ysk-omni 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/CHANGELOG.zh.md +23 -0
- package/README-ZH.md +20 -21
- package/README.md +20 -21
- package/docs/en/getting-started.md +1 -1
- package/docs/en/operations.md +1 -1
- package/docs/zh/getting-started.md +1 -1
- package/docs/zh/operations.md +1 -1
- package/package.json +6 -6
- package/public/admin/boot.js +1 -1
- package/public/admin/index.html +1 -1
- package/public/admin/vendor/purify.min.js +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,29 @@ Newest first. Every version from 1.0.0 is grouped by category. `README.md` shows
|
|
|
4
4
|
|
|
5
5
|
Entries come from git history, tags, and GitHub Releases.
|
|
6
6
|
|
|
7
|
+
## 1.0.8 — 2026-11-15
|
|
8
|
+
|
|
9
|
+
### Security
|
|
10
|
+
|
|
11
|
+
- Upgrade `vite` 6.4.5 → **6.4.6** for GHSA-p4f5-76q4-ffq7 (Critical). Unescaped `__vite-browser-external` / `__vite-optional-peer-dep` virtual module IDs allowed RCE when the Vite **dev** server is exposed (`--host` / `server.host`). Affected: Vite `>=4.0.0,<=6.4.5`. Production Admin is a built static bundle; `dev:admin` and the locked Vite version are patched. Changelog: 6.4.6 (2026-11-09) “fix: escape ids in resolve virtual modules”.
|
|
12
|
+
- Vendor Admin DOMPurify **3.4.17 → 3.4.18** (`public/admin/vendor/purify.min.js`, official minified 3.4.18 build). 3.4.18 (2026-11-14) fixes a `SAFE_FOR_TEMPLATES` reparse bypass and hook allow-list leakage when a hook passes the config object back to `sanitize()`. Chat markdown still sanitizes with `USE_PROFILES: { html: true }`.
|
|
13
|
+
- Production hosts should run Node ≥22.23.5, ≥24.22.3, or ≥26.13.1 (2026-11-11 security releases: CVE-2026-123863, CVE-2026-123864 and siblings). Package `engines` stay `>=20`. CI stays on Node 24.
|
|
14
|
+
|
|
15
|
+
### Dependency upgrades
|
|
16
|
+
|
|
17
|
+
- `vite` 6.4.5 → 6.4.6
|
|
18
|
+
- `typescript-eslint` 8.72.1 → 8.72.2, including the matching `@typescript-eslint/*` packages (plugin bugfixes: prefer-string-starts-ends-with, no-deprecated circular aliases, no-unnecessary-type-assertion, prefer-nullish-coalescing)
|
|
19
|
+
- Transitive `qs` override **6.16.2 → 6.17.1**. 6.16.2 is already OSV-clean for GHSA-6pq8-jhm2-2vcw / CVE-2026-110816 and GHSA-w4cr-vjpx-p82q / CVE-2026-110910; 6.17.1 is current 6.x. Matches GCtoAC 1.7.9.
|
|
20
|
+
- Align package.json floors `cors` `^2.8.6` and `@types/cors` `^2.8.19` (lockfile already resolved those versions).
|
|
21
|
+
|
|
22
|
+
### Internal/CI
|
|
23
|
+
|
|
24
|
+
- Bump the package version to 1.0.8, update Admin fixtures, and rebuild the Admin bundle so the sidebar shows v1.0.8.
|
|
25
|
+
- Getting started and operations docs (English and 中文) record the 2026-11-11 production Node floor. `engines` and CI Node 24 are unchanged.
|
|
26
|
+
|
|
27
|
+
GitHub Release: https://github.com/yanshekki/ysk-omni/releases/tag/v1.0.8
|
|
28
|
+
Compare: https://github.com/yanshekki/ysk-omni/compare/v1.0.7...v1.0.8
|
|
29
|
+
|
|
7
30
|
## 1.0.7 — 2026-11-08
|
|
8
31
|
|
|
9
32
|
### Security
|
package/CHANGELOG.zh.md
CHANGED
|
@@ -4,6 +4,29 @@
|
|
|
4
4
|
|
|
5
5
|
條目來自 git 歷史、標籤與 GitHub Release。
|
|
6
6
|
|
|
7
|
+
## 1.0.8 — 2026-11-15
|
|
8
|
+
|
|
9
|
+
### 安全
|
|
10
|
+
|
|
11
|
+
- 將 `vite` 由 6.4.5 升至 **6.4.6**,修復 GHSA-p4f5-76q4-ffq7(危急)。未跳脫的 `__vite-browser-external`/`__vite-optional-peer-dep` 虛擬模組 ID,在 Vite **開發**伺服器對外開放(`--host`/`server.host`)時可遠端執行程式碼。受影響範圍:Vite `>=4.0.0,<=6.4.5`。生產環境 Admin 是已建置的靜態檔;`dev:admin` 與 lockfile 中的 Vite 已修補。變更日誌:6.4.6(2026-11-09)「fix: escape ids in resolve virtual modules」。
|
|
12
|
+
- Admin 內嵌的 DOMPurify 由 **3.4.17** 升到 **3.4.18**(`public/admin/vendor/purify.min.js`,官方 3.4.18 壓縮檔)。3.4.18(2026-11-14)修復 `SAFE_FOR_TEMPLATES` 再解析繞過,以及 hook 把 config 物件交回 `sanitize()` 時允許清單外洩。對話 markdown 仍用 `USE_PROFILES: { html: true }` 消毒。
|
|
13
|
+
- 生產主機應使用 Node ≥22.23.5、≥24.22.3 或 ≥26.13.1(2026-11-11 安全版本:CVE-2026-123863、CVE-2026-123864 及同批)。套件 `engines` 維持 `>=20`。CI 仍用 Node 24。
|
|
14
|
+
|
|
15
|
+
### 依賴升級
|
|
16
|
+
|
|
17
|
+
- `vite` 6.4.5 → 6.4.6
|
|
18
|
+
- `typescript-eslint` 8.72.1 → 8.72.2,連同對應的 `@typescript-eslint/*`(外掛修正:prefer-string-starts-ends-with、no-deprecated 循環別名、no-unnecessary-type-assertion、prefer-nullish-coalescing)
|
|
19
|
+
- 傳遞依賴 `qs` 的 override 由 **6.16.2** 改為 **6.17.1**。6.16.2 已不在 GHSA-6pq8-jhm2-2vcw/CVE-2026-110816 與 GHSA-w4cr-vjpx-p82q/CVE-2026-110910 範圍內;6.17.1 是目前 6.x。與 GCtoAC 1.7.9 一致。
|
|
20
|
+
- 對齊 package.json 下限 `cors` `^2.8.6` 與 `@types/cors` `^2.8.19`(lockfile 本來已解析到這些版本)。
|
|
21
|
+
|
|
22
|
+
### 內部/CI
|
|
23
|
+
|
|
24
|
+
- 將套件版本升至 1.0.8、更新 Admin fixtures,並重建 Admin bundle,讓側欄顯示 v1.0.8。
|
|
25
|
+
- 快速開始與維運文件(英文與中文)記錄 2026-11-11 的生產 Node 下限。`engines` 與 CI 的 Node 24 不變。
|
|
26
|
+
|
|
27
|
+
GitHub Release:https://github.com/yanshekki/ysk-omni/releases/tag/v1.0.8
|
|
28
|
+
比較:https://github.com/yanshekki/ysk-omni/compare/v1.0.7...v1.0.8
|
|
29
|
+
|
|
7
30
|
## 1.0.7 — 2026-11-08
|
|
8
31
|
|
|
9
32
|
### 安全
|
package/README-ZH.md
CHANGED
|
@@ -34,6 +34,26 @@ curl -sS http://127.0.0.1:3850/v1/models \
|
|
|
34
34
|
|
|
35
35
|
## 更新日誌
|
|
36
36
|
|
|
37
|
+
### 1.0.8 — 2026-11-15
|
|
38
|
+
|
|
39
|
+
### 安全
|
|
40
|
+
|
|
41
|
+
- 將 `vite` 由 6.4.5 升至 **6.4.6**,修復 GHSA-p4f5-76q4-ffq7(危急)。未跳脫的 `__vite-browser-external`/`__vite-optional-peer-dep` 虛擬模組 ID,在 Vite **開發**伺服器對外開放(`--host`/`server.host`)時可遠端執行程式碼。受影響範圍:Vite `>=4.0.0,<=6.4.5`。生產環境 Admin 是已建置的靜態檔;`dev:admin` 與 lockfile 中的 Vite 已修補。變更日誌:6.4.6(2026-11-09)「fix: escape ids in resolve virtual modules」。
|
|
42
|
+
- Admin 內嵌的 DOMPurify 由 **3.4.17** 升到 **3.4.18**(`public/admin/vendor/purify.min.js`,官方 3.4.18 壓縮檔)。3.4.18(2026-11-14)修復 `SAFE_FOR_TEMPLATES` 再解析繞過,以及 hook 把 config 物件交回 `sanitize()` 時允許清單外洩。對話 markdown 仍用 `USE_PROFILES: { html: true }` 消毒。
|
|
43
|
+
- 生產主機應使用 Node ≥22.23.5、≥24.22.3 或 ≥26.13.1(2026-11-11 安全版本:CVE-2026-123863、CVE-2026-123864 及同批)。套件 `engines` 維持 `>=20`。CI 仍用 Node 24。
|
|
44
|
+
|
|
45
|
+
### 依賴升級
|
|
46
|
+
|
|
47
|
+
- `vite` 6.4.5 → 6.4.6
|
|
48
|
+
- `typescript-eslint` 8.72.1 → 8.72.2,連同對應的 `@typescript-eslint/*`(外掛修正:prefer-string-starts-ends-with、no-deprecated 循環別名、no-unnecessary-type-assertion、prefer-nullish-coalescing)
|
|
49
|
+
- 傳遞依賴 `qs` 的 override 由 **6.16.2** 改為 **6.17.1**。6.16.2 已不在 GHSA-6pq8-jhm2-2vcw/CVE-2026-110816 與 GHSA-w4cr-vjpx-p82q/CVE-2026-110910 範圍內;6.17.1 是目前 6.x。與 GCtoAC 1.7.9 一致。
|
|
50
|
+
- 對齊 package.json 下限 `cors` `^2.8.6` 與 `@types/cors` `^2.8.19`(lockfile 本來已解析到這些版本)。
|
|
51
|
+
|
|
52
|
+
### 內部/CI
|
|
53
|
+
|
|
54
|
+
- 將套件版本升至 1.0.8、更新 Admin fixtures,並重建 Admin bundle,讓側欄顯示 v1.0.8。
|
|
55
|
+
- 快速開始與維運文件(英文與中文)記錄 2026-11-11 的生產 Node 下限。`engines` 與 CI 的 Node 24 不變。
|
|
56
|
+
|
|
37
57
|
### 1.0.7 — 2026-11-08
|
|
38
58
|
|
|
39
59
|
### 安全
|
|
@@ -63,27 +83,6 @@ curl -sS http://127.0.0.1:3850/v1/models \
|
|
|
63
83
|
- 快速開始、維運與開發文件(英文與中文)記錄 CI 使用 Node 24,以及生產環境的 Node 下限。
|
|
64
84
|
- 將 Admin `formatApiError` 的後備錯誤本體標成錯誤物件,讓 `npm run typecheck:admin` 接受 `details.feature`、`details.flag` 與 `details.reason`。執行時期行為不變。
|
|
65
85
|
|
|
66
|
-
### 1.0.5 — 2026-10-25
|
|
67
|
-
|
|
68
|
-
### 安全
|
|
69
|
-
|
|
70
|
-
- 將 `multer` 由 1.4.5-lts 升至 2.5.0,修復 CVE-2026-77078(高危 multipart 欄位名拒絕服務)以及 2.x 至 2.5.0 的後續 multipart 修補,包括 CVE-2026-113872。上傳路由仍用 `memoryStorage`。Multer 上限錯誤改回 413/400,不再當 500。
|
|
71
|
-
- 以 npm `overrides` 釘選傳遞依賴 `body-parser` 1.20.9(CVE-2026-111181/GHSA-27r3-jxmh-p828),讓 `express.json` 與 `urlencoded` 用上已修補的解析器。
|
|
72
|
-
- 將 `vite` 由 6.4.4 升至 6.4.5(GHSA-8g5g-mxqh-grgj)。該公告只影響 Admin Vite **開發**伺服器;生產環境提供已建置的靜態 Admin。
|
|
73
|
-
- 生產主機應使用 2026-10-21 Node.js 安全版本(22.23.4、24.22.1、26.12.1,或現行已修補 LTS),以覆蓋 CVE-2026-111497 等執行時期修補。套件 `engines` 維持 `>=20`。
|
|
74
|
-
|
|
75
|
-
### 依賴升級
|
|
76
|
-
|
|
77
|
-
- `multer` 1.4.5-lts.2 → 2.5.0
|
|
78
|
-
- `@types/multer` 1.4.13 → 2.3.0
|
|
79
|
-
- `body-parser` 1.20.8 → 1.20.9(override)
|
|
80
|
-
- `vite` 6.4.4 → 6.4.5
|
|
81
|
-
- `typescript-eslint` 8.71.1 → 8.72.0
|
|
82
|
-
|
|
83
|
-
### 內部/CI
|
|
84
|
-
|
|
85
|
-
- 將套件版本升至 1.0.5、更新 Admin fixtures,並重建 Admin bundle,讓側欄顯示 v1.0.5。
|
|
86
|
-
|
|
87
86
|
完整更新日誌:[CHANGELOG.zh.md](./CHANGELOG.zh.md)。
|
|
88
87
|
|
|
89
88
|
## 授權
|
package/README.md
CHANGED
|
@@ -34,6 +34,26 @@ Full CLI, API, Admin, Catalog, Runtimes, keys, and operations: **[Documentation]
|
|
|
34
34
|
|
|
35
35
|
## Changelog
|
|
36
36
|
|
|
37
|
+
### 1.0.8 — 2026-11-15
|
|
38
|
+
|
|
39
|
+
### Security
|
|
40
|
+
|
|
41
|
+
- Upgrade `vite` 6.4.5 → **6.4.6** for GHSA-p4f5-76q4-ffq7 (Critical). Unescaped `__vite-browser-external` / `__vite-optional-peer-dep` virtual module IDs allowed RCE when the Vite **dev** server is exposed (`--host` / `server.host`). Affected: Vite `>=4.0.0,<=6.4.5`. Production Admin is a built static bundle; `dev:admin` and the locked Vite version are patched. Changelog: 6.4.6 (2026-11-09) “fix: escape ids in resolve virtual modules”.
|
|
42
|
+
- Vendor Admin DOMPurify **3.4.17 → 3.4.18** (`public/admin/vendor/purify.min.js`, official minified 3.4.18 build). 3.4.18 (2026-11-14) fixes a `SAFE_FOR_TEMPLATES` reparse bypass and hook allow-list leakage when a hook passes the config object back to `sanitize()`. Chat markdown still sanitizes with `USE_PROFILES: { html: true }`.
|
|
43
|
+
- Production hosts should run Node ≥22.23.5, ≥24.22.3, or ≥26.13.1 (2026-11-11 security releases: CVE-2026-123863, CVE-2026-123864 and siblings). Package `engines` stay `>=20`. CI stays on Node 24.
|
|
44
|
+
|
|
45
|
+
### Dependency upgrades
|
|
46
|
+
|
|
47
|
+
- `vite` 6.4.5 → 6.4.6
|
|
48
|
+
- `typescript-eslint` 8.72.1 → 8.72.2, including the matching `@typescript-eslint/*` packages (plugin bugfixes: prefer-string-starts-ends-with, no-deprecated circular aliases, no-unnecessary-type-assertion, prefer-nullish-coalescing)
|
|
49
|
+
- Transitive `qs` override **6.16.2 → 6.17.1**. 6.16.2 is already OSV-clean for GHSA-6pq8-jhm2-2vcw / CVE-2026-110816 and GHSA-w4cr-vjpx-p82q / CVE-2026-110910; 6.17.1 is current 6.x. Matches GCtoAC 1.7.9.
|
|
50
|
+
- Align package.json floors `cors` `^2.8.6` and `@types/cors` `^2.8.19` (lockfile already resolved those versions).
|
|
51
|
+
|
|
52
|
+
### Internal/CI
|
|
53
|
+
|
|
54
|
+
- Bump the package version to 1.0.8, update Admin fixtures, and rebuild the Admin bundle so the sidebar shows v1.0.8.
|
|
55
|
+
- Getting started and operations docs (English and 中文) record the 2026-11-11 production Node floor. `engines` and CI Node 24 are unchanged.
|
|
56
|
+
|
|
37
57
|
### 1.0.7 — 2026-11-08
|
|
38
58
|
|
|
39
59
|
### Security
|
|
@@ -63,27 +83,6 @@ Full CLI, API, Admin, Catalog, Runtimes, keys, and operations: **[Documentation]
|
|
|
63
83
|
- Getting started, operations, and development docs (English and 中文) record the Node 24 CI job and the production Node floor.
|
|
64
84
|
- Type the Admin `formatApiError` fallback body as the error object so `npm run typecheck:admin` accepts `details.feature`, `details.flag`, and `details.reason`. Runtime behavior is unchanged.
|
|
65
85
|
|
|
66
|
-
### 1.0.5 — 2026-10-25
|
|
67
|
-
|
|
68
|
-
### Security
|
|
69
|
-
|
|
70
|
-
- Upgrade `multer` 1.4.5-lts to 2.5.0 to fix CVE-2026-77078 (High multipart field-name DoS) and later 2.x multipart fixes through 2.5.0, including CVE-2026-113872. Upload routes still use `memoryStorage`. Multer limit errors now return 413 / 400 instead of 500.
|
|
71
|
-
- Pin transitive `body-parser` 1.20.9 (CVE-2026-111181 / GHSA-27r3-jxmh-p828) with an npm `overrides` entry so `express.json` and `urlencoded` get the patched parser.
|
|
72
|
-
- Upgrade `vite` 6.4.4 → 6.4.5 (GHSA-8g5g-mxqh-grgj). The advisory applies to the Admin Vite **dev** server; production serves the built static Admin bundle.
|
|
73
|
-
- Production hosts should run a Node.js build from the 2026-10-21 security releases (22.23.4, 24.22.1, 26.12.1, or current patched LTS) for CVE-2026-111497 and related runtime fixes. Package `engines` stay `>=20`.
|
|
74
|
-
|
|
75
|
-
### Dependency upgrades
|
|
76
|
-
|
|
77
|
-
- `multer` 1.4.5-lts.2 → 2.5.0
|
|
78
|
-
- `@types/multer` 1.4.13 → 2.3.0
|
|
79
|
-
- `body-parser` 1.20.8 → 1.20.9 (override)
|
|
80
|
-
- `vite` 6.4.4 → 6.4.5
|
|
81
|
-
- `typescript-eslint` 8.71.1 → 8.72.0
|
|
82
|
-
|
|
83
|
-
### Internal/CI
|
|
84
|
-
|
|
85
|
-
- Bump the package version to 1.0.5, update Admin fixtures, and rebuild the Admin bundle so the sidebar shows v1.0.5.
|
|
86
|
-
|
|
87
86
|
Full changelog: [CHANGELOG.md](./CHANGELOG.md).
|
|
88
87
|
|
|
89
88
|
## License
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Requirements
|
|
4
4
|
|
|
5
|
-
- Node.js 20 or later (`engines`). Node 20 is end of life and has no fix for CVE-2026-111497. Production should run Node ≥22.23.
|
|
5
|
+
- Node.js 20 or later (`engines`). Node 20 is end of life and has no fix for CVE-2026-111497 or the 2026-11-11 runtime issues. Production should run Node ≥22.23.5, ≥24.22.3, or ≥26.13.1. See [Operations](operations.md).
|
|
6
6
|
- Text GGUF: `llama-server` on `PATH`, or `OMNI_LLAMA_SERVER`
|
|
7
7
|
- Text safetensors: `vLLM` (`OMNI_VLLM`)
|
|
8
8
|
- Image / speech / video: an OpenAI-shaped HTTP worker (see [Media](media.md))
|
package/docs/en/operations.md
CHANGED
|
@@ -13,7 +13,7 @@ curl -sS http://127.0.0.1:3850/ready
|
|
|
13
13
|
|
|
14
14
|
## Node.js runtime
|
|
15
15
|
|
|
16
|
-
The package `engines` field is Node.js 20 or later. Node 20 is end of life (final release 20.20.2) and has no fix for the Brotli out-of-bounds write (CVE-2026-111497). Production hosts should run at least **22.23.
|
|
16
|
+
The package `engines` field is Node.js 20 or later. Node 20 is end of life (final release 20.20.2) and has no fix for the Brotli out-of-bounds write (CVE-2026-111497) or the 2026-11-11 runtime issues. Production hosts should run at least **22.23.5**, **24.22.3**, or **26.13.1** (2026-11-11 security releases: CVE-2026-123863, CVE-2026-123864 and siblings). As of 2026-11-15 those are the current builds on those lines.
|
|
17
17
|
|
|
18
18
|
GitHub Actions CI (`.github/workflows/ci.yml`) runs the suite on Node 24. The release workflow publishes on Node 24 as well.
|
|
19
19
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## 前置要求
|
|
4
4
|
|
|
5
|
-
- Node.js 20 或以上(`engines`)。Node 20 已結束支援,沒有 CVE-2026-111497
|
|
5
|
+
- Node.js 20 或以上(`engines`)。Node 20 已結束支援,沒有 CVE-2026-111497 或 2026-11-11 執行時期問題的修補。生產環境應使用 Node ≥22.23.5、≥24.22.3 或 ≥26.13.1。見[維運](operations.md)。
|
|
6
6
|
- 文字 GGUF:`PATH` 上的 `llama-server`,或 `OMNI_LLAMA_SERVER`
|
|
7
7
|
- 文字 safetensors:`vLLM`(`OMNI_VLLM`)
|
|
8
8
|
- 圖像/語音/影片:OpenAI 形狀的 HTTP worker(見[媒體](media.md))
|
package/docs/zh/operations.md
CHANGED
|
@@ -13,7 +13,7 @@ curl -sS http://127.0.0.1:3850/ready
|
|
|
13
13
|
|
|
14
14
|
## Node.js 執行時期
|
|
15
15
|
|
|
16
|
-
套件 `engines` 為 Node.js 20 或以上。Node 20 已結束支援(最後版本 20.20.2),沒有 Brotli 越界寫入(CVE-2026-111497
|
|
16
|
+
套件 `engines` 為 Node.js 20 或以上。Node 20 已結束支援(最後版本 20.20.2),沒有 Brotli 越界寫入(CVE-2026-111497)或 2026-11-11 執行時期問題的修補。生產主機至少應使用 **22.23.5**、**24.22.3** 或 **26.13.1**(2026-11-11 安全版本:CVE-2026-123863、CVE-2026-123864 及同批)。截至 2026-11-15,這些就是各線上的現行版本。
|
|
17
17
|
|
|
18
18
|
GitHub Actions CI(`.github/workflows/ci.yml`)在 Node 24 上執行測試。發佈工作流程同樣在 Node 24 上發佈。
|
|
19
19
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ysk-omni",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "YSK Omni — local models behind an OpenAI-compatible gateway, with Admin panel and CLI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"openai",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"dependencies": {
|
|
77
77
|
"@prisma/client": "6.19.3",
|
|
78
78
|
"commander": "^13.1.0",
|
|
79
|
-
"cors": "^2.8.
|
|
79
|
+
"cors": "^2.8.6",
|
|
80
80
|
"dotenv": "^16.4.7",
|
|
81
81
|
"execa": "5.1.1",
|
|
82
82
|
"express": "^4.22.3",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
},
|
|
91
91
|
"devDependencies": {
|
|
92
92
|
"@eslint/js": "^9.39.5",
|
|
93
|
-
"@types/cors": "^2.8.
|
|
93
|
+
"@types/cors": "^2.8.19",
|
|
94
94
|
"@types/express": "^4.17.21",
|
|
95
95
|
"@types/multer": "^2.3.0",
|
|
96
96
|
"@types/node": "^22.20.5",
|
|
@@ -100,8 +100,8 @@
|
|
|
100
100
|
"pino-pretty": "^13.2.0",
|
|
101
101
|
"tsx": "^4.23.15",
|
|
102
102
|
"typescript": "5.8",
|
|
103
|
-
"typescript-eslint": "^8.72.
|
|
104
|
-
"vite": "^6.4.
|
|
103
|
+
"typescript-eslint": "^8.72.2",
|
|
104
|
+
"vite": "^6.4.6",
|
|
105
105
|
"vitest": "^3.0.9"
|
|
106
106
|
},
|
|
107
107
|
"engines": {
|
|
@@ -109,6 +109,6 @@
|
|
|
109
109
|
},
|
|
110
110
|
"overrides": {
|
|
111
111
|
"body-parser": "1.20.9",
|
|
112
|
-
"qs": "6.
|
|
112
|
+
"qs": "6.17.1"
|
|
113
113
|
}
|
|
114
114
|
}
|
package/public/admin/boot.js
CHANGED
|
@@ -28,7 +28,7 @@ const Vs="YSK Omni",Ws="Admin Panel",Qs="Admin",Js="API Key",Ys="One-time login
|
|
|
28
28
|
<div class="lang-switch-heading">${dt(a)}</div>
|
|
29
29
|
<ul class="lang-switch-list" role="listbox" aria-label="${dt(a)}">${i}</ul>
|
|
30
30
|
</div>
|
|
31
|
-
</div>`}function Ht(){document.querySelectorAll("[data-lang-switch]").forEach(a=>{a.classList.remove("is-open");const s=a.querySelector(".lang-switch-btn"),i=a.querySelector(".lang-switch-panel");s&&s.setAttribute("aria-expanded","false"),i&&i.setAttribute("hidden","")})}function cm(a){const s=a.querySelector(".lang-switch-btn"),i=a.querySelector(".lang-switch-panel");if(!s||!i)return;const o=s.getBoundingClientRect(),n=Math.min(280,Math.max(o.width,228)),d=Math.min(Math.max(8,o.left),Math.max(8,window.innerWidth-n-8));i.style.width=`${n}px`,i.style.left=`${d}px`;const r=window.innerHeight-o.bottom;r<260&&o.top>r?(i.style.top="auto",i.style.bottom=`${window.innerHeight-o.top+6}px`):(i.style.top=`${o.bottom+6}px`,i.style.bottom="auto")}function ns(a){document.querySelectorAll("[data-lang-switch]").forEach(s=>{const i=s.querySelector(".lang-switch-btn"),o=s.querySelector(".lang-switch-panel");if(!i||!o)return;const n=()=>{Ht(),s.classList.add("is-open"),i.setAttribute("aria-expanded","true"),o.removeAttribute("hidden"),cm(s)},d=()=>{s.classList.remove("is-open"),i.setAttribute("aria-expanded","false"),o.setAttribute("hidden","")};o.addEventListener("click",r=>r.stopPropagation()),i.addEventListener("click",r=>{r.stopPropagation(),s.classList.contains("is-open")?d():n()}),s.querySelectorAll("[data-lang]").forEach(r=>{r.addEventListener("click",u=>{u.stopPropagation();const m=r.getAttribute("data-lang")||"";if(!Ma(m)||m===ze){d();return}nm(m),a()})})}),window.__yskLangSwitchBound||(window.__yskLangSwitchBound=!0,document.addEventListener("click",()=>Ht()),document.addEventListener("keydown",s=>{s.key==="Escape"&&Ht()}),window.addEventListener("resize",()=>Ht()))}os(ze);const um="1.0.
|
|
31
|
+
</div>`}function Ht(){document.querySelectorAll("[data-lang-switch]").forEach(a=>{a.classList.remove("is-open");const s=a.querySelector(".lang-switch-btn"),i=a.querySelector(".lang-switch-panel");s&&s.setAttribute("aria-expanded","false"),i&&i.setAttribute("hidden","")})}function cm(a){const s=a.querySelector(".lang-switch-btn"),i=a.querySelector(".lang-switch-panel");if(!s||!i)return;const o=s.getBoundingClientRect(),n=Math.min(280,Math.max(o.width,228)),d=Math.min(Math.max(8,o.left),Math.max(8,window.innerWidth-n-8));i.style.width=`${n}px`,i.style.left=`${d}px`;const r=window.innerHeight-o.bottom;r<260&&o.top>r?(i.style.top="auto",i.style.bottom=`${window.innerHeight-o.top+6}px`):(i.style.top=`${o.bottom+6}px`,i.style.bottom="auto")}function ns(a){document.querySelectorAll("[data-lang-switch]").forEach(s=>{const i=s.querySelector(".lang-switch-btn"),o=s.querySelector(".lang-switch-panel");if(!i||!o)return;const n=()=>{Ht(),s.classList.add("is-open"),i.setAttribute("aria-expanded","true"),o.removeAttribute("hidden"),cm(s)},d=()=>{s.classList.remove("is-open"),i.setAttribute("aria-expanded","false"),o.setAttribute("hidden","")};o.addEventListener("click",r=>r.stopPropagation()),i.addEventListener("click",r=>{r.stopPropagation(),s.classList.contains("is-open")?d():n()}),s.querySelectorAll("[data-lang]").forEach(r=>{r.addEventListener("click",u=>{u.stopPropagation();const m=r.getAttribute("data-lang")||"";if(!Ma(m)||m===ze){d();return}nm(m),a()})})}),window.__yskLangSwitchBound||(window.__yskLangSwitchBound=!0,document.addEventListener("click",()=>Ht()),document.addEventListener("keydown",s=>{s.key==="Escape"&&Ht()}),window.addEventListener("resize",()=>Ht()))}os(ze);const um="1.0.8",mm={version:um},pm=String(mm.version),rs=new Set([".txt",".md",".markdown",".csv",".json",".xml",".html",".htm",".js",".ts",".tsx",".jsx",".py",".java",".go",".rs",".c",".cpp",".h",".hpp",".css",".yml",".yaml",".toml",".ini",".env",".sh",".sql",".log",".pdf",".png",".jpg",".jpeg",".webp",".gif"]),gm=[...rs].join(","),ft="/admin/api",Vt="gog_admin_session";let Xe=null,Ze=!1;function Ia(a,s){const i=a?.error&&typeof a.error=="object"?a.error:a||{},o=typeof i.code=="string"?i.code:"",n=i.details&&typeof i.details=="object"?i.details:{},d=typeof n.feature=="string"?n.feature:typeof n.flag=="string"?n.flag:"",r=typeof n.reason=="string"?n.reason:"",u=String(i.message||a?.message||s||"");if(d&&(o==="feature_disabled"||o==="media_not_supported"||o==="forbidden")){const c=`errors.feature.${d}`;if(Pe(c))return e(c)}if(o==="feature_disabled"&&Pe("errors.feature_disabled")){const c=la(u);return c&&Pe(`errors.feature.${c}`)?e(`errors.feature.${c}`):e("errors.feature_disabled")}if(r&&Pe(`errors.media.${r}`))return e(`errors.media.${r}`);if(o==="media_generation_failed"&&r&&Pe(`errors.media.${r}`))return e(`errors.media.${r}`);if(o==="media_forbidden"&&Pe("errors.media_forbidden"))return e("errors.media_forbidden");const m=la(u);if(m&&Pe(`errors.feature.${m}`))return e(`errors.feature.${m}`);if(o){const c=`errors.${o}`;if(Pe(c))return e(c)}const g=la(u);return g&&Pe(`errors.feature.${g}`)?e(`errors.feature.${g}`):/agent-mode|agent mode|Safe keys cannot/i.test(u)?e("errors.media.agent_or_admin_required"):/no image file was found/i.test(u)?e("errors.media.no_image_in_sandbox"):/no video file was found/i.test(u)?e("errors.media.no_video_in_sandbox"):/does not support image edits/i.test(u)?e("errors.media.provider_no_edit"):/Provide an image file|sourceAssetId|sourceDocumentId/i.test(u)?e("errors.media.source_required"):/must be an image/i.test(u)?e("errors.media.source_must_be_image"):u||e("common.requestFailed")}function la(a){const s=String(a||"");return/videoApi/i.test(s)||/Video API is disabled/i.test(s)?"videoApi":/imagesApi/i.test(s)||/Images API is disabled/i.test(s)?"imagesApi":/audioApi/i.test(s)||/Audio API is disabled/i.test(s)?"audioApi":/filesOpenAiAlias/i.test(s)||/Files API alias/i.test(s)?"filesOpenAiAlias":/Tools are disabled/i.test(s)||/\btools\b/i.test(s)&&/disabled/i.test(s)&&/image/i.test(s)?"tools":""}const l={key:sessionStorage.getItem(Vt)||"",page:"dashboard",me:null,error:"",modal:null,chatFilter:{q:"",status:"",model:"",apiKeyId:"",from:"",to:"",policyMode:"",hasDocuments:"",sortBy:"createdAt",sortDir:"desc",limit:50,offset:0},docFilter:{q:"",apiKeyId:"",storageType:"",from:"",to:"",sortBy:"createdAt",sortDir:"desc",limit:20,offset:0},keyFilter:{q:"",role:"",mode:"",isActive:"",sortBy:"createdAt",sortDir:"desc",limit:20,offset:0},auditFilter:{q:"",action:"",apiKeyId:"",from:"",to:"",sortBy:"createdAt",sortDir:"desc",limit:50,offset:0},usageFilter:{tab:"model",modelQ:"",keyQ:"",keyActive:"",modelPage:0,keyPage:0,pageSize:10,sortBy:"lastUsedAt",sortDir:"desc",modelSortBy:"requests",modelSortDir:"desc"},ddosFilter:{tab:"policy",liveQ:"",banQ:"",banSource:"",livePage:0,banPage:0,pageSize:15,liveSortBy:"startedAt",liveSortDir:"desc",banSortBy:"createdAt",banSortDir:"desc",eventSortBy:"at",eventSortDir:"desc"},mediaFilter:{tab:"studio",q:"",kind:"",provider:"",from:"",to:"",sortBy:"createdAt",sortDir:"desc",jobSortBy:"createdAt",jobSortDir:"desc",limit:20,offset:0},systemTab:"software",sessionQ:"",pm2Tab:"runner",apiFeaturesTab:"protocols",catalogTab:"local",catalogModality:"",catalogPulling:"",catalogPull:{id:"",bytes:0,total:0},catalogQueue:[],catalogQueueRunning:!1,catalogHubQ:"",catalogHubHits:null,catalogHubNext:"",catalogHubBusy:!1,catalogPopularSyncedAt:"",runtimesOs:"host",runtimesMod:"",runtimesReport:null,runtimesInstall:null,models:[],catalogLocal:[],keys:[]},fm={login:"login",dashboard:"dashboard",chat:"chat",chats:"chats",keys:"keys",documents:"documents",media:"media",catalog:"catalog",runtimes:"runtimes",audit:"audit",settings:"settings","api-features":"apiFeatures",apifeatures:"apiFeatures",usage:"usage",ddos:"ddos",queue:"queue",pm2:"pm2",system:"system",support:"support",business:"business"};function bm(a){return a==="apiFeatures"?"api-features":a||"dashboard"}function wa(a){const s=String(a||"").replace(/^#\/?/,"").split("?")[0].split("/")[0].toLowerCase();return s?s==="runtime"||s==="engines"||s==="engine"?"runtimes":fm[s]||null:null}function Ta(a){const s=`#/${bm(a)}`;location.hash!==s&&history.pushState(null,"",s)}function hm(){const a=wa(location.hash);return a||(l.key?"dashboard":"login")}async function I(a,s={}){const i={...s.body?{"Content-Type":"application/json"}:{},...l.key?{Authorization:`Bearer ${l.key}`}:{},...s.headers||{}},o=await fetch(`${ft}${a}`,{...s,headers:i}),n=await o.text();let d=null;try{d=n?JSON.parse(n):null}catch{d={error:{message:n}}}if(!o.ok){const r=Ia(d,o.statusText),u=d?.error?.code||"";o.status===401?l.page!=="login"&&Wt(!1):o.status===403&&!["media_forbidden","feature_disabled","forbidden","media_not_supported"].includes(u)&&l.page!=="login"&&Wt(!1);const m=new Error(r);throw m.status=o.status,m.code=u,m.details=d?.error?.details,m}return d}async function Ft(a){const s=await a.text();let i=null;try{i=s?JSON.parse(s):null}catch{i={error:{message:s}}}if(!a.ok){const o=Ia(i,a.statusText),n=new Error(o);throw n.status=a.status,n.code=i?.error?.code,n.details=i?.error?.details,n}return i}function Wt(a=!0){const s=l.key;a&&s&&String(s).startsWith("gog_sess_")&&fetch("/admin/api/auth/logout",{method:"POST",headers:{Authorization:`Bearer ${s}`}}).catch(()=>{}),a&&sessionStorage.removeItem(Vt),l.key="",l.me=null,l.page="login",Ta("login"),oa()}function xa(a){Ca(a,{writeHash:!0})}function Ca(a,s={}){const i=a||"dashboard";l.page=i,l.modal=null,l.error="",i==="chats"&&(l.chatFilter.offset=0),i==="documents"&&(l.docFilter.offset=0),i==="keys"&&(l.keyFilter.offset=0),i==="audit"&&(l.auditFilter.offset=0),i==="media"&&(l.mediaFilter.offset=0),i!=="ddos"&&Xe&&(clearInterval(Xe),Xe=null),i!=="chat"&&document.body.classList.remove("chat-history-open"),s.writeHash!==!1&&Ta(i),oa()}function t(a){return String(a??"").replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")}let Le=null,Qt=null;function et(a){const s=Qt;Qt=null,Le&&(Le.remove(),Le=null),document.body.classList.remove("ui-dialog-open"),document.removeEventListener("keydown",Ea,!0),s&&s(a)}function Ea(a){if(Le&&a.key==="Escape"){a.preventDefault(),a.stopPropagation();const s=Le.dataset.cancelable!=="0";et(s?Le.dataset.prompt==="1"?null:!1:!0)}}function La(a){Le&&et(!1);const s=a.variant||(a.showCancel===!1?"info":"confirm"),i=a.showCancel!==!1,o=!!a.input,n=a.title||e(s==="danger"?"common.dangerTitle":i?"common.confirmTitle":"common.notice"),d=a.confirmText||e(i?"common.confirm":"common.ok"),r=a.cancelText||e("common.cancel"),u=s==="danger"?"!":s==="info"&&!i?"i":"?",m=document.createElement("div");m.className="ui-dialog-back",m.id="ui-dialog-back",m.dataset.cancelable=i||o?"1":"0",m.dataset.prompt=o?"1":"0",m.setAttribute("role","presentation"),m.innerHTML=`
|
|
32
32
|
<div class="ui-dialog ui-dialog--${t(s)}" role="alertdialog" aria-modal="true" aria-labelledby="ui-dialog-title" aria-describedby="ui-dialog-msg">
|
|
33
33
|
<div class="ui-dialog-h">
|
|
34
34
|
<div class="ui-dialog-icon" aria-hidden="true">${u}</div>
|
package/public/admin/index.html
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
rel="stylesheet"
|
|
15
15
|
/>
|
|
16
16
|
<link rel="stylesheet" href="/admin/styles.css?v=__ADMIN_ASSET_V__" />
|
|
17
|
-
<!-- GFM markdown + sanitize for chat bubbles (vendor: marked@15.0.7, dompurify@3.4.
|
|
17
|
+
<!-- GFM markdown + sanitize for chat bubbles (vendor: marked@15.0.7, dompurify@3.4.18) -->
|
|
18
18
|
<script src="/admin/vendor/marked.min.js?v=__ADMIN_ASSET_V__"></script>
|
|
19
19
|
<script src="/admin/vendor/purify.min.js?v=__ADMIN_ASSET_V__"></script>
|
|
20
20
|
</head>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! @license DOMPurify 3.4.
|
|
1
|
+
/*! @license DOMPurify 3.4.18 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.18/LICENSE */
|
|
2
2
|
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.DOMPurify=t())})(this,function(){"use strict";function e(e,t){this.v=e,this.k=t}function t(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function n(e){if(Array.isArray(e))return e}function r(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function i(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
3
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}
|
|
4
4
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
5
|
-
function a(e,t){return n(e)||r(e,t)||o(e,t)||i()}function o(e,n){if(e){if(typeof e==`string`)return t(e,n);var r={}.toString.call(e).slice(8,-1);return r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`?Array.from(e):r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}function s(t){var n,r;function i(n,r){try{var o=t[n](r),s=o.value,c=s instanceof e;Promise.resolve(c?s.v:s).then(function(e){if(c){var r=n===`return`&&s.k?n:`next`;if(!s.k||e.done)return i(r,e);e=t[r](e).value}a(!!o.done,e)},function(e){i(`throw`,e)})}catch(e){a(2,e)}}function a(e,t){e===2?n.reject(t):n.resolve({value:t,done:e}),(n=n.next)?i(n.key,n.arg):r=null}this._invoke=function(e,t){return new Promise(function(a,o){var s={key:e,arg:t,resolve:a,reject:o,next:null};r?r=r.next=s:(n=r=s,i(e,t))})},typeof t.return!=`function`&&(this.return=void 0)}s.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},s.prototype.next=function(e){return this._invoke(`next`,e)},s.prototype.throw=function(e){return this._invoke(`throw`,e)},s.prototype.return=function(e){return this._invoke(`return`,e)};let c=Object.entries,l=Object.setPrototypeOf,u=Object.isFrozen,d=Object.getPrototypeOf,f=Object.getOwnPropertyDescriptor,p=Object.freeze,m=Object.seal,h=Object.create,ee=typeof Reflect<`u`&&Reflect,g=ee.apply,te=ee.construct;p||(p=function(e){return e}),m||(m=function(e){return e}),g||(g=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)}),te||(te=function(e){return new e(...[...arguments].slice(1))});let _=E(Array.prototype.forEach);Array.prototype.indexOf;let ne=E(Array.prototype.lastIndexOf),re=E(Array.prototype.pop),ie=E(Array.prototype.push),ae=E(Array.prototype.slice),oe=E(Array.prototype.splice),v=Array.isArray,se=D(Set),ce=E(Set.prototype.add),le=E(Set.prototype.has),y=E(String.prototype.toLowerCase),ue=E(String.prototype.toString),de=E(String.prototype.match),fe=E(String.prototype.replace),pe=E(String.prototype.indexOf),me=E(String.prototype.trim),he=E(Number.prototype.toString),b=E(Boolean.prototype.toString),x=typeof BigInt>`u`?null:E(BigInt.prototype.toString),ge=typeof Symbol>`u`?null:E(Symbol.prototype.toString),S=E(Object.prototype.hasOwnProperty),C=E(Object.prototype.toString),w=E(RegExp.prototype.test),T=D(TypeError);function E(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return g(e,t,n)}}function D(e){return function(){return te(e,[...arguments])}}function O(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:y;if(l&&l(e,null),!v(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(u(t)||(t[r]=e),i=e)}e[i]=!0}return e}function _e(e){for(let t=0;t<e.length;t++)S(e,t)||(e[t]=null);return e}function k(e){let t=h(null);for(let r of c(e)){var n=a(r,2);let i=n[0],o=n[1];S(e,i)&&(t[i]=v(o)?_e(o):o&&typeof o==`object`&&o.constructor===Object?k(o):o)}return t}function ve(e){switch(typeof e){case`string`:return e;case`number`:return he(e);case`boolean`:return b(e);case`bigint`:return x?x(e):`0`;case`symbol`:return ge?ge(e):`Symbol()`;case`undefined`:return C(e);case`function`:case`object`:{if(e===null)return C(e);let t=e,n=A(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:C(e)}return C(e)}default:return C(e)}}function A(e,t){for(;e!==null;){let n=f(e,t);if(n){if(n.get)return E(n.get);if(typeof n.value==`function`)return E(n.value)}e=d(e)}function n(){return null}return n}function ye(e,t){for(;e!==null;){let n=f(e,t);if(n)return n.get?E(n.get):null;e=d(e)}return null}function be(e){try{return w(e,``),!0}catch(e){return!1}}let xe=p(/* @__PURE__ */ `a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Se=p(/* @__PURE__ */ `svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),Ce=p([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),we=p([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),Te=p(/* @__PURE__ */ `math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),Ee=p([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),De=p([`#text`]),Oe=p(/* @__PURE__ */ `accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),ke=p(/* @__PURE__ */ `accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),Ae=p(/* @__PURE__ */ `accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),je=p([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Me=m(/{{[\w\W]*|^[\w\W]*}}/g),Ne=m(/<%[\w\W]*|^[\w\W]*%>/g),Pe=m(/\${[\w\W]*/g),Fe=m(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ie=m(/^aria-[\-\w]+$/),Le=m(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Re=m(/^(?:\w+script|data):/i),ze=m(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Be=m(/^html$/i),Ve=m(/^[a-z][.\w]*(-[.\w]+)+$/i),He=m(/<[/\w!]/g),Ue=m(/<[/\w]/g),We=m(/<\/no(script|embed|frames)/i),Ge=m(/\/>/i),j={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Ke=p(O({},[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`])),qe=function(){return typeof window>`u`?null:window},Je=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch(e){return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},Ye=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},M=function(e,t,n,r){return S(e,t)&&v(e[t])?O(r.base?k(r.base):{},e[t],r.transform):n},Xe=function(e,t,n){let r=S(e,t)?e[t]:void 0;return r&&typeof r==`object`?k(r):n()};function Ze(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:qe(),t=e=>Ze(e);if(t.version=`3.4.17`,t.removed=[],!e||!e.document||e.document.nodeType!==j.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,l=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let u=e.DOMParser,d=e.trustedTypes,f=s.prototype,ee=A(f,`cloneNode`),g=A(f,`remove`),te=A(f,`removeAttributeNode`),he=A(f,`nextSibling`),b=A(f,`childNodes`),x=A(f,`parentNode`),ge=A(f,`shadowRoot`),C=A(f,`attributes`),E=o&&o.prototype?A(o.prototype,`nodeType`):null,D=o&&o.prototype?A(o.prototype,`nodeName`):null,_e=o&&o.prototype?A(o.prototype,`ownerDocument`):null,N=function(e){return E?E(e):e.nodeType},Qe=function(e){return D?D(e):e.nodeName},$e=ye(f,`namespaceURI`),et=function(e){return $e?$e(e):e.namespaceURI};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let P,F=``,tt,nt=!1,rt=0,it=function(){if(rt>0)throw T(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},at=function(e){it(),rt++;try{return P.createHTML(e)}finally{rt--}},ot=function(e){it(),rt++;try{return P.createScriptURL(e)}finally{rt--}},st=function(){return nt||(tt=Je(d,i),nt=!0),tt},ct=n,lt=ct.implementation,ut=ct.createNodeIterator,dt=ct.createDocumentFragment,ft=ct.getElementsByTagName,pt=r.importNode,I=Ye();t.isSupported=typeof c==`function`&&typeof x==`function`&<&<.createHTMLDocument!==void 0;let mt=Me,ht=Ne,gt=Pe,_t=Fe,vt=Ie,yt=Re,bt=ze,xt=Ve,St=Le,L=null,Ct=O({},[...xe,...Se,...Ce,...Te,...De]),R=null,wt=O({},[...Oe,...ke,...Ae,...je]),z=Object.seal(h(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Tt=null,Et=null,B=Object.seal(h(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Dt=!0,Ot=!0,kt=!1,At=!0,V=!1,H=!0,U=!1,jt=!1,Mt=null,Nt=null,Pt=!1,W=!1,Ft=!1,It=!1,Lt=!0,Rt=!1,zt=`user-content-`,Bt=!0,Vt=!1,G=null,K={},q=null,Ht=O({},/* @__PURE__ */ `annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Ut=null,Wt=O({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Gt=null,Kt=O({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),qt=`http://www.w3.org/1998/Math/MathML`,Jt=`http://www.w3.org/2000/svg`,J=`http://www.w3.org/1999/xhtml`,Yt=J,Xt=!1,Zt=null,Qt=O({},[qt,Jt,J],ue),$t=p([`mi`,`mo`,`mn`,`ms`,`mtext`]),en=O({},$t),tn=p([`annotation-xml`]),nn=O({},tn),rn=O({},[`title`,`style`,`font`,`a`,`script`]),an=null,on=[`application/xhtml+xml`,`text/html`],Y=null,sn=null,cn=n.createElement(`form`),ln=function(e){return e instanceof RegExp||e instanceof Function},un=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(sn&&sn===e)return;(!e||typeof e!=`object`)&&(e={}),e=k(e),an=on.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,Y=an===`application/xhtml+xml`?ue:y,L=M(e,`ALLOWED_TAGS`,Ct,{transform:Y}),R=M(e,`ALLOWED_ATTR`,wt,{transform:Y}),Zt=M(e,`ALLOWED_NAMESPACES`,Qt,{transform:ue}),Gt=M(e,`ADD_URI_SAFE_ATTR`,Kt,{transform:Y,base:Kt}),Ut=M(e,`ADD_DATA_URI_TAGS`,Wt,{transform:Y,base:Wt}),q=M(e,`FORBID_CONTENTS`,Ht,{transform:Y}),Tt=M(e,`FORBID_TAGS`,k({}),{transform:Y}),Et=M(e,`FORBID_ATTR`,k({}),{transform:Y}),K=S(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?k(e.USE_PROFILES):e.USE_PROFILES:!1,Dt=e.ALLOW_ARIA_ATTR!==!1,Ot=e.ALLOW_DATA_ATTR!==!1,kt=e.ALLOW_UNKNOWN_PROTOCOLS||!1,At=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,V=e.SAFE_FOR_TEMPLATES||!1,H=e.SAFE_FOR_XML!==!1,U=e.WHOLE_DOCUMENT||!1,W=e.RETURN_DOM||!1,Ft=e.RETURN_DOM_FRAGMENT||!1,It=e.RETURN_TRUSTED_TYPE||!1,Pt=e.FORCE_BODY||!1,Lt=e.SANITIZE_DOM!==!1,Rt=e.SANITIZE_NAMED_PROPS||!1,Bt=e.KEEP_CONTENT!==!1,Vt=e.IN_PLACE||!1,St=be(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Le,Yt=typeof e.NAMESPACE==`string`?e.NAMESPACE:J,en=Xe(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>O({},$t)),nn=Xe(e,`HTML_INTEGRATION_POINTS`,()=>O({},tn));let t=Xe(e,`CUSTOM_ELEMENT_HANDLING`,()=>h(null));if(z=h(null),S(t,`tagNameCheck`)&&ln(t.tagNameCheck)&&(z.tagNameCheck=t.tagNameCheck),S(t,`attributeNameCheck`)&&ln(t.attributeNameCheck)&&(z.attributeNameCheck=t.attributeNameCheck),S(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(z.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),m(z),V&&(Ot=!1),Ft&&(W=!0),K&&(L=O({},De),R=h(null),K.html===!0&&(O(L,xe),O(R,Oe)),K.svg===!0&&(O(L,Se),O(R,ke),O(R,je)),K.svgFilters===!0&&(O(L,Ce),O(R,ke),O(R,je)),K.mathMl===!0&&(O(L,Te),O(R,Ae),O(R,je))),B.tagCheck=null,B.attributeCheck=null,S(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?B.tagCheck=e.ADD_TAGS:v(e.ADD_TAGS)&&(L===Ct&&(L=k(L)),O(L,e.ADD_TAGS,Y))),S(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?B.attributeCheck=e.ADD_ATTR:v(e.ADD_ATTR)&&(R===wt&&(R=k(R)),O(R,e.ADD_ATTR,Y))),S(e,`ADD_FORBID_CONTENTS`)&&v(e.ADD_FORBID_CONTENTS)&&(q===Ht&&(q=k(q)),O(q,e.ADD_FORBID_CONTENTS,Y)),Bt&&(L[`#text`]=!0),U&&O(L,[`html`,`head`,`body`]),L.table&&(O(L,[`tbody`]),delete Tt.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw T(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw T(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=P;P=e.TRUSTED_TYPES_POLICY;try{F=at(``)}catch(e){throw P=t,e}}else e.TRUSTED_TYPES_POLICY===null?(P=void 0,F=``):(P===void 0&&(P=st()),P&&typeof F==`string`&&(F=at(``)));p&&p(e),sn=e},dn=O({},[...Se,...Ce,...we]),fn=O({},[...Te,...Ee]),pn=function(e,t,n){return t.namespaceURI===J?e===`svg`:t.namespaceURI===qt?e===`svg`&&(n===`annotation-xml`||en[n]):!!dn[e]},mn=function(e,t,n){return t.namespaceURI===J?e===`math`:t.namespaceURI===Jt?e===`math`&&nn[n]:!!fn[e]},hn=function(e,t,n){return t.namespaceURI===Jt&&!nn[n]||t.namespaceURI===qt&&!en[n]?!1:!fn[e]&&(rn[e]||!dn[e])},gn=function(e){let t=et(e),n=y(Qe(e)),r=x(e),i,a;return r&&N(r)===j.element?(i={namespaceURI:et(r)},a=y(Qe(r))):(i={namespaceURI:Yt},a=`template`),Zt[t]?t===Jt?pn(n,i,a):t===qt?mn(n,i,a):t===J?hn(n,i,a):!!(an===`application/xhtml+xml`&&Zt[t]):!1},X=function(e){ie(t.removed,{element:e});try{x(e).removeChild(e)}catch(t){if(g(e),!x(e))throw T(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},_n=function(e,t,n){try{te(e,t)}catch(t){try{e.removeAttribute(n)}catch(e){}}},vn=function(e){Sn(e);let t=b(e);t&&_(ae(t),e=>{try{g(e)}catch(e){}});let n=N(e)===j.element?C(e):null;if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&_n(e,r,i)}},yn=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch(e){r=null}ie(t.removed,{attribute:r||null,from:n});try{r?te(n,r):n.removeAttribute(e)}catch(t){try{n.removeAttribute(e)}catch(e){}}if(e===`is`){if(W||Ft)try{X(n)}catch(e){}else try{n.setAttribute(e,``)}catch(e){}}},bn=function(e){let t=C(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||R[Y(i)]||_n(e,r,i)}},xn=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=[e];for(;r.length>0;){let e=r.pop();if(t(e)===!1)continue;if(n&&N(e)===j.element){let t=ge(e);Z(t)&&r.push(t)}let i=b(e);if(i)for(let e=i.length-1;e>=0;--e)r.push(i[e])}},Sn=function(e){xn(e,e=>{N(e)===j.element&&bn(e)})},Cn=function(e){let t=[];return xn(e,e=>{t.push(e)},!0),t},wn=function(e,t){let n=se();_(Cn(e),e=>{N(e)===j.element&&ce(n,e)}),_(t,e=>{N(e)===j.element&&!le(n,e)&&bn(e)})},Tn=function(e,n){let r=!1;return _(t.removed,t=>{t.element&&(r=r||t.element===e,Sn(t.element))}),wn(e,n),r},En=function(e,t){let n=G,r=null,i=()=>(r||(r=se(),_(t,e=>{ce(r,e)})),r);for(let t=0;;t++){let r=Cn(e),a=[e],o=!1;if(_(r,e=>{N(e)===j.documentFragment?ie(a,e):!o&&!le(n,e)&&(o=le(i(),e))}),!o)return;if(t>=8)throw T(`the tree kept changing during in-place sanitization; refusing to return it`);_(a,(t,n)=>{Dn(t,n>0,e,i())})}},Dn=function(e,t,n,r){let i=Mn(e),a;for(;a=i.nextNode();)le(r,a)&&!le(G,a)&&(t&&Q(I.uponSanitizeShadowNode,a,null),Hn(a,n),Yn(a,n),Z(a.content)&&Xn(a.content))},On=function(e){G&&ce(G,e)},kn=function(e,t){return H?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},An=function(e){H&&xn(e,e=>{let t=N(e);if(t===j.processingInstruction||t===j.comment&&w(Ue,e.data)){try{g(e)}catch(e){}return!1}if(t===j.element){let t=e,n=Y(Qe(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&kn(`for`,n)&&t.removeAttribute(`for`)}catch(e){}}return!0})},jn=function(e){let t=null,r=null;if(Pt)e=`<remove></remove>`+e;else{let t=de(e,/^[\r\n\t ]+/);r=t&&t[0]}an===`application/xhtml+xml`&&Yt===J&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=P?at(e):e;if(Yt===J)try{t=new u().parseFromString(i,an)}catch(e){}if(!t||!t.documentElement){t=lt.createDocument(Yt,`template`,null);try{t.documentElement.innerHTML=Xt?F:i}catch(e){}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Yt===J?ft.call(t,U?`html`:`body`)[0]:U?t.documentElement:a},Mn=function(e){let t=_e?_e(e):e.ownerDocument;return ut.call(t||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},Nn=function(e){return e=fe(e,mt,` `),e=fe(e,ht,` `),e=fe(e,gt,` `),e},Pn=function(e){var t;Fn(e);let n=(t=e.querySelectorAll)==null?void 0:t.call(e,`template`);n&&_(n,e=>{Z(e.content)&&Pn(e.content)})},Fn=function(e){e.normalize();let t=_e?_e(e):e.ownerDocument,n=ut.call(t||e,e,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=Nn(r.data),r=n.nextNode()},In=function(e){let t=D?D(e):null;return typeof t!=`string`||Y(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==C(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==E(e)||e.childNodes!==b(e)},Z=function(e){if(!E||typeof e!=`object`||!e)return!1;try{return E(e)===j.documentFragment}catch(e){return!1}},Ln=function(e){if(!E||typeof e!=`object`||!e)return!1;try{return typeof E(e)==`number`}catch(e){return!1}};function Q(e,n,r){e.length!==0&&_(e,e=>{e.call(t,n,r,sn)})}let Rn=function(e,t){return!!(H&&e.hasChildNodes()&&!Ln(e.firstElementChild)&&w(He,e.textContent)&&w(He,e.innerHTML)||H&&Ke[t]&&N(e)===j.element&&et(e)===J&&(Ln(e.firstElementChild)||typeof e.textContent==`string`&&w(He,e.textContent))||e.nodeType===j.processingInstruction||H&&e.nodeType===j.comment&&w(Ue,e.data))},zn=function(e,t){return e instanceof RegExp?w(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},Bn=function(e,t,n){if(!Tt[t]&&Gn(t)&&zn(z.tagNameCheck,t))return!1;if(Bt&&!q[t]&&!q[y(t)]){let t=x(e),r=b(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?ee(r[a],!0):r[a];t.insertBefore(i,he(e))}}}return X(e),!0},Vn=function(e,t,n,r){return e.length===0?t:t===n||t===r?k(t):t},$=function(e,t){return e===t||x(e)!==null?!1:(Vt&&Sn(e),!0)},Hn=function(e,n){if(On(e),Q(I.beforeSanitizeElements,e,null),$(e,n))return!0;if(In(e))return X(e),!0;let r=Y(Qe(e));if(L=Vn(I.uponSanitizeElement,L,Ct,Mt),Q(I.uponSanitizeElement,e,{tagName:r,allowedTags:L}),$(e,n))return!0;if(Rn(e,r))return X(e),!0;if(Tt[r]||!(B.tagCheck instanceof Function&&B.tagCheck(r))&&!L[r]){let t=Bn(e,r,n);return t===!1&&(Q(I.afterSanitizeElements,e,null),$(e,n))?!0:t}if(N(e)===j.element&&!gn(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&w(We,e.innerHTML))return X(e),!0;if(V&&e.nodeType===j.text){let n=Nn(e.textContent);e.textContent!==n&&(ie(t.removed,{element:e.cloneNode()}),e.textContent=n)}return Q(I.afterSanitizeElements,e,null),$(e,n)},Un=function(e,t,r){if(Et[t]||kn(t,e)||Lt&&(t===`id`||t===`name`)&&(r in n||r in cn))return!1;let i=R[t]||B.attributeCheck instanceof Function&&B.attributeCheck(t,e);return Ot&&w(_t,t)||Dt&&w(vt,t)?!0:i?Gt[t]||w(St,fe(r,bt,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&pe(r,`data:`)===0&&Ut[e]||kt&&!w(yt,fe(r,bt,``))?!0:!r:Gn(e)&&zn(z.tagNameCheck,e)&&zn(z.attributeNameCheck,t,e)||t===`is`&&z.allowCustomizedBuiltInElements&&zn(z.tagNameCheck,r)},Wn=O({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Gn=function(e){return!Wn[y(e)]&&w(xt,e)},Kn=function(e,t,n,r){if(P&&typeof d==`object`&&typeof d.getAttributeType==`function`&&!n)switch(d.getAttributeType(e,t)){case`TrustedHTML`:return at(r);case`TrustedScriptURL`:return ot(r)}return r},qn=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!In(e)||(X(e),!1)}catch(n){return yn(t,e),!1}},Jn=function(e,t){return H&&w(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,t)?!0:y(e)===`attributename`&&de(t,`href`)!==null},Yn=function(e,n){if(Q(I.beforeSanitizeAttributes,e,null),$(e,n))return;let r=e.attributes;if(!r||In(e))return;R=Vn(I.uponSanitizeAttribute,R,wt,Nt);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:R,forceKeepAttr:void 0},a=r.length,o=Y(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=Y(s),d=l,f=s===`value`?d:me(d),p=!1;i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,Q(I.uponSanitizeAttribute,e,i),f=i.attrValue,Rt&&(u===`id`||u===`name`)&&pe(f,zt)!==0&&(yn(s,e,n),f=zt+f,p=!0),Jn(s,f)?yn(s,e,n):i.forceKeepAttr||(i.keepAttr?!At&&w(Ge,f)?yn(s,e,n):(V&&(f=Nn(f)),Un(o,u,f)?(f=Kn(o,u,c,f),f!==d&&qn(e,s,c,f)&&p&&re(t.removed)):yn(s,e,n)):yn(s,e,n))}Q(I.afterSanitizeAttributes,e,null),$(e,n)},Xn=function(e){let t=null,n=Mn(e);for(Q(I.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Q(I.uponSanitizeShadowNode,t,null),Hn(t,e),Yn(t,e),Z(t.content)&&Xn(t.content),N(t)===j.element){let e=ge(t);Z(e)&&(Zn(e),Xn(e))}V&&Fn(e),Q(I.afterSanitizeShadowDOM,e,null)},Zn=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Xn(e.shadow);continue}let n=e.node,r=N(n)===j.element,i=b(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=D?D(n):null;if(typeof e==`string`&&Y(e)===`template`){let e=n.content;Z(e)&&t.push({node:e,shadow:null})}}if(r){let e=ge(n);Z(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(Xt=!e,Xt&&(e=`<!-->`),typeof e!=`string`&&!Ln(e)&&(e=ve(e),typeof e!=`string`))throw T(`dirty is not a string, aborting`);if(!t.isSupported)return e;jt?(L=Mt,R=Nt):un(n),(I.uponSanitizeElement.length>0||I.uponSanitizeAttribute.length>0)&&(L=k(L)),I.uponSanitizeAttribute.length>0&&(R=k(R)),t.removed=[];let c=Vt&&typeof e!=`string`&&Ln(e),l=[],u=G;if(c){An(e);let t=Qe(e);if(typeof t==`string`){let n=Y(t);if(!L[n]||Tt[n])throw vn(e),T(`root node is forbidden and cannot be sanitized in-place`)}if(In(e))throw vn(e),T(`root node is clobbered and cannot be sanitized in-place`);l=Cn(e),G=se()}else if(Ln(e))i=jn(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===j.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Zn(i);else{if(!W&&!V&&!U&&e.indexOf(`<`)===-1)return P&&It?at(e):e;if(i=jn(e),!i)return W?null:It?F:``}i&&Pt&&X(i.firstChild);let d=c?e:i;try{c&&Zn(e);let t=Mn(d);for(;o=t.nextNode();)Hn(o,d),Yn(o,d),Z(o.content)&&Xn(o.content);c&&En(e,l)}catch(t){throw c&&(vn(e),Tn(e,l)),t}finally{G=u}if(c){if(Tn(e,l))throw T(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return V&&Pn(e),e}if(W){if(V&&Pn(i),Ft)for(s=dt.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(R.shadowroot||R.shadowrootmode)&&(s=pt.call(r,s,!0)),s}let f=U?i.outerHTML:i.innerHTML;return U&&L[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&w(Be,i.ownerDocument.doctype.name)&&(f=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
6
|
-
`+
|
|
5
|
+
function a(e,t){return n(e)||r(e,t)||o(e,t)||i()}function o(e,n){if(e){if(typeof e==`string`)return t(e,n);var r={}.toString.call(e).slice(8,-1);return r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`?Array.from(e):r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}function s(t){var n,r;function i(n,r){try{var o=t[n](r),s=o.value,c=s instanceof e;Promise.resolve(c?s.v:s).then(function(e){if(c){var r=n===`return`&&s.k?n:`next`;if(!s.k||e.done)return i(r,e);e=t[r](e).value}a(!!o.done,e)},function(e){i(`throw`,e)})}catch(e){a(2,e)}}function a(e,t){e===2?n.reject(t):n.resolve({value:t,done:e}),(n=n.next)?i(n.key,n.arg):r=null}this._invoke=function(e,t){return new Promise(function(a,o){var s={key:e,arg:t,resolve:a,reject:o,next:null};r?r=r.next=s:(n=r=s,i(e,t))})},typeof t.return!=`function`&&(this.return=void 0)}s.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},s.prototype.next=function(e){return this._invoke(`next`,e)},s.prototype.throw=function(e){return this._invoke(`throw`,e)},s.prototype.return=function(e){return this._invoke(`return`,e)};let c=Object.entries,l=Object.keys,u=Object.setPrototypeOf,d=Object.isFrozen,f=Object.getPrototypeOf,p=Object.getOwnPropertyDescriptor,m=Object.freeze,h=Object.seal,g=Object.create,ee=typeof Reflect<`u`&&Reflect,te=ee.apply,ne=ee.construct;m||(m=function(e){return e}),h||(h=function(e){return e}),te||(te=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)}),ne||(ne=function(e){return new e(...[...arguments].slice(1))});let _=D(Array.prototype.forEach),re=D(Array.prototype.lastIndexOf),ie=D(Array.prototype.pop),ae=D(Array.prototype.push),oe=D(Array.prototype.slice),se=D(Array.prototype.splice),v=Array.isArray,ce=O(Set),le=D(Set.prototype.add),ue=D(Set.prototype.has),y=D(String.prototype.toLowerCase),de=D(String.prototype.toString),fe=D(String.prototype.match),pe=D(String.prototype.replace),me=D(String.prototype.indexOf),he=D(String.prototype.trim),b=D(Number.prototype.toString),x=D(Boolean.prototype.toString),ge=typeof BigInt>`u`?null:D(BigInt.prototype.toString),_e=typeof Symbol>`u`?null:D(Symbol.prototype.toString),S=D(Object.prototype.hasOwnProperty),C=D(Object.prototype.toString),w=RegExp.prototype.test,T=function(e,t){return e instanceof RegExp&&(e.lastIndex=0),te(w,e,[t])},E=O(TypeError);function D(e){return function(t){var n=[...arguments].slice(1);return te(e,t,n)}}function O(e){return function(){return ne(e,[...arguments])}}function k(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:y;if(u&&u(e,null),!v(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(d(t)||(t[r]=e),i=e)}e[i]=!0}return e}function A(e){for(let t=0;t<e.length;t++)S(e,t)||(e[t]=null);return e}function ve(e){let t=g(null);for(let r of c(e)){var n=a(r,2);let i=n[0],o=n[1];S(e,i)&&(t[i]=v(o)?A(o):o&&typeof o==`object`&&o.constructor===Object?ve(o):o)}return t}function ye(e){let t=g(null),n=l(e),r=n.length;for(;r--;)t[n[r]]=e[n[r]];return t}function be(e){switch(typeof e){case`string`:return e;case`number`:return b(e);case`boolean`:return x(e);case`bigint`:return ge?ge(e):`0`;case`symbol`:return _e?_e(e):`Symbol()`;case`undefined`:return C(e);case`function`:case`object`:{if(e===null)return C(e);let t=e,n=j(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:C(e)}return C(e)}default:return C(e)}}function j(e,t){for(;e!==null;){let n=p(e,t);if(n){if(n.get)return D(n.get);if(typeof n.value==`function`)return D(n.value)}e=f(e)}function n(){return null}return n}function xe(e,t){for(;e!==null;){let n=p(e,t);if(n)return n.get?D(n.get):null;e=f(e)}return null}function Se(e){if(!e)return!1;try{return T(e,``),!0}catch(e){return!1}}let Ce=m(/* @__PURE__ */ `a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),we=m(/* @__PURE__ */ `svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.filter.font.g.glyph.glyphref.hkern.image.line.lineargradient.marker.mask.metadata.mpath.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),Te=m([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),Ee=m([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),De=m(/* @__PURE__ */ `math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),Oe=m([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),ke=m([`#text`]),Ae=m(/* @__PURE__ */ `accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),je=m(/* @__PURE__ */ `accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),Me=m(/* @__PURE__ */ `accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),Ne=m([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Pe=h(/{{[\w\W]*|^[\w\W]*}}/g),Fe=h(/<%[\w\W]*|^[\w\W]*%>/g),Ie=h(/\${[\w\W]*/g),Le=h(/{{|}}|\${|<%|%>|<%|%>/),Re=h(/^data-[\-\w.\u00B7-\uFFFF]+$/),ze=h(/^aria-[\-\w]+$/),Be=h(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ve=h(/^(?:\w+script|data):/i),He=h(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ue=h(/^html$/i),We=h(/^[a-z][.\w]*(-[.\w]+)+$/i),Ge=h(/<[/\w!]/g),Ke=h(/<[/\w]/g),qe=h(/<\/no(script|embed|frames)/i),Je=h(/\/>/i),Ye=h(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i),Xe=h(/^[\r\n\t ]+/),M={element:1,text:3,processingInstruction:7,comment:8,document:9,documentFragment:11},Ze=m(k({},[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`])),Qe=function(){return typeof window>`u`?null:window},$e=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch(e){return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},et=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},N=function(e,t,n,r){return S(e,t)&&v(e[t])?k(r.base?ye(r.base):{},e[t],r.transform):n},tt=function(e,t,n){let r=S(e,t)?e[t]:void 0;return r&&typeof r==`object`?ve(r):n};function nt(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Qe(),t=e=>nt(e);if(t.version=`3.4.18`,t.removed=[],!e||!e.document||e.document.nodeType!==M.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript,a=e.HTMLTemplateElement,o=e.Node,s=e.Element,l=e.NodeFilter,u=e.DOMParser,d=e.trustedTypes,f=s.prototype,p=j(f,`cloneNode`),ee=j(f,`remove`),te=j(f,`removeAttributeNode`),ne=j(f,`nextSibling`),b=j(f,`childNodes`),x=j(f,`parentNode`),ge=j(f,`shadowRoot`),_e=j(f,`attributes`),C=o&&o.prototype?j(o.prototype,`nodeType`):null,w=o&&o.prototype?j(o.prototype,`nodeName`):null,D=o&&o.prototype?j(o.prototype,`ownerDocument`):null,O=function(e){return C?C(e):e.nodeType},A=function(e){return w?w(e):e.nodeName},rt=xe(f,`namespaceURI`),it=function(e){return rt?rt(e):e.namespaceURI};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let P,F=``,at,ot=!1,st=0,ct=function(){if(st>0)throw E(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},lt=function(e){ct(),st++;try{return P.createHTML(e)}finally{st--}},ut=function(e){return P&&Vt?lt(e):e},dt=function(e){ct(),st++;try{return P.createScriptURL(e)}finally{st--}},ft=function(){return ot||(at=$e(d,i),ot=!0),at},pt=n,mt=pt.implementation,ht=pt.createNodeIterator,gt=pt.createDocumentFragment,_t=pt.getElementsByTagName,vt=r.importNode,I=et();t.isSupported=typeof c==`function`&&typeof x==`function`&&mt&&mt.createHTMLDocument!==void 0;let yt=Pe,bt=Fe,xt=Ie,St=Re,Ct=ze,wt=Ve,Tt=He,Et=We,Dt=Be,L=null,Ot=k({},[...Ce,...we,...Te,...De,...ke]),R=null,kt=k({},[...Ae,...je,...Me,...Ne]),z=null,At=null,jt=null,B=Object.seal(g(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Mt=!0,Nt=!0,Pt=!1,Ft=!0,V=!1,H=!0,U=!1,It=!1,Lt=null,Rt=null,zt=!1,W=!1,Bt=!1,Vt=!1,Ht=!0,Ut=!1,Wt=`user-content-`,Gt=!0,Kt=!1,G=null,K=!1,q=null,qt=k({},/* @__PURE__ */ `annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Jt=null,Yt=k({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Xt=null,Zt=k({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Qt=`http://www.w3.org/1998/Math/MathML`,$t=`http://www.w3.org/2000/svg`,J=`http://www.w3.org/1999/xhtml`,Y=J,en=!1,tn=null,nn=k({},[Qt,$t,J],de),rn=m(k({},[`mi`,`mo`,`mn`,`ms`,`mtext`])),an=null,on=m(k({},[`annotation-xml`])),sn=null,cn=m(g(null)),ln=k({},[`title`,`style`,`font`,`a`,`script`]),un=null,dn=[`application/xhtml+xml`,`text/html`],X=null,fn=null,pn=n.createElement(`form`),mn=function(e){return e instanceof RegExp||e instanceof Function},hn=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e&&typeof e==`object`||(e={}),e=ve(e),un=dn.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,X=un===`application/xhtml+xml`?de:y,L=N(e,`ALLOWED_TAGS`,Ot,{transform:X}),R=N(e,`ALLOWED_ATTR`,kt,{transform:X}),tn=N(e,`ALLOWED_NAMESPACES`,nn,{transform:de}),Xt=N(e,`ADD_URI_SAFE_ATTR`,Zt,{transform:X,base:Zt}),Jt=N(e,`ADD_DATA_URI_TAGS`,Yt,{transform:X,base:Yt}),q=N(e,`FORBID_CONTENTS`,qt,{transform:X}),At=N(e,`FORBID_TAGS`,g(null),{transform:X}),jt=N(e,`FORBID_ATTR`,g(null),{transform:X}),K=S(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?ve(e.USE_PROFILES):e.USE_PROFILES:!1,Mt=e.ALLOW_ARIA_ATTR!==!1,Nt=e.ALLOW_DATA_ATTR!==!1,Pt=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ft=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,V=e.SAFE_FOR_TEMPLATES||!1,H=e.SAFE_FOR_XML!==!1,U=e.WHOLE_DOCUMENT||!1,W=e.RETURN_DOM||!1,Bt=e.RETURN_DOM_FRAGMENT||!1,Vt=e.RETURN_TRUSTED_TYPE||!1,zt=e.FORCE_BODY||!1,Ht=e.SANITIZE_DOM!==!1,Ut=e.SANITIZE_NAMED_PROPS||!1,Gt=e.KEEP_CONTENT!==!1,Kt=e.IN_PLACE||!1,Dt=Se(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Be,Y=typeof e.NAMESPACE==`string`?e.NAMESPACE:J,an=tt(e,`MATHML_TEXT_INTEGRATION_POINTS`,rn),sn=tt(e,`HTML_INTEGRATION_POINTS`,on);let t=tt(e,`CUSTOM_ELEMENT_HANDLING`,cn);if(z=g(null),S(t,`tagNameCheck`)&&mn(t.tagNameCheck)&&(z.tagNameCheck=t.tagNameCheck),S(t,`attributeNameCheck`)&&mn(t.attributeNameCheck)&&(z.attributeNameCheck=t.attributeNameCheck),S(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(z.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),h(z),V&&(Nt=!1),Bt&&(W=!0),K&&((S(e,`ALLOWED_TAGS`)||S(e,`ALLOWED_ATTR`))&&typeof console<`u`&&typeof console.warn==`function`&&console.warn(`DOMPurify: USE_PROFILES overrides ALLOWED_TAGS and ALLOWED_ATTR. Do not use these options together.`),L=k({},ke),R=g(null),K.html===!0&&(k(L,Ce),k(R,Ae)),K.svg===!0&&(k(L,we),k(R,je),k(R,Ne)),K.svgFilters===!0&&(k(L,Te),k(R,je),k(R,Ne)),K.mathMl===!0&&(k(L,De),k(R,Me),k(R,Ne))),B.tagCheck=null,B.attributeCheck=null,S(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?B.tagCheck=e.ADD_TAGS:v(e.ADD_TAGS)&&(L===Ot&&(L=ye(L)),k(L,e.ADD_TAGS,X))),S(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?B.attributeCheck=e.ADD_ATTR:v(e.ADD_ATTR)&&(R===kt&&(R=ye(R)),k(R,e.ADD_ATTR,X))),S(e,`ADD_FORBID_CONTENTS`)&&v(e.ADD_FORBID_CONTENTS)&&(q===qt&&(q=ye(q)),k(q,e.ADD_FORBID_CONTENTS,X)),Gt&&(L[`#text`]=!0),U&&k(L,[`html`,`head`,`body`]),L.table&&(L.tbody=!0,delete At.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw E(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw E(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=P;P=e.TRUSTED_TYPES_POLICY;try{F=lt(``)}catch(e){throw P=t,e}}else e.TRUSTED_TYPES_POLICY===null?(P=void 0,F=``):(P===void 0&&(P=ft()),P&&typeof F==`string`&&(F=lt(``)));fn=m(e)},gn=k({},[...we,...Te,...Ee]),_n=k({},[...De,...Oe]),vn=function(e,t,n){return t===J?e===`svg`:t===Qt?e===`svg`&&(n===`annotation-xml`||an[n]):!!gn[e]},yn=function(e,t,n){return t===J?e===`math`:t===$t?e===`math`&&sn[n]:!!_n[e]},bn=function(e,t,n){return t===$t&&!sn[n]||t===Qt&&!an[n]?!1:!_n[e]&&(ln[e]||!gn[e])},xn=function(e){let t=it(e),n=y(A(e)),r=x(e),i=Y,a=`template`;return r&&O(r)===M.element&&(i=it(r),a=y(A(r))),tn[t]?t===$t?vn(n,i,a):t===Qt?yn(n,i,a):t===J?bn(n,i,a):un===`application/xhtml+xml`:!1},Z=function(e){ae(t.removed,{element:e});try{x(e).removeChild(e)}catch(t){if(ee(e),!x(e))throw E(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},Sn=function(e,t,n){try{te(e,t)}catch(t){try{e.removeAttribute(n)}catch(e){}}},Cn=function(e){Dn(e);let t=b(e);t&&_(oe(t),e=>{try{ee(e)}catch(e){}}),O(e)===M.element&&Tn(e,!1)},wn=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch(e){r=null}if(ae(t.removed,{attribute:r||null,from:n}),r)Sn(n,r,e);else try{n.removeAttribute(e)}catch(e){}if(e===`is`){if(W||Bt)try{Z(n)}catch(e){}else try{n.setAttribute(e,``)}catch(e){}}},Tn=function(e,t){let n=_e(e);if(n)for(let r=n.length-1;r>=0;--r){let i=n[r],a=i&&i.name;typeof a==`string`&&!(t&&R[X(a)])&&Sn(e,i,a)}},En=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=[e];for(;r.length>0;){let e=r.pop();if(t(e)===!1)continue;if(n&&O(e)===M.element){let t=ge(e);Un(t)&&r.push(t)}let i=b(e);if(i)for(let e=i.length-1;e>=0;--e)r.push(i[e])}},Dn=function(e){En(e,e=>{O(e)===M.element&&Tn(e,!0)})},On=function(e){let t=[];return En(e,e=>{t.push(e)},!0),t},kn=function(e,t){let n=ce();_(On(e),e=>{O(e)===M.element&&le(n,e)}),_(t,e=>{O(e)===M.element&&!ue(n,e)&&Tn(e,!0)})},An=function(e,n){let r=!1;return _(t.removed,t=>{t.element&&(r=r||t.element===e,Dn(t.element))}),kn(e,n),r},jn=function(e,t){let n=G,r=null,i=()=>(r||(r=ce(),_(t,e=>{le(r,e)})),r);for(let t=0;;t++){let r=On(e),a=[e],o=!1;if(_(r,e=>{O(e)===M.documentFragment?ae(a,e):!o&&!ue(n,e)&&(o=ue(i(),e))}),!o)return;if(t>=8)throw E(`the tree kept changing during in-place sanitization; refusing to return it`);_(a,(t,n)=>{Mn(t,n>0,e,i())})}},Mn=function(e,t,n,r){let i=Ln(e),a;for(;a=i.nextNode();)ue(r,a)&&!ue(G,a)&&(t&&Q(I.uponSanitizeShadowNode,a,null),rr(a,n))},Nn=function(e){G&&le(G,e)},Pn=function(e,t){return H?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},Fn=function(e){H&&En(e,e=>{let t=O(e);if(t===M.processingInstruction||t===M.comment&&T(Ke,e.data)){try{ee(e)}catch(e){}return!1}if(t===M.element){let t=e,n=X(A(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&Pn(`for`,n)&&t.removeAttribute(`for`)}catch(e){}}return!0})},In=function(e){let t=null,r=null;if(zt)e=`<remove></remove>`+e;else{let t=fe(e,Xe);r=t&&t[0]}un===`application/xhtml+xml`&&Y===J&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=P?lt(e):e;if(Y===J)try{t=new u().parseFromString(i,un)}catch(e){}if(!t||!t.documentElement){t=mt.createDocument(Y,`template`,null);try{t.documentElement.innerHTML=en?F:i}catch(e){}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Y===J?_t.call(t,U?`html`:`body`)[0]:U?t.documentElement:a},Ln=function(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=D?D(e):e.ownerDocument;return ht.call(n||e,e,(t?0:l.SHOW_ELEMENT)|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},Rn=function(e){return e=pe(e,yt,` `),e=pe(e,bt,` `),e=pe(e,xt,` `),e},zn=function(e){var t;Bn(e);let n=(t=e.querySelectorAll)==null?void 0:t.call(e,`template`);n&&_(n,e=>{Un(e.content)&&zn(e.content)})},Bn=function(e){e.normalize();let t=Ln(e,!0),n=t.nextNode();for(;n;)n.data=Rn(n.data),n=t.nextNode()},Vn=function(e){let t=w?w(e):null;return typeof t!=`string`||X(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==_e(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==C(e)||e.childNodes!==b(e)},Hn=function(e){if(!C||typeof e!=`object`||!e)return null;try{let t=C(e);return typeof t==`number`?t:null}catch(e){return null}},Un=function(e){return Hn(e)===M.documentFragment},Wn=function(e){return Hn(e)!==null};function Q(e,n,r){e.length!==0&&_(e,e=>{e.call(t,n,r,fn)})}let Gn=function(e,t,n){return!!(H&&n===M.element&&e.hasChildNodes()&&!Wn(e.firstElementChild)&&T(Ge,e.textContent)&&T(Ge,e.innerHTML)||H&&Ze[t]&&n===M.element&&it(e)===J&&(Wn(e.firstElementChild)||typeof e.textContent==`string`&&T(Ge,e.textContent))||n===M.processingInstruction||H&&n===M.comment&&T(Ke,e.data))},Kn=function(e,t){return e instanceof RegExp?T(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},qn=function(e,t,n){if(!At[t]&&Qn(t)&&Kn(z.tagNameCheck,t))return!1;if(Gt&&!q[t]&&!q[y(t)]){let t=x(e),r=b(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?p(r[a],!0):r[a];t.insertBefore(i,ne(e))}}}return Z(e),!0},Jn=function(e,t,n,r){return e.length===0?t:t===n||t===r?ye(t):t},$=function(e,t){return e===t||x(e)!==null?!1:(Kt&&Dn(e),!0)},Yn=function(e,n){if(Nn(e),Q(I.beforeSanitizeElements,e,null),$(e,n))return!0;if(Vn(e))return Z(e),!0;let r=X(A(e)),i=O(e);if(L=Jn(I.uponSanitizeElement,L,Ot,Lt),Q(I.uponSanitizeElement,e,{tagName:r,allowedTags:L}),$(e,n))return!0;if(Gn(e,r,i))return Z(e),!0;if(At[r]||!(B.tagCheck instanceof Function&&B.tagCheck(r))&&!L[r]){let t=qn(e,r,n);return t===!1&&(Q(I.afterSanitizeElements,e,null),$(e,n))?!0:t}if(i===M.element&&!xn(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&T(qe,e.innerHTML))return Z(e),!0;if(V&&i===M.text){let n=e.textContent,r=Rn(n);n!==r&&(ae(t.removed,{element:e.cloneNode()}),e.textContent=r)}return Q(I.afterSanitizeElements,e,null),$(e,n)},Xn=function(e,t,r){if(jt[t]||Pn(t,e)||Ht&&(t===`id`||t===`name`)&&(r in n||r in pn))return!1;let i=R[t]||B.attributeCheck instanceof Function&&B.attributeCheck(t,e);if(Nt&&T(St,t)||Mt&&T(Ct,t))return!0;if(!i)return Qn(e)&&Kn(z.tagNameCheck,e)&&Kn(z.attributeNameCheck,t,e)||t===`is`&&z.allowCustomizedBuiltInElements&&Kn(z.tagNameCheck,r);if(Xt[t])return!0;let a=pe(r,Tt,``);return T(Dt,a)||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&me(r,`data:`)===0&&Jt[e]||Pt&&!T(wt,a)?!0:!r},Zn=k({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Qn=function(e){return!Zn[y(e)]&&T(Et,e)},$n=function(e,t,n,r){if(P&&typeof d==`object`&&typeof d.getAttributeType==`function`&&!n)switch(d.getAttributeType(e,t)){case`TrustedHTML`:return lt(r);case`TrustedScriptURL`:return dt(r)}return r},er=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!Vn(e)||(Z(e),!1)}catch(n){return wn(t,e),!1}},tr=function(e,t){return H&&T(Ye,t)?!0:y(e)===`attributename`&&me(t,`href`)!==-1},nr=function(e,n){if(Q(I.beforeSanitizeAttributes,e,null),$(e,n))return;let r=e.attributes;if(!r||Vn(e))return;R=Jn(I.uponSanitizeAttribute,R,kt,Rt);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:R,forceKeepAttr:void 0},a=r.length,o=X(A(e));for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=X(s),d=l,f=s===`value`?d:he(d),p=!1;i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,Q(I.uponSanitizeAttribute,e,i),f=i.attrValue,Ut&&(u===`id`||u===`name`)&&me(f,Wt)!==0&&(wn(s,e,n),f=Wt+f,p=!0),tr(s,f)?wn(s,e,n):i.forceKeepAttr||(i.keepAttr?!Ft&&T(Je,f)?wn(s,e,n):(V&&(f=Rn(f)),Xn(o,u,f)?(f=$n(o,u,c,f),f!==d&&er(e,s,c,f)&&p&&ie(t.removed)):wn(s,e,n)):wn(s,e,n))}Q(I.afterSanitizeAttributes,e,null),$(e,n)},rr=function(e,t){Yn(e,t),nr(e,t),Un(e.content)&&ir(e.content)},ir=function(e){let t=null,n=Ln(e);for(Q(I.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Q(I.uponSanitizeShadowNode,t,null),rr(t,e),O(t)===M.element){let e=ge(t);Un(e)&&(ar(e),ir(e))}V&&Bn(e),Q(I.afterSanitizeShadowDOM,e,null)},ar=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){ir(e.shadow);continue}let n=e.node,r=O(n)===M.element,i=b(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=w?w(n):null;if(typeof e==`string`&&X(e)===`template`){let e=n.content;Un(e)&&t.push({node:e,shadow:null})}}if(r){let e=ge(n);Un(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(en=!e,en&&(e=`<!-->`),typeof e!=`string`&&!Wn(e)&&(e=be(e),typeof e!=`string`))throw E(`dirty is not a string, aborting`);if(!t.isSupported)return e;It?(L=Lt,R=Rt):hn(n),t.removed=[];let c=Kt&&typeof e!=`string`&&Wn(e),l=[],u=G;if(c){Fn(e);let t=A(e);if(typeof t==`string`){let n=X(t);if(!L[n]||At[n])throw Cn(e),E(`root node is forbidden and cannot be sanitized in-place`)}if(Vn(e))throw Cn(e),E(`root node is clobbered and cannot be sanitized in-place`);l=On(e),G=ce()}else if(Wn(e))i=In(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===M.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),ar(i);else{if(!W&&!V&&!U&&e.indexOf(`<`)===-1)return ut(e);if(i=In(e),!i)return W?null:Vt?F:``}i&&zt&&Z(i.firstChild);let d=c?e:i;try{c&&ar(e);let t=Ln(d);for(;o=t.nextNode();)rr(o,d);c&&jn(e,l)}catch(t){throw c&&(Cn(e),An(e,l)),t}finally{G=u}if(c){if(An(e,l))throw E(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return V&&zn(e),e}if(W){if(V&&zn(i),Bt)for(s=gt.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(R.shadowroot||R.shadowrootmode)&&(s=vt.call(r,s,!0)),s}let f=()=>U?i.outerHTML:i.innerHTML,p=f();return V&&T(Le,p)&&(Bn(i),p=f()),U&&L[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&T(Ue,i.ownerDocument.doctype.name)&&(p=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
6
|
+
`+p),ut(p)},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};hn(e),It=!0,Lt=L,Rt=R},t.clearConfig=function(){fn=null,It=!1,Lt=null,Rt=null,P=at,F=``},t.isValidAttribute=function(e,t,n){fn||hn({});let r=X(e),i=X(t);return typeof n==`string`&&(tr(t,n)||!Ft&&T(Je,n))?!1:Xn(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&S(I,e)&&ae(I[e],t)},t.removeHook=function(e,t){if(S(I,e)){if(t!==void 0){let n=re(I[e],t);return n===-1?void 0:se(I[e],n,1)[0]}return ie(I[e])}},t.removeHooks=function(e){S(I,e)&&(I[e]=[])},t.removeAllHooks=function(){I=et()},t}return nt()});
|
|
7
7
|
//# sourceMappingURL=purify.min.js.map
|