@file-viewer/assets-chm 3.0.1

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.
@@ -0,0 +1,365 @@
1
+ # Rust/WASM third-party licenses
2
+
3
+ This document is the binary-distribution license inventory for the Rust crates
4
+ resolved by `rust/Cargo.lock` and used to build `chm_wasm_bg.wasm`.
5
+
6
+ - Cargo.lock SHA-256: `8a81680e7a32a1d88656a148834dc24eb6bf866bd1366d836abac1c95e6b86ea`
7
+ - Inventory command: `cargo metadata --locked --format-version 1`
8
+ - Audit date: 2026-09-01
9
+ - Registry source: the exact crate versions named below from crates.io.
10
+ - For `MIT OR Apache-2.0` packages this distribution elects Apache-2.0.
11
+ The complete Apache-2.0 text is reproduced in section A.
12
+ - Build/procedural dependencies are included as well as runtime dependencies so
13
+ the inventory is a conservative superset of code that can affect the WASM artifact.
14
+ - No crate in this lockfile has an upstream `NOTICE` file.
15
+
16
+ The “upstream attribution” column is copied from Cargo package metadata unless a
17
+ packaged license or copyright file supplies a more specific copyright notice.
18
+
19
+ ## Locked crate inventory
20
+
21
+ | Crate | Version | Cargo SPDX expression | License text used here | Upstream attribution / copyright |
22
+ | --- | ---: | --- | --- | --- |
23
+ | bumpalo | 3.20.3 | MIT OR Apache-2.0 | Apache-2.0 (A) | Nick Fitzgerald; https://github.com/fitzgen/bumpalo |
24
+ | cfg-if | 1.0.4 | MIT OR Apache-2.0 | Apache-2.0 (A) | Alex Crichton; https://github.com/rust-lang/cfg-if |
25
+ | encoding_rs | 0.8.35 | (Apache-2.0 OR MIT) AND BSD-3-Clause | Apache-2.0 (A) and BSD-3-Clause (B) | Copyright Mozilla Foundation; derived WHATWG data copyright © WHATWG (Apple, Google, Mozilla, Microsoft) |
26
+ | futures-core | 0.3.34 | MIT OR Apache-2.0 | Apache-2.0 (A) | rust-lang/futures-rs; https://github.com/rust-lang/futures-rs |
27
+ | futures-task | 0.3.34 | MIT OR Apache-2.0 | Apache-2.0 (A) | rust-lang/futures-rs; https://github.com/rust-lang/futures-rs |
28
+ | futures-util | 0.3.34 | MIT OR Apache-2.0 | Apache-2.0 (A) | rust-lang/futures-rs; https://github.com/rust-lang/futures-rs |
29
+ | js-sys | 0.3.104 | MIT OR Apache-2.0 | Apache-2.0 (A) | The wasm-bindgen Developers; https://github.com/wasm-bindgen/wasm-bindgen/tree/master/crates/js-sys |
30
+ | once_cell | 1.21.4 | MIT OR Apache-2.0 | Apache-2.0 (A) | Aleksey Kladov; https://github.com/matklad/once_cell |
31
+ | pin-project-lite | 0.2.17 | Apache-2.0 OR MIT | Apache-2.0 (A) | taiki-e/pin-project-lite; https://github.com/taiki-e/pin-project-lite |
32
+ | proc-macro2 | 1.0.107 | MIT OR Apache-2.0 | Apache-2.0 (A) | David Tolnay and Alex Crichton; https://github.com/dtolnay/proc-macro2 |
33
+ | quote | 1.0.47 | MIT OR Apache-2.0 | Apache-2.0 (A) | David Tolnay; https://github.com/dtolnay/quote |
34
+ | rustversion | 1.0.23 | MIT OR Apache-2.0 | Apache-2.0 (A) | David Tolnay; https://github.com/dtolnay/rustversion |
35
+ | serde | 1.0.229 | MIT OR Apache-2.0 | Apache-2.0 (A) | Erick Tryzelaar and David Tolnay; https://github.com/serde-rs/serde |
36
+ | serde_core | 1.0.229 | MIT OR Apache-2.0 | Apache-2.0 (A) | Erick Tryzelaar and David Tolnay; https://github.com/serde-rs/serde |
37
+ | serde_derive | 1.0.229 | MIT OR Apache-2.0 | Apache-2.0 (A) | Erick Tryzelaar and David Tolnay; https://github.com/serde-rs/serde |
38
+ | serde-wasm-bindgen | 0.6.5 | MIT | MIT (C) | Copyright (c) 2019 Cloudflare, Inc.; https://github.com/RReverser/serde-wasm-bindgen |
39
+ | slab | 0.4.12 | MIT | MIT (D) | Copyright (c) 2019 Carl Lerche; https://github.com/tokio-rs/slab |
40
+ | syn | 2.0.119 | MIT OR Apache-2.0 | Apache-2.0 (A) | David Tolnay; https://github.com/dtolnay/syn |
41
+ | syn | 3.0.4 | MIT OR Apache-2.0 | Apache-2.0 (A) | David Tolnay; https://github.com/dtolnay/syn |
42
+ | thiserror | 2.0.20 | MIT OR Apache-2.0 | Apache-2.0 (A) | David Tolnay; https://github.com/dtolnay/thiserror |
43
+ | thiserror-impl | 2.0.20 | MIT OR Apache-2.0 | Apache-2.0 (A) | David Tolnay; https://github.com/dtolnay/thiserror |
44
+ | unicode-ident | 1.0.24 | (MIT OR Apache-2.0) AND Unicode-3.0 | Apache-2.0 (A) and Unicode-3.0 (E) | Copyright © 1991-2023 Unicode, Inc.; https://github.com/dtolnay/unicode-ident |
45
+ | wasm-bindgen | 0.2.127 | MIT OR Apache-2.0 | Apache-2.0 (A) | The wasm-bindgen Developers; https://github.com/wasm-bindgen/wasm-bindgen |
46
+ | wasm-bindgen-macro | 0.2.127 | MIT OR Apache-2.0 | Apache-2.0 (A) | The wasm-bindgen Developers; https://github.com/wasm-bindgen/wasm-bindgen/tree/master/crates/macro |
47
+ | wasm-bindgen-macro-support | 0.2.127 | MIT OR Apache-2.0 | Apache-2.0 (A) | The wasm-bindgen Developers; https://github.com/wasm-bindgen/wasm-bindgen/tree/master/crates/macro-support |
48
+ | wasm-bindgen-shared | 0.2.127 | MIT OR Apache-2.0 | Apache-2.0 (A) | The wasm-bindgen Developers; https://github.com/wasm-bindgen/wasm-bindgen/tree/master/crates/shared |
49
+
50
+ The CHM parser source adaptations from RustChm and FastChm are separately
51
+ documented with exact commits and full MIT terms in `rust/NOTICE.md`.
52
+
53
+ ## A. Apache License 2.0
54
+
55
+ Apache License
56
+ Version 2.0, January 2004
57
+ http://www.apache.org/licenses/
58
+
59
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
60
+
61
+ 1. Definitions.
62
+
63
+ "License" shall mean the terms and conditions for use, reproduction, and
64
+ distribution as defined by Sections 1 through 9 of this document.
65
+
66
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright
67
+ owner that is granting the License.
68
+
69
+ "Legal Entity" shall mean the union of the acting entity and all other entities
70
+ that control, are controlled by, or are under common control with that entity.
71
+ For the purposes of this definition, "control" means (i) the power, direct or
72
+ indirect, to cause the direction or management of such entity, whether by
73
+ contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
74
+ outstanding shares, or (iii) beneficial ownership of such entity.
75
+
76
+ "You" (or "Your") shall mean an individual or Legal Entity exercising
77
+ permissions granted by this License.
78
+
79
+ "Source" form shall mean the preferred form for making modifications, including
80
+ but not limited to software source code, documentation source, and configuration
81
+ files.
82
+
83
+ "Object" form shall mean any form resulting from mechanical transformation or
84
+ translation of a Source form, including but not limited to compiled object code,
85
+ generated documentation, and conversions to other media types.
86
+
87
+ "Work" shall mean the work of authorship, whether in Source or Object form,
88
+ made available under the License, as indicated by a copyright notice that is
89
+ included in or attached to the work.
90
+
91
+ "Derivative Works" shall mean any work, whether in Source or Object form, that
92
+ is based on (or derived from) the Work and for which the editorial revisions,
93
+ annotations, elaborations, or other modifications represent, as a whole, an
94
+ original work of authorship. For the purposes of this License, Derivative Works
95
+ shall not include works that remain separable from, or merely link (or bind by
96
+ name) to the interfaces of, the Work and Derivative Works thereof.
97
+
98
+ "Contribution" shall mean any work of authorship, including the original version
99
+ of the Work and any modifications or additions to that Work or Derivative Works
100
+ thereof, that is intentionally submitted to Licensor for inclusion in the Work by
101
+ the copyright owner or by an individual or Legal Entity authorized to submit on
102
+ behalf of the copyright owner. For the purposes of this definition, "submitted"
103
+ means any form of electronic, verbal, or written communication sent to the
104
+ Licensor or its representatives, including but not limited to communication on
105
+ electronic mailing lists, source code control systems, and issue tracking systems
106
+ that are managed by, or on behalf of, the Licensor for the purpose of discussing
107
+ and improving the Work, but excluding communication that is conspicuously marked
108
+ or otherwise designated in writing by the copyright owner as "Not a
109
+ Contribution."
110
+
111
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf
112
+ of whom a Contribution has been received by Licensor and subsequently
113
+ incorporated within the Work.
114
+
115
+ 2. Grant of Copyright License. Subject to the terms and conditions of this
116
+ License, each Contributor hereby grants to You a perpetual, worldwide,
117
+ non-exclusive, no-charge, royalty-free, irrevocable copyright license to
118
+ reproduce, prepare Derivative Works of, publicly display, publicly perform,
119
+ sublicense, and distribute the Work and such Derivative Works in Source or
120
+ Object form.
121
+
122
+ 3. Grant of Patent License. Subject to the terms and conditions of this License,
123
+ each Contributor hereby grants to You a perpetual, worldwide, non-exclusive,
124
+ no-charge, royalty-free, irrevocable (except as stated in this section) patent
125
+ license to make, have made, use, offer to sell, sell, import, and otherwise
126
+ transfer the Work, where such license applies only to those patent claims
127
+ licensable by such Contributor that are necessarily infringed by their
128
+ Contribution(s) alone or by combination of their Contribution(s) with the Work to
129
+ which such Contribution(s) was submitted. If You institute patent litigation
130
+ against any entity (including a cross-claim or counterclaim in a lawsuit)
131
+ alleging that the Work or a Contribution incorporated within the Work
132
+ constitutes direct or contributory patent infringement, then any patent licenses
133
+ granted to You under this License for that Work shall terminate as of the date
134
+ such litigation is filed.
135
+
136
+ 4. Redistribution. You may reproduce and distribute copies of the Work or
137
+ Derivative Works thereof in any medium, with or without modifications, and in
138
+ Source or Object form, provided that You meet the following conditions:
139
+
140
+ (a) You must give any other recipients of the Work or Derivative Works a copy of
141
+ this License; and
142
+
143
+ (b) You must cause any modified files to carry prominent notices stating that
144
+ You changed the files; and
145
+
146
+ (c) You must retain, in the Source form of any Derivative Works that You
147
+ distribute, all copyright, patent, trademark, and attribution notices from the
148
+ Source form of the Work, excluding those notices that do not pertain to any part
149
+ of the Derivative Works; and
150
+
151
+ (d) If the Work includes a "NOTICE" text file as part of its distribution, then
152
+ any Derivative Works that You distribute must include a readable copy of the
153
+ attribution notices contained within such NOTICE file, excluding those notices
154
+ that do not pertain to any part of the Derivative Works, in at least one of the
155
+ following places: within a NOTICE text file distributed as part of the Derivative
156
+ Works; within the Source form or documentation, if provided along with the
157
+ Derivative Works; or, within a display generated by the Derivative Works, if and
158
+ wherever such third-party notices normally appear. The contents of the NOTICE
159
+ file are for informational purposes only and do not modify the License. You may
160
+ add Your own attribution notices within Derivative Works that You distribute,
161
+ alongside or as an addendum to the NOTICE text from the Work, provided that such
162
+ additional attribution notices cannot be construed as modifying the License.
163
+
164
+ You may add Your own copyright statement to Your modifications and may provide
165
+ additional or different license terms and conditions for use, reproduction, or
166
+ distribution of Your modifications, or for any such Derivative Works as a whole,
167
+ provided Your use, reproduction, and distribution of the Work otherwise complies
168
+ with the conditions stated in this License.
169
+
170
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any
171
+ Contribution intentionally submitted for inclusion in the Work by You to the
172
+ Licensor shall be under the terms and conditions of this License, without any
173
+ additional terms or conditions. Notwithstanding the above, nothing herein shall
174
+ supersede or modify the terms of any separate license agreement you may have
175
+ executed with Licensor regarding such Contributions.
176
+
177
+ 6. Trademarks. This License does not grant permission to use the trade names,
178
+ trademarks, service marks, or product names of the Licensor, except as required
179
+ for reasonable and customary use in describing the origin of the Work and
180
+ reproducing the content of the NOTICE file.
181
+
182
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
183
+ writing, Licensor provides the Work (and each Contributor provides its
184
+ Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
185
+ KIND, either express or implied, including, without limitation, any warranties or
186
+ conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
187
+ PARTICULAR PURPOSE. You are solely responsible for determining the
188
+ appropriateness of using or redistributing the Work and assume any risks
189
+ associated with Your exercise of permissions under this License.
190
+
191
+ 8. Limitation of Liability. In no event and under no legal theory, whether in
192
+ tort (including negligence), contract, or otherwise, unless required by
193
+ applicable law (such as deliberate and grossly negligent acts) or agreed to in
194
+ writing, shall any Contributor be liable to You for damages, including any
195
+ direct, indirect, special, incidental, or consequential damages of any character
196
+ arising as a result of this License or out of the use or inability to use the
197
+ Work (including but not limited to damages for loss of goodwill, work stoppage,
198
+ computer failure or malfunction, or any and all other commercial damages or
199
+ losses), even if such Contributor has been advised of the possibility of such
200
+ damages.
201
+
202
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or
203
+ Derivative Works thereof, You may choose to offer, and charge a fee for,
204
+ acceptance of support, warranty, indemnity, or other liability obligations and/or
205
+ rights consistent with this License. However, in accepting such obligations, You
206
+ may act only on Your own behalf and on Your sole responsibility, not on behalf of
207
+ any other Contributor, and only if You agree to indemnify, defend, and hold each
208
+ Contributor harmless for any liability incurred by, or claims asserted against,
209
+ such Contributor by reason of your accepting any such warranty or additional
210
+ liability.
211
+
212
+ END OF TERMS AND CONDITIONS
213
+
214
+ APPENDIX: How to apply the Apache License to your work.
215
+
216
+ To apply the Apache License to your work, attach the following boilerplate
217
+ notice, with the fields enclosed by brackets "[]" replaced with your own
218
+ identifying information. (Don't include the brackets!) The text should be
219
+ enclosed in the appropriate comment syntax for the file format. We also
220
+ recommend that a file or class name and description of purpose be included on
221
+ the same "printed page" as the copyright notice for easier identification
222
+ within third-party archives.
223
+
224
+ Copyright [yyyy] [name of copyright owner]
225
+
226
+ Licensed under the Apache License, Version 2.0 (the "License");
227
+ you may not use this file except in compliance with the License.
228
+ You may obtain a copy of the License at
229
+
230
+ http://www.apache.org/licenses/LICENSE-2.0
231
+
232
+ Unless required by applicable law or agreed to in writing, software
233
+ distributed under the License is distributed on an "AS IS" BASIS,
234
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
235
+ See the License for the specific language governing permissions and
236
+ limitations under the License.
237
+
238
+ ## B. encoding_rs WHATWG-derived data — BSD 3-Clause
239
+
240
+ Upstream files: `encoding_rs-0.8.35/COPYRIGHT` and
241
+ `encoding_rs-0.8.35/LICENSE-WHATWG`.
242
+
243
+ encoding_rs is copyright Mozilla Foundation. Its WHATWG-derived data carries
244
+ the following notice:
245
+
246
+ Copyright © WHATWG (Apple, Google, Mozilla, Microsoft).
247
+
248
+ Redistribution and use in source and binary forms, with or without
249
+ modification, are permitted provided that the following conditions are met:
250
+
251
+ 1. Redistributions of source code must retain the above copyright notice, this
252
+ list of conditions and the following disclaimer.
253
+
254
+ 2. Redistributions in binary form must reproduce the above copyright notice,
255
+ this list of conditions and the following disclaimer in the documentation
256
+ and/or other materials provided with the distribution.
257
+
258
+ 3. Neither the name of the copyright holder nor the names of its
259
+ contributors may be used to endorse or promote products derived from
260
+ this software without specific prior written permission.
261
+
262
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
263
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
264
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
265
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
266
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
267
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
268
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
269
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
270
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
271
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
272
+
273
+ ## C. serde-wasm-bindgen 0.6.5 — MIT
274
+
275
+ MIT License
276
+
277
+ Copyright (c) 2019 Cloudflare, Inc.
278
+
279
+ Permission is hereby granted, free of charge, to any person obtaining a copy
280
+ of this software and associated documentation files (the "Software"), to deal
281
+ in the Software without restriction, including without limitation the rights
282
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
283
+ copies of the Software, and to permit persons to whom the Software is
284
+ furnished to do so, subject to the following conditions:
285
+
286
+ The above copyright notice and this permission notice shall be included in all
287
+ copies or substantial portions of the Software.
288
+
289
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
290
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
291
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
292
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
293
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
294
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
295
+ SOFTWARE.
296
+
297
+ ## D. slab 0.4.12 — MIT
298
+
299
+ Copyright (c) 2019 Carl Lerche
300
+
301
+ Permission is hereby granted, free of charge, to any
302
+ person obtaining a copy of this software and associated
303
+ documentation files (the "Software"), to deal in the
304
+ Software without restriction, including without
305
+ limitation the rights to use, copy, modify, merge,
306
+ publish, distribute, sublicense, and/or sell copies of
307
+ the Software, and to permit persons to whom the Software
308
+ is furnished to do so, subject to the following
309
+ conditions:
310
+
311
+ The above copyright notice and this permission notice
312
+ shall be included in all copies or substantial portions
313
+ of the Software.
314
+
315
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
316
+ ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
317
+ TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
318
+ PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
319
+ SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
320
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
321
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
322
+ IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
323
+ DEALINGS IN THE SOFTWARE.
324
+
325
+ ## E. unicode-ident 1.0.24 data — Unicode License v3
326
+
327
+ UNICODE LICENSE V3
328
+
329
+ COPYRIGHT AND PERMISSION NOTICE
330
+
331
+ Copyright © 1991-2023 Unicode, Inc.
332
+
333
+ NOTICE TO USER: Carefully read the following legal agreement. BY
334
+ DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR
335
+ SOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
336
+ TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT
337
+ DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE.
338
+
339
+ Permission is hereby granted, free of charge, to any person obtaining a
340
+ copy of data files and any associated documentation (the "Data Files") or
341
+ software and any associated documentation (the "Software") to deal in the
342
+ Data Files or Software without restriction, including without limitation
343
+ the rights to use, copy, modify, merge, publish, distribute, and/or sell
344
+ copies of the Data Files or Software, and to permit persons to whom the
345
+ Data Files or Software are furnished to do so, provided that either (a)
346
+ this copyright and permission notice appear with all copies of the Data
347
+ Files or Software, or (b) this copyright and permission notice appear in
348
+ associated Documentation.
349
+
350
+ THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
351
+ KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
352
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
353
+ THIRD PARTY RIGHTS.
354
+
355
+ IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE
356
+ BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES,
357
+ OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
358
+ WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
359
+ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA
360
+ FILES OR SOFTWARE.
361
+
362
+ Except as contained in this notice, the name of a copyright holder shall
363
+ not be used in advertising or otherwise to promote the sale, use or other
364
+ dealings in these Data Files or Software without prior written
365
+ authorization of the copyright holder.
@@ -0,0 +1,12 @@
1
+ # Third-party notices
2
+
3
+ The File Viewer integration around the CHM parser is released under Apache-2.0. The Rust/WASM implementation is based only on permissively licensed source and format research from:
4
+
5
+ - RustChm, commit `5418439a40812079b479acec40719cddedcb583c`, MIT License, Copyright (c) 2026 yeroo.
6
+ - FastChm, commit `2c22935ba0a1fc7a5a3d3d9785c970058c4d00f0`, MIT License, Copyright (c) 2026 yeroo.
7
+
8
+ The retained upstream MIT notice and detailed file provenance are recorded in
9
+ `rust/NOTICE.md` in the renderer package and as `RUST_NOTICE.md` beside the
10
+ Worker/WASM files in redistributed `vendor/chm` bundles.
11
+
12
+ No CHMLib, libmspack, chmlib-ts, libchm 0.3.0 LZX port, or other LGPL-derived implementation is distributed by this package.
@@ -0,0 +1,2 @@
1
+ var H=/[\u0000-\u001f\u007f]/;var re=16*1024*1024;var ie=8*1024*1024;var oe=4*1024*1024,W=4*1024*1024,X=(e=Number.POSITIVE_INFINITY)=>{let t=[],n="",r=0;return{append:o=>{if(!o||r>=e)return;let a=e-r,s=o.length>a?o.slice(0,a):o;if(r+=s.length,n.length+s.length<=16384){n+=s;return}n&&t.push(n),s.length>16384?(t.push(s),n=""):n=s},get length(){return r},finish:()=>(n&&t.push(n),t.join(""))}};var j=e=>{try{return decodeURIComponent(e)}catch{return e}},A=e=>{if(typeof e!="string"||H.test(e))return null;let t=e.trim();if(!t||t.length>4096)return null;let n=j(t);if(/^(?:[a-z]:[\\/]|[\\/]{2})/i.test(n))return null;let r=n.replace(/\\/g,"/"),i=[];for(let o of r.split("/"))if(!(!o||o===".")){if(o===".."){if(!i.length)return null;i.pop();continue}if(H.test(o))return null;i.push(o)}return`/${i.join("/")}`};var L=e=>{let t=(e||"").trim().toLowerCase().replace(/_/g,"-");return t?t==="utf8"?"utf-8":t==="gbk"||t==="cp936"?"gb18030":t==="big5-hkscs"?"big5":t==="shift-jis"||t==="sjis"||t==="cp932"?"shift_jis":t==="euc-kr"||t==="cp949"?"euc-kr":/^windows-?\d+$/.test(t)?t.replace(/^windows-?/,"windows-"):/^cp\d+$/.test(t)?t.replace(/^cp/,"windows-"):t:""},F=e=>{let t=e.subarray(0,Math.min(e.byteLength,8192)),n="";for(let i=0;i<t.byteLength;i+=1){let o=t[i];n+=o>=32&&o<=126?String.fromCharCode(o):" "}let r=n.match(/<meta\b[^>]*\bcharset\s*=\s*["']?\s*([^\s"'/>;]+)/i)||n.match(/<meta\b[^>]*\bcontent\s*=\s*["'][^"']*charset\s*=\s*([^\s"'/>;]+)/i);return L(r?.[1])},b=(e,t)=>{try{return new TextDecoder(t,{fatal:!1}).decode(e)}catch{return""}},v=(e,t="windows-1252")=>{if(e.byteLength>=3&&e[0]===239&&e[1]===187&&e[2]===191)return b(e.subarray(3),"utf-8");if(e.byteLength>=2&&e[0]===255&&e[1]===254)return b(e.subarray(2),"utf-16le");if(e.byteLength>=2&&e[0]===254&&e[1]===255){let r=new Uint8Array(e.byteLength-2);for(let i=2;i+1<e.byteLength;i+=2)r[i-2]=e[i+1],r[i-1]=e[i];return b(r,"utf-16le")}let n=[F(e),L(t),"utf-8","windows-1252"];for(let r of n){if(!r)continue;let i=b(e,r);if(i)return i.replace(/^\ufeff/,"")}return""},E=e=>e===" "||e===" "||e===`
2
+ `||e==="\f"||e==="\r",I=e=>{if(!e)return!1;let t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||e===":"||e==="_"||e==="-"},q=(e,t,n)=>{if(t+n.length>e.length)return!1;for(let r=0;r<n.length;r+=1){let i=e.charCodeAt(t+r),o=n.charCodeAt(r);if((i>=65&&i<=90?i+32:i)!==o)return!1}return!0},B=(e,t)=>{let n=t,r="";for(;n<e.length;){let i=e[n];if(r)i===r&&(r="");else if(i==='"'||i==="'")r=i;else if(i===">")return n+1;n+=1}return e.length},V=(e,t,n)=>{let r=t;for(;r<e.length;){if(e[r]==="<"&&e[r+1]==="/"&&q(e,r+2,n)&&!I(e[r+2+n.length]))return B(e,r+2+n.length);r+=1}return e.length},G=(e,t)=>{let n=t+1,r=Math.min(e.length,t+13);for(;n<r&&e[n]!==";";){if(e[n]==="&"||e[n]==="<"||E(e[n]))return null;n+=1}if(n>=r||e[n]!==";")return null;let i=e.slice(t+1,n).toLowerCase(),o={amp:"&",apos:"'",gt:">",lt:"<",nbsp:" ",quot:'"'};if(o[i]!=null)return{end:n+1,value:o[i]};let a=i.startsWith("#x")?Number.parseInt(i.slice(2),16):i.startsWith("#")?Number.parseInt(i.slice(1),10):Number.NaN;return!Number.isFinite(a)||a<=0||a>1114111||a>=55296&&a<=57343?null:{end:n+1,value:String.fromCodePoint(a)}},N=(e,t=W)=>{let n=X(Math.max(0,t)),r=0,i=!1,o=a=>{if(a){if(E(a)){i=n.length>0;return}i&&n.length<t&&n.append(" "),i=!1,n.append(a)}};for(;r<e.length;){let a=e[r];if(a==="<"){if(i=n.length>0,e.startsWith("<!--",r)){let m=e.indexOf("-->",r+4);r=m<0?e.length:m+3;continue}let s=r+1,l=e[s]==="/";for(l&&(s+=1);E(e[s]);)s+=1;let c=s;for(;I(e[s]);)s+=1;let u=e.slice(c,s).toLowerCase(),g=B(e,s);r=!l&&(u==="script"||u==="style")?V(e,g,u):g;continue}if(a==="&"){let s=G(e,r);if(s){o(s.value),r=s.end;continue}}o(a),r+=1}return n.finish().trim()};var ae=Object.freeze({workerTimeoutMs:6e4,maxArchiveBytes:335544320,maxEntries:5e4,maxEntryBytes:33554432,maxTotalDecompressedBytes:536870912,maxHtmlBytes:16777216,maxSearchTopics:1e4,maxSearchResults:200}),C=1024*1024,ce=Object.freeze({maxArchiveBytes:1024*C,maxEntries:25e4,maxEntryBytes:512*C,maxTotalDecompressedBytes:8*1024*C,maxHtmlBytes:64*C});var f=e=>typeof e=="string"?e:"",_=e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,k=e=>e===!0,K=e=>{if(!e||typeof e!="object")return null;let t=e,n=f(t.path||t.local||t.url);return n?{title:f(t.title||t.name)||n,path:n,contextId:_(t.contextId??t.context_id)}:null},R=e=>{if(!Array.isArray(e))return[];let t=[],n=[];for(let r=e.length-1;r>=0;r-=1)n.push({source:e[r],target:t});for(;n.length;){let r=n.pop();if(!r?.source||typeof r.source!="object")continue;let i=r.source,o=[],a={title:f(i.title||i.name||i.keyword)||f(i.path||i.local),path:f(i.path||i.local||i.url)||void 0,keyword:f(i.keyword)||void 0,children:o};r.target.push(a);let s=Array.isArray(i.locals)?i.locals.filter(c=>typeof c=="string"&&!!c):[];!a.path&&s.length&&(a.path=s[0]);for(let c=a.path?1:0;c<s.length;c+=1)o.push({title:`${a.title} \xB7 ${c+1}`,path:s[c],children:[]});let l=Array.isArray(i.children)?i.children:[];for(let c=l.length-1;c>=0;c-=1)n.push({source:l[c],target:o})}return t},D=e=>{let t=e&&typeof e=="object"?e:{},n=Array.isArray(t.topics)?t.topics.map(K).filter(r=>!!r):[];return{title:f(t.title),homePath:f(t.homePath??t.home_path),encoding:f(t.encoding)||"windows-1252",language:f(t.language)||void 0,topics:n,contents:R(t.contents??t.toc),index:R(t.index??t.keywords),hasBinaryToc:k(t.hasBinaryToc??t.has_binary_toc),hasBinaryIndex:k(t.hasBinaryIndex??t.has_binary_index),hasFullTextIndex:k(t.hasFullTextIndex??t.has_full_text_index)||!!(t.fullTextIndex&&typeof t.fullTextIndex=="object"&&t.fullTextIndex.available)}},O=e=>Array.isArray(e)?e.flatMap(t=>{if(!t||typeof t!="object")return[];let n=t,r=f(n.path||n.name);return r?[{path:r,size:_(n.size??n.length??n.byteLength??n.byte_length)??0,section:_(n.section)}]:[]}):[];var $=self,h,y,w,M=0,T=new Set,p=(e,t=[])=>{$.postMessage(e,t)},d=(e,t,n)=>{p({id:0,ok:!0,type:"progress",phase:e,current:t,total:n})},S=()=>{if(h)try{h.dispose?.()}finally{try{h.free?.()}catch{}h=void 0,y=void 0,w=void 0,M=0,T.clear()}},Y=e=>e.match(/^([A-Z][A-Z0-9_]+):/)?.[1],Z=e=>{let t=e instanceof Error?e.message:String(e);return{name:e instanceof Error?e.name:"Error",message:t,code:Y(t)}},J=async(e,t)=>{d("wasm",0,1);let n=await import(e);if(typeof n.default=="function"&&await n.default({module_or_path:t}),typeof n.ChmArchive!="function")throw new Error("CHM_WASM_API_MISMATCH: ChmArchive is not exported by the WASM module.");return d("wasm",1,1),n},Q=async e=>{if(S(),e.buffer.byteLength>e.limits.maxArchiveBytes)throw new Error(`CHM_LIMIT_EXCEEDED: source is ${e.buffer.byteLength} bytes; limit is ${e.limits.maxArchiveBytes}.`);let t=await J(e.moduleUrl,e.wasmUrl);d("directory",0,1),h=new t.ChmArchive(new Uint8Array(e.buffer),e.limits),w=e.limits;let n=O(h.entries());if(n.length>e.limits.maxEntries)throw new Error(`CHM_LIMIT_EXCEEDED: ${n.length} entries exceed limit ${e.limits.maxEntries}.`);return d("directory",1,1),d("manifest",0,1),y=D(h.manifest()),d("manifest",1,1),{manifest:y,entries:n}},z=()=>{if(!h||!y||!w)throw new Error("CHM_NOT_OPEN: no CHM archive is active in this Worker.");return{archive:h,manifest:y,limits:w}},P=e=>{let t=z(),n=t.archive.read(e);if(n.byteLength>t.limits.maxEntryBytes)throw new Error(`CHM_LIMIT_EXCEEDED: entry ${e} exceeds ${t.limits.maxEntryBytes} bytes.`);let r=e.toLocaleLowerCase();if(!T.has(r)){let i=M+n.byteLength;if(i>t.limits.maxTotalDecompressedBytes)throw new Error(`CHM_LIMIT_EXCEEDED: unique decoded content exceeds ${t.limits.maxTotalDecompressedBytes} bytes.`);T.add(r),M=i}return n},ee=e=>{let t=A(e);if(!t)throw new Error("CHM_BAD_PATH: the requested entry path is invalid.");let n=P(t);return n.byteOffset===0&&n.byteLength===n.buffer.byteLength?n:n.slice()},te=(e,t)=>{let r=e.toLocaleLowerCase().indexOf(t);if(r<0)return"";let i=Math.max(0,r-72),o=Math.min(e.length,r+t.length+128);return`${i?"\u2026":""}${e.slice(i,o).trim()}${o<e.length?"\u2026":""}`},ne=(e,t,n)=>{let r=z(),i=e.trim().toLocaleLowerCase();if(!i)return{hits:[],inspected:0,truncated:!1};let o=[],a=new Set,s=r.manifest.topics.slice(0,Math.max(1,n)),l=0;d("search",0,s.length);for(let c of s){if(o.length>=t)break;let u=A(c.path);if(!u||a.has(u.toLocaleLowerCase()))continue;a.add(u.toLocaleLowerCase()),l+=1;let g=c.title.toLocaleLowerCase().includes(i),m="";try{let x=P(u),U=N(v(x,r.manifest.encoding));m=te(U,i)}catch(x){if(x instanceof Error&&x.message.startsWith("CHM_LIMIT_EXCEEDED:"))throw x}(g||m)&&o.push({title:c.title||u,path:u,snippet:m,titleMatch:g}),l%64===0&&d("search",l,s.length)}return d("search",l,s.length),{hits:o,inspected:l,truncated:s.length<r.manifest.topics.length||o.length>=t}};$.addEventListener("message",async e=>{let t=e.data;try{if(t.type==="open"){let n=await Q(t);p({id:t.id,ok:!0,type:"open",...n});return}if(t.type==="read"){let n=ee(t.path);p({id:t.id,ok:!0,type:"read",data:n},[n.buffer]);return}if(t.type==="search"){let n=ne(t.query,Math.max(1,t.limit),Math.max(1,t.maxTopics));p({id:t.id,ok:!0,type:"search",...n});return}S(),p({id:t.id,ok:!0,type:"close"})}catch(n){t.type==="open"&&S(),p({id:t.id,ok:!1,type:t.type,error:Z(n)})}});