From a20cbb45973ab719c248d77e638f337d116a3c4e Mon Sep 17 00:00:00 2001 From: Ricardo Devis Agullo Date: Tue, 18 Feb 2025 19:12:03 +0100 Subject: [PATCH 1/4] Add turbostream decoding for data --- package-lock.json | 639 +++++++++++++++++++++++++++++++++++++++++- package.json | 4 +- src/oc-client.js | 264 +++++++++++------ tasks/compile.js | 42 ++- vendor/turbostream.js | 4 + 5 files changed, 856 insertions(+), 97 deletions(-) create mode 100644 vendor/turbostream.js diff --git a/package-lock.json b/package-lock.json index 293fa87..ee1fcc7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,14 +1,16 @@ { "name": "oc-client-browser", - "version": "1.7.0", + "version": "1.9.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "oc-client-browser", - "version": "1.7.0", + "version": "1.9.5", "license": "MIT", "dependencies": { + "esbuild": "^0.25.0", + "turbo-stream": "^2.4.1", "uglify-js": "3.14.2", "universalify": "2.0.0" }, @@ -144,6 +146,406 @@ "node": ">=4" } }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.0.tgz", + "integrity": "sha512-O7vun9Sf8DFjH2UtqK8Ku3LkquL9SZL8OLY1T5NZkA34+wG3OQF7cl4Ql8vdNzM6fzBbYfLaiRLIOZ+2FOCgBQ==", + "cpu": [ + "ppc64" + ], + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.0.tgz", + "integrity": "sha512-PTyWCYYiU0+1eJKmw21lWtC+d08JDZPQ5g+kFyxP0V+es6VPPSUhM6zk8iImp2jbV6GwjX4pap0JFbUQN65X1g==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.0.tgz", + "integrity": "sha512-grvv8WncGjDSyUBjN9yHXNt+cq0snxXbDxy5pJtzMKGmmpPxeAmAhWxXI+01lU5rwZomDgD3kJwulEnhTRUd6g==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.0.tgz", + "integrity": "sha512-m/ix7SfKG5buCnxasr52+LI78SQ+wgdENi9CqyCXwjVR2X4Jkz+BpC3le3AoBPYTC9NHklwngVXvbJ9/Akhrfg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.0.tgz", + "integrity": "sha512-mVwdUb5SRkPayVadIOI78K7aAnPamoeFR2bT5nszFUZ9P8UpK4ratOdYbZZXYSqPKMHfS1wdHCJk1P1EZpRdvw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.0.tgz", + "integrity": "sha512-DgDaYsPWFTS4S3nWpFcMn/33ZZwAAeAFKNHNa1QN0rI4pUjgqf0f7ONmXf6d22tqTY+H9FNdgeaAa+YIFUn2Rg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.0.tgz", + "integrity": "sha512-VN4ocxy6dxefN1MepBx/iD1dH5K8qNtNe227I0mnTRjry8tj5MRk4zprLEdG8WPyAPb93/e4pSgi1SoHdgOa4w==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.0.tgz", + "integrity": "sha512-mrSgt7lCh07FY+hDD1TxiTyIHyttn6vnjesnPoVDNmDfOmggTLXRv8Id5fNZey1gl/V2dyVK1VXXqVsQIiAk+A==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.0.tgz", + "integrity": "sha512-vkB3IYj2IDo3g9xX7HqhPYxVkNQe8qTK55fraQyTzTX/fxaDtXiEnavv9geOsonh2Fd2RMB+i5cbhu2zMNWJwg==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.0.tgz", + "integrity": "sha512-9QAQjTWNDM/Vk2bgBl17yWuZxZNQIF0OUUuPZRKoDtqF2k4EtYbpyiG5/Dk7nqeK6kIJWPYldkOcBqjXjrUlmg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.0.tgz", + "integrity": "sha512-43ET5bHbphBegyeqLb7I1eYn2P/JYGNmzzdidq/w0T8E2SsYL1U6un2NFROFRg1JZLTzdCoRomg8Rvf9M6W6Gg==", + "cpu": [ + "ia32" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.0.tgz", + "integrity": "sha512-fC95c/xyNFueMhClxJmeRIj2yrSMdDfmqJnyOY4ZqsALkDrrKJfIg5NTMSzVBr5YW1jf+l7/cndBfP3MSDpoHw==", + "cpu": [ + "loong64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.0.tgz", + "integrity": "sha512-nkAMFju7KDW73T1DdH7glcyIptm95a7Le8irTQNO/qtkoyypZAnjchQgooFUDQhNAy4iu08N79W4T4pMBwhPwQ==", + "cpu": [ + "mips64el" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.0.tgz", + "integrity": "sha512-NhyOejdhRGS8Iwv+KKR2zTq2PpysF9XqY+Zk77vQHqNbo/PwZCzB5/h7VGuREZm1fixhs4Q/qWRSi5zmAiO4Fw==", + "cpu": [ + "ppc64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.0.tgz", + "integrity": "sha512-5S/rbP5OY+GHLC5qXp1y/Mx//e92L1YDqkiBbO9TQOvuFXM+iDqUNG5XopAnXoRH3FjIUDkeGcY1cgNvnXp/kA==", + "cpu": [ + "riscv64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.0.tgz", + "integrity": "sha512-XM2BFsEBz0Fw37V0zU4CXfcfuACMrppsMFKdYY2WuTS3yi8O1nFOhil/xhKTmE1nPmVyvQJjJivgDT+xh8pXJA==", + "cpu": [ + "s390x" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.0.tgz", + "integrity": "sha512-9yl91rHw/cpwMCNytUDxwj2XjFpxML0y9HAOH9pNVQDpQrBxHy01Dx+vaMu0N1CKa/RzBD2hB4u//nfc+Sd3Cw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.0.tgz", + "integrity": "sha512-RuG4PSMPFfrkH6UwCAqBzauBWTygTvb1nxWasEJooGSJ/NwRw7b2HOwyRTQIU97Hq37l3npXoZGYMy3b3xYvPw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.0.tgz", + "integrity": "sha512-jl+qisSB5jk01N5f7sPCsBENCOlPiS/xptD5yxOx2oqQfyourJwIKLRA2yqWdifj3owQZCL2sn6o08dBzZGQzA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.0.tgz", + "integrity": "sha512-21sUNbq2r84YE+SJDfaQRvdgznTD8Xc0oc3p3iW/a1EVWeNj/SdUCbm5U0itZPQYRuRTW20fPMWMpcrciH2EJw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.0.tgz", + "integrity": "sha512-2gwwriSMPcCFRlPlKx3zLQhfN/2WjJ2NSlg5TKLQOJdV0mSxIcYNTMhk3H3ulL/cak+Xj0lY1Ym9ysDV1igceg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.0.tgz", + "integrity": "sha512-bxI7ThgLzPrPz484/S9jLlvUAHYMzy6I0XiU1ZMeAEOBcS0VePBFxh1JjTQt3Xiat5b6Oh4x7UC7IwKQKIJRIg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.0.tgz", + "integrity": "sha512-ZUAc2YK6JW89xTbXvftxdnYy3m4iHIkDtK3CLce8wg8M2L+YZhIvO1DKpxrd0Yr59AeNNkTiic9YLf6FTtXWMw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.0.tgz", + "integrity": "sha512-eSNxISBu8XweVEWG31/JzjkIGbGIJN/TrRoiSVZwZ6pkC6VX4Im/WV2cz559/TXLcYbcrDN8JtKgd9DJVIo8GA==", + "cpu": [ + "ia32" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.0.tgz", + "integrity": "sha512-ZENoHJBxA20C2zFzh6AI4fT6RraMzjYw4xKWemRTRmRVtN9c5DcH9r/f2ihEkMjOW5eGgrwCslG/+Y/3bL+DHQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, "node_modules/@eslint/eslintrc": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.1.tgz", @@ -1605,6 +2007,46 @@ "es6-promise": "^4.0.3" } }, + "node_modules/esbuild": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.0.tgz", + "integrity": "sha512-BXq5mqc8ltbaN34cDqWuYKyNhX8D/Z0J1xdtdQ8UcIIIyJyz+ZMKUt58tF3SrZ85jcfN/PZYhjR5uDQAYNVbuw==", + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.25.0", + "@esbuild/android-arm": "0.25.0", + "@esbuild/android-arm64": "0.25.0", + "@esbuild/android-x64": "0.25.0", + "@esbuild/darwin-arm64": "0.25.0", + "@esbuild/darwin-x64": "0.25.0", + "@esbuild/freebsd-arm64": "0.25.0", + "@esbuild/freebsd-x64": "0.25.0", + "@esbuild/linux-arm": "0.25.0", + "@esbuild/linux-arm64": "0.25.0", + "@esbuild/linux-ia32": "0.25.0", + "@esbuild/linux-loong64": "0.25.0", + "@esbuild/linux-mips64el": "0.25.0", + "@esbuild/linux-ppc64": "0.25.0", + "@esbuild/linux-riscv64": "0.25.0", + "@esbuild/linux-s390x": "0.25.0", + "@esbuild/linux-x64": "0.25.0", + "@esbuild/netbsd-arm64": "0.25.0", + "@esbuild/netbsd-x64": "0.25.0", + "@esbuild/openbsd-arm64": "0.25.0", + "@esbuild/openbsd-x64": "0.25.0", + "@esbuild/sunos-x64": "0.25.0", + "@esbuild/win32-arm64": "0.25.0", + "@esbuild/win32-ia32": "0.25.0", + "@esbuild/win32-x64": "0.25.0" + } + }, "node_modules/escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", @@ -5374,6 +5816,12 @@ "node": "*" } }, + "node_modules/turbo-stream": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/turbo-stream/-/turbo-stream-2.4.1.tgz", + "integrity": "sha512-v8kOJXpG3WoTN/+at8vK7erSzo6nW6CIaeOvNOkHQVDajfz1ZVeSxCbc6tOH4hrGZW7VUCV0TOXd8CPzYnYkrw==", + "license": "ISC" + }, "node_modules/tweetnacl": { "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", @@ -5947,6 +6395,156 @@ } } }, + "@esbuild/aix-ppc64": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.0.tgz", + "integrity": "sha512-O7vun9Sf8DFjH2UtqK8Ku3LkquL9SZL8OLY1T5NZkA34+wG3OQF7cl4Ql8vdNzM6fzBbYfLaiRLIOZ+2FOCgBQ==", + "optional": true + }, + "@esbuild/android-arm": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.0.tgz", + "integrity": "sha512-PTyWCYYiU0+1eJKmw21lWtC+d08JDZPQ5g+kFyxP0V+es6VPPSUhM6zk8iImp2jbV6GwjX4pap0JFbUQN65X1g==", + "optional": true + }, + "@esbuild/android-arm64": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.0.tgz", + "integrity": "sha512-grvv8WncGjDSyUBjN9yHXNt+cq0snxXbDxy5pJtzMKGmmpPxeAmAhWxXI+01lU5rwZomDgD3kJwulEnhTRUd6g==", + "optional": true + }, + "@esbuild/android-x64": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.0.tgz", + "integrity": "sha512-m/ix7SfKG5buCnxasr52+LI78SQ+wgdENi9CqyCXwjVR2X4Jkz+BpC3le3AoBPYTC9NHklwngVXvbJ9/Akhrfg==", + "optional": true + }, + "@esbuild/darwin-arm64": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.0.tgz", + "integrity": "sha512-mVwdUb5SRkPayVadIOI78K7aAnPamoeFR2bT5nszFUZ9P8UpK4ratOdYbZZXYSqPKMHfS1wdHCJk1P1EZpRdvw==", + "optional": true + }, + "@esbuild/darwin-x64": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.0.tgz", + "integrity": "sha512-DgDaYsPWFTS4S3nWpFcMn/33ZZwAAeAFKNHNa1QN0rI4pUjgqf0f7ONmXf6d22tqTY+H9FNdgeaAa+YIFUn2Rg==", + "optional": true + }, + "@esbuild/freebsd-arm64": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.0.tgz", + "integrity": "sha512-VN4ocxy6dxefN1MepBx/iD1dH5K8qNtNe227I0mnTRjry8tj5MRk4zprLEdG8WPyAPb93/e4pSgi1SoHdgOa4w==", + "optional": true + }, + "@esbuild/freebsd-x64": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.0.tgz", + "integrity": "sha512-mrSgt7lCh07FY+hDD1TxiTyIHyttn6vnjesnPoVDNmDfOmggTLXRv8Id5fNZey1gl/V2dyVK1VXXqVsQIiAk+A==", + "optional": true + }, + "@esbuild/linux-arm": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.0.tgz", + "integrity": "sha512-vkB3IYj2IDo3g9xX7HqhPYxVkNQe8qTK55fraQyTzTX/fxaDtXiEnavv9geOsonh2Fd2RMB+i5cbhu2zMNWJwg==", + "optional": true + }, + "@esbuild/linux-arm64": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.0.tgz", + "integrity": "sha512-9QAQjTWNDM/Vk2bgBl17yWuZxZNQIF0OUUuPZRKoDtqF2k4EtYbpyiG5/Dk7nqeK6kIJWPYldkOcBqjXjrUlmg==", + "optional": true + }, + "@esbuild/linux-ia32": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.0.tgz", + "integrity": "sha512-43ET5bHbphBegyeqLb7I1eYn2P/JYGNmzzdidq/w0T8E2SsYL1U6un2NFROFRg1JZLTzdCoRomg8Rvf9M6W6Gg==", + "optional": true + }, + "@esbuild/linux-loong64": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.0.tgz", + "integrity": "sha512-fC95c/xyNFueMhClxJmeRIj2yrSMdDfmqJnyOY4ZqsALkDrrKJfIg5NTMSzVBr5YW1jf+l7/cndBfP3MSDpoHw==", + "optional": true + }, + "@esbuild/linux-mips64el": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.0.tgz", + "integrity": "sha512-nkAMFju7KDW73T1DdH7glcyIptm95a7Le8irTQNO/qtkoyypZAnjchQgooFUDQhNAy4iu08N79W4T4pMBwhPwQ==", + "optional": true + }, + "@esbuild/linux-ppc64": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.0.tgz", + "integrity": "sha512-NhyOejdhRGS8Iwv+KKR2zTq2PpysF9XqY+Zk77vQHqNbo/PwZCzB5/h7VGuREZm1fixhs4Q/qWRSi5zmAiO4Fw==", + "optional": true + }, + "@esbuild/linux-riscv64": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.0.tgz", + "integrity": "sha512-5S/rbP5OY+GHLC5qXp1y/Mx//e92L1YDqkiBbO9TQOvuFXM+iDqUNG5XopAnXoRH3FjIUDkeGcY1cgNvnXp/kA==", + "optional": true + }, + "@esbuild/linux-s390x": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.0.tgz", + "integrity": "sha512-XM2BFsEBz0Fw37V0zU4CXfcfuACMrppsMFKdYY2WuTS3yi8O1nFOhil/xhKTmE1nPmVyvQJjJivgDT+xh8pXJA==", + "optional": true + }, + "@esbuild/linux-x64": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.0.tgz", + "integrity": "sha512-9yl91rHw/cpwMCNytUDxwj2XjFpxML0y9HAOH9pNVQDpQrBxHy01Dx+vaMu0N1CKa/RzBD2hB4u//nfc+Sd3Cw==", + "optional": true + }, + "@esbuild/netbsd-arm64": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.0.tgz", + "integrity": "sha512-RuG4PSMPFfrkH6UwCAqBzauBWTygTvb1nxWasEJooGSJ/NwRw7b2HOwyRTQIU97Hq37l3npXoZGYMy3b3xYvPw==", + "optional": true + }, + "@esbuild/netbsd-x64": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.0.tgz", + "integrity": "sha512-jl+qisSB5jk01N5f7sPCsBENCOlPiS/xptD5yxOx2oqQfyourJwIKLRA2yqWdifj3owQZCL2sn6o08dBzZGQzA==", + "optional": true + }, + "@esbuild/openbsd-arm64": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.0.tgz", + "integrity": "sha512-21sUNbq2r84YE+SJDfaQRvdgznTD8Xc0oc3p3iW/a1EVWeNj/SdUCbm5U0itZPQYRuRTW20fPMWMpcrciH2EJw==", + "optional": true + }, + "@esbuild/openbsd-x64": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.0.tgz", + "integrity": "sha512-2gwwriSMPcCFRlPlKx3zLQhfN/2WjJ2NSlg5TKLQOJdV0mSxIcYNTMhk3H3ulL/cak+Xj0lY1Ym9ysDV1igceg==", + "optional": true + }, + "@esbuild/sunos-x64": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.0.tgz", + "integrity": "sha512-bxI7ThgLzPrPz484/S9jLlvUAHYMzy6I0XiU1ZMeAEOBcS0VePBFxh1JjTQt3Xiat5b6Oh4x7UC7IwKQKIJRIg==", + "optional": true + }, + "@esbuild/win32-arm64": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.0.tgz", + "integrity": "sha512-ZUAc2YK6JW89xTbXvftxdnYy3m4iHIkDtK3CLce8wg8M2L+YZhIvO1DKpxrd0Yr59AeNNkTiic9YLf6FTtXWMw==", + "optional": true + }, + "@esbuild/win32-ia32": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.0.tgz", + "integrity": "sha512-eSNxISBu8XweVEWG31/JzjkIGbGIJN/TrRoiSVZwZ6pkC6VX4Im/WV2cz559/TXLcYbcrDN8JtKgd9DJVIo8GA==", + "optional": true + }, + "@esbuild/win32-x64": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.0.tgz", + "integrity": "sha512-ZENoHJBxA20C2zFzh6AI4fT6RraMzjYw4xKWemRTRmRVtN9c5DcH9r/f2ihEkMjOW5eGgrwCslG/+Y/3bL+DHQ==", + "optional": true + }, "@eslint/eslintrc": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.1.tgz", @@ -7064,6 +7662,38 @@ "es6-promise": "^4.0.3" } }, + "esbuild": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.0.tgz", + "integrity": "sha512-BXq5mqc8ltbaN34cDqWuYKyNhX8D/Z0J1xdtdQ8UcIIIyJyz+ZMKUt58tF3SrZ85jcfN/PZYhjR5uDQAYNVbuw==", + "requires": { + "@esbuild/aix-ppc64": "0.25.0", + "@esbuild/android-arm": "0.25.0", + "@esbuild/android-arm64": "0.25.0", + "@esbuild/android-x64": "0.25.0", + "@esbuild/darwin-arm64": "0.25.0", + "@esbuild/darwin-x64": "0.25.0", + "@esbuild/freebsd-arm64": "0.25.0", + "@esbuild/freebsd-x64": "0.25.0", + "@esbuild/linux-arm": "0.25.0", + "@esbuild/linux-arm64": "0.25.0", + "@esbuild/linux-ia32": "0.25.0", + "@esbuild/linux-loong64": "0.25.0", + "@esbuild/linux-mips64el": "0.25.0", + "@esbuild/linux-ppc64": "0.25.0", + "@esbuild/linux-riscv64": "0.25.0", + "@esbuild/linux-s390x": "0.25.0", + "@esbuild/linux-x64": "0.25.0", + "@esbuild/netbsd-arm64": "0.25.0", + "@esbuild/netbsd-x64": "0.25.0", + "@esbuild/openbsd-arm64": "0.25.0", + "@esbuild/openbsd-x64": "0.25.0", + "@esbuild/sunos-x64": "0.25.0", + "@esbuild/win32-arm64": "0.25.0", + "@esbuild/win32-ia32": "0.25.0", + "@esbuild/win32-x64": "0.25.0" + } + }, "escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", @@ -9968,6 +10598,11 @@ "safe-buffer": "^5.0.1" } }, + "turbo-stream": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/turbo-stream/-/turbo-stream-2.4.1.tgz", + "integrity": "sha512-v8kOJXpG3WoTN/+at8vK7erSzo6nW6CIaeOvNOkHQVDajfz1ZVeSxCbc6tOH4hrGZW7VUCV0TOXd8CPzYnYkrw==" + }, "tweetnacl": { "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", diff --git a/package.json b/package.json index 4286bac..877fc61 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,9 @@ "typescript": "4.4.4" }, "dependencies": { + "esbuild": "^0.25.0", + "turbo-stream": "^2.4.1", "uglify-js": "3.14.2", "universalify": "2.0.0" } -} \ No newline at end of file +} diff --git a/src/oc-client.js b/src/oc-client.js index 7567202..0a81682 100644 --- a/src/oc-client.js +++ b/src/oc-client.js @@ -65,7 +65,58 @@ var oc = oc || {}; }; // constants - var RETRY_INTERVAL = ocConf.retryInterval || __DEFAULT_RETRY_INTERVAL__, + var IS_FETCH_AVAILABLE = typeof fetch === 'function', + handleResponseCallback = function (apiResponse, callback) { + var response = apiResponse[0].response; + var err = response.error ? response.details || response.error : null; + callback(err, response.data, apiResponse[0]); + }, + handleTemplateCallback = function ( + apiResponse, + ocId, + id, + element, + callback + ) { + var template = apiResponse.template; + apiResponse.data.id = ocId; + apiResponse.data.element = element; + oc.render(template, apiResponse.data, function (err, html) { + if (err) { + callback( + interpolate(MESSAGES_ERRORS_RENDERING, apiResponse.href) + err + ); + } else { + logInfo(interpolate(MESSAGES_RENDERED, template.src)); + callback(null, { + id: id, + ocId: ocId, + html: html, + baseUrl: apiResponse.baseUrl, + key: template.key, + version: apiResponse.version, + name: apiResponse.name + }); + } + }); + }, + handleFetchError = function (err, href, retryFn, failedFn) { + if (err && err.status == 429) { + retries[href] = 0; + } + logError(MESSAGES_ERRORS_RETRIEVING); + retry(href, retryFn, failedFn); + }, + handleFetchResponse = function (response) { + if (!response.ok) throw response; + if (response.headers.get('Content-Type') !== 'x-text/stream') + return response.json(); + + return oc._decode(response.body).then(function (decoded) { + return decoded.value; + }); + }, + RETRY_INTERVAL = ocConf.retryInterval || __DEFAULT_RETRY_INTERVAL__, RETRY_LIMIT = ocConf.retryLimit || __DEFAULT_RETRY_LIMIT__, DISABLE_LOADER = isBool(ocConf.disableLoader) ? ocConf.disableLoader @@ -242,42 +293,71 @@ var oc = oc || {}; function getData(options, cb) { cb = cb || noop; var version = options.version, - baseUrl = options.baseUrl, name = options.name, - json = options.json; + json = options.json, + baseUrl = options.baseUrl; + if (options.action) { + baseUrl = + baseUrl + + '~actions/' + + options.action + + '/' + + options.name + + '/' + + options.version || ''; + } isRequired('version', version); isRequired('baseUrl', baseUrl); isRequired('name', name); + var parameters = $.extend({}, ocConf.globalParameters, options.parameters); var jsonRequest = isBool(json) ? json : JSON_REQUESTS; - var data = { - components: [ - { - action: options.action, - name: name, - version: version, - parameters: $.extend({}, ocConf.globalParameters, options.parameters) - } - ] - }; + var data = options.action + ? parameters + : { + components: [ + { + action: options.action, + name: name, + version: version, + parameters: parameters + } + ] + }; var headers = getHeaders(); - var ajaxOptions = { - method: 'POST', - url: baseUrl, - data: jsonRequest ? JSON.stringify(data) : data, - headers: headers, - crossDomain: true, - success: function (apiResponse) { - var response = apiResponse[0].response; - var err = response.error ? response.details || response.error : null; - cb(err, response.data, apiResponse[0]); - }, - error: cb - }; if (jsonRequest) { headers['Content-Type'] = 'application/json'; } - $.ajax(ajaxOptions); + if (IS_FETCH_AVAILABLE) { + fetch(baseUrl, { + method: 'POST', + headers: headers, + body: jsonRequest ? JSON.stringify(data) : $.param(data) + // credentials: 'include' + }) + .then(handleFetchResponse) + .then(function (apiResponse) { + if (!options.action) { + handleResponseCallback(apiResponse, cb); + } else { + cb(null, apiResponse.data); + } + }) + .catch(cb); + } else { + var ajaxOptions = { + method: 'POST', + url: baseUrl, + data: jsonRequest ? JSON.stringify(data) : data, + headers: headers, + crossDomain: true, + success: function (apiResponse) { + handleResponseCallback(apiResponse, cb); + }, + error: cb + }; + $.ajax(ajaxOptions); + } } oc.getData = getData; oc.getAction = function (options) { @@ -508,65 +588,81 @@ var oc = oc || {}; if (!href) { callback(MESSAGES_ERRORS_RENDERING + MESSAGES_ERRORS_HREF_MISSING); } else { - $.ajax({ - url: addParametersToHref( - href, - $.extend( - {}, - ocConf.globalParameters, - RETRY_SEND_NUMBER && { __oc_Retry: retryNumber } - ) - ), - headers: getHeaders(), - contentType: 'text/plain', - crossDomain: true, - success: function (apiResponse) { - var template = apiResponse.template; - apiResponse.data.id = ocId; - apiResponse.data.element = element; - oc.render(template, apiResponse.data, function (err, html) { - if (err) { - callback( - interpolate(MESSAGES_ERRORS_RENDERING, apiResponse.href) + err - ); - } else { - logInfo(interpolate(MESSAGES_RENDERED, template.src)); - callback(null, { - id: id, - ocId: ocId, - html: html, - baseUrl: apiResponse.baseUrl, - key: template.key, - version: apiResponse.version, - name: apiResponse.name - }); - } + var url = addParametersToHref( + href, + $.extend( + {}, + ocConf.globalParameters, + RETRY_SEND_NUMBER && { __oc_Retry: retryNumber } + ) + ); + var headers = getHeaders(); + var contentType = 'text/plain'; + headers['Content-Type'] = contentType; + + if (IS_FETCH_AVAILABLE) { + fetch(url, { + headers: headers + // credentials: 'include' + }) + .then(handleFetchResponse) + .then(function (apiResponse) { + handleTemplateCallback(apiResponse, ocId, id, element, callback); + }) + .catch(function (err) { + handleFetchError( + err, + href, + function (requestNumber) { + oc.renderByHref( + { + href: href, + retryNumber: requestNumber, + id: id, + element: element + }, + callback + ); + }, + function () { + callback(interpolate(MESSAGES_ERRORS_RETRY_FAILED, href)); + } + ); }); - }, - error: function (err) { - if (err && err.status == 429) { - retries[href] = 0; - } - logError(MESSAGES_ERRORS_RETRIEVING); - retry( - href, - function (requestNumber) { - oc.renderByHref( - { - href: href, - retryNumber: requestNumber, - id: id, - element: element - }, - callback - ); - }, - function () { - callback(interpolate(MESSAGES_ERRORS_RETRY_FAILED, href)); + } else { + $.ajax({ + url: url, + headers: headers, + contentType: contentType, + crossDomain: true, + success: function (apiResponse) { + handleTemplateCallback(apiResponse, ocId, id, element, callback); + }, + error: function (err) { + if (err && err.status == 429) { + retries[href] = 0; } - ); - } - }); + logError(MESSAGES_ERRORS_RETRIEVING); + retry( + href, + function (requestNumber) { + oc.renderByHref( + { + href: href, + retryNumber: requestNumber, + id: id, + element: element + }, + callback + ); + }, + function () { + callback(interpolate(MESSAGES_ERRORS_RETRY_FAILED, href)); + } + ); + } + }); + } } }); }; diff --git a/tasks/compile.js b/tasks/compile.js index d699ee6..dd05571 100644 --- a/tasks/compile.js +++ b/tasks/compile.js @@ -4,6 +4,7 @@ const fs = require('fs'); const { promisify } = require('util'); const path = require('path'); const uglifyJs = require('uglify-js'); +const esbuild = require('esbuild'); const readFile = promisify(fs.readFile); const packageJson = require('../package'); @@ -93,24 +94,42 @@ function getFiles({ sync = false, conf }) { if (sync) { const l = fs.readFileSync(lPath, 'utf-8'); const ocClient = replaceGlobals(fs.readFileSync(ocClientPath, 'utf-8')); - - return [l, ocClient]; + const { + outputFiles: [turboStream] + } = esbuild.buildSync({ + entryPoints: [path.join(__dirname, vendorPath, 'turbostream.js')], + format: 'iife', + write: false, + bundle: true, + minify: false + }); + + return [turboStream.text, l, ocClient]; } else { const lPromise = readFile(lPath, 'utf-8'); const ocClientPromise = readFile(ocClientPath, 'utf-8').then( replaceGlobals ); - - return Promise.all([lPromise, ocClientPromise]); + const turboStreamPromise = esbuild + .build({ + entryPoints: [path.join(__dirname, vendorPath, 'turbostream.js')], + format: 'iife', + write: false, + bundle: true, + minify: false + }) + .then(x => x.outputFiles[0].text); + + return Promise.all([turboStreamPromise, lPromise, ocClientPromise]); } } -function compileFiles(l, ocClient) { +function compileFiles(turboStream, l, ocClient) { const version = packageJson.version; const licenseLink = 'https://github.com/opencomponents/oc-client-browser/tree/master/LICENSES'; const license = `/*! OpenComponents client v${version} | (c) 2015-${new Date().getFullYear()} OpenComponents community | ${licenseLink} */`; - const bundle = `${license}\n${l}\n;\n${ocClient}\n;\noc.clientVersion='${version}';`; + const bundle = `${license}\n${turboStream}\n;\n${l}\n;\n${ocClient}\n;\noc.clientVersion='${version}';`; const compressed = uglifyJs.minify(bundle, { sourceMap: { @@ -126,14 +145,17 @@ function compileFiles(l, ocClient) { async function compile(conf = {}) { const parsedConf = parseConf(conf); - const [l, ocClient] = await getFiles({ sync: false, conf: parsedConf }); - return compileFiles(l, ocClient); + const [turboStream, l, ocClient] = await getFiles({ + sync: false, + conf: parsedConf + }); + return compileFiles(turboStream, l, ocClient); } function compileSync(conf = {}) { const parsedConf = parseConf(conf); - const [l, ocClient] = getFiles({ sync: true, conf: parsedConf }); - return compileFiles(l, ocClient); + const [turboStream, l, ocClient] = getFiles({ sync: true, conf: parsedConf }); + return compileFiles(turboStream, l, ocClient); } module.exports = { diff --git a/vendor/turbostream.js b/vendor/turbostream.js new file mode 100644 index 0000000..f9b38af --- /dev/null +++ b/vendor/turbostream.js @@ -0,0 +1,4 @@ +import { decode } from 'turbo-stream'; + +window.oc = window.oc || {}; +window.oc._decode = decode; From ef0c02e9dfcb2b88ad6d682b07947c4cae5ff917 Mon Sep 17 00:00:00 2001 From: Ricardo Devis Agullo Date: Tue, 18 Feb 2025 19:13:33 +0100 Subject: [PATCH 2/4] update pkg --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 877fc61..23c762a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "oc-client-browser", - "version": "1.9.5", + "version": "1.10.0", "description": "OC browser client", "main": "index.js", "types": "index.d.ts", @@ -80,4 +80,4 @@ "uglify-js": "3.14.2", "universalify": "2.0.0" } -} +} \ No newline at end of file From 41b596f684c8d8fdd120c4d0f6343f802ee72c3f Mon Sep 17 00:00:00 2001 From: Ricardo Devis Agullo Date: Thu, 27 Feb 2025 15:08:26 +0100 Subject: [PATCH 3/4] add turbo compiled --- package-lock.json | 627 +--------------------------------------------- package.json | 3 +- tasks/compile.js | 42 +--- vendor/turbo.js | 2 + 4 files changed, 18 insertions(+), 656 deletions(-) create mode 100644 vendor/turbo.js diff --git a/package-lock.json b/package-lock.json index ee1fcc7..58ecb6e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,14 @@ { "name": "oc-client-browser", - "version": "1.9.5", + "version": "1.10.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "oc-client-browser", - "version": "1.9.5", + "version": "1.10.0", "license": "MIT", "dependencies": { - "esbuild": "^0.25.0", "turbo-stream": "^2.4.1", "uglify-js": "3.14.2", "universalify": "2.0.0" @@ -146,406 +145,6 @@ "node": ">=4" } }, - "node_modules/@esbuild/aix-ppc64": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.0.tgz", - "integrity": "sha512-O7vun9Sf8DFjH2UtqK8Ku3LkquL9SZL8OLY1T5NZkA34+wG3OQF7cl4Ql8vdNzM6fzBbYfLaiRLIOZ+2FOCgBQ==", - "cpu": [ - "ppc64" - ], - "license": "MIT", - "optional": true, - "os": [ - "aix" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-arm": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.0.tgz", - "integrity": "sha512-PTyWCYYiU0+1eJKmw21lWtC+d08JDZPQ5g+kFyxP0V+es6VPPSUhM6zk8iImp2jbV6GwjX4pap0JFbUQN65X1g==", - "cpu": [ - "arm" - ], - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-arm64": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.0.tgz", - "integrity": "sha512-grvv8WncGjDSyUBjN9yHXNt+cq0snxXbDxy5pJtzMKGmmpPxeAmAhWxXI+01lU5rwZomDgD3kJwulEnhTRUd6g==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-x64": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.0.tgz", - "integrity": "sha512-m/ix7SfKG5buCnxasr52+LI78SQ+wgdENi9CqyCXwjVR2X4Jkz+BpC3le3AoBPYTC9NHklwngVXvbJ9/Akhrfg==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/darwin-arm64": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.0.tgz", - "integrity": "sha512-mVwdUb5SRkPayVadIOI78K7aAnPamoeFR2bT5nszFUZ9P8UpK4ratOdYbZZXYSqPKMHfS1wdHCJk1P1EZpRdvw==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/darwin-x64": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.0.tgz", - "integrity": "sha512-DgDaYsPWFTS4S3nWpFcMn/33ZZwAAeAFKNHNa1QN0rI4pUjgqf0f7ONmXf6d22tqTY+H9FNdgeaAa+YIFUn2Rg==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/freebsd-arm64": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.0.tgz", - "integrity": "sha512-VN4ocxy6dxefN1MepBx/iD1dH5K8qNtNe227I0mnTRjry8tj5MRk4zprLEdG8WPyAPb93/e4pSgi1SoHdgOa4w==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/freebsd-x64": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.0.tgz", - "integrity": "sha512-mrSgt7lCh07FY+hDD1TxiTyIHyttn6vnjesnPoVDNmDfOmggTLXRv8Id5fNZey1gl/V2dyVK1VXXqVsQIiAk+A==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-arm": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.0.tgz", - "integrity": "sha512-vkB3IYj2IDo3g9xX7HqhPYxVkNQe8qTK55fraQyTzTX/fxaDtXiEnavv9geOsonh2Fd2RMB+i5cbhu2zMNWJwg==", - "cpu": [ - "arm" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-arm64": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.0.tgz", - "integrity": "sha512-9QAQjTWNDM/Vk2bgBl17yWuZxZNQIF0OUUuPZRKoDtqF2k4EtYbpyiG5/Dk7nqeK6kIJWPYldkOcBqjXjrUlmg==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-ia32": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.0.tgz", - "integrity": "sha512-43ET5bHbphBegyeqLb7I1eYn2P/JYGNmzzdidq/w0T8E2SsYL1U6un2NFROFRg1JZLTzdCoRomg8Rvf9M6W6Gg==", - "cpu": [ - "ia32" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-loong64": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.0.tgz", - "integrity": "sha512-fC95c/xyNFueMhClxJmeRIj2yrSMdDfmqJnyOY4ZqsALkDrrKJfIg5NTMSzVBr5YW1jf+l7/cndBfP3MSDpoHw==", - "cpu": [ - "loong64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-mips64el": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.0.tgz", - "integrity": "sha512-nkAMFju7KDW73T1DdH7glcyIptm95a7Le8irTQNO/qtkoyypZAnjchQgooFUDQhNAy4iu08N79W4T4pMBwhPwQ==", - "cpu": [ - "mips64el" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-ppc64": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.0.tgz", - "integrity": "sha512-NhyOejdhRGS8Iwv+KKR2zTq2PpysF9XqY+Zk77vQHqNbo/PwZCzB5/h7VGuREZm1fixhs4Q/qWRSi5zmAiO4Fw==", - "cpu": [ - "ppc64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-riscv64": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.0.tgz", - "integrity": "sha512-5S/rbP5OY+GHLC5qXp1y/Mx//e92L1YDqkiBbO9TQOvuFXM+iDqUNG5XopAnXoRH3FjIUDkeGcY1cgNvnXp/kA==", - "cpu": [ - "riscv64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-s390x": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.0.tgz", - "integrity": "sha512-XM2BFsEBz0Fw37V0zU4CXfcfuACMrppsMFKdYY2WuTS3yi8O1nFOhil/xhKTmE1nPmVyvQJjJivgDT+xh8pXJA==", - "cpu": [ - "s390x" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-x64": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.0.tgz", - "integrity": "sha512-9yl91rHw/cpwMCNytUDxwj2XjFpxML0y9HAOH9pNVQDpQrBxHy01Dx+vaMu0N1CKa/RzBD2hB4u//nfc+Sd3Cw==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/netbsd-arm64": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.0.tgz", - "integrity": "sha512-RuG4PSMPFfrkH6UwCAqBzauBWTygTvb1nxWasEJooGSJ/NwRw7b2HOwyRTQIU97Hq37l3npXoZGYMy3b3xYvPw==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/netbsd-x64": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.0.tgz", - "integrity": "sha512-jl+qisSB5jk01N5f7sPCsBENCOlPiS/xptD5yxOx2oqQfyourJwIKLRA2yqWdifj3owQZCL2sn6o08dBzZGQzA==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openbsd-arm64": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.0.tgz", - "integrity": "sha512-21sUNbq2r84YE+SJDfaQRvdgznTD8Xc0oc3p3iW/a1EVWeNj/SdUCbm5U0itZPQYRuRTW20fPMWMpcrciH2EJw==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openbsd-x64": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.0.tgz", - "integrity": "sha512-2gwwriSMPcCFRlPlKx3zLQhfN/2WjJ2NSlg5TKLQOJdV0mSxIcYNTMhk3H3ulL/cak+Xj0lY1Ym9ysDV1igceg==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/sunos-x64": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.0.tgz", - "integrity": "sha512-bxI7ThgLzPrPz484/S9jLlvUAHYMzy6I0XiU1ZMeAEOBcS0VePBFxh1JjTQt3Xiat5b6Oh4x7UC7IwKQKIJRIg==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-arm64": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.0.tgz", - "integrity": "sha512-ZUAc2YK6JW89xTbXvftxdnYy3m4iHIkDtK3CLce8wg8M2L+YZhIvO1DKpxrd0Yr59AeNNkTiic9YLf6FTtXWMw==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-ia32": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.0.tgz", - "integrity": "sha512-eSNxISBu8XweVEWG31/JzjkIGbGIJN/TrRoiSVZwZ6pkC6VX4Im/WV2cz559/TXLcYbcrDN8JtKgd9DJVIo8GA==", - "cpu": [ - "ia32" - ], - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-x64": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.0.tgz", - "integrity": "sha512-ZENoHJBxA20C2zFzh6AI4fT6RraMzjYw4xKWemRTRmRVtN9c5DcH9r/f2ihEkMjOW5eGgrwCslG/+Y/3bL+DHQ==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, "node_modules/@eslint/eslintrc": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.1.tgz", @@ -2007,46 +1606,6 @@ "es6-promise": "^4.0.3" } }, - "node_modules/esbuild": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.0.tgz", - "integrity": "sha512-BXq5mqc8ltbaN34cDqWuYKyNhX8D/Z0J1xdtdQ8UcIIIyJyz+ZMKUt58tF3SrZ85jcfN/PZYhjR5uDQAYNVbuw==", - "hasInstallScript": true, - "license": "MIT", - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=18" - }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.25.0", - "@esbuild/android-arm": "0.25.0", - "@esbuild/android-arm64": "0.25.0", - "@esbuild/android-x64": "0.25.0", - "@esbuild/darwin-arm64": "0.25.0", - "@esbuild/darwin-x64": "0.25.0", - "@esbuild/freebsd-arm64": "0.25.0", - "@esbuild/freebsd-x64": "0.25.0", - "@esbuild/linux-arm": "0.25.0", - "@esbuild/linux-arm64": "0.25.0", - "@esbuild/linux-ia32": "0.25.0", - "@esbuild/linux-loong64": "0.25.0", - "@esbuild/linux-mips64el": "0.25.0", - "@esbuild/linux-ppc64": "0.25.0", - "@esbuild/linux-riscv64": "0.25.0", - "@esbuild/linux-s390x": "0.25.0", - "@esbuild/linux-x64": "0.25.0", - "@esbuild/netbsd-arm64": "0.25.0", - "@esbuild/netbsd-x64": "0.25.0", - "@esbuild/openbsd-arm64": "0.25.0", - "@esbuild/openbsd-x64": "0.25.0", - "@esbuild/sunos-x64": "0.25.0", - "@esbuild/win32-arm64": "0.25.0", - "@esbuild/win32-ia32": "0.25.0", - "@esbuild/win32-x64": "0.25.0" - } - }, "node_modules/escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", @@ -6395,156 +5954,6 @@ } } }, - "@esbuild/aix-ppc64": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.0.tgz", - "integrity": "sha512-O7vun9Sf8DFjH2UtqK8Ku3LkquL9SZL8OLY1T5NZkA34+wG3OQF7cl4Ql8vdNzM6fzBbYfLaiRLIOZ+2FOCgBQ==", - "optional": true - }, - "@esbuild/android-arm": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.0.tgz", - "integrity": "sha512-PTyWCYYiU0+1eJKmw21lWtC+d08JDZPQ5g+kFyxP0V+es6VPPSUhM6zk8iImp2jbV6GwjX4pap0JFbUQN65X1g==", - "optional": true - }, - "@esbuild/android-arm64": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.0.tgz", - "integrity": "sha512-grvv8WncGjDSyUBjN9yHXNt+cq0snxXbDxy5pJtzMKGmmpPxeAmAhWxXI+01lU5rwZomDgD3kJwulEnhTRUd6g==", - "optional": true - }, - "@esbuild/android-x64": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.0.tgz", - "integrity": "sha512-m/ix7SfKG5buCnxasr52+LI78SQ+wgdENi9CqyCXwjVR2X4Jkz+BpC3le3AoBPYTC9NHklwngVXvbJ9/Akhrfg==", - "optional": true - }, - "@esbuild/darwin-arm64": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.0.tgz", - "integrity": "sha512-mVwdUb5SRkPayVadIOI78K7aAnPamoeFR2bT5nszFUZ9P8UpK4ratOdYbZZXYSqPKMHfS1wdHCJk1P1EZpRdvw==", - "optional": true - }, - "@esbuild/darwin-x64": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.0.tgz", - "integrity": "sha512-DgDaYsPWFTS4S3nWpFcMn/33ZZwAAeAFKNHNa1QN0rI4pUjgqf0f7ONmXf6d22tqTY+H9FNdgeaAa+YIFUn2Rg==", - "optional": true - }, - "@esbuild/freebsd-arm64": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.0.tgz", - "integrity": "sha512-VN4ocxy6dxefN1MepBx/iD1dH5K8qNtNe227I0mnTRjry8tj5MRk4zprLEdG8WPyAPb93/e4pSgi1SoHdgOa4w==", - "optional": true - }, - "@esbuild/freebsd-x64": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.0.tgz", - "integrity": "sha512-mrSgt7lCh07FY+hDD1TxiTyIHyttn6vnjesnPoVDNmDfOmggTLXRv8Id5fNZey1gl/V2dyVK1VXXqVsQIiAk+A==", - "optional": true - }, - "@esbuild/linux-arm": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.0.tgz", - "integrity": "sha512-vkB3IYj2IDo3g9xX7HqhPYxVkNQe8qTK55fraQyTzTX/fxaDtXiEnavv9geOsonh2Fd2RMB+i5cbhu2zMNWJwg==", - "optional": true - }, - "@esbuild/linux-arm64": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.0.tgz", - "integrity": "sha512-9QAQjTWNDM/Vk2bgBl17yWuZxZNQIF0OUUuPZRKoDtqF2k4EtYbpyiG5/Dk7nqeK6kIJWPYldkOcBqjXjrUlmg==", - "optional": true - }, - "@esbuild/linux-ia32": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.0.tgz", - "integrity": "sha512-43ET5bHbphBegyeqLb7I1eYn2P/JYGNmzzdidq/w0T8E2SsYL1U6un2NFROFRg1JZLTzdCoRomg8Rvf9M6W6Gg==", - "optional": true - }, - "@esbuild/linux-loong64": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.0.tgz", - "integrity": "sha512-fC95c/xyNFueMhClxJmeRIj2yrSMdDfmqJnyOY4ZqsALkDrrKJfIg5NTMSzVBr5YW1jf+l7/cndBfP3MSDpoHw==", - "optional": true - }, - "@esbuild/linux-mips64el": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.0.tgz", - "integrity": "sha512-nkAMFju7KDW73T1DdH7glcyIptm95a7Le8irTQNO/qtkoyypZAnjchQgooFUDQhNAy4iu08N79W4T4pMBwhPwQ==", - "optional": true - }, - "@esbuild/linux-ppc64": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.0.tgz", - "integrity": "sha512-NhyOejdhRGS8Iwv+KKR2zTq2PpysF9XqY+Zk77vQHqNbo/PwZCzB5/h7VGuREZm1fixhs4Q/qWRSi5zmAiO4Fw==", - "optional": true - }, - "@esbuild/linux-riscv64": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.0.tgz", - "integrity": "sha512-5S/rbP5OY+GHLC5qXp1y/Mx//e92L1YDqkiBbO9TQOvuFXM+iDqUNG5XopAnXoRH3FjIUDkeGcY1cgNvnXp/kA==", - "optional": true - }, - "@esbuild/linux-s390x": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.0.tgz", - "integrity": "sha512-XM2BFsEBz0Fw37V0zU4CXfcfuACMrppsMFKdYY2WuTS3yi8O1nFOhil/xhKTmE1nPmVyvQJjJivgDT+xh8pXJA==", - "optional": true - }, - "@esbuild/linux-x64": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.0.tgz", - "integrity": "sha512-9yl91rHw/cpwMCNytUDxwj2XjFpxML0y9HAOH9pNVQDpQrBxHy01Dx+vaMu0N1CKa/RzBD2hB4u//nfc+Sd3Cw==", - "optional": true - }, - "@esbuild/netbsd-arm64": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.0.tgz", - "integrity": "sha512-RuG4PSMPFfrkH6UwCAqBzauBWTygTvb1nxWasEJooGSJ/NwRw7b2HOwyRTQIU97Hq37l3npXoZGYMy3b3xYvPw==", - "optional": true - }, - "@esbuild/netbsd-x64": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.0.tgz", - "integrity": "sha512-jl+qisSB5jk01N5f7sPCsBENCOlPiS/xptD5yxOx2oqQfyourJwIKLRA2yqWdifj3owQZCL2sn6o08dBzZGQzA==", - "optional": true - }, - "@esbuild/openbsd-arm64": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.0.tgz", - "integrity": "sha512-21sUNbq2r84YE+SJDfaQRvdgznTD8Xc0oc3p3iW/a1EVWeNj/SdUCbm5U0itZPQYRuRTW20fPMWMpcrciH2EJw==", - "optional": true - }, - "@esbuild/openbsd-x64": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.0.tgz", - "integrity": "sha512-2gwwriSMPcCFRlPlKx3zLQhfN/2WjJ2NSlg5TKLQOJdV0mSxIcYNTMhk3H3ulL/cak+Xj0lY1Ym9ysDV1igceg==", - "optional": true - }, - "@esbuild/sunos-x64": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.0.tgz", - "integrity": "sha512-bxI7ThgLzPrPz484/S9jLlvUAHYMzy6I0XiU1ZMeAEOBcS0VePBFxh1JjTQt3Xiat5b6Oh4x7UC7IwKQKIJRIg==", - "optional": true - }, - "@esbuild/win32-arm64": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.0.tgz", - "integrity": "sha512-ZUAc2YK6JW89xTbXvftxdnYy3m4iHIkDtK3CLce8wg8M2L+YZhIvO1DKpxrd0Yr59AeNNkTiic9YLf6FTtXWMw==", - "optional": true - }, - "@esbuild/win32-ia32": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.0.tgz", - "integrity": "sha512-eSNxISBu8XweVEWG31/JzjkIGbGIJN/TrRoiSVZwZ6pkC6VX4Im/WV2cz559/TXLcYbcrDN8JtKgd9DJVIo8GA==", - "optional": true - }, - "@esbuild/win32-x64": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.0.tgz", - "integrity": "sha512-ZENoHJBxA20C2zFzh6AI4fT6RraMzjYw4xKWemRTRmRVtN9c5DcH9r/f2ihEkMjOW5eGgrwCslG/+Y/3bL+DHQ==", - "optional": true - }, "@eslint/eslintrc": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.1.tgz", @@ -7662,38 +7071,6 @@ "es6-promise": "^4.0.3" } }, - "esbuild": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.0.tgz", - "integrity": "sha512-BXq5mqc8ltbaN34cDqWuYKyNhX8D/Z0J1xdtdQ8UcIIIyJyz+ZMKUt58tF3SrZ85jcfN/PZYhjR5uDQAYNVbuw==", - "requires": { - "@esbuild/aix-ppc64": "0.25.0", - "@esbuild/android-arm": "0.25.0", - "@esbuild/android-arm64": "0.25.0", - "@esbuild/android-x64": "0.25.0", - "@esbuild/darwin-arm64": "0.25.0", - "@esbuild/darwin-x64": "0.25.0", - "@esbuild/freebsd-arm64": "0.25.0", - "@esbuild/freebsd-x64": "0.25.0", - "@esbuild/linux-arm": "0.25.0", - "@esbuild/linux-arm64": "0.25.0", - "@esbuild/linux-ia32": "0.25.0", - "@esbuild/linux-loong64": "0.25.0", - "@esbuild/linux-mips64el": "0.25.0", - "@esbuild/linux-ppc64": "0.25.0", - "@esbuild/linux-riscv64": "0.25.0", - "@esbuild/linux-s390x": "0.25.0", - "@esbuild/linux-x64": "0.25.0", - "@esbuild/netbsd-arm64": "0.25.0", - "@esbuild/netbsd-x64": "0.25.0", - "@esbuild/openbsd-arm64": "0.25.0", - "@esbuild/openbsd-x64": "0.25.0", - "@esbuild/sunos-x64": "0.25.0", - "@esbuild/win32-arm64": "0.25.0", - "@esbuild/win32-ia32": "0.25.0", - "@esbuild/win32-x64": "0.25.0" - } - }, "escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", diff --git a/package.json b/package.json index 23c762a..44ef0e0 100644 --- a/package.json +++ b/package.json @@ -75,9 +75,8 @@ "typescript": "4.4.4" }, "dependencies": { - "esbuild": "^0.25.0", "turbo-stream": "^2.4.1", "uglify-js": "3.14.2", "universalify": "2.0.0" } -} \ No newline at end of file +} diff --git a/tasks/compile.js b/tasks/compile.js index dd05571..36847a4 100644 --- a/tasks/compile.js +++ b/tasks/compile.js @@ -4,7 +4,6 @@ const fs = require('fs'); const { promisify } = require('util'); const path = require('path'); const uglifyJs = require('uglify-js'); -const esbuild = require('esbuild'); const readFile = promisify(fs.readFile); const packageJson = require('../package'); @@ -78,6 +77,7 @@ function getFiles({ sync = false, conf }) { const vendorPath = '../vendor/'; const lPath = path.join(__dirname, vendorPath, 'l.js'); + const turboPath = path.join(__dirname, vendorPath, 'turbo.js'); const ocClientPath = path.join(__dirname, srcPath, 'oc-client.js'); const replaceGlobals = x => x @@ -93,43 +93,27 @@ function getFiles({ sync = false, conf }) { if (sync) { const l = fs.readFileSync(lPath, 'utf-8'); + const turbo = fs.readFileSync(turboPath, 'utf-8'); const ocClient = replaceGlobals(fs.readFileSync(ocClientPath, 'utf-8')); - const { - outputFiles: [turboStream] - } = esbuild.buildSync({ - entryPoints: [path.join(__dirname, vendorPath, 'turbostream.js')], - format: 'iife', - write: false, - bundle: true, - minify: false - }); - - return [turboStream.text, l, ocClient]; + + return [l, ocClient, turbo]; } else { const lPromise = readFile(lPath, 'utf-8'); + const turboPromise = readFile(turboPath, 'utf-8'); const ocClientPromise = readFile(ocClientPath, 'utf-8').then( replaceGlobals ); - const turboStreamPromise = esbuild - .build({ - entryPoints: [path.join(__dirname, vendorPath, 'turbostream.js')], - format: 'iife', - write: false, - bundle: true, - minify: false - }) - .then(x => x.outputFiles[0].text); - - return Promise.all([turboStreamPromise, lPromise, ocClientPromise]); + + return Promise.all([lPromise, ocClientPromise, turboPromise]); } } -function compileFiles(turboStream, l, ocClient) { +function compileFiles(l, ocClient, turbo) { const version = packageJson.version; const licenseLink = 'https://github.com/opencomponents/oc-client-browser/tree/master/LICENSES'; const license = `/*! OpenComponents client v${version} | (c) 2015-${new Date().getFullYear()} OpenComponents community | ${licenseLink} */`; - const bundle = `${license}\n${turboStream}\n;\n${l}\n;\n${ocClient}\n;\noc.clientVersion='${version}';`; + const bundle = `${license}\n${turbo}\n;\n${l}\n;\n${ocClient}\n;\noc.clientVersion='${version}';`; const compressed = uglifyJs.minify(bundle, { sourceMap: { @@ -145,17 +129,17 @@ function compileFiles(turboStream, l, ocClient) { async function compile(conf = {}) { const parsedConf = parseConf(conf); - const [turboStream, l, ocClient] = await getFiles({ + const [l, ocClient, turbo] = await getFiles({ sync: false, conf: parsedConf }); - return compileFiles(turboStream, l, ocClient); + return compileFiles(l, ocClient, turbo); } function compileSync(conf = {}) { const parsedConf = parseConf(conf); - const [turboStream, l, ocClient] = getFiles({ sync: true, conf: parsedConf }); - return compileFiles(turboStream, l, ocClient); + const [l, ocClient, turbo] = getFiles({ sync: true, conf: parsedConf }); + return compileFiles(l, ocClient, turbo); } module.exports = { diff --git a/vendor/turbo.js b/vendor/turbo.js new file mode 100644 index 0000000..40f3759 --- /dev/null +++ b/vendor/turbo.js @@ -0,0 +1,2 @@ +!function(){var e={};function r(e,r,n,t,o,a,i){try{var c=e[a](i),u=c.value}catch(e){n(e);return}c.done?r(u):Promise.resolve(u).then(t,o)}function n(e){return function(){var n=this,t=arguments;return new Promise(function(o,a){var i=e.apply(n,t);function c(e){r(i,o,a,c,u,"next",e)}function u(e){r(i,o,a,c,u,"throw",e)}c(void 0)})}}function t(e){if(Array.isArray(e))return e}function o(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(e,r){(null==r||r>e.length)&&(r=e.length);for(var n=0,t=Array(r);n0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]0;){var f=c(l.pop(),2),s=f[0],h=f[1],p=function(e){return Object.keys(e).map(function(r){return'"_'.concat(v.call(n,r),'":').concat(v.call(n,e[r]))}).join(",")},T=null;switch(void 0===s?"undefined":u(s)){case"boolean":case"number":case"string":i[h]=JSON.stringify(s);break;case"bigint":i[h]='["'.concat(E.TYPE_BIGINT,'","').concat(s,'"]');break;case"symbol":var P=Symbol.keyFor(s);P?i[h]='["'.concat(E.TYPE_SYMBOL,'",').concat(JSON.stringify(P),"]"):T=Error("Cannot encode symbol unless created with Symbol.for()");break;case"object":if(!s){i[h]="".concat(E.NULL);break}var O=Array.isArray(s),S=!1,_=!0,N=!1,I=void 0;if(!O&&o)try{for(var m,g=o[Symbol.iterator]();!(_=(m=g.next()).done);_=!0){var w=(0,m.value)(s);if(Array.isArray(w)){S=!0;var Y=d(w),R=Y[0],A=Y.slice(1);i[h]="[".concat(JSON.stringify(R)),A.length>0&&(i[h]+=",".concat(A.map(function(e){return v.call(n,e)}).join(","))),i[h]+="]";break}}}catch(e){N=!0,I=e}finally{try{_||null==g.return||g.return()}finally{if(N)throw I}}if(!S){var j=O?"[":"{";if(O){for(var L=0;L0?i[h]='["'.concat(E.TYPE_SET,'",').concat(y(s).map(function(e){return v.call(n,e)}).join(","),"]"):i[h]='["'.concat(E.TYPE_SET,'"]'):s instanceof Map?s.size>0?i[h]='["'.concat(E.TYPE_MAP,'",').concat(y(s).flatMap(function(e){var r=c(e,2),t=r[0],o=r[1];return[v.call(n,t),v.call(n,o)]}).join(","),"]"):i[h]='["'.concat(E.TYPE_MAP,'"]'):s instanceof Promise?(i[h]='["'.concat(E.TYPE_PROMISE,'",').concat(h,"]"),t[h]=s):s instanceof Error?(i[h]='["'.concat(E.TYPE_ERROR,'",').concat(JSON.stringify(s.message)),"Error"!==s.name&&(i[h]+=",".concat(JSON.stringify(s.name))),i[h]+="]"):null===Object.getPrototypeOf(s)?i[h]='["'.concat(E.TYPE_NULL_OBJECT,'",{').concat(p(s),"}]"):function(e){var r=Object.getPrototypeOf(e);return r===Object.prototype||null===r||Object.getOwnPropertyNames(r).sort().join("\0")===b}(s)?i[h]="{".concat(p(s),"}"):T=Error("Cannot encode object with prototype")}break;default:var x=Array.isArray(s),D=!1,M=!0,U=!1,V=void 0;if(!x&&o)try{for(var k,G=o[Symbol.iterator]();!(M=(k=G.next()).done);M=!0){var J=(0,k.value)(s);if(Array.isArray(J)){D=!0;var F=d(J),B=F[0],q=F.slice(1);i[h]="[".concat(JSON.stringify(B)),q.length>0&&(i[h]+=",".concat(q.map(function(e){return v.call(n,e)}).join(","))),i[h]+="]";break}}}catch(e){U=!0,V=e}finally{try{M||null==G.return||G.return()}finally{if(U)throw V}}D||(T=Error("Cannot encode function or unexpected type"))}if(T){var C=!1,Z=!0,H=!1,X=void 0;if(a)try{for(var z,W=a[Symbol.iterator]();!(Z=(z=W.next()).done);Z=!0){var $=(0,z.value)(s);if(Array.isArray($)){C=!0;var K=d($),Q=K[0],ee=K.slice(1);i[h]="[".concat(JSON.stringify(Q)),ee.length>0&&(i[h]+=",".concat(ee.map(function(e){return v.call(n,e)}).join(","))),i[h]+="]";break}}}catch(e){H=!0,X=e}finally{try{Z||null==W.return||W.return()}finally{if(H)throw X}}if(!C)throw T}}}Object.defineProperty(E,"__esModule",{value:!0}),E.createLineSplittingTransform=E.Deferred=E.TYPE_PREVIOUS_RESOLVED=E.TYPE_URL=E.TYPE_SYMBOL=E.TYPE_SET=E.TYPE_REGEXP=E.TYPE_PROMISE=E.TYPE_NULL_OBJECT=E.TYPE_MAP=E.TYPE_ERROR=E.TYPE_DATE=E.TYPE_BIGINT=E.UNDEFINED=E.POSITIVE_INFINITY=E.NULL=E.NEGATIVE_ZERO=E.NEGATIVE_INFINITY=E.NAN=E.HOLE=void 0,E.HOLE=-1,E.NAN=-2,E.NEGATIVE_INFINITY=-3,E.NEGATIVE_ZERO=-4,E.NULL=-5,E.POSITIVE_INFINITY=-6,E.UNDEFINED=-7,E.TYPE_BIGINT="B",E.TYPE_DATE="D",E.TYPE_ERROR="E",E.TYPE_MAP="M",E.TYPE_NULL_OBJECT="N",E.TYPE_PROMISE="P",E.TYPE_REGEXP="R",E.TYPE_SET="S",E.TYPE_SYMBOL="Y",E.TYPE_URL="U",E.TYPE_PREVIOUS_RESOLVED="Z",E.Deferred=function e(){var r=this;!function(e,r){if(!(e instanceof r))throw TypeError("Cannot call a class as a function")}(this,e),h(this,"promise",void 0),h(this,"resolve",void 0),h(this,"reject",void 0),this.promise=new Promise(function(e,n){r.resolve=e,r.reject=n})},E.createLineSplittingTransform=function(){var e=new TextDecoder,r="";return new TransformStream({transform:function(n,t){var o=e.decode(n,{stream:!0}),a=(r+o).split("\n");r=a.pop()||"";var i=!0,c=!1,u=void 0;try{for(var l,f=a[Symbol.iterator]();!(i=(l=f.next()).done);i=!0){var s=l.value;t.enqueue(s)}}catch(e){c=!0,u=e}finally{try{i||null==f.return||f.return()}finally{if(c)throw u}}},flush:function(e){r&&e.enqueue(r)}})},f.flatten=v;var b=Object.getOwnPropertyNames(Object.prototype).sort().join("\0"),T={};Object.defineProperty(T,"__esModule",{value:!0}),T.unflatten=void 0;var P="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:void 0;function O(e){for(var r,n=this.hydrated,t=this.values,o=this.deferred,a=this.plugins,i=[[e,function(e){r=e}]],l=[];i.length>0;)!function(){var e=c(i.pop(),2),r=e[0],f=e[1];switch(r){case E.UNDEFINED:return f(void 0);case E.NULL:return f(null);case E.NAN:return f(NaN);case E.POSITIVE_INFINITY:return f(1/0);case E.NEGATIVE_INFINITY:return f(-1/0);case E.NEGATIVE_ZERO:return f(-0)}if(n[r])return f(n[r]);var s=t[r];if(!s||(void 0===s?"undefined":u(s))!=="object")return n[r]=s,f(s);if(Array.isArray(s)){if("string"==typeof s[0]){var d=c(s,3),h=d[0],v=d[1],p=d[2];switch(h){case E.TYPE_DATE:return f(n[r]=new Date(v));case E.TYPE_URL:return f(n[r]=new URL(v));case E.TYPE_BIGINT:return f(n[r]=BigInt(v));case E.TYPE_REGEXP:return f(n[r]=new RegExp(v,p));case E.TYPE_SYMBOL:return f(n[r]=Symbol.for(v));case E.TYPE_SET:var b=new Set;n[r]=b;for(var T=1;T0;)l.pop()();return r}function S(){return(S=n(function(e,r){var n,t,o,a,i,c;return l(this,function(u){switch(u.label){case 0:return n=(null!=r?r:{}).plugins,t=new E.Deferred,o=e.pipeThrough((0,E.createLineSplittingTransform)()).getReader(),[4,_.call(a={values:[],hydrated:[],deferred:{},plugins:n},o)];case 1:return i=u.sent(),c=t.promise,i.done?t.resolve():c=I.call(a,o).then(t.resolve).catch(function(e){var r=!0,n=!1,o=void 0;try{for(var i,c=Object.values(a.deferred)[Symbol.iterator]();!(r=(i=c.next()).done);r=!0)i.value.reject(e)}catch(e){n=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(n)throw o}}t.reject(e)}),[2,{done:c.then(function(){return o.closed}),value:i.value}]}})})).apply(this,arguments)}function _(e){return N.apply(this,arguments)}function N(){return(N=n(function(e){var r,n;return l(this,function(t){switch(t.label){case 0:return[4,e.read()];case 1:if(!(r=t.sent()).value)throw SyntaxError();try{n=JSON.parse(r.value)}catch(e){throw SyntaxError()}return[2,{done:r.done,value:T.unflatten.call(this,n)}]}})})).apply(this,arguments)}function I(e){return m.apply(this,arguments)}function m(){return(m=n(function(e){var r,n,t,o,a,i,c,u,f,s,d,y,h,v;return l(this,function(l){switch(l.label){case 0:return[4,e.read()];case 1:r=l.sent(),l.label=2;case 2:if(r.done)return[3,4];if(!r.value)return[3,2];switch((n=r.value)[0]){case E.TYPE_PROMISE:if(t=n.indexOf(":"),o=Number(n.slice(1,t)),!(a=this.deferred[o]))throw Error("Deferred ID ".concat(o," not found in stream"));i=n.slice(t+1),c=void 0;try{c=JSON.parse(i)}catch(e){throw SyntaxError()}u=T.unflatten.call(this,c),a.resolve(u);break;case E.TYPE_ERROR:if(f=n.indexOf(":"),s=Number(n.slice(1,f)),!(d=this.deferred[s]))throw Error("Deferred ID ".concat(s," not found in stream"));y=n.slice(f+1),h=void 0;try{h=JSON.parse(y)}catch(e){throw SyntaxError()}v=T.unflatten.call(this,h),d.reject(v);break;default:throw SyntaxError()}return[4,e.read()];case 3:return r=l.sent(),[3,2];case 4:return[2]}})})).apply(this,arguments)}T.unflatten=function(e){var r=this.hydrated,n=this.values;if("number"==typeof e)return O.call(this,e);if(!Array.isArray(e)||!e.length)throw SyntaxError();var t=n.length,o=!0,a=!1,i=void 0;try{for(var c,u=e[Symbol.iterator]();!(o=(c=u.next()).done);o=!0){var l=c.value;n.push(l)}}catch(e){a=!0,i=e}finally{try{o||null==u.return||u.return()}finally{if(a)throw i}}return r.length=n.length,O.call(this,t)},e.decode=function(e,r){return S.apply(this,arguments)},e.encode=function(e,r){var t=null!=r?r:{},o=t.plugins,a=t.postPlugins,i=t.signal,s={deferred:{},index:0,indices:new Map,stringified:[],plugins:o,postPlugins:a,signal:i},d=new TextEncoder,y=0;return new ReadableStream({start:function(r){return n(function(){var n,t,o,a,h,v,p,b,T,P;return l(this,function(l){switch(l.label){case 0:if(Array.isArray(n=f.flatten.call(s,e)))throw Error("This should never happen");if(n<0?r.enqueue(d.encode("".concat(n,"\n"))):(r.enqueue(d.encode("[".concat(s.stringified.join(","),"]\n"))),y=s.stringified.length-1),t=new WeakSet,!Object.keys(s.deferred).length)return[3,4];a=new Promise(function(e,r){if(o=e,i){var n=function(){return r(i.reason||Error("Signal was aborted."))};i.aborted?n():i.addEventListener("abort",function(e){n()})}}),l.label=1;case 1:if(!(Object.keys(s.deferred).length>0))return[3,3];h=!0,v=!1,p=void 0;try{for(b=function(){var e=c(P.value,2),n=e[0],o=e[1];if(t.has(o))return"continue";t.add(s.deferred[Number(n)]=Promise.race([a,o]).then(function(e){var t=f.flatten.call(s,e);if(Array.isArray(t))r.enqueue(d.encode("".concat(E.TYPE_PROMISE).concat(n,':[["').concat(E.TYPE_PREVIOUS_RESOLVED,'",').concat(t[0],"]]\n"))),s.index++,y++;else if(t<0)r.enqueue(d.encode("".concat(E.TYPE_PROMISE).concat(n,":").concat(t,"\n")));else{var o=s.stringified.slice(y+1).join(",");r.enqueue(d.encode("".concat(E.TYPE_PROMISE).concat(n,":[").concat(o,"]\n"))),y=s.stringified.length-1}},function(e){e&&(void 0===e?"undefined":u(e))==="object"&&e instanceof Error||(e=Error("An unknown error occurred"));var t=f.flatten.call(s,e);if(Array.isArray(t))r.enqueue(d.encode("".concat(E.TYPE_ERROR).concat(n,':[["').concat(E.TYPE_PREVIOUS_RESOLVED,'",').concat(t[0],"]]\n"))),s.index++,y++;else if(t<0)r.enqueue(d.encode("".concat(E.TYPE_ERROR).concat(n,":").concat(t,"\n")));else{var o=s.stringified.slice(y+1).join(",");r.enqueue(d.encode("".concat(E.TYPE_ERROR).concat(n,":[").concat(o,"]\n"))),y=s.stringified.length-1}}).finally(function(){delete s.deferred[Number(n)]}))},T=Object.entries(s.deferred)[Symbol.iterator]();!(h=(P=T.next()).done);h=!0)b()}catch(e){v=!0,p=e}finally{try{h||null==T.return||T.return()}finally{if(v)throw p}}return[4,Promise.race(Object.values(s.deferred))];case 2:return l.sent(),[3,1];case 3:o(),l.label=4;case 4:return[4,Promise.all(Object.values(s.deferred))];case 5:return l.sent(),r.close(),[2]}})})()}})},window.oc=window.oc||{},window.oc._decode=e.decode}(); +//# sourceMappingURL=turbostream.js.map From fa983a872d4e3a02d4ef199a99bb7ce3a518bebe Mon Sep 17 00:00:00 2001 From: Ricardo Devis Agullo Date: Thu, 27 Feb 2025 15:17:22 +0100 Subject: [PATCH 4/4] put turbo build --- tasks/compile.js | 2 +- vendor/turbo.js | 2 - vendor/turbostream.js | 1610 ++++++++++++++++++++++++++++++++++++++++- 3 files changed, 1609 insertions(+), 5 deletions(-) delete mode 100644 vendor/turbo.js diff --git a/tasks/compile.js b/tasks/compile.js index 36847a4..1ab315f 100644 --- a/tasks/compile.js +++ b/tasks/compile.js @@ -77,7 +77,7 @@ function getFiles({ sync = false, conf }) { const vendorPath = '../vendor/'; const lPath = path.join(__dirname, vendorPath, 'l.js'); - const turboPath = path.join(__dirname, vendorPath, 'turbo.js'); + const turboPath = path.join(__dirname, vendorPath, 'turbostream.js'); const ocClientPath = path.join(__dirname, srcPath, 'oc-client.js'); const replaceGlobals = x => x diff --git a/vendor/turbo.js b/vendor/turbo.js deleted file mode 100644 index 40f3759..0000000 --- a/vendor/turbo.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(){var e={};function r(e,r,n,t,o,a,i){try{var c=e[a](i),u=c.value}catch(e){n(e);return}c.done?r(u):Promise.resolve(u).then(t,o)}function n(e){return function(){var n=this,t=arguments;return new Promise(function(o,a){var i=e.apply(n,t);function c(e){r(i,o,a,c,u,"next",e)}function u(e){r(i,o,a,c,u,"throw",e)}c(void 0)})}}function t(e){if(Array.isArray(e))return e}function o(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(e,r){(null==r||r>e.length)&&(r=e.length);for(var n=0,t=Array(r);n0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]0;){var f=c(l.pop(),2),s=f[0],h=f[1],p=function(e){return Object.keys(e).map(function(r){return'"_'.concat(v.call(n,r),'":').concat(v.call(n,e[r]))}).join(",")},T=null;switch(void 0===s?"undefined":u(s)){case"boolean":case"number":case"string":i[h]=JSON.stringify(s);break;case"bigint":i[h]='["'.concat(E.TYPE_BIGINT,'","').concat(s,'"]');break;case"symbol":var P=Symbol.keyFor(s);P?i[h]='["'.concat(E.TYPE_SYMBOL,'",').concat(JSON.stringify(P),"]"):T=Error("Cannot encode symbol unless created with Symbol.for()");break;case"object":if(!s){i[h]="".concat(E.NULL);break}var O=Array.isArray(s),S=!1,_=!0,N=!1,I=void 0;if(!O&&o)try{for(var m,g=o[Symbol.iterator]();!(_=(m=g.next()).done);_=!0){var w=(0,m.value)(s);if(Array.isArray(w)){S=!0;var Y=d(w),R=Y[0],A=Y.slice(1);i[h]="[".concat(JSON.stringify(R)),A.length>0&&(i[h]+=",".concat(A.map(function(e){return v.call(n,e)}).join(","))),i[h]+="]";break}}}catch(e){N=!0,I=e}finally{try{_||null==g.return||g.return()}finally{if(N)throw I}}if(!S){var j=O?"[":"{";if(O){for(var L=0;L0?i[h]='["'.concat(E.TYPE_SET,'",').concat(y(s).map(function(e){return v.call(n,e)}).join(","),"]"):i[h]='["'.concat(E.TYPE_SET,'"]'):s instanceof Map?s.size>0?i[h]='["'.concat(E.TYPE_MAP,'",').concat(y(s).flatMap(function(e){var r=c(e,2),t=r[0],o=r[1];return[v.call(n,t),v.call(n,o)]}).join(","),"]"):i[h]='["'.concat(E.TYPE_MAP,'"]'):s instanceof Promise?(i[h]='["'.concat(E.TYPE_PROMISE,'",').concat(h,"]"),t[h]=s):s instanceof Error?(i[h]='["'.concat(E.TYPE_ERROR,'",').concat(JSON.stringify(s.message)),"Error"!==s.name&&(i[h]+=",".concat(JSON.stringify(s.name))),i[h]+="]"):null===Object.getPrototypeOf(s)?i[h]='["'.concat(E.TYPE_NULL_OBJECT,'",{').concat(p(s),"}]"):function(e){var r=Object.getPrototypeOf(e);return r===Object.prototype||null===r||Object.getOwnPropertyNames(r).sort().join("\0")===b}(s)?i[h]="{".concat(p(s),"}"):T=Error("Cannot encode object with prototype")}break;default:var x=Array.isArray(s),D=!1,M=!0,U=!1,V=void 0;if(!x&&o)try{for(var k,G=o[Symbol.iterator]();!(M=(k=G.next()).done);M=!0){var J=(0,k.value)(s);if(Array.isArray(J)){D=!0;var F=d(J),B=F[0],q=F.slice(1);i[h]="[".concat(JSON.stringify(B)),q.length>0&&(i[h]+=",".concat(q.map(function(e){return v.call(n,e)}).join(","))),i[h]+="]";break}}}catch(e){U=!0,V=e}finally{try{M||null==G.return||G.return()}finally{if(U)throw V}}D||(T=Error("Cannot encode function or unexpected type"))}if(T){var C=!1,Z=!0,H=!1,X=void 0;if(a)try{for(var z,W=a[Symbol.iterator]();!(Z=(z=W.next()).done);Z=!0){var $=(0,z.value)(s);if(Array.isArray($)){C=!0;var K=d($),Q=K[0],ee=K.slice(1);i[h]="[".concat(JSON.stringify(Q)),ee.length>0&&(i[h]+=",".concat(ee.map(function(e){return v.call(n,e)}).join(","))),i[h]+="]";break}}}catch(e){H=!0,X=e}finally{try{Z||null==W.return||W.return()}finally{if(H)throw X}}if(!C)throw T}}}Object.defineProperty(E,"__esModule",{value:!0}),E.createLineSplittingTransform=E.Deferred=E.TYPE_PREVIOUS_RESOLVED=E.TYPE_URL=E.TYPE_SYMBOL=E.TYPE_SET=E.TYPE_REGEXP=E.TYPE_PROMISE=E.TYPE_NULL_OBJECT=E.TYPE_MAP=E.TYPE_ERROR=E.TYPE_DATE=E.TYPE_BIGINT=E.UNDEFINED=E.POSITIVE_INFINITY=E.NULL=E.NEGATIVE_ZERO=E.NEGATIVE_INFINITY=E.NAN=E.HOLE=void 0,E.HOLE=-1,E.NAN=-2,E.NEGATIVE_INFINITY=-3,E.NEGATIVE_ZERO=-4,E.NULL=-5,E.POSITIVE_INFINITY=-6,E.UNDEFINED=-7,E.TYPE_BIGINT="B",E.TYPE_DATE="D",E.TYPE_ERROR="E",E.TYPE_MAP="M",E.TYPE_NULL_OBJECT="N",E.TYPE_PROMISE="P",E.TYPE_REGEXP="R",E.TYPE_SET="S",E.TYPE_SYMBOL="Y",E.TYPE_URL="U",E.TYPE_PREVIOUS_RESOLVED="Z",E.Deferred=function e(){var r=this;!function(e,r){if(!(e instanceof r))throw TypeError("Cannot call a class as a function")}(this,e),h(this,"promise",void 0),h(this,"resolve",void 0),h(this,"reject",void 0),this.promise=new Promise(function(e,n){r.resolve=e,r.reject=n})},E.createLineSplittingTransform=function(){var e=new TextDecoder,r="";return new TransformStream({transform:function(n,t){var o=e.decode(n,{stream:!0}),a=(r+o).split("\n");r=a.pop()||"";var i=!0,c=!1,u=void 0;try{for(var l,f=a[Symbol.iterator]();!(i=(l=f.next()).done);i=!0){var s=l.value;t.enqueue(s)}}catch(e){c=!0,u=e}finally{try{i||null==f.return||f.return()}finally{if(c)throw u}}},flush:function(e){r&&e.enqueue(r)}})},f.flatten=v;var b=Object.getOwnPropertyNames(Object.prototype).sort().join("\0"),T={};Object.defineProperty(T,"__esModule",{value:!0}),T.unflatten=void 0;var P="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:void 0;function O(e){for(var r,n=this.hydrated,t=this.values,o=this.deferred,a=this.plugins,i=[[e,function(e){r=e}]],l=[];i.length>0;)!function(){var e=c(i.pop(),2),r=e[0],f=e[1];switch(r){case E.UNDEFINED:return f(void 0);case E.NULL:return f(null);case E.NAN:return f(NaN);case E.POSITIVE_INFINITY:return f(1/0);case E.NEGATIVE_INFINITY:return f(-1/0);case E.NEGATIVE_ZERO:return f(-0)}if(n[r])return f(n[r]);var s=t[r];if(!s||(void 0===s?"undefined":u(s))!=="object")return n[r]=s,f(s);if(Array.isArray(s)){if("string"==typeof s[0]){var d=c(s,3),h=d[0],v=d[1],p=d[2];switch(h){case E.TYPE_DATE:return f(n[r]=new Date(v));case E.TYPE_URL:return f(n[r]=new URL(v));case E.TYPE_BIGINT:return f(n[r]=BigInt(v));case E.TYPE_REGEXP:return f(n[r]=new RegExp(v,p));case E.TYPE_SYMBOL:return f(n[r]=Symbol.for(v));case E.TYPE_SET:var b=new Set;n[r]=b;for(var T=1;T0;)l.pop()();return r}function S(){return(S=n(function(e,r){var n,t,o,a,i,c;return l(this,function(u){switch(u.label){case 0:return n=(null!=r?r:{}).plugins,t=new E.Deferred,o=e.pipeThrough((0,E.createLineSplittingTransform)()).getReader(),[4,_.call(a={values:[],hydrated:[],deferred:{},plugins:n},o)];case 1:return i=u.sent(),c=t.promise,i.done?t.resolve():c=I.call(a,o).then(t.resolve).catch(function(e){var r=!0,n=!1,o=void 0;try{for(var i,c=Object.values(a.deferred)[Symbol.iterator]();!(r=(i=c.next()).done);r=!0)i.value.reject(e)}catch(e){n=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(n)throw o}}t.reject(e)}),[2,{done:c.then(function(){return o.closed}),value:i.value}]}})})).apply(this,arguments)}function _(e){return N.apply(this,arguments)}function N(){return(N=n(function(e){var r,n;return l(this,function(t){switch(t.label){case 0:return[4,e.read()];case 1:if(!(r=t.sent()).value)throw SyntaxError();try{n=JSON.parse(r.value)}catch(e){throw SyntaxError()}return[2,{done:r.done,value:T.unflatten.call(this,n)}]}})})).apply(this,arguments)}function I(e){return m.apply(this,arguments)}function m(){return(m=n(function(e){var r,n,t,o,a,i,c,u,f,s,d,y,h,v;return l(this,function(l){switch(l.label){case 0:return[4,e.read()];case 1:r=l.sent(),l.label=2;case 2:if(r.done)return[3,4];if(!r.value)return[3,2];switch((n=r.value)[0]){case E.TYPE_PROMISE:if(t=n.indexOf(":"),o=Number(n.slice(1,t)),!(a=this.deferred[o]))throw Error("Deferred ID ".concat(o," not found in stream"));i=n.slice(t+1),c=void 0;try{c=JSON.parse(i)}catch(e){throw SyntaxError()}u=T.unflatten.call(this,c),a.resolve(u);break;case E.TYPE_ERROR:if(f=n.indexOf(":"),s=Number(n.slice(1,f)),!(d=this.deferred[s]))throw Error("Deferred ID ".concat(s," not found in stream"));y=n.slice(f+1),h=void 0;try{h=JSON.parse(y)}catch(e){throw SyntaxError()}v=T.unflatten.call(this,h),d.reject(v);break;default:throw SyntaxError()}return[4,e.read()];case 3:return r=l.sent(),[3,2];case 4:return[2]}})})).apply(this,arguments)}T.unflatten=function(e){var r=this.hydrated,n=this.values;if("number"==typeof e)return O.call(this,e);if(!Array.isArray(e)||!e.length)throw SyntaxError();var t=n.length,o=!0,a=!1,i=void 0;try{for(var c,u=e[Symbol.iterator]();!(o=(c=u.next()).done);o=!0){var l=c.value;n.push(l)}}catch(e){a=!0,i=e}finally{try{o||null==u.return||u.return()}finally{if(a)throw i}}return r.length=n.length,O.call(this,t)},e.decode=function(e,r){return S.apply(this,arguments)},e.encode=function(e,r){var t=null!=r?r:{},o=t.plugins,a=t.postPlugins,i=t.signal,s={deferred:{},index:0,indices:new Map,stringified:[],plugins:o,postPlugins:a,signal:i},d=new TextEncoder,y=0;return new ReadableStream({start:function(r){return n(function(){var n,t,o,a,h,v,p,b,T,P;return l(this,function(l){switch(l.label){case 0:if(Array.isArray(n=f.flatten.call(s,e)))throw Error("This should never happen");if(n<0?r.enqueue(d.encode("".concat(n,"\n"))):(r.enqueue(d.encode("[".concat(s.stringified.join(","),"]\n"))),y=s.stringified.length-1),t=new WeakSet,!Object.keys(s.deferred).length)return[3,4];a=new Promise(function(e,r){if(o=e,i){var n=function(){return r(i.reason||Error("Signal was aborted."))};i.aborted?n():i.addEventListener("abort",function(e){n()})}}),l.label=1;case 1:if(!(Object.keys(s.deferred).length>0))return[3,3];h=!0,v=!1,p=void 0;try{for(b=function(){var e=c(P.value,2),n=e[0],o=e[1];if(t.has(o))return"continue";t.add(s.deferred[Number(n)]=Promise.race([a,o]).then(function(e){var t=f.flatten.call(s,e);if(Array.isArray(t))r.enqueue(d.encode("".concat(E.TYPE_PROMISE).concat(n,':[["').concat(E.TYPE_PREVIOUS_RESOLVED,'",').concat(t[0],"]]\n"))),s.index++,y++;else if(t<0)r.enqueue(d.encode("".concat(E.TYPE_PROMISE).concat(n,":").concat(t,"\n")));else{var o=s.stringified.slice(y+1).join(",");r.enqueue(d.encode("".concat(E.TYPE_PROMISE).concat(n,":[").concat(o,"]\n"))),y=s.stringified.length-1}},function(e){e&&(void 0===e?"undefined":u(e))==="object"&&e instanceof Error||(e=Error("An unknown error occurred"));var t=f.flatten.call(s,e);if(Array.isArray(t))r.enqueue(d.encode("".concat(E.TYPE_ERROR).concat(n,':[["').concat(E.TYPE_PREVIOUS_RESOLVED,'",').concat(t[0],"]]\n"))),s.index++,y++;else if(t<0)r.enqueue(d.encode("".concat(E.TYPE_ERROR).concat(n,":").concat(t,"\n")));else{var o=s.stringified.slice(y+1).join(",");r.enqueue(d.encode("".concat(E.TYPE_ERROR).concat(n,":[").concat(o,"]\n"))),y=s.stringified.length-1}}).finally(function(){delete s.deferred[Number(n)]}))},T=Object.entries(s.deferred)[Symbol.iterator]();!(h=(P=T.next()).done);h=!0)b()}catch(e){v=!0,p=e}finally{try{h||null==T.return||T.return()}finally{if(v)throw p}}return[4,Promise.race(Object.values(s.deferred))];case 2:return l.sent(),[3,1];case 3:o(),l.label=4;case 4:return[4,Promise.all(Object.values(s.deferred))];case 5:return l.sent(),r.close(),[2]}})})()}})},window.oc=window.oc||{},window.oc._decode=e.decode}(); -//# sourceMappingURL=turbostream.js.map diff --git a/vendor/turbostream.js b/vendor/turbostream.js index f9b38af..c178bfc 100644 --- a/vendor/turbostream.js +++ b/vendor/turbostream.js @@ -1,4 +1,1610 @@ -import { decode } from 'turbo-stream'; +(function () { +var $8038ee37bf9c868b$exports = {}; +function $d1e9370853ff8484$var$asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { + try { + var info = gen[key](arg); + var value = info.value; + } catch (error) { + reject(error); + return; + } + if (info.done) resolve(value); + else Promise.resolve(value).then(_next, _throw); +} +function $d1e9370853ff8484$export$71511d61b312f219(fn) { + return function() { + var self = this, args = arguments; + return new Promise(function(resolve, reject) { + var gen = fn.apply(self, args); + function _next(value) { + $d1e9370853ff8484$var$asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); + } + function _throw(err) { + $d1e9370853ff8484$var$asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); + } + _next(undefined); + }); + }; +} + + +function $f6164edf053e4083$export$71511d61b312f219(arr) { + if (Array.isArray(arr)) return arr; +} + + +function $6dec4ce864e0eaa6$export$71511d61b312f219(arr, i) { + var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; + if (_i == null) return; + var _arr = []; + var _n = true; + var _d = false; + var _s, _e; + try { + for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){ + _arr.push(_s.value); + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally{ + try { + if (!_n && _i["return"] != null) _i["return"](); + } finally{ + if (_d) throw _e; + } + } + return _arr; +} + + +function $092fde99d32800e5$export$71511d61b312f219() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} + + +function $36ca941bce93f1c7$export$71511d61b312f219(arr, len) { + if (len == null || len > arr.length) len = arr.length; + for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i]; + return arr2; +} + + +function $cfc31108d06efd09$export$71511d61b312f219(o, minLen) { + if (!o) return; + if (typeof o === "string") return (0, $36ca941bce93f1c7$export$71511d61b312f219)(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(n); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return (0, $36ca941bce93f1c7$export$71511d61b312f219)(o, minLen); +} + + +function $e3406d20bd91f5ca$export$71511d61b312f219(arr, i) { + return (0, $f6164edf053e4083$export$71511d61b312f219)(arr) || (0, $6dec4ce864e0eaa6$export$71511d61b312f219)(arr, i) || (0, $cfc31108d06efd09$export$71511d61b312f219)(arr, i) || (0, $092fde99d32800e5$export$71511d61b312f219)(); +} + + +function $bddf2f8f9387a36f$export$71511d61b312f219(obj) { + "@swc/helpers - typeof"; + return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj; +} + + +/****************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */ +var $3d92a16ff8bdcfc3$var$extendStatics = function extendStatics1(d, b) { + $3d92a16ff8bdcfc3$var$extendStatics = Object.setPrototypeOf || ({ + __proto__: [] + }) instanceof Array && function(d, b) { + d.__proto__ = b; + } || function(d, b) { + for(var p in b)if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; + }; + return $3d92a16ff8bdcfc3$var$extendStatics(d, b); +}; +function $3d92a16ff8bdcfc3$export$a8ba968b8961cb8a(d, b) { + if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + $3d92a16ff8bdcfc3$var$extendStatics(d, b); + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} +var $3d92a16ff8bdcfc3$export$18ce0697a983be9b = function __assign1() { + $3d92a16ff8bdcfc3$export$18ce0697a983be9b = Object.assign || function __assign(t) { + for(var s, i = 1, n = arguments.length; i < n; i++){ + s = arguments[i]; + for(var p in s)if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + return $3d92a16ff8bdcfc3$export$18ce0697a983be9b.apply(this, arguments); +}; +function $3d92a16ff8bdcfc3$export$3c9a16f847548506(s, e) { + var t = {}; + for(var p in s)if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") { + for(var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++)if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; + } + return t; +} +function $3d92a16ff8bdcfc3$export$29e00dfd3077644b(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if ((typeof Reflect === "undefined" ? "undefined" : (0, $bddf2f8f9387a36f$export$71511d61b312f219)(Reflect)) === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +} +function $3d92a16ff8bdcfc3$export$d5ad3fd78186038f(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +} +function $3d92a16ff8bdcfc3$export$3a84e1ae4e97e9b0(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + function accept(f) { + if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); + return f; + } + var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; + var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; + var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); + var _, done = false; + for(var i = decorators.length - 1; i >= 0; i--){ + var context = {}; + for(var p in contextIn)context[p] = p === "access" ? {} : contextIn[p]; + for(var p in contextIn.access)context.access[p] = contextIn.access[p]; + context.addInitializer = function(f) { + if (done) throw new TypeError("Cannot add initializers after decoration has completed"); + extraInitializers.push(accept(f || null)); + }; + var result = (0, decorators[i])(kind === "accessor" ? { + get: descriptor.get, + set: descriptor.set + } : descriptor[key], context); + if (kind === "accessor") { + if (result === void 0) continue; + if (result === null || (typeof result === "undefined" ? "undefined" : (0, $bddf2f8f9387a36f$export$71511d61b312f219)(result)) !== "object") throw new TypeError("Object expected"); + if (_ = accept(result.get)) descriptor.get = _; + if (_ = accept(result.set)) descriptor.set = _; + if (_ = accept(result.init)) initializers.unshift(_); + } else if (_ = accept(result)) { + if (kind === "field") initializers.unshift(_); + else descriptor[key] = _; + } + } + if (target) Object.defineProperty(target, contextIn.name, descriptor); + done = true; +} +function $3d92a16ff8bdcfc3$export$d831c04e792af3d(thisArg, initializers, value) { + var useValue = arguments.length > 2; + for(var i = 0; i < initializers.length; i++)value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); + return useValue ? value : void 0; +} +function $3d92a16ff8bdcfc3$export$6a2a36740a146cb8(x) { + return (typeof x === "undefined" ? "undefined" : (0, $bddf2f8f9387a36f$export$71511d61b312f219)(x)) === "symbol" ? x : "".concat(x); +} +function $3d92a16ff8bdcfc3$export$d1a06452d3489bc7(f, name, prefix) { + if ((typeof name === "undefined" ? "undefined" : (0, $bddf2f8f9387a36f$export$71511d61b312f219)(name)) === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; + return Object.defineProperty(f, "name", { + configurable: true, + value: prefix ? "".concat(prefix, " ", name) : name + }); +} +function $3d92a16ff8bdcfc3$export$f1db080c865becb9(metadataKey, metadataValue) { + if ((typeof Reflect === "undefined" ? "undefined" : (0, $bddf2f8f9387a36f$export$71511d61b312f219)(Reflect)) === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); +} +function $3d92a16ff8bdcfc3$export$1050f835b63b671e(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} +function $3d92a16ff8bdcfc3$export$67ebef60e6f28a6(thisArg, body) { + var _ = { + label: 0, + sent: function sent() { + if (t[0] & 1) throw t[1]; + return t[1]; + }, + trys: [], + ops: [] + }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); + return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { + return this; + }), g; + function verb(n) { + return function(v) { + return step([ + n, + v + ]); + }; + } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while(g && (g = 0, op[0] && (_ = 0)), _)try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [ + op[0] & 2, + t.value + ]; + switch(op[0]){ + case 0: + case 1: + t = op; + break; + case 4: + _.label++; + return { + value: op[1], + done: false + }; + case 5: + _.label++; + y = op[1]; + op = [ + 0 + ]; + continue; + case 7: + op = _.ops.pop(); + _.trys.pop(); + continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _ = 0; + continue; + } + if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { + _.label = op[1]; + break; + } + if (op[0] === 6 && _.label < t[1]) { + _.label = t[1]; + t = op; + break; + } + if (t && _.label < t[2]) { + _.label = t[2]; + _.ops.push(op); + break; + } + if (t[2]) _.ops.pop(); + _.trys.pop(); + continue; + } + op = body.call(thisArg, _); + } catch (e) { + op = [ + 6, + e + ]; + y = 0; + } finally{ + f = t = 0; + } + if (op[0] & 5) throw op[1]; + return { + value: op[0] ? op[1] : void 0, + done: true + }; + } +} +var $3d92a16ff8bdcfc3$export$45d3717a4c69092e = Object.create ? function __createBinding(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = { + enumerable: true, + get: function get() { + return m[k]; + } + }; + Object.defineProperty(o, k2, desc); +} : function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +}; +function $3d92a16ff8bdcfc3$export$f33643c0debef087(m, o) { + for(var p in m)if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) $3d92a16ff8bdcfc3$export$45d3717a4c69092e(o, m, p); +} +function $3d92a16ff8bdcfc3$export$19a8beecd37a4c45(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function next() { + if (o && i >= o.length) o = void 0; + return { + value: o && o[i++], + done: !o + }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +} +function $3d92a16ff8bdcfc3$export$8d051b38c9118094(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while((n === void 0 || n-- > 0) && !(r = i.next()).done)ar.push(r.value); + } catch (error) { + e = { + error: error + }; + } finally{ + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } finally{ + if (e) throw e.error; + } + } + return ar; +} +function $3d92a16ff8bdcfc3$export$afc72e2116322959() { + for(var ar = [], i = 0; i < arguments.length; i++)ar = ar.concat($3d92a16ff8bdcfc3$export$8d051b38c9118094(arguments[i])); + return ar; +} +function $3d92a16ff8bdcfc3$export$6388937ca91ccae8() { + for(var s = 0, i = 0, il = arguments.length; i < il; i++)s += arguments[i].length; + for(var r = Array(s), k = 0, i = 0; i < il; i++)for(var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)r[k] = a[j]; + return r; +} +function $3d92a16ff8bdcfc3$export$1216008129fb82ed(to, from, pack) { + if (pack || arguments.length === 2) { + for(var i = 0, l = from.length, ar; i < l; i++)if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +} +function $3d92a16ff8bdcfc3$export$10c90e4f7922046c(v) { + return this instanceof $3d92a16ff8bdcfc3$export$10c90e4f7922046c ? (this.v = v, this) : new $3d92a16ff8bdcfc3$export$10c90e4f7922046c(v); +} +function $3d92a16ff8bdcfc3$export$e427f37a30a4de9b(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function() { + return this; + }, i; + function awaitReturn(f) { + return function(v) { + return Promise.resolve(v).then(f, reject); + }; + } + function verb(n, f) { + if (g[n]) { + i[n] = function(v) { + return new Promise(function(a, b) { + q.push([ + n, + v, + a, + b + ]) > 1 || resume(n, v); + }); + }; + if (f) i[n] = f(i[n]); + } + } + function resume(n, v) { + try { + step(g[n](v)); + } catch (e) { + settle(q[0][3], e); + } + } + function step(r) { + r.value instanceof $3d92a16ff8bdcfc3$export$10c90e4f7922046c ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); + } + function fulfill(value) { + resume("next", value); + } + function reject(value) { + resume("throw", value); + } + function settle(f, v) { + if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); + } +} +function $3d92a16ff8bdcfc3$export$bbd80228419bb833(o) { + var i, p; + return i = {}, verb("next"), verb("throw", function(e) { + throw e; + }), verb("return"), i[Symbol.iterator] = function() { + return this; + }, i; + function verb(n, f) { + i[n] = o[n] ? function(v) { + return (p = !p) ? { + value: $3d92a16ff8bdcfc3$export$10c90e4f7922046c(o[n](v)), + done: false + } : f ? f(v) : v; + } : f; + } +} +function $3d92a16ff8bdcfc3$export$e3b29a3d6162315f(o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof $3d92a16ff8bdcfc3$export$19a8beecd37a4c45 === "function" ? $3d92a16ff8bdcfc3$export$19a8beecd37a4c45(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { + return this; + }, i); + function verb(n) { + i[n] = o[n] && function(v) { + return new Promise(function(resolve, reject) { + v = o[n](v), settle(resolve, reject, v.done, v.value); + }); + }; + } + function settle(resolve, reject, d, v) { + Promise.resolve(v).then(function(v) { + resolve({ + value: v, + done: d + }); + }, reject); + } +} +function $3d92a16ff8bdcfc3$export$4fb47efe1390b86f(cooked, raw) { + if (Object.defineProperty) Object.defineProperty(cooked, "raw", { + value: raw + }); + else cooked.raw = raw; + return cooked; +} +var $3d92a16ff8bdcfc3$var$__setModuleDefault = Object.create ? function __setModuleDefault(o, v) { + Object.defineProperty(o, "default", { + enumerable: true, + value: v + }); +} : function(o, v) { + o["default"] = v; +}; +var $3d92a16ff8bdcfc3$var$ownKeys = function ownKeys1(o) { + $3d92a16ff8bdcfc3$var$ownKeys = Object.getOwnPropertyNames || function(o) { + var ar = []; + for(var k in o)if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return $3d92a16ff8bdcfc3$var$ownKeys(o); +}; +function $3d92a16ff8bdcfc3$export$c21735bcef00d192(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for(var k = $3d92a16ff8bdcfc3$var$ownKeys(mod), i = 0; i < k.length; i++)if (k[i] !== "default") $3d92a16ff8bdcfc3$export$45d3717a4c69092e(result, mod, k[i]); + } + $3d92a16ff8bdcfc3$var$__setModuleDefault(result, mod); + return result; +} +function $3d92a16ff8bdcfc3$export$da59b14a69baef04(mod) { + return mod && mod.__esModule ? mod : { + default: mod + }; +} +function $3d92a16ff8bdcfc3$export$d5dcaf168c640c35(receiver, state, kind, f) { + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); +} +function $3d92a16ff8bdcfc3$export$d40a35129aaff81f(receiver, state, value, kind, f) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value; +} +function $3d92a16ff8bdcfc3$export$81fdc39f203e4e04(state, receiver) { + if (receiver === null || (typeof receiver === "undefined" ? "undefined" : (0, $bddf2f8f9387a36f$export$71511d61b312f219)(receiver)) !== "object" && typeof receiver !== "function") throw new TypeError("Cannot use 'in' operator on non-object"); + return typeof state === "function" ? receiver === state : state.has(receiver); +} +function $3d92a16ff8bdcfc3$export$88ac25d8e944e405(env, value, async) { + if (value !== null && value !== void 0) { + if ((typeof value === "undefined" ? "undefined" : (0, $bddf2f8f9387a36f$export$71511d61b312f219)(value)) !== "object" && typeof value !== "function") throw new TypeError("Object expected."); + var dispose, inner; + if (async) { + if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); + dispose = value[Symbol.asyncDispose]; + } + if (dispose === void 0) { + if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); + dispose = value[Symbol.dispose]; + if (async) inner = dispose; + } + if (typeof dispose !== "function") throw new TypeError("Object not disposable."); + if (inner) dispose = function dispose() { + try { + inner.call(this); + } catch (e) { + return Promise.reject(e); + } + }; + env.stack.push({ + value: value, + dispose: dispose, + async: async + }); + } else if (async) env.stack.push({ + async: true + }); + return value; +} +var $3d92a16ff8bdcfc3$var$_SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function _SuppressedError(error, suppressed, message) { + var e = new Error(message); + return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; +}; +function $3d92a16ff8bdcfc3$export$8f076105dc360e92(env) { + function fail(e) { + env.error = env.hasError ? new $3d92a16ff8bdcfc3$var$_SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; + env.hasError = true; + } + var r, s = 0; + function next() { + while(r = env.stack.pop())try { + if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); + if (r.dispose) { + var result = r.dispose.call(r.value); + if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { + fail(e); + return next(); + }); + } else s |= 1; + } catch (e) { + fail(e); + } + if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); + if (env.hasError) throw env.error; + } + return next(); +} +function $3d92a16ff8bdcfc3$export$889dfb5d17574b0b(path, preserveJsx) { + if (typeof path === "string" && /^\.\.?\//.test(path)) return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) { + return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js"; + }); + return path; +} +var $3d92a16ff8bdcfc3$export$2e2bcd8739ae039 = { + __extends: $3d92a16ff8bdcfc3$export$a8ba968b8961cb8a, + __assign: $3d92a16ff8bdcfc3$export$18ce0697a983be9b, + __rest: $3d92a16ff8bdcfc3$export$3c9a16f847548506, + __decorate: $3d92a16ff8bdcfc3$export$29e00dfd3077644b, + __param: $3d92a16ff8bdcfc3$export$d5ad3fd78186038f, + __esDecorate: $3d92a16ff8bdcfc3$export$3a84e1ae4e97e9b0, + __runInitializers: $3d92a16ff8bdcfc3$export$d831c04e792af3d, + __propKey: $3d92a16ff8bdcfc3$export$6a2a36740a146cb8, + __setFunctionName: $3d92a16ff8bdcfc3$export$d1a06452d3489bc7, + __metadata: $3d92a16ff8bdcfc3$export$f1db080c865becb9, + __awaiter: $3d92a16ff8bdcfc3$export$1050f835b63b671e, + __generator: $3d92a16ff8bdcfc3$export$67ebef60e6f28a6, + __createBinding: $3d92a16ff8bdcfc3$export$45d3717a4c69092e, + __exportStar: $3d92a16ff8bdcfc3$export$f33643c0debef087, + __values: $3d92a16ff8bdcfc3$export$19a8beecd37a4c45, + __read: $3d92a16ff8bdcfc3$export$8d051b38c9118094, + __spread: $3d92a16ff8bdcfc3$export$afc72e2116322959, + __spreadArrays: $3d92a16ff8bdcfc3$export$6388937ca91ccae8, + __spreadArray: $3d92a16ff8bdcfc3$export$1216008129fb82ed, + __await: $3d92a16ff8bdcfc3$export$10c90e4f7922046c, + __asyncGenerator: $3d92a16ff8bdcfc3$export$e427f37a30a4de9b, + __asyncDelegator: $3d92a16ff8bdcfc3$export$bbd80228419bb833, + __asyncValues: $3d92a16ff8bdcfc3$export$e3b29a3d6162315f, + __makeTemplateObject: $3d92a16ff8bdcfc3$export$4fb47efe1390b86f, + __importStar: $3d92a16ff8bdcfc3$export$c21735bcef00d192, + __importDefault: $3d92a16ff8bdcfc3$export$da59b14a69baef04, + __classPrivateFieldGet: $3d92a16ff8bdcfc3$export$d5dcaf168c640c35, + __classPrivateFieldSet: $3d92a16ff8bdcfc3$export$d40a35129aaff81f, + __classPrivateFieldIn: $3d92a16ff8bdcfc3$export$81fdc39f203e4e04, + __addDisposableResource: $3d92a16ff8bdcfc3$export$88ac25d8e944e405, + __disposeResources: $3d92a16ff8bdcfc3$export$8f076105dc360e92, + __rewriteRelativeImportExtension: $3d92a16ff8bdcfc3$export$889dfb5d17574b0b +}; + + +"use strict"; +Object.defineProperty($8038ee37bf9c868b$exports, "__esModule", { + value: true +}); +$8038ee37bf9c868b$exports.encode = $8038ee37bf9c868b$exports.decode = void 0; +var $cb2299d6261abd9c$exports = {}; + + +function $b424a9abf016e439$export$71511d61b312f219(iter) { + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); +} + + + + +function $78f41d2a271c854a$export$71511d61b312f219(arr) { + return (0, $f6164edf053e4083$export$71511d61b312f219)(arr) || (0, $b424a9abf016e439$export$71511d61b312f219)(arr) || (0, $cfc31108d06efd09$export$71511d61b312f219)(arr) || (0, $092fde99d32800e5$export$71511d61b312f219)(); +} + + + +function $b84912ad86c9ce6f$export$71511d61b312f219(arr) { + if (Array.isArray(arr)) return (0, $36ca941bce93f1c7$export$71511d61b312f219)(arr); +} + + + +function $1f2ccb10d71bd45a$export$71511d61b312f219() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} + + + +function $34618e712334dec5$export$71511d61b312f219(arr) { + return (0, $b84912ad86c9ce6f$export$71511d61b312f219)(arr) || (0, $b424a9abf016e439$export$71511d61b312f219)(arr) || (0, $cfc31108d06efd09$export$71511d61b312f219)(arr) || (0, $1f2ccb10d71bd45a$export$71511d61b312f219)(); +} + + + +"use strict"; +Object.defineProperty($cb2299d6261abd9c$exports, "__esModule", { + value: true +}); +$cb2299d6261abd9c$exports.flatten = void 0; +var $65e201d365740f11$exports = {}; +function $ab3a094495a865ee$export$71511d61b312f219(instance, Constructor) { + if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); +} + + +function $a15628583efdb184$export$71511d61b312f219(obj, key, value) { + if (key in obj) Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + else obj[key] = value; + return obj; +} + + +"use strict"; +Object.defineProperty($65e201d365740f11$exports, "__esModule", { + value: true +}); +$65e201d365740f11$exports.createLineSplittingTransform = $65e201d365740f11$exports.Deferred = $65e201d365740f11$exports.TYPE_PREVIOUS_RESOLVED = $65e201d365740f11$exports.TYPE_URL = $65e201d365740f11$exports.TYPE_SYMBOL = $65e201d365740f11$exports.TYPE_SET = $65e201d365740f11$exports.TYPE_REGEXP = $65e201d365740f11$exports.TYPE_PROMISE = $65e201d365740f11$exports.TYPE_NULL_OBJECT = $65e201d365740f11$exports.TYPE_MAP = $65e201d365740f11$exports.TYPE_ERROR = $65e201d365740f11$exports.TYPE_DATE = $65e201d365740f11$exports.TYPE_BIGINT = $65e201d365740f11$exports.UNDEFINED = $65e201d365740f11$exports.POSITIVE_INFINITY = $65e201d365740f11$exports.NULL = $65e201d365740f11$exports.NEGATIVE_ZERO = $65e201d365740f11$exports.NEGATIVE_INFINITY = $65e201d365740f11$exports.NAN = $65e201d365740f11$exports.HOLE = void 0; +$65e201d365740f11$exports.HOLE = -1; +$65e201d365740f11$exports.NAN = -2; +$65e201d365740f11$exports.NEGATIVE_INFINITY = -3; +$65e201d365740f11$exports.NEGATIVE_ZERO = -4; +$65e201d365740f11$exports.NULL = -5; +$65e201d365740f11$exports.POSITIVE_INFINITY = -6; +$65e201d365740f11$exports.UNDEFINED = -7; +$65e201d365740f11$exports.TYPE_BIGINT = "B"; +$65e201d365740f11$exports.TYPE_DATE = "D"; +$65e201d365740f11$exports.TYPE_ERROR = "E"; +$65e201d365740f11$exports.TYPE_MAP = "M"; +$65e201d365740f11$exports.TYPE_NULL_OBJECT = "N"; +$65e201d365740f11$exports.TYPE_PROMISE = "P"; +$65e201d365740f11$exports.TYPE_REGEXP = "R"; +$65e201d365740f11$exports.TYPE_SET = "S"; +$65e201d365740f11$exports.TYPE_SYMBOL = "Y"; +$65e201d365740f11$exports.TYPE_URL = "U"; +$65e201d365740f11$exports.TYPE_PREVIOUS_RESOLVED = "Z"; +var $65e201d365740f11$var$Deferred = function Deferred() { + var _this = this; + (0, $ab3a094495a865ee$export$71511d61b312f219)(this, Deferred); + (0, $a15628583efdb184$export$71511d61b312f219)(this, "promise", void 0); + (0, $a15628583efdb184$export$71511d61b312f219)(this, "resolve", void 0); + (0, $a15628583efdb184$export$71511d61b312f219)(this, "reject", void 0); + this.promise = new Promise(function(resolve, reject) { + _this.resolve = resolve; + _this.reject = reject; + }); +}; +$65e201d365740f11$exports.Deferred = $65e201d365740f11$var$Deferred; +function $65e201d365740f11$var$createLineSplittingTransform() { + var decoder = new TextDecoder(); + var leftover = ""; + return new TransformStream({ + transform: function(chunk, controller) { + var str = decoder.decode(chunk, { + stream: true + }); + var parts = (leftover + str).split("\n"); + // The last part might be a partial line, so keep it for the next chunk. + leftover = parts.pop() || ""; + var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined; + try { + for(var _iterator = parts[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){ + var part = _step.value; + controller.enqueue(part); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally{ + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally{ + if (_didIteratorError) { + throw _iteratorError; + } + } + } + }, + flush: function(controller) { + // If there's any leftover data, enqueue it before closing. + if (leftover) controller.enqueue(leftover); + } + }); +} +$65e201d365740f11$exports.createLineSplittingTransform = $65e201d365740f11$var$createLineSplittingTransform; + + +function $cb2299d6261abd9c$var$flatten(input) { + var indices = this.indices; + var existing = indices.get(input); + if (existing) return [ + existing + ]; + if (input === undefined) return $65e201d365740f11$exports.UNDEFINED; + if (input === null) return $65e201d365740f11$exports.NULL; + if (Number.isNaN(input)) return $65e201d365740f11$exports.NAN; + if (input === Number.POSITIVE_INFINITY) return $65e201d365740f11$exports.POSITIVE_INFINITY; + if (input === Number.NEGATIVE_INFINITY) return $65e201d365740f11$exports.NEGATIVE_INFINITY; + if (input === 0 && 1 / input < 0) return $65e201d365740f11$exports.NEGATIVE_ZERO; + var index = this.index++; + indices.set(input, index); + $cb2299d6261abd9c$var$stringify.call(this, input, index); + return index; +} +$cb2299d6261abd9c$exports.flatten = $cb2299d6261abd9c$var$flatten; +function $cb2299d6261abd9c$var$stringify(input, index) { + var _this = this; + var _this1 = this, deferred = _this1.deferred, plugins = _this1.plugins, postPlugins = _this1.postPlugins; + var str = this.stringified; + var stack = [ + [ + input, + index + ] + ]; + while(stack.length > 0){ + var _stack_pop = (0, $e3406d20bd91f5ca$export$71511d61b312f219)(stack.pop(), 2), _$input = _stack_pop[0], _$index = _stack_pop[1]; + var partsForObj = function(obj) { + return Object.keys(obj).map(function(k) { + return '"_'.concat($cb2299d6261abd9c$var$flatten.call(_this, k), '":').concat($cb2299d6261abd9c$var$flatten.call(_this, obj[k])); + }).join(","); + }; + var error = null; + switch(typeof _$input === "undefined" ? "undefined" : (0, $bddf2f8f9387a36f$export$71511d61b312f219)(_$input)){ + case "boolean": + case "number": + case "string": + str[_$index] = JSON.stringify(_$input); + break; + case "bigint": + str[_$index] = '["'.concat($65e201d365740f11$exports.TYPE_BIGINT, '","').concat(_$input, '"]'); + break; + case "symbol": + { + var keyFor = Symbol.keyFor(_$input); + if (!keyFor) error = new Error("Cannot encode symbol unless created with Symbol.for()"); + else str[_$index] = '["'.concat($65e201d365740f11$exports.TYPE_SYMBOL, '",').concat(JSON.stringify(keyFor), "]"); + break; + } + case "object": + { + if (!_$input) { + str[_$index] = "".concat($65e201d365740f11$exports.NULL); + break; + } + var isArray = Array.isArray(_$input); + var pluginHandled = false; + var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined; + if (!isArray && plugins) try { + for(var _iterator = plugins[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){ + var plugin = _step.value; + var pluginResult = plugin(_$input); + if (Array.isArray(pluginResult)) { + pluginHandled = true; + var _pluginResult = (0, $78f41d2a271c854a$export$71511d61b312f219)(pluginResult), pluginIdentifier = _pluginResult[0], rest = _pluginResult.slice(1); + str[_$index] = "[".concat(JSON.stringify(pluginIdentifier)); + if (rest.length > 0) str[_$index] += ",".concat(rest.map(function(v) { + return $cb2299d6261abd9c$var$flatten.call(_this, v); + }).join(",")); + str[_$index] += "]"; + break; + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally{ + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally{ + if (_didIteratorError) { + throw _iteratorError; + } + } + } + if (!pluginHandled) { + var result = isArray ? "[" : "{"; + if (isArray) { + for(var i = 0; i < _$input.length; i++)result += (i ? "," : "") + (i in _$input ? $cb2299d6261abd9c$var$flatten.call(this, _$input[i]) : $65e201d365740f11$exports.HOLE); + str[_$index] = "".concat(result, "]"); + } else if (_$input instanceof Date) str[_$index] = '["'.concat($65e201d365740f11$exports.TYPE_DATE, '",').concat(_$input.getTime(), "]"); + else if (_$input instanceof URL) str[_$index] = '["'.concat($65e201d365740f11$exports.TYPE_URL, '",').concat(JSON.stringify(_$input.href), "]"); + else if (_$input instanceof RegExp) str[_$index] = '["'.concat($65e201d365740f11$exports.TYPE_REGEXP, '",').concat(JSON.stringify(_$input.source), ",").concat(JSON.stringify(_$input.flags), "]"); + else if (_$input instanceof Set) { + if (_$input.size > 0) str[_$index] = '["'.concat($65e201d365740f11$exports.TYPE_SET, '",').concat((0, $34618e712334dec5$export$71511d61b312f219)(_$input).map(function(val) { + return $cb2299d6261abd9c$var$flatten.call(_this, val); + }).join(","), "]"); + else str[_$index] = '["'.concat($65e201d365740f11$exports.TYPE_SET, '"]'); + } else if (_$input instanceof Map) { + if (_$input.size > 0) str[_$index] = '["'.concat($65e201d365740f11$exports.TYPE_MAP, '",').concat((0, $34618e712334dec5$export$71511d61b312f219)(_$input).flatMap(function(param) { + var _param = (0, $e3406d20bd91f5ca$export$71511d61b312f219)(param, 2), k = _param[0], v = _param[1]; + return [ + $cb2299d6261abd9c$var$flatten.call(_this, k), + $cb2299d6261abd9c$var$flatten.call(_this, v) + ]; + }).join(","), "]"); + else str[_$index] = '["'.concat($65e201d365740f11$exports.TYPE_MAP, '"]'); + } else if (_$input instanceof Promise) { + str[_$index] = '["'.concat($65e201d365740f11$exports.TYPE_PROMISE, '",').concat(_$index, "]"); + deferred[_$index] = _$input; + } else if (_$input instanceof Error) { + str[_$index] = '["'.concat($65e201d365740f11$exports.TYPE_ERROR, '",').concat(JSON.stringify(_$input.message)); + if (_$input.name !== "Error") str[_$index] += ",".concat(JSON.stringify(_$input.name)); + str[_$index] += "]"; + } else if (Object.getPrototypeOf(_$input) === null) str[_$index] = '["'.concat($65e201d365740f11$exports.TYPE_NULL_OBJECT, '",{').concat(partsForObj(_$input), "}]"); + else if ($cb2299d6261abd9c$var$isPlainObject(_$input)) str[_$index] = "{".concat(partsForObj(_$input), "}"); + else error = new Error("Cannot encode object with prototype"); + } + break; + } + default: + { + var isArray1 = Array.isArray(_$input); + var pluginHandled1 = false; + var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined; + if (!isArray1 && plugins) try { + for(var _iterator1 = plugins[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){ + var plugin1 = _step1.value; + var pluginResult1 = plugin1(_$input); + if (Array.isArray(pluginResult1)) { + pluginHandled1 = true; + var _pluginResult1 = (0, $78f41d2a271c854a$export$71511d61b312f219)(pluginResult1), pluginIdentifier1 = _pluginResult1[0], rest1 = _pluginResult1.slice(1); + str[_$index] = "[".concat(JSON.stringify(pluginIdentifier1)); + if (rest1.length > 0) str[_$index] += ",".concat(rest1.map(function(v) { + return $cb2299d6261abd9c$var$flatten.call(_this, v); + }).join(",")); + str[_$index] += "]"; + break; + } + } + } catch (err) { + _didIteratorError1 = true; + _iteratorError1 = err; + } finally{ + try { + if (!_iteratorNormalCompletion1 && _iterator1.return != null) { + _iterator1.return(); + } + } finally{ + if (_didIteratorError1) { + throw _iteratorError1; + } + } + } + if (!pluginHandled1) error = new Error("Cannot encode function or unexpected type"); + } + } + if (error) { + var pluginHandled2 = false; + var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = undefined; + if (postPlugins) try { + for(var _iterator2 = postPlugins[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true){ + var plugin2 = _step2.value; + var pluginResult2 = plugin2(_$input); + if (Array.isArray(pluginResult2)) { + pluginHandled2 = true; + var _pluginResult2 = (0, $78f41d2a271c854a$export$71511d61b312f219)(pluginResult2), pluginIdentifier2 = _pluginResult2[0], rest2 = _pluginResult2.slice(1); + str[_$index] = "[".concat(JSON.stringify(pluginIdentifier2)); + if (rest2.length > 0) str[_$index] += ",".concat(rest2.map(function(v) { + return $cb2299d6261abd9c$var$flatten.call(_this, v); + }).join(",")); + str[_$index] += "]"; + break; + } + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally{ + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally{ + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + if (!pluginHandled2) throw error; + } + } +} +var $cb2299d6261abd9c$var$objectProtoNames = Object.getOwnPropertyNames(Object.prototype).sort().join("\0"); +function $cb2299d6261abd9c$var$isPlainObject(thing) { + var proto = Object.getPrototypeOf(thing); + return proto === Object.prototype || proto === null || Object.getOwnPropertyNames(proto).sort().join("\0") === $cb2299d6261abd9c$var$objectProtoNames; +} + + +var $6aafc7ae685fcf56$exports = {}; + + + +"use strict"; +Object.defineProperty($6aafc7ae685fcf56$exports, "__esModule", { + value: true +}); +$6aafc7ae685fcf56$exports.unflatten = void 0; + +var $6aafc7ae685fcf56$var$globalObj = typeof window !== "undefined" ? window : typeof globalThis !== "undefined" ? globalThis : undefined; +function $6aafc7ae685fcf56$var$unflatten(parsed) { + var _this = this, hydrated = _this.hydrated, values = _this.values; + if (typeof parsed === "number") return $6aafc7ae685fcf56$var$hydrate.call(this, parsed); + if (!Array.isArray(parsed) || !parsed.length) throw new SyntaxError(); + var startIndex = values.length; + var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined; + try { + for(var _iterator = parsed[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){ + var value = _step.value; + values.push(value); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally{ + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally{ + if (_didIteratorError) { + throw _iteratorError; + } + } + } + hydrated.length = values.length; + return $6aafc7ae685fcf56$var$hydrate.call(this, startIndex); +} +$6aafc7ae685fcf56$exports.unflatten = $6aafc7ae685fcf56$var$unflatten; +function $6aafc7ae685fcf56$var$hydrate(index) { + var _loop = function() { + var _stack_pop = (0, $e3406d20bd91f5ca$export$71511d61b312f219)(stack.pop(), 2), _$index = _stack_pop[0], set = _stack_pop[1]; + switch(_$index){ + case $65e201d365740f11$exports.UNDEFINED: + set(undefined); + return "continue"; + case $65e201d365740f11$exports.NULL: + set(null); + return "continue"; + case $65e201d365740f11$exports.NAN: + set(NaN); + return "continue"; + case $65e201d365740f11$exports.POSITIVE_INFINITY: + set(Infinity); + return "continue"; + case $65e201d365740f11$exports.NEGATIVE_INFINITY: + set(-Infinity); + return "continue"; + case $65e201d365740f11$exports.NEGATIVE_ZERO: + set(-0); + return "continue"; + } + if (hydrated[_$index]) { + set(hydrated[_$index]); + return "continue"; + } + var value = values[_$index]; + if (!value || (typeof value === "undefined" ? "undefined" : (0, $bddf2f8f9387a36f$export$71511d61b312f219)(value)) !== "object") { + hydrated[_$index] = value; + set(value); + return "continue"; + } + if (Array.isArray(value)) { + if (typeof value[0] === "string") { + var _value = (0, $e3406d20bd91f5ca$export$71511d61b312f219)(value, 3), type = _value[0], b = _value[1], c = _value[2]; + switch(type){ + case $65e201d365740f11$exports.TYPE_DATE: + set(hydrated[_$index] = new Date(b)); + return "continue"; + case $65e201d365740f11$exports.TYPE_URL: + set(hydrated[_$index] = new URL(b)); + return "continue"; + case $65e201d365740f11$exports.TYPE_BIGINT: + set(hydrated[_$index] = BigInt(b)); + return "continue"; + case $65e201d365740f11$exports.TYPE_REGEXP: + set(hydrated[_$index] = new RegExp(b, c)); + return "continue"; + case $65e201d365740f11$exports.TYPE_SYMBOL: + set(hydrated[_$index] = Symbol.for(b)); + return "continue"; + case $65e201d365740f11$exports.TYPE_SET: + var newSet = new Set(); + hydrated[_$index] = newSet; + for(var i = 1; i < value.length; i++)stack.push([ + value[i], + function(v) { + newSet.add(v); + } + ]); + set(newSet); + return "continue"; + case $65e201d365740f11$exports.TYPE_MAP: + var _loop = function(i1) { + var r = []; + stack.push([ + value[i1 + 1], + function(v) { + r[1] = v; + } + ]); + stack.push([ + value[i1], + function(k) { + r[0] = k; + } + ]); + postRun.push(function() { + map.set(r[0], r[1]); + }); + }; + var map = new Map(); + hydrated[_$index] = map; + for(var i1 = 1; i1 < value.length; i1 += 2)_loop(i1); + set(map); + return "continue"; + case $65e201d365740f11$exports.TYPE_NULL_OBJECT: + var obj = Object.create(null); + hydrated[_$index] = obj; + var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined; + try { + var _loop1 = function() { + var key = _step.value; + var r = []; + stack.push([ + b[key], + function(v) { + r[1] = v; + } + ]); + stack.push([ + Number(key.slice(1)), + function(k) { + r[0] = k; + } + ]); + postRun.push(function() { + obj[r[0]] = r[1]; + }); + }; + for(var _iterator = Object.keys(b).reverse()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)_loop1(); + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally{ + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally{ + if (_didIteratorError) { + throw _iteratorError; + } + } + } + set(obj); + return "continue"; + case $65e201d365740f11$exports.TYPE_PROMISE: + if (hydrated[b]) set(hydrated[_$index] = hydrated[b]); + else { + var d = new $65e201d365740f11$exports.Deferred(); + deferred[b] = d; + set(hydrated[_$index] = d.promise); + } + return "continue"; + case $65e201d365740f11$exports.TYPE_ERROR: + var _value1 = (0, $e3406d20bd91f5ca$export$71511d61b312f219)(value, 3), message = _value1[1], errorType = _value1[2]; + var error = errorType && $6aafc7ae685fcf56$var$globalObj && $6aafc7ae685fcf56$var$globalObj[errorType] ? new $6aafc7ae685fcf56$var$globalObj[errorType](message) : new Error(message); + hydrated[_$index] = error; + set(error); + return "continue"; + case $65e201d365740f11$exports.TYPE_PREVIOUS_RESOLVED: + set(hydrated[_$index] = hydrated[b]); + return "continue"; + default: + // Run plugins at the end so we have a chance to resolve primitives + // without running into a loop + if (Array.isArray(plugins)) { + var _loop2 = function(i2) { + var v = vals[i2]; + stack.push([ + v, + function(v) { + r[i2] = v; + } + ]); + }; + var r = []; + var vals = value.slice(1); + for(var i2 = 0; i2 < vals.length; i2++)_loop2(i2); + postRun.push(function() { + var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined; + try { + for(var _iterator = plugins[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){ + var plugin = _step.value; + var result = plugin.apply(void 0, [ + value[0] + ].concat((0, $34618e712334dec5$export$71511d61b312f219)(r))); + if (result) { + set(hydrated[_$index] = result.value); + return; + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally{ + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally{ + if (_didIteratorError) { + throw _iteratorError; + } + } + } + throw new SyntaxError(); + }); + return "continue"; + } + throw new SyntaxError(); + } + } else { + var _loop3 = function(i3) { + var n = value[i3]; + if (n !== $65e201d365740f11$exports.HOLE) stack.push([ + n, + function(v) { + array[i3] = v; + } + ]); + }; + var array = []; + hydrated[_$index] = array; + for(var i3 = 0; i3 < value.length; i3++)_loop3(i3); + set(array); + return "continue"; + } + } else { + var object = {}; + hydrated[_$index] = object; + var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined; + try { + var _loop4 = function() { + var key = _step1.value; + var r = []; + stack.push([ + value[key], + function(v) { + r[1] = v; + } + ]); + stack.push([ + Number(key.slice(1)), + function(k) { + r[0] = k; + } + ]); + postRun.push(function() { + object[r[0]] = r[1]; + }); + }; + for(var _iterator1 = Object.keys(value).reverse()[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true)_loop4(); + } catch (err) { + _didIteratorError1 = true; + _iteratorError1 = err; + } finally{ + try { + if (!_iteratorNormalCompletion1 && _iterator1.return != null) { + _iterator1.return(); + } + } finally{ + if (_didIteratorError1) { + throw _iteratorError1; + } + } + } + set(object); + return "continue"; + } + }; + var _this = this, hydrated = _this.hydrated, values = _this.values, deferred = _this.deferred, plugins = _this.plugins; + var result; + var stack = [ + [ + index, + function(v) { + result = v; + } + ] + ]; + var postRun = []; + while(stack.length > 0)_loop(); + while(postRun.length > 0)postRun.pop()(); + return result; +} + + + +function $8038ee37bf9c868b$var$decode(readable, options) { + return $8038ee37bf9c868b$var$_decode.apply(this, arguments); +} +function $8038ee37bf9c868b$var$_decode() { + $8038ee37bf9c868b$var$_decode = (0, $d1e9370853ff8484$export$71511d61b312f219)(function(readable, options) { + var plugins, done, reader, decoder, decoded, donePromise; + return (0, $3d92a16ff8bdcfc3$export$67ebef60e6f28a6)(this, function(_state) { + switch(_state.label){ + case 0: + plugins = (options !== null && options !== void 0 ? options : {}).plugins; + done = new $65e201d365740f11$exports.Deferred(); + reader = readable.pipeThrough((0, $65e201d365740f11$exports.createLineSplittingTransform)()).getReader(); + decoder = { + values: [], + hydrated: [], + deferred: {}, + plugins: plugins + }; + return [ + 4, + $8038ee37bf9c868b$var$decodeInitial.call(decoder, reader) + ]; + case 1: + decoded = _state.sent(); + donePromise = done.promise; + if (decoded.done) done.resolve(); + else donePromise = $8038ee37bf9c868b$var$decodeDeferred.call(decoder, reader).then(done.resolve).catch(function(reason) { + var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined; + try { + for(var _iterator = Object.values(decoder.deferred)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){ + var deferred = _step.value; + deferred.reject(reason); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally{ + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally{ + if (_didIteratorError) { + throw _iteratorError; + } + } + } + done.reject(reason); + }); + return [ + 2, + { + done: donePromise.then(function() { + return reader.closed; + }), + value: decoded.value + } + ]; + } + }); + }); + return $8038ee37bf9c868b$var$_decode.apply(this, arguments); +} +$8038ee37bf9c868b$exports.decode = $8038ee37bf9c868b$var$decode; +function $8038ee37bf9c868b$var$decodeInitial(reader) { + return $8038ee37bf9c868b$var$_decodeInitial.apply(this, arguments); +} +function $8038ee37bf9c868b$var$_decodeInitial() { + $8038ee37bf9c868b$var$_decodeInitial = (0, $d1e9370853ff8484$export$71511d61b312f219)(function(reader) { + var read, line; + return (0, $3d92a16ff8bdcfc3$export$67ebef60e6f28a6)(this, function(_state) { + switch(_state.label){ + case 0: + return [ + 4, + reader.read() + ]; + case 1: + read = _state.sent(); + if (!read.value) throw new SyntaxError(); + try { + line = JSON.parse(read.value); + } catch (reason) { + throw new SyntaxError(); + } + return [ + 2, + { + done: read.done, + value: $6aafc7ae685fcf56$exports.unflatten.call(this, line) + } + ]; + } + }); + }); + return $8038ee37bf9c868b$var$_decodeInitial.apply(this, arguments); +} +function $8038ee37bf9c868b$var$decodeDeferred(reader) { + return $8038ee37bf9c868b$var$_decodeDeferred.apply(this, arguments); +} +function $8038ee37bf9c868b$var$_decodeDeferred() { + $8038ee37bf9c868b$var$_decodeDeferred = (0, $d1e9370853ff8484$export$71511d61b312f219)(function(reader) { + var read, line, colonIndex, deferredId, deferred, lineData, jsonLine, value, colonIndex1, deferredId1, deferred1, lineData1, jsonLine1, value1; + return (0, $3d92a16ff8bdcfc3$export$67ebef60e6f28a6)(this, function(_state) { + switch(_state.label){ + case 0: + return [ + 4, + reader.read() + ]; + case 1: + read = _state.sent(); + _state.label = 2; + case 2: + if (!!read.done) return [ + 3, + 4 + ]; + if (!read.value) return [ + 3, + 2 + ]; + line = read.value; + switch(line[0]){ + case $65e201d365740f11$exports.TYPE_PROMISE: + { + colonIndex = line.indexOf(":"); + deferredId = Number(line.slice(1, colonIndex)); + deferred = this.deferred[deferredId]; + if (!deferred) throw new Error("Deferred ID ".concat(deferredId, " not found in stream")); + lineData = line.slice(colonIndex + 1); + jsonLine = void 0; + try { + jsonLine = JSON.parse(lineData); + } catch (reason) { + throw new SyntaxError(); + } + value = $6aafc7ae685fcf56$exports.unflatten.call(this, jsonLine); + deferred.resolve(value); + break; + } + case $65e201d365740f11$exports.TYPE_ERROR: + { + colonIndex1 = line.indexOf(":"); + deferredId1 = Number(line.slice(1, colonIndex1)); + deferred1 = this.deferred[deferredId1]; + if (!deferred1) throw new Error("Deferred ID ".concat(deferredId1, " not found in stream")); + lineData1 = line.slice(colonIndex1 + 1); + jsonLine1 = void 0; + try { + jsonLine1 = JSON.parse(lineData1); + } catch (reason) { + throw new SyntaxError(); + } + value1 = $6aafc7ae685fcf56$exports.unflatten.call(this, jsonLine1); + deferred1.reject(value1); + break; + } + default: + throw new SyntaxError(); + } + return [ + 4, + reader.read() + ]; + case 3: + read = _state.sent(); + return [ + 3, + 2 + ]; + case 4: + return [ + 2 + ]; + } + }); + }); + return $8038ee37bf9c868b$var$_decodeDeferred.apply(this, arguments); +} +function $8038ee37bf9c868b$var$encode(input, options) { + var _ref = options !== null && options !== void 0 ? options : {}, plugins = _ref.plugins, postPlugins = _ref.postPlugins, signal = _ref.signal; + var encoder = { + deferred: {}, + index: 0, + indices: new Map(), + stringified: [], + plugins: plugins, + postPlugins: postPlugins, + signal: signal + }; + var textEncoder = new TextEncoder(); + var lastSentIndex = 0; + var readable = new ReadableStream({ + start: function(controller) { + return (0, $d1e9370853ff8484$export$71511d61b312f219)(function() { + var id, seenPromises, raceDone, racePromise, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _loop, _iterator, _step; + return (0, $3d92a16ff8bdcfc3$export$67ebef60e6f28a6)(this, function(_state) { + switch(_state.label){ + case 0: + id = $cb2299d6261abd9c$exports.flatten.call(encoder, input); + if (Array.isArray(id)) throw new Error("This should never happen"); + if (id < 0) controller.enqueue(textEncoder.encode("".concat(id, "\n"))); + else { + controller.enqueue(textEncoder.encode("[".concat(encoder.stringified.join(","), "]\n"))); + lastSentIndex = encoder.stringified.length - 1; + } + seenPromises = new WeakSet(); + if (!Object.keys(encoder.deferred).length) return [ + 3, + 4 + ]; + racePromise = new Promise(function(resolve, reject) { + raceDone = resolve; + if (signal) { + var rejectPromise = function() { + return reject(signal.reason || new Error("Signal was aborted.")); + }; + if (signal.aborted) rejectPromise(); + else signal.addEventListener("abort", function(event) { + rejectPromise(); + }); + } + }); + _state.label = 1; + case 1: + if (!(Object.keys(encoder.deferred).length > 0)) return [ + 3, + 3 + ]; + _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined; + try { + _loop = function() { + var _step_value = (0, $e3406d20bd91f5ca$export$71511d61b312f219)(_step.value, 2), deferredId = _step_value[0], deferred = _step_value[1]; + if (seenPromises.has(deferred)) return "continue"; + seenPromises.add(// biome-ignore lint/suspicious/noAssignInExpressions: + encoder.deferred[Number(deferredId)] = Promise.race([ + racePromise, + deferred + ]).then(function(resolved) { + var id = $cb2299d6261abd9c$exports.flatten.call(encoder, resolved); + if (Array.isArray(id)) { + controller.enqueue(textEncoder.encode("".concat($65e201d365740f11$exports.TYPE_PROMISE).concat(deferredId, ':[["').concat($65e201d365740f11$exports.TYPE_PREVIOUS_RESOLVED, '",').concat(id[0], "]]\n"))); + encoder.index++; + lastSentIndex++; + } else if (id < 0) controller.enqueue(textEncoder.encode("".concat($65e201d365740f11$exports.TYPE_PROMISE).concat(deferredId, ":").concat(id, "\n"))); + else { + var values = encoder.stringified.slice(lastSentIndex + 1).join(","); + controller.enqueue(textEncoder.encode("".concat($65e201d365740f11$exports.TYPE_PROMISE).concat(deferredId, ":[").concat(values, "]\n"))); + lastSentIndex = encoder.stringified.length - 1; + } + }, function(reason) { + if (!reason || (typeof reason === "undefined" ? "undefined" : (0, $bddf2f8f9387a36f$export$71511d61b312f219)(reason)) !== "object" || !(reason instanceof Error)) reason = new Error("An unknown error occurred"); + var id = $cb2299d6261abd9c$exports.flatten.call(encoder, reason); + if (Array.isArray(id)) { + controller.enqueue(textEncoder.encode("".concat($65e201d365740f11$exports.TYPE_ERROR).concat(deferredId, ':[["').concat($65e201d365740f11$exports.TYPE_PREVIOUS_RESOLVED, '",').concat(id[0], "]]\n"))); + encoder.index++; + lastSentIndex++; + } else if (id < 0) controller.enqueue(textEncoder.encode("".concat($65e201d365740f11$exports.TYPE_ERROR).concat(deferredId, ":").concat(id, "\n"))); + else { + var values = encoder.stringified.slice(lastSentIndex + 1).join(","); + controller.enqueue(textEncoder.encode("".concat($65e201d365740f11$exports.TYPE_ERROR).concat(deferredId, ":[").concat(values, "]\n"))); + lastSentIndex = encoder.stringified.length - 1; + } + }).finally(function() { + delete encoder.deferred[Number(deferredId)]; + })); + }; + for(_iterator = Object.entries(encoder.deferred)[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)_loop(); + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally{ + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally{ + if (_didIteratorError) { + throw _iteratorError; + } + } + } + return [ + 4, + Promise.race(Object.values(encoder.deferred)) + ]; + case 2: + _state.sent(); + return [ + 3, + 1 + ]; + case 3: + raceDone(); + _state.label = 4; + case 4: + return [ + 4, + Promise.all(Object.values(encoder.deferred)) + ]; + case 5: + _state.sent(); + controller.close(); + return [ + 2 + ]; + } + }); + })(); + } + }); + return readable; +} +$8038ee37bf9c868b$exports.encode = $8038ee37bf9c868b$var$encode; + window.oc = window.oc || {}; -window.oc._decode = decode; +window.oc._decode = (0, $8038ee37bf9c868b$exports.decode); + +})(); +//# sourceMappingURL=turbostream.js.map