summaryrefslogtreecommitdiffhomepage
path: root/vhosts/blog
diff options
context:
space:
mode:
Diffstat (limited to 'vhosts/blog')
m---------vhosts/blog0
-rw-r--r--vhosts/blog/CHEATSHEET.md38
-rw-r--r--vhosts/blog/LICENSE21
-rw-r--r--vhosts/blog/Makefile30
-rw-r--r--vhosts/blog/NOTE.md56
-rw-r--r--vhosts/blog/README.md29
-rw-r--r--vhosts/blog/content/posts/2021-03-05/my-first-post.xml27
-rw-r--r--vhosts/blog/content/posts/2021-03-30/phperkaigi-2021.xml778
-rw-r--r--vhosts/blog/content/posts/2021-10-02/cpp-you-can-use-keywords-in-attributes.xml143
-rw-r--r--vhosts/blog/content/posts/2021-10-02/python-unbound-local-error.xml87
-rw-r--r--vhosts/blog/content/posts/2021-10-02/ruby-detect-running-implementation.xml122
-rw-r--r--vhosts/blog/content/posts/2021-10-02/ruby-then-keyword-and-case-in.xml270
-rw-r--r--vhosts/blog/content/posts/2021-10-02/rust-where-are-primitive-types-from.xml237
-rw-r--r--vhosts/blog/content/posts/2021-10-02/vim-difference-between-autocmd-bufwrite-and-bufwritepre.xml165
-rw-r--r--vhosts/blog/content/posts/2021-10-02/vim-swap-order-of-selected-lines.xml215
-rw-r--r--vhosts/blog/content/posts/2022-04-09/phperkaigi-2022-tokens.xml563
-rw-r--r--vhosts/blog/content/posts/2022-04-24/term-banner-write-tool-showing-banner-in-terminal.xml125
-rw-r--r--vhosts/blog/content/posts/2022-05-01/phperkaigi-2022.xml171
-rw-r--r--vhosts/blog/content/posts/2022-08-27/php-conference-okinawa-code-golf.xml122
-rw-r--r--vhosts/blog/content/posts/2022-08-31/support-for-communty-is-employee-benefits.xml72
-rw-r--r--vhosts/blog/content/posts/2022-09-29/write-fizzbuzz-in-php-2-letters-per-line.xml708
-rw-r--r--vhosts/blog/content/posts/2022-10-23/phperkaigi-2023-unused-token-quiz-1.xml188
-rw-r--r--vhosts/blog/content/posts/2022-10-28/setup-server-for-this-site.xml313
-rw-r--r--vhosts/blog/content/posts/2022-11-19/phperkaigi-2023-unused-token-quiz-2.xml174
-rw-r--r--vhosts/blog/content/posts/2023-01-10/phperkaigi-2023-unused-token-quiz-3.xml329
-rw-r--r--vhosts/blog/content/posts/2023-03-10/rewrite-this-blog-generator.xml97
-rw-r--r--vhosts/blog/content/posts/2023-04-01/implementation-of-minimal-png-image-encoder.xml607
-rw-r--r--vhosts/blog/content/posts/2023-04-04/phperkaigi-2023-report.xml187
-rw-r--r--vhosts/blog/content/posts/2023-06-25/phpconfuk-2023-report.xml109
-rw-r--r--vhosts/blog/content/slides/2023-01-18/phpstudy-tokyo-148.xml23
-rw-r--r--vhosts/blog/content/slides/2023-01-18/phpstudy-tokyo-148/slide.pdfbin0 -> 204408 bytes
-rw-r--r--vhosts/blog/content/slides/2023-02-15/phpstudy-tokyo-149.xml23
-rw-r--r--vhosts/blog/content/slides/2023-02-15/phpstudy-tokyo-149/slide.pdfbin0 -> 214504 bytes
-rw-r--r--vhosts/blog/content/slides/2023-03-15/phpstudy-tokyo-150.xml27
-rw-r--r--vhosts/blog/content/slides/2023-03-15/phpstudy-tokyo-150/slide.pdfbin0 -> 248257 bytes
-rw-r--r--vhosts/blog/content/slides/2023-03-24/phperkaigi-2023.xml24
-rw-r--r--vhosts/blog/content/slides/2023-03-24/phperkaigi-2023/slide.pdfbin0 -> 321814 bytes
-rw-r--r--vhosts/blog/content/slides/2023-03-25/phperkaigi-2023-tokens.xml24
-rw-r--r--vhosts/blog/content/slides/2023-03-25/phperkaigi-2023-tokens/slide.pdfbin0 -> 753400 bytes
-rw-r--r--vhosts/blog/content/slides/2023-04-12/phpstudy-tokyo-151.xml23
-rw-r--r--vhosts/blog/content/slides/2023-04-12/phpstudy-tokyo-151/slide.pdfbin0 -> 202360 bytes
-rw-r--r--vhosts/blog/content/slides/2023-06-21/phpstudy-tokyo-153.xml23
-rw-r--r--vhosts/blog/content/slides/2023-06-21/phpstudy-tokyo-153/slide.pdfbin0 -> 179888 bytes
-rw-r--r--vhosts/blog/content/slides/2023-06-23/phpconfuk-2023-eve.xml23
-rw-r--r--vhosts/blog/content/slides/2023-06-23/phpconfuk-2023-eve/slide.pdfbin0 -> 194763 bytes
-rw-r--r--vhosts/blog/content/slides/2023-07-26/phpstudy-tokyo-154.xml23
-rw-r--r--vhosts/blog/content/slides/2023-07-26/phpstudy-tokyo-154/slide.pdfbin0 -> 243063 bytes
-rw-r--r--vhosts/blog/content/slides/2023-08-24/phpstudy-tokyo-155.xml23
-rw-r--r--vhosts/blog/content/slides/2023-08-24/phpstudy-tokyo-155/slide.pdfbin0 -> 176356 bytes
-rw-r--r--vhosts/blog/deno.jsonc7
-rw-r--r--vhosts/blog/deno.lock84
-rw-r--r--vhosts/blog/docker-compose.local.yml13
-rw-r--r--vhosts/blog/docker-compose.yml18
-rw-r--r--vhosts/blog/import_map.json5
-rw-r--r--vhosts/blog/nginx.conf21
-rwxr-xr-xvhosts/blog/nuldoc11
-rw-r--r--vhosts/blog/nuldoc-src/commands/build.ts208
-rw-r--r--vhosts/blog/nuldoc-src/commands/new.ts92
-rw-r--r--vhosts/blog/nuldoc-src/commands/serve.ts38
-rw-r--r--vhosts/blog/nuldoc-src/components/global_footer.ts12
-rw-r--r--vhosts/blog/nuldoc-src/components/global_header.ts42
-rw-r--r--vhosts/blog/nuldoc-src/components/page_layout.ts78
-rw-r--r--vhosts/blog/nuldoc-src/components/post_page_entry.ts48
-rw-r--r--vhosts/blog/nuldoc-src/components/slide_page_entry.ts45
-rw-r--r--vhosts/blog/nuldoc-src/components/utils.ts30
-rw-r--r--vhosts/blog/nuldoc-src/config.ts43
-rw-r--r--vhosts/blog/nuldoc-src/docbook/document.ts108
-rw-r--r--vhosts/blog/nuldoc-src/docbook/parse.ts21
-rw-r--r--vhosts/blog/nuldoc-src/docbook/to_html.ts319
-rw-r--r--vhosts/blog/nuldoc-src/dom.ts107
-rw-r--r--vhosts/blog/nuldoc-src/errors.ts17
-rw-r--r--vhosts/blog/nuldoc-src/main.ts17
-rw-r--r--vhosts/blog/nuldoc-src/page.ts9
-rw-r--r--vhosts/blog/nuldoc-src/pages/about.ts183
-rw-r--r--vhosts/blog/nuldoc-src/pages/home.ts96
-rw-r--r--vhosts/blog/nuldoc-src/pages/not_found.ts51
-rw-r--r--vhosts/blog/nuldoc-src/pages/post.ts140
-rw-r--r--vhosts/blog/nuldoc-src/pages/post_list.ts64
-rw-r--r--vhosts/blog/nuldoc-src/pages/slide.ts140
-rw-r--r--vhosts/blog/nuldoc-src/pages/slide_list.ts65
-rw-r--r--vhosts/blog/nuldoc-src/pages/tag.ts60
-rw-r--r--vhosts/blog/nuldoc-src/pages/tag_list.ts76
-rw-r--r--vhosts/blog/nuldoc-src/pages/tagged_page.ts4
-rw-r--r--vhosts/blog/nuldoc-src/render.ts13
-rw-r--r--vhosts/blog/nuldoc-src/renderers/html.ts275
-rw-r--r--vhosts/blog/nuldoc-src/revision.ts27
-rw-r--r--vhosts/blog/nuldoc-src/slide/parse.ts19
-rw-r--r--vhosts/blog/nuldoc-src/slide/slide.ts122
-rw-r--r--vhosts/blog/nuldoc-src/types/highlight-js.d.ts10
-rw-r--r--vhosts/blog/nuldoc-src/xml.ts269
-rw-r--r--vhosts/blog/nuldoc-src/xml_test.ts17
-rw-r--r--vhosts/blog/public/404.html46
-rw-r--r--vhosts/blog/public/about/index.html120
-rw-r--r--vhosts/blog/public/custom.css0
-rw-r--r--vhosts/blog/public/favicon.svg61
-rw-r--r--vhosts/blog/public/hl.css10
-rw-r--r--vhosts/blog/public/index.html71
-rw-r--r--vhosts/blog/public/my-icon.js121
-rw-r--r--vhosts/blog/public/p5.min.js2
-rw-r--r--vhosts/blog/public/pdf.min.js22
-rw-r--r--vhosts/blog/public/pdf.worker.min.js22
-rw-r--r--vhosts/blog/public/posts/2021-03-05/my-first-post/index.html63
-rw-r--r--vhosts/blog/public/posts/2021-03-30/phperkaigi-2021/index.html1031
-rw-r--r--vhosts/blog/public/posts/2021-10-02/cpp-you-can-use-keywords-in-attributes/index.html200
-rw-r--r--vhosts/blog/public/posts/2021-10-02/python-unbound-local-error/index.html130
-rw-r--r--vhosts/blog/public/posts/2021-10-02/ruby-detect-running-implementation/index.html217
-rw-r--r--vhosts/blog/public/posts/2021-10-02/ruby-then-keyword-and-case-in/index.html290
-rw-r--r--vhosts/blog/public/posts/2021-10-02/rust-where-are-primitive-types-from/index.html258
-rw-r--r--vhosts/blog/public/posts/2021-10-02/vim-difference-between-autocmd-bufwrite-and-bufwritepre/index.html224
-rw-r--r--vhosts/blog/public/posts/2021-10-02/vim-swap-order-of-selected-lines/index.html253
-rw-r--r--vhosts/blog/public/posts/2022-04-09/phperkaigi-2022-tokens/index.html605
-rw-r--r--vhosts/blog/public/posts/2022-04-24/term-banner-write-tool-showing-banner-in-terminal/index.html166
-rw-r--r--vhosts/blog/public/posts/2022-05-01/phperkaigi-2022/index.html268
-rw-r--r--vhosts/blog/public/posts/2022-08-27/php-conference-okinawa-code-golf/index.html192
-rw-r--r--vhosts/blog/public/posts/2022-08-31/support-for-communty-is-employee-benefits/index.html116
-rw-r--r--vhosts/blog/public/posts/2022-09-29/write-fizzbuzz-in-php-2-letters-per-line/index.html739
-rw-r--r--vhosts/blog/public/posts/2022-10-23/phperkaigi-2023-unused-token-quiz-1/index.html212
-rw-r--r--vhosts/blog/public/posts/2022-10-28/setup-server-for-this-site/index.html316
-rw-r--r--vhosts/blog/public/posts/2022-11-19/phperkaigi-2023-unused-token-quiz-2/index.html225
-rw-r--r--vhosts/blog/public/posts/2023-01-10/phperkaigi-2023-unused-token-quiz-3/index.html410
-rw-r--r--vhosts/blog/public/posts/2023-03-10/rewrite-this-blog-generator/index.html166
-rw-r--r--vhosts/blog/public/posts/2023-04-01/implementation-of-minimal-png-image-encoder/index.html745
-rw-r--r--vhosts/blog/public/posts/2023-04-04/phperkaigi-2023-report/index.html307
-rw-r--r--vhosts/blog/public/posts/2023-06-25/phpconfuk-2023-report/index.html161
-rw-r--r--vhosts/blog/public/posts/index.html389
-rw-r--r--vhosts/blog/public/slide.js59
-rw-r--r--vhosts/blog/public/slides/2023-01-18/phpstudy-tokyo-148/index.html80
-rw-r--r--vhosts/blog/public/slides/2023-01-18/phpstudy-tokyo-148/slide.pdfbin0 -> 204408 bytes
-rw-r--r--vhosts/blog/public/slides/2023-02-15/phpstudy-tokyo-149/index.html80
-rw-r--r--vhosts/blog/public/slides/2023-02-15/phpstudy-tokyo-149/slide.pdfbin0 -> 214504 bytes
-rw-r--r--vhosts/blog/public/slides/2023-03-15/phpstudy-tokyo-150/index.html83
-rw-r--r--vhosts/blog/public/slides/2023-03-15/phpstudy-tokyo-150/slide.pdfbin0 -> 248257 bytes
-rw-r--r--vhosts/blog/public/slides/2023-03-24/phperkaigi-2023/index.html83
-rw-r--r--vhosts/blog/public/slides/2023-03-24/phperkaigi-2023/slide.pdfbin0 -> 321814 bytes
-rw-r--r--vhosts/blog/public/slides/2023-03-25/phperkaigi-2023-tokens/index.html83
-rw-r--r--vhosts/blog/public/slides/2023-03-25/phperkaigi-2023-tokens/slide.pdfbin0 -> 753400 bytes
-rw-r--r--vhosts/blog/public/slides/2023-04-12/phpstudy-tokyo-151/index.html80
-rw-r--r--vhosts/blog/public/slides/2023-04-12/phpstudy-tokyo-151/slide.pdfbin0 -> 202360 bytes
-rw-r--r--vhosts/blog/public/slides/2023-06-21/phpstudy-tokyo-153/index.html80
-rw-r--r--vhosts/blog/public/slides/2023-06-21/phpstudy-tokyo-153/slide.pdfbin0 -> 179888 bytes
-rw-r--r--vhosts/blog/public/slides/2023-06-23/phpconfuk-2023-eve/index.html80
-rw-r--r--vhosts/blog/public/slides/2023-06-23/phpconfuk-2023-eve/slide.pdfbin0 -> 194763 bytes
-rw-r--r--vhosts/blog/public/slides/2023-07-26/phpstudy-tokyo-154/index.html80
-rw-r--r--vhosts/blog/public/slides/2023-07-26/phpstudy-tokyo-154/slide.pdfbin0 -> 243063 bytes
-rw-r--r--vhosts/blog/public/slides/2023-08-24/phpstudy-tokyo-155/index.html80
-rw-r--r--vhosts/blog/public/slides/2023-08-24/phpstudy-tokyo-155/slide.pdfbin0 -> 176356 bytes
-rw-r--r--vhosts/blog/public/slides/index.html194
-rw-r--r--vhosts/blog/public/style.css269
-rw-r--r--vhosts/blog/public/tags/conference/index.html165
-rw-r--r--vhosts/blog/public/tags/cpp/index.html60
-rw-r--r--vhosts/blog/public/tags/cpp17/index.html60
-rw-r--r--vhosts/blog/public/tags/index.html149
-rw-r--r--vhosts/blog/public/tags/note-to-self/index.html60
-rw-r--r--vhosts/blog/public/tags/php/index.html345
-rw-r--r--vhosts/blog/public/tags/phpcon/index.html60
-rw-r--r--vhosts/blog/public/tags/phpconfuk/index.html75
-rw-r--r--vhosts/blog/public/tags/phperkaigi/index.html180
-rw-r--r--vhosts/blog/public/tags/phpstudy-tokyo/index.html150
-rw-r--r--vhosts/blog/public/tags/python/index.html60
-rw-r--r--vhosts/blog/public/tags/python3/index.html60
-rw-r--r--vhosts/blog/public/tags/ruby/index.html75
-rw-r--r--vhosts/blog/public/tags/ruby3/index.html60
-rw-r--r--vhosts/blog/public/tags/rust/index.html60
-rw-r--r--vhosts/blog/public/tags/vim/index.html75
-rw-r--r--vhosts/blog/static/favicon.svg61
-rw-r--r--vhosts/blog/static/hl.css10
-rw-r--r--vhosts/blog/static/my-icon.js121
-rw-r--r--vhosts/blog/static/p5.min.js2
-rw-r--r--vhosts/blog/static/pdf.min.js22
-rw-r--r--vhosts/blog/static/pdf.worker.min.js22
-rw-r--r--vhosts/blog/static/slide.js59
-rw-r--r--vhosts/blog/static/style.css269
172 files changed, 20992 insertions, 0 deletions
diff --git a/vhosts/blog b/vhosts/blog
deleted file mode 160000
-Subproject d5d6eba0c7b2d7154fb7f6e74814a19c51e2e78
diff --git a/vhosts/blog/CHEATSHEET.md b/vhosts/blog/CHEATSHEET.md
new file mode 100644
index 00000000..456a485b
--- /dev/null
+++ b/vhosts/blog/CHEATSHEET.md
@@ -0,0 +1,38 @@
+article
+ info
+ title
+ abstract
+ keywordset
+ keyword
+ revhistory
+ revision
+ date
+ revremark
+ section
+
+
+
+anchor
+article
+blockquote
+caption
+date
+emphasis
+informaltable
+itemizedlist
+link
+listitem
+literal
+literallayout
+note
+orderedlist
+para
+programlisting
+section
+table
+tbody
+td
+tfoot
+thead
+title
+tr
diff --git a/vhosts/blog/LICENSE b/vhosts/blog/LICENSE
new file mode 100644
index 00000000..e72be07e
--- /dev/null
+++ b/vhosts/blog/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2022 nsfisis
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/vhosts/blog/Makefile b/vhosts/blog/Makefile
new file mode 100644
index 00000000..e57db10d
--- /dev/null
+++ b/vhosts/blog/Makefile
@@ -0,0 +1,30 @@
+.PHONY: all
+all: deploy
+
+.PHONY: deploy
+deploy: build serve
+
+.PHONY: setup
+setup:
+ true
+
+.PHONY: build
+build:
+ docker-compose build
+
+.PHONY: serve
+serve:
+ docker-compose up -d
+
+.PHONY: clean
+clean:
+ docker-compose down
+
+.PHONY: local_up
+local_up:
+ docker-compose -f docker-compose.local.yml up -d
+ @echo http://localhost
+
+.PHONY: local_down
+local_down:
+ docker-compose -f docker-compose.local.yml down
diff --git a/vhosts/blog/NOTE.md b/vhosts/blog/NOTE.md
new file mode 100644
index 00000000..d8f87cf7
--- /dev/null
+++ b/vhosts/blog/NOTE.md
@@ -0,0 +1,56 @@
+# My note
+
+## Commands
+
+Generate the site.
+
+```
+$ ./nuldoc build
+```
+
+Create a new post.
+
+```
+$ ./nuldoc new post
+```
+
+Create a new slide.
+
+```
+$ ./nuldoc new slide
+```
+
+Update PDF.js.
+
+```
+$ curl -o static/pdf.min.js https://unpkg.com/pdfjs-dist@3.4.120/build/pdf.min.js
+$ curl -o static/pdf.worker.min.js https://unpkg.com/pdfjs-dist@3.4.120/build/pdf.worker.min.js
+```
+
+Update p5.js.
+
+```
+$ curl -o static/p5.min.js https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.6.0/p5.min.js
+```
+
+
+## Structure
+
+```
+public
+├── sitemap.xml
+├── 404.html
+├── posts
+│   ├── 2021-03-05
+│   │   └── my-first-post
+│   │   └── index.html
+│   ├── feed.xml
+│   ├── _page
+│   │   ├── 1.html
+│   │   └── 2.html
+└── tags
+ ├── index.html
+ └── vim
+ ├── feed.xml
+ └── index.html
+```
diff --git a/vhosts/blog/README.md b/vhosts/blog/README.md
new file mode 100644
index 00000000..c4044324
--- /dev/null
+++ b/vhosts/blog/README.md
@@ -0,0 +1,29 @@
+Site: https://blog.nsfisis.dev
+
+
+
+# License
+
+```
+MIT License
+
+Copyright (c) 2022 nsfisis
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+```
diff --git a/vhosts/blog/content/posts/2021-03-05/my-first-post.xml b/vhosts/blog/content/posts/2021-03-05/my-first-post.xml
new file mode 100644
index 00000000..92732269
--- /dev/null
+++ b/vhosts/blog/content/posts/2021-03-05/my-first-post.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<article xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0">
+ <info>
+ <title>My First Post</title>
+ <abstract>
+ これはテスト投稿です。これはテスト投稿です。これはテスト投稿です。
+ </abstract>
+ <revhistory>
+ <revision>
+ <date>2021-03-05</date>
+ <revremark>公開</revremark>
+ </revision>
+ </revhistory>
+ </info>
+ <section xml:id="test">
+ <title>Test</title>
+ <para>
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
+ tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
+ veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
+ commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
+ velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
+ occaecat cupidatat non proident, sunt in culpa qui officia deserunt
+ mollit anim id est laborum.
+ </para>
+ </section>
+</article>
diff --git a/vhosts/blog/content/posts/2021-03-30/phperkaigi-2021.xml b/vhosts/blog/content/posts/2021-03-30/phperkaigi-2021.xml
new file mode 100644
index 00000000..f8813273
--- /dev/null
+++ b/vhosts/blog/content/posts/2021-03-30/phperkaigi-2021.xml
@@ -0,0 +1,778 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<article xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0">
+ <info>
+ <title>PHPerKaigi 2021</title>
+ <abstract>
+ 2021-03-26 から 2021-03-28 にかけて開催された、PHPerKaigi 2021 に参加した。
+ </abstract>
+ <keywordset>
+ <keyword>conference</keyword>
+ <keyword>php</keyword>
+ <keyword>phperkaigi</keyword>
+ </keywordset>
+ <revhistory>
+ <revision>
+ <date>2021-03-30</date>
+ <revremark>公開</revremark>
+ </revision>
+ </revhistory>
+ </info>
+ <section xml:id="report">
+ <title>PHPerKaigi 2021 参加レポ</title>
+ <para>
+ 2021-03-26 から 2021-03-28
+ にかけて開催された、 <link xl:href="https://phperkaigi.jp/2021/">PHPerKaigi 2021</link>
+ に一般参加者として参加した。
+ 弊社 <link xl:href="https://www.dgcircus.com/">デジタルサーカス株式会社</link>
+ (今年1月から勤務)
+ はダイヤモンドスポンサーとなっており、スポンサー枠のチケットを使わせていただいた。
+ </para>
+ <para>
+ このようなカンファレンスには初めて参加するのでかねてより心待ちにしていたのだが、生憎2日目から体調を崩してしまい、この記事も途中までとなっている。まだ見ていないセッションも多いが、ひとまず現時点での参加レポを書いておく。
+ </para>
+ <para>
+ 発表はトラック A、B に分かれていたのだが、今回はすべて A
+ トラックを視聴している (切り替えるのが面倒だっただけ)。
+ </para>
+ <section xml:id="report-legend">
+ <title>凡例</title>
+ <blockquote>
+ <para>
+ 発表・スライドのメモ (引用ではない)
+ </para>
+ </blockquote>
+ <para>
+ 感想など
+ </para>
+ </section>
+ <section xml:id="report--day-0">
+ <title>Day 0 前夜祭 (2021/03/27)</title>
+ <section xml:id="report--day-0--1730-a">
+ <title>17:30 [A]</title>
+ <para>
+ PHP で AWS Lambda
+ </para>
+ <blockquote>
+ <para>
+ Rails のプロジェクトを PHPer のメンバのみでメンテ →他のメンバもわかる
+ PHP にリプレースを検討
+ </para>
+ <itemizedlist>
+ <listitem>サーバレス</listitem>
+ <listitem>サーバ・インフラの管理が不要</listitem>
+ <listitem>アプリケーションコードの知識だけで保守可能</listitem>
+ </itemizedlist>
+ <para>
+ ゼロベースで作れる案件が (Railsの件とは別に)
+ あるため、そちらで試験的に導入?
+ </para>
+ <para>
+ AWSの学習 AWS のドキュメント DevelopersIO
+ </para>
+ <para>
+ AWS Lambda のカスタムランタイムで PHP を動かす
+ </para>
+ <para>
+ サーバのセットアップや維持管理を気にしなくて良い サーバーレスで PHP
+ を動かすツールがすでにある サーバーレス構築はすんなり
+ </para>
+ <para>
+ 今は Laravel がルーティングしている Laravel Livewire を Lambda
+ に載せられないか? デプロイ方法は? バッチ処理は? (Lambda は
+ 15分の制限)
+ </para>
+ <para>
+ Lambda でコンテナイメージがサポートされるように
+ </para>
+ <para>
+ 抽象化されたもの「だけ」しか知らないよりも具象の理解は助けになる
+ </para>
+ </blockquote>
+ <para>
+ AWS Lambda のような Function as a Service
+ はマイクロサービス化における一つの到達点に思えるのだが、これを使って実際に
+ web サービスを作る具体的なイメージがまだ見えない (注: すべて for me
+ として書いている)。
+ </para>
+ <para>
+ PHP on AWS Lambda があれだけ簡単に動かせるのには驚いた。
+ </para>
+ <para>
+ 勝手に AWS Lambda だとフットプリントの軽さが求められそう (= PHP +
+ Laravel などでは動かなさそう)
+ だという先入観を持っていたのだが、この発表のデモによればそうでもないらしい。
+ </para>
+ </section>
+ <section xml:id="report--day-0--1810-a">
+ <title>18:10 [A]</title>
+ <para>
+ 大規模サイトの SEO
+ </para>
+ <blockquote>
+ <para>
+ 大規模サイト (100万ページ以上) Google の基準
+ </para>
+ <para>
+ クロールバジェットを意識したSEO
+ </para>
+ <para>
+ 大規模サイトでコンテンツが中頻度 (1回/週) で更新 OR 中規模サイト
+ (10,000以上) でコンテンツが目まぐるしく変更される
+ これを満たさないなら、クロールバジェットを考えなくてもいい
+ </para>
+ <para>
+ サーチコンソール 「カバレッジ」の「除外」
+ 多すぎるのは問題→クロールバジェットを浪費している
+ </para>
+ <itemizedlist>
+ <listitem>クエリの順番を決める</listitem>
+ <listitem>空の値のルールを決めておく</listitem>
+ <listitem>リダイレクトすればインデックスはうまくいく</listitem>
+ <listitem>リンクが存在する限りクロールはされる</listitem>
+ </itemizedlist>
+ <para>
+ リニューアル前のURL
+ </para>
+ <para>
+ インデックスは移行される
+ リンクのURLが存在する限り、別のURLとしてクロールされる
+ リダイレクトされるとはいえ、リニューアル前のURLは移行した方が良い
+ リニューアルで無視されるようになったパラメータも注意
+ </para>
+ <para>
+ robotes.txt で拒否しているのにクロールされる 一時的に拒否を外して 404 や
+ 301 を読ませる 内部リンクを確認する JS でのリンクに書き換え
+ </para>
+ <para>
+ クエリパラメータからURLのパスに <literal>/tokyo?area=HOGE</literal> → <literal>/tokyo/HOGE</literal>
+ </para>
+ <para>
+ URL 設計だいじ
+ </para>
+ </blockquote>
+ <para>
+ SEO (Search Engine Optimization)
+ は大して知らないので新鮮な話が多かった。その分語れることも少ない……。
+ </para>
+ </section>
+ <section xml:id="report--day-0--1850-a">
+ <title>18:50 [A]</title>
+ <blockquote>
+ <para>
+ 知覚可能 操作可能 理解可能 堅牢 ちゃんとしたHTMLを書く
+ (閉じタグ・入れ子構造など)
+ </para>
+ <itemizedlist>
+ <listitem>標準の HTML を適切に使う</listitem>
+ <listitem>WAI-ARIA</listitem>
+ <listitem>キーボードフレンドリー</listitem>
+ <listitem>マシンフレンドリー</listitem>
+ <listitem>SEOフレンドリー</listitem>
+ </itemizedlist>
+ <para>
+ button タグ →キーボード h1 タグ →スクリーンリーダー・クローラ a タグ
+ </para>
+ <para>
+ WAI-ARIA HTML では表現できないセマンティクスを追加する
+ </para>
+ <itemizedlist>
+ <listitem>
+ ロール
+ <itemizedlist>
+ <listitem>何をするのか?</listitem>
+ <listitem>ユーザーアクションによって変化しない</listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ プロパティ
+ <itemizedlist>
+ <listitem>関連づけられたデータ</listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ ステート
+ <itemizedlist>
+ <listitem>現在の状態</listitem>
+ </itemizedlist>
+ </listitem>
+ </itemizedlist>
+ <para>
+ まずは標準の HTML 要素で解決する 何でもかんでも WAI-ARIA
+ を使えばいいというものではない
+ </para>
+ <para>
+ マウスホバーでツールチップが出てくるが、キーボード操作では出てこない
+ </para>
+ <para>
+ VoiceOver
+ </para>
+ <para>
+ 全ての属性を使う必要はない
+ あくまでアクセシビリティを上げるための方法の一つにすぎない
+ </para>
+ </blockquote>
+ <para>
+ つい最近 WAI-ARIA
+ についての記事を読んだばかりだったので個人的にタイムリーな話題だった。(あまりこの言葉を使いたくないのだが)
+ いわゆる「健常者」にとって、こうした問題を普段の生活の中で意識するのは難しい。だからこそ情報へのアンテナは張っておくようにしたい。
+ </para>
+ </section>
+ <section xml:id="report--day-0--1930-a">
+ <title>19:30 [A]</title>
+ <para>
+ PHP で FUSE
+ </para>
+ <para>
+ 個人的に楽しみだった発表。
+ </para>
+ <blockquote>
+ <para>
+ VFS (virtual filesystem) vs 具体的なファイルシステム
+ </para>
+ <para>
+ 最適な実装方法は状況により異なる
+ </para>
+ <para>
+ アプリケーションに見せるAPIは変えずに実装を隠蔽する→VFS
+ </para>
+ <para>
+ カーネルのプログラムを作るのは難しい
+ * 権限がデカすぎる
+ * システム全体がクラッシュ
+ * セキュリティリスク
+ * 開発サイクルを回しづらい
+ * ネイティブコードにコンパイルされる言語である必要がある
+ </para>
+ <para>
+ Filesystem in USEr space (FUSE)
+ </para>
+ <itemizedlist>
+ <listitem>特定の C の関数を呼ぶことで filesystem が作れる</listitem>
+ <listitem>FFI を持つ言語なら FUSE が使える</listitem>
+ </itemizedlist>
+ <para>
+ SSHFS / s3fs / Docker Desktop
+ </para>
+ <para>
+ Linux 以外でも使える
+ </para>
+ <itemizedlist>
+ <listitem>dokany (on Windows)</listitem>
+ <listitem>osxfuse</listitem>
+ </itemizedlist>
+ <para>
+ VFS: システムコールが呼ばれると、ファイルシステムによってコール FUSE:
+ カーネル空間からユーザ空間へ通信
+ </para>
+ <para>
+ 高レベルなラッパで型をつける
+ </para>
+ <para>
+ PHP 以外では Wordpress を FUSE にマウントする実装がある (C, Python など)
+ </para>
+ <itemizedlist>
+ <listitem>grep できる</listitem>
+ <listitem>sed できる</listitem>
+ <listitem>編集できる</listitem>
+ </itemizedlist>
+ </blockquote>
+ <para>
+ 期待通りの興味深い発表だった。FUSE
+ 自体も今回の発表で知ったのだが、これ本体の実装を見るのも面白そうだ。
+ この発表を聞きながらファイルシステムにマウントできそうなものを考えていたのだが、およそ木構造をしているものすべてと言えそうだ
+ (ハンマーしか持っていないと云々)。何かできそうだがなかなか思いつかない。
+ </para>
+ </section>
+ </section>
+ <section xml:id="report--day-1">
+ <title>Day 1 (2021/03/27)</title>
+ <section xml:id="report--day-1--1050-a">
+ <title>10:50 [A]</title>
+ <para>
+ ATDD
+ </para>
+ <blockquote>
+ <itemizedlist>
+ <listitem>ユーザーストーリー</listitem>
+ <listitem>ユニットテスト</listitem>
+ <listitem>CI/CD</listitem>
+ </itemizedlist>
+ <para>
+ ユーザストーリーの受け入れ条件が曖昧になりがち
+ デグレチェックがユニットレベルでは収まらない場合、手動で同じシナリオをテストしている
+ </para>
+ <para>
+ Q2の強化 アジャイルテストの4象限
+ </para>
+ <para>
+ 技術面/ビジネス面
+ 開発チーム支援(コーディング前・コーディング中)/製品批評(コーディング後)
+ </para>
+ <itemizedlist>
+ <listitem>
+ Q1: 技術面 &amp; チーム支援
+ <itemizedlist>
+ <listitem>TDD</listitem>
+ <listitem>ユニットテストなど</listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ Q2: ビジネス面 &amp; チーム支援
+ <itemizedlist>
+ <listitem>ATDD</listitem>
+ <listitem>ビジネス面の受け入れテストで駆動する</listitem>
+ </itemizedlist>
+ </listitem>
+ </itemizedlist>
+ <para>
+ Agile Alliance ユーザストーリーのスキルレベルを高める
+ </para>
+ <para>
+ テストピラミッド
+ </para>
+ <itemizedlist>
+ <listitem>UI Tests</listitem>
+ <listitem>Service Tests</listitem>
+ <listitem>Unit Tests</listitem>
+ <listitem>異なる粒度のテストを書く</listitem>
+ <listitem>
+ 高レベルになるほど、持つべきテストは少なくなる
+ <itemizedlist>
+ <listitem>ピラミッド型になる</listitem>
+ </itemizedlist>
+ </listitem>
+ </itemizedlist>
+ <para>
+ 高レベルテストが多すぎる→アイスクリームコーン アンチパターン
+ </para>
+ <para>
+ ATDD (Acceptance TDD) API経由・UI経由での高レベルテスト E2E test
+ </para>
+ <para>
+ ストーリ受け入れテスト
+ </para>
+ <para>
+ 入れ子のフィードバックループ ATDD(外側) と TDD(内側)
+ </para>
+ <para>
+ 外部品質・内部品質
+ </para>
+ <para>
+ バーティカルスライスのデリバリー
+ </para>
+ <itemizedlist>
+ <listitem>cucumber</listitem>
+ <listitem>gauge</listitem>
+ <listitem>behat</listitem>
+ </itemizedlist>
+ <para>
+ ユビキタス言語 手動テストもspecに書く 自動化は可能だがコスパが悪い
+ 失敗することがわかっているテスト(レッドテスト)はCIから外す
+ 失敗時の原因究明が難しい 饒舌なエラーメッセージ 状況のスナップショット
+ </para>
+ <para>
+ Continuous Testing
+ </para>
+ </blockquote>
+ <para>
+ User Acceptance Test (UAT)
+ くらいの規模になると個人開発・趣味開発では触れない領域なので、大いに勉強になった。スライドに添付されている資料が相当に充実していたので、これを読むのが本番といった様相すら感じる。
+ 高レベルテストの自動化は現在のプロジェクトでも感じており、自動化のチャンスは伺っている。とはいえセッションでも指摘されているように自動化することにコストがかかりすぎる領域があるのも事実で、そのバランスが難しい。
+ </para>
+ </section>
+ <section xml:id="report--day-1--1150-a">
+ <title>11:50 [A]</title>
+ <para>
+ 型解析を用いたリファクタリング
+ </para>
+ <para>
+ 型のある世界で生きてきた身として大いに楽しみにしていた発表。
+ </para>
+ <blockquote>
+ <itemizedlist>
+ <listitem>PHPStan</listitem>
+ <listitem>Phan</listitem>
+ <listitem>Psalm</listitem>
+ </itemizedlist>
+ <para>
+ autoload も認識できる bootstrapFiles
+ </para>
+ <para>
+ 編集箇所と利用箇所を CI でチェック ルールレベルを徐々に引き上げていく
+ 警告が多すぎると見落としてしまう・無視されやすくなる
+ </para>
+ <para>
+ 型がついていないことによるエラーが多い
+ </para>
+ <para>
+ 型よりも詳細な検査 <literal>Util_Assert::min</literal>
+ </para>
+ <para>
+ SQL を静的解析 placeholder の型付け
+ </para>
+ <para>
+ 警告レベルを低いレベルから導入 タイプヒントを積極的に書いていく PHPStan
+ の拡張を追加する
+ </para>
+ </blockquote>
+ <para>
+ 昨今、動的型付き言語での型宣言・型アノテーション・型ヒントの導入が相次いでいる。長らく静的型付き言語を書いてきた私からすると、ようやく気づいたかといったところだが、ともかく型を導入する言語が増えてきた。
+ 今のプロジェクトでも新しく追加するコードには型をつけるよう努めているが、どうしても古いコードには型がついていない。個人的には型のないコードに対してどう型を自動的に付けるかという点に興味があり、その点で
+ Ruby の typeprof には注目している。
+ </para>
+ </section>
+ <section xml:id="report--day-1--1230-a">
+ <title>12:30 [A]</title>
+ <para>
+ 昼食をとっていた。事前に何か食料を買っておくべきだった。
+ </para>
+ </section>
+ <section xml:id="report--day-1--1310-a">
+ <title>13:10 [A]</title>
+ <para>
+ Documentation as Code
+ </para>
+ <para>
+ この発表も以前から非常に楽しみにしていた。
+ </para>
+ <blockquote>
+ <para>
+ 開発開始までのオーバーヘッド 新規にチームにジョイン
+ 担当範囲外の機能を理解 オンボーディングのコスト
+ </para>
+ <para>
+ PHPerKaigi 2020 で発表あり
+ </para>
+ <para>
+ 継続的にシステムの理解を助けるドキュメント
+ </para>
+ <para>
+ 継続的ドキュメンテーション システムとドキュメントの乖離
+ </para>
+ <para>
+ 書いてあることが間違っている・足りない * 徐々にずれていく *
+ システムの更新タイミングとドキュメントの更新タイミングに差がある
+ </para>
+ <para>
+ システムとドキュメントは対応関係がある * 間違ったドキュメント *
+ 存在しないドキュメント
+ </para>
+ <para>
+ システムとドキュメントの乖離を定量化する 継続的に
+ システムの更新に近いタイミングで ドキュメントを更新し続ける
+ </para>
+ <para>
+ Documentation as Code
+ </para>
+ <para>
+ コードと同じツールでドキュメントを書く * issue tracker * vcs * plain
+ text markup * automation
+ </para>
+ <para>
+ 開発者 システム ドキュメント 構造化データ ソフトウェア
+ </para>
+ <para>
+ システムから構造化データを抽出する PHPDoc OpenAPI
+ </para>
+ <para>
+ ビュー 関心ごとに合わせてアーキテクチャを一つ以上の側面(断面)で説明する
+ </para>
+ <para>
+ ビューの単位でドキュメントに
+ </para>
+ <para>
+ スタックトレースからのドキュメント生成
+ </para>
+ </blockquote>
+ <para>
+ ドキュメントの管理は現プロジェクトでも課題と感じている。作られた当初は正しくても、実態と乖離していくのを止めるのは困難を極める。全体的に興味深い発表だったが、特にスタックトレースからのドキュメント生成というアイデアに惹かれるものを感じた。スタックトレースという実態と不可分な
+ (乖離しない)
+ 情報を起点にするのは理にかなっている。問題はトレースをいつ、どう取るかだろうか。それを自動化しなければ、実態との乖離が避けられないだろう。
+ </para>
+ </section>
+ <section xml:id="report--day-1--1410-a">
+ <title>14:10 [A]</title>
+ <para>
+ cookie による session 管理
+ </para>
+ <para>
+ 全体的に基本的な話だったので特に触れない。Cookie
+ やセッションの話としては非常に分かりやすくまとめられていたので、知らない人が学ぶにはいい教材だろう。
+ </para>
+ </section>
+ <section xml:id="report--day-1--1450-a">
+ <title>14:50 [A]</title>
+ <para>
+ PHP のエラーと例外
+ </para>
+ <blockquote>
+ <para>
+ エラー PHPエンジンがエラーを通知する 例外 プログラムが投げる
+ </para>
+ <para>
+ PHP7-8とエラー
+ </para>
+ <para>
+ PHPエンジンのエラーの一部が に変換されるようになった → try-catch
+ で捕捉できる
+ </para>
+ <para>
+ は例外とは異なる
+ </para>
+ <para>
+ PHP8 でエラーレベルの引き上げ
+ </para>
+ <itemizedlist>
+ <listitem>
+ 捕捉すべきもの
+ <itemizedlist>
+ <listitem>recoverable</listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ 捕捉すべきでないもの
+ <itemizedlist>
+ <listitem>unrecoverable</listitem>
+ <listitem>開発時に対処できるもの</listitem>
+ </itemizedlist>
+ </listitem>
+ </itemizedlist>
+ <para>
+ 例外 * 捕捉して事後処理 * 捕捉せず(or 捕捉した上で)さらに上に是非を問う
+ </para>
+ <para>
+ 開発段階で例外を把握し、ハンドリングを考えておく
+ </para>
+ <para>
+ と
+ </para>
+ <para>
+ はキャッチすべきでない
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+
+ </para>
+ <itemizedlist>
+ <listitem>本番で起きてはいけない</listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ <para>
+
+ </para>
+ <itemizedlist>
+ <listitem>本番で起きてはいけない →生じないのだから捕捉もしない</listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ <para>
+
+ </para>
+ <itemizedlist>
+ <listitem>起こるかもしれないので本番環境でも考慮する</listitem>
+ </itemizedlist>
+ </listitem>
+ </itemizedlist>
+ <para>
+ 捕捉して対応するのではなく、未然に防ぐ
+ </para>
+ <para>
+ 独自例外を使う を投げてしまうと、 catch ()せざるを得ない →catch
+ 範囲が広すぎる
+ </para>
+ <para>
+ SPL の例外を使う
+ </para>
+ <para>
+ 例外翻訳
+ 上位のレイヤが下位のレイヤの例外を捕捉し、上位レイヤのAPIに「翻訳」する
+ 下位レイヤの知識に依存させない
+ </para>
+ <para>
+ @throws 捕捉してほしい例外を書き連ねておく
+ </para>
+ <para>
+ 呼び出しもとに負わせたい責任
+ </para>
+ </blockquote>
+ <para>
+ PHP を学んでいる途中の私としては、今まさに聞きたい発表だった (現時点で
+ PHP を書き始めてから 4ヶ月ほどになる)。
+ </para>
+ <para>
+ 個人的に例外やエラーを最もうまく扱っているのは Go、Swift、Rust、Haskell
+ などのエラーを「値として」扱う言語だと思っている。try-catch
+ は通常の処理フローを完全に壊してしまう上、構文としても重すぎる。値としてのエラー通知は
+ C言語時代への回帰ともいえるが、その頃と異なるのはエラーを暗黙のうちに握り潰すことがないということだ。これらの言語は型を持っており、静的に検証ができる
+ (C のそれはまともな型付けではない。念のため)。
+ </para>
+ <para>
+ PHP
+ のように、すでに例外が言語システムに根ざしている言語ではどうすればよいか。この場合も同じく静的検証の力を借りることになるだろう。
+ </para>
+ </section>
+ <section xml:id="report--day-1--1530-a">
+ <title>15:30 [A]</title>
+ <para>
+ Laravel のメール認証
+ </para>
+ <para>
+ Laravel
+ の知識がない私にはまったくついていけなかった。また、個人的にタイトルがややミスリーディングに感じた。
+ </para>
+ </section>
+ <section xml:id="report--day-1--1610-a">
+ <title>16:10 [A]</title>
+ <para>
+ gRPC
+ </para>
+ <blockquote>
+ <para>
+ Unary RPCs Server streaming RPCs Client streaming RPCs Bidirectional
+ streaming RPCs
+ </para>
+ <para>
+ Protobuf
+ </para>
+ <para>
+ 実装とAPIが乖離しにくい 自動生成 複数言語でも相互に使える
+ </para>
+ <para>
+ マイクロサービスのサービス通信 スマホアプリ ゲームサーバ
+ </para>
+ <para>
+ PHP では?
+ </para>
+ <para>
+ PHP ではストリーミングが難しい リクエストごとにプロセスが使い捨て
+ </para>
+ <para>
+ PHP ではgRPCのクライアントしか対応していない
+ </para>
+ <para>
+ gRPC-Web ブラウザで扱うためのJSライブラリ+プロトコル
+ </para>
+ <para>
+ HTTP/1.1 でも使える Unary RPC と Server streaming RPC のみ
+ </para>
+ <para>
+ Envoy Nginx などで相互に gRPC と gRPC-Web で変換
+ </para>
+ <para>
+ Amp イベント駆動な並行処理のフレームワーク
+ </para>
+ <para>
+ HTTP/2 対応
+ </para>
+ <para>
+ C#のgRPC-Webが楽
+ </para>
+ </blockquote>
+ <para>
+ (発表の中でもまさに同じことをおっしゃっていたが) PHP
+ 以外の方が向いているだろう、というのが第一の感想である。gRPC
+ はそれ自体というよりも Protobuf
+ というエコシステムに乗れることのメリットが大きいと感じる。そのエコシステムにうまく乗れない時点で、うーんという感じ。
+ </para>
+ </section>
+ <section xml:id="report--day-1--1650-a">
+ <title>16:50 [A]</title>
+ <para>
+ アーキテクチャテスト
+ </para>
+ <blockquote>
+ <para>
+ Independent Core Layer Pattern
+ </para>
+ <para>
+ 開発初期のアーキテクチャが崩れる
+ アーキテクチャ観点のコードレビューができない
+ </para>
+ <para>
+ どこにクラスを置けばよいか? ドキュメントがない
+ </para>
+ <para>
+ アーキテクチャ設計に関する知識が属人化・暗黙知化
+ </para>
+ <para>
+ ガイドライン * 最初にルールを決めるのは簡単 *
+ ルール通り作り始めるのも簡単 *
+ →維持するのが難しい、人が決めたものゆえ壊れやすい
+ </para>
+ <para>
+ PHP の特性 * クラスは public * 可視性の制御が public / protected /
+ private のみ * 依存関係の制御が困難
+ </para>
+ <para>
+ アーキテクチャテスト
+ クラスの依存関係や実装ルールをコードとして表現し、自動テスト化する
+ </para>
+ <itemizedlist>
+ <listitem>deptrac</listitem>
+ <listitem>phpat</listitem>
+ </itemizedlist>
+ <para>
+ Independent Core Layer Pattern
+ </para>
+ <para>
+ アーキテクチャテストの失敗 * 実装誤り * or アーキテクチャが適切でない *
+ 開発の過程でフィードバックしていく
+ </para>
+ <para>
+ モジュラーモノリス→マイクロサービスへ
+ </para>
+ </blockquote>
+ </section>
+ </section>
+ <section xml:id="report--day-2">
+ <title>Day 2 (2021/03/28)</title>
+ <para>
+ 冒頭に書いた通り、2日目から体調が悪くまともに聴けていない。途中までは頭痛を我慢しつつ見ていたのだが、まともに入ってこなかった。
+ </para>
+ <para>
+ 残念ではあるが、いずれにせよ見られていない発表は他にもあるので、今週末にでもまとめて見ようと思う。
+ </para>
+ </section>
+ <section xml:id="report--comments">
+ <title>全体の感想</title>
+ <para>
+ Day 2
+ にほとんど参加できなかったのは残念だが、イベント自体は大変楽しく、また興味深いものであった。自分がまったく知らない領域の話を聞けるのはこうしたイベントならではだと感じる。オンライン開催ゆえ現地に行く必要がなく、気軽に参加できたのも
+ (特に初参加者として) 嬉しいポイントだった。
+ </para>
+ <para>
+ 今回、雑談/登壇者への質問等向けに Discord
+ サーバもあったのだが、こちらは参加こそしたものの ROM
+ のままになってしまった。発表に1ウィンドウ、メモを書くのに1ウィンドウ、Discord
+ 表示に
+ 1ウィンドウで私にはもう脳のリソースとディスプレイのスペースが追いつかなかった
+ (さらにいうと Zoom
+ でアンカンファレンスもやっていたようだ。こちらはまったく参加していない)。
+ </para>
+ <para>
+ 1つ個人的な反省点としては、一つ一つのセッションを真剣に聞き過ぎたというものがある。もっと適当に聞いておけばよかった。これだけだと大変語弊があるのだが、言い方を変えると、Discord
+ しかりアンカンファレンスしかり「このイベントのこの瞬間にしかないコンテンツ」に触れずに、後から見返せる発表やスライドに注力してしまった、ということだ。発表の詳細な見直しはあとからできるのだから、今しかできないことを考えるべきだった。
+ まあ初カンファレンスだし、とお茶を濁しておこう。
+ </para>
+ <para>
+ さて、カンファレンスで一つ気になったことがある。それは、Discord
+ という書き込み場所が増えたことでニコ生のコメントの流量が吸い取られてしまったのではないか、という点だ。ニコニコだけ見ていると過疎っているかのように見えた発表も、Discord
+ の方では盛り上がっている、というのを何度か見かけた。ニコニコのコメント方式は盛り上がりを如実に反映するが、逆もまたしかり。Discord
+ があったこと自体はプラスだったと思うが、この点はマイナスだったのではないかと感じる。
+ </para>
+ <para>
+ <hr/>
+ </para>
+ <para>
+ 最後になりましたが、毎年の PHPerKaigi
+ 開催にご尽力されている皆様、スピーカーの皆様、楽しい3日間でした。ありがとうございました!
+ (ずっと常体で書いてしまったのでいきなり仏頂面から笑顔になったようで気持ち悪い)
+ </para>
+ <para>
+ ではまた来年。
+ </para>
+ </section>
+ </section>
+</article>
diff --git a/vhosts/blog/content/posts/2021-10-02/cpp-you-can-use-keywords-in-attributes.xml b/vhosts/blog/content/posts/2021-10-02/cpp-you-can-use-keywords-in-attributes.xml
new file mode 100644
index 00000000..f87d3a65
--- /dev/null
+++ b/vhosts/blog/content/posts/2021-10-02/cpp-you-can-use-keywords-in-attributes.xml
@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<article xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0">
+ <info>
+ <title>【C++】 属性構文の属性名にはキーワードが使える</title>
+ <abstract>
+ C++ の属性構文の属性名には、キーワードが使える。ネタ記事。
+ </abstract>
+ <keywordset>
+ <keyword>cpp</keyword>
+ <keyword>cpp17</keyword>
+ </keywordset>
+ <revhistory>
+ <revision>
+ <date>2021-10-02</date>
+ <revremark>Qiita から移植</revremark>
+ </revision>
+ </revhistory>
+ </info>
+ <note>
+ この記事は Qiita から移植してきたものです。
+ 元 URL: <link xl:href="https://qiita.com/nsfisis/items/94090937bcf860cfa93b">https://qiita.com/nsfisis/items/94090937bcf860cfa93b</link>
+ </note>
+ <para>
+ タイトル落ち。まずはこのコードを見て欲しい。
+ </para>
+ <programlisting language="cpp" linenumbering="unnumbered">
+ <![CDATA[
+ #include <iostream>
+
+ [[alignas]] [[alignof]] [[and]] [[and_eq]] [[asm]] [[auto]] [[bitand]]
+ [[bitor]] [[bool]] [[break]] [[case]] [[catch]] [[char]] [[char16_t]]
+ [[char32_t]] [[class]] [[compl]] [[const]] [[const_cast]] [[constexpr]]
+ [[continue]] [[decltype]] [[default]] [[delete]] [[do]] [[double]]
+ [[dynamic_cast]] [[else]] [[enum]] [[explicit]] [[export]] [[extern]] [[false]]
+ [[final]] [[float]] [[for]] [[friend]] [[goto]] [[if]] [[inline]] [[int]]
+ [[long]] [[mutable]] [[namespace]] [[new]] [[noexcept]] [[not]] [[not_eq]]
+ [[nullptr]] [[operator]] [[or]] [[or_eq]] [[override]] [[private]]
+ [[protected]] [[public]] [[register]] [[reinterpret_cast]] [[return]] [[short]]
+ [[signed]] [[sizeof]] [[static]] [[static_assert]] [[static_cast]] [[struct]]
+ [[switch]] [[template]] [[this]] [[thread_local]] [[throw]] [[true]] [[try]]
+ [[typedef]] [[typeid]] [[typename]] [[union]] [[unsigned]]
+ [[virtual]] [[void]] [[volatile]] [[wchar_t]] [[while]] [[xor]] [[xor_eq]]
+ // [[using]]
+ int main() {
+ std::cout << "Hello, World!" << std::endl;
+ }
+ ]]>
+ </programlisting>
+ <blockquote>
+ <para>
+ コンパイラのバージョン $ clang++ –version Apple clang version 11.0.0
+ (clang-1100.0.33.8) Target: x86_64-apple-darwin19.6.0 Thread model:
+ posix InstalledDir:
+ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
+ </para>
+ <para>
+ コンパイルコマンド (C17指定) $ clang –std=c++17 hoge.cpp
+ </para>
+ </blockquote>
+ <para>
+ この記事から得られるものはこれ以上ないので以下は蛇足になる。
+ </para>
+ <para>
+ 別件で cppreference.com の
+ <link xl:href="https://en.cppreference.com/w/cpp/language/identifiers">identifier
+ のページ</link> を読んでいた時、次の文が目に止まった。
+ </para>
+ <blockquote>
+ <itemizedlist>
+ <listitem>
+ the identifiers that are keywords cannot be used for other purposes;
+ <itemizedlist>
+ <listitem>
+ The only place they can be used as non-keywords is in an
+ attribute-token. (e.g. [[private]] is a valid attribute) (since C++11)
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </itemizedlist>
+ </blockquote>
+ <para>
+ キーワードでも属性として指定する場合は非キーワードとして使えるらしい。
+ 実際にやってみる。
+ </para>
+ <para>
+ 同サイトの <link xl:href="https://en.cppreference.com/w/cpp/keyword">keywords のページ</link>
+ から一覧を拝借し、上のコードが出来上がった (C++17
+ においてキーワードでないものなど、一部省いている)。 大量の警告 (unknown
+ attribute `〇〇' ignored)
+ がコンパイラから出力されるが、コンパイルできる。
+ </para>
+ <para>
+ 上のコードでは <literal>[[using]]</literal> をコメントアウトしているが、これは <literal>using</literal>
+ キーワードのみ属性構文の中で意味を持つからであり、このコメントアウトを外すとコンパイルに失敗する。
+ </para>
+ <programlisting language="cpp" linenumbering="unnumbered">
+ <![CDATA[
+ // using の例
+ [[using foo: attr1, attr2]] int x; // [[foo::attr1, foo::attr2]] の糖衣構文
+ ]]>
+ </programlisting>
+ <para>
+ C++17 の仕様も見てみる (正確には標準化前のドラフト)。
+ </para>
+ <para>
+ 引用元: <link xl:href="https://timsong-cpp.github.io/cppwp/n4659/dcl.attr#grammar-4">https://timsong-cpp.github.io/cppwp/n4659/dcl.attr#grammar-4</link>
+ </para>
+ <blockquote>
+ <para>
+ If a keyword or an alternative token that satisfies the syntactic
+ requirements of an identifier is contained in an attribute-token, it is
+ considered an identifier.
+ </para>
+ </blockquote>
+ <para>
+ 「<literal>identifier</literal> の構文上の要件を満たすキーワードまたは代替トークンが
+ <literal>attribute-token</literal> に含まれている場合、<literal>identifier</literal>
+ とみなされる」とある。どうやら間違いないようだ。
+ </para>
+ <para>
+ ところで、代替トークン (alternative token) とは <literal>and</literal> (<literal>&amp;</literal>) や <literal>bitor</literal>
+ (<literal>|</literal>) などのことだが、<literal>identifier</literal>
+ の構文上の要件を満たさないような代替トークンなどあるのか?
+ 疑問に思って調べたところ、代替トークンという語にはダイグラフも含まれるらしい
+ (参考:
+ <link xl:href="https://timsong-cpp.github.io/cppwp/n4659/lex.digraph">同ドラフト</link>)
+ </para>
+ <itemizedlist>
+ <listitem><literal>&lt;%</literal> → <literal>{</literal></listitem>
+ <listitem><literal>%&gt;</literal> → <literal>}</literal></listitem>
+ <listitem><literal>&lt;:</literal> → <literal>[</literal></listitem>
+ <listitem><literal>:&gt;</literal> → <literal>]</literal></listitem>
+ <listitem><literal>%:</literal> → <literal>#</literal></listitem>
+ <listitem><literal>%:%:</literal> → <literal>##</literal></listitem>
+ </itemizedlist>
+ <para>
+ 「<literal>identifier</literal>
+ の構文上の要件を満たさないような代替トークン」はこれらが当てはまると思われる。
+ </para>
+ <para>
+ 調べた感想: 字句解析器か構文解析器が辛そう
+ </para>
+</article>
diff --git a/vhosts/blog/content/posts/2021-10-02/python-unbound-local-error.xml b/vhosts/blog/content/posts/2021-10-02/python-unbound-local-error.xml
new file mode 100644
index 00000000..eb8aa452
--- /dev/null
+++ b/vhosts/blog/content/posts/2021-10-02/python-unbound-local-error.xml
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<article xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0">
+ <info>
+ <title>【Python】 クロージャとUnboundLocalError: local variable 'x' referenced before assignment</title>
+ <abstract>
+ Python における UnboundLocalError の理由と対処法。
+ </abstract>
+ <keywordset>
+ <keyword>python</keyword>
+ <keyword>python3</keyword>
+ </keywordset>
+ <revhistory>
+ <revision>
+ <date>2021-10-02</date>
+ <revremark>Qiita から移植</revremark>
+ </revision>
+ </revhistory>
+ </info>
+ <note>
+ この記事は Qiita から移植してきたものです。
+ 元 URL: <link xl:href="https://qiita.com/nsfisis/items/5d733703afcb35bbf399">https://qiita.com/nsfisis/items/5d733703afcb35bbf399</link>
+ </note>
+ <para>
+ 本記事は Python 3.7.6 の動作結果を元にして書かれている。
+ </para>
+ <para>
+ Python でクロージャを作ろうと、次のようなコードを書いた。
+ </para>
+ <programlisting language="python" linenumbering="unnumbered">
+ <![CDATA[
+ def f():
+ x = 0
+ def g():
+ x += 1
+ g()
+
+ f()
+ ]]>
+ </programlisting>
+ <para>
+ 関数 <literal>g</literal> から 関数 <literal>f</literal> のスコープ内で定義された変数 <literal>x</literal> を参照し、それに
+ 1 を足そうとしている。 これを実行すると <literal>x += 1</literal>
+ の箇所でエラーが発生する。
+ </para>
+ <blockquote>
+ <para>
+ UnboundLocalError: local variable `x' referenced before assignment
+ </para>
+ </blockquote>
+ <para>
+ local変数 <literal>x</literal> が代入前に参照された、とある。これは、<literal>f</literal> の <literal>x</literal>
+ を参照するのではなく、新しく別の変数を <literal>g</literal> 内に作ってしまっているため。
+ 前述のコードを宣言と代入を便宜上分けて書き直すと次のようになる。<literal>var</literal>
+ を変数宣言のための構文として擬似的に利用している。
+ </para>
+ <programlisting language="python" linenumbering="unnumbered">
+ <![CDATA[
+ # 注: var は正しい Python の文法ではない。上記参照のこと
+ def f():
+ var x # f の local変数 'x' を宣言
+ x = 0 # x に 0 を代入
+ def g(): # f の内部関数 g を定義
+ var x # g の local変数 'x' を宣言
+ # たまたま f にも同じ名前の変数があるが、それとは別の変数
+ x += 1 # x に 1 を加算 (x = x + 1 の糖衣構文)
+ # 加算する前の値を参照しようとするが、まだ代入されていないためエラー
+ g()
+ ]]>
+ </programlisting>
+ <para>
+ 当初の意図を表現するには、次のように書けばよい。
+ </para>
+ <programlisting language="python" linenumbering="unnumbered">
+ <![CDATA[
+ def f():
+ x = 0
+ def g():
+ nonlocal x ## (*)
+ x += 1
+ g()
+ ]]>
+ </programlisting>
+ <para>
+ <literal>(*)</literal> のように、<literal>nonlocal</literal> を追加する。これにより一つ外側のスコープ (<literal>g</literal>
+ の一つ外側 = <literal>f</literal>) で定義されている <literal>x</literal> を探しに行くようになる。
+ </para>
+</article>
diff --git a/vhosts/blog/content/posts/2021-10-02/ruby-detect-running-implementation.xml b/vhosts/blog/content/posts/2021-10-02/ruby-detect-running-implementation.xml
new file mode 100644
index 00000000..7c0c960d
--- /dev/null
+++ b/vhosts/blog/content/posts/2021-10-02/ruby-detect-running-implementation.xml
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<article xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0">
+ <info>
+ <title>【Ruby】 自身を実行している処理系の種類を判定する</title>
+ <abstract>
+ Ruby には複数の実装があるが、自身を実行している処理系の種類をスクリプト上からどのように判定すればよいだろうか。
+ </abstract>
+ <keywordset>
+ <keyword>ruby</keyword>
+ </keywordset>
+ <revhistory>
+ <revision>
+ <date>2021-10-02</date>
+ <revremark>Qiita から移植</revremark>
+ </revision>
+ </revhistory>
+ </info>
+ <note>
+ この記事は Qiita から移植してきたものです。
+ 元 URL: <link xl:href="https://qiita.com/nsfisis/items/74d7ffeeebc51b20d791">https://qiita.com/nsfisis/items/74d7ffeeebc51b20d791</link>
+ </note>
+ <para>
+ Ruby
+ という言語には複数の実装があるが、それらをスクリプト上からどのようにして
+ programmatically に見分ければよいだろうか。
+ </para>
+ <para>
+ <literal>Object</literal> クラスに定義されている <literal>RUBY_ENGINE</literal>
+ という定数がこの用途に使える。
+ </para>
+ <para>
+ 参考:
+ <link xl:href="https://docs.ruby-lang.org/ja/latest/method/Object/c/RUBY_ENGINE.html">Object::RUBY_ENGINE</link>
+ </para>
+ <para>
+ 上記ページの例から引用する:
+ </para>
+ <programlisting language="shell-session" linenumbering="unnumbered">
+ <![CDATA[
+ $ ruby-1.9.1 -ve 'p RUBY_ENGINE'
+ ruby 1.9.1p0 (2009-03-04 revision 22762) [x86_64-linux]
+ "ruby"
+ $ jruby -ve 'p RUBY_ENGINE'
+ jruby 1.2.0 (ruby 1.8.6 patchlevel 287) (2009-03-16 rev 9419) [i386-java]
+ "jruby"
+ ]]>
+ </programlisting>
+ <para>
+ それぞれの処理系がどのような値を返すかだが、stack overflow
+ に良い質問と回答があった。
+ </para>
+ <para>
+ <link xl:href="https://stackoverflow.com/a/9894232">What values for RUBY_ENGINE
+ correspond to which Ruby implementations?</link> より引用:
+ </para>
+ <blockquote>
+ <table>
+ <thead>
+ <tr>
+ <td>RUBY_ENGINE</td>
+ <td>Implementation</td>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>&lt;undefined&gt;</td>
+ <td>MRI &lt; 1.9</td>
+ </tr>
+ <tr>
+ <td>`ruby'</td>
+ <td>MRI &gt;= 1.9 or REE</td>
+ </tr>
+ <tr>
+ <td>`jruby'</td>
+ <td>JRuby</td>
+ </tr>
+ <tr>
+ <td>`macruby'</td>
+ <td>MacRuby</td>
+ </tr>
+ <tr>
+ <td>`rbx'</td>
+ <td>Rubinius</td>
+ </tr>
+ <tr>
+ <td>`maglev'</td>
+ <td>MagLev</td>
+ </tr>
+ <tr>
+ <td>`ironruby'</td>
+ <td>IronRuby</td>
+ </tr>
+ <tr>
+ <td>`cardinal'</td>
+ <td>Cardinal</td>
+ </tr>
+ </tbody>
+ </table>
+ </blockquote>
+ <para>
+ なお、この質問・回答は
+ 2014年になされたものであり、値は変わっている可能性がある。MRI (aka
+ CRuby) については執筆時現在 (2020/12/8) も <literal>'ruby'</literal>
+ が返ってくることを確認済み。
+ </para>
+ <para>
+ この表にない主要な処理系として、https://mruby.org[mruby] は <literal>'mruby'</literal>
+ を返す。
+ </para>
+ <para>
+ <link xl:href="https://github.com/mruby/mruby/blob/ed29d74bfd95362eaeb946fcf7e865d80346b62b/include/mruby/version.h#L32-L35">mruby
+ 該当部分のソース</link> より引用:
+ </para>
+ <programlisting language="c" linenumbering="unnumbered">
+ <![CDATA[
+ /*
+ * Ruby engine.
+ */
+ #define MRUBY_RUBY_ENGINE "mruby"
+ ]]>
+ </programlisting>
+</article>
diff --git a/vhosts/blog/content/posts/2021-10-02/ruby-then-keyword-and-case-in.xml b/vhosts/blog/content/posts/2021-10-02/ruby-then-keyword-and-case-in.xml
new file mode 100644
index 00000000..0a799a3b
--- /dev/null
+++ b/vhosts/blog/content/posts/2021-10-02/ruby-then-keyword-and-case-in.xml
@@ -0,0 +1,270 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<article xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0">
+ <info>
+ <title>【Ruby】 then キーワードと case in</title>
+ <abstract>
+ Ruby 3.0 で追加される case in 構文と、then キーワードについて。
+ </abstract>
+ <keywordset>
+ <keyword>ruby</keyword>
+ <keyword>ruby3</keyword>
+ </keywordset>
+ <revhistory>
+ <revision>
+ <date>2021-10-02</date>
+ <revremark>Qiita から移植</revremark>
+ </revision>
+ </revhistory>
+ </info>
+ <note>
+ この記事は Qiita から移植してきたものです。
+ 元 URL: <link xl:href="https://qiita.com/nsfisis/items/787a8cf888a304497223">https://qiita.com/nsfisis/items/787a8cf888a304497223</link>
+ </note>
+ <section xml:id="tl-dr">
+ <title>TL; DR</title>
+ <para>
+ <literal>case</literal> - <literal>in</literal> によるパターンマッチング構文でも、<literal>case</literal> - <literal>when</literal>
+ と同じように <literal>then</literal> が使える (場合によっては使う必要がある)。
+ </para>
+ </section>
+ <section xml:id="what-is-then-keyword">
+ <title><literal>then</literal> とは</title>
+ <para>
+ 使われることは稀だが、Ruby では <literal>then</literal>
+ がキーワードになっている。次のように使う:
+ </para>
+ <programlisting language="ruby" linenumbering="unnumbered">
+ <![CDATA[
+ if cond then
+ puts "Y"
+ else
+ puts "N"
+ end
+ ]]>
+ </programlisting>
+ <para>
+ このキーワードが現れうる場所はいくつかあり、<literal>if</literal>、<literal>unless</literal>、<literal>rescue</literal>、<literal>case</literal>
+ 構文がそれに当たる。 上記のように、何か条件を書いた後 <literal>then</literal>
+ を置き、式がそこで終了していることを示すマーカーとして機能する。
+ </para>
+ <programlisting language="ruby" linenumbering="unnumbered">
+ <![CDATA[
+ # Example:
+
+ if x then
+ a
+ end
+
+ unless x then
+ a
+ end
+
+ begin
+ a
+ rescue then
+ b
+ end
+
+ case x
+ when p then
+ a
+ end
+ ]]>
+ </programlisting>
+ </section>
+ <section xml:id="why-then-is-usually-unnecessary">
+ <title>なぜ普段は書かなくてもよいのか</title>
+ <para>
+ 普通 Ruby のコードで <literal>then</literal>
+ を書くことはない。なぜか。次のコードを実行してみるとわかる。
+ </para>
+ <programlisting language="ruby" linenumbering="unnumbered">
+ <![CDATA[
+ if true puts 'Hello, World!' end
+ ]]>
+ </programlisting>
+ <para>
+ 次のような構文エラーが出力される。
+ </para>
+ <literallayout class="monospaced">
+ <![CDATA[
+ 20:1: syntax error, unexpected local variable or method, expecting `then' or ';' or '\n'
+ if true puts 'Hello, World!' end
+ ^~~~
+ 20:1: syntax error, unexpected `end', expecting end-of-input
+ ...f true puts 'Hello, World!' end
+ ]]>
+ </literallayout>
+ <para>
+ 二つ目のメッセージは無視して一つ目を読むと、<literal>then</literal> か <literal>;</literal>
+ か改行が来るはずのところ変数だかメソッドだかが現れたことによりエラーとなっているようだ。
+ </para>
+ <para>
+ ポイントは改行が <literal>then</literal> (や <literal>;</literal>) の代わりとなることである。<literal>true</literal>
+ の後に改行を入れてみる。
+ </para>
+ <programlisting language="ruby" linenumbering="unnumbered">
+ <![CDATA[
+ if true
+ puts 'Hello, World!' end
+ ]]>
+ </programlisting>
+ <para>
+ 無事 Hello, World! と出力されるようになった。
+ </para>
+ </section>
+ <section xml:id="why-then-or-linebreak-is-needed">
+ <title>なぜ <literal>then</literal> や <literal>;</literal> や改行が必要か</title>
+ <para>
+ なぜ <literal>then</literal> や <literal>;</literal> や改行 (以下 「<literal>then</literal> 等」)
+ が必要なのだろうか。次の例を見てほしい:
+ </para>
+ <programlisting language="ruby" linenumbering="unnumbered">
+ <![CDATA[
+ if a b end
+ ]]>
+ </programlisting>
+ <para>
+ <literal>then</literal> も <literal>;</literal>
+ も改行もないのでエラーになるが、これは条件式がどこまで続いているのかわからないためだ。
+ この例は二通りに解釈できる。
+ </para>
+ <programlisting language="ruby" linenumbering="unnumbered">
+ <![CDATA[
+ # a という変数かメソッドの評価結果が truthy なら b という変数かメソッドを評価
+ if a then
+ b
+ end
+ ]]>
+ </programlisting>
+ <programlisting language="ruby" linenumbering="unnumbered">
+ <![CDATA[
+ # a というメソッドに b という変数かメソッドの評価結果を渡して呼び出し、
+ # その結果が truthy なら何もしない
+ if a(b) then
+ end
+ ]]>
+ </programlisting>
+ <para>
+ <literal>then</literal> 等はこの曖昧性を排除するためにあり、条件式は <literal>if</literal> から <literal>then</literal>
+ 等までの間にある、ということを明確にする。 C系の <literal>if</literal> 後に来る <literal>(</literal>/<literal>)</literal>
+ や、Python の <literal>:</literal>、Rust/Go/Swift などの <literal>{</literal> も同じ役割を持つ。
+ </para>
+ <para>
+ Ruby の場合、プログラマーが書きやすいよう改行でもって <literal>then</literal>
+ が代用できるので、ほとんどの場合 <literal>then</literal> は必要ない。
+ </para>
+ </section>
+ <section xml:id="then-in-case-in">
+ <title><literal>case</literal> - <literal>in</literal> における <literal>then</literal></title>
+ <para>
+ ようやく本題にたどり着いた。来る Ruby 3.0 では <literal>case</literal> と <literal>in</literal>
+ キーワードを使ったパターンマッチングの構文が入る予定である。この構文でもパターン部との区切りとして
+ <literal>then</literal> 等が必要になる。 (現在の) Ruby には formal
+ な形式での文法仕様は存在しないので、yacc の定義ファイルを参照した (yacc
+ の説明は省略)。
+ </para>
+ <para>
+ <link xl:href="https://github.com/ruby/ruby/blob/221ca0f8281d39f0dfdfe13b2448875384bbf735/parse.y#L3961-L3986">https://github.com/ruby/ruby/blob/221ca0f8281d39f0dfdfe13b2448875384bbf735/parse.y#L3961-L3986</link>
+ </para>
+ <programlisting language="yacc" linenumbering="unnumbered">
+ <![CDATA[
+ p_case_body : keyword_in
+ {
+ SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
+ p->command_start = FALSE;
+ $<ctxt>1 = p->ctxt;
+ p->ctxt.in_kwarg = 1;
+ $<tbl>$ = push_pvtbl(p);
+ }
+ {
+ $<tbl>$ = push_pktbl(p);
+ }
+ p_top_expr then
+ {
+ pop_pktbl(p, $<tbl>3);
+ pop_pvtbl(p, $<tbl>2);
+ p->ctxt.in_kwarg = $<ctxt>1.in_kwarg;
+ }
+ compstmt
+ p_cases
+ {
+ /*%%%*/
+ $$ = NEW_IN($4, $7, $8, &@$);
+ /*% %*/
+ /*% ripper: in!($4, $7, escape_Qundef($8)) %*/
+ }
+ ;
+ ]]>
+ </programlisting>
+ <para>
+ 簡略版:
+ </para>
+ <programlisting language="yacc" linenumbering="unnumbered">
+ <![CDATA[
+ p_case_body : keyword_in p_top_expr then compstmt p_cases
+ ;
+ ]]>
+ </programlisting>
+ <para>
+ ここで、<literal>keyword_in</literal> は文字通り <literal>in</literal>、<literal>p_top_expr</literal>
+ はいわゆるパターン、<literal>then</literal> は <literal>then</literal>
+ キーワードのことではなく、この記事で <literal>then</literal> 等と呼んでいるもの、つまり
+ <literal>then</literal> キーワード、<literal>;</literal>、改行のいずれかである。
+ </para>
+ <para>
+ これにより、<literal>case</literal> - <literal>when</literal> による従来の構文と同じように、<literal>then</literal>
+ 等をパターンの後ろに挿入すればよいことがわかった。つまり次の3通りのいずれかになる:
+ </para>
+ <programlisting language="ruby" linenumbering="unnumbered">
+ <![CDATA[
+ case x
+ in 1 then a
+ in 2 then b
+ in 3 then c
+ end
+
+ case x
+ in 1
+ a
+ in 2
+ b
+ in 3
+ c
+ end
+
+ case x
+ in 1; a
+ in 2; b
+ in 3; c
+ end
+ ]]>
+ </programlisting>
+ <para>
+ ところで、<literal>p_top_expr</literal> には <literal>if</literal> による guard clause
+ が書けるので、その場合は <literal>if</literal> - <literal>then</literal> と似たような見た目になる。
+ </para>
+ <programlisting language="ruby" linenumbering="unnumbered">
+ <![CDATA[
+ case x
+ in 0 then a
+ in n if n < 0 then b
+ in n then c
+ end
+ ]]>
+ </programlisting>
+ </section>
+ <section xml:id="outro">
+ <title>まとめ</title>
+ <itemizedlist>
+ <listitem>
+ <literal>if</literal> や <literal>case</literal> の条件の後ろには <literal>then</literal>、<literal>;</literal>、改行のいずれかが必要
+ <itemizedlist>
+ <listitem>通常は改行しておけばよい</listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>3.0 で入る予定の <literal>case</literal> - <literal>in</literal> でも <literal>then</literal> 等が必要になる</listitem>
+ <listitem>Ruby の構文を正確に知るには (現状) <literal>parse.y</literal> を直接読めばよい</listitem>
+ </itemizedlist>
+ </section>
+</article>
diff --git a/vhosts/blog/content/posts/2021-10-02/rust-where-are-primitive-types-from.xml b/vhosts/blog/content/posts/2021-10-02/rust-where-are-primitive-types-from.xml
new file mode 100644
index 00000000..3aaca63f
--- /dev/null
+++ b/vhosts/blog/content/posts/2021-10-02/rust-where-are-primitive-types-from.xml
@@ -0,0 +1,237 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<article xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0">
+ <info>
+ <title>Rust のプリミティブ型はどこからやって来るか</title>
+ <abstract>
+ Rust のプリミティブ型は予約語ではなく普通の識別子である。どのようにこれが名前解決されるのかを調べた。
+ </abstract>
+ <keywordset>
+ <keyword>rust</keyword>
+ </keywordset>
+ <revhistory>
+ <revision>
+ <date>2021-10-02</date>
+ <revremark>Qiita から移植</revremark>
+ </revision>
+ </revhistory>
+ </info>
+ <note>
+ この記事は Qiita から移植してきたものです。
+ 元 URL: <link xl:href="https://qiita.com/nsfisis/items/9a429432258bbcd6c565">https://qiita.com/nsfisis/items/9a429432258bbcd6c565</link>
+ </note>
+ <section xml:id="intro">
+ <title>前置き</title>
+ <para>
+ Rust
+ において、プリミティブ型の名前は予約語でない。したがって、次のコードは合法である。
+ </para>
+ <programlisting language="rust" linenumbering="unnumbered">
+ <![CDATA[
+ #![allow(non_camel_case_types)]
+ #![allow(dead_code)]
+
+ struct bool;
+ struct char;
+ struct i8;
+ struct i16;
+ struct i32;
+ struct i64;
+ struct i128;
+ struct isize;
+ struct u8;
+ struct u16;
+ struct u32;
+ struct u64;
+ struct u128;
+ struct usize;
+ struct f32;
+ struct f64;
+ struct str;
+ ]]>
+ </programlisting>
+ <para>
+ では、普段単に <literal>bool</literal> と書いたとき、この <literal>bool</literal>
+ は一体どこから来ているのか。rustc のソースを追ってみた。
+ </para>
+ <blockquote>
+ <para>
+ 前提知識: 一般的なコンパイラの構造、用語。<literal>rustc</literal> そのものの知識は不要
+ (というよりも筆者自身がよく知らない)
+ </para>
+ </blockquote>
+ </section>
+ <section xml:id="code-reading">
+ <title>調査</title>
+ <para>
+ 調査に使用したソース (調査時点での最新 master)
+ </para>
+ <para>
+ <link xl:href="https://github.com/rust-lang/rust/tree/511ed9f2356af365ad8affe046b3dd33f7ac3c98">https://github.com/rust-lang/rust/tree/511ed9f2356af365ad8affe046b3dd33f7ac3c98</link>
+ </para>
+ <para>
+ どのようにして調べるか。rustc
+ の構造には詳しくないため、すぐに当たりをつけるのは難しい。
+ </para>
+ <para>
+ 大雑把な構造としては、<literal>compiler</literal> フォルダ以下に <literal>rustc_*</literal>
+ という名前のクレートが数十個入っている。これがどうやら <literal>rustc</literal>
+ コマンドの実装部のようだ。
+ </para>
+ <para>
+ <literal>rustc</literal> はセルフホストされている (= <literal>rustc</literal> 自身が Rust で書かれている)
+ ので、<literal>bool</literal> や <literal>char</literal>
+ などで適当に検索をかけてもノイズが多すぎて話にならない。
+ しかし、お誂え向きなことに <literal>i128</literal>/<literal>u128</literal>
+ というコンパイラ自身が使うことがなさそうな型が存在するのでこれを使って
+ <literal>git grep</literal> してみる。
+ </para>
+ <literallayout class="monospaced">
+ <![CDATA[
+ $ git grep "\bi128\b" | wc # i128
+ 165 1069 15790
+
+ $ git grep "\bu128\b" | wc # u128
+ 293 2127 26667
+
+ $ git grep "\bbool\b" | wc # cf. bool の結果
+ 3563 23577 294659
+ ]]>
+ </literallayout>
+ <para>
+ 165
+ 程度であれば探すことができそうだ。今回は、クレート名を見ておおよその当たりをつけた。
+ </para>
+ <literallayout class="monospaced">
+ <![CDATA[
+ $ git grep "\bi128\b"
+ ...
+ rustc_resolve/src/lib.rs: table.insert(sym::i128, Int(IntTy::I128));
+ ...
+ ]]>
+ </literallayout>
+ <para>
+ <literal>rustc_resolve</literal>
+ というのはいかにも名前解決を担いそうなクレート名である。該当箇所を見てみる。
+ </para>
+ <programlisting language="rust" linenumbering="unnumbered">
+ <![CDATA[
+ /// Interns the names of the primitive types.
+ ///
+ /// All other types are defined somewhere and possibly imported, but the primitive ones need
+ /// special handling, since they have no place of origin.
+ struct PrimitiveTypeTable {
+ primitive_types: FxHashMap<Symbol, PrimTy>,
+ }
+
+ impl PrimitiveTypeTable {
+ fn new() -> PrimitiveTypeTable {
+ let mut table = FxHashMap::default();
+
+ table.insert(sym::bool, Bool);
+ table.insert(sym::char, Char);
+ table.insert(sym::f32, Float(FloatTy::F32));
+ table.insert(sym::f64, Float(FloatTy::F64));
+ table.insert(sym::isize, Int(IntTy::Isize));
+ table.insert(sym::i8, Int(IntTy::I8));
+ table.insert(sym::i16, Int(IntTy::I16));
+ table.insert(sym::i32, Int(IntTy::I32));
+ table.insert(sym::i64, Int(IntTy::I64));
+ table.insert(sym::i128, Int(IntTy::I128));
+ table.insert(sym::str, Str);
+ table.insert(sym::usize, Uint(UintTy::Usize));
+ table.insert(sym::u8, Uint(UintTy::U8));
+ table.insert(sym::u16, Uint(UintTy::U16));
+ table.insert(sym::u32, Uint(UintTy::U32));
+ table.insert(sym::u64, Uint(UintTy::U64));
+ table.insert(sym::u128, Uint(UintTy::U128));
+ Self { primitive_types: table }
+ }
+ }
+ ]]>
+ </programlisting>
+ <para>
+ これは初めに列挙したプリミティブ型の一覧と一致している。doc comment
+ にも、
+ </para>
+ <blockquote>
+ <para>
+ All other types are defined somewhere and possibly imported, but the
+ primitive ones need special handling, since they have no place of
+ origin.
+ </para>
+ </blockquote>
+ <para>
+ とある。次はこの struct
+ の使用箇所を追う。追うと言っても使われている箇所は次の一箇所しかない。なお説明に不要な箇所は大きく削っている。
+ </para>
+ <programlisting language="rust" linenumbering="unnumbered">
+ <![CDATA[
+ /// This resolves the identifier `ident` in the namespace `ns` in the current lexical scope.
+ /// (略)
+ fn resolve_ident_in_lexical_scope(
+ &mut self,
+ mut ident: Ident,
+ ns: Namespace,
+ // (略)
+ ) -> Option<LexicalScopeBinding<'a>> {
+ // (略)
+
+ if ns == TypeNS {
+ if let Some(prim_ty) = self.primitive_type_table.primitive_types.get(&ident.name) {
+ let binding =
+ (Res::PrimTy(*prim_ty), ty::Visibility::Public, DUMMY_SP, ExpnId::root())
+ .to_name_binding(self.arenas);
+ return Some(LexicalScopeBinding::Item(binding));
+ }
+ }
+
+ None
+ }
+ ]]>
+ </programlisting>
+ <para>
+ 関数名や doc comment が示している通り、この関数は識別子 (identifier,
+ ident) を現在のレキシカルスコープ内で解決 (resolve) する。
+ <literal>if ns == TypeNS</literal> のブロック内では、<literal>primitive_type_table</literal> (上記の
+ <literal>PrimitiveTypeTable::new()</literal> で作られた変数) に含まれている識別子
+ (<literal>bool</literal>、<literal>i32</literal> など)
+ かどうか判定し、そうであればそれに紐づけられたプリミティブ型を返している。
+ </para>
+ <para>
+ なお、<literal>ns</literal> は「名前空間」を示す変数である。Rust
+ における名前空間はC言語におけるそれとほとんど同じで、今探している名前が関数名/変数名なのか型なのかマクロなのかを区別している。この
+ <literal>if</literal>
+ は、プリミティブ型に解決されるのは型を探しているときだけだ、と言っている。
+ </para>
+ <para>
+ 重要なのは、これが <literal>resolve_ident_in_lexical_scope()</literal>
+ の最後に書かれている点である。つまり、最初に挙げたプリミティブ型の識別子は、「名前解決の最終段階で」、「他に同名の型が見つかっていなければ」プリミティブ型として解決される。
+ </para>
+ <para>
+ 動作がわかったところで、例として次のコードを考える。
+ </para>
+ <programlisting language="rust" linenumbering="unnumbered">
+ <![CDATA[
+ #![allow(non_camel_case_types)]
+
+ struct bool;
+
+ fn main() {
+ let _: bool = bool;
+ }
+ ]]>
+ </programlisting>
+ <para>
+ ここで <literal>main()</literal> の <literal>bool</literal> は <literal>struct bool</literal>
+ として解決される。なぜなら、プリミティブ型の判定をする前に <literal>bool</literal>
+ という名前の別の型が見つかるからだ。
+ </para>
+ </section>
+ <section xml:id="outro">
+ <title>まとめ</title>
+ <para>
+ Rust
+ のプリミティブ型は予約語ではない。名前解決の最終段階で特別扱いされ、他に同名の型が見つかっていなければ対応するプリミティブ型に解決される。
+ </para>
+ </section>
+</article>
diff --git a/vhosts/blog/content/posts/2021-10-02/vim-difference-between-autocmd-bufwrite-and-bufwritepre.xml b/vhosts/blog/content/posts/2021-10-02/vim-difference-between-autocmd-bufwrite-and-bufwritepre.xml
new file mode 100644
index 00000000..ef17ae38
--- /dev/null
+++ b/vhosts/blog/content/posts/2021-10-02/vim-difference-between-autocmd-bufwrite-and-bufwritepre.xml
@@ -0,0 +1,165 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<article xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0">
+ <info>
+ <title>【Vim】 autocmd events の BufWrite/BufWritePre の違い</title>
+ <abstract>
+ Vim の autocmd events における BufWrite/BufWritePre がどう違うのかを調べた結果、違いはないことがわかった。
+ </abstract>
+ <keywordset>
+ <keyword>vim</keyword>
+ </keywordset>
+ <revhistory>
+ <revision>
+ <date>2021-10-02</date>
+ <revremark>Qiita から移植</revremark>
+ </revision>
+ </revhistory>
+ </info>
+ <note>
+ この記事は Qiita から移植してきたものです。
+ 元 URL: <link xl:href="https://qiita.com/nsfisis/items/79ab4db8564032de0b25">https://qiita.com/nsfisis/items/79ab4db8564032de0b25</link>
+ </note>
+ <section xml:id="tl-dr">
+ <title>TL; DR</title>
+ <para>
+ 違いはない。ただのエイリアス。
+ </para>
+ </section>
+ <section xml:id="code-reading">
+ <title>調査記録</title>
+ <para>
+ Vim の autocmd events には似通った名前のものがいくつかある。大抵は
+ <literal>:help</literal>
+ に説明があるが、この記事のタイトルにある2つを含めた以下のイベントには、その違いについて説明がない。
+ </para>
+ <itemizedlist>
+ <listitem><literal>BufRead</literal>/<literal>BufReadPost</literal></listitem>
+ <listitem><literal>BufWrite</literal>/<literal>BufWritePre</literal></listitem>
+ <listitem><literal>BufAdd</literal>/<literal>BufCreate</literal></listitem>
+ </itemizedlist>
+ <para>
+ このうち、<literal>BufAdd</literal>/<literal>BufCreate</literal> に関しては、<literal>:help BufCreate</literal> に
+ </para>
+ <blockquote>
+ <para>
+ The BufCreate event is for historic reasons.
+ </para>
+ </blockquote>
+ <para>
+ とあり、おそらくは <literal>BufAdd</literal>
+ のエイリアスであろうということがわかる。他の2組も同様ではないかと予想されるが、確認のため
+ vim と neovim のソースコードを調査した。
+ </para>
+ <blockquote>
+ <para>
+ ソースコードへのリンク
+ <link xl:href="https://github.com/vim/vim/tree/8e6be34338f13a6a625f19bcef82019c9adc65f2">vim (調査時点での master branch)</link>
+ <link xl:href="https://github.com/neovim/neovim/tree/71d4f5851f068eeb432af34850dddda8cc1c71e3">neovim (上に同じ)</link>
+ </para>
+ </blockquote>
+ <section xml:id="code-reading--vim">
+ <title>vim のソースコード</title>
+ <para>
+ 以下は、autocmd events
+ の名前と内部で使われている整数値とのマッピングを定義している箇所である。見ての通り、上でエイリアスではないかと述べた3組には、それぞれ同じ内部値が使われている。
+ </para>
+ <para>
+ <link xl:href="https://github.com/vim/vim/blob/8e6be34338f13a6a625f19bcef82019c9adc65f2/src/autocmd.c#L85-L86">https://github.com/vim/vim/blob/8e6be34338f13a6a625f19bcef82019c9adc65f2/src/autocmd.c#L85-L86</link>
+ </para>
+ <programlisting language="c" linenumbering="unnumbered">
+ <![CDATA[
+ {"BufAdd", EVENT_BUFADD},
+ {"BufCreate", EVENT_BUFADD},
+ ]]>
+ </programlisting>
+ <para>
+ <link xl:href="https://github.com/vim/vim/blob/8e6be34338f13a6a625f19bcef82019c9adc65f2/src/autocmd.c#L95-L97">https://github.com/vim/vim/blob/8e6be34338f13a6a625f19bcef82019c9adc65f2/src/autocmd.c#L95-L97</link>
+ </para>
+ <programlisting language="c" linenumbering="unnumbered">
+ <![CDATA[
+ {"BufRead", EVENT_BUFREADPOST},
+ {"BufReadCmd", EVENT_BUFREADCMD},
+ {"BufReadPost", EVENT_BUFREADPOST},
+ ]]>
+ </programlisting>
+ <para>
+ <link xl:href="https://github.com/vim/vim/blob/8e6be34338f13a6a625f19bcef82019c9adc65f2/src/autocmd.c#L103-L105">https://github.com/vim/vim/blob/8e6be34338f13a6a625f19bcef82019c9adc65f2/src/autocmd.c#L103-L105</link>
+ </para>
+ <programlisting language="c" linenumbering="unnumbered">
+ <![CDATA[
+ {"BufWrite", EVENT_BUFWRITEPRE},
+ {"BufWritePost", EVENT_BUFWRITEPOST},
+ {"BufWritePre", EVENT_BUFWRITEPRE},
+ ]]>
+ </programlisting>
+ </section>
+ <section xml:id="code-reading--neovim">
+ <title>neovim のソースコード</title>
+ <para>
+ neovim の場合でも同様のマッピングが定義されているが、こちらの場合は Lua
+ で書かれている。以下にある通り、はっきり <literal>aliases</literal> と書かれている。
+ </para>
+ <para>
+ <link xl:href="https://github.com/neovim/neovim/blob/71d4f5851f068eeb432af34850dddda8cc1c71e3/src/nvim/auevents.lua#L119-L124">https://github.com/neovim/neovim/blob/71d4f5851f068eeb432af34850dddda8cc1c71e3/src/nvim/auevents.lua#L119-L124</link>
+ </para>
+ <programlisting language="lua" linenumbering="unnumbered">
+ <![CDATA[
+ aliases = {
+ BufCreate = 'BufAdd',
+ BufRead = 'BufReadPost',
+ BufWrite = 'BufWritePre',
+ FileEncoding = 'EncodingChanged',
+ },
+ ]]>
+ </programlisting>
+ <para>
+ ところで、上では取り上げなかった <literal>FileEncoding</literal> だが、これは
+ <literal>:help FileEncoding</literal> にしっかりと書いてある。
+ </para>
+ <literallayout class="monospaced">
+ <![CDATA[
+ *FileEncoding*
+ FileEncoding Obsolete. It still works and is equivalent
+ to |EncodingChanged|.
+ ]]>
+ </literallayout>
+ </section>
+ </section>
+ <section xml:id="outro">
+ <title>まとめ</title>
+ <para>
+ 記事タイトルについて言えば、どちらも変わらないので好きな方を使えばよい。あえて言えば、次のようになるだろう。
+ </para>
+ <itemizedlist>
+ <listitem>
+ <literal>BufAdd</literal>/<literal>BufCreate</literal>
+ <itemizedlist>
+ <listitem>→ <literal>BufCreate</literal> は歴史的な理由により ("for historic reasons") 存在しているため、新しい方 (<literal>BufAdd</literal>) を使う</listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ <literal>BufRead</literal>/<literal>BufReadPost</literal>
+ <itemizedlist>
+ <listitem>→ <literal>BufReadPre</literal> との対称性のため、あるいは <literal>BufWritePost</literal> との対称性のため <literal>BufReadPost</literal> を使う</listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ <literal>BufWrite</literal>/<literal>BufWritePre</literal>
+ <itemizedlist>
+ <listitem>→ <literal>BufWritePost</literal> との対称性のため、あるいは <literal>BufReadPre</literal> との対称性のため <literal>BufWritePre</literal> を使う</listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ <literal>FileEncoding</literal>/<literal>EncodingChanged</literal>
+ <itemizedlist>
+ <listitem>→ <literal>FileEncoding</literal> は <literal>`Obsolete'' と明言されているので、`EncodingChanged</literal> を使う</listitem>
+ </itemizedlist>
+ </listitem>
+ </itemizedlist>
+ <para>
+ ところでこの調査で知ったのだが、<literal>BufRead</literal> と <literal>BufWrite</literal>
+ は上にある通り発火するタイミングが「後」と「前」で対称性がない。可能なら
+ <literal>Pre</literal>/<literal>Post</literal> 付きのものを使った方が分かりやすいだろう。
+ </para>
+ </section>
+</article>
diff --git a/vhosts/blog/content/posts/2021-10-02/vim-swap-order-of-selected-lines.xml b/vhosts/blog/content/posts/2021-10-02/vim-swap-order-of-selected-lines.xml
new file mode 100644
index 00000000..c4c26ca8
--- /dev/null
+++ b/vhosts/blog/content/posts/2021-10-02/vim-swap-order-of-selected-lines.xml
@@ -0,0 +1,215 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<article xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0">
+ <info>
+ <title>Vimで選択した行の順番を入れ替える</title>
+ <abstract>
+ Vim で選択した行の順番を入れ替える方法。
+ </abstract>
+ <keywordset>
+ <keyword>vim</keyword>
+ </keywordset>
+ <revhistory>
+ <revision>
+ <date>2021-10-02</date>
+ <revremark>Qiita から移植</revremark>
+ </revision>
+ </revhistory>
+ </info>
+ <note>
+ この記事は Qiita から移植してきたものです。
+ 元 URL: <link xl:href="https://qiita.com/nsfisis/items/4fefb361d9a693803520">https://qiita.com/nsfisis/items/4fefb361d9a693803520</link>
+ </note>
+ <section xml:id="tl-dr">
+ <title>TL; DR</title>
+ <programlisting language="vim" linenumbering="unnumbered">
+ <![CDATA[
+ " License: Public Domain
+
+ command! -bar -range=%
+ \ Reverse
+ \ keeppatterns <line1>,<line2>g/^/m<line1>-1
+ ]]>
+ </programlisting>
+ </section>
+ <section xml:id="version">
+ <title>バージョン情報</title>
+ <para>
+ <literal>:version</literal> の一部
+ </para>
+ <blockquote>
+ <para>
+ VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Jan 26 2020 11:30:30) macOS
+ version Included patches: 1-148 Huge version without GUI.
+ </para>
+ </blockquote>
+ </section>
+ <section xml:id="existing-solution">
+ <title>よく紹介されている手法</title>
+ <section xml:id="existing-solution--external-commands">
+ <title><literal>tac</literal> / <literal>tail</literal></title>
+ <para>
+ <literal>tac</literal> や <literal>tail -r</literal> などの外部コマンドを <literal>!</literal>
+ を使って呼び出し、置き換える。
+ </para>
+ <blockquote>
+ <para>
+ :h v_!
+ </para>
+ </blockquote>
+ <para>
+ <literal>tac</literal> コマンドや <literal>tail</literal> の <literal>-r</literal>
+ オプションは環境によって利用できないことがあり、複数の環境を行き来する場合に採用しづらい
+ </para>
+ </section>
+ <section xml:id="existing-solution--global-command">
+ <title><literal>:g/^/m0</literal></title>
+ <para>
+ こちらは外部コマンドに頼らず、Vim の機能のみを使う。<literal>g</literal> は <literal>:global</literal>
+ コマンドの、<literal>m</literal> は <literal>:move</literal> コマンドの略
+ </para>
+ <para>
+ <literal>:global</literal> コマンドは <literal>:[range]global/{pattern}/[command]</literal>
+ のように使い、<literal>[range]</literal> で指定された範囲の行のうち、<literal>{pattern}</literal>
+ で指定された検索パターンにマッチする行に対して、順番に <literal>[command]</literal>
+ で指定された Ex コマンドを呼び出す。
+ </para>
+ <blockquote>
+ <para>
+ :h :global
+ </para>
+ </blockquote>
+ <para>
+ <literal>:move</literal> コマンドは <literal>[range]:move {address}</literal> のように使い、<literal>[range]</literal>
+ で指定された範囲の行を <literal>{address}</literal> で指定された位置に移動させる。
+ </para>
+ <blockquote>
+ <para>
+ :h :move
+ </para>
+ </blockquote>
+ <para>
+ <literal>:g/^/m0</literal> のように組み合わせると、「すべての行を1行ずつ
+ 0行目(1行目の上)に動かす」という動きをする。これは確かに行の入れ替えになっている。
+ </para>
+ <para>
+ なお、<literal>:g/^/m0</literal> は全ての行を入れ替えるが、<literal>:N,Mg/^/mN-1</literal> とすることで
+ N行目から
+ M行目を処理範囲とするよう拡張できる。手でこれを入力するわけにはいかないので、次のようなコマンドを用意する。
+ </para>
+ <programlisting language="vim" linenumbering="unnumbered">
+ <![CDATA[
+ command! -bar -range=%
+ \ Reverse
+ \ <line1>,<line2>g/^/m<line1>-1
+ ]]>
+ </programlisting>
+ <para>
+ これは望みの動作をするが、実際に実行してみると全行がハイライトされてしまう。次節で詳細を述べる。
+ </para>
+ </section>
+ </section>
+ <section xml:id="problem-of-global-command">
+ <title><literal>:g/^/m0</literal> の問題点</title>
+ <para>
+ <literal>:global</literal>
+ コマンドは各行に対してマッチングを行う際、現在の検索パターンを上書きしてしまう。<literal>^</literal>
+ は行の先頭にマッチするため、結果として全ての行がハイライトされてしまう。<literal>'hlsearch'</literal>
+ オプションを無効にしている場合その限りではないが、その場合でも直前の検索パターンが失われてしまうと
+ <literal>n</literal> コマンドなどの際に不便である。
+ </para>
+ <blockquote>
+ <para>
+ :h @/
+ </para>
+ </blockquote>
+ </section>
+ <section xml:id="solution">
+ <title>解決策</title>
+ <blockquote>
+ <para>
+ [2020/9/28追記] より簡潔な方法を見つけたので次節に追記した
+ </para>
+ </blockquote>
+ <para>
+ 前述した <literal>:Reverse</literal> コマンドの定義を少し変えて、次のようにする:
+ </para>
+ <programlisting language="vim" linenumbering="unnumbered">
+ <![CDATA[
+ function! s:reverse_lines(from, to) abort
+ execute printf("%d,%dg/^/m%d", a:from, a:to, a:from - 1)
+ endfunction
+
+ command! -bar -range=%
+ \ Reverse
+ \ call <SID>reverse_lines(<line1>, <line2>)
+ ]]>
+ </programlisting>
+ <para>
+ 実行しているコマンドが変わったわけではないが、関数呼び出しを経由するようにした。これだけで前述の問題が解決する。
+ </para>
+ <para>
+ この理由は、ユーザー定義関数を実行する際は検索パターンが一度保存され、実行が終了したあと復元されるため。結果として検索パターンが
+ <literal>^</literal> で上書きされることがなくなる。
+ </para>
+ <para>
+ Vim のヘルプから該当箇所を引用する (強調は筆者による)。
+ </para>
+ <blockquote>
+ <para>
+ :h autocmd-searchpat
+ </para>
+ <para>
+ <emphasis role="strong">Autocommands do not change the current search patterns.</emphasis> Vim saves the
+ current search patterns before executing autocommands then restores them
+ after the autocommands finish. This means that autocommands do not
+ affect the strings highlighted with the `hlsearch' option.
+ </para>
+ </blockquote>
+ <para>
+ これは autocommand
+ の実行に関しての記述だが、これと同じことがユーザー定義関数の実行時にも適用される。このことは
+ <literal>:nohlsearch</literal> のヘルプにある。同じく該当箇所を引用する
+ (強調は筆者による)。
+ </para>
+ <blockquote>
+ <para>
+ :h :nohlsearch
+ </para>
+ <para>
+ (略) This command doesn’t work in an autocommand, because the
+ highlighting state is saved and restored when executing autocommands
+ |autocmd-searchpat|. <emphasis role="strong">Same thing for when invoking a user function.</emphasis>
+ </para>
+ </blockquote>
+ <para>
+ この仕様により、<literal>:g/^/m0</literal>
+ の呼び出しをユーザー定義関数に切り出すことで上述の問題を解決できる。
+ </para>
+ </section>
+ <section xml:id="solution-revised">
+ <title>解決策 (改訂版)</title>
+ <blockquote>
+ <para>
+ [2020/9/28追記] より簡潔な方法を見つけたため追記する
+ </para>
+ </blockquote>
+ <programlisting language="vim" linenumbering="unnumbered">
+ <![CDATA[
+ command! -bar -range=%
+ \ Reverse
+ \ keeppatterns <line1>,<line2>g/^/m<line1>-1
+ ]]>
+ </programlisting>
+ <para>
+ まさにこのための Exコマンド、<literal>:keeppatterns</literal>
+ が存在する。<literal>:keeppatterns {command}</literal>
+ のように使い、読んで字の如く、後ろに続く
+ Exコマンドを「現在の検索パターンを保ったまま」実行する。はるかに分かりやすく意図を表現できる。
+ </para>
+ <blockquote>
+ <para>
+ :h :keeppatterns
+ </para>
+ </blockquote>
+ </section>
+</article>
diff --git a/vhosts/blog/content/posts/2022-04-09/phperkaigi-2022-tokens.xml b/vhosts/blog/content/posts/2022-04-09/phperkaigi-2022-tokens.xml
new file mode 100644
index 00000000..898d7ea9
--- /dev/null
+++ b/vhosts/blog/content/posts/2022-04-09/phperkaigi-2022-tokens.xml
@@ -0,0 +1,563 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<article xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0">
+ <info>
+ <title>PHPerKaigi 2022 トークン問題の解説</title>
+ <abstract>
+ PHPerKaigi 2022 で私が作成した PHPer チャレンジ問題を解説する。
+ </abstract>
+ <keywordset>
+ <keyword>conference</keyword>
+ <keyword>php</keyword>
+ <keyword>phperkaigi</keyword>
+ </keywordset>
+ <revhistory>
+ <revision>
+ <date>2022-04-09</date>
+ <revremark>公開</revremark>
+ </revision>
+ <revision>
+ <date>2022-04-16</date>
+ <revremark>2問目、3問目の解説を追加、1問目に加筆</revremark>
+ </revision>
+ </revhistory>
+ </info>
+ <section xml:id="intro">
+ <title>はじめに</title>
+ <para>
+ 本日開始された <link xl:href="https://phperkaigi.jp/2022/">PHPerKaigi 2022</link> の PHPer
+ チャレンジにおいて、弊社
+ <link xl:href="https://www.dgcircus.com/">デジタルサーカス株式会社</link> の問題を
+ 3問作成した。この記事では、これらの問題の解説をおこなう。
+ </para>
+ <para>
+ リポジトリはこちら: <link xl:href="https://github.com/nsfisis/PHPerKaigi2022-tokens">https://github.com/nsfisis/PHPerKaigi2022-tokens</link>
+ </para>
+ </section>
+ <section xml:id="q1-brainfuck">
+ <title>第1問 brainf_ck.php</title>
+ <para>
+ ソースコードはこちら。実行には PHP 8.1 以上が必要なので注意。
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ <?php
+
+ declare(strict_types=0O1);
+
+ namespace Dgcircus\PHPerKaigi\Y2022;
+
+ /**
+ * @todo
+ * Run this program to acquire a PHPer token.
+ */
+
+ https://creativecommons.org/publicdomain/zero/1.0/
+
+ \error_reporting(~+!'We are hiring!');
+
+ $z = fn($f) => (fn($x) => $f(fn(...$xs) => $x($x)(...$xs)))(fn($x) => $f(fn(...$xs) => $x($x)(...$xs)));
+ $id = \spl_object_id(...);
+ $put = fn($c) => \printf('%c', $c);
+ $mm = fn($p, $n) => new \ArrayObject(\array_fill(+!![], $n, $p));
+
+ $👉 = fn($m, $p, $b, $e, $mp, $pc) => [++$mp, ++$pc];
+ $👈 = fn($m, $p, $b, $e, $mp, $pc) => [--$mp, ++$pc];
+ $👍 = fn($m, $p, $b, $e, $mp, $pc) => [$mp, ++$pc, ++$m[$mp]];
+ $👎 = fn($m, $p, $b, $e, $mp, $pc) => [$mp, ++$pc, --$m[$mp]];
+ $📝 = fn($m, $p, $b, $e, $mp, $pc) => [$mp, ++$pc, $put($m[$mp])];
+ $🤡 = fn($m, $p, $b, $e, $mp, $pc) => match ($m[$mp]) {
+ +!![] => [$mp, $z(fn($loop) => fn($pc, $n) => match ($id($p[$pc])) {
+ $b => $loop(++$pc, ++$n),
+ $e => $n === +!![] ? ++$pc : $loop(++$pc, --$n),
+ default => $loop(++$pc, $n),
+ })($pc, -![])],
+ default => [$mp, ++$pc],
+ };
+ $🎪 = fn($m, $p, $b, $e, $mp, $pc) => match ($m[$mp]) {
+ +!![] => [$mp, ++$pc],
+ default => [$mp, $z(fn($loop) => fn($pc, $n) => match ($id($p[$pc])) {
+ $e => $loop(--$pc, ++$n),
+ $b => $n === +!![] ? $pc+![] : $loop(--$pc, --$n),
+ default => $loop(--$pc, $n),
+ })($pc, -![])],
+ };
+ $🐘 = fn($p) => $z(fn($loop) => fn($m, $p, $b, $e, $mp, $pc) =>
+ isset($p[$pc]) && $loop($m, $p, $b, $e, ...($p[$pc]($m, $p, $b, $e, $mp, $pc)))
+ )($mm(+!![], +(![].![])), $p, $id($🤡), $id($🎪), +!![], +!![]);
+
+ $🐘([
+ $👍, $👍, $👍, $👍, $👍, $👍, $👍, $👍, $👍, $👍,
+ $🤡,
+ $👉, $👍, $👍, $👍,
+ $👉, $👍, $👍, $👍, $👍, $👍,
+ $👉, $👍, $👍, $👍, $👍, $👍, $👍, $👍, $👍, $👍, $👍, $👍, $👍,
+ $👉, $👍, $👍, $👍, $👍, $👍, $👍, $👍, $👍, $👍, $👍,
+ $👈, $👈, $👈, $👈, $👎,
+ $🎪,
+ $👉, $👍, $👍, $👍, $👍, $👍, $📝,
+ $👎, $👎, $📝,
+ $👉, $👎, $👎, $👎, $📝,
+ $👉, $👎, $👎, $👎, $📝,
+ $👎, $👎, $📝,
+ $👎, $📝,
+ $👈, $📝,
+ $👉, $👉, $👎, $👎, $📝,
+ $👍, $👍, $👍, $👍, $👍, $👍, $👍, $📝,
+ $👈, $👎, $👎, $👎, $👎, $📝,
+ $👈, $📝,
+ $👉, $👍, $👍, $📝,
+ $👉, $👎, $📝,
+ $👈, $📝,
+ ]);
+ ]]>
+ </programlisting>
+ <para>
+ この問題は、単に適切なバージョンの PHP で動かせばトークンが得られる。
+ </para>
+ <section xml:id="q1-brainfuck--commentary">
+ <title>解説</title>
+ <section xml:id="q1-brainfuck--commentary--emoji">
+ <title>絵文字</title>
+ <para>
+ まず目につくのは大量の絵文字だろう。 PHP
+ は識別子に使用できる文字の範囲が広く、絵文字も使うことができる。
+ </para>
+ </section>
+ <section xml:id="q1-brainfuck--commentary--brainfuck">
+ <title>プログラム全体</title>
+ <para>
+ Brainf*ck のインタプリタとプログラムになっている。 Brainf*ck
+ とは、難解プログラミング言語のひとつであり、ここで説明するよりも
+ Wikipedia の該当ページを読んだ方がよい。
+ </para>
+ <para>
+ <link xl:href="https://ja.wikipedia.org/wiki/Brainfuck">https://ja.wikipedia.org/wiki/Brainfuck</link>
+ </para>
+ <para>
+ なお、brainf*ck プログラムを普通の書き方で書くと、次のようになる。
+ </para>
+ <literallayout class="monospaced">
+ <![CDATA[
+ + + + + + + + + + +
+ [
+ > + + +
+ > + + + + +
+ > + + + + + + + + + + + +
+ > + + + + + + + + + +
+ < < < < -
+ ]
+ > + + + + + .
+ - - .
+ > - - - .
+ > - - - .
+ - - .
+ - .
+ < .
+ > > - - .
+ + + + + + + + .
+ < - - - - .
+ < .
+ > + + .
+ > - .
+ < .
+ ]]>
+ </literallayout>
+ <para>
+ 実行結果はこちら: <link xl:href="https://ideone.com/22VWmb">https://ideone.com/22VWmb</link>
+ </para>
+ <para>
+ それぞれの絵文字で表された関数が、各命令に対応している。
+ </para>
+ <itemizedlist>
+ <listitem><literal>$👉</literal>: <literal>&gt;</literal></listitem>
+ <listitem><literal>$👈</literal>: <literal>&lt;</literal></listitem>
+ <listitem><literal>$👍</literal>: <literal>+</literal></listitem>
+ <listitem><literal>$👎</literal>: <literal>-</literal></listitem>
+ <listitem><literal>$📝</literal>: <literal>.</literal></listitem>
+ <listitem><literal>$🤡</literal>: <literal>[</literal></listitem>
+ <listitem><literal>$🎪</literal>: <literal>]</literal></listitem>
+ </itemizedlist>
+ <para>
+ <literal>,</literal> (入力) に対応する関数はない
+ (このプログラムでは使わないので用意していない)。
+ </para>
+ <para>
+ なお、<literal>$🐘</literal> はいわゆる main 関数であり、プログラムの実行部分である。
+ </para>
+ </section>
+ <section xml:id="q1-brainfuck--commentary--emoji-selection">
+ <title>絵文字の選択</title>
+ <para>
+ おおよそ意味に合致するよう選んでいるが、<literal>$🤡</literal> と <literal>$🎪</literal>
+ は弊社デジタルサーカスにちなんでいる。 また、<literal>$🐘</literal> は PHP
+ のマスコットの象に由来する。
+ </para>
+ </section>
+ <section xml:id="q1-brainfuck--commentary--strict-types">
+ <title>strict_types</title>
+ <para>
+ <literal>declare</literal> 文の <literal>strict_types</literal> に指定できるのは、<literal>0</literal> か <literal>1</literal>
+ の数値リテラルだが、 <literal>0x0</literal> や <literal>0b1</literal> のような値も受け付ける。 今回は、PHP
+ 8.1 から追加された、<literal>0O</literal> または <literal>0o</literal> から始まる八進数リテラルを使った。
+ </para>
+ </section>
+ <section xml:id="q1-brainfuck--commentary--url">
+ <title>URL</title>
+ <para>
+ ソースコードのライセンスを示したこの部分だが、
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ https://creativecommons.org/publicdomain/zero/1.0/
+ ]]>
+ </programlisting>
+ <para>
+ 完全に合法な PHP のコードである。 <literal>https:</literal> 部分はラベル、<literal>//</literal>
+ 以降は行コメントになっている。
+ </para>
+ </section>
+ <section xml:id="q1-brainfuck--commentary--numbers">
+ <title>リテラルなしで数値を生成する</title>
+ <para>
+ ソースコード中に、ほとんど数値リテラルが書かれていないことにお気づきだろうか。
+ PHP では、型変換を利用することで任意の整数を作り出すことができる。
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ assert(0 === +!![]);
+ assert(1 === +![]);
+ assert(2 === ![]+![]);
+ assert(3 === ![]+![]+![]);
+ assert(10 === +(![].+!![]));
+ ]]>
+ </programlisting>
+ <para>
+ <literal>[]</literal> に <literal>!</literal> を適用すると <literal>true</literal> が返ってくる。それに <literal>+</literal>
+ を適用すると、<literal>bool</literal> から <literal>int</literal> ヘの型変換が走り、<literal>1</literal> が生成される。<literal>10</literal>
+ はさらにトリッキーだ。まず <literal>1</literal> と <literal>0</literal> を作り、<literal>.</literal> で文字列として結合する
+ (<literal>'10'</literal>)。これに <literal>+</literal> を適用すると、<literal>string</literal> から <literal>int</literal>
+ への型変換が走り、<literal>10</literal> が生まれる (コード量に頓着しないなら、<literal>1</literal> を 10
+ 個足し合わせてももちろん 10 が作れる)。
+ </para>
+ <para>
+ また、<literal>error_reporting</literal> に指定しているのは <literal>-1</literal> である。 これは、<literal>!</literal>
+ によって文字列を <literal>false</literal> にし、<literal>+</literal> によって <literal>false</literal> を <literal>0</literal>
+ にし、さらにビット反転して <literal>-1</literal> にしている。
+ </para>
+ </section>
+ <section xml:id="q1-brainfuck--commentary--conditionals">
+ <title><literal>if</literal> 文なしで条件分岐</title>
+ <para>
+ 三項演算子ないし <literal>match</literal> 式を使うことで、<literal>if</literal>
+ を一切書かずに条件分岐ができる。 また、<literal>&amp;&amp;</literal> / <literal>||</literal> も使えることがある。
+ 遅延評価が不要なケースでは、<literal>[$t, $f][$cond]</literal>
+ のような形で分岐することもできる。
+ </para>
+ </section>
+ <section xml:id="q1-brainfuck--commentary--loops">
+ <title><literal>while</literal>、<literal>for</literal> 文なしでループ</title>
+ <para>
+ 不動点コンビネータを使って無名再帰する
+ (詳しい説明は省略する。これらの単語で検索してほしい)。 ここでは、一般に
+ Z コンビネータとして知られるものを使った (<literal>$z</literal>)。
+ </para>
+ <para>
+ 実際のところ、<literal>$🤡</literal> や <literal>$🎪</literal>、<literal>$🐘</literal> は、一度 Scheme (Lisp の一種)
+ で書いてから PHP に翻訳する形で記述した。
+ </para>
+ <para>
+ なお、PHP は末尾再帰の最適化をおこなわない (少なくとも今のところは)
+ ので、 あまりに長い brainf*ck
+ プログラムを書くとスタックオーバーフローする。
+ </para>
+ </section>
+ </section>
+ </section>
+ <section xml:id="q2-riddle">
+ <title>第2問 riddle.php</title>
+ <para>
+ ソースコードはこちら。実行には PHP 8.0 以上が必要なので注意。
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ <?php
+
+ /*********************************************************
+ * This program displays a PHPer token. *
+ * Guess 'N'. *
+ * *
+ * Hints: *
+ * - N itself has no special meaning, e.g., 42, 8128, *
+ * it is selected at random. *
+ * - Each element of $token represents a single letter. *
+ * - One letter consists of 5x5 cells. *
+ * - Remember, the output is a complete PHPer token. *
+ * *
+ * License: *
+ * https://creativecommons.org/publicdomain/zero/1.0/ *
+ *********************************************************/
+ const N = 0 /* Change it to your answer. */;
+ assert(0 <= N && N <= 0b11111_11111_11111_11111_11111);
+
+ $token = [
+ 0x14B499C,
+ 0x0BE34CC, 0x01C9C69,
+ 0x0ECA069, 0x01C2449, 0x0FDB166, 0x01C9C69,
+ 0x01C1C66, 0x0FC1C47, 0x01C1C66,
+ 0x10C5858, 0x1E4E3B8, 0x1A2F2F8,
+ ];
+ foreach ($token as $x) {
+ $x = $x ^ N;
+
+ $x = sprintf('%025b', $x);
+ $x = str_replace(search: ['0', '1'], replace: [' ', '#'], subject: $x);
+ $x = implode("\n", str_split($x, length: 5));
+ echo "{$x}\n\n";
+ }
+ ]]>
+ </programlisting>
+ <para>
+ さて、この問題はさきほどのように単純に実行しただけでは、謎のブロックが表示されるだけでトークンは得られない。
+ トークンを得るためには、ソースコードを読み、定数 <literal>N</literal>
+ を特定する必要がある。
+ </para>
+ <para>
+ ここでは、私の想定解を解説する。
+ </para>
+ <section xml:id="q2-riddle--code-reading">
+ <title>読解</title>
+ <para>
+ まずはソースコードを読んでいく。
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ $token = [
+ // 略
+ ];
+ ]]>
+ </programlisting>
+ <para>
+ 数値からなる <literal>$token</literal> があり、各要素をループしている。
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ $x = $x ^ N;
+ ]]>
+ </programlisting>
+ <para>
+ まずは排他的論理和 (xor) を取り、
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ $x = sprintf('%025b', $x);
+ ]]>
+ </programlisting>
+ <para>
+ 二進数に変換して、
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ $x = str_replace(search: ['0', '1'], replace: [' ', '#'], subject: $x);
+ ]]>
+ </programlisting>
+ <para>
+ 0 を空白に、1 を <literal>#</literal> にし、
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ $x = implode("\n", str_split($x, length: 5));
+ ]]>
+ </programlisting>
+ <para>
+ 5文字ごとに区切ったあと、改行で結合している。
+ </para>
+ </section>
+ <section xml:id="q2-riddle--hint">
+ <title>ヒント</title>
+ <para>
+ 次に、ソースコードに書いてあるヒントを読んでいく。
+ </para>
+ <itemizedlist>
+ <listitem><literal>N</literal> それ自体は、42 や 8128 といったような特別な意味を持たず、ランダムに決められている</listitem>
+ <listitem><literal>$token</literal> の各要素は、1文字を表す</listitem>
+ <listitem>1文字は 5x5 のセルからなる</listitem>
+ <listitem>出力されるのは、完全な PHPer トークンである</listitem>
+ </itemizedlist>
+ <para>
+ ここで、PHPer トークンは必ず <literal>#</literal> 記号から始まることを思いだすと、
+ <literal>$token</literal> の最初の数字 <literal>0x14B499C</literal> は、変換の結果 <literal>#</literal>
+ になるのではないかと予想される (なお、このことは、リポジトリの README
+ ファイルに追加ヒントとして書かれている)。
+ </para>
+ </section>
+ <section xml:id="q2-riddle--solve">
+ <title>解く</title>
+ <para>
+ ここまでわかれば、あと一歩で解ける。すなわち、<literal>0x14B499C</literal> が <literal>#</literal>
+ に変換されるような <literal>N</literal> を見つければよい。
+ </para>
+ <para>
+ <literal>N</literal> は高々
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ assert(0 <= N && N <= 0b11111_11111_11111_11111_11111);
+ ]]>
+ </programlisting>
+ <para>
+ なのでブルートフォースしてもよいが、ここではブルートフォースしない方法を紹介する。
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ <?php
+
+ $x = 0x14B499C;
+
+ $x = $x ^ N;
+
+ $x = sprintf('%025b', $x);
+ $x = str_replace(search: ['0', '1'], replace: [' ', '#'], subject: $x);
+ $x = implode("\n", str_split($x, length: 5));
+
+ assert($x ===
+ " # # \n" .
+ "#####\n" .
+ " # # \n" .
+ "#####\n" .
+ " # # ");
+ ]]>
+ </programlisting>
+ <para>
+ この一連の変換に対する逆変換を考えると、次のようになる。
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ <?php
+
+ $x =
+ " # # \n" .
+ "#####\n" .
+ " # # \n" .
+ "#####\n" .
+ " # # ";
+
+ $x = implode('', explode("\n", $x));
+ $x = str_replace(search: [' ', '#'], replace: ['0', '1'], subject: $x);
+ $x = bindec($x);
+
+ $n = $x ^ 0x14B499C;
+
+ echo "N = $n\n";
+ ]]>
+ </programlisting>
+ <para>
+ これを実行すると、<literal>N</literal> が得られる。
+ </para>
+ </section>
+ </section>
+ <section xml:id="q3-toquine">
+ <title>第3問 toquine.php</title>
+ <para>
+ ソースコードはこちら。
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ <?php
+
+ // License: https://creativecommons.org/publicdomain/zero/1.0/
+ // This is a quine-like program to generate a PHPer token.
+ // Execute it like this: php toquine.php | php | php | php | ...
+
+ $s = <<<'Q'
+ <?cuc
+ // Yvprafr: uggcf://perngvirpbzzbaf.bet/choyvpqbznva/mreb/1.0/
+ // Guvf vf n dhvar-yvxr cebtenz gb trarengr n CUCre gbxra.
+ // Rkrphgr vg yvxr guvf: cuc gbdhvar.cuc | cuc | cuc | cuc | ...
+ %f$f = %f;
+ $f = fge_ebg13($f); $kf = [
+ %f,
+ ];
+ $g = ahyy.snyfr; sbe ($v = 0; $v <= vagqvi(__YVAR__-035,6); ++$v) vs (!vffrg($kf[$v])) oernx; ryfr
+ $g .= vzcybqr("\a", fge_fcyvg(fge_ercynpr(['0','1'], [' ','##'], fcevags(pue(37) . '025o', $kf[$v])), 012)) . "\a\a";
+ $jf = neenl_znc(sa($j) => vzcybqr(', ', $j), neenl_puhax(neenl_znc(sa($k) => fcevags('0k' . pue(37) . '07K', $k), $kf), 10));
+ cevags($f, $g, fge_ebg13("<<<'Q'\a{$f}\aQ"), vzcybqr(",\a", $jf));
+ Q;
+ $s = str_rot13($s); $xs = [
+ 0x0AFABEA, 0x1F294A7, 0x1F2109F, 0x1F294A7, 0x0002800, 0x1F2109F, 0x0117041, 0x1F294A7, 0x1FAD6B5, 0x1F295B7,
+ 0x010FC21, 0x1FAD6B5, 0x1151151, 0x010FC21, 0x1F294A7, 0x1F295B7, 0x1FAD6B5, 0x1F294A7, 0x1F295B7, 0x1F8C63F,
+ 0x1F8C631, 0x1FAD6B5, 0x17AD6BD, 0x17AD6BD, 0x1F8C63F, 0x1F295B7,
+ ];
+ $t = null.false; for ($i = 0; $i <= intdiv(__LINE__-035,6); ++$i) if (!isset($xs[$i])) break; else
+ $t .= implode("\n", str_split(str_replace(['0','1'], [' ','##'], sprintf(chr(37) . '025b', $xs[$i])), 012)) . "\n\n";
+ $ws = array_map(fn($w) => implode(', ', $w), array_chunk(array_map(fn($x) => sprintf('0x' . chr(37) . '07X', $x), $xs), 10));
+ printf($s, $t, str_rot13("<<<'D'\n{$s}\nD"), implode(",\n", $ws));
+ ]]>
+ </programlisting>
+ <para>
+ コメントにもあるとおり、次のようにして実行すれば答えがでてくる。
+ </para>
+ <programlisting language="shell-session" linenumbering="unnumbered">
+ <![CDATA[
+ $ php toquine.php | php | php | php | ...
+ ]]>
+ </programlisting>
+ <para>
+ 実際にはもう少しパイプで繋げなければならない。
+ </para>
+ <section xml:id="q3-toquine--commentary">
+ <title>解説</title>
+ <section xml:id="q3-toquine--commentary--quine">
+ <title>プログラム全体</title>
+ <para>
+ コメントにもあるとおり、これは quine (風) のプログラムになっている。
+ Quine
+ とは、自分のソースコードをそっくりそのまま出力するようなプログラムのことである。
+ </para>
+ <para>
+ このプログラムは、実行すると自身とほとんど同じプログラムを出力する。
+ 異なるのはトークンになっている部分のみである。
+ </para>
+ </section>
+ <section xml:id="q3-toquine--commentary--tokens">
+ <title>トークン</title>
+ <para>
+ <literal>$xs</literal> がトークンに対応している。変換のロジックは <literal>riddle.php</literal>
+ とほぼ同じなので省略する。
+ </para>
+ </section>
+ <section xml:id="q3-toquine--commentary--states">
+ <title>状態保持</title>
+ <para>
+ トークンの何文字目まで出力したかを、ソースコードを変えずに (quine
+ なので) 覚えておく必要がある。
+ このプログラムでは、トークンが出力されるとソースコードがだんだんと長くなっていくのを利用して、<literal><emphasis>LINE</emphasis></literal>
+ から情報を取得している。
+ </para>
+ </section>
+ <section xml:id="q3-toquine--commentary--rot-13">
+ <title>ROT 13</title>
+ <para>
+ Quine は、素朴に書くとプログラムの一部が 2回記述されてしまう。
+ これがあまり美しくないので、<literal>toquine.php</literal> では、ROT 13
+ 変換を使って難読化した。
+ </para>
+ <para>
+ それにしてもなぜこんなものが標準ライブラリに……。
+ </para>
+ </section>
+ </section>
+ </section>
+ <section xml:id="outro">
+ <title>おわりに</title>
+ <para>
+ 解いていただいたみなさん、また、難易度調整につきあっていただいた社内のみなさん、ありがとうございました。
+ </para>
+ <para>
+ 今回は直前に作りはじめたのもあり、3問だけかつ使い古されたネタばかりになってしまいましたが、
+ 来年は 5問、より面白い問題を持っていきます。
+ </para>
+ <para>
+ 実はもう作りはじめているので、どうか来年もありますように……。
+ </para>
+ </section>
+</article>
diff --git a/vhosts/blog/content/posts/2022-04-24/term-banner-write-tool-showing-banner-in-terminal.xml b/vhosts/blog/content/posts/2022-04-24/term-banner-write-tool-showing-banner-in-terminal.xml
new file mode 100644
index 00000000..34082b12
--- /dev/null
+++ b/vhosts/blog/content/posts/2022-04-24/term-banner-write-tool-showing-banner-in-terminal.xml
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<article xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0">
+ <info>
+ <title>term-banner: ターミナルにバナーを表示するツールを書いた</title>
+ <abstract>
+ ターミナルに任意の文字のバナーを表示するためのツールを Go で書いた。
+ </abstract>
+ <revhistory>
+ <revision>
+ <date>2022-04-24</date>
+ <revremark>公開</revremark>
+ </revision>
+ <revision>
+ <date>2022-04-27</date>
+ <revremark>-f オプションについて追記</revremark>
+ </revision>
+ </revhistory>
+ </info>
+ <section xml:id="intro">
+ <title>はじめに</title>
+ <para>
+ こんなものを作った。
+ </para>
+ <literallayout class="monospaced">
+ <![CDATA[
+ $ term-banner 'Hello, World!' 'こんにちは、' '世界!'
+ ]]>
+ </literallayout>
+ <para>
+ image::https://raw.githubusercontent.com/nsfisis/term-banner/main/screenshot.png[term-banner
+ のスクリーンショット]
+ </para>
+ <para>
+ コマンドライン引数として渡した文字列をターミナルに大きく表示する。
+ </para>
+ <para>
+ リポジトリはこちら: <link xl:href="https://github.com/nsfisis/term-banner">https://github.com/nsfisis/term-banner</link>
+ </para>
+ </section>
+ <section xml:id="motivation">
+ <title>Motivation</title>
+ <para>
+ 以前、https://github.com/nsfisis/big-clock-mode[big-clock-mode]
+ という似たようなプログラムを書いた。 これは tmux の <literal>:clock-mode</literal>
+ コマンドに着想を得たもので、<literal>:clock-mode</literal>
+ よりも大きく現在時刻を表示する。
+ </para>
+ <para>
+ <literal>big-clock-mode</literal>
+ を開発したのは、次のようなシチュエーションで使うためである。
+ 弊社では現在リモートワークが基本だが、web
+ 会議などで画面共有しているときに、休憩を挟んで特定の時刻から再開する、ということがある。
+ こういったケースで、画面上に現在の時刻を大きめに表示しておくと、モニタから離れても遠くから時刻がわかるので便利である。
+ </para>
+ <para>
+ それこそタイマアプリか何かを使えばいいのだが、ターミナルに棲むいきものとしては、住処から離れたくないわけだ。
+ </para>
+ <para>
+ しばらく便利に使っていたのだが、ひとつ不満点が出てきた。それは、再開する時刻がいつだったかを覚えておかなければならないということだ。
+ どこかにメモしておいてもいいが、せっかくなら現在時刻とともに表示させておきたい。
+ </para>
+ <para>
+ そんなわけで、「任意の文字列をターミナルに表示する」プログラムを書く運びとなった。
+ まあ、作らなくても探せばあると思うが、作りたいものは作りたいので知ったことではない。
+ </para>
+ </section>
+ <section xml:id="program">
+ <title>プログラム</title>
+ <para>
+ 全体の流れは次のようになっている。
+ </para>
+ <orderedlist numeration="arabic">
+ <listitem>フォントファイルを読み込む</listitem>
+ <listitem>コマンドライン引数を Shift-JIS に変換する (フォントが Shift-JIS 基準で並んでいるため)</listitem>
+ <listitem>1文字ずつレンダリングしていく</listitem>
+ </orderedlist>
+ <para>
+ <literal>big-clock-mode</literal> が Go 製なので、今回も Go で書いた。 PNG
+ が標準ライブラリにあったり、Shift-JIS
+ のエンコーディングが準標準ライブラリにあったりしたのは助かった。
+ </para>
+ <para>
+ フォントファイルは <literal>go:embed</literal>
+ で実行ファイルに埋め込んでいるので、ビルド後はワンバイナリで動く。
+ 仕事ではスクリプト言語ばかり書いているが、やはりコンパイル言語はいい。
+ </para>
+ </section>
+ <section xml:id="font">
+ <title>フォント</title>
+ <para>
+ フリーの 8x8
+ ビットマップフォントである、https://littlelimit.net/misaki.htm[美咲フォント
+ 2021-05-05a 版] を使わせていただいた。
+ </para>
+ <para>
+ はじめは自分でポチポチ打っていたのだが、「き」くらいまでやって挫折した。
+ 同じく 8x8
+ で作っていたのだが、平仮名でさえも、この小さなキャンバスにはとても収められない。
+ </para>
+ <para>
+ 美咲フォントは、平仮名・片仮名に留まらず、JIS
+ 第一・第二水準の漢字までサポートしている。
+ 第二水準ともなると一生お目にかかることのない字の方が多いくらいだが、これをこの大きさで書くというのは、もはや芸術の域である。
+ </para>
+ <para>
+ さらに言うと、実のところ美咲フォントは実サイズ 7x7
+ で作られており、余白が設けられている。
+ これは、単純にそのまま並べても字間・行間を確保できるようにという配慮である。
+ おかげでコーディングまで楽になった。
+ </para>
+ <para>
+ ゴシック体と明朝体があったが、私の好みで明朝体の方にした。
+ ただ、ゴシック体の方が見やすい気がするので、フォントを選べるように後ほど拡張するかもしれない。
+ </para>
+ <para>
+ 2022-04-27 追記: <literal>-f</literal> オプションで選べるようにした。
+ </para>
+ </section>
+ <section xml:id="outro">
+ <title>おわりに</title>
+ <para>
+ あなたもターミナルに住んでみませんか?
+ </para>
+ </section>
+</article>
diff --git a/vhosts/blog/content/posts/2022-05-01/phperkaigi-2022.xml b/vhosts/blog/content/posts/2022-05-01/phperkaigi-2022.xml
new file mode 100644
index 00000000..1c3b015d
--- /dev/null
+++ b/vhosts/blog/content/posts/2022-05-01/phperkaigi-2022.xml
@@ -0,0 +1,171 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<article xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0">
+ <info>
+ <title>PHPerKaigi 2022</title>
+ <abstract>
+ 2022-04-09 から 2022-04-11 にかけて開催された、PHPerKaigi 2022 に参加した。
+ </abstract>
+ <keywordset>
+ <keyword>conference</keyword>
+ <keyword>php</keyword>
+ <keyword>phperkaigi</keyword>
+ </keywordset>
+ <revhistory>
+ <revision>
+ <date>2022-05-01</date>
+ <revremark>公開</revremark>
+ </revision>
+ </revhistory>
+ </info>
+ <section xml:id="intro">
+ <title>はじめに</title>
+ <para>
+ 2022-04-09 から 2022-04-11 にかけて開催された、<link xl:href="https://phperkaigi.jp/2022/">PHPerKaigi 2022</link> に、
+ 一般参加者として参加した。
+ 弊社<link xl:href="https://www.dgcircus.com/">デジタルサーカス株式会社</link>はダイヤモンドスポンサーとなっており、
+ スポンサー枠のチケットを使わせていただいた。
+ </para>
+ <para>
+ 昨年のレポートは<link xl:href="/posts/2021-03-30/phperkaigi-2021">こちら</link>。
+ </para>
+ </section>
+ <section xml:id="comments">
+ <title>感想</title>
+ <section xml:id="comments--great-sessions">
+ <title>厳選おすすめトーク</title>
+ <para>
+ 多くの素晴らしいトークの中から、特におすすめのものを 5つ選んだ。
+ 是非聞いてほしい。引用部分は、リンク先プロポーザルから引用している。
+ </para>
+ <para>
+ <link xl:href="https://fortee.jp/phperkaigi-2022/proposal/ef8cf4ed-63fe-42f8-8145-b3e70054458b">予防に勝る防御なし - 堅牢なコードを導く様々な設計のヒント</link>
+ </para>
+ <blockquote>
+ <para>
+ PHP はバージョンを追う毎に型宣言、例外、表明、列挙型などの機能が大幅に強化され、堅牢なコードを書くための機能が充実してきました。それらの機能はどう使うと効果的なのでしょうか。
+ </para>
+ <para>
+ 本講演では PHP 8.1 をベースにして、誤りを想定してチェックするのではなく、そもそも誤りにくい設計とはどのようなものか、つまり「予防」の観点を軸足に、堅牢なコードを導くための様々な設計のヒントをご紹介します。
+ </para>
+ </blockquote>
+ <para>
+ <link xl:href="https://fortee.jp/phperkaigi-2022/proposal/db00d49e-0dd6-453f-b54b-f731d112f10e">PHPのエラーを理解して適切なエラーハンドリングを学ぼう</link>
+ </para>
+ <blockquote>
+ <para>
+ PHPを使ってるとよく遭遇する Fatal error / Parse error / Warning / Notice 理解していますか?<br/>
+ これらのエラー文を理解することで、すぐにエラーの原因に気付き適切に対象できる様になります!<br/>
+ またそれらを理解した上でのエラーハンドリングを学びましょう。
+ </para>
+ </blockquote>
+ <para>
+ <link xl:href="https://fortee.jp/phperkaigi-2022/proposal/4a7e3ded-9134-4919-955c-ec7bf4491c0d">エラー監視とテスト体制への改善作戦</link>
+ </para>
+ <blockquote>
+ <para>
+ 毎日流れてくるエラーに皆さんはどう向き合ってますか?<br/>
+ エラーを出さない事が一番ですが、完全に塞ぐ事は難しいと考えます。<br/>
+ サービス運用の中で本番環境から発生するエラー(サーバー・クライアントサイド・サードパーティ起因のエラー)への監視体制と、<br/>
+ エラー・バグ防御のためチームで行っているテストコード文化づくりの話をします。
+ </para>
+ </blockquote>
+ <para>
+ <link xl:href="https://fortee.jp/phperkaigi-2022/proposal/6f47daf8-c78f-4fb1-9b99-e9656e6fe7f7">ISUCON11のPHP実装は、何を考え、どのようにして作られていたのか</link>
+ </para>
+ <blockquote>
+ <para>
+ 昨年開催されたISUCON11にて問題(参考実装)のPHPへの移植を担当させていただきました。
+ </para>
+ <para>
+ 最終的なソースコードこそシンプルなWebアプリケーションではありますが、その裏には<br/>
+ ・「(私の思う)良い設計」を実現するための意思決定<br/>
+ ・「ISUCONの問題」という位置付けに由来する取捨選択<br/>
+ ・移植中に遭遇したトラブルとその解決策<br/>
+ といった文脈や葛藤が存在しています。
+ </para>
+ <para>
+ 本発表はそれらを共有することで<br/>
+ ・PHPアプリケーションの設計、実装事例として役立ててもらう<br/>
+ ・ISUCONの言語移植に興味を持ってもらう<br/>
+ ・ISUCON問題移植の「実装や設計の練習をする教材」としての可能性を知ってもらう<br/>
+ ことを目的とします。
+ </para>
+ </blockquote>
+ <para>
+ <link xl:href="https://fortee.jp/phperkaigi-2022/proposal/5a260e4e-542d-4d82-849d-ef3d6cb7c854">チームの仕事はまわっていたけど、メンバーはそれぞれモヤモヤを抱えていた話──40名の大規模開発チームで1on1ログを公開してみた</link>
+ </para>
+ <blockquote>
+ <para>
+ サイボウズの大企業向けグループウェアのGaroon(ガルーン)は、PHPで開発されている20年目の製品です。ガルーン開発チームは日本で40名、ベトナムで50名の計90名ほどのチームになっています。また、コロナ禍でフルリモートでの活動がこの2年ほど継続してきました。
+ </para>
+ <para>
+ フルリモートになっても仕事はまわっており、継続的にリリースはしていましたが、一方でお互いの考えていることや感じている問題意識が見えづらくなり、モヤモヤを抱えているメンバーが増えていました。
+ </para>
+ <para>
+ このセッションでは、そういう状況で私がチーム外からジョインし、聴き役に徹しながら見える化することで状況を改善していった取り組みを紹介します。同じように大きなチームやリモートワークで難しさを感じている人に、難しさの原因への気づきや取り組みへのヒントがあれば幸いです。
+ </para>
+ </blockquote>
+ </section>
+ <section xml:id="comments--token-quizzes">
+ <title>トークン問題の作成</title>
+ <para>
+ 今回は、PHPer チャレンジ用に弊社のトークン問題を 3題作成した。
+ こちらについては<link xl:href="/posts/2022-04-09/phperkaigi-2022-tokens">別途記事にしている</link>ので、そちらを参照されたい。
+ </para>
+ </section>
+ <section xml:id="comments--phper-challenge">
+ <title>PHPer チャレンジ</title>
+ <para>
+ <link xl:href="https://fortee.jp/phperkaigi-2022/challenge">1位</link>になった。<br/>
+ また、賞品として <link xl:href="https://www.amazon.co.jp/dp/B08MQNJC9Z">Echo Show 15</link> をいただいた。
+ </para>
+ </section>
+ <section xml:id="comments--conference">
+ <title>カンファレンス全体への感想</title>
+ <para>
+ <link xl:href="/posts/2021-03-30/phperkaigi-2021">去年の参加レポ</link> では、こんなことを書いた。
+ </para>
+ <blockquote>
+ <para>
+ 1つ個人的な反省点としては、(中略) Discord しかりアンカンファレンスしかり「このイベントのこの瞬間にしかないコンテンツ」に触れずに、
+ 後から見返せる発表やスライドに注力してしまった、ということだ。
+ 発表の詳細な見直しはあとからできるのだから、今しかできないことを考えるべきだった。<br/>
+ まあ初カンファレンスだし、とお茶を濁しておこう。
+ </para>
+ </blockquote>
+ <para>
+ この反省を踏まえ、今年は積極的にほかの場 (公式の Discord サーバや、アンカンファレンス) にも参加した。<br/>
+ これにより、参加体験の質がはるかに向上した。特に Discord に関しては、登壇者ご本人による補足や、
+ 質問への回答などがおこなわれる (ことが多い) ため、特別な理由のない限り、発言はしないまでも参加はしておいたほうが良いと思われる。
+ </para>
+ <para>
+ なお、アンカンファレンスについては、1日目の終わりに<link xl:href="https://fortee.jp/phperkaigi-2022/unconference/view/d332797a-8921-4706-a7e2-ee72640c9b5e">トークン問題の解説放送</link>もおこなった。
+ </para>
+ <para>
+ また、今年はオフラインとオンラインのハイブリッド開催であったが、去年の全オンラインと比べて、オンライン参加の体験が落ちていなかったのは、特筆すべきであろう。
+ 今年は 3回目のワクチン接種が間に合わなかったこともあり現地参加は見送ったのだが、来年は是非オフラインで参加したい。
+ </para>
+ </section>
+</section>
+<section xml:id="next-year">
+ <title>そして来年へ……?</title>
+ <para>
+ PHPerKaigi 2023 があるかどうか存じ上げないが、あるとすれば、次の 4つを目標としたい。
+ </para>
+ <itemizedlist>
+ <listitem>プロポーザルを出す</listitem>
+ <listitem>PHPer チャレンジのトークン問題を 5題作成する</listitem>
+ <listitem>現地に行く</listitem>
+ <listitem>PHPer チャレンジで圧勝する</listitem>
+ </itemizedlist>
+ <para>
+ <hr/>
+ </para>
+ <para>
+ 最後になりましたが、PHPerKaigi のスタッフ、スポンサー、スピーカーのみなさん、素敵な時間をありがとうございました。
+ </para>
+ <para>
+ ではまた来年。
+ </para>
+</section>
+</article>
diff --git a/vhosts/blog/content/posts/2022-08-27/php-conference-okinawa-code-golf.xml b/vhosts/blog/content/posts/2022-08-27/php-conference-okinawa-code-golf.xml
new file mode 100644
index 00000000..ba5b7026
--- /dev/null
+++ b/vhosts/blog/content/posts/2022-08-27/php-conference-okinawa-code-golf.xml
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<article xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0">
+ <info>
+ <title>PHP カンファレンス沖縄で出題されたコードゴルフの問題を解いてみた</title>
+ <abstract>
+ PHP カンファレンス沖縄の懇親会 LT で出題されたコードゴルフの問題を解いてみた。
+ </abstract>
+ <keywordset>
+ <keyword>conference</keyword>
+ <keyword>php</keyword>
+ <keyword>phpcon</keyword>
+ </keywordset>
+ <revhistory>
+ <revision>
+ <date>2022-08-27</date>
+ <revremark>公開</revremark>
+ </revision>
+ </revhistory>
+ </info>
+ <section xml:id="intro">
+ <title>はじめに</title>
+ <para>
+ 本日 <link xl:href="https://phpcon.okinawa.jp/">PHP カンファレンス沖縄 2022</link> が開催された (らしい)。
+ </para>
+ <para>
+ カンファレンスには参加できなかったものの、懇親会の LT で出題されたコードゴルフの問題が Twitter に流れてきたので、解いてみた。
+ </para>
+ <itemizedlist>
+ <listitem>ツイート: <link xl:href="https://twitter.com/m3m0r7/status/1563397620231712772">https://twitter.com/m3m0r7/status/1563397620231712772</link></listitem>
+ <listitem>スライド: <link xl:href="https://speakerdeck.com/memory1994/php-conference-okinawa-2022-extra?slide=3">https://speakerdeck.com/memory1994/php-conference-okinawa-2022-extra?slide=3</link></listitem>
+ </itemizedlist>
+ </section>
+ <section xml:id="solution">
+ <title>解</title>
+ <para>
+ 細かいレギュレーションは不明だったので、勝手に定めた。
+ </para>
+ <itemizedlist>
+ <listitem>コマンドライン引数の第1引数で受けとる</listitem>
+ <listitem>結果は標準出力に出す</listitem>
+ <listitem>コンマの直後にはスペースを1つ置く</listitem>
+ <listitem>末尾コンマは禁止</listitem>
+ <listitem>数字でないものは入ってこないものとする</listitem>
+ <listitem>負数は入ってこないものとする</listitem>
+ </itemizedlist>
+ <para>
+ 書いたものがこちら:
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ [<?php $n=$argv[1];foreach([1e4,5e3,2e3,1e3,500,100,50,10,5,1]as$x)for(;$n>=$x;$n-=$x)$r[]=$x;echo implode(', ',$r??[]);?>]
+ ]]>
+ </programlisting>
+ <para>
+ しめて 123 バイトとなった (末尾改行を含めずにカウント)。
+ </para>
+ <para>
+ こちらは改行とスペースを追加したバージョン:
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ [<?php
+
+ $n = $argv[1];
+ foreach ([1e4, 5e3, 2e3, 1e3, 500, 100, 50, 10, 5, 1] as $x)
+ for (; $n >= $x; $n -= $x)
+ $r[] = $x;
+ echo implode(', ', $r ?? []);
+
+ ?>]
+ ]]>
+ </programlisting>
+ </section>
+ <section xml:id="techniques">
+ <title>使用したテクニック</title>
+ <section xml:id="techniques--exponential-notation">
+ <title>指数表記</title>
+ <para>
+ 割と多くの言語のゴルフで使えるテクニック。
+ <literal>e</literal> を用いた指数表記で、大きな数を短く表す。
+ このコードでは <literal>10000</literal>、<literal>5000</literal>、<literal>2000</literal>、<literal>1000</literal> を指数表記している。
+ </para>
+ </section>
+ <section xml:id="techniques--shorten-loop">
+ <title>foreach や for の中身を1つの文に</title>
+ <para>
+ <literal>foreach</literal>、<literal>for</literal>、<literal>if</literal> などの後ろには、
+ 通常 <literal>{</literal> を続けて複数の文を連ねるが、中身の文を1つにしてしまえば、<literal>{</literal> と <literal>}</literal> を省略できる。
+ C言語などでも使える。
+ </para>
+ </section>
+ <section xml:id="techniques--omit-initialization">
+ <title>$r に初期値を入れない</title>
+ <para>
+ PHP では、<literal>$r[] = ......</literal> のような配列の末尾に追加する式を実行したとき、
+ <literal>$r</literal> が未定義だった場合は <literal>$r</literal> を勝手に定義して空の配列で初期化してくれる。
+ これを利用すると、<literal>$r = [];</literal> のような初期化が不要になる。
+ </para>
+ <para>
+ ただし、プログラムに 0 が渡されるとループを一度も回らないので、<literal>$r</literal> が未定義になってしまい、
+ <literal>implode()</literal> に渡すところでエラーになる。
+ それを防ぐために <literal>$r ?? []</literal> を使っている。
+ </para>
+ <para>
+ もし 0 が渡されたケースを無視するなら、これが不要になるので 4 バイト縮む。
+ </para>
+ </section>
+ <section xml:id="techniques--put-text-outside-php-tag">
+ <title>PHP タグの外に文字列を置く</title>
+ <para>
+ PHP では、<literal>&lt;?php</literal> <literal>?&gt;</literal> で囲われた部分の外側にある文字列は、そのまま出力される。
+ 今回のケースでは、先頭と末尾に必ず <literal>[</literal> と <literal>]</literal> を出力するので、そのまま書いてやればよい。
+ </para>
+ </section>
+ </section>
+ <section xml:id="outro">
+ <title>おわりに</title>
+ <para>
+ 最後になりましたが、<link xl:href="https://twitter.com/m3m0r7">めもりー</link>さん、楽しい問題をありがとうございました。
+ </para>
+ </section>
+</article>
diff --git a/vhosts/blog/content/posts/2022-08-31/support-for-communty-is-employee-benefits.xml b/vhosts/blog/content/posts/2022-08-31/support-for-communty-is-employee-benefits.xml
new file mode 100644
index 00000000..eb9353d1
--- /dev/null
+++ b/vhosts/blog/content/posts/2022-08-31/support-for-communty-is-employee-benefits.xml
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<article xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0">
+ <info>
+ <title>弊社の PHP Foundation への寄付に寄せて</title>
+ <abstract>
+ 先日、私の勤めるデジタルサーカス株式会社が、PHP Foundation へ寄付をおこないました。
+ 本件を社内でしつこく推進した1人として、推進の理由等を書き残しておきます。
+ </abstract>
+ <revhistory>
+ <revision>
+ <date>2022-08-31</date>
+ <revremark>公開</revremark>
+ </revision>
+ </revhistory>
+ </info>
+ <section xml:id="intro">
+ <title>はじめに</title>
+ <para>
+ <emphasis role="strong">注: これは私個人の意見であり、所属する組織を代表するものではありません。</emphasis>
+ </para>
+ <para>
+ 先日、私の勤める <link xl:href="https://www.dgcircus.com/">デジタルサーカス株式会社</link> が
+ <link xl:href="https://opencollective.com/phpfoundation">PHP Foundation</link> へ $2,000 の寄付をおこないました。
+ </para>
+ <para>
+ 記事: <link xl:href="https://www.dgcircus.com/news/581">https://www.dgcircus.com/news/581</link>
+ </para>
+ <para>
+ 本件を社内でしつこく推進した1人として、推進の理由等を書き残しておきます。
+ </para>
+ </section>
+ <section xml:id="why">
+ <title>なぜ?</title>
+ <para>
+ 組織としての寄付理由は前掲した記事に譲るとして、ここでは、私が社内でこの件を推進した理由について書くことにします。
+ </para>
+ <para>
+ 当時の考えを端的にまとめた社内チャットの投稿があったので、それを引用します:
+ </para>
+ <blockquote>
+ <para>
+ 結局これを通したい (私の中での) 最大の理由が、「自分の勤める会社が、これをやる会社であってほしい」というのがあり、
+ ↑にしても、感情ベースの理由しか出せていないというのが説得力に欠けている理由なのだと思いますが、
+ 寄付の報告が流れてきたり、OSS のフリーライドの話が流れてきたりするたびに、自尊心が毀損される、というか
+ (これは大袈裟すぎる表現で、実際にはそこまで明確に傷ついているわけではありませんが)。
+ </para>
+ <para>
+ 追記: 「肩身が狭くなる」というのがより適切でした。
+ </para>
+ </blockquote>
+ <para>
+ ※文中の「↑にしても」は、ここに載せていない別の投稿を指しています。
+ </para>
+ <para>
+ OSS を金銭的に支援したり、技術カンファレンスへ協賛したり
+ (あるいは <link xl:href="https://twitter.com/tomzoh">CTO</link> がカンファレンスを年2で主催したり:
+ <link xl:href="https://iosdc.jp">iOSDC</link> <link xl:href="https://phperkaigi.jp">PHPerKaigi</link>)
+ といった行為は、コミュニティへの貢献であると同時に、社員に対する精神的福利厚生でもあると言えるでしょう (知らんけど)。
+ これらは、技術や技術者を大切にする組織である、ということの、対外的にも対内的にも強力なメッセージなのです。
+ </para>
+ <para>
+ 以上が、私が社内で寄付の件を進めた (かなり私的な) 理由です。
+ </para>
+ </section>
+ <section xml:id="outro">
+ <title>おわりに</title>
+ <para>
+ 最終的に社としての寄付まで漕ぎ着けられたのは、もちろん私の力ではなく役員の方々の決定によるものです。
+ この場を借りて感謝申し上げます。
+ </para>
+ </section>
+</article>
diff --git a/vhosts/blog/content/posts/2022-09-29/write-fizzbuzz-in-php-2-letters-per-line.xml b/vhosts/blog/content/posts/2022-09-29/write-fizzbuzz-in-php-2-letters-per-line.xml
new file mode 100644
index 00000000..88d71755
--- /dev/null
+++ b/vhosts/blog/content/posts/2022-09-29/write-fizzbuzz-in-php-2-letters-per-line.xml
@@ -0,0 +1,708 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<article xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0">
+ <info>
+ <title>【PHP】 fizzbuzz を書く。1行あたり2文字で。</title>
+ <abstract>
+ PHP で、fizzbuzz を書いた。ただし、1行あたりに使える文字数は2文字まで。
+ </abstract>
+ <keywordset>
+ <keyword>php</keyword>
+ </keywordset>
+ <revhistory>
+ <revision>
+ <date>2022-09-28</date>
+ <revremark>公開</revremark>
+ </revision>
+ <revision>
+ <date>2022-09-29</date>
+ <revremark>小さな文言の修正・変更</revremark>
+ </revision>
+ </revhistory>
+ </info>
+ <section xml:id="intro">
+ <title>記事の構成について</title>
+ <para>
+ この記事は、普通の fizzbuzz を徐々に変形して最終形にしていく、という構成で書かれている。
+ 最終形を見てどのような仕組みで動いているのか解読してから解説を読みたい、というかたがいれば、
+ <link xl:href="https://gist.github.com/nsfisis/04c227d5a419867472a0b23a83ad2919#file-fizzbuzz-php-2-letters-per-line-and-supports-php-8-x-without-warnings">このページ</link>
+ にソースコードがあるので、そちらを先に見てほしい。
+ </para>
+ </section>
+ <section xml:id="regulations">
+ <title>レギュレーション</title>
+ <para>
+ PHP で、次のような制約の下に fizzbuzz を書いた。
+ </para>
+ <itemizedlist>
+ <listitem>
+ 1行あたりの文字数は2文字までに収めること (ただし <literal>&lt;?php</literal> タグは除く)
+ <itemizedlist>
+ <listitem>
+ 厳密な定義: <literal>&lt;?php</literal> タグ以降のソースコードが、2 byte ごとにラインフィード (LF) で区切られること
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>スペースやタブを使用しないこと</listitem>
+ <listitem>
+ ループのアンロールをしないこと
+ <itemizedlist>
+ <listitem>100 回ループの代わりに 100 回コードをコピペ、というのは禁止</listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>PHP 7.4〜8.1 で動作すること</listitem>
+ <listitem>実行時に Notice や Warning が出ないこと</listitem>
+ <listitem>標準的なインストール構成の PHP で実現できること (デフォルトで有効になっていない拡張等を使わないこと)</listitem>
+ </itemizedlist>
+ <para>
+ 備考: PHP には <literal>short_open_tag</literal> というオプションがあり、
+ これを有効にするとファイル冒頭の <literal>&lt;?php</literal> の代わりに <literal>&lt;?</literal>
+ を使うことができ、文字どおり1行2文字で書ける。
+ ただ、このオプションはデフォルト off になっている環境が多いようなので、今回は使わないことにした。
+ </para>
+ </section>
+ <section xml:id="problems">
+ <title>主な障害</title>
+ <para>
+ 1行あたりの文字数など、適当に改行を挟めばいいだけではないのか?
+ </para>
+ <para>
+ 特に、C言語でこのような試みをおこなったことがあるかたならそう思うだろう。事実、Cでのこの制約はほとんど無意味に等しい。
+ </para>
+ <programlisting language="c" linenumbering="unnumbered">
+ <![CDATA[
+ #\
+ i\
+ n\
+ c\
+ l\
+ u\
+ d\
+ e\
+ <\
+ s\
+ t\
+ d\
+ i\
+ o\
+ .\
+ h\
+ >\
+ /*
+ */
+ i\
+ n\
+ t\
+ /*
+ */
+ m\
+ a\
+ i\
+ n(
+ ){
+ f\
+ o\
+ r(
+ i\
+ n\
+ t\
+ /*
+ */
+ i=
+ 1;
+ i<
+ 1\
+ 0\
+ 0;
+ i\
+ +\
+ +)
+ if
+ (i
+ %\
+ 15
+ ==
+ 0)
+ p\
+ r\
+ i\
+ n\
+ t\
+ f(
+ "\
+ F\
+ i\
+ z\
+ z\
+ B\
+ u\
+ z\
+ z\
+ %\
+ c\
+ ",
+ 10
+ );
+
+ /* あとは同じように普通のプログラムを変形するだけなので省略 */
+ ]]>
+ </programlisting>
+ <para>
+ バックスラッシュを使った行継続がトークンを区切らない、というのがポイントだ。
+ </para>
+ <para>
+ さて、PHP ではそもそもバックスラッシュを行継続に使うことができない。
+ これにより、「3文字以上からなるトークンが一切使えない」という制約が課される。
+ 例えば、<literal>echo</literal> で出力することや、<literal>for</literal> でループすること、
+ <literal>new</literal> でインスタンスを生成することができない。
+ 特に、出力は fizzbuzz をどんなアルゴリズムで実装しようとおこなわなければならないので、できないのは致命的である。
+ </para>
+ <para>
+ 当然、名前が3文字以上ある関数も使えない。なお、標準 PHP の範囲内において、名前が 2文字以下の関数は以下のとおりである:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <literal>_</literal>: <literal>gettext</literal> のエイリアス
+ </listitem>
+ <listitem>
+ <literal>dl</literal>: 拡張モジュールをロードする
+ </listitem>
+ <listitem>
+ <literal>pi</literal>: 円周率を返す
+ </listitem>
+ </itemizedlist>
+ <para>
+ (環境によって多少は変わるかも)
+ </para>
+ <para>
+ 2文字の関数を定義しまくった拡張モジュールを用意しておいて <literal>dl()</literal> で読み込む行為は、レギュレーションで定めた
+ </para>
+ <blockquote>
+ <itemizedlist>
+ <listitem>標準的なインストール構成の PHP で実現できること (デフォルトで有効になっていない拡張等を使わないこと)</listitem>
+ </itemizedlist>
+ </blockquote>
+ <para>
+ に反する (というより、「それだとおもしろくもなんともないので、このルールを足した」というのが正しい)。
+ </para>
+ <para>
+ また、2文字だと文字列がまともに書けないのも辛い。<literal>''</literal> だけで2文字使うので、
+ 「1文字の文字列リテラル」というものを書くことができない。PHP では文字列リテラル中に生の改行が書けるので
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ $a
+ ='
+ a'
+ ;;
+ ]]>
+ </programlisting>
+ <para>
+ とすると <literal>$a</literal> は <literal>"\na"</literal> になるのだが、余計な改行が入ってしまう。
+ </para>
+ <para>
+ これらの障害をどのように乗り越えるのか、次節から見ていく。
+ </para>
+ </section>
+ <section xml:id="commentary">
+ <title>解説</title>
+ <section xml:id="commentary--normal-fizzbuzz">
+ <title>普通の (?) fizzbuzz</title>
+ <para>
+ まずは普通に書くとしよう。
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ <?php
+
+ for ($i = 1; $i < 100; $i++) {
+ echo (($i % 3 ? '' : 'Fizz') . ($i % 5 ? '' : 'Buzz') ?: $i) . "\n";
+ }
+ ]]>
+ </programlisting>
+ <para>
+ 素直に書いた fizzbuzz とは言い難いが、このくらいは普通だということにしておかないと、この先がやっていられないので許してほしい。
+ </para>
+ </section>
+ <section xml:id="commentary--remove-keywords">
+ <title><literal>for</literal> の排除</title>
+ <para>
+ <literal>for</literal> は、3文字もある長いキーワードである。
+ こんなものは使えない。<literal>array_</literal> 系の関数を使って、適当に置き換えるとしよう。
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ <?php
+
+ $s = range(1, 100);
+ array_walk(
+ $s,
+ fn($i) =>
+ printf((($i % 3 ? '' : 'Fizz') . ($i % 5 ? '' : 'Buzz') ?: $i) . "\n"),
+ );
+ ]]>
+ </programlisting>
+ <para>
+ <literal>array_walk</literal> や <literal>range</literal>、<literal>printf</literal> といった
+ <literal>for</literal> よりも長いトークンが現れてしまったが、これは次節で直すことにする。
+ なお、<literal>echo</literal> は文 (statement) であり式 (expression) ではないので、式である <literal>printf</literal> に置き換えた。
+ </para>
+ </section>
+ <section xml:id="commentary--shorten-function-invocation">
+ <title>関数呼び出しの短縮</title>
+ <para>
+ <literal>range</literal>、<literal>array_walk</literal>、<literal>printf</literal> は長すぎるのでどうにかせねばならない。
+ ここで、PHP の可変関数を使う。可変関数とは、関数名が文字列として入った変数を経由して、関数を呼び出す機能である。
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ <?php
+
+ $r = 'range';
+ $w = 'array_walk';
+ $p = 'printf';
+
+ $s = $r(1, 100);
+ $w(
+ $s,
+ fn($i) =>
+ $p((($i % 3 ? '' : 'Fizz') . ($i % 5 ? '' : 'Buzz') ?: $i) . "\n"),
+ );
+ ]]>
+ </programlisting>
+ <para>
+ これで関数を呼び出している所は短くなった。
+ では、<literal>$r</literal> や <literal>$w</literal> や <literal>$p</literal>、
+ また <literal>'Fizz'</literal> や <literal>'Buzz'</literal> はどうやって 1 行 2 文字に収めるのか。
+ 次のテクニックへ移ろう。
+ </para>
+ </section>
+ <section xml:id="commentary--incompatible-solution">
+ <title>余談: PHP 8.x で動作しなくてもいいなら</title>
+ <para>
+ 今回使ったテクニックを説明する前に、余談として、文字列リテラルの短縮法として今回採用しなかったものを紹介する。
+ </para>
+ <blockquote>
+ <itemizedlist>
+ <listitem>PHP 7.4〜8.1 で動作すること</listitem>
+ </itemizedlist>
+ </blockquote>
+ <para>
+ というルールがない場合、「未定義の定数が評価された場合、その定数の名前が値になる」という PHP 7.x までの仕様が利用できる。
+ 例えば、 <literal>Fizz</literal> という文字列が欲しければ、次のようにする。
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ $f
+ =F
+ .i
+ .z
+ .z
+ ;;
+ ]]>
+ </programlisting>
+ <para>
+ こうして簡単に文字列を作れる。
+ なお、この仕様は 7.x 時点でも警告を受けるので、<literal>@</literal> 演算子を使って抑制してやるとよい。
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ $f
+ =@
+ F.
+ @i
+ .#
+ @z
+ .#
+ @z
+ ;;
+ ]]>
+ </programlisting>
+ <para>
+ むしろ、このことがわかっていたからこそ PHP 8.x での動作を要件に課したところがある。
+ </para>
+ </section>
+ <section xml:id="commentary--shorten-string-literals">
+ <title>文字列リテラルの短縮</title>
+ <para>
+ 実際に使った手法の説明に移る。
+ </para>
+ <para>
+ ずばり、文字列同士のビット演算を使う。
+ PHP では、文字列同士でビット演算 (<literal>&amp;</literal>、<literal>|</literal>、<literal>^</literal>) をした場合、
+ 文字列の各バイトごとに指定したビット演算がなされ、それを結合したものが演算結果となる。
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ $a = "12345";
+ $b = "world";
+
+ // $a ^ $b は次のコードと同じ
+ $result = '';
+ for ($i = 0; $i < min(strlen($a), strlen($b)); $i++) {
+ $result .= $a[$i] ^ $b[$i];
+ }
+
+ echo $result;
+ // => F]AXQ
+ ]]>
+ </programlisting>
+ <para>
+ これを踏まえ、次のコードを見てみよう。
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ $x = "x\nOm\n";
+ $y = "\nk!\no";
+ $r = $x ^ $y;
+ echo "$r\n";
+ ]]>
+ </programlisting>
+ <para>
+ 実行すると、<literal>range</literal> が表示される。
+ さて、PHP では文字列リテラル中に生の改行を直接書いてもよいのだった (「主な障害」の節を参照のこと)。
+ 書きかえてみよう。
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ $x
+ ='x
+ Om
+ ';
+ $y
+ ='
+ k!
+ o'
+ ;
+
+ $r = $x ^ $y;
+ echo "$r\n";
+ ]]>
+ </programlisting>
+ <para>
+ さらに <literal>#</literal> を使って適当に調整すると、次のようになる。
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ $x
+ =#
+ 'x
+ Om
+ ';
+ $y
+ ='
+ k!
+ o'
+ ;#
+ $r
+ =#
+ $x
+ ^#
+ $y
+ ;#
+
+ echo "$r\n";
+ ]]>
+ </programlisting>
+ <para>
+ 1行あたり2文字で、<literal>range</literal> という文字列を生成することに成功した。
+ 他の必要な文字列にも、同様の処理をほどこす。
+ </para>
+ <para>
+ 備考: <literal>Buzz</literal> 中にある小文字の <literal>u</literal> は、このロジックだと non-printable な文字になってしまう。
+ ここまでのテクニックを駆使すれば回避するのはそう難しくないので、考えてみてほしい。
+ </para>
+ </section>
+ </section>
+ <section xml:id="stretched-fizzbuzz">
+ <title>完成系</title>
+ <para>
+ 完成したものがこちら。
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ <?php
+
+ $x
+ =#
+ 'i
+ S'
+ ;;
+ $y
+ ='
+ b!
+ ';
+ $c
+ =#
+ $x
+ ^#
+ $y
+ ;#
+ $x
+ =#
+ 'x
+ Om
+ ';
+ $y
+ ='
+ k!
+ o'
+ ;#
+ $r
+ =#
+ $x
+ ^#
+ $y
+ ;#
+ $x
+ =#
+ 'k
+ Sk
+ ~}
+ Ma
+ ';
+ $y
+ ='
+ x!
+ s!
+ k!
+ ';
+ $w
+ =#
+ $x
+ ^#
+ $y
+ ;#
+ $x
+ =#
+ 'z
+ Hd
+ G'
+ ;#
+ $y
+ ='
+ x!
+ ~!
+ ';
+ $p
+ =#
+ $x
+ ^#
+ $y
+ ;#
+ $x
+ =#
+ 'L
+ [p
+ ';
+ $y
+ ='
+ c!
+ ';
+ $f
+ =#
+ $x
+ ^#
+ $y
+ ;#
+ $x
+ =#
+ 'H
+ [p
+ ';
+ $y
+ ='
+ _!
+ ';
+ $b
+ =#
+ $x
+ ^#
+ $y
+ ;#
+ $b
+ [1
+ ]=
+ $c
+ (#
+ 13
+ *9
+ );
+ $s
+ =#
+ $r
+ (1
+ ,(
+ 10
+ **
+ 2)
+ );
+ $w
+ (#
+ $s
+ ,#
+ fn
+ (#
+ $i
+ )#
+ =>
+ $p
+ ((
+ (#
+ $i
+ %3
+ ?#
+ ''
+ :#
+ $f
+ ).
+ (#
+ $i
+ %5
+ ?#
+ ''
+ :#
+ $b
+ )?
+ :#
+ $i
+ )#
+ .'
+ ')
+ );
+ ]]>
+ </programlisting>
+ </section>
+ <section xml:id="outro">
+ <title>感想など</title>
+ <para>
+ PHP は、スクリプト言語の中だとシンタックスシュガーが少ない (体感)。
+ この挑戦は不可能に思われたが、PHP マニュアルとにらめっこしていたらなんとかなった。
+ </para>
+ <para>
+ みんなもプログラムを細長くしよう。
+ </para>
+ </section>
+ <section xml:id="alternative-solution">
+ <title>余談2: 別解</title>
+ <para>
+ PHP では、バッククォートを使ってシェルを呼び出せる。
+ これは <literal>shell_exec</literal> 関数と等価である。
+ さて、PHP ではバックスラッシュによる行継続が使えないと書いたが、シェルでは使える
+ (当然だが、呼び出されるシェルに依存する。Bash なら大丈夫だろう。知らんけど)。
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ <?php
+
+ printf(`
+ e\
+ c\
+ h\
+ o\
+ \
+ 1\
+ 2\
+ 3\
+ `);
+ ]]>
+ </programlisting>
+ <para>
+ なお、ここでは簡単のため出力に <literal>printf</literal> をそのまま使っているが、
+ 実際には <literal>printf</literal> という文字列を合成して可変関数で呼び出す。
+ </para>
+ <para>
+ ただし、これでは
+ </para>
+ <blockquote>
+ <itemizedlist>
+ <listitem>スペースやタブを使用しないこと</listitem>
+ </itemizedlist>
+ </blockquote>
+ <para>
+ に違反してしまう。スペースが使えないと引数とコマンドを区切れない。これは困った。
+ </para>
+ <para>
+ もうこれ以上は不可能だと思っていたのだが、この記事の執筆中に解決する方法を思いついたので載せておく。
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ <?php
+
+ $c = 'chr';
+
+ ${
+ '_
+ '}
+ =#
+ $c
+ (#
+ 32
+ ).
+ $c
+ (#
+ 92
+ );
+
+ printf(`
+ e\
+ c\
+ h\
+ o\
+ ${
+ '_
+ '}
+ 1\
+ 2\
+ 3\
+ `);
+ ]]>
+ </programlisting>
+ <para>
+ 先程と同じく、<literal>chr</literal> や <literal>printf</literal> を生成する部分は長くなるので省いた。
+ </para>
+ <literallayout class="monospaced">
+ <![CDATA[
+ ${
+ '_
+ '}
+ ]]>
+ </literallayout>
+ <para>
+ は変数で、中にはスペースとエスケープが入っている (<literal>chr(32) . chr(92)</literal>)。
+ シェルに渡されている文字列は次のようになる。
+ </para>
+ <literallayout class="monospaced">
+ <![CDATA[
+ e\
+ c\
+ h\
+ o\
+ \
+ 1\
+ 2\
+ 3\
+ ]]>
+ </literallayout>
+ <para>
+ これは、前掲したコマンドと同じだ。
+ かくして、スペースを陽に書かずにシェルをおおよそ自由に扱えるようになった。
+ Fizzbuzz のワンライナーくらいすぐ書けるだろうから、あとはなんとかなるだろう (試してないけど)。
+ </para>
+ <para>
+ ということでこれは別解ということにしておく。
+ </para>
+ <para>
+ ちなみに、PHP 8.2 からは、この記法で Warning が出るようになるようだ。
+ </para>
+ <literallayout class="monospaced">
+ <![CDATA[
+ ${
+ '_
+ '}
+ ]]>
+ </literallayout>
+ <para>
+ 最新版で警告が出るというのも美しくないので、私としては本編の解法を推す。
+ </para>
+ </section>
+</article>
diff --git a/vhosts/blog/content/posts/2022-10-23/phperkaigi-2023-unused-token-quiz-1.xml b/vhosts/blog/content/posts/2022-10-23/phperkaigi-2023-unused-token-quiz-1.xml
new file mode 100644
index 00000000..79202320
--- /dev/null
+++ b/vhosts/blog/content/posts/2022-10-23/phperkaigi-2023-unused-token-quiz-1.xml
@@ -0,0 +1,188 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<article xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0">
+ <info>
+ <title>PHPerKaigi 2023: ボツになったトークン問題 その 1</title>
+ <abstract>
+ 来年の PHPerKaigi 2023 でデジタルサーカス株式会社から出題予定のトークン問題のうち、ボツになった問題を公開する (その 1)。
+ </abstract>
+ <keywordset>
+ <keyword>php</keyword>
+ <keyword>phperkaigi</keyword>
+ </keywordset>
+ <revhistory>
+ <revision>
+ <date>2022-10-23</date>
+ <revremark>公開</revremark>
+ </revision>
+ </revhistory>
+ </info>
+ <section xml:id="intro">
+ <title>はじめに</title>
+ <para>
+ 2023 年 3 月 23 日から 25 日にかけて開催予定 (記事執筆時点) の、
+ <link xl:href="https://phperkaigi.jp/2023/">PHPerKaigi 2023</link> において、
+ 昨年と同様に、弊社 <link xl:href="https://www.dgcircus.com/">デジタルサーカス株式会社</link> から、
+ トークン問題を出題予定である。
+ </para>
+ <para>
+ 昨年のトークン問題の記事はこちら: <link xl:href="/posts/2022-04-09/phperkaigi-2022-tokens">PHPerKaigi 2022 トークン問題の解説</link>
+ </para>
+ <para>
+ すでに 2023 年用の問題は作成済みであるが、その制作過程の中でいくつかボツ問ができた。
+ せっかくなので、PHPerKaigi 開催を待つ間に紹介しようと思う。
+ </para>
+ <para>
+ 10 月から 2 月まで、毎月 1 記事ずつ公開していく予定 (忘れていなければ)。
+ </para>
+ </section>
+ <section xml:id="quiz">
+ <title>問題</title>
+ <para>
+ 注意: これはボツ問なので、得られたトークンを PHPerKaigi で入力してもポイントにはならない。
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ <?php
+
+ $π = $argv[1] ?? null;
+ if ($π === null) {
+ exit('No input.');
+ }
+ $π = trim($π);
+ if (!is_numeric($π)) {
+ exit('Invalid input.');
+ }
+
+ $s = implode(array_map(chr(...), str_split($π, 2)));
+
+ preg_match('/(\x23.+?) /', $s, $m);
+ $t = $m[1] ?? '';
+
+ if (md5($t) === '056e831a4146bf123e8ea16613303d2e') {
+ echo "Token: {$t}\n";
+ } else {
+ echo "Failed.\n";
+ }
+ ]]>
+ </programlisting>
+ </section>
+ <section xml:id="how-to-obtain-token">
+ <title>トークン入手方法</title>
+ <para>
+ ソースを見るとわかるとおり、<literal>$argv[1]</literal> を参照している。
+ それを <literal>$π</literal> なる変数に代入しているので、円周率を渡してみる。
+ </para>
+ <programlisting language="shell-session" linenumbering="unnumbered">
+ <![CDATA[
+ $ php Q.php 3.14
+ Failed.
+ ]]>
+ </programlisting>
+ <para>
+ 失敗してしまった。精度を上げてみる。
+ </para>
+ <programlisting language="shell-session" linenumbering="unnumbered">
+ <![CDATA[
+ $ php Q.php 3.1415
+ Failed.
+ ]]>
+ </programlisting>
+ <para>
+ だめだった。これを成功するまで繰り返す。
+ </para>
+ <para>
+ 最初にトークンが得られるのは、小数点以下 16 桁目まで入力したときで、こうなる。
+ </para>
+ <programlisting language="shell-session" linenumbering="unnumbered">
+ <![CDATA[
+ $ php Q.php 3.1415926535897932
+ Token: #YO
+ ]]>
+ </programlisting>
+ <para>
+ めでたくトークン「<literal>#YO</literal>」が手に入った。
+ </para>
+ </section>
+ <section xml:id="commentary">
+ <title>解説</title>
+ <para>
+ 短いので頭から追っていく。
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ $π = $argv[1] ?? null;
+ if ($π === null) {
+ exit('No input.');
+ }
+ $π = trim($π);
+ if (!is_numeric($π)) {
+ exit('Invalid input.');
+ }
+ ]]>
+ </programlisting>
+ <para>
+ 入力のバリデーション部分。数値のみ受け付ける。
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ $s = implode(array_map(chr(...), str_split($π, 2)));
+ ]]>
+ </programlisting>
+ <para>
+ <literal>$π</literal> を 2 文字ごとに区切り (<literal>str_split</literal>)、
+ 数値を ASCII コードと見做して文字に変換 (<literal>chr</literal>) して結合 (<literal>implode</literal>) している。
+ </para>
+ <para>
+ 例えば、<literal>$π</literal> が <literal>'656667'</literal> だったとすると、
+ <literal>65</literal>、<literal>66</literal>、<literal>67</literal> に対応した
+ <literal>'A'</literal>、<literal>'B'</literal>、<literal>'C'</literal> へと変換され、<literal>'ABC'</literal> になる。
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ $π = '656667';
+ $s = implode(array_map(chr(...), str_split($π, 2)));
+ echo $s;
+ // => ABC
+ ]]>
+ </programlisting>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ preg_match('/(\x23.+?) /', $s, $m);
+ $t = $m[1] ?? '';
+ ]]>
+ </programlisting>
+ <para>
+ 正規表現でマッチングしている。<literal>\x23</literal> は <literal>#</literal> と同じであることに留意すると、
+ この正規表現は「<literal>#</literal> から始まる 2 以上の長さ (含 <literal>#</literal>) の文字列で、
+ 最初に現れるスペースまで」にマッチする。つまりこれは、PHPerKaigi におけるトークンである。
+ </para>
+ <para>
+ なお、<literal>#</literal> を直接書いていないのは、<literal>/#.+?) /</literal> と書くと、
+ <literal>#.+?)</literal> という意図せぬトークンが登録されてしまうからである。
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ if (md5($t) === '056e831a4146bf123e8ea16613303d2e') {
+ echo "Token: {$t}\n";
+ } else {
+ echo "Failed.\n";
+ }
+ ]]>
+ </programlisting>
+ <para>
+ 最後にトークンのハッシュ値を見て、想定解かどうかを確認する。
+ </para>
+ </section>
+ <section xml:id="outro">
+ <title>おわりに</title>
+ <para>
+ 円周率を何桁も計算して ASCII コード経由で文字列化すれば、トークンっぽいものがどこかで出てくるのではないか、と考えて生まれた作品。
+ </para>
+ <para>
+ 最初は真面目に円周率の計算プログラムを組んでいたのだが、いざ動かしてみるとやけに浅いところにあったので驚いた
+ (ちなみに、それでも <literal>M_PI</literal> や <literal>pi()</literal> では精度が足りない)。
+ 見つけたときは狂喜したものの、冷静になってみると大して面白くなかったのでボツになった。
+ むしろ、100 万桁目くらいに埋まっていてくれたほうがよかったかもしれない。
+ </para>
+ </section>
+</article>
diff --git a/vhosts/blog/content/posts/2022-10-28/setup-server-for-this-site.xml b/vhosts/blog/content/posts/2022-10-28/setup-server-for-this-site.xml
new file mode 100644
index 00000000..b0ad60e0
--- /dev/null
+++ b/vhosts/blog/content/posts/2022-10-28/setup-server-for-this-site.xml
@@ -0,0 +1,313 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<article xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0">
+ <info>
+ <title>【備忘録】 このサイト用の VPS をセットアップしたときのメモ</title>
+ <abstract>
+ GitHub Pages でホストしていたこのサイトを VPS へ移行したので、そのときにやったことのメモ。99 % 自分用。
+ </abstract>
+ <keywordset>
+ <keyword>note-to-self</keyword>
+ </keywordset>
+ <revhistory>
+ <revision>
+ <date>2022-10-28</date>
+ <revremark>公開</revremark>
+ </revision>
+ <revision>
+ <date>2023-08-30</date>
+ <revremark>ssh_config に IdentitiesOnly yes を追加</revremark>
+ </revision>
+ </revhistory>
+ </info>
+ <section xml:id="intro">
+ <title>はじめに</title>
+ <para>
+ これまでこの blog は GitHub Pages でホストしていたのだが、先日 VPS に移行した。
+ そのときにおこなったサーバのセットアップ作業を書き残しておく。
+ 99 % 自分用の備忘録。別のベンダに移したりしたくなったら見に来る。
+ </para>
+ <para>
+ 未来の自分へ: 特に自動化してないので、せいぜい苦しんでくれ。
+ </para>
+ </section>
+ <section xml:id="vps">
+ <title>VPS</title>
+ <para>
+ <link xl:href="https://vps.sakura.ad.jp/">さくらの VPS</link> の 2 GB プラン。
+ そこまで真面目に選定していないので、困ったら移動するかも。
+ </para>
+ </section>
+ <section xml:id="preparation">
+ <title>事前準備</title>
+ <section xml:id="preparation--hostname">
+ <title>サーバのホスト名を決める</title>
+ <para>
+ モチベーションが上がるという効能がある。今回は藤原定家から取って <literal>teika</literal> にした。
+ たいていいつも源氏物語の帖か小倉百人一首の歌人から選んでいる。
+ </para>
+ </section>
+ <section xml:id="preparation--ssh-key">
+ <title>SSH の鍵生成</title>
+ <para>
+ ローカルマシンで鍵を生成する。
+ </para>
+ <programlisting language="shell-session" linenumbering="unnumbered">
+ <![CDATA[
+ $ ssh-keygen -t ed25519 -b 521 -f ~/.ssh/teika.key
+ $ ssh-keygen -t ed25519 -b 521 -f ~/.ssh/github2teika.key
+ ]]>
+ </programlisting>
+ <para>
+ <literal>teika.key</literal> はローカルからサーバへの接続用、<literal>github2teika.key</literal> は、
+ GitHub Actions からサーバへのデプロイ用。
+ </para>
+ </section>
+ <section xml:id="preparation--ssh-config">
+ <title>SSH の設定</title>
+ <para>
+ <literal>.ssh/config</literal> に設定しておく。
+ </para>
+ <programlisting language="ssh_config" linenumbering="unnumbered">
+ <![CDATA[
+ Host teika
+ HostName **********
+ User **********
+ Port **********
+ IdentityFile ~/.ssh/teika.key
+ IdentitiesOnly yes
+ ]]>
+ </programlisting>
+ </section>
+ </section>
+ <section xml:id="basic-setup">
+ <title>基本のセットアップ</title>
+ <section xml:id="basic-setup--login">
+ <title>SSH 接続</title>
+ <para>
+ VPS 契約時に設定した管理者ユーザとパスワードを使ってログインする。
+ </para>
+ </section>
+ <section xml:id="basic-setup--user">
+ <title>ユーザを作成する</title>
+ <para>
+ 管理者ユーザで作業すると危ないので、メインで使うユーザを作成する。
+ <literal>sudo</literal> グループに追加して <literal>sudo</literal> できるようにし、<literal>su</literal> で切り替え。
+ </para>
+ <programlisting language="shell-session" linenumbering="unnumbered">
+ <![CDATA[
+ $ sudo adduser **********
+ $ sudo adduser ********** sudo
+ $ su **********
+ $ cd
+ ]]>
+ </programlisting>
+ </section>
+ <section xml:id="basic-setup--hostname">
+ <title>ホスト名を変える</title>
+ <programlisting language="shell-session" linenumbering="unnumbered">
+ <![CDATA[
+ $ sudo hostname teika
+ ]]>
+ </programlisting>
+ </section>
+ <section xml:id="basic-setup--public-key">
+ <title>公開鍵を置く</title>
+ <programlisting language="shell-session" linenumbering="unnumbered">
+ <![CDATA[
+ $ mkdir ~/.ssh
+ $ chmod 700 ~/.ssh
+ $ vi ~/.ssh/authorized_keys
+ ]]>
+ </programlisting>
+ <para>
+ <literal>authorized_keys</literal> には、ローカルで生成した <literal>~/.ssh/teika.key.pub</literal> と
+ <literal>~/.ssh/github2teika.key.pub</literal> の内容をコピーする。
+ </para>
+ </section>
+ <section xml:id="basic-setup--ssh-config">
+ <title>SSH の設定</title>
+ <para>
+ SSH の設定を変更し、少しでも安全にしておく。
+ </para>
+ <programlisting language="shell-session" linenumbering="unnumbered">
+ <![CDATA[
+ $ sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
+ $ sudo vi /etc/ssh/sshd_config
+ ]]>
+ </programlisting>
+ <itemizedlist>
+ <listitem><literal>Port</literal> を変更</listitem>
+ <listitem><literal>PermitRootLogin</literal> を <literal>no</literal> に</listitem>
+ <listitem><literal>PasswordAuthentication</literal> を <literal>no</literal> に</listitem>
+ </itemizedlist>
+ <para>
+ そして設定を反映。
+ </para>
+ <programlisting language="shell-session" linenumbering="unnumbered">
+ <![CDATA[
+ $ sudo systemctl restart sshd
+ $ sudo systemctl status sshd
+ ]]>
+ </programlisting>
+ </section>
+ <section xml:id="basic-setup--ssh-connect">
+ <title>SSH で接続確認</title>
+ <para>
+ 今の SSH セッションは閉じずに、ターミナルを別途開いて疎通確認する。
+ セッションを閉じてしまうと、SSH の設定に不備があった場合に締め出しをくらう。
+ </para>
+ <programlisting language="shell-session" linenumbering="unnumbered">
+ <![CDATA[
+ $ ssh teika
+ ]]>
+ </programlisting>
+ </section>
+ <section xml:id="basic-setup--close-ports">
+ <title>ポートの遮断</title>
+ <para>
+ デフォルトの 22 番を閉じ、設定したポートだけ空ける。
+ </para>
+ <programlisting language="shell-session" linenumbering="unnumbered">
+ <![CDATA[
+ $ sudo ufw deny ssh
+ $ sudo ufw allow *******
+ $ sudo ufw enable
+ $ sudo ufw reload
+ $ sudo ufw status
+ ]]>
+ </programlisting>
+ <para>
+ ここでもう一度 SSH の接続確認を挟む。
+ </para>
+ </section>
+ <section xml:id="basic-setup--ssh-key-for-github">
+ <title>GitHub 用の SSH 鍵</title>
+ <para>
+ GitHub に置いてある private リポジトリをサーバから clone したいので、SSH 鍵を生成して置いておく。
+ </para>
+ <programlisting language="shell-session" linenumbering="unnumbered">
+ <![CDATA[
+ $ ssh-keygen -t ed25519 -b 521 -f ~/.ssh/github.key
+ $ cat ~/.ssh/github.key.pub
+ ]]>
+ </programlisting>
+ <para>
+ <link xl:href="https://github.com/settings/ssh">GitHub の設定画面</link> から、この公開鍵を追加する。
+ </para>
+ <programlisting language="shell-session" linenumbering="unnumbered">
+ <![CDATA[
+ $ vi ~/.ssh/config
+ ]]>
+ </programlisting>
+ <para>
+ 設定はこう。
+ </para>
+ <programlisting language="ssh_config" linenumbering="unnumbered">
+ <![CDATA[
+ Host github.com
+ HostName github.com
+ User git
+ Port 22
+ IdentityFile ~/.ssh/github.key
+ IdentitiesOnly yes
+ ]]>
+ </programlisting>
+ <para>
+ 最後に接続できるか確認しておく。
+ </para>
+ <programlisting language="shell-session" linenumbering="unnumbered">
+ <![CDATA[
+ $ ssh -T github.com
+ ]]>
+ </programlisting>
+ </section>
+ <section xml:id="basic-setup--upgrade-packages">
+ <title>パッケージの更新</title>
+ <programlisting language="shell-session" linenumbering="unnumbered">
+ <![CDATA[
+ $ sudo apt update
+ $ sudo apt upgrade
+ $ sudo apt update
+ $ sudo apt upgrade
+ $ sudo apt autoremove
+ ]]>
+ </programlisting>
+ </section>
+ </section>
+ <section xml:id="site-hosting-setup">
+ <title>サイトホスティング用のセットアップ</title>
+ <section xml:id="site-hosting-setup--dns">
+ <title>DNS に IP アドレスを登録する</title>
+ <para>
+ このサーバは固定の IP アドレスがあるので、<literal>A</literal> レコードに直接入れるだけで済んだ。
+ </para>
+ </section>
+ <section xml:id="site-hosting-setup--install-softwares">
+ <title>使うソフトウェアのインストール</title>
+ <programlisting language="shell-session" linenumbering="unnumbered">
+ <![CDATA[
+ $ sudo apt install docker docker-compose git make
+ ]]>
+ </programlisting>
+ </section>
+ <section xml:id="site-hosting-setup--docker">
+ <title>メインユーザが Docker を使えるように</title>
+ <programlisting language="shell-session" linenumbering="unnumbered">
+ <![CDATA[
+ $ sudo adduser ********** docker
+ ]]>
+ </programlisting>
+ </section>
+ <section xml:id="site-hosting-setup--open-http-ports">
+ <title>HTTP/HTTPS を通す</title>
+ <para>
+ 80 番と 443 番を空ける。
+ </para>
+ <programlisting language="shell-session" linenumbering="unnumbered">
+ <![CDATA[
+ $ sudo ufw allow 80/tcp
+ $ sudo ufw allow 443/tcp
+ $ sudo ufw reload
+ $ sudo ufw status
+ ]]>
+ </programlisting>
+ </section>
+ <section xml:id="site-hosting-setup--clone-repositories">
+ <title>リポジトリのクローン</title>
+ <programlisting language="shell-session" linenumbering="unnumbered">
+ <![CDATA[
+ $ cd
+ $ git clone git@github.com:nsfisis/nsfisis.dev.git
+ $ cd nsfisis.dev
+ $ git submodule update --init
+ ]]>
+ </programlisting>
+ </section>
+ <section xml:id="site-hosting-setup--certbot">
+ <title>certbot で証明書取得</title>
+ <programlisting language="shell-session" linenumbering="unnumbered">
+ <![CDATA[
+ $ docker-compose up -d acme-challenge
+ $ make setup
+ ]]>
+ </programlisting>
+ </section>
+ <section xml:id="site-hosting-setup--run-server">
+ <title>サーバを稼動させる</title>
+ <programlisting language="shell-session" linenumbering="unnumbered">
+ <![CDATA[
+ $ make serve
+ ]]>
+ </programlisting>
+ </section>
+ </section>
+ <section xml:id="outro">
+ <title>感想</title>
+ <para>
+ (業務でなく) 個人だと数年ぶりのサーバセットアップで、これだけでも割と時間を食ってしまった。
+ とはいえ式年遷宮は楽しいので、これからも定期的にやっていきたい。
+ コンテナデプロイにしたい気持ちもあるのだが、色々実験したい関係上、本物のサーバも欲しくはある。
+ 次の式年遷宮では、手順の一部だけでも自動化したいところ。
+ </para>
+ </section>
+</article>
diff --git a/vhosts/blog/content/posts/2022-11-19/phperkaigi-2023-unused-token-quiz-2.xml b/vhosts/blog/content/posts/2022-11-19/phperkaigi-2023-unused-token-quiz-2.xml
new file mode 100644
index 00000000..0332179d
--- /dev/null
+++ b/vhosts/blog/content/posts/2022-11-19/phperkaigi-2023-unused-token-quiz-2.xml
@@ -0,0 +1,174 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<article xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0">
+ <info>
+ <title>PHPerKaigi 2023: ボツになったトークン問題 その 2</title>
+ <abstract>
+ 来年の PHPerKaigi 2023 でデジタルサーカス株式会社から出題予定のトークン問題のうち、ボツになった問題を公開する (その 2)。
+ </abstract>
+ <keywordset>
+ <keyword>php</keyword>
+ <keyword>phperkaigi</keyword>
+ </keywordset>
+ <revhistory>
+ <revision>
+ <date>2022-11-19</date>
+ <revremark>公開</revremark>
+ </revision>
+ </revhistory>
+ </info>
+ <section xml:id="intro">
+ <title>はじめに</title>
+ <para>
+ 2023 年 3 月 23 日から 25 日にかけて開催予定 (記事執筆時点) の <link xl:href="https://phperkaigi.jp/2023/">PHPerKaigi 2023</link> において、
+ 昨年と同様に、弊社 <link xl:href="https://www.dgcircus.com/">デジタルサーカス株式会社</link> からトークン問題を出題予定である。
+ </para>
+ <para>
+ 昨年のトークン問題の記事はこちら: <link xl:href="/posts/2022-04-09/phperkaigi-2022-tokens/">PHPerKaigi 2022 トークン問題の解説</link>
+ </para>
+ <para>
+ すでに 2023 年用の問題は作成済みであるが、その制作過程の中でいくつかボツ問ができた。せっかくなので、PHPerKaigi 開催を待つ間に紹介しようと思う。
+ </para>
+ <para>
+ 10 月から 2 月まで、毎月 1 記事ずつ公開していく予定 (忘れていなければ)。
+ </para>
+ <para>
+ その 1 はこちら: <link xl:href="/posts/2022-10-23/phperkaigi-2023-unused-token-quiz-1/">PHPerKaigi 2023: ボツになったトークン問題 その 1</link>
+ </para>
+ </section>
+ <section xml:id="quiz">
+ <title>問題</title>
+ <para>
+ 注意: これはボツ問なので、得られたトークンを PHPerKaigi で入力してもポイントにはならない。
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ <?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s='​<?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>')."\n","\x27$s\x27");?>
+ <?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s='​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​<?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>')."\n","\x27$s\x27");?>
+ <?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s='​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​<?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>')."\n","\x27$s\x27");?>
+ <?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s='​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​<?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>')."\n","\x27$s\x27");?>
+ <?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s='​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​<?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>')."\n","\x27$s\x27");?>
+ <?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s='​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​<?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>')."\n","\x27$s\x27");?>
+ <?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s='​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​<?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>')."\n","\x27$s\x27");?>
+ <?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s='​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​<?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>')."\n","\x27$s\x27");?>
+ <?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s='​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​<?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>')."\n","\x27$s\x27");?>
+ <?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s='​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​<?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>')."\n","\x27$s\x27");?>
+ ]]>
+ </programlisting>
+ <para>
+ "And Then There Were None" (そして誰もいなくなった) と名付けた作品。変則 quine (自分自身と同じソースコードを出力するプログラム) になっている。
+ </para>
+ </section>
+ <section xml:id="how-to-obtain-token">
+ <title>トークン入手方法</title>
+ <para>
+ 実行してみると、次のような出力が得られる。
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ #
+ <?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s='​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​<?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>')."\n","\x27$s\x27");?>
+ <?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s='​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​<?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>')."\n","\x27$s\x27");?>
+ <?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s='​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​<?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>')."\n","\x27$s\x27");?>
+ <?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s='​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​<?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>')."\n","\x27$s\x27");?>
+ <?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s='​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​<?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>')."\n","\x27$s\x27");?>
+ <?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s='​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​<?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>')."\n","\x27$s\x27");?>
+ <?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s='​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​<?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>')."\n","\x27$s\x27");?>
+ <?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s='​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​<?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>')."\n","\x27$s\x27");?>
+ <?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s='​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​<?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>')."\n","\x27$s\x27");?>
+ ]]>
+ </programlisting>
+ <para>
+ 1 行目を除き、先ほどのコードとほぼ同じものが出てきた。もう一度実行してみる。
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ #
+ W
+ <?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s='​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​<?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>')."\n","\x27$s\x27");?>
+ <?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s='​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​<?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>')."\n","\x27$s\x27");?>
+ <?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s='​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​<?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>')."\n","\x27$s\x27");?>
+ <?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s='​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​<?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>')."\n","\x27$s\x27");?>
+ <?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s='​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​<?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>')."\n","\x27$s\x27");?>
+ <?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s='​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​<?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>')."\n","\x27$s\x27");?>
+ <?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s='​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​<?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>')."\n","\x27$s\x27");?>
+ <?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s='​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​<?php printf((isset($s)?fn($s)=>trim($s,"​"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>')."\n","\x27$s\x27");?>
+ ]]>
+ </programlisting>
+ <para>
+ 今度は 2 行目が書き換えられた。すべての行が変化するまで繰り返すと次のようになる。
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ #
+ W
+ E
+ L
+ O
+ V
+ E
+ P
+ H
+ P
+ ]]>
+ </programlisting>
+ <para>
+ トークン「#WELOVEPHP」が手に入った。
+ </para>
+ </section>
+ <section xml:id="commentary">
+ <title>解説</title>
+ <para>
+ 一見すると同じ行が 10 行並んでいるだけなのにも関わらず、なぜそれぞれの行で出力が変わるのか。ソースコードをコピーして、適当なエディタに貼り付けるとわかりやすい。
+ </para>
+ <para>
+ Vim で開くと次のようになる (1 行目を抜粋)。
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ <?php printf((isset($s)?fn($s)=>trim($s,"<200b>"):fn($s)=>chr(strlen($s)/3))($s='<200b><?php printf((isset($s)?fn($s)=>trim($s,"<200b>"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>')."\n","\x27$s\x27");?>
+ ]]>
+ </programlisting>
+ <para>
+ <literal>&lt;200b&gt;</literal> と表示されているのは、Unicode の U+200b で、ゼロ幅スペースである。
+ </para>
+ <note>
+ <para>
+ エディタによっては、ゼロ幅スペースが見えないことがある。VSCode ではブラウザと同様に不可視だった。
+ </para>
+ </note>
+ <para>
+ 文字列リテラルの中にゼロ幅スペースを仕込むことで、見た目を変えずに情報をエンコードすることが可能となる。
+ </para>
+ <para>
+ 続いて、トークンへの変換ロジックを解析する。注目すべきはこの部分だ。以下、ゼロ幅スペースは Vim での表示に合わせて <literal>&lt;200b&gt;</literal> と記載する。
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ fn($s)=>chr(strlen($s)/3)
+ ]]>
+ </programlisting>
+ <para>
+ PHP の <literal>strlen()</literal> は文字列のバイト数を返す。1 行目の <literal>$s</literal> は以下の内容となっており、
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ $s='<200b><?php printf((isset($s)?fn($s)=>trim($s,"<200b>"):fn($s)=>chr(strlen($s)/3))($s=%s)."\n","\x27$s\x27");?>'
+ ]]>
+ </programlisting>
+ <para>
+ このソースコードは UTF-8 で書かれているので、105 バイトになる。それを 3 で割ると 35 となり、これは <literal>#</literal> の ASCII コードと一致する。他の行も、同様にしてゼロ幅スペースを詰めることで文字列長を調整し、トークンをエンコードしている。
+ </para>
+ <para>
+ デコード部以外の部分は、quine のための記述である。
+ </para>
+ </section>
+ <section xml:id="outro">
+ <title>おわりに</title>
+ <para>
+ <link xl:href="https://blog.rust-lang.org/2021/11/01/cve-2021-42574.html">CVE-2021-42574</link> に着想を得た作品。この脆弱性は、Unicode の制御文字である left-to-right mark と right-to-left mark を利用し、ソースコードの実際の内容を欺く、というもの。簡単のためゼロ幅スペースを用いることとし、ついでに quine にもするとこうなった。
+ </para>
+ <para>
+ ボツになった理由は、ゼロ幅スペースを表示してくるエディタが想像以上に多かったため。「同じ行が並んでいるだけなのに出力が異なる」というアイデアの根幹を崩されてしまうので、この問題は不採用となった。
+ </para>
+ </section>
+</article>
diff --git a/vhosts/blog/content/posts/2023-01-10/phperkaigi-2023-unused-token-quiz-3.xml b/vhosts/blog/content/posts/2023-01-10/phperkaigi-2023-unused-token-quiz-3.xml
new file mode 100644
index 00000000..90838852
--- /dev/null
+++ b/vhosts/blog/content/posts/2023-01-10/phperkaigi-2023-unused-token-quiz-3.xml
@@ -0,0 +1,329 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<article xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0">
+ <info>
+ <title>PHPerKaigi 2023: ボツになったトークン問題 その 3</title>
+ <abstract>
+ 来年の PHPerKaigi 2023 でデジタルサーカス株式会社から出題予定のトークン問題のうち、ボツになった問題を公開する (その 3)。
+ </abstract>
+ <keywordset>
+ <keyword>php</keyword>
+ <keyword>phperkaigi</keyword>
+ </keywordset>
+ <revhistory>
+ <revision>
+ <date>2023-01-10</date>
+ <revremark>公開</revremark>
+ </revision>
+ </revhistory>
+ </info>
+ <section xml:id="intro">
+ <title>はじめに</title>
+ <para>
+ 2023 年 3 月 23 日から 25 日にかけて開催予定 (記事執筆時点) の <link xl:href="https://phperkaigi.jp/2023/">PHPerKaigi 2023</link> において、
+ 昨年と同様に、弊社 <link xl:href="https://www.dgcircus.com/">デジタルサーカス株式会社</link> からトークン問題を出題予定である。
+ </para>
+ <para>
+ 昨年のトークン問題の記事はこちら: <link xl:href="/posts/2022-04-09/phperkaigi-2022-tokens/">PHPerKaigi 2022 トークン問題の解説</link>
+ </para>
+ <para>
+ すでに 2023 年用の問題は作成済みであるが、その制作過程の中でいくつかボツ問ができた。
+ せっかくなので、PHPerKaigi 開催を待つ間に紹介しようと思う。
+ </para>
+ <para>
+ 10 月から 2 月まで、毎月 1 記事ずつ公開していく予定 (忘れていなければ → 忘れていたので 12 月公開予定だった記事を今書いている)。
+ </para>
+ <itemizedlist>
+ <listitem>その 1 はこちら: <link xl:href="/posts/2022-10-23/phperkaigi-2023-unused-token-quiz-1/">PHPerKaigi 2023: ボツになったトークン問題 その 1</link></listitem>
+ <listitem>その 2 はこちら: <link xl:href="/posts/2022-11-19/phperkaigi-2023-unused-token-quiz-2/">PHPerKaigi 2023: ボツになったトークン問題 その 2</link></listitem>
+ </itemizedlist>
+ </section>
+ <section xml:id="quiz">
+ <title>問題</title>
+ <para>
+ 注意: これはボツ問なので、得られたトークンを PHPerKaigi で入力してもポイントにはならない。
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ <?php
+ try {
+ f(g() / __LINE__);
+ } catch (Throwable $e) {
+ while ($e = $e->getPrevious()) printf('%c', $e->getLine() + 23);
+ echo "\n";
+ }
+ function f(int $i) {
+ if ($i < 0) f();
+ try {
+ match ($i) {
+ 0 => 0 / 0,
+
+
+
+ 15, 36 => 0 / 0,
+ 14 => 0 / 0,
+ 37 => 0 / 0,
+
+
+
+
+
+
+
+
+
+
+ 6 => 0 / 0,
+
+ 5 => 0 / 0,
+
+ 22 => 0 / 0,
+
+
+
+
+ 34, 35 => 0 / 0,
+
+
+
+
+
+
+
+
+ 25 => 0 / 0,
+ 17, 21 => 0 / 0,
+
+ 24, 32 => 0 / 0,
+
+
+
+
+
+
+
+ 33 => 0 / 0,
+
+ 16 => 0 / 0,
+
+
+ 18 => 0 / 0,
+
+
+
+
+
+
+
+
+ 7 => 0 / 0,
+
+ 2 => 0 / 0,
+ 1, 20 => 0 / 0,
+ 10, 28 => 0 / 0,
+ 8, 12, 26 => 0 / 0,
+ 4, 9, 13 => 0 / 0,
+
+
+
+
+
+ 31 => 0 / 0,
+
+ 29 => 0 / 0,
+
+ 11 => 0 / 0,
+
+
+
+ 3, 19, 23 => 0 / 0,
+
+
+ 27 => 0 / 0,
+
+ 30 => 0 / 0,
+ };
+ } finally {
+ f($i - 1);
+ }
+ }
+
+
+
+
+
+
+
+ function g() {
+ return __LINE__;
+ }
+ ]]>
+ </programlisting>
+ <para>
+ "Catchline" と名付けた作品。実行するとトークン <literal>#base64_decode('SGVsbG8sIFdvcmxkIQ==')</literal> が得られる。
+ </para>
+ <para>
+ トークンは PHP の式になっていて、評価すると <literal>Hello, World!</literal> という文字列になる。PHPer チャレンジのトークンには空白を含められないという制約があるが、こういった形でトークンにすれば回避できる。
+ </para>
+ </section>
+ <section xml:id="commentary">
+ <title>解説</title>
+ <section xml:id="commentary--summary">
+ <title>概要</title>
+ <para>
+ 例外が発生した行数にデータをエンコードし、それを <literal>catch</literal> で捕まえて表示している。
+ </para>
+ </section>
+ <section xml:id="commentary--chain-of-exceptions">
+ <title>例外オブジェクトの連鎖</title>
+ <para>
+ <link xl:href="https://www.php.net/class.Exception"><literal>Exception</literal></link> や <link xl:href="https://www.php.net/class.Error"><literal>Error</literal></link> には <literal>$previous</literal> というプロパティがあり、コンストラクタの第3引数から渡すことができる。主に 2つの用法がある:
+ </para>
+ <itemizedlist>
+ <listitem>エラーを処理している途中に起こった別のエラーに、元のエラー情報を含める</listitem>
+ <listitem>内部エラーをラップして作られたエラーに、内部エラーの情報を含める</listitem>
+ </itemizedlist>
+ <para>
+ このうち 1つ目のケースは、 <literal>finally</literal> 節の中でエラーを投げると PHP 処理系が勝手に <literal>$previous</literal> を設定してくれる。
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ <?php
+
+ try {
+ try {
+ throw new Exception("Error 1");
+ } finally {
+ throw new Exception("Error 2");
+ }
+ } catch (Exception $e) {
+ echo $e->getMessage() . PHP_EOL;
+ // => Error 2
+ echo $e->getPrevious()->getMessage() . PHP_EOL;
+ // => Error 1
+ }
+ ]]>
+ </programlisting>
+ <para>
+ この知識を元に、トークンの出力部を解析してみる。
+ </para>
+ </section>
+ <section xml:id="commentary--output">
+ <title>出力部の解析</title>
+ <para>
+ 出力部をコメントや改行を追加して再掲する:
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ <?php
+ try {
+ f(g() / __LINE__);
+ } catch (Throwable $e) {
+ while ($e = $e->getPrevious()) {
+ printf('%c', $e->getLine() + 23);
+ }
+ echo "\n";
+ }
+ ]]>
+ </programlisting>
+ <para>
+ 出力をおこなう <literal>catch</literal> 節を見てみると、 <literal>Throwable::getPrevious()</literal> を呼び出してエラーチェインを辿り、 <literal>Throwable::getLine()</literal> でエラーが発生した行数を取得している。その行数に <literal>23</literal> なるマジックナンバーを足し、フォーマット指定子 <literal>%c</literal> で出力している。
+ </para>
+ <para>
+ フォーマット指定子 <literal>%c</literal> は、整数を ASCII コード<footnote>RAS syndrome</footnote> と見做して印字する。トークン <literal>#base64_decode('SGVsbG8sIFdvcmxkIQ==')</literal> の <literal>b</literal> であれば、ASCII コード <literal>98</literal> なので、75 行目で発生したエラー、
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ 1, 20 => 0 / 0,
+ ]]>
+ </programlisting>
+ <para>
+ によって表現されている。エラーを起こす方法はいろいろと考えられるが、今回はゼロ除算を使った。
+ </para>
+ <para>
+ それでは、エラーチェインを作る箇所、関数 <literal>f()</literal> を見ていく。
+ </para>
+ </section>
+ <section xml:id="commentary--data-construction">
+ <title>データ構成部の解析</title>
+ <para>
+ <literal>f()</literal> の定義を再掲する (エラーオブジェクトの行数を利用しているので、一部分だけ抜き出すと値が変わることに注意):
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ function f(int $i) {
+ if ($i < 0) f();
+ try {
+ match ($i) {
+ 0 => 0 / 0, // 12 行目
+
+
+
+ 15, 36 => 0 / 0,
+ 14 => 0 / 0,
+ 37 => 0 / 0,
+
+ // (略)
+
+ 30 => 0 / 0, // 97 行目
+ };
+ } finally {
+ f($i - 1);
+ }
+ }
+ ]]>
+ </programlisting>
+ <para>
+ 前述のように、 <literal>finally</literal> 節でエラーを投げると PHP 処理系が <literal>$previous</literal> を設定する。ここでは、エラーを繋げるために <literal>f()</literal> を再帰呼び出ししている。最初に <literal>f()</literal> を呼び出している箇所を確認すると、
+ </para>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ <?php
+ try {
+ f(g() / __LINE__); // 3 行目
+ ]]>
+ </programlisting>
+ <programlisting language="php" linenumbering="unnumbered">
+ <![CDATA[
+ function g() {
+ return __LINE__; // 111 行目
+ }
+ ]]>
+ </programlisting>
+ <para>
+ <literal>f()</literal> には <literal>111 / 3</literal> で <literal>37</literal> が渡されることがわかる。そこから 1 ずつ減らして再帰呼び出ししていき、0 より小さくなったら <literal>f()</literal> を引数なしで呼び出す。引数の数が足りないと呼び出しに失敗するので、再帰はここで止まる。
+ </para>
+ <para>
+ エラーチェインは、最後に発生したエラーを先頭とした単方向連結リストになっているので、順に
+ </para>
+ <orderedlist numeration="arabic">
+ <listitem><literal>f()</literal> の引数が足りないことによる呼び出し失敗</listitem>
+ <listitem><literal>f(0)</literal> の呼び出しで発生したゼロ除算</listitem>
+ <listitem><literal>f(1)</literal> の呼び出しで発生したゼロ除算</listitem>
+ <listitem>…</listitem>
+ <listitem><literal>f(37)</literal> の呼び出しで発生したゼロ除算</listitem>
+ </orderedlist>
+ <para>
+ となっている。出力の際は <literal>catch</literal> したエラーの <literal>getPrevious()</literal> から処理を始めるので、1 番目の <literal>f()</literal> によるエラーは無視され、 <literal>f(0)</literal> によるエラー、 <literal>f(1)</literal> によるエラー、 <literal>f(2)</literal> によるエラー、と出力が進む。
+ </para>
+ <para>
+ <literal>f()</literal> に <literal>0</literal> を渡したときは 12 行目にある <literal>match</literal> の <literal>0</literal> でゼロ除算が起こるので、行数が 12 となったエラーが投げられる。出力部ではこれに 23 を足した数を ASCII コードとして表示しているのだった。 <literal>12 + 23</literal> は <literal>35</literal>、ASCII コードでは <literal>#</literal> である。これがトークンの 1文字目にあたる。
+ </para>
+ </section>
+ </section>
+ <section xml:id="outro">
+ <title>おわりに</title>
+ <para>
+ 「行数」というのはトークン文字列をデコードする対象として優れている。
+ </para>
+ <itemizedlist>
+ <listitem>トークンの一部や全部が陽に現れない</listitem>
+ <listitem><literal>__LINE__</literal> で容易に取得できる</listitem>
+ </itemizedlist>
+ <para>
+ しかし、こういった「変な」プログラムを何度も読んだり書いたりしていると、 <literal>__LINE__</literal> を使うのはあまりにありきたりで退屈になる。では、他に行数を取得する手段はないか。こうして <literal>Throwable</literal> を思いつき、続けてエラーオブジェクトには <literal>$previous</literal> があることを思い出した。
+ </para>
+ <para>
+ 今回エラーを投げるのにゼロ除算を用いたのは、それがエラーを投げる最も短いコードだと考えたからである。もし 3バイト未満で <literal>Throwable</literal> なオブジェクトを投げる手段をご存じのかたがいらっしゃれば、ぜひご教示いただきたい。……と締める予定だったのだが、<literal>0/0</literal> のところを存在しない定数にすれば、簡単に 1バイトを達成できた。ゼロ除算している箇所はちょうど 26 箇所あるので、アルファベットにでもしておけば意味ありげで良かったかもしれない。
+ </para>
+ </section>
+</article>
diff --git a/vhosts/blog/content/posts/2023-03-10/rewrite-this-blog-generator.xml b/vhosts/blog/content/posts/2023-03-10/rewrite-this-blog-generator.xml
new file mode 100644
index 00000000..9deff792
--- /dev/null
+++ b/vhosts/blog/content/posts/2023-03-10/rewrite-this-blog-generator.xml
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<article xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0">
+ <info>
+ <title>このブログのジェネレータを書き直した</title>
+ <abstract>
+ このブログのジェネレータを書き直したので、やったことを書き記しておく。
+ </abstract>
+ <revhistory>
+ <revision>
+ <date>2023-03-10</date>
+ <revremark>公開</revremark>
+ </revision>
+ </revhistory>
+ </info>
+ <section xml:id="intro">
+ <title>はじめに</title>
+ <para>
+ このブログを構築するシステムを書き直したのは 2度目である。
+ 元々立ち上げた当初は、静的サイトジェネレータである <link xl:href="https://gohugo.io/">Hugo</link> を使っていた。
+ それを <link xl:href="https://asciidoctor.org/">Asciidoctor</link> にいくつかのカスタムを加えた自前のジェネレータに移行したのが 2022年の11月ごろだ。
+ そして今回、スクラッチから書いた <link xl:href="https://deno.land/">Deno</link> 製のジェネレータに移行した。
+ </para>
+ <para>
+ この記事では、移行の理由などを (主に将来の私へ向けて) 書き記しておく。
+ </para>
+ </section>
+ <section xml:id="from-hugo-to-asciidoctor">
+ <title>Hugo から Asciidoctor へ</title>
+ <para>
+ 最初に断っておくと、Hugo は大変に優れた静的サイトジェネレータである。移行の理由の大半は、自分でジェネレータを書きたかったからに他ならない。
+ 実のところ、この記事を執筆している現在、自作ジェネレータは Hugo よりも機能が劣っている。
+ 例えば、Hugo を使っていたころはサポートしていた RSS フィードの生成は、まだ実装できていない。
+ </para>
+ <para>
+ 移行先のフォーマットとして AsciiDoc を選んだのは、Markdown よりも表現力に優れるからである。Markdown は広く使われている軽量マークアップ言語だが、以下のような欠点を持つ。
+ </para>
+ <para>
+ <itemizedlist>
+ <listitem>CommonMark では機能が貧弱である (例: 脚注、<code>id</code> 属性の付与)</listitem>
+ <listitem>拡張記法に実装間で互換性がない</listitem>
+ <listitem>メタデータ (公開日など) を埋め込む統一された方法がない</listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ AsciiDoc は Markdown に比べると普及していないが、上記の欠点は克服している。
+ </para>
+ <para>
+ <itemizedlist>
+ <listitem>ブログを書くのに十分な表現力がある</listitem>
+ <listitem>フォーマットを拡張するときの記法があらかじめ定められている</listitem>
+ <listitem>メタデータを埋め込む統一された方法がある</listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ なお、Hugo は AsciiDoc もサポートしているのだが、AsciiDoc を使う場合 Asciidoctor を別途インストールする必要があり、それならば最初から Asciidoctor でよかろうと移行を決めた。
+ </para>
+ </section>
+ <section xml:id="from-asciidoctor-to-my-own-generator">
+ <title>Asciidoctor から自前のジェネレータへ</title>
+ <para>
+ AsciiDoc は良いフォーマットだが、私には 1点不満があった。それは、高い表現力を担保するために記号が使い倒されており、エスケープが難しいという点だ (具体例を挙げたいのだが、何だったか覚えていない)。これは、多種多様な記号類を入力する必要のある技術ブログにとっては辛い問題である。この問題を解決するため、
+ <itemizedlist>
+ <listitem>表現力が高く、</listitem>
+ <listitem>文法が厳密であり、</listitem>
+ <listitem>簡単に実装できる</listitem>
+ </itemizedlist>
+ フォーマットが求められた。これに合致したのが、XML をベースとする <link xl:href="https://docbook.org/">DocBook</link> (今回使っているのは、そのサブセットである <link xl:href="https://tdg.docbook.org/tdg/sdocbook/5.1/">Simplified DocBook</link>) である。
+ </para>
+ <para>
+ 実は、AsciiDoc と DocBook はおおよそ互換性がある。AsciiDoc で書かれた文書は (ほぼ) 情報ロスなしに DocBook へ変換でき、逆もまたしかりである。
+ よって、DocBook には、AsciiDoc と同等の表現力がある。
+ </para>
+ <para>
+ XML の文法の厳密さについては、説明するまでもないだろう。また、単純な文法であることから実装が容易であり、事実上 Asciidoctor へロックインされる AsciiDoc とは異なり、さまざまな言語で多くのライブラリが存在する。
+ </para>
+ <para>
+ 今回は、XML のパース自体も自分で書いている (これは何となく書きたかったからであり、合理的な理由があるわけではない。実装はサボりまくっているので XML のコメントが使えないといった制限がある)。
+ </para>
+ <para>
+ XML という機械処理しやすいフォーマットを選ぶことには、機械的な変換や検査といった処理がおこないやすくなるといった利点もある。
+ 欠点は軽量マークアップ言語と比べて冗長であることだが、書く際は補完などを用いるのでそれほど気にならない。
+ 結局のところ、技術ブログの執筆を律速するのは調査と文章の記述であり、マークアップの手段は執筆時間に大した影響を与えない。
+ </para>
+ </section>
+ <section xml:id="outro">
+ <title>おわりに</title>
+ <para>
+ 2度のリライトを経て、記事のフォーマットとサイトジェネレータを上から下まで掌握した。
+ 今後も改善のアイデアは多数あるので、じわじわと進めていきたいところだ。
+ </para>
+ <para>
+ 最後にもう一度書くのだが、Hugo は大変に優れた静的サイトジェネレータである。
+ 無駄な拘りがなければこれを使うとよい。
+ 私は無駄に拘ったので、ブログの記事を書く時間を潰してブログシステムを作ってしまった。
+ </para>
+ </section>
+</article>
diff --git a/vhosts/blog/content/posts/2023-04-01/implementation-of-minimal-png-image-encoder.xml b/vhosts/blog/content/posts/2023-04-01/implementation-of-minimal-png-image-encoder.xml
new file mode 100644
index 00000000..67dfad87
--- /dev/null
+++ b/vhosts/blog/content/posts/2023-04-01/implementation-of-minimal-png-image-encoder.xml
@@ -0,0 +1,607 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<article xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0">
+ <info>
+ <title>PNG 画像の最小構成エンコーダを実装する</title>
+ <abstract>
+ PNG 画像として valid な範囲で最大限手抜きしたエンコーダを書く。
+ </abstract>
+ <revhistory>
+ <revision>
+ <date>2023-04-01</date>
+ <revremark>公開</revremark>
+ </revision>
+ </revhistory>
+ </info>
+ <section xml:id="intro">
+ <title>はじめに</title>
+ <para>
+ この記事では、PNG 画像として valid な範囲で最大限手抜きしたエンコーダを書く。
+ PNG 画像に対応したビューアであれば読み込めるが、圧縮効率については一切考えない。
+ また、実装には Go 言語を使うが、Go の標準ライブラリにあるさまざまなアルゴリズム (PNG 画像に関係する範囲だと、zlib や CRC32、Adler-32 など) は使わない。
+ </para>
+ </section>
+ <section xml:id="basic-structure-of-png">
+ <title>PNG ファイルの基本構造</title>
+ <para>
+ PNG ファイルの基本構造は次のようになっている。
+ </para>
+ <orderedlist>
+ <listitem>PNG signature</listitem>
+ <listitem>IHDR chunk</listitem>
+ <listitem>任意個の chunk</listitem>
+ <listitem>IEND chunk</listitem>
+ </orderedlist>
+ <para>
+ Chunk には画像データを入れる IDAT chunk、パレットデータを入れる PLTE chunk、テキストデータを入れる tEXt chunk などがあるが、
+ 今回は最小構成ということで IDAT chunk (と IHDR chunk と IEND chunk) のみを用いる。
+ </para>
+ <para>
+ 次節で、それぞれの具体的な構造を確認しつつ実装していく。
+ </para>
+ </section>
+ <section xml:id="implement-png-encoder">
+ <title>PNG のエンコーダを実装する</title>
+ <para>
+ 以下のソースコードをベースにする。
+ 今回 PNG のデコーダは扱わないので、読み込みには Go の標準ライブラリ <literal>image/png</literal> を用いる。
+ </para>
+ <programlisting language="go" linenumbering="unnumbered">
+ <![CDATA[
+ package main
+
+ import (
+ "image"
+ _ "image/png"
+ "io"
+ "os"
+ )
+
+ func main() {
+ inFile, err := os.Open("input.png")
+ if err != nil {
+ panic(err)
+ }
+ defer inFile.Close()
+
+ img, _, err := image.Decode(inFile)
+ if err != nil {
+ panic(err)
+ }
+
+ outFile, err := os.Create("output.png")
+ if err != nil {
+ panic(err)
+ }
+ defer outFile.Close()
+
+ writePng(outFile, img)
+ }
+
+ func writePng(w io.Writer, img image.Image) {
+ width := uint32(img.Bounds().Dx())
+ height := uint32(img.Bounds().Dy())
+ writeSignature(w)
+ writeChunkIhdr(w, width, height)
+ writeChunkIdat(w, width, height, img)
+ writeChunkIend(w)
+ }
+ ]]>
+ </programlisting>
+ <para>
+ 以降は、<literal>writeSignature</literal> や <literal>writeChunkIhdr</literal> などを実装していく。
+ </para>
+ <section xml:id="implement-png-encoder--png-signature">
+ <title>PNG signature</title>
+ <para>
+ PNG signature は、PNG 画像の先頭に固定で付与されるバイト列で、8 バイトからなる。
+ </para>
+ <orderedlist>
+ <listitem>0x89</listitem>
+ <listitem>0x50 (ASCII コードで「P」)</listitem>
+ <listitem>0x4E (ASCII コードで「N」)</listitem>
+ <listitem>0x47 (ASCII コードで「G」)</listitem>
+ <listitem>0x0D (ASCII コードで CR)</listitem>
+ <listitem>0x0A (ASCII コードで LF)</listitem>
+ <listitem>0x1A (ASCII コードで EOF)</listitem>
+ <listitem>0x0A (ASCII コードで LF)</listitem>
+ </orderedlist>
+ <para>
+ CRLF や LF は、送信中に改行コードの変換が誤っておこなわれていないかどうかを検知するのに使われる。
+ </para>
+ <para>
+ <literal>writeSignature</literal> の実装はこちら:
+ </para>
+ <programlisting language="go" linenumbering="unnumbered">
+ <![CDATA[
+ import "encoding/binary"
+
+ func writeSignature(w io.Writer) {
+ sig := [8]uint8{
+ 0x89,
+ 0x50, // P
+ 0x4E, // N
+ 0x47, // G
+ 0x0D, // CR
+ 0x0A, // LF
+ 0x1A, // EOF (^Z)
+ 0x0A, // LF
+ }
+ binary.Write(w, binary.BigEndian, sig)
+ }
+ ]]>
+ </programlisting>
+ <para>
+ <literal>encoding/binary</literal> パッケージの <literal>binary.Write</literal> を使い、固定の 8 バイトを書き込む。
+ </para>
+ </section>
+ <section xml:id="implement-png-encoder--structure-of-chunk">
+ <title>Chunk の構造</title>
+ <para>
+ IHDR chunk に進む前に、chunk 一般の構造を確認する。
+ </para>
+ <orderedlist>
+ <listitem>Length: chunk data のバイト長 (符号なし 4 バイト整数)</listitem>
+ <listitem>Chunk type: chunk の種類を示す 4 バイトからなる名前</listitem>
+ <listitem>Chunk data: 実際のデータ。0 バイトでもよい</listitem>
+ <listitem>CRC: chunk type と chunk data の CRC (符号なし 4 バイト整数)</listitem>
+ </orderedlist>
+ <para>
+ CRC (Cyclic Redundancy Check) は誤り検出符号の一種。Go 言語では <literal>hash/crc32</literal> パッケージにあるが、今回はこれも自前で実装する。PNG の仕様書に C 言語のサンプルコードが載っている (<link xl:href="https://www.w3.org/TR/png/#D-CRCAppendix">D. Sample CRC implementation</link>) ので、これを Go に移植する。
+ </para>
+ <programlisting language="go" linenumbering="unnumbered">
+ <![CDATA[
+ var (
+ crcTable [256]uint32
+ crcTableComputed bool
+ )
+
+ func makeCrcTable() {
+ for n := 0; n < 256; n++ {
+ c := uint32(n)
+ for k := 0; k < 8; k++ {
+ if (c & 1) != 0 {
+ c = 0xEDB88320 ^ (c >> 1)
+ } else {
+ c = c >> 1
+ }
+ }
+ crcTable[n] = c
+ }
+ crcTableComputed = true
+ }
+
+ func updateCrc(crc uint32, buf []byte) uint32 {
+ if !crcTableComputed {
+ makeCrcTable()
+ }
+
+ c := crc
+ for n := 0; n < len(buf); n++ {
+ c = crcTable[(c^uint32(buf[n]))&0xFF] ^ (c >> 8)
+ }
+ return c
+ }
+
+ func crc(buf []byte) uint32 {
+ return updateCrc(0xFFFFFFFF, buf) ^ 0xFFFFFFFF
+ }
+ ]]>
+ </programlisting>
+ <para>
+ できた <literal>crc</literal> 関数を使って、chunk 一般を書き込む関数も用意しておこう。
+ </para>
+ <programlisting language="go" linenumbering="unnumbered">
+ <![CDATA[
+ func writeChunk(w io.Writer, chunkType string, data []byte) {
+ typeAndData := make([]byte, 0, len(chunkType)+len(data))
+ typeAndData = append(typeAndData, []byte(chunkType)...)
+ typeAndData = append(typeAndData, data...)
+
+ binary.Write(w, binary.BigEndian, uint32(len(data)))
+ binary.Write(w, binary.BigEndian, typeAndData)
+ binary.Write(w, binary.BigEndian, crc(typeAndData))
+ }
+ ]]>
+ </programlisting>
+ <para>
+ 仕様どおり、<literal>chunkType</literal> と <literal>data</literal> から CRC を計算し、<literal>data</literal> の長さと合わせて書き込んでいる。
+ PNG では基本的に big endian を使うことに注意する。
+ </para>
+ <para>
+ 準備ができたところで、具体的な chunk をエンコードしていく。
+ </para>
+ </section>
+ <section xml:id="implement-png-encoder--ihdr-chunk">
+ <title>IHDR chunk</title>
+ <para>
+ IHDR chunk は最初に配置される chunk である。次のようなデータからなる。
+ </para>
+ <orderedlist>
+ <listitem>画像の幅 (符号なし 4 バイト整数)</listitem>
+ <listitem>画像の高さ (符号なし 4 バイト整数)</listitem>
+ <listitem>
+ ビット深度 (符号なし 1 バイト整数)
+ <itemizedlist>
+ <listitem>1 色に使うビット数。1 ピクセルに 24 bit 使う truecolor 画像では 8 になる</listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ 色タイプ (符号なし 1 バイト整数)
+ <itemizedlist>
+ <listitem>0: グレースケール</listitem>
+ <listitem>2: Truecolor (今回はこれに決め打ち)</listitem>
+ <listitem>3: パレットのインデックス</listitem>
+ <listitem>4: グレースケール + アルファ</listitem>
+ <listitem>6: Truecolor + アルファ</listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ 圧縮方式 (符号なし 1 バイト整数)
+ <itemizedlist>
+ PNG の仕様書に 0 しか定義されていないので 0 で固定
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ フィルタ方式 (符号なし 1 バイト整数)
+ <itemizedlist>
+ PNG の仕様書に 0 しか定義されていないので 0 で固定
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ インターレース方式 (符号なし 1 バイト整数)
+ <itemizedlist>
+ 今回はインターレースしないので 0
+ </itemizedlist>
+ </listitem>
+ </orderedlist>
+ <para>
+ 今回ほとんどのデータは決め打ちするので、データに応じて変わるのは width と height だけになる。コードは次のようになる。
+ </para>
+ <programlisting language="go" linenumbering="unnumbered">
+ <![CDATA[
+ import "bytes"
+
+ func writeChunkIhdr(w io.Writer, width, height uint32) {
+ var buf bytes.Buffer
+ binary.Write(&buf, binary.BigEndian, width)
+ binary.Write(&buf, binary.BigEndian, height)
+ binary.Write(&buf, binary.BigEndian, uint8(8))
+ binary.Write(&buf, binary.BigEndian, uint8(2))
+ binary.Write(&buf, binary.BigEndian, uint8(0))
+ binary.Write(&buf, binary.BigEndian, uint8(0))
+ binary.Write(&buf, binary.BigEndian, uint8(0))
+
+ writeChunk(w, "IHDR", buf.Bytes())
+ }
+ ]]>
+ </programlisting>
+ </section>
+ <section xml:id="implement-png-encoder--idat-chunk">
+ <title>IDAT chunk</title>
+ <para>
+ IDAT chunk は、実際の画像データが格納された chunk である。IDAT chunk は deflate アルゴリズムにより圧縮され、zlib 形式で格納される。
+ </para>
+ <section xml:id="implement-png-encoder--idat-chunk--zlib">
+ <title>Zlib</title>
+ <para>
+ まずは zlib について確認する。おおよそ次のような構造になっている。
+ </para>
+ <orderedlist>
+ <listitem>固定で 0x78 (符号なし 1 バイト整数)</listitem>
+ <listitem>固定で 0x01 (符号なし 1 バイト整数)</listitem>
+ <listitem>データ</listitem>
+ <listitem>データの Adler-32</listitem>
+ </orderedlist>
+ <para>
+ 最初の 2 バイトにも意味はあるが、PNG では固定で構わない。
+ </para>
+ <para>
+ Adler-32 も CRC と同じく誤り検出符号である。こちらも zlib の仕様書に C 言語でサンプルコードが記載されている (<link xl:href="https://www.rfc-editor.org/rfc/rfc1950#section-9">9. Appendix: Sample code</link>) ので、Go に移植する。
+ </para>
+ <programlisting language="go" linenumbering="unnumbered">
+ <![CDATA[
+ const adler32Base = 65521
+
+ func updateAdler32(adler uint32, buf []byte) uint32 {
+ s1 := adler & 0xFFFF
+ s2 := (adler >> 16) & 0xFFFF
+
+ for n := 0; n < len(buf); n++ {
+ s1 = (s1 + uint32(buf[n])) % adler32Base
+ s2 = (s2 + s1) % adler32Base
+ }
+ return (s2 << 16) + s1
+ }
+
+ func adler32(buf []byte) uint32 {
+ return updateAdler32(1, buf)
+ }
+ ]]>
+ </programlisting>
+ <para>
+ 「データ」の部分には圧縮したデータが入るのだが、真面目に deflate アルゴリズムを実装する必要はない。Zlib には無圧縮のデータブロックを格納することができるので、これを使う。本来は、データの圧縮効率の悪いランダムなデータをそのまま格納するためのものだが、今回は deflate の実装をサボるために使う。
+ </para>
+ <para>
+ 1 つの無圧縮ブロックには 65535 (2<superscript>16</superscript> - 1) バイトまで格納できる。それぞれのブロックは次のような構成になっている。
+ </para>
+ <orderedlist>
+ <listitem>最終ブロックなら 1、そうでなければ 0 (符号なし 1 バイト整数)</listitem>
+ <listitem>ブロックのバイト長 (符号なし 2 バイト整数)</listitem>
+ <listitem>ブロックのバイト長の 1 の補数、あるいはビット反転 (符号なし 2 バイト整数)</listitem>
+ <listitem>データ (最大 65535 バイト)</listitem>
+ </orderedlist>
+ <para>
+ 実際にこの手抜き zlib を実装したものがこちら:
+ </para>
+ <programlisting language="go" linenumbering="unnumbered">
+ <![CDATA[
+ func encodeZlib(data []byte) []byte {
+ var buf bytes.Buffer
+
+ binary.Write(&buf, binary.BigEndian, uint8(0x78))
+ binary.Write(&buf, binary.BigEndian, uint8(0x01))
+ blockSize := 65535
+ isFinalBlock := false
+ for i := 0; !isFinalBlock; i++ {
+ var block []byte
+ if len(data) <= (i+1)*blockSize {
+ block = data[i*blockSize:]
+ isFinalBlock = true
+ } else {
+ block = data[i*blockSize : (i+1)*blockSize]
+ }
+ binary.Write(&buf, binary.BigEndian, isFinalBlock)
+ binary.Write(&buf, binary.LittleEndian, uint16(len(block)))
+ binary.Write(&buf, binary.LittleEndian, uint16(^len(block)))
+ binary.Write(&buf, binary.LittleEndian, block)
+ }
+ binary.Write(&buf, binary.BigEndian, adler32(data))
+
+ return buf.Bytes()
+ }
+ ]]>
+ </programlisting>
+ </section>
+ <section xml:id="implement-png-encoder--idat-chunk--image-data">
+ <title>画像データ</title>
+ <para>
+ では次に、zlib 形式で格納するデータを用意する。PNG 画像は次のような順にスキャンする。
+ 画像の左上のピクセルから同じ行を横にスキャンしていき、一番右まで到達したら次の行の左に向かう。
+ 右下のピクセルまで行けば終わり。要は Z 字型に進んでいく。
+ </para>
+ <para>
+ また、それぞれの行の先頭には、圧縮のためのフィルタタイプを指定する。
+ ただ、今回はその実装を省略するために、常にフィルタ 0 (何も加工しない) を使う。
+ </para>
+ <para>
+ 先ほどの <literal>encodeZlib</literal> も使って実際に実装したものがこちら:
+ </para>
+ <programlisting language="go" linenumbering="unnumbered">
+ <![CDATA[
+ func writeChunkIdat(w io.Writer, width, height uint32, img image.Image) {
+ var pixels bytes.Buffer
+ for y := uint32(0); y < height; y++ {
+ binary.Write(&pixels, binary.BigEndian, uint8(0))
+ for x := uint32(0); x < width; x++ {
+ r, g, b, _ := img.At(int(x), int(y)).RGBA()
+ binary.Write(&pixels, binary.BigEndian, uint8(r))
+ binary.Write(&pixels, binary.BigEndian, uint8(g))
+ binary.Write(&pixels, binary.BigEndian, uint8(b))
+ }
+ }
+
+ writeChunk(w, "IDAT", encodeZlib(pixels.Bytes()))
+ }
+ ]]>
+ </programlisting>
+ </section>
+ </section>
+ <section xml:id="implement-png-encoder--iend-chunk">
+ <title>IEND chunk</title>
+ <para>
+ 最後に IEND chunk を書き込む。これは PNG 画像の最後に配置される chunk で、PNG のデコーダはこの chunk に出会うとそこでデコードを停止する。
+ </para>
+ <para>
+ 特に追加のデータはなく、必要なのは chunk type の <literal>IEND</literal> くらいなので実装は簡単:
+ </para>
+ <programlisting language="go" linenumbering="unnumbered">
+ <![CDATA[
+ func writeChunkIend(w io.Writer) {
+ writeChunk(w, "IEND", nil)
+ }
+ ]]>
+ </programlisting>
+ </section>
+ </section>
+ <section xml:id="outro">
+ <title>おわりに</title>
+ <para>
+ 最後に全ソースコードを再掲しておく。
+ </para>
+ <programlisting language="go" linenumbering="unnumbered">
+ <![CDATA[
+ package main
+
+ import (
+ "bytes"
+ "encoding/binary"
+ "image"
+ _ "image/png"
+ "io"
+ "os"
+ )
+
+ func main() {
+ inFile, err := os.Open("input.png")
+ if err != nil {
+ panic(err)
+ }
+ defer inFile.Close()
+
+ img, _, err := image.Decode(inFile)
+ if err != nil {
+ panic(err)
+ }
+
+ outFile, err := os.Create("output.png")
+ if err != nil {
+ panic(err)
+ }
+ defer outFile.Close()
+
+ writePng(outFile, img)
+ }
+
+ func writePng(w io.Writer, img image.Image) {
+ width := uint32(img.Bounds().Dx())
+ height := uint32(img.Bounds().Dy())
+ writeSignature(w)
+ writeChunkIhdr(w, width, height)
+ writeChunkIdat(w, width, height, img)
+ writeChunkIend(w)
+ }
+
+ func writeSignature(w io.Writer) {
+ sig := [8]uint8{
+ 0x89,
+ 0x50, // P
+ 0x4E, // N
+ 0x47, // G
+ 0x0D, // CR
+ 0x0A, // LF
+ 0x1A, // EOF (^Z)
+ 0x0A, // LF
+ }
+ binary.Write(w, binary.BigEndian, sig)
+ }
+
+ func writeChunkIhdr(w io.Writer, width, height uint32) {
+ var buf bytes.Buffer
+ binary.Write(&buf, binary.BigEndian, width)
+ binary.Write(&buf, binary.BigEndian, height)
+ binary.Write(&buf, binary.BigEndian, uint8(8))
+ binary.Write(&buf, binary.BigEndian, uint8(2))
+ binary.Write(&buf, binary.BigEndian, uint8(0))
+ binary.Write(&buf, binary.BigEndian, uint8(0))
+ binary.Write(&buf, binary.BigEndian, uint8(0))
+
+ writeChunk(w, "IHDR", buf.Bytes())
+ }
+
+ func writeChunkIdat(w io.Writer, width, height uint32, img image.Image) {
+ var pixels bytes.Buffer
+ for y := uint32(0); y < height; y++ {
+ binary.Write(&pixels, binary.BigEndian, uint8(0))
+ for x := uint32(0); x < width; x++ {
+ r, g, b, _ := img.At(int(x), int(y)).RGBA()
+ binary.Write(&pixels, binary.BigEndian, uint8(r))
+ binary.Write(&pixels, binary.BigEndian, uint8(g))
+ binary.Write(&pixels, binary.BigEndian, uint8(b))
+ }
+ }
+
+ writeChunk(w, "IDAT", encodeZlib(pixels.Bytes()))
+ }
+
+ func encodeZlib(data []byte) []byte {
+ var buf bytes.Buffer
+
+ binary.Write(&buf, binary.BigEndian, uint8(0x78))
+ binary.Write(&buf, binary.BigEndian, uint8(0x01))
+ blockSize := 65535
+ isFinalBlock := false
+ for i := 0; !isFinalBlock; i++ {
+ var block []byte
+ if len(data) <= (i+1)*blockSize {
+ block = data[i*blockSize:]
+ isFinalBlock = true
+ } else {
+ block = data[i*blockSize : (i+1)*blockSize]
+ }
+ binary.Write(&buf, binary.BigEndian, isFinalBlock)
+ binary.Write(&buf, binary.LittleEndian, uint16(len(block)))
+ binary.Write(&buf, binary.LittleEndian, uint16(^len(block)))
+ binary.Write(&buf, binary.LittleEndian, block)
+ }
+ binary.Write(&buf, binary.BigEndian, adler32(data))
+
+ return buf.Bytes()
+ }
+
+ func writeChunkIend(w io.Writer) {
+ writeChunk(w, "IEND", nil)
+ }
+
+ func writeChunk(w io.Writer, chunkType string, data []byte) {
+ typeAndData := make([]byte, 0, len(chunkType)+len(data))
+ typeAndData = append(typeAndData, []byte(chunkType)...)
+ typeAndData = append(typeAndData, data...)
+
+ binary.Write(w, binary.BigEndian, uint32(len(data)))
+ binary.Write(w, binary.BigEndian, typeAndData)
+ binary.Write(w, binary.BigEndian, crc(typeAndData))
+ }
+
+ var (
+ crcTable [256]uint32
+ crcTableComputed bool
+ )
+
+ func makeCrcTable() {
+ for n := 0; n < 256; n++ {
+ c := uint32(n)
+ for k := 0; k < 8; k++ {
+ if (c & 1) != 0 {
+ c = 0xEDB88320 ^ (c >> 1)
+ } else {
+ c = c >> 1
+ }
+ }
+ crcTable[n] = c
+ }
+ crcTableComputed = true
+ }
+
+ func updateCrc(crc uint32, buf []byte) uint32 {
+ if !crcTableComputed {
+ makeCrcTable()
+ }
+
+ c := crc
+ for n := 0; n < len(buf); n++ {
+ c = crcTable[(c^uint32(buf[n]))&0xFF] ^ (c >> 8)
+ }
+ return c
+ }
+
+ func crc(buf []byte) uint32 {
+ return updateCrc(0xFFFFFFFF, buf) ^ 0xFFFFFFFF
+ }
+
+ const adler32Base = 65521
+
+ func updateAdler32(adler uint32, buf []byte) uint32 {
+ s1 := adler & 0xFFFF
+ s2 := (adler >> 16) & 0xFFFF
+
+ for n := 0; n < len(buf); n++ {
+ s1 = (s1 + uint32(buf[n])) % adler32Base
+ s2 = (s2 + s1) % adler32Base
+ }
+ return (s2 << 16) + s1
+ }
+
+ func adler32(buf []byte) uint32 {
+ return updateAdler32(1, buf)
+ }
+ ]]>
+ </programlisting>
+ </section>
+ <section xml:id="references">
+ <title>参考</title>
+ <itemizedlist>
+ <listitem><link xl:href="https://www.w3.org/TR/png">Portable Network Graphics (PNG) Specification (Third Edition)</link></listitem>
+ <listitem><link xl:href="https://www.rfc-editor.org/rfc/rfc1950">ZLIB Compressed Data Format Specification version 3.3</link></listitem>
+ </itemizedlist>
+ </section>
+</article>
diff --git a/vhosts/blog/content/posts/2023-04-04/phperkaigi-2023-report.xml b/vhosts/blog/content/posts/2023-04-04/phperkaigi-2023-report.xml
new file mode 100644
index 00000000..18bc96ce
--- /dev/null
+++ b/vhosts/blog/content/posts/2023-04-04/phperkaigi-2023-report.xml
@@ -0,0 +1,187 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<article xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0">
+ <info>
+ <title>PHPerKaigi 2023 参加レポ</title>
+ <abstract>
+ 2023-03-23 から 2023-03-25 にかけて開催された、PHPerKaigi 2023 に参加した。
+ </abstract>
+ <keywordset>
+ <keyword>conference</keyword>
+ <keyword>php</keyword>
+ <keyword>phperkaigi</keyword>
+ </keywordset>
+ <revhistory>
+ <revision>
+ <date>2023-04-04</date>
+ <revremark>公開</revremark>
+ </revision>
+ <revision>
+ <date>2023-06-28</date>
+ <revremark>トークセッションの記事版の執筆を中止</revremark>
+ </revision>
+ </revhistory>
+ </info>
+ <section xml:id="intro">
+ <title>はじめに</title>
+ <para>
+ 2023-03-23 から 2023-03-25 にかけて開催された、<link xl:href="https://phperkaigi.jp/2023/">PHPerKaigi 2023</link> に参加した。
+ 今年は 2つのセッションのスピーカーとして、また、当日スタッフとして参加した。
+ </para>
+ <para>
+ 昨年、一昨年の参加レポはこちら:
+ </para>
+ <itemizedlist>
+ <listitem><link xl:href="/posts/2022-05-01/phperkaigi-2022/">PHPerKaigi 2022</link></listitem>
+ <listitem><link xl:href="/posts/2021-03-30/phperkaigi-2021/">PHPerKaigi 2021</link></listitem>
+ </itemizedlist>
+ </section>
+ <section xml:id="as-speaker">
+ <title>スピーカーとして</title>
+ <para>
+ これまでとの最大の違いとして、今回はスピーカーとして登壇した。まずはそれについて書く。2つのセッションで登壇した。
+ </para>
+ <itemizedlist>
+ <listitem>
+ 詳説「参照」:PHP 処理系の実装から参照を理解する
+ <itemizedlist>
+ <listitem><link xl:href="https://fortee.jp/phperkaigi-2023/proposal/95e4dd94-5fc7-40fe-9e1a-230e36404cbe">プロポーザル</link></listitem>
+ <listitem><link xl:href="/slides/2023-03-24/phperkaigi-2023/">スライド</link></listitem>
+ <listitem>解説記事 (執筆中) → 追記: 記事版の執筆は諦めた</listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ PHPerチャレンジ解説セッション - デジタルサーカス株式会社
+ <itemizedlist>
+ <listitem><link xl:href="https://fortee.jp/phperkaigi-2023/proposal/524c9dca-1d70-4b32-a939-9c73ffe5cb48">プロポーザル</link></listitem>
+ <listitem><link xl:href="/slides/2023-03-25/phperkaigi-2023-tokens/">スライド</link></listitem>
+ <listitem>解説記事 (執筆中) → 追記: 記事版の執筆は諦めた</listitem>
+ </itemizedlist>
+ </listitem>
+ </itemizedlist>
+ <para>
+ PHPer チャレンジの話については後述する。
+ 参照については、PHP を書き始めた頃からずっと疑問に思っていたので、仕組みを理解する良い機会となった。
+ </para>
+ </section>
+ <section xml:id="as-staff">
+ <title>当日スタッフとして</title>
+ <para>
+ 今回はスピーカーのみならず当日スタッフとしても参加した。
+ カンファレンスのスタッフとしての参加は初めてだったが、初参加のスタッフでもスムーズに作業ができるような仕組みが整えられていた。
+ </para>
+ <para>
+ PHPerKaigi は一般参加者の目線でもよくできたカンファレンスだなあという印象だったのだが、よりその思いを強くした。
+ なんとスタッフにとってもよくできたカンファレンスなのである。
+ </para>
+ <para>
+ 反省点は私自身の最大 HP がまったく足りていなかったことで、次の機会には最後まで動けるようにしたいところである。
+ </para>
+ </section>
+ <section xml:id="as-attendee">
+ <title>参加者として</title>
+ <section xml:id="as-attendee--recommended-sessions">
+ <title>おすすめセッション</title>
+ <para>
+ 5つのセッションを厳選した。
+ </para>
+ <para>
+ <link xl:href="https://fortee.jp/phperkaigi-2023/proposal/f7f2f18a-e6b0-47e4-ade0-e324f72428ae">ブラウザの向こう側で「200 OK」を返すまでに何が起きているのか調べてみた</link>
+ </para>
+ <para>
+ Web に関わるなら、バックエンドでもフロントエンドでも知っておいてほしい知識。
+ タイトルを見て「こんな話だろうな」と想像がつくレベルなら見なくてもいいかも。
+ </para>
+ <para>
+ <link xl:href="https://fortee.jp/phperkaigi-2023/proposal/280706e0-7158-4237-8202-c9d64330b96f">PHPで学ぶ "Cacheの距離" の話</link>
+ </para>
+ <para>
+ これも上セッションと同様に、基礎を抑えられる良いセッション。
+ </para>
+ <para>
+ <link xl:href="https://fortee.jp/phperkaigi-2023/proposal/ad3ba31c-0214-4557-a0df-3755db8ed8cc">防衛的 PHP: 多様性を生き抜くための PHP 入門</link>
+ </para>
+ <para>
+ 静的解析ツールの話。静的解析は PHP のみならず最近の動的言語の一大潮流なので、逃れられない。
+ </para>
+ <para>
+ <link xl:href="https://fortee.jp/phperkaigi-2023/proposal/e00788a4-ef25-49ee-b254-9d2b53e19633">PHPの最高機能、配列を捨てよう!!</link>
+ </para>
+ <para>
+ 実はこれも上のセッションと同様の話。
+ PHP の静的解析ツールは配列にも (無理矢理) 型が付けられるものが多いが、実行時にも検査できるという点において専用のクラスを作る方が優れている。
+ </para>
+ <para>
+ <link xl:href="https://fortee.jp/phperkaigi-2023/proposal/7e212cb2-be37-43e8-b6ee-5236d259fcbf">時間を気にせず普通にカンニングもしつつ ISUCON12 本選問題を PHP でやってみる</link>
+ </para>
+ <para>
+ 個人的に最も楽しみにしていたセッションであり、今回のモリアガリトーク賞 (盛り上がったセッションに運営側から贈られる賞) でもある。
+ ネタバレになるが、最終的に (Go で実装された) 本戦優勝スコアを超えている。
+ </para>
+ </section>
+ <section xml:id="as-attendee--phper-challenge">
+ <title>PHPer チャレンジ</title>
+ <para>
+ 昨年に引き続き、弊社デジタルサーカス株式会社からのトークン問題の作題を担当した。
+ また、今年はさらに作成した問題を解説するセッションにも登壇した。
+ 今年のトークンは、昨年の PHPerKaigi 2022 が終わった段階から作り始め、約半年かけて制作した。
+ </para>
+ <para>
+ 問題の制作中は大変楽しかったが、まあやりすぎた。
+ いかに超絶技巧を凝らすかに注力してしまい、解く楽しさという観点を失ってしまったきらいがある。
+ </para>
+ <para>
+ (WIP: 解説ブログ記事執筆中。終わったらここにリンク)
+ </para>
+ </section>
+ <section xml:id="as-attendee--random-thoughts">
+ <title>雑多な感想</title>
+ <para>
+ なんかいろいろ。
+ </para>
+ <itemizedlist>
+ <listitem>マカロンおいしかった</listitem>
+ <listitem>\ペチパー/</listitem>
+ <listitem>名札便利</listitem>
+ <listitem>\ペチパー/</listitem>
+ <listitem>傘袋便利</listitem>
+ <listitem>\ペチパー/</listitem>
+ <listitem>パーカーのデザイン良き</listitem>
+ </itemizedlist>
+ <para>
+ (あとから見返して自分でもわけがわからなくなりそうなので書いておくと、会場に入場する際に名札をタッチすると小桜エツコさんの声で「ペチパー」という音声が流れるギミックがあった)
+ </para>
+ </section>
+ </section>
+ <section xml:id="outro">
+ <title>おわりに</title>
+ <para>
+ <link xl:href="/posts/2022-05-01/phperkaigi-2022/#section--next-year">去年の参加レポ</link>では、来年の目標として次を挙げた。
+ </para>
+ <blockquote>
+ <itemizedlist>
+ <listitem>プロポーザルを出す</listitem>
+ <listitem>PHPer チャレンジのトークン問題を 5題作成する</listitem>
+ <listitem>現地に行く</listitem>
+ <listitem>PHPer チャレンジで圧勝する</listitem>
+ </itemizedlist>
+ </blockquote>
+ <para>
+ プロポーザルに関しては採択されて登壇できたし、PHPer チャレンジは解説もおこなった。また、現地に行くだけでなく、当日スタッフとして参加した。
+ 4つ目の PHPer チャレンジに関しては、今年は参加していない。
+ スタッフをやりながらだと入力する時間も探す時間も取れそうになかったのと、スタッフをやっている関係で少しだけ早く入手してしまうトークンがいくつか存在していたため。
+ </para>
+ <para>
+ カンファレンス全体の感想についてだが、大規模なカンファレンスにオフラインで参加するのは今回が初めてだったので、その話をしたい。
+ </para>
+ <para>
+ オンラインとオフラインだと体験が別物になる。そもそもが似て非なるものなのだ。
+ 向き不向きはあるだろうが、オンラインしか参加したことのないという方は、一度現地参加してみてはいかがだろうか。
+ </para>
+ <para>
+ さて、参加レポは去年も一昨年もこの言葉で締め括っているので、今年もそれで終わろうと思う。
+ </para>
+ <para>
+ ではまた来年。
+ </para>
+ </section>
+</article>
diff --git a/vhosts/blog/content/posts/2023-06-25/phpconfuk-2023-report.xml b/vhosts/blog/content/posts/2023-06-25/phpconfuk-2023-report.xml
new file mode 100644
index 00000000..d713773e
--- /dev/null
+++ b/vhosts/blog/content/posts/2023-06-25/phpconfuk-2023-report.xml
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<article xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0">
+ <info>
+ <title>PHP カンファレンス福岡 2023 参加レポ</title>
+ <abstract>
+ 2023-06-24 に開催された、PHP カンファレンス福岡に参加した。
+ </abstract>
+ <keywordset>
+ <keyword>conference</keyword>
+ <keyword>php</keyword>
+ <keyword>phpconfuk</keyword>
+ </keywordset>
+ <revhistory>
+ <revision>
+ <date>2023-06-25</date>
+ <revremark>公開</revremark>
+ </revision>
+ </revhistory>
+ </info>
+ <section xml:id="intro">
+ <title>はじめに</title>
+ <para>
+ 2023-06-24 に開催された、<link xl:href="https://phpcon.fukuoka.jp/2023/">PHP カンファレンス福岡 2023</link>に参加した。
+ また、その前日に催された、<link xl:href="https://connpass.com/event/282285/">非公式の前夜祭</link>にも参加した。
+ 前夜祭では、15分の登壇もおこなった。<link xl:href="/slides/2023-06-23/phpconfuk-2023-eve/">登壇の方の資料はこちら。</link>
+ </para>
+ </section>
+ <section xml:id="sessions-thoughts">
+ <title>セッションの感想</title>
+ <section xml:id="sessions-thoughts--eve">
+ <title>前夜祭</title>
+ <para>
+ ※セッションの題名と発表者名は、<link xl:href="https://connpass.com/event/282285/">前夜祭イベントの connpass ページ</link>から引用。
+ </para>
+ <itemizedlist>
+ <listitem>
+ スクラム(の一部)を導入してよくなったこと (asumikam さん)
+ <itemizedlist>
+ <listitem>
+ スクラムの「一部」を導入されたということでしたが、理想的な形で改善が進んでいるように見受けられました。
+ 特に、ブランチ運用やデプロイ頻度、フィードバックサイクルに大きく変化が起きているのは驚くべき成果だと感じました。
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ 地方の小さな勉強会を一番の活動舞台にする (tomio さん)
+ <itemizedlist>
+ <listitem>
+ すさまじいほどの「熱」を感じました。
+ 私自身、最近になってカンファレンスや勉強会への参加・登壇を活発におこなうようになったことで、頷く点が多かったです。
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section xml:id="sessions-thoughts--conference">
+ <title>カンファレンス</title>
+ <para>
+ ※セッションの題名と発表者名は、<link xl:href="https://fortee.jp/phpconfukuoka-2023/proposal/accepted">カンファレンスの fortee ページ</link>から引用。
+ </para>
+ <itemizedlist>
+ <listitem>
+ <link xl:href="https://fortee.jp/phpconfukuoka-2023/proposal/df5f06e8-900e-4e71-94d7-d0c3cc57a0ac">育成力 - エンジニアの才能を引き出す環境とチューターの立ち回り - (岡嵜 雄平 さん)</link>
+ <itemizedlist>
+ <listitem>
+ ちょうど弊チームに新規メンバがジョインしたばかりで、オンボーディングプロセスについて考えていたところの発表でした。
+ すぐにすべてを取り入れるというわけにはいきませんが、弊社での新人育成プロセスの改善につながるヒントをいくつか得られたと思います。
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ オブジェクト指向は本当に必要か? (たなかひさてる さん、こいほげ さん)
+ <itemizedlist>
+ <listitem>
+ ※当日 D ホールでおこなわれたアンカンファレンスセッションのため、正式タイトル・リンクなし
+ </listitem>
+ <listitem>
+ 私自身、「オブジェクト指向」については色々と言いたいことがあるのですが、だいたいツイートしたこれとこれです。
+ <itemizedlist>
+ <listitem>
+ 「オブジェクト指向の話は、パラダイムの異なる複数の言語に触れているかどうかで見え方がまったく異なる印象がある。OOPはどうでもいいです (※個人の感想です)」 (<link xl:href="https://twitter.com/nsfisis/status/1672502935983656960">Twitter のツイートへのリンク</link>)
+ </listitem>
+ <listitem>
+ 「OOPは現代の言語で考える意味はほぼない古いパラダイムだよという立場ですが、OOPについてあまり大っぴらに話してると色んなところから刺されそうなんですよね (Twitterは大っぴらじゃないんですか?)」 (<link xl:href="https://twitter.com/nsfisis/status/1672504892244787201">Twitter のツイートへのリンク</link>)
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ <link xl:href="https://fortee.jp/phpconfukuoka-2023/proposal/ae71f3a7-4c3c-4c87-8816-8426bcc8d325">その説明、コードコメントに書く?コミットメッセージに書く?プルリクエストに書く? (おかしょい/岡田正平 さん)</link>
+ <itemizedlist>
+ <listitem>
+ Twitter にもツイートしましたが、完全に自分の意見と一致していたので、とても共感できました。
+ 今後は社内のコードレビュー時に、こちらの資料を貼りつけることにします。
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </itemizedlist>
+ </section>
+ </section>
+ <section xml:id="outro">
+ <title>おわりに</title>
+ <para>
+ 居住地域から離れた場所への遠征参加は初めてだったが、大変楽しい (しかも勉強にもなる!) 体験だった。
+ 受け取った「熱」が冷める前に、自らの手を動かしていきたい。
+ </para>
+ </section>
+</article>
diff --git a/vhosts/blog/content/slides/2023-01-18/phpstudy-tokyo-148.xml b/vhosts/blog/content/slides/2023-01-18/phpstudy-tokyo-148.xml
new file mode 100644
index 00000000..f9ea4848
--- /dev/null
+++ b/vhosts/blog/content/slides/2023-01-18/phpstudy-tokyo-148.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<slide>
+ <info>
+ <title>明日のあなたの役に立たない PHP コーディング技法~polyglot~</title>
+ <event>
+ PHP 勉強会@東京 第148 回
+ </event>
+ <talktype>
+ LT
+ </talktype>
+ <link>/slides/2023-01-18/phpstudy-tokyo-148/slide.pdf</link>
+ <keywordset>
+ <keyword>php</keyword>
+ <keyword>phpstudy-tokyo</keyword>
+ </keywordset>
+ <revhistory>
+ <revision>
+ <date>2023-01-18</date>
+ <revremark>登壇</revremark>
+ </revision>
+ </revhistory>
+ </info>
+</slide>
diff --git a/vhosts/blog/content/slides/2023-01-18/phpstudy-tokyo-148/slide.pdf b/vhosts/blog/content/slides/2023-01-18/phpstudy-tokyo-148/slide.pdf
new file mode 100644
index 00000000..e50d08ef
--- /dev/null
+++ b/vhosts/blog/content/slides/2023-01-18/phpstudy-tokyo-148/slide.pdf
Binary files differ
diff --git a/vhosts/blog/content/slides/2023-02-15/phpstudy-tokyo-149.xml b/vhosts/blog/content/slides/2023-02-15/phpstudy-tokyo-149.xml
new file mode 100644
index 00000000..fba41d14
--- /dev/null
+++ b/vhosts/blog/content/slides/2023-02-15/phpstudy-tokyo-149.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<slide>
+ <info>
+ <title>PHPerKaigi 2023 のトークン問題でボツにした問題を供養する</title>
+ <event>
+ PHP 勉強会@東京 第149 回
+ </event>
+ <talktype>
+ LT
+ </talktype>
+ <link>/slides/2023-02-15/phpstudy-tokyo-149/slide.pdf</link>
+ <keywordset>
+ <keyword>php</keyword>
+ <keyword>phpstudy-tokyo</keyword>
+ </keywordset>
+ <revhistory>
+ <revision>
+ <date>2023-02-15</date>
+ <revremark>登壇</revremark>
+ </revision>
+ </revhistory>
+ </info>
+</slide>
diff --git a/vhosts/blog/content/slides/2023-02-15/phpstudy-tokyo-149/slide.pdf b/vhosts/blog/content/slides/2023-02-15/phpstudy-tokyo-149/slide.pdf
new file mode 100644
index 00000000..f51f6f81
--- /dev/null
+++ b/vhosts/blog/content/slides/2023-02-15/phpstudy-tokyo-149/slide.pdf
Binary files differ
diff --git a/vhosts/blog/content/slides/2023-03-15/phpstudy-tokyo-150.xml b/vhosts/blog/content/slides/2023-03-15/phpstudy-tokyo-150.xml
new file mode 100644
index 00000000..a5657847
--- /dev/null
+++ b/vhosts/blog/content/slides/2023-03-15/phpstudy-tokyo-150.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<slide>
+ <info>
+ <title>明日のあなたの役に立たない PHP コーディング技法~細長い FizzBuzz を書く~</title>
+ <event>
+ PHP 勉強会@東京 第150 回
+ </event>
+ <talktype>
+ LT
+ </talktype>
+ <link>/slides/2023-03-15/phpstudy-tokyo-150/slide.pdf</link>
+ <keywordset>
+ <keyword>php</keyword>
+ <keyword>phpstudy-tokyo</keyword>
+ </keywordset>
+ <revhistory>
+ <revision>
+ <date>2023-03-15</date>
+ <revremark>登壇</revremark>
+ </revision>
+ <revision>
+ <date>2023-03-18</date>
+ <revremark>2文字以下の関数が他にもあったので修正</revremark>
+ </revision>
+ </revhistory>
+ </info>
+</slide>
diff --git a/vhosts/blog/content/slides/2023-03-15/phpstudy-tokyo-150/slide.pdf b/vhosts/blog/content/slides/2023-03-15/phpstudy-tokyo-150/slide.pdf
new file mode 100644
index 00000000..fdc070c3
--- /dev/null
+++ b/vhosts/blog/content/slides/2023-03-15/phpstudy-tokyo-150/slide.pdf
Binary files differ
diff --git a/vhosts/blog/content/slides/2023-03-24/phperkaigi-2023.xml b/vhosts/blog/content/slides/2023-03-24/phperkaigi-2023.xml
new file mode 100644
index 00000000..0930525f
--- /dev/null
+++ b/vhosts/blog/content/slides/2023-03-24/phperkaigi-2023.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<slide>
+ <info>
+ <title>詳説「参照」PHP の参照を完全に理解する</title>
+ <event>
+ PHPerKaigi 2023
+ </event>
+ <talktype>
+ レギュラートーク
+ </talktype>
+ <link>/slides/2023-03-24/phperkaigi-2023/slide.pdf</link>
+ <keywordset>
+ <keyword>conference</keyword>
+ <keyword>php</keyword>
+ <keyword>phperkaigi</keyword>
+ </keywordset>
+ <revhistory>
+ <revision>
+ <date>2023-03-24</date>
+ <revremark>登壇</revremark>
+ </revision>
+ </revhistory>
+ </info>
+</slide>
diff --git a/vhosts/blog/content/slides/2023-03-24/phperkaigi-2023/slide.pdf b/vhosts/blog/content/slides/2023-03-24/phperkaigi-2023/slide.pdf
new file mode 100644
index 00000000..6d3d9c39
--- /dev/null
+++ b/vhosts/blog/content/slides/2023-03-24/phperkaigi-2023/slide.pdf
Binary files differ
diff --git a/vhosts/blog/content/slides/2023-03-25/phperkaigi-2023-tokens.xml b/vhosts/blog/content/slides/2023-03-25/phperkaigi-2023-tokens.xml
new file mode 100644
index 00000000..996dc837
--- /dev/null
+++ b/vhosts/blog/content/slides/2023-03-25/phperkaigi-2023-tokens.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<slide>
+ <info>
+ <title>PHPer チャレンジ解説 (デジタルサーカス株式会社)</title>
+ <event>
+ PHPerKaigi 2023
+ </event>
+ <talktype>
+ トークン解説セッション
+ </talktype>
+ <link>/slides/2023-03-25/phperkaigi-2023-tokens/slide.pdf</link>
+ <keywordset>
+ <keyword>conference</keyword>
+ <keyword>php</keyword>
+ <keyword>phperkaigi</keyword>
+ </keywordset>
+ <revhistory>
+ <revision>
+ <date>2023-03-25</date>
+ <revremark>登壇</revremark>
+ </revision>
+ </revhistory>
+ </info>
+</slide>
diff --git a/vhosts/blog/content/slides/2023-03-25/phperkaigi-2023-tokens/slide.pdf b/vhosts/blog/content/slides/2023-03-25/phperkaigi-2023-tokens/slide.pdf
new file mode 100644
index 00000000..1104b62b
--- /dev/null
+++ b/vhosts/blog/content/slides/2023-03-25/phperkaigi-2023-tokens/slide.pdf
Binary files differ
diff --git a/vhosts/blog/content/slides/2023-04-12/phpstudy-tokyo-151.xml b/vhosts/blog/content/slides/2023-04-12/phpstudy-tokyo-151.xml
new file mode 100644
index 00000000..ed59e136
--- /dev/null
+++ b/vhosts/blog/content/slides/2023-04-12/phpstudy-tokyo-151.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<slide>
+ <info>
+ <title>list でない array の末尾を探す</title>
+ <event>
+ PHP 勉強会@東京 第151 回
+ </event>
+ <talktype>
+ LT
+ </talktype>
+ <link>/slides/2023-04-12/phpstudy-tokyo-151/slide.pdf</link>
+ <keywordset>
+ <keyword>php</keyword>
+ <keyword>phpstudy-tokyo</keyword>
+ </keywordset>
+ <revhistory>
+ <revision>
+ <date>2023-04-12</date>
+ <revremark>登壇</revremark>
+ </revision>
+ </revhistory>
+ </info>
+</slide>
diff --git a/vhosts/blog/content/slides/2023-04-12/phpstudy-tokyo-151/slide.pdf b/vhosts/blog/content/slides/2023-04-12/phpstudy-tokyo-151/slide.pdf
new file mode 100644
index 00000000..422d9b8f
--- /dev/null
+++ b/vhosts/blog/content/slides/2023-04-12/phpstudy-tokyo-151/slide.pdf
Binary files differ
diff --git a/vhosts/blog/content/slides/2023-06-21/phpstudy-tokyo-153.xml b/vhosts/blog/content/slides/2023-06-21/phpstudy-tokyo-153.xml
new file mode 100644
index 00000000..fd332214
--- /dev/null
+++ b/vhosts/blog/content/slides/2023-06-21/phpstudy-tokyo-153.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<slide>
+ <info>
+ <title>テキストファイルの末尾には改行コードを入れよう</title>
+ <event>
+ PHP 勉強会@東京 第153 回
+ </event>
+ <talktype>
+ LT
+ </talktype>
+ <link>/slides/2023-06-21/phpstudy-tokyo-153/slide.pdf</link>
+ <keywordset>
+ <keyword>php</keyword>
+ <keyword>phpstudy-tokyo</keyword>
+ </keywordset>
+ <revhistory>
+ <revision>
+ <date>2023-06-21</date>
+ <revremark>登壇</revremark>
+ </revision>
+ </revhistory>
+ </info>
+</slide>
diff --git a/vhosts/blog/content/slides/2023-06-21/phpstudy-tokyo-153/slide.pdf b/vhosts/blog/content/slides/2023-06-21/phpstudy-tokyo-153/slide.pdf
new file mode 100644
index 00000000..53d14bac
--- /dev/null
+++ b/vhosts/blog/content/slides/2023-06-21/phpstudy-tokyo-153/slide.pdf
Binary files differ
diff --git a/vhosts/blog/content/slides/2023-06-23/phpconfuk-2023-eve.xml b/vhosts/blog/content/slides/2023-06-23/phpconfuk-2023-eve.xml
new file mode 100644
index 00000000..bfc1d393
--- /dev/null
+++ b/vhosts/blog/content/slides/2023-06-23/phpconfuk-2023-eve.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<slide>
+ <info>
+ <title>巨大なコードベースへ突撃するために</title>
+ <event>
+ PHP カンファレンス福岡 2023 前夜祭 (非公式)
+ </event>
+ <talktype>
+ レギュラートーク
+ </talktype>
+ <link>/slides/2023-06-23/phpconfuk-2023-eve/slide.pdf</link>
+ <keywordset>
+ <keyword>php</keyword>
+ <keyword>phpconfuk</keyword>
+ </keywordset>
+ <revhistory>
+ <revision>
+ <date>2023-06-23</date>
+ <revremark>登壇</revremark>
+ </revision>
+ </revhistory>
+ </info>
+</slide>
diff --git a/vhosts/blog/content/slides/2023-06-23/phpconfuk-2023-eve/slide.pdf b/vhosts/blog/content/slides/2023-06-23/phpconfuk-2023-eve/slide.pdf
new file mode 100644
index 00000000..648680e9
--- /dev/null
+++ b/vhosts/blog/content/slides/2023-06-23/phpconfuk-2023-eve/slide.pdf
Binary files differ
diff --git a/vhosts/blog/content/slides/2023-07-26/phpstudy-tokyo-154.xml b/vhosts/blog/content/slides/2023-07-26/phpstudy-tokyo-154.xml
new file mode 100644
index 00000000..8596d43b
--- /dev/null
+++ b/vhosts/blog/content/slides/2023-07-26/phpstudy-tokyo-154.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<slide>
+ <info>
+ <title>言語間で比較するエラーの通知と処理</title>
+ <event>
+ PHP 勉強会@東京 第154 回
+ </event>
+ <talktype>
+ レギュラートーク
+ </talktype>
+ <link>/slides/2023-07-26/phpstudy-tokyo-154/slide.pdf</link>
+ <keywordset>
+ <keyword>php</keyword>
+ <keyword>phpstudy-tokyo</keyword>
+ </keywordset>
+ <revhistory>
+ <revision>
+ <date>2023-07-26</date>
+ <revremark>登壇</revremark>
+ </revision>
+ </revhistory>
+ </info>
+</slide>
diff --git a/vhosts/blog/content/slides/2023-07-26/phpstudy-tokyo-154/slide.pdf b/vhosts/blog/content/slides/2023-07-26/phpstudy-tokyo-154/slide.pdf
new file mode 100644
index 00000000..e26c8d10
--- /dev/null
+++ b/vhosts/blog/content/slides/2023-07-26/phpstudy-tokyo-154/slide.pdf
Binary files differ
diff --git a/vhosts/blog/content/slides/2023-08-24/phpstudy-tokyo-155.xml b/vhosts/blog/content/slides/2023-08-24/phpstudy-tokyo-155.xml
new file mode 100644
index 00000000..1475c3cc
--- /dev/null
+++ b/vhosts/blog/content/slides/2023-08-24/phpstudy-tokyo-155.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<slide>
+ <info>
+ <title>PHP 3.0 の処理系のソースを読んでみる</title>
+ <event>
+ PHP 勉強会@東京 第155 回
+ </event>
+ <talktype>
+ LT
+ </talktype>
+ <link>/slides/2023-08-24/phpstudy-tokyo-155/slide.pdf</link>
+ <keywordset>
+ <keyword>php</keyword>
+ <keyword>phpstudy-tokyo</keyword>
+ </keywordset>
+ <revhistory>
+ <revision>
+ <date>2023-08-24</date>
+ <revremark>登壇</revremark>
+ </revision>
+ </revhistory>
+ </info>
+</slide>
diff --git a/vhosts/blog/content/slides/2023-08-24/phpstudy-tokyo-155/slide.pdf b/vhosts/blog/content/slides/2023-08-24/phpstudy-tokyo-155/slide.pdf
new file mode 100644
index 00000000..ead5c00d
--- /dev/null
+++ b/vhosts/blog/content/slides/2023-08-24/phpstudy-tokyo-155/slide.pdf
Binary files differ
diff --git a/vhosts/blog/deno.jsonc b/vhosts/blog/deno.jsonc
new file mode 100644
index 00000000..d44e9015
--- /dev/null
+++ b/vhosts/blog/deno.jsonc
@@ -0,0 +1,7 @@
+{
+ "importMap": "import_map.json",
+ "tasks": {
+ "check": "deno check nuldoc-src/main.ts && deno lint -- nuldoc-src/ && deno fmt --check -- nuldoc-src/",
+ "fmt": "deno fmt -- nuldoc-src",
+ }
+}
diff --git a/vhosts/blog/deno.lock b/vhosts/blog/deno.lock
new file mode 100644
index 00000000..7b9cfa17
--- /dev/null
+++ b/vhosts/blog/deno.lock
@@ -0,0 +1,84 @@
+{
+ "version": "2",
+ "remote": {
+ "https://deno.land/std@0.170.0/_util/asserts.ts": "d0844e9b62510f89ce1f9878b046f6a57bf88f208a10304aab50efcb48365272",
+ "https://deno.land/std@0.170.0/_util/os.ts": "8a33345f74990e627b9dfe2de9b040004b08ea5146c7c9e8fe9a29070d193934",
+ "https://deno.land/std@0.170.0/async/abortable.ts": "80b2ac399f142cc528f95a037a7d0e653296352d95c681e284533765961de409",
+ "https://deno.land/std@0.170.0/async/deadline.ts": "2c2deb53c7c28ca1dda7a3ad81e70508b1ebc25db52559de6b8636c9278fd41f",
+ "https://deno.land/std@0.170.0/async/debounce.ts": "60301ffb37e730cd2d6f9dadfd0ecb2a38857681bd7aaf6b0a106b06e5210a98",
+ "https://deno.land/std@0.170.0/async/deferred.ts": "77d3f84255c3627f1cc88699d8472b664d7635990d5358c4351623e098e917d6",
+ "https://deno.land/std@0.170.0/async/delay.ts": "5a9bfba8de38840308a7a33786a0155a7f6c1f7a859558ddcec5fe06e16daf57",
+ "https://deno.land/std@0.170.0/async/mod.ts": "7809ad4bb223e40f5fdc043e5c7ca04e0e25eed35c32c3c32e28697c553fa6d9",
+ "https://deno.land/std@0.170.0/async/mux_async_iterator.ts": "770a0ff26c59f8bbbda6b703a2235f04e379f73238e8d66a087edc68c2a2c35f",
+ "https://deno.land/std@0.170.0/async/pool.ts": "6854d8cd675a74c73391c82005cbbe4cc58183bddcd1fbbd7c2bcda42b61cf69",
+ "https://deno.land/std@0.170.0/async/retry.ts": "e8e5173623915bbc0ddc537698fa418cf875456c347eda1ed453528645b42e67",
+ "https://deno.land/std@0.170.0/async/tee.ts": "3a47cc4e9a940904fd4341f0224907e199121c80b831faa5ec2b054c6d2eff5e",
+ "https://deno.land/std@0.170.0/collections/_utils.ts": "fd759867be7a0047a1fa89ec89f7b58ebe3f2f7f089a8f4e416eb30c5d764868",
+ "https://deno.land/std@0.170.0/collections/deep_merge.ts": "0303cca7697646c5464ecb3337d494602056babae4f09baf6619f1043ba7eb6d",
+ "https://deno.land/std@0.170.0/crypto/_fnv/fnv32.ts": "aa9bddead8c6345087d3abd4ef35fb9655622afc333fc41fff382b36e64280b5",
+ "https://deno.land/std@0.170.0/crypto/_fnv/fnv64.ts": "625d7e7505b6cb2e9801b5fd6ed0a89256bac12b2bbb3e4664b85a88b0ec5bef",
+ "https://deno.land/std@0.170.0/crypto/_fnv/index.ts": "a8f6a361b4c6d54e5e89c16098f99b6962a1dd6ad1307dbc97fa1ecac5d7060a",
+ "https://deno.land/std@0.170.0/crypto/_fnv/util.ts": "4848313bed7f00f55be3cb080aa0583fc007812ba965b03e4009665bde614ce3",
+ "https://deno.land/std@0.170.0/crypto/_util.ts": "4a8cb74e7273d2400aa6da582ec58078cf8d54bc66530592048cbd7cc4152621",
+ "https://deno.land/std@0.170.0/crypto/_wasm/lib/deno_std_wasm_crypto.generated.mjs": "71c1ac20f32fdbdc9b31a14917779c7fa392dbc8b050059cbb2c35b400b975b1",
+ "https://deno.land/std@0.170.0/crypto/_wasm/mod.ts": "b49ec171049bbbaaed3c5a5a71dfcb3d09f880607c8d9c517638d0443bd0f874",
+ "https://deno.land/std@0.170.0/crypto/keystack.ts": "ee8ee58ca876f619cef56f40127405f77f9738f50a459b6ba44234b3a2cb6cc8",
+ "https://deno.land/std@0.170.0/crypto/mod.ts": "f953406904aa4257a6c76c40eb74b47d8dad83af8a77f33a4639cbac6d311baf",
+ "https://deno.land/std@0.170.0/crypto/timing_safe_equal.ts": "3784958e40a5fe10429a68b75cc5f8d34356bf0bc2eb93c80c3033e2a6f17821",
+ "https://deno.land/std@0.170.0/crypto/util.ts": "93fc9dbaa62421538ad60ee65337cbf1d8a0298fac3c4f70b37e5627e7e129eb",
+ "https://deno.land/std@0.170.0/encoding/base64.ts": "8605e018e49211efc767686f6f687827d7f5fd5217163e981d8d693105640d7a",
+ "https://deno.land/std@0.170.0/encoding/base64url.ts": "0283b12fcd306c11e3cf26fc022fecc800c6acc19704ea8bdb3908898fcd06d6",
+ "https://deno.land/std@0.170.0/encoding/hex.ts": "b51e99b684486a3ad2406807a8be953f5ef8bac95af202774a759f9fcf0d87a6",
+ "https://deno.land/std@0.170.0/flags/mod.ts": "4f50ec6383c02684db35de38b3ffb2cd5b9fcfcc0b1147055d1980c49e82521c",
+ "https://deno.land/std@0.170.0/fmt/colors.ts": "03ad95e543d2808bc43c17a3dd29d25b43d0f16287fe562a0be89bf632454a12",
+ "https://deno.land/std@0.170.0/fs/_util.ts": "fdc156f897197f261a1c096dcf8ff9267ed0ff42bd5b31f55053a4763a4bae3b",
+ "https://deno.land/std@0.170.0/fs/copy.ts": "c6303e52f544c81271c929931f5b59c9cfa4f81930719d2d3f777188c38aac9f",
+ "https://deno.land/std@0.170.0/fs/empty_dir.ts": "453d6232ff109f2afb5e57ec14c3228e399205c1b408d85536aed7230290c414",
+ "https://deno.land/std@0.170.0/fs/ensure_dir.ts": "5e9e3d7da7fc5b5e391e6d9ccead17086d76e82fb46ccc7cc9b9ee3491bab6e0",
+ "https://deno.land/std@0.170.0/fs/ensure_file.ts": "76ef3a8ebef60d8da1fc4316fcb8e20c1b6f52b1baed3a9692ad3b0d1a9a1b03",
+ "https://deno.land/std@0.170.0/fs/ensure_link.ts": "adc8919063e26819f5971a0010fedc1bfd71d6350a24db1a36dff432bc35c7d7",
+ "https://deno.land/std@0.170.0/fs/ensure_symlink.ts": "5273557b8c50be69477aa9cb003b54ff2240a336db52a40851c97abce76b96ab",
+ "https://deno.land/std@0.170.0/fs/eol.ts": "6e784ff8120c8d5589cb258e56dc39bc5b408ac9827a2e914163cbf9f2e3ce92",
+ "https://deno.land/std@0.170.0/fs/exists.ts": "6a447912e49eb79cc640adacfbf4b0baf8e17ede6d5bed057062ce33c4fa0d68",
+ "https://deno.land/std@0.170.0/fs/expand_glob.ts": "3a92ee4921d2b063b8dfefd1d87c35bf81126f0f1cb16e5a0f4e9ecb88ec6fe3",
+ "https://deno.land/std@0.170.0/fs/mod.ts": "79c209c6e66903b3426f9245a4f216380a0ed47ffe9d253f5a61a0bc9ad1f314",
+ "https://deno.land/std@0.170.0/fs/move.ts": "02ab1fc9b744da8b496f406e9fc77b0bf7960b6faaa7ec9f5fb0a129e5bef215",
+ "https://deno.land/std@0.170.0/fs/walk.ts": "677eac2e5386217a7a4e7526769ae28b41ff4ae7a3cd0389f3aa4eb662545edd",
+ "https://deno.land/std@0.170.0/http/file_server.ts": "c26eee517f9fe8a398556f3ba9a65accfa9a85af37e583ae537a4d5126a51dd7",
+ "https://deno.land/std@0.170.0/http/http_status.ts": "ed24048cc0d06066c944da59b0301da3ae2f990564bb4ad79bb52a09cf8e9b30",
+ "https://deno.land/std@0.170.0/http/server.ts": "1b93c76cd415d7b6ad0ae36c17ccb9149b23f4dff018f7d5aa1ab5c36637eb45",
+ "https://deno.land/std@0.170.0/http/util.ts": "759a2b57b44b722d2033d0dfe077f7e9a257f431db6d0319b78dcfebed0adb1e",
+ "https://deno.land/std@0.170.0/media_types/_db.ts": "981fb4a1ad1dad6bc896208e9d01929bea31b875b9a400ad145a5e802996b3ea",
+ "https://deno.land/std@0.170.0/media_types/_util.ts": "839abd68a8c67f89e3fd8900b89b8d4725368b488f72f067fcf8051e77e3a38d",
+ "https://deno.land/std@0.170.0/media_types/content_type.ts": "ecf5e4965195b7c19a0de7b251ae920cfb40897205c5529d829d357bf2218900",
+ "https://deno.land/std@0.170.0/media_types/format_media_type.ts": "e5f906e7b0509d47c81b3533ebb96783e57683cc0fcb03ea4e3420c641a80538",
+ "https://deno.land/std@0.170.0/media_types/get_charset.ts": "74aee42562808172c3ce2892a7e668f537bf565f2deebd2655a7d5c5b2779857",
+ "https://deno.land/std@0.170.0/media_types/parse_media_type.ts": "f40f0b98e7e6883bc2ea0f83482c48e2583a2a9785426dfc665f494f0ca3f17b",
+ "https://deno.land/std@0.170.0/media_types/type_by_extension.ts": "5bd760bb9518ba0cf4e40cc5b9d04dc84b0c562d9b04ac2cbd4050a4b47c9a6d",
+ "https://deno.land/std@0.170.0/media_types/vendor/mime-db.v1.52.0.ts": "724cee25fa40f1a52d3937d6b4fbbfdd7791ff55e1b7ac08d9319d5632c7f5af",
+ "https://deno.land/std@0.170.0/path/_constants.ts": "df1db3ffa6dd6d1252cc9617e5d72165cd2483df90e93833e13580687b6083c3",
+ "https://deno.land/std@0.170.0/path/_interface.ts": "ee3b431a336b80cf445441109d089b70d87d5e248f4f90ff906820889ecf8d09",
+ "https://deno.land/std@0.170.0/path/_util.ts": "d16be2a16e1204b65f9d0dfc54a9bc472cafe5f4a190b3c8471ec2016ccd1677",
+ "https://deno.land/std@0.170.0/path/common.ts": "bee563630abd2d97f99d83c96c2fa0cca7cee103e8cb4e7699ec4d5db7bd2633",
+ "https://deno.land/std@0.170.0/path/glob.ts": "81cc6c72be002cd546c7a22d1f263f82f63f37fe0035d9726aa96fc8f6e4afa1",
+ "https://deno.land/std@0.170.0/path/mod.ts": "cf7cec7ac11b7048bb66af8ae03513e66595c279c65cfa12bfc07d9599608b78",
+ "https://deno.land/std@0.170.0/path/posix.ts": "b859684bc4d80edfd4cad0a82371b50c716330bed51143d6dcdbe59e6278b30c",
+ "https://deno.land/std@0.170.0/path/separator.ts": "fe1816cb765a8068afb3e8f13ad272351c85cbc739af56dacfc7d93d710fe0f9",
+ "https://deno.land/std@0.170.0/path/win32.ts": "7cebd2bda6657371adc00061a1d23fdd87bcdf64b4843bb148b0b24c11b40f69",
+ "https://deno.land/std@0.170.0/testing/_diff.ts": "a23e7fc2b4d8daa3e158fa06856bedf5334ce2a2831e8bf9e509717f455adb2c",
+ "https://deno.land/std@0.170.0/testing/_format.ts": "cd11136e1797791045e639e9f0f4640d5b4166148796cad37e6ef75f7d7f3832",
+ "https://deno.land/std@0.170.0/testing/asserts.ts": "51353e79437361d4b02d8e32f3fc83b22231bc8f8d4c841d86fd32b0b0afe940",
+ "https://deno.land/std@0.170.0/version.ts": "eb6935c9beaac221b235d011ba5b127ceb5d3addf329cc01e05806af07ba93e1"
+ },
+ "npm": {
+ "specifiers": {
+ "highlight.js": "highlight.js@11.7.0"
+ },
+ "packages": {
+ "highlight.js@11.7.0": {
+ "integrity": "sha512-1rRqesRFhMO/PRF+G86evnyJkCgaZFOI+Z6kdj15TA18funfoqJXvgPCLSf0SWq3SRfg1j3HlDs8o4s3EGq1oQ==",
+ "dependencies": {}
+ }
+ }
+ }
+}
diff --git a/vhosts/blog/docker-compose.local.yml b/vhosts/blog/docker-compose.local.yml
new file mode 100644
index 00000000..ea78e676
--- /dev/null
+++ b/vhosts/blog/docker-compose.local.yml
@@ -0,0 +1,13 @@
+version: '3'
+
+services:
+ blog_nsfisis_nginx:
+ image: nginx
+ volumes:
+ - ./nginx.conf:/etc/nginx/conf.d/default.conf
+ - ./public:/public
+ ports:
+ - 80:80
+ environment:
+ TZ: Asia/Tokyo
+ restart: always
diff --git a/vhosts/blog/docker-compose.yml b/vhosts/blog/docker-compose.yml
new file mode 100644
index 00000000..f6eef3d4
--- /dev/null
+++ b/vhosts/blog/docker-compose.yml
@@ -0,0 +1,18 @@
+version: '3'
+
+services:
+ blog_nsfisis_nginx:
+ image: nginx
+ volumes:
+ - ./nginx.conf:/etc/nginx/conf.d/default.conf
+ - ./public:/public
+ expose:
+ - 80
+ environment:
+ TZ: Asia/Tokyo
+ restart: always
+
+networks:
+ default:
+ external:
+ name: nsfisis_dev_shared
diff --git a/vhosts/blog/import_map.json b/vhosts/blog/import_map.json
new file mode 100644
index 00000000..0bbc3d36
--- /dev/null
+++ b/vhosts/blog/import_map.json
@@ -0,0 +1,5 @@
+{
+ "imports": {
+ "std/": "https://deno.land/std@0.170.0/"
+ }
+}
diff --git a/vhosts/blog/nginx.conf b/vhosts/blog/nginx.conf
new file mode 100644
index 00000000..7b84774b
--- /dev/null
+++ b/vhosts/blog/nginx.conf
@@ -0,0 +1,21 @@
+server {
+ listen 80 default;
+ listen [::]:80;
+
+ location / {
+ root /public;
+ }
+
+ error_page 404 /404.html;
+
+ rewrite ^/posts/(my-first-post)/?$ /posts/2021-03-05/$1/ permanent;
+ rewrite ^/posts/(phperkaigi-2021)/?$ /posts/2021-03-30/$1/ permanent;
+ rewrite ^/posts/(cpp-you-can-use-keywords-in-attributes)/?$ /posts/2021-10-02/$1/ permanent;
+ rewrite ^/posts/(python-unbound-local-error)/?$ /posts/2021-10-02/$1/ permanent;
+ rewrite ^/posts/(ruby-detect-running-implementation)/?$ /posts/2021-10-02/$1/ permanent;
+ rewrite ^/posts/(ruby-then-keyword-and-case-in)/?$ /posts/2021-10-02/$1/ permanent;
+ rewrite ^/posts/(rust-where-are-primitive-types-from)/?$ /posts/2021-10-02/$1/ permanent;
+ rewrite ^/posts/(vim-difference-between-autocmd-bufwrite-and-bufwritepre)/?$ /posts/2021-10-02/$1/ permanent;
+ rewrite ^/posts/(vim-swap-order-of-selected-lines)/?$ /posts/2021-10-02/$1/ permanent;
+ rewrite ^/posts/(phperkaigi-2022-tokens)/?$ /posts/2022-04-09/$1/ permanent;
+}
diff --git a/vhosts/blog/nuldoc b/vhosts/blog/nuldoc
new file mode 100755
index 00000000..7fc7cf22
--- /dev/null
+++ b/vhosts/blog/nuldoc
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+base_dir="$(dirname "$BASH_SOURCE")"
+
+deno run \
+ --allow-read="$base_dir" \
+ --allow-write="$base_dir" \
+ --allow-net="0.0.0.0:8000" \
+ --allow-run="./nuldoc" \
+ "$base_dir/nuldoc-src/main.ts" \
+ "$@"
diff --git a/vhosts/blog/nuldoc-src/commands/build.ts b/vhosts/blog/nuldoc-src/commands/build.ts
new file mode 100644
index 00000000..da7e5cec
--- /dev/null
+++ b/vhosts/blog/nuldoc-src/commands/build.ts
@@ -0,0 +1,208 @@
+import { dirname, join, joinGlobs } from "std/path/mod.ts";
+import { ensureDir } from "std/fs/mod.ts";
+import { expandGlob } from "std/fs/expand_glob.ts";
+import { Config } from "../config.ts";
+import { parseDocBookFile } from "../docbook/parse.ts";
+import { Page } from "../page.ts";
+import { render } from "../render.ts";
+import { dateToString } from "../revision.ts";
+import { generateAboutPage } from "../pages/about.ts";
+import { generateHomePage } from "../pages/home.ts";
+import { generateNotFoundPage } from "../pages/not_found.ts";
+import {
+ generatePostPage,
+ getPostCreatedDate,
+ PostPage,
+} from "../pages/post.ts";
+import { generatePostListPage } from "../pages/post_list.ts";
+import { generateSlidePage, SlidePage } from "../pages/slide.ts";
+import { generateSlideListPage } from "../pages/slide_list.ts";
+import { generateTagPage, TagPage } from "../pages/tag.ts";
+import { TaggedPage } from "../pages/tagged_page.ts";
+import { generateTagListPage } from "../pages/tag_list.ts";
+import { parseSlideFile } from "../slide/parse.ts";
+
+export async function runBuildCommand(config: Config) {
+ const posts = await buildPostPages(config);
+ await buildPostListPage(posts, config);
+ const slides = await buildSlidePages(config);
+ await buildSlideListPage(slides, config);
+ const tags = await buildTagPages(posts, slides, config);
+ await buildTagListPage(tags, config);
+ await buildHomePage(config);
+ await buildAboutPage(slides, config);
+ await buildNotFoundPage(config);
+ await copyStaticFiles(config);
+ await copyAssetFiles(slides, config);
+}
+
+async function buildPostPages(config: Config): Promise<PostPage[]> {
+ const sourceDir = join(Deno.cwd(), config.locations.contentDir, "posts");
+ const postFiles = await collectPostFiles(sourceDir);
+ const posts = await parsePosts(postFiles, config);
+ for (const post of posts) {
+ await writePage(post, config);
+ }
+ return posts;
+}
+
+async function collectPostFiles(sourceDir: string): Promise<string[]> {
+ const filePaths = [];
+ const globPattern = joinGlobs([sourceDir, "**", "*.xml"]);
+ for await (const entry of expandGlob(globPattern)) {
+ filePaths.push(entry.path);
+ }
+ return filePaths;
+}
+
+async function parsePosts(
+ postFiles: string[],
+ config: Config,
+): Promise<PostPage[]> {
+ const posts = [];
+ for (const postFile of postFiles) {
+ posts.push(
+ await generatePostPage(await parseDocBookFile(postFile, config), config),
+ );
+ }
+ return posts;
+}
+
+async function buildPostListPage(posts: PostPage[], config: Config) {
+ const postListPage = await generatePostListPage(posts, config);
+ await writePage(postListPage, config);
+}
+
+async function buildSlidePages(config: Config): Promise<SlidePage[]> {
+ const sourceDir = join(Deno.cwd(), config.locations.contentDir, "slides");
+ const slideFiles = await collectSlideFiles(sourceDir);
+ const slides = await parseSlides(slideFiles, config);
+ for (const slide of slides) {
+ await writePage(slide, config);
+ }
+ return slides;
+}
+
+async function collectSlideFiles(sourceDir: string): Promise<string[]> {
+ const filePaths = [];
+ const globPattern = joinGlobs([sourceDir, "**", "*.xml"]);
+ for await (const entry of expandGlob(globPattern)) {
+ filePaths.push(entry.path);
+ }
+ return filePaths;
+}
+
+async function parseSlides(
+ slideFiles: string[],
+ config: Config,
+): Promise<SlidePage[]> {
+ const slides = [];
+ for (const slideFile of slideFiles) {
+ slides.push(
+ await generateSlidePage(await parseSlideFile(slideFile, config), config),
+ );
+ }
+ return slides;
+}
+
+async function buildSlideListPage(slides: SlidePage[], config: Config) {
+ const slideListPage = await generateSlideListPage(slides, config);
+ await writePage(slideListPage, config);
+}
+
+async function buildHomePage(config: Config) {
+ const homePage = await generateHomePage(config);
+ await writePage(homePage, config);
+}
+
+async function buildAboutPage(slides: SlidePage[], config: Config) {
+ const aboutPage = await generateAboutPage(slides, config);
+ await writePage(aboutPage, config);
+}
+
+async function buildNotFoundPage(config: Config) {
+ const notFoundPage = await generateNotFoundPage(config);
+ await writePage(notFoundPage, config);
+}
+
+async function buildTagPages(
+ posts: PostPage[],
+ slides: SlidePage[],
+ config: Config,
+): Promise<TagPage[]> {
+ const tagsAndPages = collectTags([...posts, ...slides]);
+ const tags = [];
+ for (const [tag, pages] of tagsAndPages) {
+ const tagPage = await generateTagPage(tag, pages, config);
+ await writePage(tagPage, config);
+ tags.push(tagPage);
+ }
+ return tags;
+}
+
+async function buildTagListPage(tags: TagPage[], config: Config) {
+ const tagListPage = await generateTagListPage(tags, config);
+ await writePage(tagListPage, config);
+}
+
+function collectTags(taggedPages: TaggedPage[]): [string, TaggedPage[]][] {
+ const tagsAndPages = new Map();
+ for (const page of taggedPages) {
+ for (const tag of page.tags) {
+ if (!tagsAndPages.has(tag)) {
+ tagsAndPages.set(tag, []);
+ }
+ tagsAndPages.get(tag).push(page);
+ }
+ }
+
+ const result: [string, TaggedPage[]][] = [];
+ for (const tag of Array.from(tagsAndPages.keys()).sort()) {
+ result.push([
+ tag,
+ tagsAndPages.get(tag).sort((a: TaggedPage, b: TaggedPage) => {
+ const ta = dateToString(getPostCreatedDate(a));
+ const tb = dateToString(getPostCreatedDate(b));
+ if (ta > tb) return -1;
+ if (ta < tb) return 1;
+ return 0;
+ }),
+ ]);
+ }
+ return result;
+}
+
+async function copyStaticFiles(config: Config) {
+ const globPattern = joinGlobs([Deno.cwd(), config.locations.staticDir, "*"]);
+ for await (const entry of expandGlob(globPattern)) {
+ const src = entry.path;
+ const dst = src.replace(
+ config.locations.staticDir,
+ config.locations.destDir,
+ );
+ await Deno.copyFile(src, dst);
+ }
+}
+
+async function copyAssetFiles(slides: SlidePage[], config: Config) {
+ const cwd = Deno.cwd();
+ const contentDir = join(cwd, config.locations.contentDir);
+ const destDir = join(cwd, config.locations.destDir);
+
+ for (const slide of slides) {
+ const src = join(contentDir, slide.slideLink);
+ const dst = join(destDir, slide.slideLink);
+ await ensureDir(dirname(dst));
+ await Deno.copyFile(src, dst);
+ }
+}
+
+async function writePage(page: Page, config: Config) {
+ const destFilePath = join(
+ Deno.cwd(),
+ config.locations.destDir,
+ page.destFilePath,
+ );
+ await ensureDir(dirname(destFilePath));
+ await Deno.writeTextFile(destFilePath, render(page.root, page.renderer));
+}
diff --git a/vhosts/blog/nuldoc-src/commands/new.ts b/vhosts/blog/nuldoc-src/commands/new.ts
new file mode 100644
index 00000000..22329972
--- /dev/null
+++ b/vhosts/blog/nuldoc-src/commands/new.ts
@@ -0,0 +1,92 @@
+import { dirname, join } from "std/path/mod.ts";
+import { ensureDir } from "std/fs/mod.ts";
+import { Config } from "../config.ts";
+
+export async function runNewCommand(config: Config) {
+ const type = Deno.args[1];
+ if (type !== "post" && type !== "slide") {
+ console.log(`Usage: nuldoc new <type>
+
+<type> must be either post or slide.`);
+ Deno.exit(1);
+ }
+
+ const now = new Date();
+ const ymd = `${now.getFullYear()}-${
+ (now.getMonth() + 1).toString().padStart(2, "0")
+ }-${now.getDate().toString().padStart(2, "0")}`;
+
+ const destFilePath = join(
+ Deno.cwd(),
+ config.locations.contentDir,
+ getDirPath(type),
+ ymd,
+ "TODO.xml",
+ );
+
+ await ensureDir(dirname(destFilePath));
+ await Deno.writeTextFile(destFilePath, getTemplate(type, ymd));
+ console.log(
+ `New file ${
+ destFilePath.replace(Deno.cwd(), "")
+ } was successfully created.`,
+ );
+}
+
+function getDirPath(type: "post" | "slide"): string {
+ return type === "post" ? "posts" : "slides";
+}
+
+function getTemplate(type: "post" | "slide", date: string): string {
+ if (type === "post") {
+ return `<?xml version="1.0" encoding="UTF-8"?>
+<article xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0">
+ <info>
+ <title>TODO</title>
+ <abstract>
+ TODO
+ </abstract>
+ <keywordset>
+ <keyword>TODO</keyword>
+ </keywordset>
+ <revhistory>
+ <revision>
+ <date>${date}</date>
+ <revremark>公開</revremark>
+ </revision>
+ </revhistory>
+ </info>
+ <section xml:id="TODO">
+ <title>TODO</title>
+ <para>
+ TODO
+ </para>
+ </section>
+</article>
+`;
+ } else {
+ return `<?xml version="1.0" encoding="UTF-8"?>
+<slide>
+ <info>
+ <title>TODO</title>
+ <event>
+ TODO
+ </event>
+ <talktype>
+ TODO
+ </talktype>
+ <link>TODO</link>
+ <keywordset>
+ <keyword>TODO</keyword>
+ </keywordset>
+ <revhistory>
+ <revision>
+ <date>${date}</date>
+ <revremark>登壇</revremark>
+ </revision>
+ </revhistory>
+ </info>
+</slide>
+`;
+ }
+}
diff --git a/vhosts/blog/nuldoc-src/commands/serve.ts b/vhosts/blog/nuldoc-src/commands/serve.ts
new file mode 100644
index 00000000..aa5221df
--- /dev/null
+++ b/vhosts/blog/nuldoc-src/commands/serve.ts
@@ -0,0 +1,38 @@
+import { serveDir } from "std/http/file_server.ts";
+import { Status, STATUS_TEXT } from "std/http/http_status.ts";
+import { serve } from "std/http/server.ts";
+import { join } from "std/path/mod.ts";
+import { Config } from "../config.ts";
+
+export function runServeCommand(config: Config) {
+ const rootDir = join(Deno.cwd(), config.locations.destDir);
+ serve(async (req) => {
+ const pathname = new URL(req.url).pathname;
+ if (!pathname.endsWith("css") && !pathname.endsWith("svg")) {
+ const command = new Deno.Command(
+ join(Deno.cwd(), "nuldoc"),
+ {
+ args: ["build"],
+ },
+ );
+ await command.output();
+ console.log("rebuild");
+ }
+ const res = await serveDir(req, {
+ fsRoot: rootDir,
+ showIndex: true,
+ });
+ if (res.status !== Status.NotFound) {
+ return res;
+ }
+
+ const notFoundHtml = await Deno.readTextFile(join(rootDir, "404.html"));
+ return new Response(notFoundHtml, {
+ status: Status.NotFound,
+ statusText: STATUS_TEXT[Status.NotFound],
+ headers: {
+ "content-type": "text/html",
+ },
+ });
+ });
+}
diff --git a/vhosts/blog/nuldoc-src/components/global_footer.ts b/vhosts/blog/nuldoc-src/components/global_footer.ts
new file mode 100644
index 00000000..4c9d2457
--- /dev/null
+++ b/vhosts/blog/nuldoc-src/components/global_footer.ts
@@ -0,0 +1,12 @@
+import { Config } from "../config.ts";
+import { el, Element, text } from "../dom.ts";
+
+export function globalFooter(config: Config): Element {
+ return el(
+ "footer",
+ [["class", "footer"]],
+ text(
+ `&copy; ${config.blog.siteCopyrightYear} ${config.blog.author}`,
+ ),
+ );
+}
diff --git a/vhosts/blog/nuldoc-src/components/global_header.ts b/vhosts/blog/nuldoc-src/components/global_header.ts
new file mode 100644
index 00000000..a5130612
--- /dev/null
+++ b/vhosts/blog/nuldoc-src/components/global_header.ts
@@ -0,0 +1,42 @@
+import { Config } from "../config.ts";
+import { el, Element, text } from "../dom.ts";
+
+export function globalHeader(config: Config): Element {
+ return el(
+ "header",
+ [["class", "header"]],
+ el(
+ "nav",
+ [["class", "nav"]],
+ el(
+ "ul",
+ [],
+ el(
+ "li",
+ [],
+ el("a", [["href", "/"]], text(config.blog.siteName)),
+ ),
+ el(
+ "li",
+ [],
+ el("a", [["href", "/about/"]], text("About")),
+ ),
+ el(
+ "li",
+ [],
+ el("a", [["href", "/posts/"]], text("Posts")),
+ ),
+ el(
+ "li",
+ [],
+ el("a", [["href", "/slides/"]], text("Slides")),
+ ),
+ el(
+ "li",
+ [],
+ el("a", [["href", "/tags/"]], text("Tags")),
+ ),
+ ),
+ ),
+ );
+}
diff --git a/vhosts/blog/nuldoc-src/components/page_layout.ts b/vhosts/blog/nuldoc-src/components/page_layout.ts
new file mode 100644
index 00000000..50ed45de
--- /dev/null
+++ b/vhosts/blog/nuldoc-src/components/page_layout.ts
@@ -0,0 +1,78 @@
+import { Config } from "../config.ts";
+import { el, Element, text } from "../dom.ts";
+import { stylesheetLinkElement } from "./utils.ts";
+
+type Params = {
+ metaCopyrightYear: number;
+ metaDescription: string;
+ metaKeywords: string[];
+ metaTitle: string;
+ requiresSyntaxHighlight: boolean;
+};
+
+export async function pageLayout(
+ {
+ metaCopyrightYear,
+ metaDescription,
+ metaKeywords,
+ metaTitle,
+ requiresSyntaxHighlight,
+ }: Params,
+ body: Element,
+ config: Config,
+): Promise<Element> {
+ const head = el(
+ "head",
+ [],
+ metaElement([["charset", "UTF-8"]]),
+ metaElement([["name", "viewport"], [
+ "content",
+ "width=device-width, initial-scale=1.0",
+ ]]),
+ metaElement([["name", "author"], ["content", config.blog.author]]),
+ metaElement([["name", "copyright"], [
+ "content",
+ `&copy; ${metaCopyrightYear} ${config.blog.author}`,
+ ]]),
+ metaElement([["name", "description"], [
+ "content",
+ metaDescription,
+ ]]),
+ ...(metaKeywords.length === 0 ? [] : [
+ metaElement([["name", "keywords"], [
+ "content",
+ metaKeywords.join(","),
+ ]]),
+ ]),
+ linkElement("icon", "/favicon.svg", "image/svg+xml"),
+ el("title", [], text(metaTitle)),
+ await stylesheetLinkElement("/style.css", config),
+ ...(
+ requiresSyntaxHighlight
+ ? [await stylesheetLinkElement("/hl.css", config)]
+ : []
+ ),
+ );
+ return el(
+ "html",
+ [["lang", "ja-JP"]],
+ head,
+ body,
+ );
+}
+
+function metaElement(attrs: [string, string][]): Element {
+ return el("meta", attrs);
+}
+
+function linkElement(
+ rel: string,
+ href: string,
+ type: string | null,
+): Element {
+ const attrs: [string, string][] = [["rel", rel], ["href", href]];
+ if (type !== null) {
+ attrs.push(["type", type]);
+ }
+ return el("link", attrs);
+}
diff --git a/vhosts/blog/nuldoc-src/components/post_page_entry.ts b/vhosts/blog/nuldoc-src/components/post_page_entry.ts
new file mode 100644
index 00000000..685c03a8
--- /dev/null
+++ b/vhosts/blog/nuldoc-src/components/post_page_entry.ts
@@ -0,0 +1,48 @@
+import { el, Element, text } from "../dom.ts";
+import {
+ getPostCreatedDate,
+ getPostUpdatedDate,
+ PostPage,
+} from "../pages/post.ts";
+import { dateToString } from "../revision.ts";
+
+export function postPageEntry(post: PostPage): Element {
+ return el(
+ "article",
+ [["class", "post-entry"]],
+ el(
+ "a",
+ [["href", post.href]],
+ el(
+ "header",
+ [["class", "entry-header"]],
+ el("h2", [], text(post.title)),
+ ),
+ el(
+ "section",
+ [["class", "entry-content"]],
+ el("p", [], text(post.summary)),
+ ),
+ el(
+ "footer",
+ [["class", "entry-footer"]],
+ el(
+ "time",
+ [["datetime", dateToString(getPostCreatedDate(post))]],
+ text(dateToString(getPostCreatedDate(post))),
+ ),
+ text(" 投稿"),
+ ...(post.revisions.length > 1
+ ? [
+ text("、"),
+ el("time", [[
+ "datetime",
+ dateToString(getPostUpdatedDate(post)),
+ ]], text(dateToString(getPostUpdatedDate(post)))),
+ text(" 更新"),
+ ]
+ : []),
+ ),
+ ),
+ );
+}
diff --git a/vhosts/blog/nuldoc-src/components/slide_page_entry.ts b/vhosts/blog/nuldoc-src/components/slide_page_entry.ts
new file mode 100644
index 00000000..4767ca2b
--- /dev/null
+++ b/vhosts/blog/nuldoc-src/components/slide_page_entry.ts
@@ -0,0 +1,45 @@
+import { el, Element, text } from "../dom.ts";
+import { getPostCreatedDate, getPostUpdatedDate } from "../pages/post.ts";
+import { SlidePage } from "../pages/slide.ts";
+import { dateToString } from "../revision.ts";
+
+export function slidePageEntry(slide: SlidePage): Element {
+ return el(
+ "article",
+ [["class", "post-entry"]],
+ el(
+ "a",
+ [["href", slide.href]],
+ el(
+ "header",
+ [["class", "entry-header"]],
+ el("h2", [], text(`登壇: ${slide.event} (${slide.talkType})`)),
+ ),
+ el(
+ "section",
+ [["class", "entry-content"]],
+ el("p", [], text(slide.title)),
+ ),
+ el(
+ "footer",
+ [["class", "entry-footer"]],
+ el(
+ "time",
+ [["datetime", dateToString(getPostCreatedDate(slide))]],
+ text(dateToString(getPostCreatedDate(slide))),
+ ),
+ text(" 登壇"),
+ ...(slide.revisions.length > 1
+ ? [
+ text("、"),
+ el("time", [[
+ "datetime",
+ dateToString(getPostUpdatedDate(slide)),
+ ]], text(dateToString(getPostUpdatedDate(slide)))),
+ text(" 更新"),
+ ]
+ : []),
+ ),
+ ),
+ );
+}
diff --git a/vhosts/blog/nuldoc-src/components/utils.ts b/vhosts/blog/nuldoc-src/components/utils.ts
new file mode 100644
index 00000000..f0de71f1
--- /dev/null
+++ b/vhosts/blog/nuldoc-src/components/utils.ts
@@ -0,0 +1,30 @@
+import { crypto, toHashString } from "std/crypto/mod.ts";
+import { join } from "std/path/mod.ts";
+import { Config } from "../config.ts";
+import { el, Element } from "../dom.ts";
+
+export async function stylesheetLinkElement(
+ fileName: string,
+ config: Config,
+): Promise<Element> {
+ const filePath = join(Deno.cwd(), config.locations.staticDir, fileName);
+ const hash = await calculateFileHash(filePath);
+ return el("link", [["rel", "stylesheet"], ["href", `${fileName}?h=${hash}`]]);
+}
+
+export async function staticScriptElement(
+ fileName: string,
+ attrs: [string, string][],
+ config: Config,
+): Promise<Element> {
+ const filePath = join(Deno.cwd(), config.locations.staticDir, fileName);
+ const hash = await calculateFileHash(filePath);
+ return el("script", [["src", `${fileName}?h=${hash}`], ...attrs]);
+}
+
+async function calculateFileHash(
+ filePath: string,
+): Promise<string> {
+ const content = (await Deno.readFile(filePath)).buffer;
+ return toHashString(await crypto.subtle.digest("MD5", content), "hex");
+}
diff --git a/vhosts/blog/nuldoc-src/config.ts b/vhosts/blog/nuldoc-src/config.ts
new file mode 100644
index 00000000..5e1cad46
--- /dev/null
+++ b/vhosts/blog/nuldoc-src/config.ts
@@ -0,0 +1,43 @@
+export const config = {
+ locations: {
+ contentDir: "/content",
+ destDir: "/public",
+ staticDir: "/static",
+ },
+ rendering: {
+ html: {
+ indentWidth: 2,
+ },
+ },
+ blog: {
+ author: "nsfisis",
+ siteName: "REPL: Rest-Eat-Program Loop",
+ siteCopyrightYear: 2021,
+ tagLabels: {
+ "conference": "カンファレンス",
+ "cpp": "C++",
+ "cpp17": "C++ 17",
+ "note-to-self": "備忘録",
+ "php": "PHP",
+ "phpcon": "PHP カンファレンス",
+ "phpconfuk": "PHP カンファレンス福岡",
+ "phperkaigi": "PHPerKaigi",
+ "phpstudy-tokyo": "PHP 勉強会@東京",
+ "python": "Python",
+ "python3": "Python 3",
+ "ruby": "Ruby",
+ "ruby3": "Ruby 3",
+ "rust": "Rust",
+ "vim": "Vim",
+ },
+ },
+};
+
+export type Config = typeof config;
+
+export function getTagLabel(c: Config, slug: string): string {
+ if (!(slug in c.blog.tagLabels)) {
+ throw new Error(`Unknown tag: ${slug}`);
+ }
+ return (c.blog.tagLabels as { [slug: string]: string })[slug];
+}
diff --git a/vhosts/blog/nuldoc-src/docbook/document.ts b/vhosts/blog/nuldoc-src/docbook/document.ts
new file mode 100644
index 00000000..677c8275
--- /dev/null
+++ b/vhosts/blog/nuldoc-src/docbook/document.ts
@@ -0,0 +1,108 @@
+import { join } from "std/path/mod.ts";
+import { Config } from "../config.ts";
+import { DocBookError } from "../errors.ts";
+import { Revision, stringToDate } from "../revision.ts";
+import {
+ Element,
+ findChildElements,
+ findFirstChildElement,
+ innerText,
+} from "../dom.ts";
+
+export type Document = {
+ root: Element;
+ sourceFilePath: string;
+ link: string;
+ title: string;
+ summary: string; // TODO: should it be markup text?
+ tags: string[];
+ revisions: Revision[];
+};
+
+export function createNewDocumentFromRootElement(
+ root: Element,
+ sourceFilePath: string,
+ config: Config,
+): Document {
+ const article = findFirstChildElement(root, "article");
+ if (!article) {
+ throw new DocBookError(
+ `[docbook.new] <article> element not found`,
+ );
+ }
+ const info = findFirstChildElement(article, "info");
+ if (!info) {
+ throw new DocBookError(
+ `[docbook.new] <info> element not found`,
+ );
+ }
+
+ const titleElement = findFirstChildElement(info, "title");
+ if (!titleElement) {
+ throw new DocBookError(
+ `[docbook.new] <title> element not found`,
+ );
+ }
+ const title = innerText(titleElement).trim();
+ const abstractElement = findFirstChildElement(info, "abstract");
+ if (!abstractElement) {
+ throw new DocBookError(
+ `[docbook.new] <abstract> element not found`,
+ );
+ }
+ const summary = innerText(abstractElement).trim();
+ const keywordsetElement = findFirstChildElement(info, "keywordset");
+ let tags: string[];
+ if (!keywordsetElement) {
+ tags = [];
+ } else {
+ tags = findChildElements(keywordsetElement, "keyword").map((x) =>
+ innerText(x).trim()
+ );
+ }
+ const revhistoryElement = findFirstChildElement(info, "revhistory");
+ if (!revhistoryElement) {
+ throw new DocBookError(
+ `[docbook.new] <revhistory> element not found`,
+ );
+ }
+ const revisions = findChildElements(revhistoryElement, "revision").map(
+ (x, i) => {
+ const dateElement = findFirstChildElement(x, "date");
+ if (!dateElement) {
+ throw new DocBookError(
+ `[docbook.new] <date> element not found`,
+ );
+ }
+ const revremarkElement = findFirstChildElement(x, "revremark");
+ if (!revremarkElement) {
+ throw new DocBookError(
+ `[docbook.new] <revremark> element not found`,
+ );
+ }
+ return {
+ number: i + 1,
+ date: stringToDate(innerText(dateElement).trim()),
+ remark: innerText(revremarkElement).trim(),
+ };
+ },
+ );
+ if (revisions.length === 0) {
+ throw new DocBookError(
+ `[docbook.new] <revision> element not found`,
+ );
+ }
+
+ const cwd = Deno.cwd();
+ const contentDir = join(cwd, config.locations.contentDir);
+ const link = sourceFilePath.replace(contentDir, "").replace(".xml", "/");
+ return {
+ root: root,
+ sourceFilePath: sourceFilePath,
+ link: link,
+ title: title,
+ summary: summary,
+ tags: tags,
+ revisions: revisions,
+ };
+}
diff --git a/vhosts/blog/nuldoc-src/docbook/parse.ts b/vhosts/blog/nuldoc-src/docbook/parse.ts
new file mode 100644
index 00000000..bce317e6
--- /dev/null
+++ b/vhosts/blog/nuldoc-src/docbook/parse.ts
@@ -0,0 +1,21 @@
+import { Config } from "../config.ts";
+import { parseXmlFile } from "../xml.ts";
+import { DocBookError, XmlParseError } from "../errors.ts";
+import { createNewDocumentFromRootElement, Document } from "./document.ts";
+import toHtml from "./to_html.ts";
+
+export async function parseDocBookFile(
+ filePath: string,
+ config: Config,
+): Promise<Document> {
+ try {
+ const root = await parseXmlFile(filePath);
+ const doc = createNewDocumentFromRootElement(root, filePath, config);
+ return toHtml(doc);
+ } catch (e) {
+ if (e instanceof DocBookError || e instanceof XmlParseError) {
+ e.message = `${e.message} in ${filePath}`;
+ }
+ throw e;
+ }
+}
diff --git a/vhosts/blog/nuldoc-src/docbook/to_html.ts b/vhosts/blog/nuldoc-src/docbook/to_html.ts
new file mode 100644
index 00000000..4add912c
--- /dev/null
+++ b/vhosts/blog/nuldoc-src/docbook/to_html.ts
@@ -0,0 +1,319 @@
+// @deno-types="../types/highlight-js.d.ts"
+import hljs from "npm:highlight.js";
+import { Document } from "./document.ts";
+import { DocBookError } from "../errors.ts";
+import {
+ addClass,
+ Element,
+ findFirstChildElement,
+ forEachChild,
+ forEachChildRecursively,
+ Node,
+ RawHTML,
+ removeChildElements,
+ Text,
+} from "../dom.ts";
+
+export default function toHtml(doc: Document): Document {
+ removeArticleInfo(doc);
+ removeArticleAttributes(doc);
+ removeUnnecessaryTextNode(doc);
+ transformElementNames(doc, "emphasis", "em");
+ transformElementNames(doc, "informaltable", "table");
+ transformElementNames(doc, "itemizedlist", "ul");
+ transformElementNames(doc, "link", "a");
+ transformElementNames(doc, "listitem", "li");
+ transformElementNames(doc, "literal", "code");
+ transformElementNames(doc, "orderedlist", "ol");
+ transformElementNames(doc, "para", "p");
+ transformElementNames(doc, "superscript", "sup");
+ transformAttributeNames(doc, "xml:id", "id");
+ transformAttributeNames(doc, "xl:href", "href");
+ transformSectionIdAttribute(doc);
+ setSectionTitleAnchor(doc);
+ transformSectionTitleElement(doc);
+ transformProgramListingElement(doc);
+ transformLiteralLayoutElement(doc);
+ transformNoteElement(doc);
+ setDefaultLangAttribute(doc);
+ traverseFootnotes(doc);
+ highlightPrograms(doc);
+ return doc;
+}
+
+function removeArticleInfo(doc: Document) {
+ const article = findFirstChildElement(doc.root, "article");
+ if (!article) {
+ throw new DocBookError(
+ `[docbook.tohtml] <article> element not found`,
+ );
+ }
+ removeChildElements(article, "info");
+}
+
+function removeArticleAttributes(doc: Document) {
+ const article = findFirstChildElement(doc.root, "article");
+ if (!article) {
+ throw new DocBookError(
+ `[docbook.tohtml] <article> element not found`,
+ );
+ }
+ article.attributes.delete("xmlns");
+ article.attributes.delete("xmlns:xl");
+ article.attributes.delete("version");
+}
+
+function removeUnnecessaryTextNode(doc: Document) {
+ const g = (n: Node) => {
+ if (n.kind !== "element") {
+ return;
+ }
+
+ let changed = true;
+ while (changed) {
+ changed = false;
+ if (n.children.length === 0) {
+ break;
+ }
+ const firstChild = n.children[0];
+ if (firstChild.kind === "text" && firstChild.content.trim() === "") {
+ n.children.shift();
+ changed = true;
+ }
+ if (n.children.length === 0) {
+ break;
+ }
+ const lastChild = n.children[n.children.length - 1];
+ if (lastChild.kind === "text" && lastChild.content.trim() === "") {
+ n.children.pop();
+ changed = true;
+ }
+ }
+
+ forEachChild(n, g);
+ };
+ forEachChild(doc.root, g);
+}
+
+function transformElementNames(
+ doc: Document,
+ from: string,
+ to: string,
+) {
+ forEachChildRecursively(doc.root, (n) => {
+ if (n.kind === "element" && n.name === from) {
+ n.name = to;
+ }
+ });
+}
+
+function transformAttributeNames(
+ doc: Document,
+ from: string,
+ to: string,
+) {
+ forEachChildRecursively(doc.root, (n) => {
+ if (n.kind !== "element") {
+ return;
+ }
+ const value = n.attributes.get(from) as string;
+ if (value !== undefined) {
+ n.attributes.delete(from);
+ n.attributes.set(to, value);
+ }
+ });
+}
+
+function transformSectionIdAttribute(doc: Document) {
+ forEachChildRecursively(doc.root, (n) => {
+ if (n.kind !== "element" || n.name !== "section") {
+ return;
+ }
+
+ const idAttr = n.attributes.get("id");
+ n.attributes.set("id", `section--${idAttr}`);
+ });
+}
+
+function setSectionTitleAnchor(doc: Document) {
+ const sectionStack: Element[] = [];
+ const g = (c: Node) => {
+ if (c.kind !== "element") {
+ return;
+ }
+
+ if (c.name === "section") {
+ sectionStack.push(c);
+ }
+ forEachChild(c, g);
+ if (c.name === "section") {
+ sectionStack.pop();
+ }
+ if (c.name === "title") {
+ const currentSection = sectionStack[sectionStack.length - 1];
+ if (!currentSection) {
+ throw new DocBookError(
+ "[docbook.tohtml] <title> element must be inside <section>",
+ );
+ }
+ const sectionId = currentSection.attributes.get("id");
+ const aElement: Element = {
+ kind: "element",
+ name: "a",
+ attributes: new Map(),
+ children: c.children,
+ };
+ aElement.attributes.set("href", `#${sectionId}`);
+ c.children = [aElement];
+ }
+ };
+ forEachChild(doc.root, g);
+}
+
+function transformSectionTitleElement(doc: Document) {
+ let sectionLevel = 1;
+ const g = (c: Node) => {
+ if (c.kind !== "element") {
+ return;
+ }
+
+ if (c.name === "section") {
+ sectionLevel += 1;
+ c.attributes.set("--section-level", sectionLevel.toString());
+ }
+ forEachChild(c, g);
+ if (c.name === "section") {
+ sectionLevel -= 1;
+ }
+ if (c.name === "title") {
+ c.name = `h${sectionLevel}`;
+ }
+ };
+ forEachChild(doc.root, g);
+}
+
+function transformProgramListingElement(doc: Document) {
+ forEachChildRecursively(doc.root, (n) => {
+ if (n.kind !== "element" || n.name !== "programlisting") {
+ return;
+ }
+
+ n.name = "pre";
+ addClass(n, "highlight");
+ const codeElement: Element = {
+ kind: "element",
+ name: "code",
+ attributes: new Map(),
+ children: n.children,
+ };
+ n.children = [codeElement];
+ });
+}
+
+function transformLiteralLayoutElement(doc: Document) {
+ forEachChildRecursively(doc.root, (n) => {
+ if (n.kind !== "element" || n.name !== "literallayout") {
+ return;
+ }
+
+ n.name = "pre";
+ addClass(n, "highlight");
+ const codeElement: Element = {
+ kind: "element",
+ name: "code",
+ attributes: new Map(),
+ children: n.children,
+ };
+ n.children = [codeElement];
+ });
+}
+
+function transformNoteElement(doc: Document) {
+ forEachChildRecursively(doc.root, (n) => {
+ if (n.kind !== "element" || n.name !== "note") {
+ return;
+ }
+
+ const labelElement: Element = {
+ kind: "element",
+ name: "div",
+ attributes: new Map([["class", "admonition-label"]]),
+ children: [{
+ kind: "text",
+ content: "NOTE",
+ raw: false,
+ }],
+ };
+ const contentElement: Element = {
+ kind: "element",
+ name: "div",
+ attributes: new Map([["class", "admonition-content"]]),
+ children: n.children,
+ };
+ n.name = "div";
+ addClass(n, "admonition");
+ n.children = [
+ labelElement,
+ contentElement,
+ ];
+ });
+}
+
+function setDefaultLangAttribute(_doc: Document) {
+ // TODO
+ // if (!e.attributes.has("lang")) {
+ // e.attributes.set("lang", "ja-JP");
+ // }
+}
+
+function traverseFootnotes(doc: Document) {
+ forEachChildRecursively(doc.root, (n) => {
+ if (n.kind !== "element" || n.name !== "footnote") {
+ return;
+ }
+
+ // TODO
+ // <footnote>x</footnote>
+ //
+ // <sup class="footnote">[<a id="_footnoteref_1" class="footnote" href="#_footnotedef_1">1</a>]</sup>
+ //
+ // <div class="footnote" id="_footnotedef_1">
+ // <a href="#_footnoteref_1">1</a>. RAS syndrome
+ // </div>
+ n.name = "span";
+ n.children = [];
+ });
+}
+
+function highlightPrograms(doc: Document) {
+ forEachChildRecursively(doc.root, (n) => {
+ if (n.kind !== "element" || n.name !== "pre") {
+ return;
+ }
+ const preClass = n.attributes.get("class") || "";
+ if (!preClass.includes("highlight")) {
+ return;
+ }
+ const codeElement = findFirstChildElement(n, "code");
+ if (!codeElement) {
+ return;
+ }
+ const language = n.attributes.get("language");
+ if (!language) {
+ return;
+ }
+ const sourceCodeNode = codeElement.children[0] as Text | RawHTML;
+ const sourceCode = sourceCodeNode.content;
+
+ if (!hljs.getLanguage(language)) {
+ return;
+ }
+
+ const highlighted =
+ hljs.highlight(sourceCode, { language: language }).value;
+
+ sourceCodeNode.content = highlighted;
+ sourceCodeNode.raw = true;
+ codeElement.attributes.set("class", "highlight");
+ });
+}
diff --git a/vhosts/blog/nuldoc-src/dom.ts b/vhosts/blog/nuldoc-src/dom.ts
new file mode 100644
index 00000000..d8f53d76
--- /dev/null
+++ b/vhosts/blog/nuldoc-src/dom.ts
@@ -0,0 +1,107 @@
+export type Text = {
+ kind: "text";
+ content: string;
+ raw: false;
+};
+
+export type RawHTML = {
+ kind: "text";
+ content: string;
+ raw: true;
+};
+
+export type Element = {
+ kind: "element";
+ name: string;
+ attributes: Map<string, string>;
+ children: Node[];
+};
+
+export type Node = Element | Text | RawHTML;
+
+export function addClass(e: Element, klass: string) {
+ const classes = e.attributes.get("class");
+ if (classes === undefined) {
+ e.attributes.set("class", klass);
+ } else {
+ const classList = classes.split(" ");
+ classList.push(klass);
+ classList.sort();
+ e.attributes.set("class", classList.join(" "));
+ }
+}
+
+export function findFirstChildElement(
+ e: Element,
+ name: string,
+): Element | null {
+ for (const c of e.children) {
+ if (c.kind === "element" && c.name === name) {
+ return c;
+ }
+ }
+ return null;
+}
+
+export function findChildElements(e: Element, name: string): Element[] {
+ const cs = [];
+ for (const c of e.children) {
+ if (c.kind === "element" && c.name === name) {
+ cs.push(c);
+ }
+ }
+ return cs;
+}
+
+export function removeChildElements(e: Element, name: string) {
+ e.children = e.children.filter((c) =>
+ c.kind !== "element" || c.name !== name
+ );
+}
+
+export function innerText(e: Element): string {
+ let t = "";
+ forEachChild(e, (c) => {
+ if (c.kind === "text") {
+ t += c.content;
+ }
+ });
+ return t;
+}
+
+export function forEachChild(e: Element, f: (n: Node) => void) {
+ for (const c of e.children) {
+ f(c);
+ }
+}
+
+export function forEachChildRecursively(e: Element, f: (n: Node) => void) {
+ const g = (c: Node) => {
+ f(c);
+ if (c.kind === "element") {
+ forEachChild(c, g);
+ }
+ };
+ forEachChild(e, g);
+}
+
+export function text(content: string): Text {
+ return {
+ kind: "text",
+ content: content,
+ raw: false,
+ };
+}
+
+export function el(
+ name: string,
+ attrs: [string, string][],
+ ...children: Node[]
+): Element {
+ return {
+ kind: "element",
+ name: name,
+ attributes: new Map(attrs),
+ children: children,
+ };
+}
diff --git a/vhosts/blog/nuldoc-src/errors.ts b/vhosts/blog/nuldoc-src/errors.ts
new file mode 100644
index 00000000..fa535836
--- /dev/null
+++ b/vhosts/blog/nuldoc-src/errors.ts
@@ -0,0 +1,17 @@
+export class DocBookError extends Error {
+ static {
+ this.prototype.name = "DocBookError";
+ }
+}
+
+export class SlideError extends Error {
+ static {
+ this.prototype.name = "SlideError";
+ }
+}
+
+export class XmlParseError extends Error {
+ static {
+ this.prototype.name = "XmlParseError";
+ }
+}
diff --git a/vhosts/blog/nuldoc-src/main.ts b/vhosts/blog/nuldoc-src/main.ts
new file mode 100644
index 00000000..8598d80c
--- /dev/null
+++ b/vhosts/blog/nuldoc-src/main.ts
@@ -0,0 +1,17 @@
+import { runBuildCommand } from "./commands/build.ts";
+import { runNewCommand } from "./commands/new.ts";
+import { runServeCommand } from "./commands/serve.ts";
+import { config } from "./config.ts";
+
+if (import.meta.main) {
+ const command = Deno.args[0] ?? "build";
+ if (command === "build") {
+ await runBuildCommand(config);
+ } else if (command === "new") {
+ runNewCommand(config);
+ } else if (command === "serve") {
+ runServeCommand(config);
+ } else {
+ console.error(`Unknown command: ${command}`);
+ }
+}
diff --git a/vhosts/blog/nuldoc-src/page.ts b/vhosts/blog/nuldoc-src/page.ts
new file mode 100644
index 00000000..f4a6166b
--- /dev/null
+++ b/vhosts/blog/nuldoc-src/page.ts
@@ -0,0 +1,9 @@
+import { Element } from "./dom.ts";
+import { RendererType } from "./render.ts";
+
+export interface Page {
+ root: Element;
+ renderer: RendererType;
+ destFilePath: string;
+ href: string;
+}
diff --git a/vhosts/blog/nuldoc-src/pages/about.ts b/vhosts/blog/nuldoc-src/pages/about.ts
new file mode 100644
index 00000000..acba113b
--- /dev/null
+++ b/vhosts/blog/nuldoc-src/pages/about.ts
@@ -0,0 +1,183 @@
+import { globalFooter } from "../components/global_footer.ts";
+import { globalHeader } from "../components/global_header.ts";
+import { pageLayout } from "../components/page_layout.ts";
+import { staticScriptElement } from "../components/utils.ts";
+import { Config } from "../config.ts";
+import { el, text } from "../dom.ts";
+import { Page } from "../page.ts";
+import { dateToString } from "../revision.ts";
+import { getPostCreatedDate } from "./post.ts";
+import { SlidePage } from "./slide.ts";
+
+export type AboutPage = Page;
+
+export async function generateAboutPage(
+ slides: SlidePage[],
+ config: Config,
+): Promise<AboutPage> {
+ const body = el(
+ "body",
+ [["class", "single"]],
+ globalHeader(config),
+ el(
+ "main",
+ [["class", "main"]],
+ el(
+ "article",
+ [["class", "post-single"]],
+ el(
+ "header",
+ [["class", "post-header"]],
+ el(
+ "h1",
+ [["class", "post-title"]],
+ text("nsfisis"),
+ ),
+ el(
+ "div",
+ [["class", "my-icon"]],
+ await staticScriptElement("/p5.min.js", [], config),
+ await staticScriptElement("/my-icon.js", [], config),
+ el("div", [["id", "p5jsMyIcon"]]),
+ el(
+ "noscript",
+ [],
+ el(
+ "img",
+ [["src", "/favicon.svg"]],
+ ),
+ ),
+ ),
+ ),
+ el(
+ "div",
+ [["class", "post-content"]],
+ el(
+ "section",
+ [],
+ el(
+ "h2",
+ [],
+ text("読み方"),
+ ),
+ el(
+ "p",
+ [],
+ text(
+ "読み方は決めていません。音にする必要があるときは本名である「いまむら」をお使いください。",
+ ),
+ ),
+ ),
+ el(
+ "section",
+ [],
+ el(
+ "h2",
+ [],
+ text("アカウント"),
+ ),
+ el(
+ "ul",
+ [],
+ el(
+ "li",
+ [],
+ el(
+ "a",
+ [["href", "https://twitter.com/nsfisis"]],
+ text("Twitter (現 𝕏): @nsfisis"),
+ ),
+ ),
+ el(
+ "li",
+ [],
+ el(
+ "a",
+ [["href", "https://github.com/nsfisis"]],
+ text("GitHub: @nsfisis"),
+ ),
+ ),
+ ),
+ ),
+ el(
+ "section",
+ [],
+ el(
+ "h2",
+ [],
+ text("仕事"),
+ ),
+ el(
+ "ul",
+ [],
+ el(
+ "li",
+ [],
+ text("2021-01~現在: "),
+ el(
+ "a",
+ [["href", "https://www.dgcircus.com/"]],
+ text("デジタルサーカス株式会社"),
+ ),
+ ),
+ ),
+ ),
+ el(
+ "section",
+ [],
+ el(
+ "h2",
+ [],
+ text("登壇"),
+ ),
+ el(
+ "ul",
+ [],
+ ...Array.from(slides).sort((a, b) => {
+ const ta = dateToString(getPostCreatedDate(a));
+ const tb = dateToString(getPostCreatedDate(b));
+ if (ta > tb) return -1;
+ if (ta < tb) return 1;
+ return 0;
+ }).map((slide) =>
+ el(
+ "li",
+ [],
+ el(
+ "a",
+ [["href", slide.href]],
+ text(
+ `${
+ dateToString(getPostCreatedDate(slide))
+ }: ${slide.event} (${slide.talkType})`,
+ ),
+ ),
+ )
+ ),
+ ),
+ ),
+ ),
+ ),
+ ),
+ globalFooter(config),
+ );
+
+ const html = await pageLayout(
+ {
+ metaCopyrightYear: config.blog.siteCopyrightYear,
+ metaDescription: "このサイトの著者について",
+ metaKeywords: [],
+ metaTitle: `About | ${config.blog.siteName}`,
+ requiresSyntaxHighlight: false,
+ },
+ body,
+ config,
+ );
+
+ return {
+ root: el("__root__", [], html),
+ renderer: "html",
+ destFilePath: "/about/index.html",
+ href: "/about/",
+ };
+}
diff --git a/vhosts/blog/nuldoc-src/pages/home.ts b/vhosts/blog/nuldoc-src/pages/home.ts
new file mode 100644
index 00000000..a240278a
--- /dev/null
+++ b/vhosts/blog/nuldoc-src/pages/home.ts
@@ -0,0 +1,96 @@
+import { globalFooter } from "../components/global_footer.ts";
+import { globalHeader } from "../components/global_header.ts";
+import { pageLayout } from "../components/page_layout.ts";
+import { Config } from "../config.ts";
+import { el, text } from "../dom.ts";
+import { Page } from "../page.ts";
+
+export type HomePage = Page;
+
+export async function generateHomePage(config: Config): Promise<HomePage> {
+ const body = el(
+ "body",
+ [["class", "single"]],
+ globalHeader(config),
+ el(
+ "main",
+ [["class", "main"]],
+ el(
+ "article",
+ [["class", "post-single"]],
+ el(
+ "article",
+ [["class", "post-entry"]],
+ el(
+ "a",
+ [["href", "/about/"]],
+ el(
+ "header",
+ [["class", "entry-header"]],
+ el("h2", [], text("About")),
+ ),
+ ),
+ ),
+ el(
+ "article",
+ [["class", "post-entry"]],
+ el(
+ "a",
+ [["href", "/posts/"]],
+ el(
+ "header",
+ [["class", "entry-header"]],
+ el("h2", [], text("Posts")),
+ ),
+ ),
+ ),
+ el(
+ "article",
+ [["class", "post-entry"]],
+ el(
+ "a",
+ [["href", "/slides/"]],
+ el(
+ "header",
+ [["class", "entry-header"]],
+ el("h2", [], text("Slides")),
+ ),
+ ),
+ ),
+ el(
+ "article",
+ [["class", "post-entry"]],
+ el(
+ "a",
+ [["href", "/tags/"]],
+ el(
+ "header",
+ [["class", "entry-header"]],
+ el("h2", [], text("Tags")),
+ ),
+ ),
+ ),
+ ),
+ ),
+ globalFooter(config),
+ );
+
+ const html = await pageLayout(
+ {
+ metaCopyrightYear: config.blog.siteCopyrightYear,
+ metaDescription: "nsfisis のブログサイト",
+ metaKeywords: [],
+ metaTitle: config.blog.siteName,
+ requiresSyntaxHighlight: false,
+ },
+ body,
+ config,
+ );
+
+ return {
+ root: el("__root__", [], html),
+ renderer: "html",
+ destFilePath: "/index.html",
+ href: "/",
+ };
+}
diff --git a/vhosts/blog/nuldoc-src/pages/not_found.ts b/vhosts/blog/nuldoc-src/pages/not_found.ts
new file mode 100644
index 00000000..a1b6109b
--- /dev/null
+++ b/vhosts/blog/nuldoc-src/pages/not_found.ts
@@ -0,0 +1,51 @@
+import { globalFooter } from "../components/global_footer.ts";
+import { globalHeader } from "../components/global_header.ts";
+import { pageLayout } from "../components/page_layout.ts";
+import { Config } from "../config.ts";
+import { el, text } from "../dom.ts";
+import { Page } from "../page.ts";
+
+export type NotFoundPage = Page;
+
+export async function generateNotFoundPage(
+ config: Config,
+): Promise<NotFoundPage> {
+ const body = el(
+ "body",
+ [["class", "single"]],
+ globalHeader(config),
+ el(
+ "main",
+ [["class", "main"]],
+ el(
+ "article",
+ [],
+ el(
+ "div",
+ [["class", "not-found"]],
+ text("404"),
+ ),
+ ),
+ ),
+ globalFooter(config),
+ );
+
+ const html = await pageLayout(
+ {
+ metaCopyrightYear: config.blog.siteCopyrightYear,
+ metaDescription: "リクエストされたページが見つかりません。",
+ metaKeywords: [],
+ metaTitle: `Page Not Found | ${config.blog.siteName}`,
+ requiresSyntaxHighlight: false,
+ },
+ body,
+ config,
+ );
+
+ return {
+ root: el("__root__", [], html),
+ renderer: "html",
+ destFilePath: "/404.html",
+ href: "/404.html",
+ };
+}
diff --git a/vhosts/blog/nuldoc-src/pages/post.ts b/vhosts/blog/nuldoc-src/pages/post.ts
new file mode 100644
index 00000000..24a6d5f5
--- /dev/null
+++ b/vhosts/blog/nuldoc-src/pages/post.ts
@@ -0,0 +1,140 @@
+import { join } from "std/path/mod.ts";
+import { globalFooter } from "../components/global_footer.ts";
+import { globalHeader } from "../components/global_header.ts";
+import { pageLayout } from "../components/page_layout.ts";
+import { Config, getTagLabel } from "../config.ts";
+import { el, Element, text } from "../dom.ts";
+import { Document } from "../docbook/document.ts";
+import { Page } from "../page.ts";
+import { Date, dateToString, Revision } from "../revision.ts";
+
+export interface PostPage extends Page {
+ title: string;
+ summary: string;
+ tags: string[];
+ revisions: Revision[];
+}
+
+export function getPostCreatedDate(page: { revisions: Revision[] }): Date {
+ return page.revisions[0].date;
+}
+
+export function getPostUpdatedDate(page: { revisions: Revision[] }): Date {
+ return page.revisions[page.revisions.length - 1].date;
+}
+
+export async function generatePostPage(
+ doc: Document,
+ config: Config,
+): Promise<PostPage> {
+ const body = el(
+ "body",
+ [["class", "single"]],
+ globalHeader(config),
+ el(
+ "main",
+ [["class", "main"]],
+ el(
+ "article",
+ [["class", "post-single"]],
+ el(
+ "header",
+ [["class", "post-header"]],
+ el(
+ "h1",
+ [["class", "post-title"]],
+ text(doc.title),
+ ),
+ ...(doc.tags.length === 0 ? [] : [
+ el(
+ "ul",
+ [["class", "post-tags"]],
+ ...doc.tags.map((slug) =>
+ el(
+ "li",
+ [["class", "tag"]],
+ el(
+ "a",
+ [["href", `/tags/${slug}/`]],
+ text(
+ getTagLabel(config, slug),
+ ),
+ ),
+ )
+ ),
+ ),
+ ]),
+ ),
+ el(
+ "div",
+ [["class", "post-content"]],
+ el(
+ "section",
+ [],
+ el(
+ "h2",
+ [["id", "changelog"]],
+ text("更新履歴"),
+ ),
+ el(
+ "ol",
+ [],
+ ...doc.revisions.map((rev) =>
+ el(
+ "li",
+ [["class", "revision"]],
+ el(
+ "time",
+ [["datetime", dateToString(rev.date)]],
+ text(dateToString(rev.date)),
+ ),
+ text(`: ${rev.remark}`),
+ )
+ ),
+ ),
+ ),
+ // TODO: refactor
+ ...(doc.root.children[0] as Element).children,
+ // TODO: footnotes
+ // <div id="footnotes">
+ // <% for footnote in footnotes %>
+ // <div class="footnote" id="_footnotedef_<%= footnote.index %>">
+ // <a href="#_footnoteref_<%= footnote.index %>"><%= footnote.index %></a>. <%= footnote.text %>
+ // </div>
+ // <% end %>
+ // </div>
+ ),
+ ),
+ ),
+ globalFooter(config),
+ );
+
+ const html = await pageLayout(
+ {
+ metaCopyrightYear: getPostCreatedDate(doc).year,
+ metaDescription: doc.summary,
+ metaKeywords: doc.tags.map((slug) => getTagLabel(config, slug)),
+ metaTitle: `${doc.title} | ${config.blog.siteName}`,
+ requiresSyntaxHighlight: true,
+ },
+ body,
+ config,
+ );
+
+ const cwd = Deno.cwd();
+ const contentDir = join(cwd, config.locations.contentDir);
+ const destFilePath = join(
+ doc.sourceFilePath.replace(contentDir, "").replace(".xml", ""),
+ "index.html",
+ );
+ return {
+ root: el("__root__", [], html),
+ renderer: "html",
+ destFilePath: destFilePath,
+ href: destFilePath.replace("index.html", ""),
+ title: doc.title,
+ summary: doc.summary,
+ tags: doc.tags,
+ revisions: doc.revisions,
+ };
+}
diff --git a/vhosts/blog/nuldoc-src/pages/post_list.ts b/vhosts/blog/nuldoc-src/pages/post_list.ts
new file mode 100644
index 00000000..498b3efb
--- /dev/null
+++ b/vhosts/blog/nuldoc-src/pages/post_list.ts
@@ -0,0 +1,64 @@
+import { globalFooter } from "../components/global_footer.ts";
+import { globalHeader } from "../components/global_header.ts";
+import { pageLayout } from "../components/page_layout.ts";
+import { postPageEntry } from "../components/post_page_entry.ts";
+import { Config } from "../config.ts";
+import { el, text } from "../dom.ts";
+import { Page } from "../page.ts";
+import { dateToString } from "../revision.ts";
+import { getPostCreatedDate, PostPage } from "./post.ts";
+
+export type PostListPage = Page;
+
+export async function generatePostListPage(
+ posts: PostPage[],
+ config: Config,
+): Promise<PostListPage> {
+ const pageTitle = "投稿一覧";
+
+ const body = el(
+ "body",
+ [["class", "list"]],
+ globalHeader(config),
+ el(
+ "main",
+ [["class", "main"]],
+ el(
+ "header",
+ [["class", "page-header"]],
+ el(
+ "h1",
+ [],
+ text(pageTitle),
+ ),
+ ),
+ ...Array.from(posts).sort((a, b) => {
+ const ta = dateToString(getPostCreatedDate(a));
+ const tb = dateToString(getPostCreatedDate(b));
+ if (ta > tb) return -1;
+ if (ta < tb) return 1;
+ return 0;
+ }).map((post) => postPageEntry(post)),
+ ),
+ globalFooter(config),
+ );
+
+ const html = await pageLayout(
+ {
+ metaCopyrightYear: config.blog.siteCopyrightYear,
+ metaDescription: "投稿した記事の一覧",
+ metaKeywords: [],
+ metaTitle: `${pageTitle} | ${config.blog.siteName}`,
+ requiresSyntaxHighlight: false,
+ },
+ body,
+ config,
+ );
+
+ return {
+ root: el("__root__", [], html),
+ renderer: "html",
+ destFilePath: "/posts/index.html",
+ href: "/posts/",
+ };
+}
diff --git a/vhosts/blog/nuldoc-src/pages/slide.ts b/vhosts/blog/nuldoc-src/pages/slide.ts
new file mode 100644
index 00000000..a75aeb68
--- /dev/null
+++ b/vhosts/blog/nuldoc-src/pages/slide.ts
@@ -0,0 +1,140 @@
+import { join } from "std/path/mod.ts";
+import { globalFooter } from "../components/global_footer.ts";
+import { globalHeader } from "../components/global_header.ts";
+import { pageLayout } from "../components/page_layout.ts";
+import { staticScriptElement } from "../components/utils.ts";
+import { Config, getTagLabel } from "../config.ts";
+import { el, text } from "../dom.ts";
+import { Page } from "../page.ts";
+import { dateToString, Revision } from "../revision.ts";
+import { Slide } from "../slide/slide.ts";
+import { getPostCreatedDate } from "./post.ts";
+
+export interface SlidePage extends Page {
+ title: string;
+ event: string;
+ talkType: string;
+ slideLink: string;
+ tags: string[];
+ revisions: Revision[];
+}
+
+export async function generateSlidePage(
+ slide: Slide,
+ config: Config,
+): Promise<SlidePage> {
+ const body = el(
+ "body",
+ [["class", "single"]],
+ globalHeader(config),
+ el(
+ "main",
+ [["class", "main"]],
+ el(
+ "article",
+ [["class", "post-single"]],
+ el(
+ "header",
+ [["class", "post-header"]],
+ el(
+ "h1",
+ [["class", "post-title"]],
+ text(slide.title),
+ ),
+ ...(slide.tags.length === 0 ? [] : [
+ el(
+ "ul",
+ [["class", "post-tags"]],
+ ...slide.tags.map((slug) =>
+ el(
+ "li",
+ [["class", "tag"]],
+ el(
+ "a",
+ [["href", `/tags/${slug}/`]],
+ text(
+ getTagLabel(config, slug),
+ ),
+ ),
+ )
+ ),
+ ),
+ ]),
+ ),
+ el(
+ "div",
+ [["class", "post-content"]],
+ el(
+ "section",
+ [],
+ el(
+ "h2",
+ [["id", "changelog"]],
+ text("更新履歴"),
+ ),
+ el(
+ "ol",
+ [],
+ ...slide.revisions.map((rev) =>
+ el(
+ "li",
+ [["class", "revision"]],
+ el(
+ "time",
+ [["datetime", dateToString(rev.date)]],
+ text(dateToString(rev.date)),
+ ),
+ text(`: ${rev.remark}`),
+ )
+ ),
+ ),
+ ),
+ el(
+ "canvas",
+ [["id", "slide"], ["data-slide-link", slide.slideLink]],
+ ),
+ el(
+ "div",
+ [],
+ el("button", [["id", "prev"]], text("Prev")),
+ el("button", [["id", "next"]], text("Next")),
+ ),
+ await staticScriptElement("/pdf.min.js", [], config),
+ await staticScriptElement("/slide.js", [["type", "module"]], config),
+ ),
+ ),
+ ),
+ globalFooter(config),
+ );
+
+ const html = await pageLayout(
+ {
+ metaCopyrightYear: getPostCreatedDate(slide).year,
+ metaDescription: slide.title,
+ metaKeywords: slide.tags.map((slug) => getTagLabel(config, slug)),
+ metaTitle: `${slide.event} (${slide.talkType}) | ${config.blog.siteName}`,
+ requiresSyntaxHighlight: true,
+ },
+ body,
+ config,
+ );
+
+ const cwd = Deno.cwd();
+ const contentDir = join(cwd, config.locations.contentDir);
+ const destFilePath = join(
+ slide.sourceFilePath.replace(contentDir, "").replace(".xml", ""),
+ "index.html",
+ );
+ return {
+ root: el("__root__", [], html),
+ renderer: "html",
+ destFilePath: destFilePath,
+ href: destFilePath.replace("index.html", ""),
+ title: slide.title,
+ event: slide.event,
+ talkType: slide.talkType,
+ slideLink: slide.slideLink,
+ tags: slide.tags,
+ revisions: slide.revisions,
+ };
+}
diff --git a/vhosts/blog/nuldoc-src/pages/slide_list.ts b/vhosts/blog/nuldoc-src/pages/slide_list.ts
new file mode 100644
index 00000000..5031436d
--- /dev/null
+++ b/vhosts/blog/nuldoc-src/pages/slide_list.ts
@@ -0,0 +1,65 @@
+import { globalFooter } from "../components/global_footer.ts";
+import { globalHeader } from "../components/global_header.ts";
+import { pageLayout } from "../components/page_layout.ts";
+import { slidePageEntry } from "../components/slide_page_entry.ts";
+import { Config } from "../config.ts";
+import { el, text } from "../dom.ts";
+import { Page } from "../page.ts";
+import { dateToString } from "../revision.ts";
+import { getPostCreatedDate } from "./post.ts";
+import { SlidePage } from "./slide.ts";
+
+export type SlideListPage = Page;
+
+export async function generateSlideListPage(
+ slides: SlidePage[],
+ config: Config,
+): Promise<SlideListPage> {
+ const pageTitle = "スライド一覧";
+
+ const body = el(
+ "body",
+ [["class", "list"]],
+ globalHeader(config),
+ el(
+ "main",
+ [["class", "main"]],
+ el(
+ "header",
+ [["class", "page-header"]],
+ el(
+ "h1",
+ [],
+ text(pageTitle),
+ ),
+ ),
+ ...Array.from(slides).sort((a, b) => {
+ const ta = dateToString(getPostCreatedDate(a));
+ const tb = dateToString(getPostCreatedDate(b));
+ if (ta > tb) return -1;
+ if (ta < tb) return 1;
+ return 0;
+ }).map((slide) => slidePageEntry(slide)),
+ ),
+ globalFooter(config),
+ );
+
+ const html = await pageLayout(
+ {
+ metaCopyrightYear: config.blog.siteCopyrightYear,
+ metaDescription: "登壇したイベントで使用したスライドの一覧",
+ metaKeywords: [],
+ metaTitle: `${pageTitle} | ${config.blog.siteName}`,
+ requiresSyntaxHighlight: false,
+ },
+ body,
+ config,
+ );
+
+ return {
+ root: el("__root__", [], html),
+ renderer: "html",
+ destFilePath: "/slides/index.html",
+ href: "/slides/",
+ };
+}
diff --git a/vhosts/blog/nuldoc-src/pages/tag.ts b/vhosts/blog/nuldoc-src/pages/tag.ts
new file mode 100644
index 00000000..f501cb33
--- /dev/null
+++ b/vhosts/blog/nuldoc-src/pages/tag.ts
@@ -0,0 +1,60 @@
+import { globalFooter } from "../components/global_footer.ts";
+import { globalHeader } from "../components/global_header.ts";
+import { pageLayout } from "../components/page_layout.ts";
+import { postPageEntry } from "../components/post_page_entry.ts";
+import { slidePageEntry } from "../components/slide_page_entry.ts";
+import { Config, getTagLabel } from "../config.ts";
+import { el, text } from "../dom.ts";
+import { Page } from "../page.ts";
+import { getPostCreatedDate } from "./post.ts";
+import { TaggedPage } from "./tagged_page.ts";
+
+export interface TagPage extends Page {
+ tagSlug: string;
+ tagLabel: string;
+}
+
+export async function generateTagPage(
+ tagSlug: string,
+ pages: TaggedPage[],
+ config: Config,
+): Promise<TagPage> {
+ const tagLabel = getTagLabel(config, tagSlug);
+ const pageTitle = `タグ「${tagLabel}」一覧`;
+
+ const body = el(
+ "body",
+ [["class", "list"]],
+ globalHeader(config),
+ el(
+ "main",
+ [["class", "main"]],
+ el("header", [["class", "page-header"]], el("h1", [], text(pageTitle))),
+ ...pages.map((page) =>
+ "event" in page ? slidePageEntry(page) : postPageEntry(page)
+ ),
+ ),
+ globalFooter(config),
+ );
+
+ const html = await pageLayout(
+ {
+ metaCopyrightYear: getPostCreatedDate(pages[pages.length - 1]).year,
+ metaDescription: `タグ「${tagLabel}」のついた記事またはスライドの一覧`,
+ metaKeywords: [tagLabel],
+ metaTitle: `${pageTitle} | ${config.blog.siteName}`,
+ requiresSyntaxHighlight: false,
+ },
+ body,
+ config,
+ );
+
+ return {
+ root: el("__root__", [], html),
+ renderer: "html",
+ destFilePath: `/tags/${tagSlug}/index.html`,
+ href: `/tags/${tagSlug}/`,
+ tagSlug: tagSlug,
+ tagLabel: tagLabel,
+ };
+}
diff --git a/vhosts/blog/nuldoc-src/pages/tag_list.ts b/vhosts/blog/nuldoc-src/pages/tag_list.ts
new file mode 100644
index 00000000..2b58ff32
--- /dev/null
+++ b/vhosts/blog/nuldoc-src/pages/tag_list.ts
@@ -0,0 +1,76 @@
+import { globalFooter } from "../components/global_footer.ts";
+import { globalHeader } from "../components/global_header.ts";
+import { pageLayout } from "../components/page_layout.ts";
+import { Config } from "../config.ts";
+import { el, text } from "../dom.ts";
+import { Page } from "../page.ts";
+import { TagPage } from "./tag.ts";
+
+export type TagListPage = Page;
+
+export async function generateTagListPage(
+ tags: TagPage[],
+ config: Config,
+): Promise<TagListPage> {
+ const pageTitle = "タグ一覧";
+
+ const body = el(
+ "body",
+ [["class", "list"]],
+ globalHeader(config),
+ el(
+ "main",
+ [["class", "main"]],
+ el(
+ "header",
+ [["class", "page-header"]],
+ el(
+ "h1",
+ [],
+ text(pageTitle),
+ ),
+ ),
+ ...Array.from(tags).sort((a, b) => {
+ const ta = a.tagSlug;
+ const tb = b.tagSlug;
+ if (ta < tb) return -1;
+ if (ta > tb) return 1;
+ return 0;
+ }).map((tag) =>
+ el(
+ "article",
+ [["class", "post-entry"]],
+ el(
+ "a",
+ [["href", tag.href]],
+ el(
+ "header",
+ [["class", "entry-header"]],
+ el("h2", [], text(tag.tagLabel)),
+ ),
+ ),
+ )
+ ),
+ ),
+ globalFooter(config),
+ );
+
+ const html = await pageLayout(
+ {
+ metaCopyrightYear: config.blog.siteCopyrightYear,
+ metaDescription: "タグの一覧",
+ metaKeywords: [],
+ metaTitle: `${pageTitle} | ${config.blog.siteName}`,
+ requiresSyntaxHighlight: false,
+ },
+ body,
+ config,
+ );
+
+ return {
+ root: el("__root__", [], html),
+ renderer: "html",
+ destFilePath: "/tags/index.html",
+ href: "/tags/",
+ };
+}
diff --git a/vhosts/blog/nuldoc-src/pages/tagged_page.ts b/vhosts/blog/nuldoc-src/pages/tagged_page.ts
new file mode 100644
index 00000000..23de8cb4
--- /dev/null
+++ b/vhosts/blog/nuldoc-src/pages/tagged_page.ts
@@ -0,0 +1,4 @@
+import { PostPage } from "./post.ts";
+import { SlidePage } from "./slide.ts";
+
+export type TaggedPage = PostPage | SlidePage;
diff --git a/vhosts/blog/nuldoc-src/render.ts b/vhosts/blog/nuldoc-src/render.ts
new file mode 100644
index 00000000..feb72a4b
--- /dev/null
+++ b/vhosts/blog/nuldoc-src/render.ts
@@ -0,0 +1,13 @@
+import { Node } from "./dom.ts";
+import { renderHtml } from "./renderers/html.ts";
+
+// export type RendererType = "html" | "xml";
+export type RendererType = "html";
+
+export function render(root: Node, renderer: RendererType): string {
+ if (renderer === "html") {
+ return renderHtml(root);
+ } else {
+ return renderHtml(root);
+ }
+}
diff --git a/vhosts/blog/nuldoc-src/renderers/html.ts b/vhosts/blog/nuldoc-src/renderers/html.ts
new file mode 100644
index 00000000..3b6c6ebc
--- /dev/null
+++ b/vhosts/blog/nuldoc-src/renderers/html.ts
@@ -0,0 +1,275 @@
+import { Element, forEachChild, Node, Text } from "../dom.ts";
+import { DocBookError } from "../errors.ts";
+
+export function renderHtml(root: Node): string {
+ return `<!DOCTYPE html>\n` + nodeToHtmlText(root, {
+ indentLevel: -1,
+ isInPre: false,
+ });
+}
+
+type Context = {
+ indentLevel: number;
+ isInPre: boolean;
+};
+
+type Dtd = { type: "block" | "inline"; auto_closing?: boolean };
+
+function getDtd(name: string): Dtd {
+ switch (name) {
+ case "__root__":
+ return { type: "block" };
+ case "a":
+ return { type: "inline" };
+ case "article":
+ return { type: "block" };
+ case "blockquote":
+ return { type: "block" };
+ case "body":
+ return { type: "block" };
+ case "br":
+ return { type: "block", auto_closing: true };
+ case "button":
+ return { type: "block" };
+ case "canvas":
+ return { type: "block" };
+ case "code":
+ return { type: "inline" };
+ case "div":
+ return { type: "block" };
+ case "em":
+ return { type: "inline" };
+ case "footer":
+ return { type: "block" };
+ case "h1":
+ return { type: "inline" };
+ case "h2":
+ return { type: "inline" };
+ case "h3":
+ return { type: "inline" };
+ case "h4":
+ return { type: "inline" };
+ case "h5":
+ return { type: "inline" };
+ case "h6":
+ return { type: "inline" };
+ case "head":
+ return { type: "block" };
+ case "header":
+ return { type: "block" };
+ case "hr":
+ return { type: "block" };
+ case "html":
+ return { type: "block" };
+ case "img":
+ return { type: "block" };
+ case "li":
+ return { type: "block" };
+ case "link":
+ return { type: "block", auto_closing: true };
+ case "main":
+ return { type: "block" };
+ case "meta":
+ return { type: "block", auto_closing: true };
+ case "nav":
+ return { type: "block" };
+ case "noscript":
+ return { type: "block" };
+ case "ol":
+ return { type: "block" };
+ case "p":
+ return { type: "block" };
+ case "pre":
+ return { type: "block" };
+ case "script":
+ return { type: "block" };
+ case "section":
+ return { type: "block" };
+ case "span":
+ return { type: "inline" };
+ case "sup":
+ return { type: "inline" };
+ case "table":
+ return { type: "block" };
+ case "tbody":
+ return { type: "block" };
+ case "td": // TODO
+ return { type: "block" };
+ case "tfoot":
+ return { type: "block" };
+ case "thead":
+ return { type: "block" };
+ case "time":
+ return { type: "inline" };
+ case "title": // TODO
+ return { type: "inline" };
+ case "tr":
+ return { type: "block" };
+ case "ul":
+ return { type: "block" };
+ default:
+ throw new DocBookError(`[html.write] Unknown element name: ${name}`);
+ }
+}
+
+function isInlineNode(n: Node): boolean {
+ if (n.kind === "text") {
+ return true;
+ }
+ if (n.name !== "a") {
+ return getDtd(n.name).type === "inline";
+ }
+
+ // a tag: check if all children are inline elements.
+ let allInline = true;
+ forEachChild(n, (c) => allInline &&= isInlineNode(c));
+ return allInline;
+}
+
+function isBlockNode(n: Node): boolean {
+ return !isInlineNode(n);
+}
+
+function nodeToHtmlText(n: Node, ctx: Context): string {
+ if (n.kind === "text") {
+ if (n.raw) {
+ return n.content;
+ } else {
+ return textNodeToHtmlText(n, ctx);
+ }
+ } else {
+ return elementNodeToHtmlText(n, ctx);
+ }
+}
+
+function textNodeToHtmlText(t: Text, ctx: Context): string {
+ const s = encodeSpecialCharacters(t.content);
+ if (ctx.isInPre) return s;
+
+ // TODO: 日本語で改行するときはスペースを入れない
+ return s.replaceAll(/\n */g, " ");
+}
+
+function encodeSpecialCharacters(s: string): string {
+ return s.replaceAll(/&(?!\w+;)/g, "&amp;")
+ .replaceAll(/</g, "&lt;")
+ .replaceAll(/>/g, "&gt;")
+ .replaceAll(/'/g, "&apos;")
+ .replaceAll(/"/g, "&quot;");
+}
+
+function elementNodeToHtmlText(e: Element, ctx: Context): string {
+ const dtd = getDtd(e.name);
+
+ let s = "";
+ if (e.name !== "__root__") {
+ if (isBlockNode(e)) {
+ s += indent(ctx);
+ }
+ s += `<${e.name}`;
+ const attributes = getElementAttributes(e);
+ if (attributes.length > 0) {
+ s += " ";
+ for (let i = 0; i < attributes.length; i++) {
+ const [name, value] = attributes[i];
+ s += `${name}="${value}"`;
+ if (i !== attributes.length - 1) {
+ s += " ";
+ }
+ }
+ }
+ s += ">";
+ if (isBlockNode(e) && e.name !== "pre") {
+ s += "\n";
+ }
+ }
+ ctx.indentLevel += 1;
+
+ let prevChild: Node | null = null;
+ if (e.name === "pre") {
+ ctx.isInPre = true;
+ }
+ forEachChild(e, (c) => {
+ if (isBlockNode(e) && !ctx.isInPre) {
+ if (isInlineNode(c)) {
+ if (needsIndent(prevChild)) {
+ s += indent(ctx);
+ }
+ } else {
+ if (needsLineBreak(prevChild)) {
+ s += "\n";
+ }
+ }
+ }
+ s += nodeToHtmlText(c, ctx);
+ prevChild = c;
+ });
+ if (e.name === "pre") {
+ ctx.isInPre = false;
+ }
+
+ ctx.indentLevel -= 1;
+ if (e.name !== "__root__" && !dtd.auto_closing) {
+ if (e.name !== "pre") {
+ if (isBlockNode(e)) {
+ if (needsLineBreak(prevChild)) {
+ s += "\n";
+ }
+ s += indent(ctx);
+ }
+ }
+ s += `</${e.name}>`;
+ if (isBlockNode(e)) {
+ s += "\n";
+ }
+ }
+ return s;
+}
+
+function indent(ctx: Context): string {
+ return " ".repeat(ctx.indentLevel);
+}
+
+function getElementAttributes(e: Element): [string, string][] {
+ return [...e.attributes.entries()]
+ .filter((a) => !a[0].startsWith("--"))
+ .sort(
+ (a, b) => {
+ // Special rules:
+ if (e.name === "meta") {
+ if (a[0] === "content" && b[0] === "name") {
+ return 1;
+ }
+ if (a[0] === "name" && b[0] === "content") {
+ return -1;
+ }
+ }
+ if (e.name === "link") {
+ if (a[0] === "href" && b[0] === "rel") {
+ return 1;
+ }
+ if (a[0] === "rel" && b[0] === "href") {
+ return -1;
+ }
+ if (a[0] === "href" && b[0] === "type") {
+ return 1;
+ }
+ if (a[0] === "type" && b[0] === "href") {
+ return -1;
+ }
+ }
+ // General rules:
+ if (a[0] > b[0]) return 1;
+ else if (a[0] < b[0]) return -1;
+ else return 0;
+ },
+ );
+}
+
+function needsIndent(prevChild: Node | null): boolean {
+ return !prevChild || isBlockNode(prevChild);
+}
+
+function needsLineBreak(prevChild: Node | null): boolean {
+ return !needsIndent(prevChild);
+}
diff --git a/vhosts/blog/nuldoc-src/revision.ts b/vhosts/blog/nuldoc-src/revision.ts
new file mode 100644
index 00000000..e04b7ba1
--- /dev/null
+++ b/vhosts/blog/nuldoc-src/revision.ts
@@ -0,0 +1,27 @@
+export type Date = {
+ year: number;
+ month: number;
+ day: number;
+};
+
+export function stringToDate(s: string): Date {
+ const match = s.match(/(\d{4})-(\d{2})-(\d{2})/);
+ if (match === null) {
+ throw new Error();
+ }
+ const [_, y, m, d] = match;
+ return { year: parseInt(y), month: parseInt(m), day: parseInt(d) };
+}
+
+export function dateToString(date: Date): string {
+ const y = `${date.year}`.padStart(4, "0");
+ const m = `${date.month}`.padStart(2, "0");
+ const d = `${date.day}`.padStart(2, "0");
+ return `${y}-${m}-${d}`;
+}
+
+export type Revision = {
+ number: number;
+ date: Date;
+ remark: string;
+};
diff --git a/vhosts/blog/nuldoc-src/slide/parse.ts b/vhosts/blog/nuldoc-src/slide/parse.ts
new file mode 100644
index 00000000..00ff645f
--- /dev/null
+++ b/vhosts/blog/nuldoc-src/slide/parse.ts
@@ -0,0 +1,19 @@
+import { Config } from "../config.ts";
+import { parseXmlFile } from "../xml.ts";
+import { SlideError, XmlParseError } from "../errors.ts";
+import { createNewSlideFromRootElement, Slide } from "./slide.ts";
+
+export async function parseSlideFile(
+ filePath: string,
+ config: Config,
+): Promise<Slide> {
+ try {
+ const root = await parseXmlFile(filePath);
+ return createNewSlideFromRootElement(root, filePath, config);
+ } catch (e) {
+ if (e instanceof SlideError || e instanceof XmlParseError) {
+ e.message = `${e.message} in ${filePath}`;
+ }
+ throw e;
+ }
+}
diff --git a/vhosts/blog/nuldoc-src/slide/slide.ts b/vhosts/blog/nuldoc-src/slide/slide.ts
new file mode 100644
index 00000000..a982d4f2
--- /dev/null
+++ b/vhosts/blog/nuldoc-src/slide/slide.ts
@@ -0,0 +1,122 @@
+import { Config } from "../config.ts";
+import { SlideError } from "../errors.ts";
+import { Revision, stringToDate } from "../revision.ts";
+import {
+ Element,
+ findChildElements,
+ findFirstChildElement,
+ innerText,
+} from "../dom.ts";
+
+export type Slide = {
+ sourceFilePath: string;
+ title: string;
+ event: string;
+ talkType: string;
+ slideLink: string;
+ tags: string[];
+ revisions: Revision[];
+};
+
+export function createNewSlideFromRootElement(
+ root: Element,
+ sourceFilePath: string,
+ _config: Config,
+): Slide {
+ const slide = findFirstChildElement(root, "slide");
+ if (!slide) {
+ throw new SlideError(
+ `[slide.new] <slide> element not found`,
+ );
+ }
+ const info = findFirstChildElement(slide, "info");
+ if (!info) {
+ throw new SlideError(
+ `[slide.new] <info> element not found`,
+ );
+ }
+
+ const titleElement = findFirstChildElement(info, "title");
+ if (!titleElement) {
+ throw new SlideError(
+ `[slide.new] <title> element not found`,
+ );
+ }
+ const title = innerText(titleElement).trim();
+
+ const eventElement = findFirstChildElement(info, "event");
+ if (!eventElement) {
+ throw new SlideError(
+ `[slide.new] <event> element not found`,
+ );
+ }
+ const event = innerText(eventElement).trim();
+
+ const talkTypeElement = findFirstChildElement(info, "talktype");
+ if (!talkTypeElement) {
+ throw new SlideError(
+ `[slide.new] <talktype> element not found`,
+ );
+ }
+ const talkType = innerText(talkTypeElement).trim();
+
+ const slideLinkElement = findFirstChildElement(info, "link");
+ if (!slideLinkElement) {
+ throw new SlideError(
+ `[slide.new] <link> element not found`,
+ );
+ }
+ const slideLink = innerText(slideLinkElement).trim();
+
+ const keywordsetElement = findFirstChildElement(info, "keywordset");
+ let tags: string[];
+ if (!keywordsetElement) {
+ tags = [];
+ } else {
+ tags = findChildElements(keywordsetElement, "keyword").map((x) =>
+ innerText(x).trim()
+ );
+ }
+ const revhistoryElement = findFirstChildElement(info, "revhistory");
+ if (!revhistoryElement) {
+ throw new SlideError(
+ `[slide.new] <revhistory> element not found`,
+ );
+ }
+ const revisions = findChildElements(revhistoryElement, "revision").map(
+ (x, i) => {
+ const dateElement = findFirstChildElement(x, "date");
+ if (!dateElement) {
+ throw new SlideError(
+ `[slide.new] <date> element not found`,
+ );
+ }
+ const revremarkElement = findFirstChildElement(x, "revremark");
+ if (!revremarkElement) {
+ throw new SlideError(
+ `[slide.new] <revremark> element not found`,
+ );
+ }
+ return {
+ number: i + 1,
+ date: stringToDate(innerText(dateElement).trim()),
+ remark: innerText(revremarkElement).trim(),
+ };
+ },
+ );
+ if (revisions.length === 0) {
+ throw new SlideError(
+ `[slide.new] <revision> element not found`,
+ );
+ }
+
+ return {
+ sourceFilePath: sourceFilePath,
+ title: title,
+ event: event,
+ talkType: talkType,
+ slideLink: slideLink,
+ tags: tags,
+ revisions: revisions,
+ };
+}
diff --git a/vhosts/blog/nuldoc-src/types/highlight-js.d.ts b/vhosts/blog/nuldoc-src/types/highlight-js.d.ts
new file mode 100644
index 00000000..d7bd0b50
--- /dev/null
+++ b/vhosts/blog/nuldoc-src/types/highlight-js.d.ts
@@ -0,0 +1,10 @@
+declare module "highlight.js" {
+ function getLanguage(
+ name: string,
+ ): string | undefined;
+
+ function highlight(
+ code: string,
+ options: { language: string },
+ ): { value: string };
+}
diff --git a/vhosts/blog/nuldoc-src/xml.ts b/vhosts/blog/nuldoc-src/xml.ts
new file mode 100644
index 00000000..847b5e12
--- /dev/null
+++ b/vhosts/blog/nuldoc-src/xml.ts
@@ -0,0 +1,269 @@
+import { Element, Node, Text } from "./dom.ts";
+import { XmlParseError } from "./errors.ts";
+
+export async function parseXmlFile(filePath: string): Promise<Element> {
+ return parseXmlString(await Deno.readTextFile(filePath));
+}
+
+export function parseXmlString(source: string): Element {
+ return parse({ source: source, index: 0 });
+}
+
+type Parser = {
+ source: string;
+ index: number;
+};
+
+function parse(p: Parser): Element {
+ parseXmlDeclaration(p);
+ skipWhitespaces(p);
+ const e = parseXmlElement(p);
+ const root: Element = {
+ kind: "element",
+ name: "__root__",
+ attributes: new Map(),
+ children: [e],
+ };
+ return root;
+}
+
+function parseXmlDeclaration(p: Parser) {
+ expect(p, "<?xml ");
+ skipTo(p, "?>");
+ next(p, 2);
+}
+
+function parseXmlElement(p: Parser): Element {
+ const { name, attributes, closed } = parseStartTag(p);
+ if (closed) {
+ return {
+ kind: "element",
+ name: name,
+ attributes: attributes,
+ children: [],
+ };
+ }
+ const children = parseChildNodes(p);
+ parseEndTag(p, name);
+
+ const thisElement: Element = {
+ kind: "element",
+ name: name,
+ attributes: attributes,
+ children: children,
+ };
+ return thisElement;
+}
+
+function parseChildNodes(p: Parser): Node[] {
+ const nodes = [];
+ while (true) {
+ const c = peek(p);
+ const c2 = peekN(p, 2);
+ const c3 = peekN(p, 3);
+ if (c === "<") {
+ if (c2 === "/") {
+ break;
+ } else if (c2 === "!") {
+ if (c3 === "[") {
+ // <![CDATA[
+ nodes.push(parseCdata(p));
+ } else {
+ // <!--
+ skipComment(p);
+ }
+ } else {
+ nodes.push(parseXmlElement(p));
+ }
+ } else {
+ nodes.push(parseTextNode(p));
+ }
+ }
+ return nodes;
+}
+
+function parseTextNode(p: Parser): Text {
+ const content = skipTo(p, "<");
+ return {
+ kind: "text",
+ content: replaceEntityReferences(content),
+ raw: false,
+ };
+}
+
+function parseCdata(p: Parser): Text {
+ expect(p, "<![CDATA[");
+ const content = skipTo(p, "]]>");
+ next(p, "]]>".length);
+ return {
+ kind: "text",
+ content: formatCdata(content),
+ raw: false,
+ };
+}
+
+function skipComment(p: Parser) {
+ expect(p, "<!--");
+ skipTo(p, "-->");
+ next(p, "-->".length);
+}
+
+function formatCdata(s: string): string {
+ // <![CDATA[
+ // foo
+ // bar
+ // baz
+ // ]]>
+ // => "foo\n bar\nbaz"
+ s = s.replace(/^\n(.*)\n *$/s, "$1");
+ const ls = s.split("\n");
+ const n = Math.min(
+ ...ls.filter((l) => l !== "").map((l) =>
+ l.match(/^( *)/)?.[0]?.length ?? 0
+ ),
+ );
+ let z = "";
+ for (const p of s.split("\n")) {
+ z += p.slice(n) + "\n";
+ }
+ return z.slice(0, -1);
+}
+
+function parseStartTag(
+ p: Parser,
+): { name: string; attributes: Map<string, string>; closed: boolean } {
+ expect(p, "<");
+ const name = parseIdentifier(p);
+ skipWhitespaces(p);
+ if (peek(p) === "/") {
+ expect(p, "/>");
+ return { name: name, attributes: new Map(), closed: true };
+ }
+ if (peek(p) === ">") {
+ next(p);
+ return { name: name, attributes: new Map(), closed: false };
+ }
+ const attributes = new Map();
+ while (peek(p) !== ">" && peek(p) !== "/") {
+ const { name, value } = parseAttribute(p);
+ attributes.set(name, value);
+ }
+ let closed = false;
+ if (peek(p) === "/") {
+ next(p);
+ closed = true;
+ }
+ expect(p, ">");
+ return { name: name, attributes: attributes, closed: closed };
+}
+
+function parseEndTag(p: Parser, name: string) {
+ expect(p, `</${name}>`);
+}
+
+function parseAttribute(p: Parser): { name: string; value: string } {
+ skipWhitespaces(p);
+ let name = parseIdentifier(p);
+ if (peek(p) === ":") {
+ next(p);
+ const name2 = parseIdentifier(p);
+ name += ":" + name2;
+ }
+ expect(p, "=");
+ const value = parseQuotedString(p);
+ skipWhitespaces(p);
+ return { name: name, value: replaceEntityReferences(value) };
+}
+
+function parseQuotedString(p: Parser): string {
+ expect(p, '"');
+ const content = skipTo(p, '"');
+ next(p);
+ return content;
+}
+
+function parseIdentifier(p: Parser): string {
+ let id = "";
+ while (p.index < p.source.length) {
+ const c = peek(p);
+ if (!c || !/[A-Za-z]/.test(c)) {
+ break;
+ }
+ id += c;
+ next(p);
+ }
+ return id;
+}
+
+function expect(p: Parser, expected: string) {
+ let actual = "";
+ for (let i = 0; i < expected.length; i++) {
+ actual += peek(p);
+ next(p);
+ }
+ if (actual !== expected) {
+ throw new XmlParseError(
+ `[parse.expect] expected ${expected}, but actually got ${
+ escapeForHuman(actual)
+ } (pos: ${p.index})`,
+ );
+ }
+}
+
+function skipTo(p: Parser, delimiter: string): string {
+ const indexStart = p.index;
+ let i = 0;
+ while (i < delimiter.length) {
+ if (peek(p) === delimiter[i]) {
+ i++;
+ } else {
+ i = 0;
+ }
+ next(p);
+ }
+ back(p, delimiter.length);
+ return p.source.substring(indexStart, p.index);
+}
+
+function skipWhitespaces(p: Parser) {
+ while (p.index < p.source.length) {
+ const c = peek(p);
+ if (!c || !/[ \n\t]/.test(c)) {
+ break;
+ }
+ next(p);
+ }
+}
+
+function peek(p: Parser): string | null {
+ return peekN(p, 1);
+}
+
+function peekN(p: Parser, n: number): string | null {
+ return (p.index + n - 1 < p.source.length) ? p.source[p.index + n - 1] : null;
+}
+
+function next(p: Parser, n = 1) {
+ p.index += n;
+}
+
+function back(p: Parser, n = 1) {
+ p.index -= n;
+}
+
+function replaceEntityReferences(s: string): string {
+ return s
+ .replaceAll(/&amp;/g, "&")
+ .replaceAll(/&lt;/g, "<")
+ .replaceAll(/&gt;/g, ">")
+ .replaceAll(/&apos;/g, "'")
+ .replaceAll(/&quot;/g, '"');
+}
+
+function escapeForHuman(s: string): string {
+ // support more characters?
+ return s
+ .replaceAll("\n", "\\n")
+ .replaceAll("\t", "\\t")
+ .replaceAll("\r", "\\r");
+}
diff --git a/vhosts/blog/nuldoc-src/xml_test.ts b/vhosts/blog/nuldoc-src/xml_test.ts
new file mode 100644
index 00000000..28e15970
--- /dev/null
+++ b/vhosts/blog/nuldoc-src/xml_test.ts
@@ -0,0 +1,17 @@
+import { assertEquals } from "std/testing/asserts.ts";
+import { parseXmlString } from "./xml.ts";
+
+Deno.test("Parse XML", () => {
+ assertEquals(
+ "__root__",
+ parseXmlString(
+ `<?xml version="1.0" encoding="UTF-8"?>
+<hoge>
+ <piyo>
+ <!-- comment -->
+ </piyo>
+</hoge>
+`,
+ ).name,
+ );
+});
diff --git a/vhosts/blog/public/404.html b/vhosts/blog/public/404.html
new file mode 100644
index 00000000..c104d9e4
--- /dev/null
+++ b/vhosts/blog/public/404.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2021 nsfisis">
+ <meta name="description" content="リクエストされたページが見つかりません。">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>Page Not Found | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ </head>
+ <body class="single">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <article>
+ <div class="not-found">
+ 404
+ </div>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/about/index.html b/vhosts/blog/public/about/index.html
new file mode 100644
index 00000000..3c334912
--- /dev/null
+++ b/vhosts/blog/public/about/index.html
@@ -0,0 +1,120 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2021 nsfisis">
+ <meta name="description" content="このサイトの著者について">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>About | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ </head>
+ <body class="single">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <article class="post-single">
+ <header class="post-header">
+ <h1 class="post-title">nsfisis</h1>
+ <div class="my-icon">
+ <script src="/p5.min.js?h=51188c3517b547017eb034eab6141792">
+ </script>
+ <script src="/my-icon.js?h=bfd5c06d2618e858be2e073b91adb8cc">
+ </script>
+ <div id="p5jsMyIcon">
+ </div>
+ <noscript>
+ <img src="/favicon.svg">
+ </img>
+ </noscript>
+ </div>
+ </header>
+ <div class="post-content">
+ <section>
+ <h2>読み方</h2>
+ <p>
+ 読み方は決めていません。音にする必要があるときは本名である「いまむら」をお使いください。
+ </p>
+ </section>
+ <section>
+ <h2>アカウント</h2>
+ <ul>
+ <li>
+ <a href="https://twitter.com/nsfisis">Twitter (現 𝕏): @nsfisis</a>
+ </li>
+ <li>
+ <a href="https://github.com/nsfisis">GitHub: @nsfisis</a>
+ </li>
+ </ul>
+ </section>
+ <section>
+ <h2>仕事</h2>
+ <ul>
+ <li>
+ 2021-01~現在: <a href="https://www.dgcircus.com/">デジタルサーカス株式会社</a>
+ </li>
+ </ul>
+ </section>
+ <section>
+ <h2>登壇</h2>
+ <ul>
+ <li>
+ <a href="/slides/2023-08-24/phpstudy-tokyo-155/">2023-08-24: PHP 勉強会@東京 第155 回 (LT)</a>
+ </li>
+ <li>
+ <a href="/slides/2023-07-26/phpstudy-tokyo-154/">2023-07-26: PHP 勉強会@東京 第154 回 (レギュラートーク)</a>
+ </li>
+ <li>
+ <a href="/slides/2023-06-23/phpconfuk-2023-eve/">2023-06-23: PHP カンファレンス福岡 2023 前夜祭 (非公式) (レギュラートーク)</a>
+ </li>
+ <li>
+ <a href="/slides/2023-06-21/phpstudy-tokyo-153/">2023-06-21: PHP 勉強会@東京 第153 回 (LT)</a>
+ </li>
+ <li>
+ <a href="/slides/2023-04-12/phpstudy-tokyo-151/">2023-04-12: PHP 勉強会@東京 第151 回 (LT)</a>
+ </li>
+ <li>
+ <a href="/slides/2023-03-25/phperkaigi-2023-tokens/">2023-03-25: PHPerKaigi 2023 (トークン解説セッション)</a>
+ </li>
+ <li>
+ <a href="/slides/2023-03-24/phperkaigi-2023/">2023-03-24: PHPerKaigi 2023 (レギュラートーク)</a>
+ </li>
+ <li>
+ <a href="/slides/2023-03-15/phpstudy-tokyo-150/">2023-03-15: PHP 勉強会@東京 第150 回 (LT)</a>
+ </li>
+ <li>
+ <a href="/slides/2023-02-15/phpstudy-tokyo-149/">2023-02-15: PHP 勉強会@東京 第149 回 (LT)</a>
+ </li>
+ <li>
+ <a href="/slides/2023-01-18/phpstudy-tokyo-148/">2023-01-18: PHP 勉強会@東京 第148 回 (LT)</a>
+ </li>
+ </ul>
+ </section>
+ </div>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/custom.css b/vhosts/blog/public/custom.css
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/vhosts/blog/public/custom.css
diff --git a/vhosts/blog/public/favicon.svg b/vhosts/blog/public/favicon.svg
new file mode 100644
index 00000000..923d78b1
--- /dev/null
+++ b/vhosts/blog/public/favicon.svg
@@ -0,0 +1,61 @@
+<?xml version="1.0"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg
+ width="100" height="100" viewBox="0 0 100 100"
+ xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
+>
+ <defs>
+ <g id="favicon.l">
+ <line x1="50" y1="5" x2="50" y2="50" stroke="white" stroke-width="2"/>
+ <path d="M 50 10 L 46 5 L 54 5" fill="white"/>
+ <path d="M 50 30 L 47 50 L 53 50" fill="white"/>
+ </g>
+ <g id="favicon.s">
+ <rect x="0" y="0" width="10" height="10" fill-opacity="0.75"/>
+ </g>
+ </defs>
+ <circle cx="50" cy="50" r="50" fill="orange"/>
+
+ <circle cx="50" cy="50" r="45" fill="transparent" stroke="white" stroke-width="4"/>
+ <use xlink:href="#favicon.l" transform="rotate( 0, 50, 50)"/>
+ <use xlink:href="#favicon.l" transform="rotate( 36, 50, 50)"/>
+ <use xlink:href="#favicon.l" transform="rotate( 72, 50, 50)"/>
+ <use xlink:href="#favicon.l" transform="rotate(108, 50, 50)"/>
+ <use xlink:href="#favicon.l" transform="rotate(144, 50, 50)"/>
+ <use xlink:href="#favicon.l" transform="rotate(180, 50, 50)"/>
+ <use xlink:href="#favicon.l" transform="rotate(216, 50, 50)"/>
+ <use xlink:href="#favicon.l" transform="rotate(252, 50, 50)"/>
+ <use xlink:href="#favicon.l" transform="rotate(288, 50, 50)"/>
+ <use xlink:href="#favicon.l" transform="rotate(324, 50, 50)"/>
+
+ <use xlink:href="#favicon.s" x="50" y="0" fill="darkorange"/>
+ <use xlink:href="#favicon.s" x="50" y="20" fill="gold"/>
+ <use xlink:href="#favicon.s" x="50" y="30" fill="orange"/>
+ <use xlink:href="#favicon.s" x="50" y="70" fill="orange"/>
+ <use xlink:href="#favicon.s" x="50" y="90" fill="gold"/>
+ <use xlink:href="#favicon.s" x="60" y="10" fill="orange"/>
+ <use xlink:href="#favicon.s" x="60" y="20" fill="orange"/>
+ <use xlink:href="#favicon.s" x="60" y="30" fill="gold"/>
+ <use xlink:href="#favicon.s" x="60" y="50" fill="gold"/>
+ <use xlink:href="#favicon.s" x="60" y="70" fill="gold"/>
+ <use xlink:href="#favicon.s" x="60" y="80" fill="gold"/>
+ <use xlink:href="#favicon.s" x="70" y="0" fill="#ffcd72"/>
+ <use xlink:href="#favicon.s" x="70" y="10" fill="orange"/>
+ <use xlink:href="#favicon.s" x="70" y="20" fill="gold"/>
+ <use xlink:href="#favicon.s" x="70" y="30" fill="gold"/>
+ <use xlink:href="#favicon.s" x="70" y="70" fill="darkorange"/>
+ <use xlink:href="#favicon.s" x="70" y="90" fill="#ffcd72"/>
+ <use xlink:href="#favicon.s" x="80" y="10" fill="#ffd27f"/>
+ <use xlink:href="#favicon.s" x="80" y="20" fill="orange"/>
+ <use xlink:href="#favicon.s" x="80" y="40" fill="gold"/>
+ <use xlink:href="#favicon.s" x="80" y="60" fill="orange"/>
+ <use xlink:href="#favicon.s" x="80" y="70" fill="orange"/>
+ <use xlink:href="#favicon.s" x="80" y="80" fill="#ffd27f"/>
+ <use xlink:href="#favicon.s" x="90" y="30" fill="#ffc04c"/>
+ <use xlink:href="#favicon.s" x="90" y="40" fill="#ffa90c"/>
+ <use xlink:href="#favicon.s" x="90" y="60" fill="#ffc04c"/>
+ <use xlink:href="#favicon.s" x="90" y="70" fill="#ffe4b2"/>
+
+ <rect x="30" y="35" width="6" height="25" rx="2" ry="2" fill="black"/>
+ <rect x="64" y="35" width="6" height="25" rx="2" ry="2" fill="black"/>
+</svg>
diff --git a/vhosts/blog/public/hl.css b/vhosts/blog/public/hl.css
new file mode 100644
index 00000000..275239a7
--- /dev/null
+++ b/vhosts/blog/public/hl.css
@@ -0,0 +1,10 @@
+pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!
+ Theme: GitHub
+ Description: Light theme as seen on github.com
+ Author: github.com
+ Maintainer: @Hirse
+ Updated: 2021-05-15
+
+ Outdated base version: https://github.com/primer/github-syntax-light
+ Current colors taken from GitHub's CSS
+*/.hljs{color:#24292e;background:#fff}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#d73a49}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#6f42c1}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable{color:#005cc5}.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#032f62}.hljs-built_in,.hljs-symbol{color:#e36209}.hljs-code,.hljs-comment,.hljs-formula{color:#6a737d}.hljs-name,.hljs-quote,.hljs-selector-pseudo,.hljs-selector-tag{color:#22863a}.hljs-subst{color:#24292e}.hljs-section{color:#005cc5;font-weight:700}.hljs-bullet{color:#735c0f}.hljs-emphasis{color:#24292e;font-style:italic}.hljs-strong{color:#24292e;font-weight:700}.hljs-addition{color:#22863a;background-color:#f0fff4}.hljs-deletion{color:#b31d28;background-color:#ffeef0} \ No newline at end of file
diff --git a/vhosts/blog/public/index.html b/vhosts/blog/public/index.html
new file mode 100644
index 00000000..f0aca8ec
--- /dev/null
+++ b/vhosts/blog/public/index.html
@@ -0,0 +1,71 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2021 nsfisis">
+ <meta name="description" content="nsfisis のブログサイト">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ </head>
+ <body class="single">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <article class="post-single">
+ <article class="post-entry">
+ <a href="/about/">
+ <header class="entry-header">
+ <h2>About</h2>
+ </header>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/">
+ <header class="entry-header">
+ <h2>Posts</h2>
+ </header>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/slides/">
+ <header class="entry-header">
+ <h2>Slides</h2>
+ </header>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/tags/">
+ <header class="entry-header">
+ <h2>Tags</h2>
+ </header>
+ </a>
+ </article>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/my-icon.js b/vhosts/blog/public/my-icon.js
new file mode 100644
index 00000000..5b52ca3d
--- /dev/null
+++ b/vhosts/blog/public/my-icon.js
@@ -0,0 +1,121 @@
+const colorBackground = 'white';
+const color蜜柑の果実 = [255, 165, 0];
+const color蜜柑の内果皮 = [255, 255, 255];
+const color蜜柑のじょうのう = [255, 255, 255];
+const colorMosaic = [
+ [255, 165, 0],
+ [255, 140, 0],
+ [255, 215, 0],
+ [255, 205, 114],
+ [255, 210, 127],
+ [255, 192, 76],
+ [255, 169, 12],
+ [255, 228, 178],
+];
+const colorEye = [0, 0, 0];
+
+function setup() {
+ const container = document.getElementById("p5jsMyIcon");
+ const canvas = createCanvas(100, 100);
+ canvas.parent(container);
+
+ background(colorBackground);
+ frameRate(15);
+}
+
+function draw() {
+ if (4 <= frameCount % 15) {
+ return;
+ }
+
+ clear();
+
+ draw蜜柑();
+ applyMosaicEffect([10, 5, 2, 0][frameCount % 15]);
+ drawMosaic();
+ drawEyes();
+}
+
+function applyMosaicEffect(k) {
+ if (k === 0) {
+ return;
+ }
+
+ loadPixels();
+ noStroke();
+ const d = pixelDensity();
+ for (let y = 0; y < 100; y += k) {
+ for (let x = 50; x < 100; x += k) {
+ var r = 0, g = 0, b = 0;
+ for (let i = 0; i < k; i++) {
+ for (let j = 0; j < k; j++) {
+ const offset = 4 * d * ((y + i) * 100 * d + (x + j));
+ const r_ = pixels[offset];
+ const g_ = pixels[offset + 1];
+ const b_ = pixels[offset + 2];
+ const a_ = pixels[offset + 3];
+ r += a_ === 0 ? red(colorBackground) : r_;
+ g += a_ === 0 ? green(colorBackground) : g_;
+ b += a_ === 0 ? blue(colorBackground) : b_;
+ }
+ }
+ fill(r / k**2, g / k**2, b / k**2);
+ rect(x, y, k, k);
+ }
+ }
+}
+
+function draw蜜柑() {
+ // 果実、外果皮
+ fill(color蜜柑の果実);
+ noStroke();
+ ellipse(50, 50, 100, 100);
+
+ // 内果皮
+ noFill();
+ stroke(color蜜柑の内果皮);
+ strokeWeight(4);
+ ellipse(50, 50, 90, 90);
+
+ // じょうのう
+ stroke(color蜜柑のじょうのう);
+ strokeWeight(2);
+ for (let t = 0; t < 10; t++) {
+ push();
+ translate(50, 50);
+ rotate(t * PI / 5);
+ line(0, -45, 0, 0);
+ triangle(0, -40, -4, -45, 4, -45);
+ triangle(0, -20, -3, 0, 3, 0);
+ pop();
+ }
+}
+
+function drawMosaic() {
+ for (let dy = 0; dy < 10; dy++) {
+ for (let dx = 0; dx < 10; dx++) {
+ const y = dy * 10;
+ const x = dx * 10;
+ if (x < 50) {
+ continue;
+ }
+ if ((x - 45)**2 + (y - 45)**2 > 55**2) {
+ continue;
+ }
+ if (random() < 0.5) {
+ continue;
+ }
+ const [r, g, b] = random(colorMosaic);
+ noStroke();
+ fill(r, g, b, 192);
+ rect(x, y, 10, 10);
+ }
+ }
+}
+
+function drawEyes() {
+ noStroke();
+ fill(colorEye);
+ rect(30, 35, 6, 25, 2);
+ rect(64, 35, 6, 25, 2);
+}
diff --git a/vhosts/blog/public/p5.min.js b/vhosts/blog/public/p5.min.js
new file mode 100644
index 00000000..7a5b8275
--- /dev/null
+++ b/vhosts/blog/public/p5.min.js
@@ -0,0 +1,2 @@
+/*! p5.js v1.6.0 February 22, 2023 */
+!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).p5=e()}(function(){var s,t,r;return function o(n,s,i){function a(t,e){if(!s[t]){if(!n[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(l)return l(t,!0);throw(e=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",e}r=s[t]={exports:{}},n[t][0].call(r.exports,function(e){return a(n[t][1][e]||e)},r,r.exports,o,n,s,i)}return s[t].exports}for(var l="function"==typeof require&&require,e=0;e<i.length;e++)a(i[e]);return a}({1:[function(e,t,r){"use strict";r.byteLength=function(e){var e=c(e),t=e[0],e=e[1];return 3*(t+e)/4-e},r.toByteArray=function(e){var t,r,o=c(e),n=o[0],o=o[1],s=new u(function(e,t){return 3*(e+t)/4-t}(n,o)),i=0,a=0<o?n-4:n;for(r=0;r<a;r+=4)t=l[e.charCodeAt(r)]<<18|l[e.charCodeAt(r+1)]<<12|l[e.charCodeAt(r+2)]<<6|l[e.charCodeAt(r+3)],s[i++]=t>>16&255,s[i++]=t>>8&255,s[i++]=255&t;2===o&&(t=l[e.charCodeAt(r)]<<2|l[e.charCodeAt(r+1)]>>4,s[i++]=255&t);1===o&&(t=l[e.charCodeAt(r)]<<10|l[e.charCodeAt(r+1)]<<4|l[e.charCodeAt(r+2)]>>2,s[i++]=t>>8&255,s[i++]=255&t);return s},r.fromByteArray=function(e){for(var t,r=e.length,o=r%3,n=[],s=0,i=r-o;s<i;s+=16383)n.push(function(e,t,r){for(var o,n=[],s=t;s<r;s+=3)o=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),n.push(function(e){return a[e>>18&63]+a[e>>12&63]+a[e>>6&63]+a[63&e]}(o));return n.join("")}(e,s,i<s+16383?i:s+16383));1==o?(t=e[r-1],n.push(a[t>>2]+a[t<<4&63]+"==")):2==o&&(t=(e[r-2]<<8)+e[r-1],n.push(a[t>>10]+a[t>>4&63]+a[t<<2&63]+"="));return n.join("")};for(var a=[],l=[],u="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,s=o.length;n<s;++n)a[n]=o[n],l[o.charCodeAt(n)]=n;function c(e){var t=e.length;if(0<t%4)throw new Error("Invalid string. Length must be a multiple of 4");e=e.indexOf("="),t=(e=-1===e?t:e)===t?0:4-e%4;return[e,t]}l["-".charCodeAt(0)]=62,l["_".charCodeAt(0)]=63},{}],2:[function(e,t,r){},{}],3:[function(e,t,r){arguments[4][2][0].apply(r,arguments)},{dup:2}],4:[function(P,e,A){!function(d){"use strict";var S=P("base64-js"),s=P("ieee754"),e="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null,t=(A.Buffer=d,A.SlowBuffer=function(e){+e!=e&&(e=0);return d.alloc(+e)},A.INSPECT_MAX_BYTES=50,2147483647);function l(e){if(t<e)throw new RangeError('The value "'+e+'" is invalid for option "size"');e=new Uint8Array(e);return Object.setPrototypeOf(e,d.prototype),e}function d(e,t,r){if("number"!=typeof e)return o(e,t,r);if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return i(e)}function o(e,t,r){if("string"==typeof e){var o=e,n=t;if(d.isEncoding(n="string"==typeof n&&""!==n?n:"utf8"))return s=0|f(o,n),i=l(s),i=(o=i.write(o,n))!==s?i.slice(0,o):i;throw new TypeError("Unknown encoding: "+n)}if(ArrayBuffer.isView(e))return u(e);if(null!=e){if(O(e,ArrayBuffer)||e&&O(e.buffer,ArrayBuffer)){var s=e,o=t,i=r;if(o<0||s.byteLength<o)throw new RangeError('"offset" is outside of buffer bounds');if(s.byteLength<o+(i||0))throw new RangeError('"length" is outside of buffer bounds');return s=void 0===o&&void 0===i?new Uint8Array(s):void 0===i?new Uint8Array(s,o):new Uint8Array(s,o,i),Object.setPrototypeOf(s,d.prototype),s}if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return d.from(n,t,r);var a=function(e){{var t,r;if(d.isBuffer(e))return t=0|c(e.length),0!==(r=l(t)).length&&e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||k(e.length)?l(0):u(e);if("Buffer"===e.type&&Array.isArray(e.data))return u(e.data)}(e);if(a)return a;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return d.from(e[Symbol.toPrimitive]("string"),t,r)}throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function n(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function i(e){return n(e),l(e<0?0:0|c(e))}function u(e){for(var t=e.length<0?0:0|c(e.length),r=l(t),o=0;o<t;o+=1)r[o]=255&e[o];return r}function c(e){if(t<=e)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+t.toString(16)+" bytes");return 0|e}function f(e,t){if(d.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||O(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,o=2<arguments.length&&!0===arguments[2];if(!o&&0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return E(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return T(e).length;default:if(n)return o?-1:E(e).length;t=(""+t).toLowerCase(),n=!0}}function r(e,t,r){var o,n=!1;if((t=void 0===t||t<0?0:t)>this.length)return"";if((r=void 0===r||r>this.length?this.length:r)<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":var s=this,i=t,a=r,l=s.length;(!a||a<0||l<a)&&(a=l);for(var u="",c=i=!i||i<0?0:i;c<a;++c)u+=L[s[c]];return u;case"utf8":case"utf-8":return M(this,t,r);case"ascii":var d=this,l=t,f=r,h="";f=Math.min(d.length,f);for(var p=l;p<f;++p)h+=String.fromCharCode(127&d[p]);return h;case"latin1":case"binary":var m=this,i=t,y=r,g="";y=Math.min(m.length,y);for(var v=i;v<y;++v)g+=String.fromCharCode(m[v]);return g;case"base64":return b=this,o=r,0===(j=t)&&o===b.length?S.fromByteArray(b):S.fromByteArray(b.slice(j,o));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":for(var b=t,j=r,_=this.slice(b,j),x="",w=0;w<_.length;w+=2)x+=String.fromCharCode(_[w]+256*_[w+1]);return x;default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function a(e,t,r){var o=e[t];e[t]=e[r],e[r]=o}function h(e,t,r,o,n){if(0===e.length)return-1;if("string"==typeof r?(o=r,r=0):2147483647<r?r=2147483647:r<-2147483648&&(r=-2147483648),(r=(r=k(r=+r)?n?0:e.length-1:r)<0?e.length+r:r)>=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=d.from(t,o)),d.isBuffer(t))return 0===t.length?-1:p(e,t,r,o,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?(n?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(e,t,r):p(e,[t],r,o,n);throw new TypeError("val must be string, number or Buffer")}function p(e,t,r,o,n){var s=1,i=e.length,a=t.length;if(void 0!==o&&("ucs2"===(o=String(o).toLowerCase())||"ucs-2"===o||"utf16le"===o||"utf-16le"===o)){if(e.length<2||t.length<2)return-1;i/=s=2,a/=2,r/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(n)for(var u=-1,c=r;c<i;c++)if(l(e,c)===l(t,-1===u?0:c-u)){if(c-(u=-1===u?c:u)+1===a)return u*s}else-1!==u&&(c-=c-u),u=-1;else for(c=r=i<r+a?i-a:r;0<=c;c--){for(var d=!0,f=0;f<a;f++)if(l(e,c+f)!==l(t,f)){d=!1;break}if(d)return c}return-1}function y(e,t,r,o){return C(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,o)}function g(e,t,r,o){return C(function(e,t){for(var r,o,n=[],s=0;s<e.length&&!((t-=2)<0);++s)o=e.charCodeAt(s),r=o>>8,o=o%256,n.push(o),n.push(r);return n}(t,e.length-r),e,r,o)}function M(e,t,r){r=Math.min(e.length,r);for(var o=[],n=t;n<r;){var s,i,a,l,u=e[n],c=null,d=239<u?4:223<u?3:191<u?2:1;if(n+d<=r)switch(d){case 1:u<128&&(c=u);break;case 2:128==(192&(s=e[n+1]))&&127<(l=(31&u)<<6|63&s)&&(c=l);break;case 3:s=e[n+1],i=e[n+2],128==(192&s)&&128==(192&i)&&2047<(l=(15&u)<<12|(63&s)<<6|63&i)&&(l<55296||57343<l)&&(c=l);break;case 4:s=e[n+1],i=e[n+2],a=e[n+3],128==(192&s)&&128==(192&i)&&128==(192&a)&&65535<(l=(15&u)<<18|(63&s)<<12|(63&i)<<6|63&a)&&l<1114112&&(c=l)}null===c?(c=65533,d=1):65535<c&&(c-=65536,o.push(c>>>10&1023|55296),c=56320|1023&c),o.push(c),n+=d}var f=o,h=f.length;if(h<=v)return String.fromCharCode.apply(String,f);for(var p="",m=0;m<h;)p+=String.fromCharCode.apply(String,f.slice(m,m+=v));return p}A.kMaxLength=t,(d.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(d.prototype,"parent",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.buffer}}),Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&d[Symbol.species]===d&&Object.defineProperty(d,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),d.poolSize=8192,d.from=o,Object.setPrototypeOf(d.prototype,Uint8Array.prototype),Object.setPrototypeOf(d,Uint8Array),d.alloc=function(e,t,r){return t=t,r=r,n(e=e),!(e<=0)&&void 0!==t?"string"==typeof r?l(e).fill(t,r):l(e).fill(t):l(e)},d.allocUnsafe=i,d.allocUnsafeSlow=i,d.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==d.prototype},d.compare=function(e,t){if(O(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)),O(t,Uint8Array)&&(t=d.from(t,t.offset,t.byteLength)),!d.isBuffer(e)||!d.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,o=t.length,n=0,s=Math.min(r,o);n<s;++n)if(e[n]!==t[n]){r=e[n],o=t[n];break}return r<o?-1:o<r?1:0},d.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},d.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return d.alloc(0);if(void 0===t)for(n=t=0;n<e.length;++n)t+=e[n].length;for(var r=d.allocUnsafe(t),o=0,n=0;n<e.length;++n){var s=e[n];if(O(s,Uint8Array)&&(s=d.from(s)),!d.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,o),o+=s.length}return r},d.byteLength=f,d.prototype._isBuffer=!0,d.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)a(this,t,t+1);return this},d.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)a(this,t,t+3),a(this,t+1,t+2);return this},d.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)a(this,t,t+7),a(this,t+1,t+6),a(this,t+2,t+5),a(this,t+3,t+4);return this},d.prototype.toLocaleString=d.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?M(this,0,e):r.apply(this,arguments)},d.prototype.equals=function(e){if(d.isBuffer(e))return this===e||0===d.compare(this,e);throw new TypeError("Argument must be a Buffer")},d.prototype.inspect=function(){var e="",t=A.INSPECT_MAX_BYTES,e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim();return this.length>t&&(e+=" ... "),"<Buffer "+e+">"},e&&(d.prototype[e]=d.prototype.inspect),d.prototype.compare=function(e,t,r,o,n){if(O(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)),!d.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===r&&(r=e?e.length:0),void 0===o&&(o=0),void 0===n&&(n=this.length),(t=void 0===t?0:t)<0||r>e.length||o<0||n>this.length)throw new RangeError("out of range index");if(n<=o&&r<=t)return 0;if(n<=o)return-1;if(r<=t)return 1;if(this===e)return 0;for(var s=(n>>>=0)-(o>>>=0),i=(r>>>=0)-(t>>>=0),a=Math.min(s,i),l=this.slice(o,n),u=e.slice(t,r),c=0;c<a;++c)if(l[c]!==u[c]){s=l[c],i=u[c];break}return s<i?-1:i<s?1:0},d.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},d.prototype.indexOf=function(e,t,r){return h(this,e,t,r,!0)},d.prototype.lastIndexOf=function(e,t,r){return h(this,e,t,r,!1)},d.prototype.write=function(e,t,r,o){if(void 0===t)o="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)o=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===o&&(o="utf8")):(o=r,r=void 0)}var n=this.length-t;if((void 0===r||n<r)&&(r=n),0<e.length&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");o=o||"utf8";for(var s,i,a,l=!1;;)switch(o){case"hex":var u=this,c=e,d=t,f=r,h=(d=Number(d)||0,u.length-d);(!f||h<(f=Number(f)))&&(f=h),(h=c.length)/2<f&&(f=h/2);for(var p=0;p<f;++p){var m=parseInt(c.substr(2*p,2),16);if(k(m))return p;u[d+p]=m}return p;case"utf8":case"utf-8":return h=t,a=r,C(E(e,(i=this).length-h),i,h,a);case"ascii":return y(this,e,t,r);case"latin1":case"binary":return y(this,e,t,r);case"base64":return i=this,a=t,s=r,C(T(e),i,a,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return g(this,e,t,r);default:if(l)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),l=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var v=4096;function m(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(r<e+t)throw new RangeError("Trying to access beyond buffer length")}function b(e,t,r,o,n,s){if(!d.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(n<t||t<s)throw new RangeError('"value" argument is out of bounds');if(r+o>e.length)throw new RangeError("Index out of range")}function j(e,t,r,o){if(r+o>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function _(e,t,r,o,n){return t=+t,r>>>=0,n||j(e,0,r,4),s.write(e,t,r,o,23,4),r+4}function x(e,t,r,o,n){return t=+t,r>>>=0,n||j(e,0,r,8),s.write(e,t,r,o,52,8),r+8}d.prototype.slice=function(e,t){var r=this.length,r=((e=~~e)<0?(e+=r)<0&&(e=0):r<e&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):r<t&&(t=r),t<e&&(t=e),this.subarray(e,t));return Object.setPrototypeOf(r,d.prototype),r},d.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||m(e,t,this.length);for(var o=this[e],n=1,s=0;++s<t&&(n*=256);)o+=this[e+s]*n;return o},d.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||m(e,t,this.length);for(var o=this[e+--t],n=1;0<t&&(n*=256);)o+=this[e+--t]*n;return o},d.prototype.readUInt8=function(e,t){return e>>>=0,t||m(e,1,this.length),this[e]},d.prototype.readUInt16LE=function(e,t){return e>>>=0,t||m(e,2,this.length),this[e]|this[e+1]<<8},d.prototype.readUInt16BE=function(e,t){return e>>>=0,t||m(e,2,this.length),this[e]<<8|this[e+1]},d.prototype.readUInt32LE=function(e,t){return e>>>=0,t||m(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},d.prototype.readUInt32BE=function(e,t){return e>>>=0,t||m(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},d.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||m(e,t,this.length);for(var o=this[e],n=1,s=0;++s<t&&(n*=256);)o+=this[e+s]*n;return(n*=128)<=o&&(o-=Math.pow(2,8*t)),o},d.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||m(e,t,this.length);for(var o=t,n=1,s=this[e+--o];0<o&&(n*=256);)s+=this[e+--o]*n;return(n*=128)<=s&&(s-=Math.pow(2,8*t)),s},d.prototype.readInt8=function(e,t){return e>>>=0,t||m(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},d.prototype.readInt16LE=function(e,t){e>>>=0,t||m(e,2,this.length);t=this[e]|this[e+1]<<8;return 32768&t?4294901760|t:t},d.prototype.readInt16BE=function(e,t){e>>>=0,t||m(e,2,this.length);t=this[e+1]|this[e]<<8;return 32768&t?4294901760|t:t},d.prototype.readInt32LE=function(e,t){return e>>>=0,t||m(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},d.prototype.readInt32BE=function(e,t){return e>>>=0,t||m(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},d.prototype.readFloatLE=function(e,t){return e>>>=0,t||m(e,4,this.length),s.read(this,e,!0,23,4)},d.prototype.readFloatBE=function(e,t){return e>>>=0,t||m(e,4,this.length),s.read(this,e,!1,23,4)},d.prototype.readDoubleLE=function(e,t){return e>>>=0,t||m(e,8,this.length),s.read(this,e,!0,52,8)},d.prototype.readDoubleBE=function(e,t){return e>>>=0,t||m(e,8,this.length),s.read(this,e,!1,52,8)},d.prototype.writeUIntLE=function(e,t,r,o){e=+e,t>>>=0,r>>>=0,o||b(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,s=0;for(this[t]=255&e;++s<r&&(n*=256);)this[t+s]=e/n&255;return t+r},d.prototype.writeUIntBE=function(e,t,r,o){e=+e,t>>>=0,r>>>=0,o||b(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,s=1;for(this[t+n]=255&e;0<=--n&&(s*=256);)this[t+n]=e/s&255;return t+r},d.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,1,255,0),this[t]=255&e,t+1},d.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},d.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},d.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},d.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},d.prototype.writeIntLE=function(e,t,r,o){e=+e,t>>>=0,o||b(this,e,t,r,(o=Math.pow(2,8*r-1))-1,-o);var n=0,s=1,i=0;for(this[t]=255&e;++n<r&&(s*=256);)e<0&&0===i&&0!==this[t+n-1]&&(i=1),this[t+n]=(e/s>>0)-i&255;return t+r},d.prototype.writeIntBE=function(e,t,r,o){e=+e,t>>>=0,o||b(this,e,t,r,(o=Math.pow(2,8*r-1))-1,-o);var n=r-1,s=1,i=0;for(this[t+n]=255&e;0<=--n&&(s*=256);)e<0&&0===i&&0!==this[t+n+1]&&(i=1),this[t+n]=(e/s>>0)-i&255;return t+r},d.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,1,127,-128),this[t]=255&(e=e<0?255+e+1:e),t+1},d.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},d.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},d.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},d.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,4,2147483647,-2147483648),this[t]=(e=e<0?4294967295+e+1:e)>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},d.prototype.writeFloatLE=function(e,t,r){return _(this,e,t,!0,r)},d.prototype.writeFloatBE=function(e,t,r){return _(this,e,t,!1,r)},d.prototype.writeDoubleLE=function(e,t,r){return x(this,e,t,!0,r)},d.prototype.writeDoubleBE=function(e,t,r){return x(this,e,t,!1,r)},d.prototype.copy=function(e,t,r,o){if(!d.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,o||0===o||(o=this.length),t>=e.length&&(t=e.length),(o=0<o&&o<r?r:o)===r)return 0;if(0===e.length||0===this.length)return 0;if((t=t||0)<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length);var n=(o=e.length-t<o-r?e.length-t+r:o)-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,o);else if(this===e&&r<t&&t<o)for(var s=n-1;0<=s;--s)e[s+t]=this[s+r];else Uint8Array.prototype.set.call(e,this.subarray(r,o),t);return n},d.prototype.fill=function(e,t,r,o){if("string"==typeof e){if("string"==typeof t?(o=t,t=0,r=this.length):"string"==typeof r&&(o=r,r=this.length),void 0!==o&&"string"!=typeof o)throw new TypeError("encoding must be a string");if("string"==typeof o&&!d.isEncoding(o))throw new TypeError("Unknown encoding: "+o);var n;1===e.length&&(n=e.charCodeAt(0),("utf8"===o&&n<128||"latin1"===o)&&(e=n))}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");var s;if(!(r<=t))if(t>>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(s=t;s<r;++s)this[s]=e;else{var i=d.isBuffer(e)?e:d.from(e,o),a=i.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(s=0;s<r-t;++s)this[s+t]=i[s%a]}return this};var w=/[^+/0-9A-Za-z-_]/g;function E(e,t){t=t||1/0;for(var r,o=e.length,n=null,s=[],i=0;i<o;++i){if(55295<(r=e.charCodeAt(i))&&r<57344){if(!n){if(56319<r){-1<(t-=3)&&s.push(239,191,189);continue}if(i+1===o){-1<(t-=3)&&s.push(239,191,189);continue}n=r;continue}if(r<56320){-1<(t-=3)&&s.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&-1<(t-=3)&&s.push(239,191,189);if(n=null,r<128){if(--t<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function T(e){return S.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(w,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function C(e,t,r,o){for(var n=0;n<o&&!(n+r>=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function O(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function k(e){return e!=e}var L=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var o=16*r,n=0;n<16;++n)t[o+n]=e[r]+e[n];return t}()}.call(this,P("buffer").Buffer)},{"base64-js":1,buffer:4,ieee754:238}],5:[function(e,t,r){t.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},{}],6:[function(e,t,r){var o=e("../internals/is-object");t.exports=function(e){if(o(e)||null===e)return e;throw TypeError("Can't set "+String(e)+" as a prototype")}},{"../internals/is-object":74}],7:[function(e,t,r){var o=e("../internals/well-known-symbol"),n=e("../internals/object-create"),e=e("../internals/object-define-property"),s=o("unscopables"),i=Array.prototype;null==i[s]&&e.f(i,s,{configurable:!0,value:n(null)}),t.exports=function(e){i[s][e]=!0}},{"../internals/object-create":90,"../internals/object-define-property":92,"../internals/well-known-symbol":146}],8:[function(e,t,r){"use strict";var o=e("../internals/string-multibyte").charAt;t.exports=function(e,t,r){return t+(r?o(e,t).length:1)}},{"../internals/string-multibyte":123}],9:[function(e,t,r){t.exports=function(e,t,r){if(e instanceof t)return e;throw TypeError("Incorrect "+(r?r+" ":"")+"invocation")}},{}],10:[function(e,t,r){var o=e("../internals/is-object");t.exports=function(e){if(o(e))return e;throw TypeError(String(e)+" is not an object")}},{"../internals/is-object":74}],11:[function(e,t,r){t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},{}],12:[function(e,t,r){"use strict";function o(e){return l(e)&&u(E,c(e))}var n,s=e("../internals/array-buffer-native"),i=e("../internals/descriptors"),a=e("../internals/global"),l=e("../internals/is-object"),u=e("../internals/has"),c=e("../internals/classof"),d=e("../internals/create-non-enumerable-property"),f=e("../internals/redefine"),h=e("../internals/object-define-property").f,p=e("../internals/object-get-prototype-of"),m=e("../internals/object-set-prototype-of"),y=e("../internals/well-known-symbol"),e=e("../internals/uid"),g=a.Int8Array,v=g&&g.prototype,b=a.Uint8ClampedArray,b=b&&b.prototype,j=g&&p(g),_=v&&p(v),x=Object.prototype,w=x.isPrototypeOf,y=y("toStringTag"),S=e("TYPED_ARRAY_TAG"),M=s&&!!m&&"Opera"!==c(a.opera),e=!1,E={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8};for(n in E)a[n]||(M=!1);if((!M||"function"!=typeof j||j===Function.prototype)&&(j=function(){throw TypeError("Incorrect invocation")},M))for(n in E)a[n]&&m(a[n],j);if((!M||!_||_===x)&&(_=j.prototype,M))for(n in E)a[n]&&m(a[n].prototype,_);if(M&&p(b)!==_&&m(b,_),i&&!u(_,y))for(n in e=!0,h(_,y,{get:function(){return l(this)?this[S]:void 0}}),E)a[n]&&d(a[n],S,n);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:M,TYPED_ARRAY_TAG:e&&S,aTypedArray:function(e){if(o(e))return e;throw TypeError("Target is not a typed array")},aTypedArrayConstructor:function(e){if(m){if(w.call(j,e))return e}else for(var t in E)if(u(E,n)){t=a[t];if(t&&(e===t||w.call(t,e)))return e}throw TypeError("Target is not a typed array constructor")},exportTypedArrayMethod:function(e,t,r){if(i){if(r)for(var o in E){o=a[o];o&&u(o.prototype,e)&&delete o.prototype[e]}_[e]&&!r||f(_,e,!r&&M&&v[e]||t)}},exportTypedArrayStaticMethod:function(e,t,r){var o,n;if(i){if(m){if(r)for(o in E)(n=a[o])&&u(n,e)&&delete n[e];if(j[e]&&!r)return;try{return f(j,e,!r&&M&&g[e]||t)}catch(e){}}for(o in E)!(n=a[o])||n[e]&&!r||f(n,e,t)}},isView:function(e){e=c(e);return"DataView"===e||u(E,e)},isTypedArray:o,TypedArray:j,TypedArrayPrototype:_}},{"../internals/array-buffer-native":11,"../internals/classof":29,"../internals/create-non-enumerable-property":38,"../internals/descriptors":43,"../internals/global":59,"../internals/has":60,"../internals/is-object":74,"../internals/object-define-property":92,"../internals/object-get-prototype-of":97,"../internals/object-set-prototype-of":101,"../internals/redefine":108,"../internals/uid":143,"../internals/well-known-symbol":146}],13:[function(e,t,D){"use strict";function r(e){return[255&e]}function o(e){return[255&e,e>>8&255]}function n(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function s(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]}function i(e){return k(e,23,4)}function U(e){return k(e,52,8)}function a(e,t){H(e[w],t,{get:function(){return b(this)[t]}})}function l(e,t,r,o){if(r=m(r),e=b(e),r+t>e.byteLength)throw O(S);var n=b(e.buffer).bytes,r=r+e.byteOffset,e=n.slice(r,r+t);return o?e:e.reverse()}function u(e,t,r,o,n,s){if(r=m(r),e=b(e),r+t>e.byteLength)throw O(S);for(var i=b(e.buffer).bytes,a=r+e.byteOffset,l=o(+n),u=0;u<t;u++)i[a+u]=l[s?u:t-u-1]}var c=e("../internals/global"),d=e("../internals/descriptors"),N=e("../internals/array-buffer-native"),F=e("../internals/create-non-enumerable-property"),f=e("../internals/redefine-all"),h=e("../internals/fails"),p=e("../internals/an-instance"),B=e("../internals/to-integer"),G=e("../internals/to-length"),m=e("../internals/to-index"),y=e("../internals/ieee754"),V=e("../internals/object-get-prototype-of"),g=e("../internals/object-set-prototype-of"),z=e("../internals/object-get-own-property-names").f,H=e("../internals/object-define-property").f,W=e("../internals/array-fill"),v=e("../internals/set-to-string-tag"),e=e("../internals/internal-state"),b=e.get,j=e.set,_="ArrayBuffer",x="DataView",w="prototype",S="Wrong index",M=c[_],E=M,T=c[x],e=T&&T[w],C=Object.prototype,O=c.RangeError,k=y.pack,L=y.unpack;if(N){if(!h(function(){M(1)})||!h(function(){new M(-1)})||h(function(){return new M,new M(1.5),new M(NaN),M.name!=_})){for(var P,c=(E=function(e){return p(this,E),new M(m(e))})[w]=M[w],A=z(M),R=0;A.length>R;)(P=A[R++])in E||F(E,P,M[P]);c.constructor=E}g&&V(e)!==C&&g(e,C);var y=new T(new E(2)),I=e.setInt8;y.setInt8(0,2147483648),y.setInt8(1,2147483649),!y.getInt8(0)&&y.getInt8(1)||f(e,{setInt8:function(e,t){I.call(this,e,t<<24>>24)},setUint8:function(e,t){I.call(this,e,t<<24>>24)}},{unsafe:!0})}else E=function(e){p(this,E,_);e=m(e);j(this,{bytes:W.call(new Array(e),0),byteLength:e}),d||(this.byteLength=e)},T=function(e,t,r){p(this,T,x),p(e,E,x);var o=b(e).byteLength,t=B(t);if(t<0||o<t)throw O("Wrong offset");if(o<t+(r=void 0===r?o-t:G(r)))throw O("Wrong length");j(this,{buffer:e,byteLength:r,byteOffset:t}),d||(this.buffer=e,this.byteLength=r,this.byteOffset=t)},d&&(a(E,"byteLength"),a(T,"buffer"),a(T,"byteLength"),a(T,"byteOffset")),f(T[w],{getInt8:function(e){return l(this,1,e)[0]<<24>>24},getUint8:function(e){return l(this,1,e)[0]},getInt16:function(e){e=l(this,2,e,1<arguments.length?arguments[1]:void 0);return(e[1]<<8|e[0])<<16>>16},getUint16:function(e){e=l(this,2,e,1<arguments.length?arguments[1]:void 0);return e[1]<<8|e[0]},getInt32:function(e){return s(l(this,4,e,1<arguments.length?arguments[1]:void 0))},getUint32:function(e){return s(l(this,4,e,1<arguments.length?arguments[1]:void 0))>>>0},getFloat32:function(e){return L(l(this,4,e,1<arguments.length?arguments[1]:void 0),23)},getFloat64:function(e){return L(l(this,8,e,1<arguments.length?arguments[1]:void 0),52)},setInt8:function(e,t){u(this,1,e,r,t)},setUint8:function(e,t){u(this,1,e,r,t)},setInt16:function(e,t){u(this,2,e,o,t,2<arguments.length?arguments[2]:void 0)},setUint16:function(e,t){u(this,2,e,o,t,2<arguments.length?arguments[2]:void 0)},setInt32:function(e,t){u(this,4,e,n,t,2<arguments.length?arguments[2]:void 0)},setUint32:function(e,t){u(this,4,e,n,t,2<arguments.length?arguments[2]:void 0)},setFloat32:function(e,t){u(this,4,e,i,t,2<arguments.length?arguments[2]:void 0)},setFloat64:function(e,t){u(this,8,e,U,t,2<arguments.length?arguments[2]:void 0)}});v(E,_),v(T,x),t.exports={ArrayBuffer:E,DataView:T}},{"../internals/an-instance":9,"../internals/array-buffer-native":11,"../internals/array-fill":15,"../internals/create-non-enumerable-property":38,"../internals/descriptors":43,"../internals/fails":51,"../internals/global":59,"../internals/ieee754":65,"../internals/internal-state":70,"../internals/object-define-property":92,"../internals/object-get-own-property-names":95,"../internals/object-get-prototype-of":97,"../internals/object-set-prototype-of":101,"../internals/redefine-all":107,"../internals/set-to-string-tag":117,"../internals/to-index":131,"../internals/to-integer":133,"../internals/to-length":134}],14:[function(e,t,r){"use strict";var l=e("../internals/to-object"),u=e("../internals/to-absolute-index"),c=e("../internals/to-length"),d=Math.min;t.exports=[].copyWithin||function(e,t){var r=l(this),o=c(r.length),n=u(e,o),s=u(t,o),e=2<arguments.length?arguments[2]:void 0,i=d((void 0===e?o:u(e,o))-s,o-n),a=1;for(s<n&&n<s+i&&(a=-1,s+=i-1,n+=i-1);0<i--;)s in r?r[n]=r[s]:delete r[n],n+=a,s+=a;return r}},{"../internals/to-absolute-index":130,"../internals/to-length":134,"../internals/to-object":135}],15:[function(e,t,r){"use strict";var i=e("../internals/to-object"),a=e("../internals/to-absolute-index"),l=e("../internals/to-length");t.exports=function(e){for(var t=i(this),r=l(t.length),o=arguments.length,n=a(1<o?arguments[1]:void 0,r),o=2<o?arguments[2]:void 0,s=void 0===o?r:a(o,r);n<s;)t[n++]=e;return t}},{"../internals/to-absolute-index":130,"../internals/to-length":134,"../internals/to-object":135}],16:[function(e,t,r){"use strict";var o=e("../internals/array-iteration").forEach,n=e("../internals/array-method-is-strict"),e=e("../internals/array-method-uses-to-length"),n=n("forEach"),e=e("forEach");t.exports=n&&e?[].forEach:function(e){return o(this,e,1<arguments.length?arguments[1]:void 0)}},{"../internals/array-iteration":19,"../internals/array-method-is-strict":22,"../internals/array-method-uses-to-length":23}],17:[function(e,t,r){"use strict";var h=e("../internals/function-bind-context"),p=e("../internals/to-object"),m=e("../internals/call-with-safe-iteration-closing"),y=e("../internals/is-array-iterator-method"),g=e("../internals/to-length"),v=e("../internals/create-property"),b=e("../internals/get-iterator-method");t.exports=function(e){var t,r,o,n,s,i,a=p(e),e="function"==typeof this?this:Array,l=arguments.length,u=1<l?arguments[1]:void 0,c=void 0!==u,d=b(a),f=0;if(c&&(u=h(u,2<l?arguments[2]:void 0,2)),null==d||e==Array&&y(d))for(r=new e(t=g(a.length));f<t;f++)i=c?u(a[f],f):a[f],v(r,f,i);else for(s=(n=d.call(a)).next,r=new e;!(o=s.call(n)).done;f++)i=c?m(n,u,[o.value,f],!0):o.value,v(r,f,i);return r.length=f,r}},{"../internals/call-with-safe-iteration-closing":26,"../internals/create-property":40,"../internals/function-bind-context":54,"../internals/get-iterator-method":57,"../internals/is-array-iterator-method":71,"../internals/to-length":134,"../internals/to-object":135}],18:[function(e,t,r){function o(a){return function(e,t,r){var o,n=l(e),s=u(n.length),i=c(r,s);if(a&&t!=t){for(;i<s;)if((o=n[i++])!=o)return!0}else for(;i<s;i++)if((a||i in n)&&n[i]===t)return a||i||0;return!a&&-1}}var l=e("../internals/to-indexed-object"),u=e("../internals/to-length"),c=e("../internals/to-absolute-index");t.exports={includes:o(!0),indexOf:o(!1)}},{"../internals/to-absolute-index":130,"../internals/to-indexed-object":132,"../internals/to-length":134}],19:[function(e,t,r){function o(f){var h=1==f,p=2==f,m=3==f,y=4==f,g=6==f,v=5==f||g;return function(e,t,r,o){for(var n,s,i=_(e),a=j(i),l=b(t,r,3),u=x(a.length),c=0,t=o||w,d=h?t(e,u):p?t(e,0):void 0;c<u;c++)if((v||c in a)&&(s=l(n=a[c],c,i),f))if(h)d[c]=s;else if(s)switch(f){case 3:return!0;case 5:return n;case 6:return c;case 2:S.call(d,n)}else if(y)return!1;return g?-1:m||y?y:d}}var b=e("../internals/function-bind-context"),j=e("../internals/indexed-object"),_=e("../internals/to-object"),x=e("../internals/to-length"),w=e("../internals/array-species-create"),S=[].push;t.exports={forEach:o(0),map:o(1),filter:o(2),some:o(3),every:o(4),find:o(5),findIndex:o(6)}},{"../internals/array-species-create":25,"../internals/function-bind-context":54,"../internals/indexed-object":66,"../internals/to-length":134,"../internals/to-object":135}],20:[function(e,t,r){"use strict";var n=e("../internals/to-indexed-object"),s=e("../internals/to-integer"),i=e("../internals/to-length"),o=e("../internals/array-method-is-strict"),e=e("../internals/array-method-uses-to-length"),a=Math.min,l=[].lastIndexOf,u=!!l&&1/[1].lastIndexOf(1,-0)<0,o=o("lastIndexOf"),e=e("indexOf",{ACCESSORS:!0,1:0});t.exports=u||!o||!e?function(e){if(u)return l.apply(this,arguments)||0;var t=n(this),r=i(t.length),o=r-1;for((o=1<arguments.length?a(o,s(arguments[1])):o)<0&&(o=r+o);0<=o;o--)if(o in t&&t[o]===e)return o||0;return-1}:l},{"../internals/array-method-is-strict":22,"../internals/array-method-uses-to-length":23,"../internals/to-indexed-object":132,"../internals/to-integer":133,"../internals/to-length":134}],21:[function(e,t,r){var o=e("../internals/fails"),n=e("../internals/well-known-symbol"),s=e("../internals/engine-v8-version"),i=n("species");t.exports=function(t){return 51<=s||!o(function(){var e=[];return(e.constructor={})[i]=function(){return{foo:1}},1!==e[t](Boolean).foo})}},{"../internals/engine-v8-version":48,"../internals/fails":51,"../internals/well-known-symbol":146}],22:[function(e,t,r){"use strict";var o=e("../internals/fails");t.exports=function(e,t){var r=[][e];return!!r&&o(function(){r.call(null,t||function(){throw 1},1)})}},{"../internals/fails":51}],23:[function(e,t,r){function i(e){throw e}var a=e("../internals/descriptors"),l=e("../internals/fails"),u=e("../internals/has"),c=Object.defineProperty,d={};t.exports=function(e,t){var r,o,n,s;return u(d,e)?d[e]:(r=[][e],o=!!u(t=t||{},"ACCESSORS")&&t.ACCESSORS,n=u(t,0)?t[0]:i,s=u(t,1)?t[1]:void 0,d[e]=!!r&&!l(function(){if(o&&!a)return!0;var e={length:-1};o?c(e,1,{enumerable:!0,get:i}):e[1]=1,r.call(e,n,s)}))}},{"../internals/descriptors":43,"../internals/fails":51,"../internals/has":60}],24:[function(e,t,r){function o(u){return function(e,t,r,o){c(t);var n=d(e),s=f(n),i=h(n.length),a=u?i-1:0,l=u?-1:1;if(r<2)for(;;){if(a in s){o=s[a],a+=l;break}if(a+=l,u?a<0:i<=a)throw TypeError("Reduce of empty array with no initial value")}for(;u?0<=a:a<i;a+=l)a in s&&(o=t(o,s[a],a,n));return o}}var c=e("../internals/a-function"),d=e("../internals/to-object"),f=e("../internals/indexed-object"),h=e("../internals/to-length");t.exports={left:o(!1),right:o(!0)}},{"../internals/a-function":5,"../internals/indexed-object":66,"../internals/to-length":134,"../internals/to-object":135}],25:[function(e,t,r){var o=e("../internals/is-object"),n=e("../internals/is-array"),s=e("../internals/well-known-symbol")("species");t.exports=function(e,t){var r;return new(void 0===(r=n(e)&&("function"==typeof(r=e.constructor)&&(r===Array||n(r.prototype))||o(r)&&null===(r=r[s]))?void 0:r)?Array:r)(0===t?0:t)}},{"../internals/is-array":72,"../internals/is-object":74,"../internals/well-known-symbol":146}],26:[function(e,t,r){var n=e("../internals/an-object");t.exports=function(t,e,r,o){try{return o?e(n(r)[0],r[1]):e(r)}catch(e){o=t.return;throw void 0!==o&&n(o.call(t)),e}}},{"../internals/an-object":10}],27:[function(e,t,r){var n=e("../internals/well-known-symbol")("iterator"),s=!1;try{var o=0,i={next:function(){return{done:!!o++}},return:function(){s=!0}};i[n]=function(){return this},Array.from(i,function(){throw 2})}catch(e){}t.exports=function(e,t){if(!t&&!s)return!1;var r=!1;try{var o={};o[n]=function(){return{next:function(){return{done:r=!0}}}},e(o)}catch(e){}return r}},{"../internals/well-known-symbol":146}],28:[function(e,t,r){var o={}.toString;t.exports=function(e){return o.call(e).slice(8,-1)}},{}],29:[function(e,t,r){var o=e("../internals/to-string-tag-support"),n=e("../internals/classof-raw"),s=e("../internals/well-known-symbol")("toStringTag"),i="Arguments"==n(function(){return arguments}());t.exports=o?n:function(e){var t;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(t=function(e,t){try{return e[t]}catch(e){}}(e=Object(e),s))?t:i?n(e):"Object"==(t=n(e))&&"function"==typeof e.callee?"Arguments":t}},{"../internals/classof-raw":28,"../internals/to-string-tag-support":139,"../internals/well-known-symbol":146}],30:[function(e,t,r){"use strict";var u=e("../internals/object-define-property").f,c=e("../internals/object-create"),d=e("../internals/redefine-all"),f=e("../internals/function-bind-context"),h=e("../internals/an-instance"),p=e("../internals/iterate"),i=e("../internals/define-iterator"),a=e("../internals/set-species"),m=e("../internals/descriptors"),y=e("../internals/internal-metadata").fastKey,e=e("../internals/internal-state"),g=e.set,v=e.getterFor;t.exports={getConstructor:function(e,r,o,n){function s(e,t,r){var o,n=l(e),s=i(e,t);return s?s.value=r:(n.last=s={index:o=y(t,!0),key:t,value:r,previous:t=n.last,next:void 0,removed:!1},n.first||(n.first=s),t&&(t.next=s),m?n.size++:e.size++,"F"!==o&&(n.index[o]=s)),e}function i(e,t){var r,e=l(e),o=y(t);if("F"!==o)return e.index[o];for(r=e.first;r;r=r.next)if(r.key==t)return r}var a=e(function(e,t){h(e,a,r),g(e,{type:r,index:c(null),first:void 0,last:void 0,size:0}),m||(e.size=0),null!=t&&p(t,e[n],e,o)}),l=v(r);return d(a.prototype,{clear:function(){for(var e=l(this),t=e.index,r=e.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete t[r.index],r=r.next;e.first=e.last=void 0,m?e.size=0:this.size=0},delete:function(e){var t,r,o=l(this),e=i(this,e);return e&&(t=e.next,r=e.previous,delete o.index[e.index],e.removed=!0,r&&(r.next=t),t&&(t.previous=r),o.first==e&&(o.first=t),o.last==e&&(o.last=r),m?o.size--:this.size--),!!e},forEach:function(e){for(var t,r=l(this),o=f(e,1<arguments.length?arguments[1]:void 0,3);t=t?t.next:r.first;)for(o(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!i(this,e)}}),d(a.prototype,o?{get:function(e){e=i(this,e);return e&&e.value},set:function(e,t){return s(this,0===e?0:e,t)}}:{add:function(e){return s(this,e=0===e?0:e,e)}}),m&&u(a.prototype,"size",{get:function(){return l(this).size}}),a},setStrong:function(e,t,r){var o=t+" Iterator",n=v(t),s=v(o);i(e,t,function(e,t){g(this,{type:o,target:e,state:n(e),kind:t,last:void 0})},function(){for(var e=s(this),t=e.kind,r=e.last;r&&r.removed;)r=r.previous;return e.target&&(e.last=r=r?r.next:e.state.first)?"keys"==t?{value:r.key,done:!1}:"values"==t?{value:r.value,done:!1}:{value:[r.key,r.value],done:!1}:{value:e.target=void 0,done:!0}},r?"entries":"values",!r,!0),a(t)}}},{"../internals/an-instance":9,"../internals/define-iterator":41,"../internals/descriptors":43,"../internals/function-bind-context":54,"../internals/internal-metadata":69,"../internals/internal-state":70,"../internals/iterate":77,"../internals/object-create":90,"../internals/object-define-property":92,"../internals/redefine-all":107,"../internals/set-species":116}],31:[function(e,t,r){"use strict";function l(e){return e.frozen||(e.frozen=new o)}function o(){this.entries=[]}function n(e,t){return i(e.entries,function(e){return e[0]===t})}var u=e("../internals/redefine-all"),c=e("../internals/internal-metadata").getWeakData,d=e("../internals/an-object"),f=e("../internals/is-object"),h=e("../internals/an-instance"),p=e("../internals/iterate"),s=e("../internals/array-iteration"),m=e("../internals/has"),e=e("../internals/internal-state"),y=e.set,g=e.getterFor,i=s.find,a=s.findIndex,v=0;o.prototype={get:function(e){e=n(this,e);if(e)return e[1]},has:function(e){return!!n(this,e)},set:function(e,t){var r=n(this,e);r?r[1]=t:this.entries.push([e,t])},delete:function(t){var e=a(this.entries,function(e){return e[0]===t});return~e&&this.entries.splice(e,1),!!~e}},t.exports={getConstructor:function(e,r,o,n){function s(e,t,r){var o=a(e),n=c(d(t),!0);return!0===n?l(o).set(t,r):n[o.id]=r,e}var i=e(function(e,t){h(e,i,r),y(e,{type:r,id:v++,frozen:void 0}),null!=t&&p(t,e[n],e,o)}),a=g(r);return u(i.prototype,{delete:function(e){var t,r=a(this);return!!f(e)&&(!0===(t=c(e))?l(r).delete(e):t&&m(t,r.id)&&delete t[r.id])},has:function(e){var t,r=a(this);return!!f(e)&&(!0===(t=c(e))?l(r).has(e):t&&m(t,r.id))}}),u(i.prototype,o?{get:function(e){var t,r=a(this);if(f(e))return!0===(t=c(e))?l(r).get(e):t?t[r.id]:void 0},set:function(e,t){return s(this,e,t)}}:{add:function(e){return s(this,e,!0)}}),i}}},{"../internals/an-instance":9,"../internals/an-object":10,"../internals/array-iteration":19,"../internals/has":60,"../internals/internal-metadata":69,"../internals/internal-state":70,"../internals/is-object":74,"../internals/iterate":77,"../internals/redefine-all":107}],32:[function(e,t,r){"use strict";var y=e("../internals/export"),g=e("../internals/global"),v=e("../internals/is-forced"),b=e("../internals/redefine"),j=e("../internals/internal-metadata"),_=e("../internals/iterate"),x=e("../internals/an-instance"),w=e("../internals/is-object"),S=e("../internals/fails"),M=e("../internals/check-correctness-of-iteration"),E=e("../internals/set-to-string-tag"),T=e("../internals/inherit-if-required");t.exports=function(r,e,t){function o(e){var r=h[e];b(h,e,"add"==e?function(e){return r.call(this,0===e?0:e),this}:"delete"==e?function(e){return!(c&&!w(e))&&r.call(this,0===e?0:e)}:"get"==e?function(e){return c&&!w(e)?void 0:r.call(this,0===e?0:e)}:"has"==e?function(e){return!(c&&!w(e))&&r.call(this,0===e?0:e)}:function(e,t){return r.call(this,0===e?0:e,t),this})}var n,s,i,a,l,u=-1!==r.indexOf("Map"),c=-1!==r.indexOf("Weak"),d=u?"set":"add",f=g[r],h=f&&f.prototype,p=f,m={};return v(r,"function"!=typeof f||!(c||h.forEach&&!S(function(){(new f).entries().next()})))?(p=t.getConstructor(e,r,u,d),j.REQUIRED=!0):v(r,!0)&&(s=(n=new p)[d](c?{}:-0,1)!=n,i=S(function(){n.has(1)}),a=M(function(e){new f(e)}),l=!c&&S(function(){for(var e=new f,t=5;t--;)e[d](t,t);return!e.has(-0)}),a||(((p=e(function(e,t){x(e,p,r);e=T(new f,e,p);return null!=t&&_(t,e[d],e,u),e})).prototype=h).constructor=p),(i||l)&&(o("delete"),o("has"),u&&o("get")),(l||s)&&o(d),c&&h.clear&&delete h.clear),m[r]=p,y({global:!0,forced:p!=f},m),E(p,r),c||t.setStrong(p,r,u),p}},{"../internals/an-instance":9,"../internals/check-correctness-of-iteration":27,"../internals/export":50,"../internals/fails":51,"../internals/global":59,"../internals/inherit-if-required":67,"../internals/internal-metadata":69,"../internals/is-forced":73,"../internals/is-object":74,"../internals/iterate":77,"../internals/redefine":108,"../internals/set-to-string-tag":117}],33:[function(e,t,r){var a=e("../internals/has"),l=e("../internals/own-keys"),u=e("../internals/object-get-own-property-descriptor"),c=e("../internals/object-define-property");t.exports=function(e,t){for(var r=l(t),o=c.f,n=u.f,s=0;s<r.length;s++){var i=r[s];a(e,i)||o(e,i,n(t,i))}}},{"../internals/has":60,"../internals/object-define-property":92,"../internals/object-get-own-property-descriptor":93,"../internals/own-keys":103}],34:[function(e,t,r){var o=e("../internals/well-known-symbol")("match");t.exports=function(t){var r=/./;try{"/./"[t](r)}catch(e){try{return r[o]=!1,"/./"[t](r)}catch(e){}}return!1}},{"../internals/well-known-symbol":146}],35:[function(e,t,r){e=e("../internals/fails");t.exports=!e(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})},{"../internals/fails":51}],36:[function(e,t,r){var s=e("../internals/require-object-coercible"),i=/"/g;t.exports=function(e,t,r,o){var e=String(s(e)),n="<"+t;return""!==r&&(n+=" "+r+'="'+String(o).replace(i,"&quot;")+'"'),n+">"+e+"</"+t+">"}},{"../internals/require-object-coercible":113}],37:[function(e,t,r){"use strict";function o(){return this}var n=e("../internals/iterators-core").IteratorPrototype,s=e("../internals/object-create"),i=e("../internals/create-property-descriptor"),a=e("../internals/set-to-string-tag"),l=e("../internals/iterators");t.exports=function(e,t,r){t+=" Iterator";return e.prototype=s(n,{next:i(1,r)}),a(e,t,!1,!0),l[t]=o,e}},{"../internals/create-property-descriptor":39,"../internals/iterators":79,"../internals/iterators-core":78,"../internals/object-create":90,"../internals/set-to-string-tag":117}],38:[function(e,t,r){var o=e("../internals/descriptors"),n=e("../internals/object-define-property"),s=e("../internals/create-property-descriptor");t.exports=o?function(e,t,r){return n.f(e,t,s(1,r))}:function(e,t,r){return e[t]=r,e}},{"../internals/create-property-descriptor":39,"../internals/descriptors":43,"../internals/object-define-property":92}],39:[function(e,t,r){t.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},{}],40:[function(e,t,r){"use strict";var o=e("../internals/to-primitive"),n=e("../internals/object-define-property"),s=e("../internals/create-property-descriptor");t.exports=function(e,t,r){t=o(t);t in e?n.f(e,t,s(0,r)):e[t]=r}},{"../internals/create-property-descriptor":39,"../internals/object-define-property":92,"../internals/to-primitive":138}],41:[function(e,t,r){"use strict";function m(){return this}var y=e("../internals/export"),g=e("../internals/create-iterator-constructor"),v=e("../internals/object-get-prototype-of"),b=e("../internals/object-set-prototype-of"),j=e("../internals/set-to-string-tag"),_=e("../internals/create-non-enumerable-property"),x=e("../internals/redefine"),o=e("../internals/well-known-symbol"),w=e("../internals/is-pure"),S=e("../internals/iterators"),e=e("../internals/iterators-core"),M=e.IteratorPrototype,E=e.BUGGY_SAFARI_ITERATORS,T=o("iterator"),C="values",O="entries";t.exports=function(e,t,r,o,n,s,i){g(r,t,o);function a(e){if(e===n&&h)return h;if(!E&&e in d)return d[e];switch(e){case"keys":case C:case O:return function(){return new r(this,e)}}return function(){return new r(this)}}var l,u,o=t+" Iterator",c=!1,d=e.prototype,f=d[T]||d["@@iterator"]||n&&d[n],h=!E&&f||a(n),p="Array"==t&&d.entries||f;if(p&&(p=v(p.call(new e)),M!==Object.prototype&&p.next&&(w||v(p)===M||(b?b(p,M):"function"!=typeof p[T]&&_(p,T,m)),j(p,o,!0,!0),w&&(S[o]=m))),n==C&&f&&f.name!==C&&(c=!0,h=function(){return f.call(this)}),w&&!i||d[T]===h||_(d,T,h),S[t]=h,n)if(l={values:a(C),keys:s?h:a("keys"),entries:a(O)},i)for(u in l)!E&&!c&&u in d||x(d,u,l[u]);else y({target:t,proto:!0,forced:E||c},l);return l}},{"../internals/create-iterator-constructor":37,"../internals/create-non-enumerable-property":38,"../internals/export":50,"../internals/is-pure":75,"../internals/iterators":79,"../internals/iterators-core":78,"../internals/object-get-prototype-of":97,"../internals/object-set-prototype-of":101,"../internals/redefine":108,"../internals/set-to-string-tag":117,"../internals/well-known-symbol":146}],42:[function(e,t,r){var o=e("../internals/path"),n=e("../internals/has"),s=e("../internals/well-known-symbol-wrapped"),i=e("../internals/object-define-property").f;t.exports=function(e){var t=o.Symbol||(o.Symbol={});n(t,e)||i(t,e,{value:s.f(e)})}},{"../internals/has":60,"../internals/object-define-property":92,"../internals/path":104,"../internals/well-known-symbol-wrapped":145}],43:[function(e,t,r){e=e("../internals/fails");t.exports=!e(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})},{"../internals/fails":51}],44:[function(e,t,r){var o=e("../internals/global"),e=e("../internals/is-object"),n=o.document,s=e(n)&&e(n.createElement);t.exports=function(e){return s?n.createElement(e):{}}},{"../internals/global":59,"../internals/is-object":74}],45:[function(e,t,r){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},{}],46:[function(e,t,r){e=e("../internals/engine-user-agent");t.exports=/(iphone|ipod|ipad).*applewebkit/i.test(e)},{"../internals/engine-user-agent":47}],47:[function(e,t,r){e=e("../internals/get-built-in");t.exports=e("navigator","userAgent")||""},{"../internals/get-built-in":56}],48:[function(e,t,r){var o,n,s=e("../internals/global"),e=e("../internals/engine-user-agent"),s=s.process,s=s&&s.versions,s=s&&s.v8;s?n=(o=s.split("."))[0]+o[1]:e&&(!(o=e.match(/Edge\/(\d+)/))||74<=o[1])&&(o=e.match(/Chrome\/(\d+)/))&&(n=o[1]),t.exports=n&&+n},{"../internals/engine-user-agent":47,"../internals/global":59}],49:[function(e,t,r){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},{}],50:[function(e,t,r){var u=e("../internals/global"),c=e("../internals/object-get-own-property-descriptor").f,d=e("../internals/create-non-enumerable-property"),f=e("../internals/redefine"),h=e("../internals/set-global"),p=e("../internals/copy-constructor-properties"),m=e("../internals/is-forced");t.exports=function(e,t){var r,o,n,s=e.target,i=e.global,a=e.stat,l=i?u:a?u[s]||h(s,{}):(u[s]||{}).prototype;if(l)for(r in t){if(o=t[r],n=e.noTargetGet?(n=c(l,r))&&n.value:l[r],!m(i?r:s+(a?".":"#")+r,e.forced)&&void 0!==n){if(typeof o==typeof n)continue;p(o,n)}(e.sham||n&&n.sham)&&d(o,"sham",!0),f(l,r,o,e)}}},{"../internals/copy-constructor-properties":33,"../internals/create-non-enumerable-property":38,"../internals/global":59,"../internals/is-forced":73,"../internals/object-get-own-property-descriptor":93,"../internals/redefine":108,"../internals/set-global":115}],51:[function(e,t,r){t.exports=function(e){try{return!!e()}catch(e){return!0}}},{}],52:[function(e,t,r){"use strict";e("../modules/es.regexp.exec");var u=e("../internals/redefine"),c=e("../internals/fails"),d=e("../internals/well-known-symbol"),f=e("../internals/regexp-exec"),h=e("../internals/create-non-enumerable-property"),p=d("species"),m=!c(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}),y="$0"==="a".replace(/./,"$0"),e=d("replace"),g=!!/./[e]&&""===/./[e]("a","$0"),v=!c(function(){var e=/(?:)/,t=e.exec,e=(e.exec=function(){return t.apply(this,arguments)},"ab".split(e));return 2!==e.length||"a"!==e[0]||"b"!==e[1]});t.exports=function(r,e,t,o){var s,n,i=d(r),a=!c(function(){var e={};return e[i]=function(){return 7},7!=""[r](e)}),l=a&&!c(function(){var e=!1,t=/a/;return"split"===r&&((t={constructor:{}}).constructor[p]=function(){return t},t.flags="",t[i]=/./[i]),t.exec=function(){return e=!0,null},t[i](""),!e});a&&l&&("replace"!==r||m&&y&&!g)&&("split"!==r||v)||(s=/./[i],t=(l=t(i,""[r],function(e,t,r,o,n){return t.exec===f?a&&!n?{done:!0,value:s.call(t,r,o)}:{done:!0,value:e.call(r,t,o)}:{done:!1}},{REPLACE_KEEPS_$0:y,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:g}))[0],n=l[1],u(String.prototype,r,t),u(RegExp.prototype,i,2==e?function(e,t){return n.call(e,this,t)}:function(e){return n.call(e,this)})),o&&h(RegExp.prototype[i],"sham",!0)}},{"../internals/create-non-enumerable-property":38,"../internals/fails":51,"../internals/redefine":108,"../internals/regexp-exec":110,"../internals/well-known-symbol":146,"../modules/es.regexp.exec":181}],53:[function(e,t,r){e=e("../internals/fails");t.exports=!e(function(){return Object.isExtensible(Object.preventExtensions({}))})},{"../internals/fails":51}],54:[function(e,t,r){var s=e("../internals/a-function");t.exports=function(o,n,e){if(s(o),void 0===n)return o;switch(e){case 0:return function(){return o.call(n)};case 1:return function(e){return o.call(n,e)};case 2:return function(e,t){return o.call(n,e,t)};case 3:return function(e,t,r){return o.call(n,e,t,r)}}return function(){return o.apply(n,arguments)}}},{"../internals/a-function":5}],55:[function(e,t,r){"use strict";var o=e("../internals/a-function"),n=e("../internals/is-object"),c=[].slice,d={};t.exports=Function.bind||function(i){var a=o(this),l=c.call(arguments,1),u=function(){var e=l.concat(c.call(arguments));if(this instanceof u){var t=a,r=e.length,o=e;if(!(r in d)){for(var n=[],s=0;s<r;s++)n[s]="a["+s+"]";d[r]=Function("C,a","return new C("+n.join(",")+")")}return d[r](t,o)}return a.apply(i,e)};return n(a.prototype)&&(u.prototype=a.prototype),u}},{"../internals/a-function":5,"../internals/is-object":74}],56:[function(e,t,r){function o(e){return"function"==typeof e?e:void 0}var n=e("../internals/path"),s=e("../internals/global");t.exports=function(e,t){return arguments.length<2?o(n[e])||o(s[e]):n[e]&&n[e][t]||s[e]&&s[e][t]}},{"../internals/global":59,"../internals/path":104}],57:[function(e,t,r){var o=e("../internals/classof"),n=e("../internals/iterators"),s=e("../internals/well-known-symbol")("iterator");t.exports=function(e){if(null!=e)return e[s]||e["@@iterator"]||n[o(e)]}},{"../internals/classof":29,"../internals/iterators":79,"../internals/well-known-symbol":146}],58:[function(e,t,r){var o=e("../internals/an-object"),n=e("../internals/get-iterator-method");t.exports=function(e){var t=n(e);if("function"!=typeof t)throw TypeError(String(e)+" is not iterable");return o(t.call(e))}},{"../internals/an-object":10,"../internals/get-iterator-method":57}],59:[function(e,r,t){!function(e){function t(e){return e&&e.Math==Math&&e}r.exports=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof e&&e)||Function("return this")()}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],60:[function(e,t,r){var o={}.hasOwnProperty;t.exports=function(e,t){return o.call(e,t)}},{}],61:[function(e,t,r){t.exports={}},{}],62:[function(e,t,r){var o=e("../internals/global");t.exports=function(e,t){var r=o.console;r&&r.error&&(1===arguments.length?r.error(e):r.error(e,t))}},{"../internals/global":59}],63:[function(e,t,r){e=e("../internals/get-built-in");t.exports=e("document","documentElement")},{"../internals/get-built-in":56}],64:[function(e,t,r){var o=e("../internals/descriptors"),n=e("../internals/fails"),s=e("../internals/document-create-element");t.exports=!o&&!n(function(){return 7!=Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a})},{"../internals/descriptors":43,"../internals/document-create-element":44,"../internals/fails":51}],65:[function(e,t,r){var f=Math.abs,h=Math.pow,p=Math.floor,m=Math.log,y=Math.LN2;t.exports={pack:function(e,t,r){var o,n,s,i=new Array(r),a=8*r-t-1,r=(1<<a)-1,l=r>>1,u=23===t?h(2,-24)-h(2,-77):0,c=e<0||0===e&&1/e<0?1:0,d=0;for((e=f(e))!=e||e===1/0?(n=e!=e?1:0,o=r):(o=p(m(e)/y),e*(s=h(2,-o))<1&&(o--,s*=2),2<=(e+=1<=o+l?u/s:u*h(2,1-l))*s&&(o++,s/=2),r<=o+l?(n=0,o=r):1<=o+l?(n=(e*s-1)*h(2,t),o+=l):(n=e*h(2,l-1)*h(2,t),o=0));8<=t;i[d++]=255&n,n/=256,t-=8);for(o=o<<t|n,a+=t;0<a;i[d++]=255&o,o/=256,a-=8);return i[--d]|=128*c,i},unpack:function(e,t){var r,o=e.length,n=8*o-t-1,s=(1<<n)-1,i=s>>1,a=n-7,l=o-1,n=e[l--],u=127&n;for(n>>=7;0<a;u=256*u+e[l],l--,a-=8);for(r=u&(1<<-a)-1,u>>=-a,a+=t;0<a;r=256*r+e[l],l--,a-=8);if(0===u)u=1-i;else{if(u===s)return r?NaN:n?-1/0:1/0;r+=h(2,t),u-=i}return(n?-1:1)*r*h(2,u-t)}}},{}],66:[function(e,t,r){var o=e("../internals/fails"),n=e("../internals/classof-raw"),s="".split;t.exports=o(function(){return!Object("z").propertyIsEnumerable(0)})?function(e){return"String"==n(e)?s.call(e,""):Object(e)}:Object},{"../internals/classof-raw":28,"../internals/fails":51}],67:[function(e,t,r){var o=e("../internals/is-object"),n=e("../internals/object-set-prototype-of");t.exports=function(e,t,r){return n&&"function"==typeof(t=t.constructor)&&t!==r&&o(t=t.prototype)&&t!==r.prototype&&n(e,t),e}},{"../internals/is-object":74,"../internals/object-set-prototype-of":101}],68:[function(e,t,r){var e=e("../internals/shared-store"),o=Function.toString;"function"!=typeof e.inspectSource&&(e.inspectSource=function(e){return o.call(e)}),t.exports=e.inspectSource},{"../internals/shared-store":119}],69:[function(e,t,r){function o(e){a(e,c,{value:{objectID:"O"+ ++d,weakData:{}}})}var n=e("../internals/hidden-keys"),s=e("../internals/is-object"),i=e("../internals/has"),a=e("../internals/object-define-property").f,l=e("../internals/uid"),u=e("../internals/freezing"),c=l("meta"),d=0,f=Object.isExtensible||function(){return!0},h=t.exports={REQUIRED:!1,fastKey:function(e,t){if(!s(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!i(e,c)){if(!f(e))return"F";if(!t)return"E";o(e)}return e[c].objectID},getWeakData:function(e,t){if(!i(e,c)){if(!f(e))return!0;if(!t)return!1;o(e)}return e[c].weakData},onFreeze:function(e){return u&&h.REQUIRED&&f(e)&&!i(e,c)&&o(e),e}};n[c]=!0},{"../internals/freezing":53,"../internals/has":60,"../internals/hidden-keys":61,"../internals/is-object":74,"../internals/object-define-property":92,"../internals/uid":143}],70:[function(e,t,r){var o,n,s,i,a,l,u,c,d=e("../internals/native-weak-map"),f=e("../internals/global"),h=e("../internals/is-object"),p=e("../internals/create-non-enumerable-property"),m=e("../internals/has"),y=e("../internals/shared-key"),e=e("../internals/hidden-keys"),f=f.WeakMap;u=d?(o=new f,n=o.get,s=o.has,i=o.set,a=function(e,t){return i.call(o,e,t),t},l=function(e){return n.call(o,e)||{}},function(e){return s.call(o,e)}):(e[c=y("state")]=!0,a=function(e,t){return p(e,c,t),t},l=function(e){return m(e,c)?e[c]:{}},function(e){return m(e,c)}),t.exports={set:a,get:l,has:u,enforce:function(e){return u(e)?l(e):a(e,{})},getterFor:function(t){return function(e){if(h(e)&&(e=l(e)).type===t)return e;throw TypeError("Incompatible receiver, "+t+" required")}}}},{"../internals/create-non-enumerable-property":38,"../internals/global":59,"../internals/has":60,"../internals/hidden-keys":61,"../internals/is-object":74,"../internals/native-weak-map":85,"../internals/shared-key":118}],71:[function(e,t,r){var o=e("../internals/well-known-symbol"),n=e("../internals/iterators"),s=o("iterator"),i=Array.prototype;t.exports=function(e){return void 0!==e&&(n.Array===e||i[s]===e)}},{"../internals/iterators":79,"../internals/well-known-symbol":146}],72:[function(e,t,r){var o=e("../internals/classof-raw");t.exports=Array.isArray||function(e){return"Array"==o(e)}},{"../internals/classof-raw":28}],73:[function(e,t,r){function o(e,t){return(e=a[i(e)])==u||e!=l&&("function"==typeof t?n(t):!!t)}var n=e("../internals/fails"),s=/#|\.prototype\./,i=o.normalize=function(e){return String(e).replace(s,".").toLowerCase()},a=o.data={},l=o.NATIVE="N",u=o.POLYFILL="P";t.exports=o},{"../internals/fails":51}],74:[function(e,t,r){t.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},{}],75:[function(e,t,r){t.exports=!1},{}],76:[function(e,t,r){var o=e("../internals/is-object"),n=e("../internals/classof-raw"),s=e("../internals/well-known-symbol")("match");t.exports=function(e){var t;return o(e)&&(void 0!==(t=e[s])?!!t:"RegExp"==n(e))}},{"../internals/classof-raw":28,"../internals/is-object":74,"../internals/well-known-symbol":146}],77:[function(e,t,r){function f(e,t){this.stopped=e,this.result=t}var h=e("../internals/an-object"),p=e("../internals/is-array-iterator-method"),m=e("../internals/to-length"),y=e("../internals/function-bind-context"),g=e("../internals/get-iterator-method"),v=e("../internals/call-with-safe-iteration-closing");(t.exports=function(e,t,r,o,n){var s,i,a,l,u,c,d=y(t,r,o?2:1);if(n)s=e;else{if("function"!=typeof(t=g(e)))throw TypeError("Target is not iterable");if(p(t)){for(i=0,a=m(e.length);i<a;i++)if((l=o?d(h(c=e[i])[0],c[1]):d(e[i]))&&l instanceof f)return l;return new f(!1)}s=t.call(e)}for(u=s.next;!(c=u.call(s)).done;)if("object"==typeof(l=v(s,d,c.value,o))&&l&&l instanceof f)return l;return new f(!1)}).stop=function(e){return new f(!0,e)}},{"../internals/an-object":10,"../internals/call-with-safe-iteration-closing":26,"../internals/function-bind-context":54,"../internals/get-iterator-method":57,"../internals/is-array-iterator-method":71,"../internals/to-length":134}],78:[function(e,t,r){"use strict";var o,n,s=e("../internals/object-get-prototype-of"),i=e("../internals/create-non-enumerable-property"),a=e("../internals/has"),l=e("../internals/well-known-symbol"),e=e("../internals/is-pure"),l=l("iterator"),u=!1;[].keys&&("next"in(n=[].keys())?(s=s(s(n)))!==Object.prototype&&(o=s):u=!0),null==o&&(o={}),e||a(o,l)||i(o,l,function(){return this}),t.exports={IteratorPrototype:o,BUGGY_SAFARI_ITERATORS:u}},{"../internals/create-non-enumerable-property":38,"../internals/has":60,"../internals/is-pure":75,"../internals/object-get-prototype-of":97,"../internals/well-known-symbol":146}],79:[function(e,t,r){t.exports={}},{}],80:[function(e,t,r){t.exports=Math.sign||function(e){return 0==(e=+e)||e!=e?e:e<0?-1:1}},{}],81:[function(e,t,r){var o,n,s,i,a,l,u,c,d=e("../internals/global"),f=e("../internals/object-get-own-property-descriptor").f,h=e("../internals/classof-raw"),p=e("../internals/task").set,e=e("../internals/engine-is-ios"),m=d.MutationObserver||d.WebKitMutationObserver,y=d.process,g=d.Promise,v="process"==h(y),h=f(d,"queueMicrotask"),f=h&&h.value;f||(o=function(){var e,t;for(v&&(e=y.domain)&&e.exit();n;){t=n.fn,n=n.next;try{t()}catch(e){throw n?i():s=void 0,e}}s=void 0,e&&e.enter()},i=v?function(){y.nextTick(o)}:m&&!e?(a=!0,l=document.createTextNode(""),new m(o).observe(l,{characterData:!0}),function(){l.data=a=!a}):g&&g.resolve?(u=g.resolve(void 0),c=u.then,function(){c.call(u,o)}):function(){p.call(d,o)}),t.exports=f||function(e){e={fn:e,next:void 0};s&&(s.next=e),n||(n=e,i()),s=e}},{"../internals/classof-raw":28,"../internals/engine-is-ios":46,"../internals/global":59,"../internals/object-get-own-property-descriptor":93,"../internals/task":128}],82:[function(e,t,r){e=e("../internals/global");t.exports=e.Promise},{"../internals/global":59}],83:[function(e,t,r){e=e("../internals/fails");t.exports=!!Object.getOwnPropertySymbols&&!e(function(){return!String(Symbol())})},{"../internals/fails":51}],84:[function(e,t,r){var o=e("../internals/fails"),n=e("../internals/well-known-symbol"),s=e("../internals/is-pure"),i=n("iterator");t.exports=!o(function(){var e=new URL("b?a=1&b=2&c=3","http://a"),r=e.searchParams,o="";return e.pathname="c%20d",r.forEach(function(e,t){r.delete("b"),o+=t+e}),s&&!e.toJSON||!r.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==r.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!r[i]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==o||"x"!==new URL("http://x",void 0).host})},{"../internals/fails":51,"../internals/is-pure":75,"../internals/well-known-symbol":146}],85:[function(e,t,r){var o=e("../internals/global"),e=e("../internals/inspect-source"),o=o.WeakMap;t.exports="function"==typeof o&&/native code/.test(e(o))},{"../internals/global":59,"../internals/inspect-source":68}],86:[function(e,t,r){"use strict";function o(e){var r,o;this.promise=new e(function(e,t){if(void 0!==r||void 0!==o)throw TypeError("Bad Promise constructor");r=e,o=t}),this.resolve=n(r),this.reject=n(o)}var n=e("../internals/a-function");t.exports.f=function(e){return new o(e)}},{"../internals/a-function":5}],87:[function(e,t,r){var o=e("../internals/is-regexp");t.exports=function(e){if(o(e))throw TypeError("The method doesn't accept regular expressions");return e}},{"../internals/is-regexp":76}],88:[function(e,t,r){var o=e("../internals/global").isFinite;t.exports=Number.isFinite||function(e){return"number"==typeof e&&o(e)}},{"../internals/global":59}],89:[function(e,t,r){"use strict";var f=e("../internals/descriptors"),o=e("../internals/fails"),h=e("../internals/object-keys"),p=e("../internals/object-get-own-property-symbols"),m=e("../internals/object-property-is-enumerable"),y=e("../internals/to-object"),g=e("../internals/indexed-object"),n=Object.assign,s=Object.defineProperty;t.exports=!n||o(function(){var e,t,r,o;return!(!f||1===n({b:1},n(s({},"a",{enumerable:!0,get:function(){s(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)||(t={},o="abcdefghijklmnopqrst",(e={})[r=Symbol()]=7,o.split("").forEach(function(e){t[e]=e}),7!=n({},e)[r]||h(n({},t)).join("")!=o)})?function(e,t){for(var r=y(e),o=arguments.length,n=1,s=p.f,i=m.f;n<o;)for(var a,l=g(arguments[n++]),u=s?h(l).concat(s(l)):h(l),c=u.length,d=0;d<c;)a=u[d++],f&&!i.call(l,a)||(r[a]=l[a]);return r}:n},{"../internals/descriptors":43,"../internals/fails":51,"../internals/indexed-object":66,"../internals/object-get-own-property-symbols":96,"../internals/object-keys":99,"../internals/object-property-is-enumerable":100,"../internals/to-object":135}],90:[function(e,t,r){function o(){}var n,s=e("../internals/an-object"),i=e("../internals/object-define-properties"),a=e("../internals/enum-bug-keys"),l=e("../internals/hidden-keys"),u=e("../internals/html"),c=e("../internals/document-create-element"),e=e("../internals/shared-key"),d="prototype",f="script",h=e("IE_PROTO"),p=function(e){return"<"+f+">"+e+"</"+f+">"},m=function(){try{n=document.domain&&new ActiveXObject("htmlfile")}catch(e){}m=n?((e=n).write(p("")),e.close(),t=e.parentWindow.Object,e=null,t):(e=c("iframe"),t="java"+f+":",e.style.display="none",u.appendChild(e),e.src=String(t),(t=e.contentWindow.document).open(),t.write(p("document.F=Object")),t.close(),t.F);for(var e,t,r=a.length;r--;)delete m[d][a[r]];return m()};l[h]=!0,t.exports=Object.create||function(e,t){var r;return null!==e?(o[d]=s(e),r=new o,o[d]=null,r[h]=e):r=m(),void 0===t?r:i(r,t)}},{"../internals/an-object":10,"../internals/document-create-element":44,"../internals/enum-bug-keys":49,"../internals/hidden-keys":61,"../internals/html":63,"../internals/object-define-properties":91,"../internals/shared-key":118}],91:[function(e,t,r){var o=e("../internals/descriptors"),i=e("../internals/object-define-property"),a=e("../internals/an-object"),l=e("../internals/object-keys");t.exports=o?Object.defineProperties:function(e,t){a(e);for(var r,o=l(t),n=o.length,s=0;s<n;)i.f(e,r=o[s++],t[r]);return e}},{"../internals/an-object":10,"../internals/descriptors":43,"../internals/object-define-property":92,"../internals/object-keys":99}],92:[function(e,t,r){var o=e("../internals/descriptors"),n=e("../internals/ie8-dom-define"),s=e("../internals/an-object"),i=e("../internals/to-primitive"),a=Object.defineProperty;r.f=o?a:function(e,t,r){if(s(e),t=i(t,!0),s(r),n)try{return a(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},{"../internals/an-object":10,"../internals/descriptors":43,"../internals/ie8-dom-define":64,"../internals/to-primitive":138}],93:[function(e,t,r){var o=e("../internals/descriptors"),n=e("../internals/object-property-is-enumerable"),s=e("../internals/create-property-descriptor"),i=e("../internals/to-indexed-object"),a=e("../internals/to-primitive"),l=e("../internals/has"),u=e("../internals/ie8-dom-define"),c=Object.getOwnPropertyDescriptor;r.f=o?c:function(e,t){if(e=i(e),t=a(t,!0),u)try{return c(e,t)}catch(e){}if(l(e,t))return s(!n.f.call(e,t),e[t])}},{"../internals/create-property-descriptor":39,"../internals/descriptors":43,"../internals/has":60,"../internals/ie8-dom-define":64,"../internals/object-property-is-enumerable":100,"../internals/to-indexed-object":132,"../internals/to-primitive":138}],94:[function(e,t,r){var o=e("../internals/to-indexed-object"),n=e("../internals/object-get-own-property-names").f,s={}.toString,i="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(e){if(!i||"[object Window]"!=s.call(e))return n(o(e));try{return n(e)}catch(e){return i.slice()}}},{"../internals/object-get-own-property-names":95,"../internals/to-indexed-object":132}],95:[function(e,t,r){var o=e("../internals/object-keys-internal"),n=e("../internals/enum-bug-keys").concat("length","prototype");r.f=Object.getOwnPropertyNames||function(e){return o(e,n)}},{"../internals/enum-bug-keys":49,"../internals/object-keys-internal":98}],96:[function(e,t,r){r.f=Object.getOwnPropertySymbols},{}],97:[function(e,t,r){var o=e("../internals/has"),n=e("../internals/to-object"),s=e("../internals/shared-key"),e=e("../internals/correct-prototype-getter"),i=s("IE_PROTO"),a=Object.prototype;t.exports=e?Object.getPrototypeOf:function(e){return e=n(e),o(e,i)?e[i]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},{"../internals/correct-prototype-getter":35,"../internals/has":60,"../internals/shared-key":118,"../internals/to-object":135}],98:[function(e,t,r){var i=e("../internals/has"),a=e("../internals/to-indexed-object"),l=e("../internals/array-includes").indexOf,u=e("../internals/hidden-keys");t.exports=function(e,t){var r,o=a(e),n=0,s=[];for(r in o)!i(u,r)&&i(o,r)&&s.push(r);for(;t.length>n;)!i(o,r=t[n++])||~l(s,r)||s.push(r);return s}},{"../internals/array-includes":18,"../internals/has":60,"../internals/hidden-keys":61,"../internals/to-indexed-object":132}],99:[function(e,t,r){var o=e("../internals/object-keys-internal"),n=e("../internals/enum-bug-keys");t.exports=Object.keys||function(e){return o(e,n)}},{"../internals/enum-bug-keys":49,"../internals/object-keys-internal":98}],100:[function(e,t,r){"use strict";var o={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,s=n&&!o.call({1:2},1);r.f=s?function(e){e=n(this,e);return!!e&&e.enumerable}:o},{}],101:[function(e,t,r){var n=e("../internals/an-object"),s=e("../internals/a-possible-prototype");t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var r,o=!1,e={};try{(r=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(e,[]),o=e instanceof Array}catch(e){}return function(e,t){return n(e),s(t),o?r.call(e,t):e.__proto__=t,e}}():void 0)},{"../internals/a-possible-prototype":6,"../internals/an-object":10}],102:[function(e,t,r){"use strict";var o=e("../internals/to-string-tag-support"),n=e("../internals/classof");t.exports=o?{}.toString:function(){return"[object "+n(this)+"]"}},{"../internals/classof":29,"../internals/to-string-tag-support":139}],103:[function(e,t,r){var o=e("../internals/get-built-in"),n=e("../internals/object-get-own-property-names"),s=e("../internals/object-get-own-property-symbols"),i=e("../internals/an-object");t.exports=o("Reflect","ownKeys")||function(e){var t=n.f(i(e)),r=s.f;return r?t.concat(r(e)):t}},{"../internals/an-object":10,"../internals/get-built-in":56,"../internals/object-get-own-property-names":95,"../internals/object-get-own-property-symbols":96}],104:[function(e,t,r){e=e("../internals/global");t.exports=e},{"../internals/global":59}],105:[function(e,t,r){t.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},{}],106:[function(e,t,r){var o=e("../internals/an-object"),n=e("../internals/is-object"),s=e("../internals/new-promise-capability");t.exports=function(e,t){return o(e),n(t)&&t.constructor===e?t:((0,(e=s.f(e)).resolve)(t),e.promise)}},{"../internals/an-object":10,"../internals/is-object":74,"../internals/new-promise-capability":86}],107:[function(e,t,r){var n=e("../internals/redefine");t.exports=function(e,t,r){for(var o in t)n(e,o,t[o],r);return e}},{"../internals/redefine":108}],108:[function(e,t,r){var i=e("../internals/global"),a=e("../internals/create-non-enumerable-property"),l=e("../internals/has"),u=e("../internals/set-global"),o=e("../internals/inspect-source"),e=e("../internals/internal-state"),n=e.get,c=e.enforce,d=String(String).split("String");(t.exports=function(e,t,r,o){var n=!!o&&!!o.unsafe,s=!!o&&!!o.enumerable,o=!!o&&!!o.noTargetGet;"function"==typeof r&&("string"!=typeof t||l(r,"name")||a(r,"name",t),c(r).source=d.join("string"==typeof t?t:"")),e===i?s?e[t]=r:u(t,r):(n?!o&&e[t]&&(s=!0):delete e[t],s?e[t]=r:a(e,t,r))})(Function.prototype,"toString",function(){return"function"==typeof this&&n(this).source||o(this)})},{"../internals/create-non-enumerable-property":38,"../internals/global":59,"../internals/has":60,"../internals/inspect-source":68,"../internals/internal-state":70,"../internals/set-global":115}],109:[function(e,t,r){var o=e("./classof-raw"),n=e("./regexp-exec");t.exports=function(e,t){var r=e.exec;if("function"==typeof r){r=r.call(e,t);if("object"!=typeof r)throw TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==o(e))throw TypeError("RegExp#exec called on incompatible receiver");return n.call(e,t)}},{"./classof-raw":28,"./regexp-exec":110}],110:[function(e,t,r){"use strict";var o,n,d=e("./regexp-flags"),e=e("./regexp-sticky-helpers"),f=RegExp.prototype.exec,h=String.prototype.replace,s=f,p=(o=/a/,n=/b*/g,f.call(o,"a"),f.call(n,"a"),0!==o.lastIndex||0!==n.lastIndex),m=e.UNSUPPORTED_Y||e.BROKEN_CARET,y=void 0!==/()??/.exec("")[1];t.exports=s=p||y||m?function(e){var t,r,o,n,s=this,i=m&&s.sticky,a=d.call(s),l=s.source,u=0,c=e;return i&&(-1===(a=a.replace("y","")).indexOf("g")&&(a+="g"),c=String(e).slice(s.lastIndex),0<s.lastIndex&&(!s.multiline||s.multiline&&"\n"!==e[s.lastIndex-1])&&(l="(?: "+l+")",c=" "+c,u++),r=new RegExp("^(?:"+l+")",a)),y&&(r=new RegExp("^"+l+"$(?!\\s)",a)),p&&(t=s.lastIndex),o=f.call(i?r:s,c),i?o?(o.input=o.input.slice(u),o[0]=o[0].slice(u),o.index=s.lastIndex,s.lastIndex+=o[0].length):s.lastIndex=0:p&&o&&(s.lastIndex=s.global?o.index+o[0].length:t),y&&o&&1<o.length&&h.call(o[0],r,function(){for(n=1;n<arguments.length-2;n++)void 0===arguments[n]&&(o[n]=void 0)}),o}:s},{"./regexp-flags":111,"./regexp-sticky-helpers":112}],111:[function(e,t,r){"use strict";var o=e("../internals/an-object");t.exports=function(){var e=o(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},{"../internals/an-object":10}],112:[function(e,t,r){"use strict";e=e("./fails");function o(e,t){return RegExp(e,t)}r.UNSUPPORTED_Y=e(function(){var e=o("a","y");return e.lastIndex=2,null!=e.exec("abcd")}),r.BROKEN_CARET=e(function(){var e=o("^r","gy");return e.lastIndex=2,null!=e.exec("str")})},{"./fails":51}],113:[function(e,t,r){t.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},{}],114:[function(e,t,r){t.exports=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}},{}],115:[function(e,t,r){var o=e("../internals/global"),n=e("../internals/create-non-enumerable-property");t.exports=function(t,r){try{n(o,t,r)}catch(e){o[t]=r}return r}},{"../internals/create-non-enumerable-property":38,"../internals/global":59}],116:[function(e,t,r){"use strict";var o=e("../internals/get-built-in"),n=e("../internals/object-define-property"),s=e("../internals/well-known-symbol"),i=e("../internals/descriptors"),a=s("species");t.exports=function(e){var e=o(e),t=n.f;i&&e&&!e[a]&&t(e,a,{configurable:!0,get:function(){return this}})}},{"../internals/descriptors":43,"../internals/get-built-in":56,"../internals/object-define-property":92,"../internals/well-known-symbol":146}],117:[function(e,t,r){var o=e("../internals/object-define-property").f,n=e("../internals/has"),s=e("../internals/well-known-symbol")("toStringTag");t.exports=function(e,t,r){e&&!n(e=r?e:e.prototype,s)&&o(e,s,{configurable:!0,value:t})}},{"../internals/has":60,"../internals/object-define-property":92,"../internals/well-known-symbol":146}],118:[function(e,t,r){var o=e("../internals/shared"),n=e("../internals/uid"),s=o("keys");t.exports=function(e){return s[e]||(s[e]=n(e))}},{"../internals/shared":120,"../internals/uid":143}],119:[function(e,t,r){var o=e("../internals/global"),e=e("../internals/set-global"),n="__core-js_shared__",o=o[n]||e(n,{});t.exports=o},{"../internals/global":59,"../internals/set-global":115}],120:[function(e,t,r){var o=e("../internals/is-pure"),n=e("../internals/shared-store");(t.exports=function(e,t){return n[e]||(n[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.6.5",mode:o?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},{"../internals/is-pure":75,"../internals/shared-store":119}],121:[function(e,t,r){var o=e("../internals/an-object"),n=e("../internals/a-function"),s=e("../internals/well-known-symbol")("species");t.exports=function(e,t){var e=o(e).constructor;return void 0===e||null==(e=o(e)[s])?t:n(e)}},{"../internals/a-function":5,"../internals/an-object":10,"../internals/well-known-symbol":146}],122:[function(e,t,r){var o=e("../internals/fails");t.exports=function(t){return o(function(){var e=""[t]('"');return e!==e.toLowerCase()||3<e.split('"').length})}},{"../internals/fails":51}],123:[function(e,t,r){function o(n){return function(e,t){var r,e=String(i(e)),t=s(t),o=e.length;return t<0||o<=t?n?"":void 0:(r=e.charCodeAt(t))<55296||56319<r||t+1===o||(o=e.charCodeAt(t+1))<56320||57343<o?n?e.charAt(t):r:n?e.slice(t,t+2):o-56320+(r-55296<<10)+65536}}var s=e("../internals/to-integer"),i=e("../internals/require-object-coercible");t.exports={codeAt:o(!1),charAt:o(!0)}},{"../internals/require-object-coercible":113,"../internals/to-integer":133}],124:[function(e,t,r){"use strict";function g(e){return e+22+75*(e<26)}function s(e){var t,r=[],o=(e=function(e){for(var t=[],r=0,o=e.length;r<o;){var n,s=e.charCodeAt(r++);55296<=s&&s<=56319&&r<o?56320==(64512&(n=e.charCodeAt(r++)))?t.push(((1023&s)<<10)+(1023&n)+65536):(t.push(s),r--):t.push(s)}return t}(e)).length,n=128,s=0,i=72;for(c=0;c<e.length;c++)(t=e[c])<128&&r.push(E(t));var a=r.length,l=a;for(a&&r.push("-");l<o;){for(var u=v,c=0;c<e.length;c++)n<=(t=e[c])&&t<u&&(u=t);var d=l+1;if(u-n>M((v-s)/d))throw RangeError(w);for(s+=(u-n)*d,n=u,c=0;c<e.length;c++){if((t=e[c])<n&&++s>v)throw RangeError(w);if(t==n){for(var f=s,h=b;;h+=b){var p=h<=i?1:i+j<=h?j:h-i;if(f<p)break;var m=f-p,y=b-p;r.push(E(g(p+m%y))),f=M(m/y)}r.push(E(g(f))),i=function(e,t,r){var o=0;for(e=r?M(e/x):e>>1,e+=M(e/t);S*j>>1<e;o+=b)e=M(e/S);return M(o+(S+1)*e/(e+_))}(s,d,l==a),s=0,++l}}++s,++n}return r.join("")}var v=2147483647,b=36,j=26,_=38,x=700,i=/[^\0-\u007E]/,a=/[.\u3002\uFF0E\uFF61]/g,w="Overflow: input needs wider integers to process",S=b-1,M=Math.floor,E=String.fromCharCode;t.exports=function(e){for(var t,r=[],o=e.toLowerCase().replace(a,".").split("."),n=0;n<o.length;n++)t=o[n],r.push(i.test(t)?"xn--"+s(t):t);return r.join(".")}},{}],125:[function(e,t,r){"use strict";var n=e("../internals/to-integer"),s=e("../internals/require-object-coercible");t.exports="".repeat||function(e){var t=String(s(this)),r="",o=n(e);if(o<0||o==1/0)throw RangeError("Wrong number of repetitions");for(;0<o;(o>>>=1)&&(t+=t))1&o&&(r+=t);return r}},{"../internals/require-object-coercible":113,"../internals/to-integer":133}],126:[function(e,t,r){var o=e("../internals/fails"),n=e("../internals/whitespaces");t.exports=function(e){return o(function(){return!!n[e]()||"​…᠎"!="​…᠎"[e]()||n[e].name!==e})}},{"../internals/fails":51,"../internals/whitespaces":147}],127:[function(e,t,r){function o(t){return function(e){e=String(n(e));return 1&t&&(e=e.replace(s,"")),e=2&t?e.replace(i,""):e}}var n=e("../internals/require-object-coercible"),e="["+e("../internals/whitespaces")+"]",s=RegExp("^"+e+e+"*"),i=RegExp(e+e+"*$");t.exports={start:o(1),end:o(2),trim:o(3)}},{"../internals/require-object-coercible":113,"../internals/whitespaces":147}],128:[function(e,t,r){function o(e){return function(){x(e)}}function n(e){x(e.data)}function s(e){a.postMessage(e+"",h.protocol+"//"+h.host)}var i,a=e("../internals/global"),l=e("../internals/fails"),u=e("../internals/classof-raw"),c=e("../internals/function-bind-context"),d=e("../internals/html"),f=e("../internals/document-create-element"),e=e("../internals/engine-is-ios"),h=a.location,p=a.setImmediate,m=a.clearImmediate,y=a.process,g=a.MessageChannel,v=a.Dispatch,b=0,j={},_="onreadystatechange",x=function(e){var t;j.hasOwnProperty(e)&&(t=j[e],delete j[e],t())};p&&m||(p=function(e){for(var t=[],r=1;r<arguments.length;)t.push(arguments[r++]);return j[++b]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},i(b),b},m=function(e){delete j[e]},"process"==u(y)?i=function(e){y.nextTick(o(e))}:v&&v.now?i=function(e){v.now(o(e))}:g&&!e?(e=(u=new g).port2,u.port1.onmessage=n,i=c(e.postMessage,e,1)):!a.addEventListener||"function"!=typeof postMessage||a.importScripts||l(s)||"file:"===h.protocol?i=_ in f("script")?function(e){d.appendChild(f("script"))[_]=function(){d.removeChild(this),x(e)}}:function(e){setTimeout(o(e),0)}:(i=s,a.addEventListener("message",n,!1))),t.exports={set:p,clear:m}},{"../internals/classof-raw":28,"../internals/document-create-element":44,"../internals/engine-is-ios":46,"../internals/fails":51,"../internals/function-bind-context":54,"../internals/global":59,"../internals/html":63}],129:[function(e,t,r){var o=e("../internals/classof-raw");t.exports=function(e){if("number"!=typeof e&&"Number"!=o(e))throw TypeError("Incorrect invocation");return+e}},{"../internals/classof-raw":28}],130:[function(e,t,r){var o=e("../internals/to-integer"),n=Math.max,s=Math.min;t.exports=function(e,t){e=o(e);return e<0?n(e+t,0):s(e,t)}},{"../internals/to-integer":133}],131:[function(e,t,r){var o=e("../internals/to-integer"),n=e("../internals/to-length");t.exports=function(e){if(void 0===e)return 0;var e=o(e),t=n(e);if(e!==t)throw RangeError("Wrong length or index");return t}},{"../internals/to-integer":133,"../internals/to-length":134}],132:[function(e,t,r){var o=e("../internals/indexed-object"),n=e("../internals/require-object-coercible");t.exports=function(e){return o(n(e))}},{"../internals/indexed-object":66,"../internals/require-object-coercible":113}],133:[function(e,t,r){var o=Math.ceil,n=Math.floor;t.exports=function(e){return isNaN(e=+e)?0:(0<e?n:o)(e)}},{}],134:[function(e,t,r){var o=e("../internals/to-integer"),n=Math.min;t.exports=function(e){return 0<e?n(o(e),9007199254740991):0}},{"../internals/to-integer":133}],135:[function(e,t,r){var o=e("../internals/require-object-coercible");t.exports=function(e){return Object(o(e))}},{"../internals/require-object-coercible":113}],136:[function(e,t,r){var o=e("../internals/to-positive-integer");t.exports=function(e,t){e=o(e);if(e%t)throw RangeError("Wrong offset");return e}},{"../internals/to-positive-integer":137}],137:[function(e,t,r){var o=e("../internals/to-integer");t.exports=function(e){e=o(e);if(e<0)throw RangeError("The argument can't be less than 0");return e}},{"../internals/to-integer":133}],138:[function(e,t,r){var n=e("../internals/is-object");t.exports=function(e,t){if(!n(e))return e;var r,o;if(t&&"function"==typeof(r=e.toString)&&!n(o=r.call(e))||"function"==typeof(r=e.valueOf)&&!n(o=r.call(e))||!t&&"function"==typeof(r=e.toString)&&!n(o=r.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},{"../internals/is-object":74}],139:[function(e,t,r){var o={};o[e("../internals/well-known-symbol")("toStringTag")]="z",t.exports="[object z]"===String(o)},{"../internals/well-known-symbol":146}],140:[function(e,t,D){"use strict";function h(e,t){for(var r=0,o=t.length,n=new(Q(e))(o);r<o;)n[r]=t[r++];return n}function r(e,t){E(e,t,{get:function(){return M(this)[t]}})}function p(e){return e instanceof C||"ArrayBuffer"==(e=B(e))||"SharedArrayBuffer"==e}function o(e,t){return A(e)&&"symbol"!=typeof t&&t in e&&String(+t)==String(t)}function n(e,t){return o(e,t=d(t,!0))?N(2,e[t]):X(e,t)}function s(e,t,r){return!(o(e,t=d(t,!0))&&b(r)&&f(r,"value"))||f(r,"get")||f(r,"set")||r.configurable||f(r,"writable")&&!r.writable||f(r,"enumerable")&&!r.enumerable?E(e,t,r):(e[t]=r.value,e)}var a=e("../internals/export"),l=e("../internals/global"),i=e("../internals/descriptors"),U=e("../internals/typed-array-constructors-require-wrappers"),u=e("../internals/array-buffer-view-core"),c=e("../internals/array-buffer"),m=e("../internals/an-instance"),N=e("../internals/create-property-descriptor"),y=e("../internals/create-non-enumerable-property"),F=e("../internals/to-length"),g=e("../internals/to-index"),v=e("../internals/to-offset"),d=e("../internals/to-primitive"),f=e("../internals/has"),B=e("../internals/classof"),b=e("../internals/is-object"),G=e("../internals/object-create"),j=e("../internals/object-set-prototype-of"),V=e("../internals/object-get-own-property-names").f,_=e("../internals/typed-array-from"),z=e("../internals/array-iteration").forEach,H=e("../internals/set-species"),x=e("../internals/object-define-property"),w=e("../internals/object-get-own-property-descriptor"),S=e("../internals/internal-state"),W=e("../internals/inherit-if-required"),M=S.get,q=S.set,E=x.f,X=w.f,Y=Math.round,T=l.RangeError,C=c.ArrayBuffer,Z=c.DataView,O=u.NATIVE_ARRAY_BUFFER_VIEWS,k=u.TYPED_ARRAY_TAG,L=u.TypedArray,P=u.TypedArrayPrototype,Q=u.aTypedArrayConstructor,A=u.isTypedArray,R="BYTES_PER_ELEMENT",I="Wrong length";i?(O||(w.f=n,x.f=s,r(P,"buffer"),r(P,"byteOffset"),r(P,"byteLength"),r(P,"length")),a({target:"Object",stat:!0,forced:!O},{getOwnPropertyDescriptor:n,defineProperty:s}),t.exports=function(e,t,n){function u(e,o){E(e,o,{get:function(){var e=this,t=o;return(e=M(e)).view[r](t*c+e.byteOffset,!0)},set:function(e){var t=this,r=o;t=M(t),n&&(e=(e=Y(e))<0?0:255<e?255:255&e),t.view[s](r*c+t.byteOffset,e,!0)},enumerable:!0})}var c=e.match(/\d+$/)[0]/8,d=e+(n?"Clamped":"")+"Array",r="get"+e,s="set"+e,i=l[d],f=i,e=f&&f.prototype,o={};O?U&&(f=t(function(e,t,r,o){return m(e,f,d),W(b(t)?p(t)?void 0!==o?new i(t,v(r,c),o):void 0!==r?new i(t,v(r,c)):new i(t):A(t)?h(f,t):_.call(f,t):new i(g(t)),e,f)}),j&&j(f,L),z(V(i),function(e){e in f||y(f,e,i[e])}),f.prototype=e):(f=t(function(e,t,r,o){m(e,f,d);var n,s,i=0,a=0;if(b(t)){if(!p(t))return A(t)?h(f,t):_.call(f,t);var l=t,a=v(r,c),r=t.byteLength;if(void 0===o){if(r%c)throw T(I);if((n=r-a)<0)throw T(I)}else if(r<(n=F(o)*c)+a)throw T(I);s=n/c}else s=g(t),l=new C(n=s*c);for(q(e,{buffer:l,byteOffset:a,byteLength:n,length:s,view:new Z(l)});i<s;)u(e,i++)}),j&&j(f,L),e=f.prototype=G(P)),e.constructor!==f&&y(e,"constructor",f),k&&y(e,k,d),o[d]=f,a({global:!0,forced:f!=i,sham:!O},o),R in f||y(f,R,c),R in e||y(e,R,c),H(d)}):t.exports=function(){}},{"../internals/an-instance":9,"../internals/array-buffer":13,"../internals/array-buffer-view-core":12,"../internals/array-iteration":19,"../internals/classof":29,"../internals/create-non-enumerable-property":38,"../internals/create-property-descriptor":39,"../internals/descriptors":43,"../internals/export":50,"../internals/global":59,"../internals/has":60,"../internals/inherit-if-required":67,"../internals/internal-state":70,"../internals/is-object":74,"../internals/object-create":90,"../internals/object-define-property":92,"../internals/object-get-own-property-descriptor":93,"../internals/object-get-own-property-names":95,"../internals/object-set-prototype-of":101,"../internals/set-species":116,"../internals/to-index":131,"../internals/to-length":134,"../internals/to-offset":136,"../internals/to-primitive":138,"../internals/typed-array-constructors-require-wrappers":141,"../internals/typed-array-from":142}],141:[function(e,t,r){var o=e("../internals/global"),n=e("../internals/fails"),s=e("../internals/check-correctness-of-iteration"),e=e("../internals/array-buffer-view-core").NATIVE_ARRAY_BUFFER_VIEWS,i=o.ArrayBuffer,a=o.Int8Array;t.exports=!e||!n(function(){a(1)})||!n(function(){new a(-1)})||!s(function(e){new a,new a(null),new a(1.5),new a(e)},!0)||n(function(){return 1!==new a(new i(2),1,void 0).length})},{"../internals/array-buffer-view-core":12,"../internals/check-correctness-of-iteration":27,"../internals/fails":51,"../internals/global":59}],142:[function(e,t,r){var f=e("../internals/to-object"),h=e("../internals/to-length"),p=e("../internals/get-iterator-method"),m=e("../internals/is-array-iterator-method"),y=e("../internals/function-bind-context"),g=e("../internals/array-buffer-view-core").aTypedArrayConstructor;t.exports=function(e){var t,r,o,n,s,i,a=f(e),l=arguments.length,u=1<l?arguments[1]:void 0,c=void 0!==u,d=p(a);if(null!=d&&!m(d))for(i=(s=d.call(a)).next,a=[];!(n=i.call(s)).done;)a.push(n.value);for(c&&2<l&&(u=y(u,arguments[2],2)),r=h(a.length),o=new(g(this))(r),t=0;t<r;t++)o[t]=c?u(a[t],t):a[t];return o}},{"../internals/array-buffer-view-core":12,"../internals/function-bind-context":54,"../internals/get-iterator-method":57,"../internals/is-array-iterator-method":71,"../internals/to-length":134,"../internals/to-object":135}],143:[function(e,t,r){var o=0,n=Math.random();t.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++o+n).toString(36)}},{}],144:[function(e,t,r){e=e("../internals/native-symbol");t.exports=e&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},{"../internals/native-symbol":83}],145:[function(e,t,r){e=e("../internals/well-known-symbol");r.f=e},{"../internals/well-known-symbol":146}],146:[function(e,t,r){var o=e("../internals/global"),n=e("../internals/shared"),s=e("../internals/has"),i=e("../internals/uid"),a=e("../internals/native-symbol"),e=e("../internals/use-symbol-as-uid"),l=n("wks"),u=o.Symbol,c=e?u:u&&u.withoutSetter||i;t.exports=function(e){return s(l,e)||(a&&s(u,e)?l[e]=u[e]:l[e]=c("Symbol."+e)),l[e]}},{"../internals/global":59,"../internals/has":60,"../internals/native-symbol":83,"../internals/shared":120,"../internals/uid":143,"../internals/use-symbol-as-uid":144}],147:[function(e,t,r){t.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},{}],148:[function(e,t,r){"use strict";var o=e("../internals/export"),n=e("../internals/global"),s=e("../internals/array-buffer"),e=e("../internals/set-species"),i="ArrayBuffer",s=s[i];o({global:!0,forced:n[i]!==s},{ArrayBuffer:s}),e(i)},{"../internals/array-buffer":13,"../internals/export":50,"../internals/global":59,"../internals/set-species":116}],149:[function(e,t,r){"use strict";var o=e("../internals/export"),n=e("../internals/fails"),d=e("../internals/is-array"),f=e("../internals/is-object"),h=e("../internals/to-object"),p=e("../internals/to-length"),m=e("../internals/create-property"),y=e("../internals/array-species-create"),s=e("../internals/array-method-has-species-support"),i=e("../internals/well-known-symbol"),e=e("../internals/engine-v8-version"),g=i("isConcatSpreadable"),v=9007199254740991,b="Maximum allowed index exceeded",i=51<=e||!n(function(){var e=[];return e[g]=!1,e.concat()[0]!==e}),e=s("concat");o({target:"Array",proto:!0,forced:!i||!e},{concat:function(e){for(var t,r,o,n,s,i=h(this),a=y(i,0),l=0,u=-1,c=arguments.length;u<c;u++)if(s=void 0,!f(n=o=-1===u?i:arguments[u])||(void 0!==(s=n[g])?!s:!d(n))){if(v<=l)throw TypeError(b);m(a,l++,o)}else{if(r=p(o.length),v<l+r)throw TypeError(b);for(t=0;t<r;t++,l++)t in o&&m(a,l,o[t])}return a.length=l,a}})},{"../internals/array-method-has-species-support":21,"../internals/array-species-create":25,"../internals/create-property":40,"../internals/engine-v8-version":48,"../internals/export":50,"../internals/fails":51,"../internals/is-array":72,"../internals/is-object":74,"../internals/to-length":134,"../internals/to-object":135,"../internals/well-known-symbol":146}],150:[function(e,t,r){var o=e("../internals/export"),n=e("../internals/array-copy-within"),e=e("../internals/add-to-unscopables");o({target:"Array",proto:!0},{copyWithin:n}),e("copyWithin")},{"../internals/add-to-unscopables":7,"../internals/array-copy-within":14,"../internals/export":50}],151:[function(e,t,r){"use strict";var o=e("../internals/export"),n=e("../internals/array-iteration").every,s=e("../internals/array-method-is-strict"),e=e("../internals/array-method-uses-to-length"),s=s("every"),e=e("every");o({target:"Array",proto:!0,forced:!s||!e},{every:function(e){return n(this,e,1<arguments.length?arguments[1]:void 0)}})},{"../internals/array-iteration":19,"../internals/array-method-is-strict":22,"../internals/array-method-uses-to-length":23,"../internals/export":50}],152:[function(e,t,r){var o=e("../internals/export"),n=e("../internals/array-fill"),e=e("../internals/add-to-unscopables");o({target:"Array",proto:!0},{fill:n}),e("fill")},{"../internals/add-to-unscopables":7,"../internals/array-fill":15,"../internals/export":50}],153:[function(e,t,r){"use strict";var o=e("../internals/export"),n=e("../internals/array-iteration").filter,s=e("../internals/array-method-has-species-support"),e=e("../internals/array-method-uses-to-length"),s=s("filter"),e=e("filter");o({target:"Array",proto:!0,forced:!s||!e},{filter:function(e){return n(this,e,1<arguments.length?arguments[1]:void 0)}})},{"../internals/array-iteration":19,"../internals/array-method-has-species-support":21,"../internals/array-method-uses-to-length":23,"../internals/export":50}],154:[function(e,t,r){"use strict";var o=e("../internals/export"),e=e("../internals/array-for-each");o({target:"Array",proto:!0,forced:[].forEach!=e},{forEach:e})},{"../internals/array-for-each":16,"../internals/export":50}],155:[function(e,t,r){var o=e("../internals/export"),n=e("../internals/array-from");o({target:"Array",stat:!0,forced:!e("../internals/check-correctness-of-iteration")(function(e){Array.from(e)})},{from:n})},{"../internals/array-from":17,"../internals/check-correctness-of-iteration":27,"../internals/export":50}],156:[function(e,t,r){"use strict";var o=e("../internals/export"),n=e("../internals/array-includes").includes,s=e("../internals/add-to-unscopables");o({target:"Array",proto:!0,forced:!e("../internals/array-method-uses-to-length")("indexOf",{ACCESSORS:!0,1:0})},{includes:function(e){return n(this,e,1<arguments.length?arguments[1]:void 0)}}),s("includes")},{"../internals/add-to-unscopables":7,"../internals/array-includes":18,"../internals/array-method-uses-to-length":23,"../internals/export":50}],157:[function(e,t,r){"use strict";var o=e("../internals/export"),n=e("../internals/array-includes").indexOf,s=e("../internals/array-method-is-strict"),e=e("../internals/array-method-uses-to-length"),i=[].indexOf,a=!!i&&1/[1].indexOf(1,-0)<0,s=s("indexOf"),e=e("indexOf",{ACCESSORS:!0,1:0});o({target:"Array",proto:!0,forced:a||!s||!e},{indexOf:function(e){return a?i.apply(this,arguments)||0:n(this,e,1<arguments.length?arguments[1]:void 0)}})},{"../internals/array-includes":18,"../internals/array-method-is-strict":22,"../internals/array-method-uses-to-length":23,"../internals/export":50}],158:[function(e,t,r){"use strict";var o=e("../internals/to-indexed-object"),n=e("../internals/add-to-unscopables"),s=e("../internals/iterators"),i=e("../internals/internal-state"),e=e("../internals/define-iterator"),a="Array Iterator",l=i.set,u=i.getterFor(a);t.exports=e(Array,"Array",function(e,t){l(this,{type:a,target:o(e),index:0,kind:t})},function(){var e=u(this),t=e.target,r=e.kind,o=e.index++;return!t||o>=t.length?{value:e.target=void 0,done:!0}:"keys"==r?{value:o,done:!1}:"values"==r?{value:t[o],done:!1}:{value:[o,t[o]],done:!1}},"values"),s.Arguments=s.Array,n("keys"),n("values"),n("entries")},{"../internals/add-to-unscopables":7,"../internals/define-iterator":41,"../internals/internal-state":70,"../internals/iterators":79,"../internals/to-indexed-object":132}],159:[function(e,t,r){"use strict";var o=e("../internals/export"),n=e("../internals/indexed-object"),s=e("../internals/to-indexed-object"),e=e("../internals/array-method-is-strict"),i=[].join,n=n!=Object,e=e("join",",");o({target:"Array",proto:!0,forced:n||!e},{join:function(e){return i.call(s(this),void 0===e?",":e)}})},{"../internals/array-method-is-strict":22,"../internals/export":50,"../internals/indexed-object":66,"../internals/to-indexed-object":132}],160:[function(e,t,r){var o=e("../internals/export"),e=e("../internals/array-last-index-of");o({target:"Array",proto:!0,forced:e!==[].lastIndexOf},{lastIndexOf:e})},{"../internals/array-last-index-of":20,"../internals/export":50}],161:[function(e,t,r){"use strict";var o=e("../internals/export"),n=e("../internals/array-iteration").map,s=e("../internals/array-method-has-species-support"),e=e("../internals/array-method-uses-to-length"),s=s("map"),e=e("map");o({target:"Array",proto:!0,forced:!s||!e},{map:function(e){return n(this,e,1<arguments.length?arguments[1]:void 0)}})},{"../internals/array-iteration":19,"../internals/array-method-has-species-support":21,"../internals/array-method-uses-to-length":23,"../internals/export":50}],162:[function(e,t,r){"use strict";var o=e("../internals/export"),u=e("../internals/is-object"),c=e("../internals/is-array"),d=e("../internals/to-absolute-index"),f=e("../internals/to-length"),h=e("../internals/to-indexed-object"),p=e("../internals/create-property"),n=e("../internals/well-known-symbol"),s=e("../internals/array-method-has-species-support"),e=e("../internals/array-method-uses-to-length"),s=s("slice"),e=e("slice",{ACCESSORS:!0,0:0,1:2}),m=n("species"),y=[].slice,g=Math.max;o({target:"Array",proto:!0,forced:!s||!e},{slice:function(e,t){var r,o,n,s=h(this),i=f(s.length),a=d(e,i),l=d(void 0===t?i:t,i);if(c(s)&&((r="function"==typeof(r=s.constructor)&&(r===Array||c(r.prototype))||u(r)&&null===(r=r[m])?void 0:r)===Array||void 0===r))return y.call(s,a,l);for(o=new(void 0===r?Array:r)(g(l-a,0)),n=0;a<l;a++,n++)a in s&&p(o,n,s[a]);return o.length=n,o}})},{"../internals/array-method-has-species-support":21,"../internals/array-method-uses-to-length":23,"../internals/create-property":40,"../internals/export":50,"../internals/is-array":72,"../internals/is-object":74,"../internals/to-absolute-index":130,"../internals/to-indexed-object":132,"../internals/to-length":134,"../internals/well-known-symbol":146}],163:[function(e,t,r){"use strict";var o=e("../internals/export"),n=e("../internals/array-iteration").some,s=e("../internals/array-method-is-strict"),e=e("../internals/array-method-uses-to-length"),s=s("some"),e=e("some");o({target:"Array",proto:!0,forced:!s||!e},{some:function(e){return n(this,e,1<arguments.length?arguments[1]:void 0)}})},{"../internals/array-iteration":19,"../internals/array-method-is-strict":22,"../internals/array-method-uses-to-length":23,"../internals/export":50}],164:[function(e,t,r){"use strict";var o=e("../internals/export"),d=e("../internals/to-absolute-index"),f=e("../internals/to-integer"),h=e("../internals/to-length"),p=e("../internals/to-object"),m=e("../internals/array-species-create"),y=e("../internals/create-property"),n=e("../internals/array-method-has-species-support"),e=e("../internals/array-method-uses-to-length"),n=n("splice"),e=e("splice",{ACCESSORS:!0,0:0,1:2}),g=Math.max,v=Math.min;o({target:"Array",proto:!0,forced:!n||!e},{splice:function(e,t){var r,o,n,s,i,a,l=p(this),u=h(l.length),c=d(e,u),e=arguments.length;if(0===e?r=o=0:o=1===e?(r=0,u-c):(r=e-2,v(g(f(t),0),u-c)),9007199254740991<u+r-o)throw TypeError("Maximum allowed length exceeded");for(n=m(l,o),s=0;s<o;s++)(i=c+s)in l&&y(n,s,l[i]);if(r<(n.length=o)){for(s=c;s<u-o;s++)a=s+r,(i=s+o)in l?l[a]=l[i]:delete l[a];for(s=u;u-o+r<s;s--)delete l[s-1]}else if(o<r)for(s=u-o;c<s;s--)a=s+r-1,(i=s+o-1)in l?l[a]=l[i]:delete l[a];for(s=0;s<r;s++)l[s+c]=arguments[s+2];return l.length=u-o+r,n}})},{"../internals/array-method-has-species-support":21,"../internals/array-method-uses-to-length":23,"../internals/array-species-create":25,"../internals/create-property":40,"../internals/export":50,"../internals/to-absolute-index":130,"../internals/to-integer":133,"../internals/to-length":134,"../internals/to-object":135}],165:[function(e,t,r){var o=e("../internals/descriptors"),e=e("../internals/object-define-property").f,n=Function.prototype,s=n.toString,i=/^\s*function ([^ (]*)/;!o||"name"in n||e(n,"name",{configurable:!0,get:function(){try{return s.call(this).match(i)[1]}catch(e){return""}}})},{"../internals/descriptors":43,"../internals/object-define-property":92}],166:[function(e,t,r){"use strict";var o=e("../internals/collection"),e=e("../internals/collection-strong");t.exports=o("Map",function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},e)},{"../internals/collection":32,"../internals/collection-strong":30}],167:[function(e,t,r){var e=e("../internals/export"),o=Math.hypot,l=Math.abs,u=Math.sqrt;e({target:"Math",stat:!0,forced:!!o&&o(1/0,NaN)!==1/0},{hypot:function(e,t){for(var r,o,n=0,s=0,i=arguments.length,a=0;s<i;)a<(r=l(arguments[s++]))?(n=n*(o=a/r)*o+1,a=r):n+=0<r?(o=r/a)*o:r;return a===1/0?1/0:a*u(n)}})},{"../internals/export":50}],168:[function(e,t,r){e("../internals/export")({target:"Math",stat:!0},{sign:e("../internals/math-sign")})},{"../internals/export":50,"../internals/math-sign":80}],169:[function(e,t,r){"use strict";function o(e){var t,r,o,n,s,i,a,l=d(e,!1);if("string"==typeof l&&2<l.length)if(43===(e=(l=g(l)).charCodeAt(0))||45===e){if(88===(t=l.charCodeAt(2))||120===t)return NaN}else if(48===e){switch(l.charCodeAt(1)){case 66:case 98:r=2,o=49;break;case 79:case 111:r=8,o=55;break;default:return+l}for(s=(n=l.slice(2)).length,i=0;i<s;i++)if((a=n.charCodeAt(i))<48||o<a)return NaN;return parseInt(n,r)}return+l}var n=e("../internals/descriptors"),s=e("../internals/global"),i=e("../internals/is-forced"),a=e("../internals/redefine"),l=e("../internals/has"),u=e("../internals/classof-raw"),c=e("../internals/inherit-if-required"),d=e("../internals/to-primitive"),f=e("../internals/fails"),h=e("../internals/object-create"),p=e("../internals/object-get-own-property-names").f,m=e("../internals/object-get-own-property-descriptor").f,y=e("../internals/object-define-property").f,g=e("../internals/string-trim").trim,v="Number",b=s[v],j=b.prototype,_=u(h(j))==v;if(i(v,!b(" 0o1")||!b("0b1")||b("+0x1"))){for(var x,w=function(e){var e=arguments.length<1?0:e,t=this;return t instanceof w&&(_?f(function(){j.valueOf.call(t)}):u(t)!=v)?c(new b(o(e)),t,w):o(e)},S=n?p(b):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),M=0;S.length>M;M++)l(b,x=S[M])&&!l(w,x)&&y(w,x,m(b,x));(w.prototype=j).constructor=w,a(s,v,w)}},{"../internals/classof-raw":28,"../internals/descriptors":43,"../internals/fails":51,"../internals/global":59,"../internals/has":60,"../internals/inherit-if-required":67,"../internals/is-forced":73,"../internals/object-create":90,"../internals/object-define-property":92,"../internals/object-get-own-property-descriptor":93,"../internals/object-get-own-property-names":95,"../internals/redefine":108,"../internals/string-trim":127,"../internals/to-primitive":138}],170:[function(e,t,r){e("../internals/export")({target:"Number",stat:!0},{isFinite:e("../internals/number-is-finite")})},{"../internals/export":50,"../internals/number-is-finite":88}],171:[function(e,t,r){"use strict";function c(e,t,r){return 0===t?r:t%2==1?c(e,t-1,r*e):c(e*e,t/2,r)}var o=e("../internals/export"),d=e("../internals/to-integer"),f=e("../internals/this-number-value"),h=e("../internals/string-repeat"),e=e("../internals/fails"),n=1..toFixed,p=Math.floor;o({target:"Number",proto:!0,forced:n&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==0xde0b6b3a7640080.toFixed(0))||!e(function(){n.call({})})},{toFixed:function(e){function t(e,t){for(var r=-1,o=t;++r<6;)o+=e*a[r],a[r]=o%1e7,o=p(o/1e7)}function r(e){for(var t=6,r=0;0<=--t;)r+=a[t],a[t]=p(r/e),r=r%e*1e7}function o(){for(var e,t=6,r="";0<=--t;)""===r&&0!==t&&0===a[t]||(e=String(a[t]),r=""===r?e:r+h.call("0",7-e.length)+e);return r}var n,s,i=f(this),e=d(e),a=[0,0,0,0,0,0],l="",u="0";if(e<0||20<e)throw RangeError("Incorrect fraction digits");if(i!=i)return"NaN";if(i<=-1e21||1e21<=i)return String(i);if(i<0&&(l="-",i=-i),1e-21<i)if(i=(n=function(e){for(var t=0,r=e;4096<=r;)t+=12,r/=4096;for(;2<=r;)t+=1,r/=2;return t}(i*c(2,69,1))-69)<0?i*c(2,-n,1):i/c(2,n,1),i*=4503599627370496,0<(n=52-n)){for(t(0,i),s=e;7<=s;)t(1e7,0),s-=7;for(t(c(10,s,1),0),s=n-1;23<=s;)r(1<<23),s-=23;r(1<<s),t(1,1),r(2),u=o()}else t(0,i),t(1<<-n,0),u=o()+h.call("0",e);return u=0<e?l+((i=u.length)<=e?"0."+h.call("0",e-i)+u:u.slice(0,i-e)+"."+u.slice(i-e)):l+u}})},{"../internals/export":50,"../internals/fails":51,"../internals/string-repeat":125,"../internals/this-number-value":129,"../internals/to-integer":133}],172:[function(e,t,r){var o=e("../internals/export"),e=e("../internals/object-assign");o({target:"Object",stat:!0,forced:Object.assign!==e},{assign:e})},{"../internals/export":50,"../internals/object-assign":89}],173:[function(e,t,r){var o=e("../internals/export"),n=e("../internals/fails"),s=e("../internals/to-indexed-object"),i=e("../internals/object-get-own-property-descriptor").f,e=e("../internals/descriptors"),n=n(function(){i(1)});o({target:"Object",stat:!0,forced:!e||n,sham:!e},{getOwnPropertyDescriptor:function(e,t){return i(s(e),t)}})},{"../internals/descriptors":43,"../internals/export":50,"../internals/fails":51,"../internals/object-get-own-property-descriptor":93,"../internals/to-indexed-object":132}],174:[function(e,t,r){var o=e("../internals/export"),n=e("../internals/fails"),e=e("../internals/object-get-own-property-names-external").f;o({target:"Object",stat:!0,forced:n(function(){return!Object.getOwnPropertyNames(1)})},{getOwnPropertyNames:e})},{"../internals/export":50,"../internals/fails":51,"../internals/object-get-own-property-names-external":94}],175:[function(e,t,r){var o=e("../internals/export"),n=e("../internals/fails"),s=e("../internals/to-object"),i=e("../internals/object-get-prototype-of"),e=e("../internals/correct-prototype-getter");o({target:"Object",stat:!0,forced:n(function(){i(1)}),sham:!e},{getPrototypeOf:function(e){return i(s(e))}})},{"../internals/correct-prototype-getter":35,"../internals/export":50,"../internals/fails":51,"../internals/object-get-prototype-of":97,"../internals/to-object":135}],176:[function(e,t,r){var o=e("../internals/export"),n=e("../internals/to-object"),s=e("../internals/object-keys");o({target:"Object",stat:!0,forced:e("../internals/fails")(function(){s(1)})},{keys:function(e){return s(n(e))}})},{"../internals/export":50,"../internals/fails":51,"../internals/object-keys":99,"../internals/to-object":135}],177:[function(e,t,r){var o=e("../internals/to-string-tag-support"),n=e("../internals/redefine"),e=e("../internals/object-to-string");o||n(Object.prototype,"toString",e,{unsafe:!0})},{"../internals/object-to-string":102,"../internals/redefine":108,"../internals/to-string-tag-support":139}],178:[function(e,D,U){"use strict";var r,t,o,n,s=e("../internals/export"),i=e("../internals/is-pure"),g=e("../internals/global"),a=e("../internals/get-built-in"),l=e("../internals/native-promise-constructor"),N=e("../internals/redefine"),F=e("../internals/redefine-all"),B=e("../internals/set-to-string-tag"),G=e("../internals/set-species"),V=e("../internals/is-object"),c=e("../internals/a-function"),z=e("../internals/an-instance"),H=e("../internals/classof-raw"),W=e("../internals/inspect-source"),d=e("../internals/iterate"),q=e("../internals/check-correctness-of-iteration"),X=e("../internals/species-constructor"),v=e("../internals/task").set,u=e("../internals/microtask"),f=e("../internals/promise-resolve"),Y=e("../internals/host-report-errors"),h=e("../internals/new-promise-capability"),b=e("../internals/perform"),p=e("../internals/internal-state"),Z=e("../internals/is-forced"),m=e("../internals/well-known-symbol"),y=e("../internals/engine-v8-version"),Q=m("species"),j="Promise",_=p.get,J=p.set,K=p.getterFor(j),x=l,w=g.TypeError,S=g.document,M=g.process,E=a("fetch"),T=h.f,$=T,C="process"==H(M),ee=!!(S&&S.createEvent&&g.dispatchEvent),O="unhandledrejection",te="rejectionhandled",k=1,re=2,L=1,oe=2,e=Z(j,function(){var e,t;if(!(W(x)!==String(x))){if(66===y)return!0;if(!C&&"function"!=typeof PromiseRejectionEvent)return!0}return!(!i||x.prototype.finally)||!(51<=y&&/native code/.test(x))&&(t=function(e){e(function(){},function(){})},((e=x.resolve(1)).constructor={})[Q]=t,!(e.then(function(){})instanceof t))}),m=e||!q(function(e){x.all(e).catch(function(){})}),ne=function(e){var t;return!(!V(e)||"function"!=typeof(t=e.then))&&t},P=function(h,p,m){var y;p.notified||(p.notified=!0,y=p.reactions,u(function(){for(var r,o,e=p.value,t=p.state==k,n=0;y.length>n;){var s,i,a,l=y[n++],u=t?l.ok:l.fail,c=l.resolve,d=l.reject,f=l.domain;try{u?(t||(p.rejection===oe&&function(e,t){v.call(g,function(){if(C)M.emit("rejectionHandled",e);else se(te,e,t.value)})}(h,p),p.rejection=L),!0===u?s=e:(f&&f.enter(),s=u(e),f&&(f.exit(),a=!0)),s===l.promise?d(w("Promise-chain cycle")):(i=ne(s))?i.call(s,c,d):c(s)):d(e)}catch(e){f&&!a&&f.exit(),d(e)}}p.reactions=[],p.notified=!1,m&&!p.rejection&&(r=h,o=p,v.call(g,function(){var e=o.value,t=ie(o);if(t&&(t=b(function(){C?M.emit("unhandledRejection",e,r):se(O,r,e)}),o.rejection=C||ie(o)?oe:L,t.error))throw t.value}))}))},se=function(e,t,r){var o;ee?((o=S.createEvent("Event")).promise=t,o.reason=r,o.initEvent(e,!1,!0),g.dispatchEvent(o)):o={promise:t,reason:r},(t=g["on"+e])?t(o):e===O&&Y("Unhandled promise rejection",r)},ie=function(e){return e.rejection!==L&&!e.parent},A=function(t,r,o,n){return function(e){t(r,o,e,n)}},R=function(e,t,r,o){t.done||(t.done=!0,(t=o?o:t).value=r,t.state=re,P(e,t,!0))},I=function(r,o,e,t){if(!o.done){o.done=!0,t&&(o=t);try{if(r===e)throw w("Promise can't be resolved itself");var n=ne(e);n?u(function(){var t={done:!1};try{n.call(e,A(I,r,t,o),A(R,r,t,o))}catch(e){R(r,t,e,o)}}):(o.value=e,o.state=k,P(r,o,!1))}catch(e){R(r,{done:!1},e,o)}}};e&&(x=function(e){z(this,x,j),c(e),r.call(this);var t=_(this);try{e(A(I,this,t),A(R,this,t))}catch(e){R(this,t,e)}},(r=function(e){J(this,{type:j,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=F(x.prototype,{then:function(e,t){var r=K(this),o=T(X(this,x));return o.ok="function"!=typeof e||e,o.fail="function"==typeof t&&t,o.domain=C?M.domain:void 0,r.parent=!0,r.reactions.push(o),0!=r.state&&P(this,r,!1),o.promise},catch:function(e){return this.then(void 0,e)}}),t=function(){var e=new r,t=_(e);this.promise=e,this.resolve=A(I,e,t),this.reject=A(R,e,t)},h.f=T=function(e){return e===x||e===o?new t:$(e)},i||"function"!=typeof l||(n=l.prototype.then,N(l.prototype,"then",function(e,t){var r=this;return new x(function(e,t){n.call(r,e,t)}).then(e,t)},{unsafe:!0}),"function"==typeof E&&s({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return f(x,E.apply(g,arguments))}}))),s({global:!0,wrap:!0,forced:e},{Promise:x}),B(x,j,!1,!0),G(j),o=a(j),s({target:j,stat:!0,forced:e},{reject:function(e){var t=T(this);return t.reject.call(void 0,e),t.promise}}),s({target:j,stat:!0,forced:i||e},{resolve:function(e){return f(i&&this===o?x:this,e)}}),s({target:j,stat:!0,forced:m},{all:function(e){var a=this,t=T(a),l=t.resolve,u=t.reject,r=b(function(){var o=c(a.resolve),n=[],s=0,i=1;d(e,function(e){var t=s++,r=!1;n.push(void 0),i++,o.call(a,e).then(function(e){r||(r=!0,n[t]=e,--i||l(n))},u)}),--i||l(n)});return r.error&&u(r.value),t.promise},race:function(e){var r=this,o=T(r),n=o.reject,t=b(function(){var t=c(r.resolve);d(e,function(e){t.call(r,e).then(o.resolve,n)})});return t.error&&n(t.value),o.promise}})},{"../internals/a-function":5,"../internals/an-instance":9,"../internals/check-correctness-of-iteration":27,"../internals/classof-raw":28,"../internals/engine-v8-version":48,"../internals/export":50,"../internals/get-built-in":56,"../internals/global":59,"../internals/host-report-errors":62,"../internals/inspect-source":68,"../internals/internal-state":70,"../internals/is-forced":73,"../internals/is-object":74,"../internals/is-pure":75,"../internals/iterate":77,"../internals/microtask":81,"../internals/native-promise-constructor":82,"../internals/new-promise-capability":86,"../internals/perform":105,"../internals/promise-resolve":106,"../internals/redefine":108,"../internals/redefine-all":107,"../internals/set-species":116,"../internals/set-to-string-tag":117,"../internals/species-constructor":121,"../internals/task":128,"../internals/well-known-symbol":146}],179:[function(e,t,r){var o=e("../internals/export"),n=e("../internals/get-built-in"),s=e("../internals/a-function"),i=e("../internals/an-object"),a=e("../internals/is-object"),l=e("../internals/object-create"),u=e("../internals/function-bind"),e=e("../internals/fails"),c=n("Reflect","construct"),d=e(function(){function e(){}return!(c(function(){},[],e)instanceof e)}),f=!e(function(){c(function(){})}),n=d||f;o({target:"Reflect",stat:!0,forced:n,sham:n},{construct:function(e,t){s(e),i(t);var r=arguments.length<3?e:s(arguments[2]);if(f&&!d)return c(e,t,r);if(e==r){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var o=[null];return o.push.apply(o,t),new(u.apply(e,o))}o=r.prototype,r=l(a(o)?o:Object.prototype),o=Function.apply.call(e,r,t);return a(o)?o:r}})},{"../internals/a-function":5,"../internals/an-object":10,"../internals/export":50,"../internals/fails":51,"../internals/function-bind":55,"../internals/get-built-in":56,"../internals/is-object":74,"../internals/object-create":90}],180:[function(e,t,r){var o=e("../internals/descriptors"),n=e("../internals/global"),s=e("../internals/is-forced"),i=e("../internals/inherit-if-required"),a=e("../internals/object-define-property").f,l=e("../internals/object-get-own-property-names").f,u=e("../internals/is-regexp"),c=e("../internals/regexp-flags"),d=e("../internals/regexp-sticky-helpers"),f=e("../internals/redefine"),h=e("../internals/fails"),p=e("../internals/internal-state").set,m=e("../internals/set-species"),y=e("../internals/well-known-symbol")("match"),g=n.RegExp,v=g.prototype,b=/a/g,j=/a/g,_=new g(b)!==b,x=d.UNSUPPORTED_Y;if(o&&s("RegExp",!_||x||h(function(){return j[y]=!1,g(b)!=b||g(j)==j||"/a/i"!=g(b,"i")}))){for(var w=function(e,t){var r,o=this instanceof w,n=u(e),s=void 0===t;if(!o&&n&&e.constructor===w&&s)return e;_?n&&!s&&(e=e.source):e instanceof w&&(s&&(t=c.call(e)),e=e.source),x&&(r=!!t&&-1<t.indexOf("y"))&&(t=t.replace(/y/g,""));n=i(_?new g(e,t):g(e,t),o?this:v,w);return x&&r&&p(n,{sticky:r}),n},S=l(g),M=0;S.length>M;)!function(t){t in w||a(w,t,{configurable:!0,get:function(){return g[t]},set:function(e){g[t]=e}})}(S[M++]);(v.constructor=w).prototype=v,f(n,"RegExp",w)}m("RegExp")},{"../internals/descriptors":43,"../internals/fails":51,"../internals/global":59,"../internals/inherit-if-required":67,"../internals/internal-state":70,"../internals/is-forced":73,"../internals/is-regexp":76,"../internals/object-define-property":92,"../internals/object-get-own-property-names":95,"../internals/redefine":108,"../internals/regexp-flags":111,"../internals/regexp-sticky-helpers":112,"../internals/set-species":116,"../internals/well-known-symbol":146}],181:[function(e,t,r){"use strict";var o=e("../internals/export"),e=e("../internals/regexp-exec");o({target:"RegExp",proto:!0,forced:/./.exec!==e},{exec:e})},{"../internals/export":50,"../internals/regexp-exec":110}],182:[function(e,t,r){"use strict";var o=e("../internals/redefine"),n=e("../internals/an-object"),s=e("../internals/fails"),i=e("../internals/regexp-flags"),e="toString",a=RegExp.prototype,l=a[e],s=s(function(){return"/a/b"!=l.call({source:"a",flags:"b"})}),u=l.name!=e;(s||u)&&o(RegExp.prototype,e,function(){var e=n(this),t=String(e.source),r=e.flags;return"/"+t+"/"+String(void 0===r&&e instanceof RegExp&&!("flags"in a)?i.call(e):r)},{unsafe:!0})},{"../internals/an-object":10,"../internals/fails":51,"../internals/redefine":108,"../internals/regexp-flags":111}],183:[function(e,t,r){"use strict";var o=e("../internals/collection"),e=e("../internals/collection-strong");t.exports=o("Set",function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},e)},{"../internals/collection":32,"../internals/collection-strong":30}],184:[function(e,t,r){"use strict";var o=e("../internals/export"),n=e("../internals/object-get-own-property-descriptor").f,s=e("../internals/to-length"),i=e("../internals/not-a-regexp"),a=e("../internals/require-object-coercible"),l=e("../internals/correct-is-regexp-logic"),e=e("../internals/is-pure"),u="".endsWith,c=Math.min,l=l("endsWith");o({target:"String",proto:!0,forced:!!(e||l||(!(o=n(String.prototype,"endsWith"))||o.writable))&&!l},{endsWith:function(e){var t=String(a(this)),r=(i(e),1<arguments.length?arguments[1]:void 0),o=s(t.length),r=void 0===r?o:c(s(r),o),o=String(e);return u?u.call(t,o,r):t.slice(r-o.length,r)===o}})},{"../internals/correct-is-regexp-logic":34,"../internals/export":50,"../internals/is-pure":75,"../internals/not-a-regexp":87,"../internals/object-get-own-property-descriptor":93,"../internals/require-object-coercible":113,"../internals/to-length":134}],185:[function(e,t,r){"use strict";var o=e("../internals/export"),n=e("../internals/not-a-regexp"),s=e("../internals/require-object-coercible");o({target:"String",proto:!0,forced:!e("../internals/correct-is-regexp-logic")("includes")},{includes:function(e){return!!~String(s(this)).indexOf(n(e),1<arguments.length?arguments[1]:void 0)}})},{"../internals/correct-is-regexp-logic":34,"../internals/export":50,"../internals/not-a-regexp":87,"../internals/require-object-coercible":113}],186:[function(e,t,r){"use strict";var o=e("../internals/string-multibyte").charAt,n=e("../internals/internal-state"),e=e("../internals/define-iterator"),s="String Iterator",i=n.set,a=n.getterFor(s);e(String,"String",function(e){i(this,{type:s,string:String(e),index:0})},function(){var e=a(this),t=e.string,r=e.index;return r>=t.length?{value:void 0,done:!0}:(t=o(t,r),e.index+=t.length,{value:t,done:!1})})},{"../internals/define-iterator":41,"../internals/internal-state":70,"../internals/string-multibyte":123}],187:[function(e,t,r){"use strict";var o=e("../internals/fix-regexp-well-known-symbol-logic"),c=e("../internals/an-object"),d=e("../internals/to-length"),n=e("../internals/require-object-coercible"),f=e("../internals/advance-string-index"),h=e("../internals/regexp-exec-abstract");o("match",1,function(o,l,u){return[function(e){var t=n(this),r=null==e?void 0:e[o];return void 0!==r?r.call(e,t):new RegExp(e)[o](String(t))},function(e){var t=u(l,e,this);if(t.done)return t.value;var r=c(e),o=String(this);if(!r.global)return h(r,o);for(var n=r.unicode,s=[],i=r.lastIndex=0;null!==(a=h(r,o));){var a=String(a[0]);""===(s[i]=a)&&(r.lastIndex=f(o,d(r.lastIndex),n)),i++}return 0===i?null:s}]})},{"../internals/advance-string-index":8,"../internals/an-object":10,"../internals/fix-regexp-well-known-symbol-logic":52,"../internals/regexp-exec-abstract":109,"../internals/require-object-coercible":113,"../internals/to-length":134}],188:[function(e,t,r){e("../internals/export")({target:"String",proto:!0},{repeat:e("../internals/string-repeat")})},{"../internals/export":50,"../internals/string-repeat":125}],189:[function(e,t,r){"use strict";var o=e("../internals/fix-regexp-well-known-symbol-logic"),M=e("../internals/an-object"),E=e("../internals/to-object"),T=e("../internals/to-length"),C=e("../internals/to-integer"),s=e("../internals/require-object-coercible"),O=e("../internals/advance-string-index"),k=e("../internals/regexp-exec-abstract"),L=Math.max,P=Math.min,A=Math.floor,R=/\$([$&'`]|\d\d?|<[^>]*>)/g,I=/\$([$&'`]|\d\d?)/g;o("replace",2,function(n,j,_,e){var x=e.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,w=e.REPLACE_KEEPS_$0,S=x?"$":"$0";return[function(e,t){var r=s(this),o=null==e?void 0:e[n];return void 0!==o?o.call(e,r,t):j.call(String(r),e,t)},function(e,t){if(!x&&w||"string"==typeof t&&-1===t.indexOf(S)){var r=_(j,e,this,t);if(r.done)return r.value}for(var o,n=M(e),s=String(this),i="function"==typeof t,a=(i||(t=String(t)),n.global),l=(a&&(o=n.unicode,n.lastIndex=0),[]);null!==(h=k(n,s))&&(l.push(h),a);)""===String(h[0])&&(n.lastIndex=O(s,T(n.lastIndex),o));for(var u,c="",d=0,f=0;f<l.length;f++){for(var h=l[f],p=String(h[0]),m=L(P(C(h.index),s.length),0),y=[],g=1;g<h.length;g++)y.push(void 0===(u=h[g])?u:String(u));var v=h.groups,b=i?(b=[p].concat(y,m,s),void 0!==v&&b.push(v),String(t.apply(void 0,b))):function(s,i,a,l,u,e){var c=a+s.length,d=l.length,t=I;void 0!==u&&(u=E(u),t=R);return j.call(e,t,function(e,t){var r;switch(t.charAt(0)){case"$":return"$";case"&":return s;case"`":return i.slice(0,a);case"'":return i.slice(c);case"<":r=u[t.slice(1,-1)];break;default:var o,n=+t;if(0==n)return e;if(d<n)return 0!==(o=A(n/10))&&o<=d?void 0===l[o-1]?t.charAt(1):l[o-1]+t.charAt(1):e;r=l[n-1]}return void 0===r?"":r})}(p,s,m,y,v,t);d<=m&&(c+=s.slice(d,m)+b,d=m+p.length)}return c+s.slice(d)}]})},{"../internals/advance-string-index":8,"../internals/an-object":10,"../internals/fix-regexp-well-known-symbol-logic":52,"../internals/regexp-exec-abstract":109,"../internals/require-object-coercible":113,"../internals/to-integer":133,"../internals/to-length":134,"../internals/to-object":135}],190:[function(e,t,r){"use strict";var o=e("../internals/fix-regexp-well-known-symbol-logic"),i=e("../internals/an-object"),a=e("../internals/require-object-coercible"),l=e("../internals/same-value"),u=e("../internals/regexp-exec-abstract");o("search",1,function(o,n,s){return[function(e){var t=a(this),r=null==e?void 0:e[o];return void 0!==r?r.call(e,t):new RegExp(e)[o](String(t))},function(e){var t,r=s(n,e,this);return r.done?r.value:(r=i(e),e=String(this),t=r.lastIndex,l(t,0)||(r.lastIndex=0),e=u(r,e),l(r.lastIndex,t)||(r.lastIndex=t),null===e?-1:e.index)}]})},{"../internals/an-object":10,"../internals/fix-regexp-well-known-symbol-logic":52,"../internals/regexp-exec-abstract":109,"../internals/require-object-coercible":113,"../internals/same-value":114}],191:[function(e,t,r){"use strict";var o=e("../internals/fix-regexp-well-known-symbol-logic"),c=e("../internals/is-regexp"),g=e("../internals/an-object"),d=e("../internals/require-object-coercible"),v=e("../internals/species-constructor"),b=e("../internals/advance-string-index"),j=e("../internals/to-length"),_=e("../internals/regexp-exec-abstract"),f=e("../internals/regexp-exec"),e=e("../internals/fails"),h=[].push,x=Math.min,w=4294967295,S=!e(function(){return!RegExp(w,"y")});o("split",2,function(n,p,m){var y="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||1<".".split(/()()/).length||"".split(/.?/).length?function(e,t){var r=String(d(this)),o=void 0===t?w:t>>>0;if(0==o)return[];if(void 0===e)return[r];if(!c(e))return p.call(r,e,o);for(var n,s,i,a=[],t=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),l=0,u=new RegExp(e.source,t+"g");(n=f.call(u,r))&&!(l<(s=u.lastIndex)&&(a.push(r.slice(l,n.index)),1<n.length&&n.index<r.length&&h.apply(a,n.slice(1)),i=n[0].length,l=s,a.length>=o));)u.lastIndex===n.index&&u.lastIndex++;return l===r.length?!i&&u.test("")||a.push(""):a.push(r.slice(l)),a.length>o?a.slice(0,o):a}:"0".split(void 0,0).length?function(e,t){return void 0===e&&0===t?[]:p.call(this,e,t)}:p;return[function(e,t){var r=d(this),o=null==e?void 0:e[n];return void 0!==o?o.call(e,r,t):y.call(String(r),e,t)},function(e,t){var r=m(y,e,this,t,y!==p);if(r.done)return r.value;var r=g(e),o=String(this),e=v(r,RegExp),n=r.unicode,s=(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.unicode?"u":"")+(S?"y":"g"),i=new e(S?r:"^(?:"+r.source+")",s),a=void 0===t?w:t>>>0;if(0==a)return[];if(0===o.length)return null===_(i,o)?[o]:[];for(var l=0,u=0,c=[];u<o.length;){i.lastIndex=S?u:0;var d,f=_(i,S?o:o.slice(u));if(null===f||(d=x(j(i.lastIndex+(S?0:u)),o.length))===l)u=b(o,u,n);else{if(c.push(o.slice(l,u)),c.length===a)return c;for(var h=1;h<=f.length-1;h++)if(c.push(f[h]),c.length===a)return c;u=l=d}}return c.push(o.slice(l)),c}]},!S)},{"../internals/advance-string-index":8,"../internals/an-object":10,"../internals/fails":51,"../internals/fix-regexp-well-known-symbol-logic":52,"../internals/is-regexp":76,"../internals/regexp-exec":110,"../internals/regexp-exec-abstract":109,"../internals/require-object-coercible":113,"../internals/species-constructor":121,"../internals/to-length":134}],192:[function(e,t,r){"use strict";var o=e("../internals/export"),n=e("../internals/create-html");o({target:"String",proto:!0,forced:e("../internals/string-html-forced")("sub")},{sub:function(){return n(this,"sub","","")}})},{"../internals/create-html":36,"../internals/export":50,"../internals/string-html-forced":122}],193:[function(e,t,r){"use strict";var o=e("../internals/export"),n=e("../internals/string-trim").trim;o({target:"String",proto:!0,forced:e("../internals/string-trim-forced")("trim")},{trim:function(){return n(this)}})},{"../internals/export":50,"../internals/string-trim":127,"../internals/string-trim-forced":126}],194:[function(e,t,r){"use strict";var o,n,s,i,a,l=e("../internals/export"),u=e("../internals/descriptors"),c=e("../internals/global"),d=e("../internals/has"),f=e("../internals/is-object"),h=e("../internals/object-define-property").f,e=e("../internals/copy-constructor-properties"),p=c.Symbol;!u||"function"!=typeof p||"description"in p.prototype&&void 0===p().description||(o={},e(n=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),t=this instanceof n?new p(e):void 0===e?p():p(e);return""===e&&(o[t]=!0),t},p),(c=n.prototype=p.prototype).constructor=n,s=c.toString,i="Symbol(test)"==String(p("test")),a=/^Symbol\((.*)\)[^)]+$/,h(c,"description",{configurable:!0,get:function(){var e=f(this)?this.valueOf():this,t=s.call(e);return d(o,e)?"":""===(e=i?t.slice(7,-1):t.replace(a,"$1"))?void 0:e}}),l({global:!0,forced:!0},{Symbol:n}))},{"../internals/copy-constructor-properties":33,"../internals/descriptors":43,"../internals/export":50,"../internals/global":59,"../internals/has":60,"../internals/is-object":74,"../internals/object-define-property":92}],195:[function(e,t,r){e("../internals/define-well-known-symbol")("iterator")},{"../internals/define-well-known-symbol":42}],196:[function(e,D,U){"use strict";function o(e,t){var r=E[e]=h(w[_]);return ie(r,{type:j,tag:e,description:t}),s||(r.description=t),r}function r(t,e){u(t);var r=c(e),e=q(r).concat(I(r));return v(e,function(e){s&&!R.call(r,e)||A(t,e,r[e])}),t}function t(e,t){var r,e=c(e),t=d(t,!0);if(e!==x||!l(E,t)||l(T,t))return!(r=le(e,t))||!l(E,t)||l(e,b)&&e[b][t]||(r.enumerable=!0),r}function N(e){var e=ue(c(e)),t=[];return v(e,function(e){l(E,e)||l(ee,e)||t.push(e)}),t}var n=e("../internals/export"),F=e("../internals/global"),B=e("../internals/get-built-in"),G=e("../internals/is-pure"),s=e("../internals/descriptors"),i=e("../internals/native-symbol"),V=e("../internals/use-symbol-as-uid"),a=e("../internals/fails"),l=e("../internals/has"),z=e("../internals/is-array"),H=e("../internals/is-object"),u=e("../internals/an-object"),W=e("../internals/to-object"),c=e("../internals/to-indexed-object"),d=e("../internals/to-primitive"),f=e("../internals/create-property-descriptor"),h=e("../internals/object-create"),q=e("../internals/object-keys"),X=e("../internals/object-get-own-property-names"),Y=e("../internals/object-get-own-property-names-external"),p=e("../internals/object-get-own-property-symbols"),Z=e("../internals/object-get-own-property-descriptor"),Q=e("../internals/object-define-property"),J=e("../internals/object-property-is-enumerable"),K=e("../internals/create-non-enumerable-property"),m=e("../internals/redefine"),y=e("../internals/shared"),$=e("../internals/shared-key"),ee=e("../internals/hidden-keys"),te=e("../internals/uid"),re=e("../internals/well-known-symbol"),oe=e("../internals/well-known-symbol-wrapped"),ne=e("../internals/define-well-known-symbol"),se=e("../internals/set-to-string-tag"),g=e("../internals/internal-state"),v=e("../internals/array-iteration").forEach,b=$("hidden"),j="Symbol",_="prototype",e=re("toPrimitive"),ie=g.set,ae=g.getterFor(j),x=Object[_],w=F.Symbol,S=B("JSON","stringify"),le=Z.f,M=Q.f,ue=Y.f,ce=J.f,E=y("symbols"),T=y("op-symbols"),C=y("string-to-symbol-registry"),O=y("symbol-to-string-registry"),$=y("wks"),g=F.QObject,k=!g||!g[_]||!g[_].findChild,L=s&&a(function(){return 7!=h(M({},"a",{get:function(){return M(this,"a",{value:7}).a}})).a})?function(e,t,r){var o=le(x,t);o&&delete x[t],M(e,t,r),o&&e!==x&&M(x,t,o)}:M,P=V?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof w},A=function(e,t,r){e===x&&A(T,t,r),u(e);t=d(t,!0);return u(r),(l(E,t)?(r.enumerable?(l(e,b)&&e[b][t]&&(e[b][t]=!1),r=h(r,{enumerable:f(0,!1)})):(l(e,b)||M(e,b,f(1,{})),e[b][t]=!0),L):M)(e,t,r)},R=function(e){var e=d(e,!0),t=ce.call(this,e);return!(this===x&&l(E,e)&&!l(T,e))&&(!(t||!l(this,e)||!l(E,e)||l(this,b)&&this[b][e])||t)},I=function(e){var t=e===x,e=ue(t?T:c(e)),r=[];return v(e,function(e){!l(E,e)||t&&!l(x,e)||r.push(E[e])}),r};i||(m((w=function(){if(this instanceof w)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,t=te(e),r=function(e){this===x&&r.call(T,e),l(this,b)&&l(this[b],t)&&(this[b][t]=!1),L(this,t,f(1,e))};return s&&k&&L(x,t,{configurable:!0,set:r}),o(t,e)})[_],"toString",function(){return ae(this).tag}),m(w,"withoutSetter",function(e){return o(te(e),e)}),J.f=R,Q.f=A,Z.f=t,X.f=Y.f=N,p.f=I,oe.f=function(e){return o(re(e),e)},s&&(M(w[_],"description",{configurable:!0,get:function(){return ae(this).description}}),G||m(x,"propertyIsEnumerable",R,{unsafe:!0}))),n({global:!0,wrap:!0,forced:!i,sham:!i},{Symbol:w}),v(q($),function(e){ne(e)}),n({target:j,stat:!0,forced:!i},{for:function(e){var t,e=String(e);return l(C,e)?C[e]:(t=w(e),C[e]=t,O[t]=e,t)},keyFor:function(e){if(!P(e))throw TypeError(e+" is not a symbol");if(l(O,e))return O[e]},useSetter:function(){k=!0},useSimple:function(){k=!1}}),n({target:"Object",stat:!0,forced:!i,sham:!s},{create:function(e,t){return void 0===t?h(e):r(h(e),t)},defineProperty:A,defineProperties:r,getOwnPropertyDescriptor:t}),n({target:"Object",stat:!0,forced:!i},{getOwnPropertyNames:N,getOwnPropertySymbols:I}),n({target:"Object",stat:!0,forced:a(function(){p.f(1)})},{getOwnPropertySymbols:function(e){return p.f(W(e))}}),S&&n({target:"JSON",stat:!0,forced:!i||a(function(){var e=w();return"[null]"!=S([e])||"{}"!=S({a:e})||"{}"!=S(Object(e))})},{stringify:function(e,t,r){for(var o,n=[e],s=1;s<arguments.length;)n.push(arguments[s++]);if((H(o=t)||void 0!==e)&&!P(e))return z(t)||(t=function(e,t){if("function"==typeof o&&(t=o.call(this,e,t)),!P(t))return t}),n[1]=t,S.apply(null,n)}}),w[_][e]||K(w[_],e,w[_].valueOf),se(w,j),ee[b]=!0},{"../internals/an-object":10,"../internals/array-iteration":19,"../internals/create-non-enumerable-property":38,"../internals/create-property-descriptor":39,"../internals/define-well-known-symbol":42,"../internals/descriptors":43,"../internals/export":50,"../internals/fails":51,"../internals/get-built-in":56,"../internals/global":59,"../internals/has":60,"../internals/hidden-keys":61,"../internals/internal-state":70,"../internals/is-array":72,"../internals/is-object":74,"../internals/is-pure":75,"../internals/native-symbol":83,"../internals/object-create":90,"../internals/object-define-property":92,"../internals/object-get-own-property-descriptor":93,"../internals/object-get-own-property-names":95,"../internals/object-get-own-property-names-external":94,"../internals/object-get-own-property-symbols":96,"../internals/object-keys":99,"../internals/object-property-is-enumerable":100,"../internals/redefine":108,"../internals/set-to-string-tag":117,"../internals/shared":120,"../internals/shared-key":118,"../internals/to-indexed-object":132,"../internals/to-object":135,"../internals/to-primitive":138,"../internals/uid":143,"../internals/use-symbol-as-uid":144,"../internals/well-known-symbol":146,"../internals/well-known-symbol-wrapped":145}],197:[function(e,t,r){"use strict";var o=e("../internals/array-buffer-view-core"),n=e("../internals/array-copy-within"),s=o.aTypedArray;(0,o.exportTypedArrayMethod)("copyWithin",function(e,t){return n.call(s(this),e,t,2<arguments.length?arguments[2]:void 0)})},{"../internals/array-buffer-view-core":12,"../internals/array-copy-within":14}],198:[function(e,t,r){"use strict";var o=e("../internals/array-buffer-view-core"),n=e("../internals/array-iteration").every,s=o.aTypedArray;(0,o.exportTypedArrayMethod)("every",function(e){return n(s(this),e,1<arguments.length?arguments[1]:void 0)})},{"../internals/array-buffer-view-core":12,"../internals/array-iteration":19}],199:[function(e,t,r){"use strict";var o=e("../internals/array-buffer-view-core"),n=e("../internals/array-fill"),s=o.aTypedArray;(0,o.exportTypedArrayMethod)("fill",function(e){return n.apply(s(this),arguments)})},{"../internals/array-buffer-view-core":12,"../internals/array-fill":15}],200:[function(e,t,r){"use strict";var o=e("../internals/array-buffer-view-core"),s=e("../internals/array-iteration").filter,i=e("../internals/species-constructor"),a=o.aTypedArray,l=o.aTypedArrayConstructor;(0,o.exportTypedArrayMethod)("filter",function(e){for(var t=s(a(this),e,1<arguments.length?arguments[1]:void 0),e=i(this,this.constructor),r=0,o=t.length,n=new(l(e))(o);r<o;)n[r]=t[r++];return n})},{"../internals/array-buffer-view-core":12,"../internals/array-iteration":19,"../internals/species-constructor":121}],201:[function(e,t,r){"use strict";var o=e("../internals/array-buffer-view-core"),n=e("../internals/array-iteration").findIndex,s=o.aTypedArray;(0,o.exportTypedArrayMethod)("findIndex",function(e){return n(s(this),e,1<arguments.length?arguments[1]:void 0)})},{"../internals/array-buffer-view-core":12,"../internals/array-iteration":19}],202:[function(e,t,r){"use strict";var o=e("../internals/array-buffer-view-core"),n=e("../internals/array-iteration").find,s=o.aTypedArray;(0,o.exportTypedArrayMethod)("find",function(e){return n(s(this),e,1<arguments.length?arguments[1]:void 0)})},{"../internals/array-buffer-view-core":12,"../internals/array-iteration":19}],203:[function(e,t,r){e("../internals/typed-array-constructor")("Float32",function(o){return function(e,t,r){return o(this,e,t,r)}})},{"../internals/typed-array-constructor":140}],204:[function(e,t,r){e("../internals/typed-array-constructor")("Float64",function(o){return function(e,t,r){return o(this,e,t,r)}})},{"../internals/typed-array-constructor":140}],205:[function(e,t,r){"use strict";var o=e("../internals/array-buffer-view-core"),n=e("../internals/array-iteration").forEach,s=o.aTypedArray;(0,o.exportTypedArrayMethod)("forEach",function(e){n(s(this),e,1<arguments.length?arguments[1]:void 0)})},{"../internals/array-buffer-view-core":12,"../internals/array-iteration":19}],206:[function(e,t,r){"use strict";var o=e("../internals/array-buffer-view-core"),n=e("../internals/array-includes").includes,s=o.aTypedArray;(0,o.exportTypedArrayMethod)("includes",function(e){return n(s(this),e,1<arguments.length?arguments[1]:void 0)})},{"../internals/array-buffer-view-core":12,"../internals/array-includes":18}],207:[function(e,t,r){"use strict";var o=e("../internals/array-buffer-view-core"),n=e("../internals/array-includes").indexOf,s=o.aTypedArray;(0,o.exportTypedArrayMethod)("indexOf",function(e){return n(s(this),e,1<arguments.length?arguments[1]:void 0)})},{"../internals/array-buffer-view-core":12,"../internals/array-includes":18}],208:[function(e,t,r){e("../internals/typed-array-constructor")("Int16",function(o){return function(e,t,r){return o(this,e,t,r)}})},{"../internals/typed-array-constructor":140}],209:[function(e,t,r){e("../internals/typed-array-constructor")("Int32",function(o){return function(e,t,r){return o(this,e,t,r)}})},{"../internals/typed-array-constructor":140}],210:[function(e,t,r){"use strict";function o(){return a.call(c(this))}var n=e("../internals/global"),s=e("../internals/array-buffer-view-core"),i=e("../modules/es.array.iterator"),e=e("../internals/well-known-symbol")("iterator"),n=n.Uint8Array,a=i.values,l=i.keys,u=i.entries,c=s.aTypedArray,i=s.exportTypedArrayMethod,s=n&&n.prototype[e],n=!!s&&("values"==s.name||null==s.name);i("entries",function(){return u.call(c(this))}),i("keys",function(){return l.call(c(this))}),i("values",o,!n),i(e,o,!n)},{"../internals/array-buffer-view-core":12,"../internals/global":59,"../internals/well-known-symbol":146,"../modules/es.array.iterator":158}],211:[function(e,t,r){"use strict";var e=e("../internals/array-buffer-view-core"),o=e.aTypedArray,e=e.exportTypedArrayMethod,n=[].join;e("join",function(e){return n.apply(o(this),arguments)})},{"../internals/array-buffer-view-core":12}],212:[function(e,t,r){"use strict";var o=e("../internals/array-buffer-view-core"),n=e("../internals/array-last-index-of"),s=o.aTypedArray;(0,o.exportTypedArrayMethod)("lastIndexOf",function(e){return n.apply(s(this),arguments)})},{"../internals/array-buffer-view-core":12,"../internals/array-last-index-of":20}],213:[function(e,t,r){"use strict";var o=e("../internals/array-buffer-view-core"),n=e("../internals/array-iteration").map,s=e("../internals/species-constructor"),i=o.aTypedArray,a=o.aTypedArrayConstructor;(0,o.exportTypedArrayMethod)("map",function(e){return n(i(this),e,1<arguments.length?arguments[1]:void 0,function(e,t){return new(a(s(e,e.constructor)))(t)})})},{"../internals/array-buffer-view-core":12,"../internals/array-iteration":19,"../internals/species-constructor":121}],214:[function(e,t,r){"use strict";var o=e("../internals/array-buffer-view-core"),n=e("../internals/array-reduce").right,s=o.aTypedArray;(0,o.exportTypedArrayMethod)("reduceRight",function(e){return n(s(this),e,arguments.length,1<arguments.length?arguments[1]:void 0)})},{"../internals/array-buffer-view-core":12,"../internals/array-reduce":24}],215:[function(e,t,r){"use strict";var o=e("../internals/array-buffer-view-core"),n=e("../internals/array-reduce").left,s=o.aTypedArray;(0,o.exportTypedArrayMethod)("reduce",function(e){return n(s(this),e,arguments.length,1<arguments.length?arguments[1]:void 0)})},{"../internals/array-buffer-view-core":12,"../internals/array-reduce":24}],216:[function(e,t,r){"use strict";var e=e("../internals/array-buffer-view-core"),n=e.aTypedArray,e=e.exportTypedArrayMethod,s=Math.floor;e("reverse",function(){for(var e,t=n(this).length,r=s(t/2),o=0;o<r;)e=this[o],this[o++]=this[--t],this[t]=e;return this})},{"../internals/array-buffer-view-core":12}],217:[function(e,t,r){"use strict";var o=e("../internals/array-buffer-view-core"),i=e("../internals/to-length"),a=e("../internals/to-offset"),l=e("../internals/to-object"),e=e("../internals/fails"),u=o.aTypedArray;(0,o.exportTypedArrayMethod)("set",function(e){u(this);var t=a(1<arguments.length?arguments[1]:void 0,1),r=this.length,o=l(e),n=i(o.length),s=0;if(r<n+t)throw RangeError("Wrong length");for(;s<n;)this[t+s]=o[s++]},e(function(){new Int8Array(1).set({})}))},{"../internals/array-buffer-view-core":12,"../internals/fails":51,"../internals/to-length":134,"../internals/to-object":135,"../internals/to-offset":136}],218:[function(e,t,r){"use strict";var o=e("../internals/array-buffer-view-core"),i=e("../internals/species-constructor"),e=e("../internals/fails"),a=o.aTypedArray,l=o.aTypedArrayConstructor,o=o.exportTypedArrayMethod,u=[].slice;o("slice",function(e,t){for(var r=u.call(a(this),e,t),e=i(this,this.constructor),o=0,n=r.length,s=new(l(e))(n);o<n;)s[o]=r[o++];return s},e(function(){new Int8Array(1).slice()}))},{"../internals/array-buffer-view-core":12,"../internals/fails":51,"../internals/species-constructor":121}],219:[function(e,t,r){"use strict";var o=e("../internals/array-buffer-view-core"),n=e("../internals/array-iteration").some,s=o.aTypedArray;(0,o.exportTypedArrayMethod)("some",function(e){return n(s(this),e,1<arguments.length?arguments[1]:void 0)})},{"../internals/array-buffer-view-core":12,"../internals/array-iteration":19}],220:[function(e,t,r){"use strict";var e=e("../internals/array-buffer-view-core"),o=e.aTypedArray,e=e.exportTypedArrayMethod,n=[].sort;e("sort",function(e){return n.call(o(this),e)})},{"../internals/array-buffer-view-core":12}],221:[function(e,t,r){"use strict";var o=e("../internals/array-buffer-view-core"),n=e("../internals/to-length"),s=e("../internals/to-absolute-index"),i=e("../internals/species-constructor"),a=o.aTypedArray;(0,o.exportTypedArrayMethod)("subarray",function(e,t){var r=a(this),o=r.length,e=s(e,o);return new(i(r,r.constructor))(r.buffer,r.byteOffset+e*r.BYTES_PER_ELEMENT,n((void 0===t?o:s(t,o))-e))})},{"../internals/array-buffer-view-core":12,"../internals/species-constructor":121,"../internals/to-absolute-index":130,"../internals/to-length":134}],222:[function(e,t,r){"use strict";var o=e("../internals/global"),n=e("../internals/array-buffer-view-core"),e=e("../internals/fails"),s=o.Int8Array,i=n.aTypedArray,o=n.exportTypedArrayMethod,a=[].toLocaleString,l=[].slice,u=!!s&&e(function(){a.call(new s(1))});o("toLocaleString",function(){return a.apply(u?l.call(i(this)):i(this),arguments)},e(function(){return[1,2].toLocaleString()!=new s([1,2]).toLocaleString()})||!e(function(){s.prototype.toLocaleString.call([1,2])}))},{"../internals/array-buffer-view-core":12,"../internals/fails":51,"../internals/global":59}],223:[function(e,t,r){"use strict";var o=e("../internals/array-buffer-view-core").exportTypedArrayMethod,n=e("../internals/fails"),e=e("../internals/global").Uint8Array,e=e&&e.prototype||{},s=[].toString,i=[].join,n=(n(function(){s.call({})})&&(s=function(){return i.call(this)}),e.toString!=s);o("toString",s,n)},{"../internals/array-buffer-view-core":12,"../internals/fails":51,"../internals/global":59}],224:[function(e,t,r){e("../internals/typed-array-constructor")("Uint16",function(o){return function(e,t,r){return o(this,e,t,r)}})},{"../internals/typed-array-constructor":140}],225:[function(e,t,r){e("../internals/typed-array-constructor")("Uint32",function(o){return function(e,t,r){return o(this,e,t,r)}})},{"../internals/typed-array-constructor":140}],226:[function(e,t,r){e("../internals/typed-array-constructor")("Uint8",function(o){return function(e,t,r){return o(this,e,t,r)}})},{"../internals/typed-array-constructor":140}],227:[function(e,t,r){e("../internals/typed-array-constructor")("Uint8",function(o){return function(e,t,r){return o(this,e,t,r)}},!0)},{"../internals/typed-array-constructor":140}],228:[function(e,t,r){"use strict";function o(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}var n,s,i,a,l,u=e("../internals/global"),c=e("../internals/redefine-all"),d=e("../internals/internal-metadata"),f=e("../internals/collection"),h=e("../internals/collection-weak"),p=e("../internals/is-object"),m=e("../internals/internal-state").enforce,e=e("../internals/native-weak-map"),u=!u.ActiveXObject&&"ActiveXObject"in u,y=Object.isExtensible,t=t.exports=f("WeakMap",o,h);e&&u&&(n=h.getConstructor(o,"WeakMap",!0),d.REQUIRED=!0,f=t.prototype,s=f.delete,i=f.has,a=f.get,l=f.set,c(f,{delete:function(e){var t;return p(e)&&!y(e)?((t=m(this)).frozen||(t.frozen=new n),s.call(this,e)||t.frozen.delete(e)):s.call(this,e)},has:function(e){var t;return p(e)&&!y(e)?((t=m(this)).frozen||(t.frozen=new n),i.call(this,e)||t.frozen.has(e)):i.call(this,e)},get:function(e){var t;return!p(e)||y(e)||((t=m(this)).frozen||(t.frozen=new n),i.call(this,e))?a.call(this,e):t.frozen.get(e)},set:function(e,t){var r;return!p(e)||y(e)||((r=m(this)).frozen||(r.frozen=new n),i.call(this,e))?l.call(this,e,t):r.frozen.set(e,t),this}}))},{"../internals/collection":32,"../internals/collection-weak":31,"../internals/global":59,"../internals/internal-metadata":69,"../internals/internal-state":70,"../internals/is-object":74,"../internals/native-weak-map":85,"../internals/redefine-all":107}],229:[function(e,t,r){var o,n=e("../internals/global"),s=e("../internals/dom-iterables"),i=e("../internals/array-for-each"),a=e("../internals/create-non-enumerable-property");for(o in s){var l=n[o],l=l&&l.prototype;if(l&&l.forEach!==i)try{a(l,"forEach",i)}catch(e){l.forEach=i}}},{"../internals/array-for-each":16,"../internals/create-non-enumerable-property":38,"../internals/dom-iterables":45,"../internals/global":59}],230:[function(e,t,r){var o,n=e("../internals/global"),s=e("../internals/dom-iterables"),i=e("../modules/es.array.iterator"),a=e("../internals/create-non-enumerable-property"),e=e("../internals/well-known-symbol"),l=e("iterator"),u=e("toStringTag"),c=i.values;for(o in s){var d=n[o],f=d&&d.prototype;if(f){if(f[l]!==c)try{a(f,l,c)}catch(e){f[l]=c}if(f[u]||a(f,u,o),s[o])for(var h in i)if(f[h]!==i[h])try{a(f,h,i[h])}catch(e){f[h]=i[h]}}}},{"../internals/create-non-enumerable-property":38,"../internals/dom-iterables":45,"../internals/global":59,"../internals/well-known-symbol":146,"../modules/es.array.iterator":158}],231:[function(e,t,D){"use strict";e("../modules/es.array.iterator");function n(t){try{return decodeURIComponent(t)}catch(e){return t}}function r(e){return B[e]}function s(e){return encodeURIComponent(e).replace(F,r)}function c(e){this.entries.length=0,R(this.entries,e)}function u(e,t){if(e<t)throw TypeError("Not enough arguments")}function d(){y(this,d,C);var e,t,r,o,n,s,i,a,l=0<arguments.length?arguments[0]:void 0,u=[];if(k(this,{type:C,entries:u,updateURL:function(){},updateSearchParams:c}),void 0!==l)if(_(l))if("function"==typeof(e=M(l)))for(r=(t=e.call(l)).next;!(o=r.call(t)).done;){if((s=(n=(o=S(j(o.value))).next).call(o)).done||(i=n.call(o)).done||!n.call(o).done)throw TypeError("Expected sequence with length 2");u.push({key:s.value+"",value:i.value+""})}else for(a in l)g(l,a)&&u.push({key:a,value:l[a]+""});else R(u,"string"==typeof l?"?"===l.charAt(0)?l.slice(1):l:l+"")}var o=e("../internals/export"),i=e("../internals/get-built-in"),a=e("../internals/native-url"),l=e("../internals/redefine"),f=e("../internals/redefine-all"),h=e("../internals/set-to-string-tag"),p=e("../internals/create-iterator-constructor"),m=e("../internals/internal-state"),y=e("../internals/an-instance"),g=e("../internals/has"),v=e("../internals/function-bind-context"),b=e("../internals/classof"),j=e("../internals/an-object"),_=e("../internals/is-object"),x=e("../internals/object-create"),w=e("../internals/create-property-descriptor"),S=e("../internals/get-iterator"),M=e("../internals/get-iterator-method"),e=e("../internals/well-known-symbol"),E=i("fetch"),T=i("Headers"),i=e("iterator"),C="URLSearchParams",O=C+"Iterator",k=m.set,L=m.getterFor(C),U=m.getterFor(O),N=/\+/g,P=Array(4),A=function(e){var t,r=e.replace(N," "),o=4;try{return decodeURIComponent(r)}catch(e){for(;o;)r=r.replace((t=o--,P[t-1]||(P[t-1]=RegExp("((?:%[\\da-f]{2}){"+t+"})","gi"))),n);return r}},F=/[!'()~]|%20/g,B={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},R=function(e,t){if(t)for(var r,o=t.split("&"),n=0;n<o.length;)(r=o[n++]).length&&(r=r.split("="),e.push({key:A(r.shift()),value:A(r.join("="))}))},I=p(function(e,t){k(this,{type:O,iterator:S(L(e).entries),kind:t})},"Iterator",function(){var e=U(this),t=e.kind,e=e.iterator.next(),r=e.value;return e.done||(e.value="keys"===t?r.key:"values"===t?r.value:[r.key,r.value]),e}),e=d.prototype;f(e,{append:function(e,t){u(arguments.length,2);var r=L(this);r.entries.push({key:e+"",value:t+""}),r.updateURL()},delete:function(e){u(arguments.length,1);for(var t=L(this),r=t.entries,o=e+"",n=0;n<r.length;)r[n].key===o?r.splice(n,1):n++;t.updateURL()},get:function(e){u(arguments.length,1);for(var t=L(this).entries,r=e+"",o=0;o<t.length;o++)if(t[o].key===r)return t[o].value;return null},getAll:function(e){u(arguments.length,1);for(var t=L(this).entries,r=e+"",o=[],n=0;n<t.length;n++)t[n].key===r&&o.push(t[n].value);return o},has:function(e){u(arguments.length,1);for(var t=L(this).entries,r=e+"",o=0;o<t.length;)if(t[o++].key===r)return!0;return!1},set:function(e,t){u(arguments.length,1);for(var r,o=L(this),n=o.entries,s=!1,i=e+"",a=t+"",l=0;l<n.length;l++)(r=n[l]).key===i&&(s?n.splice(l--,1):(s=!0,r.value=a));s||n.push({key:i,value:a}),o.updateURL()},sort:function(){for(var e,t,r=L(this),o=r.entries,n=o.slice(),s=o.length=0;s<n.length;s++){for(e=n[s],t=0;t<s;t++)if(o[t].key>e.key){o.splice(t,0,e);break}t===s&&o.push(e)}r.updateURL()},forEach:function(e){for(var t,r=L(this).entries,o=v(e,1<arguments.length?arguments[1]:void 0,3),n=0;n<r.length;)o((t=r[n++]).value,t.key,this)},keys:function(){return new I(this,"keys")},values:function(){return new I(this,"values")},entries:function(){return new I(this,"entries")}},{enumerable:!0}),l(e,i,e.entries),l(e,"toString",function(){for(var e,t=L(this).entries,r=[],o=0;o<t.length;)e=t[o++],r.push(s(e.key)+"="+s(e.value));return r.join("&")},{enumerable:!0}),h(d,C),o({global:!0,forced:!a},{URLSearchParams:d}),a||"function"!=typeof E||"function"!=typeof T||o({global:!0,enumerable:!0,forced:!0},{fetch:function(e){var t,r,o,e=[e];return 1<arguments.length&&(_(t=arguments[1])&&(r=t.body,b(r)===C&&((o=t.headers?new T(t.headers):new T).has("content-type")||o.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),t=x(t,{body:w(0,String(r)),headers:w(0,o)}))),e.push(t)),E.apply(this,e)}}),t.exports={URLSearchParams:d,getState:L}},{"../internals/an-instance":9,"../internals/an-object":10,"../internals/classof":29,"../internals/create-iterator-constructor":37,"../internals/create-property-descriptor":39,"../internals/export":50,"../internals/function-bind-context":54,"../internals/get-built-in":56,"../internals/get-iterator":58,"../internals/get-iterator-method":57,"../internals/has":60,"../internals/internal-state":70,"../internals/is-object":74,"../internals/native-url":84,"../internals/object-create":90,"../internals/redefine":108,"../internals/redefine-all":107,"../internals/set-to-string-tag":117,"../internals/well-known-symbol":146,"../modules/es.array.iterator":158}],232:[function(e,y,U){"use strict";e("../modules/es.string.iterator");function c(e){var t,r,o,n;if("number"==typeof e){for(t=[],r=0;r<4;r++)t.unshift(e%256),e=Y(e/256);return t.join(".")}if("object"!=typeof e)return e;for(t="",o=le(e),r=0;r<8;r++)n&&0===e[r]||(n=n&&!1,o===r?(t+=r?":":"::",n=!0):(t+=e[r].toString(16),r<7&&(t+=":")));return"["+t+"]"}function n(e){return!e.host||e.cannotBeABaseURL||"file"==e.scheme}function a(e,t,r,o){var n,s,i,a=r||me,l=0,u="",c=!1,d=!1,f=!1;for(r||(e.scheme="",e.username="",e.password="",e.host=null,e.port=null,e.path=[],e.query=null,e.fragment=null,e.cannotBeABaseURL=!1,t=t.replace(ie,"")),t=t.replace(ae,""),n=b(t);l<=n.length;){switch(s=n[l],a){case me:if(!s||!K.test(s)){if(r)return j;a=ge;continue}u+=s.toLowerCase(),a=ye;break;case ye:if(s&&($.test(s)||"+"==s||"-"==s||"."==s))u+=s.toLowerCase();else{if(":"!=s){if(r)return j;u="",a=ge,l=0;continue}if(r&&(C(e)!=v(T,u)||"file"==u&&(O(e)||null!==e.port)||"file"==e.scheme&&!e.host))return;if(e.scheme=u,r)return void(C(e)&&T[e.scheme]==e.port&&(e.port=null));u="","file"==e.scheme?a=Ee:C(e)&&o&&o.scheme==e.scheme?a=ve:C(e)?a=xe:"/"==n[l+1]?(a=be,l++):(e.cannotBeABaseURL=!0,e.path.push(""),a=Oe)}break;case ge:if(!o||o.cannotBeABaseURL&&"#"!=s)return j;if(o.cannotBeABaseURL&&"#"==s){e.scheme=o.scheme,e.path=o.path.slice(),e.query=o.query,e.fragment="",e.cannotBeABaseURL=!0,a=D;break}a="file"==o.scheme?Ee:je;continue;case ve:if("/"!=s||"/"!=n[l+1]){a=je;continue}a=L,l++;break;case be:if("/"==s){a=P;break}a=R;continue;case je:if(e.scheme=o.scheme,s==g)e.username=o.username,e.password=o.password,e.host=o.host,e.port=o.port,e.path=o.path.slice(),e.query=o.query;else if("/"==s||"\\"==s&&C(e))a=_e;else if("?"==s)e.username=o.username,e.password=o.password,e.host=o.host,e.port=o.port,e.path=o.path.slice(),e.query="",a=I;else{if("#"!=s){e.username=o.username,e.password=o.password,e.host=o.host,e.port=o.port,e.path=o.path.slice(),e.path.pop(),a=R;continue}e.username=o.username,e.password=o.password,e.host=o.host,e.port=o.port,e.path=o.path.slice(),e.query=o.query,e.fragment="",a=D}break;case _e:if(!C(e)||"/"!=s&&"\\"!=s){if("/"!=s){e.username=o.username,e.password=o.password,e.host=o.host,e.port=o.port,a=R;continue}a=P}else a=L;break;case xe:if(a=L,"/"!=s||"/"!=u.charAt(l+1))continue;l++;break;case L:if("/"==s||"\\"==s)break;a=P;continue;case P:if("@"==s){c&&(u="%40"+u);for(var c=!0,h=b(u),p=0;p<h.length;p++){var m=h[p];":"!=m||f?(m=E(m,M),f?e.password+=m:e.username+=m):f=!0}u=""}else if(s==g||"/"==s||"?"==s||"#"==s||"\\"==s&&C(e)){if(c&&""==u)return Q;l-=b(u).length+1,u="",a=we}else u+=s;break;case we:case Se:if(r&&"file"==e.scheme){a=Ce;continue}if(":"!=s||d){if(s==g||"/"==s||"?"==s||"#"==s||"\\"==s&&C(e)){if(C(e)&&""==u)return _;if(r&&""==u&&(O(e)||null!==e.port))return;if(i=w(e,u))return i;if(u="",a=A,r)return;continue}"["==s?d=!0:"]"==s&&(d=!1),u+=s}else{if(""==u)return _;if(i=w(e,u))return i;if(u="",a=Me,r==Se)return}break;case Me:if(!x.test(s)){if(s==g||"/"==s||"?"==s||"#"==s||"\\"==s&&C(e)||r){if(""!=u){var y=parseInt(u,10);if(65535<y)return J;e.port=C(e)&&y===T[e.scheme]?null:y,u=""}if(r)return;a=A;continue}return J}u+=s;break;case Ee:if(e.scheme="file","/"==s||"\\"==s)a=Te;else{if(!o||"file"!=o.scheme){a=R;continue}if(s==g)e.host=o.host,e.path=o.path.slice(),e.query=o.query;else if("?"==s)e.host=o.host,e.path=o.path.slice(),e.query="",a=I;else{if("#"!=s){de(n.slice(l).join(""))||(e.host=o.host,e.path=o.path.slice(),fe(e)),a=R;continue}e.host=o.host,e.path=o.path.slice(),e.query=o.query,e.fragment="",a=D}}break;case Te:if("/"==s||"\\"==s){a=Ce;break}o&&"file"==o.scheme&&!de(n.slice(l).join(""))&&(k(o.path[0],!0)?e.path.push(o.path[0]):e.host=o.host),a=R;continue;case Ce:if(s==g||"/"==s||"\\"==s||"?"==s||"#"==s){if(!r&&k(u))a=R;else{if(""==u){if(e.host="",r)return}else{if(i=w(e,u))return i;if("localhost"==e.host&&(e.host=""),r)return;u=""}a=A}continue}u+=s;break;case A:if(C(e)){if(a=R,"/"!=s&&"\\"!=s)continue}else if(r||"?"!=s)if(r||"#"!=s){if(s!=g&&(a=R,"/"!=s))continue}else e.fragment="",a=D;else e.query="",a=I;break;case R:if(s==g||"/"==s||"\\"==s&&C(e)||!r&&("?"==s||"#"==s)){if(pe(u)?(fe(e),"/"==s||"\\"==s&&C(e)||e.path.push("")):he(u)?"/"==s||"\\"==s&&C(e)||e.path.push(""):("file"==e.scheme&&!e.path.length&&k(u)&&(e.host&&(e.host=""),u=u.charAt(0)+":"),e.path.push(u)),u="","file"==e.scheme&&(s==g||"?"==s||"#"==s))for(;1<e.path.length&&""===e.path[0];)e.path.shift();"?"==s?(e.query="",a=I):"#"==s&&(e.fragment="",a=D)}else u+=E(s,ce);break;case Oe:"?"==s?(e.query="",a=I):"#"==s?(e.fragment="",a=D):s!=g&&(e.path[0]+=E(s,S));break;case I:r||"#"!=s?s!=g&&("'"==s&&C(e)?e.query+="%27":e.query+="#"==s?"%23":E(s,S)):(e.fragment="",a=D);break;case D:s!=g&&(e.fragment+=E(s,ue))}l++}}function l(e){var t,r,o=G(this,l,"URL"),n=1<arguments.length?arguments[1]:void 0,e=String(e),s=X(o,{type:"URL"});if(void 0!==n)if(n instanceof l)t=p(n);else if(r=a(t={},String(n)))throw TypeError(r);if(r=a(s,e,null,t))throw TypeError(r);var i=s.searchParams=new q;(n=h(i)).updateSearchParams(s.query),n.updateURL=function(){s.query=String(i)||null},u||(o.href=m.call(o),o.origin=ke.call(o),o.protocol=Le.call(o),o.username=Pe.call(o),o.password=Ae.call(o),o.host=Re.call(o),o.hostname=Ie.call(o),o.port=De.call(o),o.pathname=Ue.call(o),o.search=Ne.call(o),o.searchParams=Fe.call(o),o.hash=Be.call(o))}function t(e,t){return{get:e,set:t,configurable:!0,enumerable:!0}}var g,r,o,N=e("../internals/export"),u=e("../internals/descriptors"),F=e("../internals/native-url"),s=e("../internals/global"),B=e("../internals/object-define-properties"),i=e("../internals/redefine"),G=e("../internals/an-instance"),v=e("../internals/has"),d=e("../internals/object-assign"),b=e("../internals/array-from"),V=e("../internals/string-multibyte").codeAt,z=e("../internals/string-punycode-to-ascii"),H=e("../internals/set-to-string-tag"),W=e("../modules/web.url-search-params"),e=e("../internals/internal-state"),f=s.URL,q=W.URLSearchParams,h=W.getState,X=e.set,p=e.getterFor("URL"),Y=Math.floor,Z=Math.pow,Q="Invalid authority",j="Invalid scheme",_="Invalid host",J="Invalid port",K=/[A-Za-z]/,$=/[\d+-.A-Za-z]/,x=/\d/,ee=/^(0x|0X)/,te=/^[0-7]+$/,re=/^\d+$/,oe=/^[\dA-Fa-f]+$/,ne=/[\u0000\u0009\u000A\u000D #%/:?@[\\]]/,se=/[\u0000\u0009\u000A\u000D #/:?@[\\]]/,ie=/^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g,ae=/[\u0009\u000A\u000D]/g,w=function(e,t){var r,o,n;if("["==t.charAt(0))return"]"==t.charAt(t.length-1)&&(r=function(e){var t=[0,0,0,0,0,0,0,0],r=0,o=null,n=0,s,i,a,l,u,c,d,f=function(){return e.charAt(n)};if(f()==":"){if(e.charAt(1)!=":")return;n+=2;r++;o=r}while(f()){if(r==8)return;if(f()==":"){if(o!==null)return;n++;r++;o=r;continue}s=i=0;while(i<4&&oe.test(f())){s=s*16+parseInt(f(),16);n++;i++}if(f()=="."){if(i==0)return;n-=i;if(r>6)return;a=0;while(f()){l=null;if(a>0)if(f()=="."&&a<4)n++;else return;if(!x.test(f()))return;while(x.test(f())){u=parseInt(f(),10);if(l===null)l=u;else if(l==0)return;else l=l*10+u;if(l>255)return;n++}t[r]=t[r]*256+l;a++;if(a==2||a==4)r++}if(a!=4)return;break}else if(f()==":"){n++;if(!f())return}else if(f())return;t[r++]=s}if(o!==null){c=r-o;r=7;while(r!=0&&c>0){d=t[r];t[r--]=t[o+c-1];t[o+--c]=d}}else if(r!=8)return;return t}(t.slice(1,-1)))?void(e.host=r):_;if(C(e))return t=z(t),ne.test(t)||null===(r=function(e){var t=e.split("."),r,o,n,s,i,a,l;if(t.length&&t[t.length-1]=="")t.pop();if((r=t.length)>4)return e;for(o=[],n=0;n<r;n++){s=t[n];if(s=="")return e;i=10;if(s.length>1&&s.charAt(0)=="0"){i=ee.test(s)?16:8;s=s.slice(i==8?1:2)}if(s==="")a=0;else{if(!(i==10?re:i==8?te:oe).test(s))return e;a=parseInt(s,i)}o.push(a)}for(n=0;n<r;n++){a=o[n];if(n==r-1){if(a>=Z(256,5-r))return null}else if(a>255)return null}for(l=o.pop(),n=0;n<o.length;n++)l+=o[n]*Z(256,3-n);return l}(t))?_:void(e.host=r);if(se.test(t))return _;for(r="",o=b(t),n=0;n<o.length;n++)r+=E(o[n],S);e.host=r},le=function(e){for(var t=null,r=1,o=null,n=0,s=0;s<8;s++)0!==e[s]?(r<n&&(t=o,r=n),o=null,n=0):(null===o&&(o=s),++n);return r<n&&(t=o,r=n),t},S={},ue=d({},S,{" ":1,'"':1,"<":1,">":1,"`":1}),ce=d({},ue,{"#":1,"?":1,"{":1,"}":1}),M=d({},ce,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),E=function(e,t){var r=V(e,0);return 32<r&&r<127&&!v(t,e)?e:encodeURIComponent(e)},T={ftp:21,file:null,http:80,https:443,ws:80,wss:443},C=function(e){return v(T,e.scheme)},O=function(e){return""!=e.username||""!=e.password},k=function(e,t){return 2==e.length&&K.test(e.charAt(0))&&(":"==(e=e.charAt(1))||!t&&"|"==e)},de=function(e){return 1<e.length&&k(e.slice(0,2))&&(2==e.length||"/"===(e=e.charAt(2))||"\\"===e||"?"===e||"#"===e)},fe=function(e){var t=e.path,r=t.length;!r||"file"==e.scheme&&1==r&&k(t[0],!0)||t.pop()},he=function(e){return"."===e||"%2e"===e.toLowerCase()},pe=function(e){return".."===(e=e.toLowerCase())||"%2e."===e||".%2e"===e||"%2e%2e"===e},me={},ye={},ge={},ve={},be={},je={},_e={},xe={},L={},P={},we={},Se={},Me={},Ee={},Te={},Ce={},A={},R={},Oe={},I={},D={},s=l.prototype,m=function(){var e=p(this),t=e.scheme,r=e.username,o=e.password,n=e.host,s=e.port,i=e.path,a=e.query,l=e.fragment,u=t+":";return null!==n?(u+="//",O(e)&&(u+=r+(o?":"+o:"")+"@"),u+=c(n),null!==s&&(u+=":"+s)):"file"==t&&(u+="//"),u+=e.cannotBeABaseURL?i[0]:i.length?"/"+i.join("/"):"",null!==a&&(u+="?"+a),null!==l&&(u+="#"+l),u},ke=function(){var e=p(this),t=e.scheme,r=e.port;if("blob"==t)try{return new URL(t.path[0]).origin}catch(e){return"null"}return"file"!=t&&C(e)?t+"://"+c(e.host)+(null!==r?":"+r:""):"null"},Le=function(){return p(this).scheme+":"},Pe=function(){return p(this).username},Ae=function(){return p(this).password},Re=function(){var e=p(this),t=e.host,e=e.port;return null===t?"":null===e?c(t):c(t)+":"+e},Ie=function(){var e=p(this).host;return null===e?"":c(e)},De=function(){var e=p(this).port;return null===e?"":String(e)},Ue=function(){var e=p(this),t=e.path;return e.cannotBeABaseURL?t[0]:t.length?"/"+t.join("/"):""},Ne=function(){var e=p(this).query;return e?"?"+e:""},Fe=function(){return p(this).searchParams},Be=function(){var e=p(this).fragment;return e?"#"+e:""};u&&B(s,{href:t(m,function(e){var t=p(this),e=String(e),e=a(t,e);if(e)throw TypeError(e);h(t.searchParams).updateSearchParams(t.query)}),origin:t(ke),protocol:t(Le,function(e){var t=p(this);a(t,String(e)+":",me)}),username:t(Pe,function(e){var t=p(this),r=b(String(e));if(!n(t)){t.username="";for(var o=0;o<r.length;o++)t.username+=E(r[o],M)}}),password:t(Ae,function(e){var t=p(this),r=b(String(e));if(!n(t)){t.password="";for(var o=0;o<r.length;o++)t.password+=E(r[o],M)}}),host:t(Re,function(e){var t=p(this);t.cannotBeABaseURL||a(t,String(e),we)}),hostname:t(Ie,function(e){var t=p(this);t.cannotBeABaseURL||a(t,String(e),Se)}),port:t(De,function(e){var t=p(this);n(t)||(""==(e=String(e))?t.port=null:a(t,e,Me))}),pathname:t(Ue,function(e){var t=p(this);t.cannotBeABaseURL||(t.path=[],a(t,e+"",A))}),search:t(Ne,function(e){var t=p(this);""==(e=String(e))?t.query=null:("?"==e.charAt(0)&&(e=e.slice(1)),t.query="",a(t,e,I)),h(t.searchParams).updateSearchParams(t.query)}),searchParams:t(Fe),hash:t(Be,function(e){var t=p(this);""==(e=String(e))?t.fragment=null:("#"==e.charAt(0)&&(e=e.slice(1)),t.fragment="",a(t,e,D))})}),i(s,"toJSON",function(){return m.call(this)},{enumerable:!0}),i(s,"toString",function(){return m.call(this)},{enumerable:!0}),f&&(r=f.createObjectURL,o=f.revokeObjectURL,r&&i(l,"createObjectURL",function(e){return r.apply(f,arguments)}),o&&i(l,"revokeObjectURL",function(e){return o.apply(f,arguments)})),H(l,"URL"),N({global:!0,forced:!F,sham:!u},{URL:l})},{"../internals/an-instance":9,"../internals/array-from":17,"../internals/descriptors":43,"../internals/export":50,"../internals/global":59,"../internals/has":60,"../internals/internal-state":70,"../internals/native-url":84,"../internals/object-assign":89,"../internals/object-define-properties":91,"../internals/redefine":108,"../internals/set-to-string-tag":117,"../internals/string-multibyte":123,"../internals/string-punycode-to-ascii":124,"../modules/es.string.iterator":186,"../modules/web.url-search-params":231}],233:[function(e,t,r){"use strict";t.exports=e("./").polyfill()},{"./":234}],234:[function(V,r,o){!function(B,G){var e,t;e=this,t=function(){"use strict";function l(e){return"function"==typeof e}var r=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},o=0,t=void 0,n=void 0,i=function(e,t){d[o]=e,d[o+1]=t,2===(o+=2)&&(n?n(f):D())};var e="undefined"!=typeof window?window:void 0,s=e||{},s=s.MutationObserver||s.WebKitMutationObserver,a="undefined"==typeof self&&void 0!==B&&"[object process]"==={}.toString.call(B),u="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function c(){var e=setTimeout;return function(){return e(f,1)}}var d=new Array(1e3);function f(){for(var e=0;e<o;e+=2)(0,d[e])(d[e+1]),d[e]=void 0,d[e+1]=void 0;o=0}function h(){try{var e=Function("return this")().require("vertx");return void 0!==(t=e.runOnLoop||e.runOnContext)?function(){t(f)}:c()}catch(e){return c()}}var p,m,y,D=void 0;function g(e,t){var r,o=this,n=new this.constructor(j),s=(void 0===n[b]&&P(n),o._state);return s?(r=arguments[s-1],i(function(){return k(s,n,r,o._result)})):C(o,n,e,t),n}function v(e){var t;return e&&"object"==typeof e&&e.constructor===this?e:(M(t=new this(j),e),t)}var D=a?function(){return B.nextTick(f)}:s?(m=0,a=new s(f),y=document.createTextNode(""),a.observe(y,{characterData:!0}),function(){y.data=m=++m%2}):u?((p=new MessageChannel).port1.onmessage=f,function(){return p.port2.postMessage(0)}):(void 0===e&&"function"==typeof V?h:c)(),b=Math.random().toString(36).substring(2);function j(){}var _=void 0,x=1,w=2;function U(e,o,n){i(function(t){var r=!1,e=function(e,t,r,o){try{e.call(t,r,o)}catch(e){return e}}(n,o,function(e){r||(r=!0,(o!==e?M:E)(t,e))},function(e){r||(r=!0,T(t,e))},t._label);!r&&e&&(r=!0,T(t,e))},e)}function S(e,t,r){var o,n;t.constructor===e.constructor&&r===g&&t.constructor.resolve===v?(o=e,(n=t)._state===x?E(o,n._result):n._state===w?T(o,n._result):C(n,void 0,function(e){return M(o,e)},function(e){return T(o,e)})):void 0!==r&&l(r)?U(e,t,r):E(e,t)}function M(t,e){if(t===e)T(t,new TypeError("You cannot resolve a promise with itself"));else if(r=typeof e,null===e||"object"!=r&&"function"!=r)E(t,e);else{r=void 0;try{r=e.then}catch(e){return void T(t,e)}S(t,e,r)}var r}function N(e){e._onerror&&e._onerror(e._result),O(e)}function E(e,t){e._state===_&&(e._result=t,e._state=x,0!==e._subscribers.length&&i(O,e))}function T(e,t){e._state===_&&(e._state=w,e._result=t,i(N,e))}function C(e,t,r,o){var n=e._subscribers,s=n.length;e._onerror=null,n[s]=t,n[s+x]=r,n[s+w]=o,0===s&&e._state&&i(O,e)}function O(e){var t=e._subscribers,r=e._state;if(0!==t.length){for(var o,n=void 0,s=e._result,i=0;i<t.length;i+=3)o=t[i],n=t[i+r],o?k(r,o,n,s):n(s);e._subscribers.length=0}}function k(e,t,r,o){var n=l(r),s=void 0,i=void 0,a=!0;if(n){try{s=r(o)}catch(e){a=!1,i=e}if(t===s)return void T(t,new TypeError("A promises callback cannot return that same promise."))}else s=o;t._state===_&&(n&&a?M(t,s):!1===a?T(t,i):e===x?E(t,s):e===w&&T(t,s))}var L=0;function P(e){e[b]=L++,e._state=void 0,e._result=void 0,e._subscribers=[]}A.prototype._enumerate=function(e){for(var t=0;this._state===_&&t<e.length;t++)this._eachEntry(e[t],t)},A.prototype._eachEntry=function(t,e){var r=this._instanceConstructor,o=r.resolve;if(o===v){var n,s=void 0,i=void 0,a=!1;try{s=t.then}catch(e){a=!0,i=e}s===g&&t._state!==_?this._settledAt(t._state,e,t._result):"function"!=typeof s?(this._remaining--,this._result[e]=t):r===R?(n=new r(j),a?T(n,i):S(n,t,s),this._willSettleAt(n,e)):this._willSettleAt(new r(function(e){return e(t)}),e)}else this._willSettleAt(o(t),e)},A.prototype._settledAt=function(e,t,r){var o=this.promise;o._state===_&&(this._remaining--,e===w?T(o,r):this._result[t]=r),0===this._remaining&&E(o,this._result)},A.prototype._willSettleAt=function(e,t){var r=this;C(e,void 0,function(e){return r._settledAt(x,t,e)},function(e){return r._settledAt(w,t,e)})};var F=A;function A(e,t){this._instanceConstructor=e,this.promise=new e(j),this.promise[b]||P(this.promise),r(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0!==this.length&&(this.length=this.length||0,this._enumerate(t),0!==this._remaining)||E(this.promise,this._result)):T(this.promise,new Error("Array Methods must be provided an Array"))}I.prototype.catch=function(e){return this.then(null,e)},I.prototype.finally=function(t){var r=this.constructor;return l(t)?this.then(function(e){return r.resolve(t()).then(function(){return e})},function(e){return r.resolve(t()).then(function(){throw e})}):this.then(t,t)};var R=I;function I(e){if(this[b]=L++,this._result=this._state=void 0,this._subscribers=[],j!==e){if("function"!=typeof e)throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");if(!(this instanceof I))throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");var t=this;try{e(function(e){M(t,e)},function(e){T(t,e)})}catch(e){T(t,e)}}}return R.prototype.then=g,R.all=function(e){return new F(this,e).promise},R.race=function(n){var s=this;return r(n)?new s(function(e,t){for(var r=n.length,o=0;o<r;o++)s.resolve(n[o]).then(e,t)}):new s(function(e,t){return t(new TypeError("You must pass an array to race."))})},R.resolve=v,R.reject=function(e){var t=new this(j);return T(t,e),t},R._setScheduler=function(e){n=e},R._setAsap=function(e){i=e},R._asap=i,R.polyfill=function(){var e=void 0;if(void 0!==G)e=G;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var r=null;try{r=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===r&&!t.cast)return}e.Promise=R},R.Promise=R},"object"==typeof o&&void 0!==r?r.exports=t():"function"==typeof s&&s.amd?s(t):e.ES6Promise=t()}.call(this,V("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:243}],235:[function(e,t,r){var o,n;o=this,n=function(e,t){"use strict";var r=5e3,o="callback";function d(t){try{delete window[t]}catch(e){window[t]=void 0}}function f(e){e=document.getElementById(e);e&&document.getElementsByTagName("head")[0].removeChild(e)}t.exports=function(s){var i=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],a=s,l=i.timeout||r,u=i.jsonpCallback||o,c=void 0;return new Promise(function(t,e){var r=i.jsonpCallbackFunction||"jsonp_"+Date.now()+"_"+Math.ceil(1e5*Math.random()),o=u+"_"+r,n=(window[r]=function(e){t({ok:!0,json:function(){return Promise.resolve(e)}}),c&&clearTimeout(c),f(o),d(r)},a+=-1===a.indexOf("?")?"?":"&",document.createElement("script"));n.setAttribute("src",""+a+u+"="+r),i.charset&&n.setAttribute("charset",i.charset),n.id=o,document.getElementsByTagName("head")[0].appendChild(n),c=setTimeout(function(){e(new Error("JSONP request to "+s+" timed out")),d(r),f(o),window[r]=function(){d(r)}},l),n.onerror=function(){e(new Error("JSONP request to "+s+" failed")),d(r),f(o),c&&clearTimeout(c)}})}},"function"==typeof s&&s.amd?s(["exports","module"],n):void 0!==r&&void 0!==t?n(0,t):(n(n={exports:{}},n),o.fetchJsonp=n.exports)},{}],236:[function(e,t,r){var o=function(a){"use strict";var l,u,c,d,f,h,t,p,m,o,e;if(!(void 0===a||"undefined"!=typeof navigator&&/MSIE [1-9]\./.test(navigator.userAgent)))return e=a.document,l=function(){return a.URL||a.webkitURL||a},u=e.createElementNS("http://www.w3.org/1999/xhtml","a"),c="download"in u,d=/constructor/i.test(a.HTMLElement)||a.safari,f=/CriOS\/[\d]+/.test(navigator.userAgent),h=function(e){(a.setImmediate||a.setTimeout)(function(){throw e},0)},t=4e4,p=function(e){setTimeout(function(){"string"==typeof e?l().revokeObjectURL(e):e.remove()},t)},m=function(e){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([String.fromCharCode(65279),e],{type:e.type}):e},e=(o=function(e,r,t){t||(e=m(e));var o,n,s=this,t="application/octet-stream"===e.type,i=function(){for(var e=s,t="writestart progress write writeend".split(" "),r=void 0,o=(t=[].concat(t)).length;o--;){var n=e["on"+t[o]];if("function"==typeof n)try{n.call(e,r||e)}catch(e){h(e)}}};s.readyState=s.INIT,c?(o=l().createObjectURL(e),setTimeout(function(){var e,t;u.href=o,u.download=r,e=u,t=new MouseEvent("click"),e.dispatchEvent(t),i(),p(o),s.readyState=s.DONE})):(f||t&&d)&&a.FileReader?((n=new FileReader).onloadend=function(){var e=f?n.result:n.result.replace(/^data:[^;]*;/,"data:attachment/file;");a.open(e,"_blank")||(a.location.href=e),e=void 0,s.readyState=s.DONE,i()},n.readAsDataURL(e),s.readyState=s.INIT):(o=o||l().createObjectURL(e),!t&&a.open(o,"_blank")||(a.location.href=o),s.readyState=s.DONE,i(),p(o))}).prototype,"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(e,t,r){return t=t||e.name||"download",r||(e=m(e)),navigator.msSaveOrOpenBlob(e,t)}:(e.abort=function(){},e.readyState=e.INIT=0,e.WRITING=1,e.DONE=2,e.error=e.onwritestart=e.onprogress=e.onwrite=e.onabort=e.onerror=e.onwriteend=null,function(e,t,r){return new o(e,t||e.name||"download",r)})}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content);void 0!==t&&t.exports?t.exports.saveAs=o:null!=s&&null!==s.amd&&s("FileSaver.js",function(){return o})},{}],237:[function(e,t,r){var o,n=Object.defineProperty,s=(n(r,"__esModule",{value:!0}),r),i={GIFEncoder:()=>f,applyPalette:()=>function(e,t,r="rgb565"){if(!e||!e.buffer)throw new Error("quantize() expected RGBA Uint8Array data");if(!(e instanceof Uint8Array||e instanceof Uint8ClampedArray))throw new Error("quantize() expected RGBA Uint8Array data");if(256<t.length)throw new Error("applyPalette() only works with 256 colors or less");const o=new Uint32Array(e.buffer),n=o.length,s="rgb444"===r?4096:65536,i=new Uint8Array(n),a=new Array(s);if("rgba4444"===r)for(let e=0;e<n;e++){var l=o[e],u=l>>24&255,c=l>>16&255,d=l>>8&255,l=255&l,f=L(l,d,c,u),f=f in a?a[f]:a[f]=function(t,r,o,n,s){let i=0,a=1e100;for(let e=0;e<s.length;e++){var l,u=s[e],c=v(u[3]-n);c>a||(l=u[0],(c+=v(l-t))>a||(l=u[1],(c+=v(l-r))>a||(l=u[2],(c+=v(l-o))>a||(a=c,i=e))))}return i}(l,d,c,u,t);i[e]=f}else{const g="rgb444"===r?P:k;for(let e=0;e<n;e++){var h=o[e],p=h>>16&255,m=h>>8&255,h=255&h,y=g(h,m,p),y=y in a?a[y]:a[y]=function(t,r,o,n){let s=0,i=1e100;for(let e=0;e<n.length;e++){var a,l=n[e],u=v(l[0]-t);u>i||(a=l[1],(u+=v(a-r))>i||(a=l[2],(u+=v(a-o))>i||(i=u,s=e)))}return s}(h,m,p,t);i[e]=y}}return i},default:()=>h,nearestColor:()=>function(e,t,r=u){return e[l(e,t,r)]},nearestColorIndex:()=>l,nearestColorIndexWithDistance:()=>d,prequantize:()=>function(e,{roundRGB:r=5,roundAlpha:o=10,oneBitAlpha:n=null}={}){const s=new Uint32Array(e.buffer);for(let t=0;t<s.length;t++){var i=s[t];let e=i>>24&255;var a,l=i>>16&255,u=i>>8&255,i=255&i;e=c(e,o),n&&(a="number"==typeof n?n:127,e=e<=a?0:255),i=c(i,r),u=c(u,r),l=c(l,r),s[t]=e<<24|l<<16|u<<8|i<<0}},quantize:()=>function(e,t,r={}){var{format:o="rgb565",clearAlpha:n=!0,clearAlphaColor:s=0,clearAlphaThreshold:i=0,oneBitAlpha:a=!1}=r;if(!e||!e.buffer)throw new Error("quantize() expected RGBA Uint8Array data");if(!(e instanceof Uint8Array||e instanceof Uint8ClampedArray))throw new Error("quantize() expected RGBA Uint8Array data");e=new Uint32Array(e.buffer);let l=!1!==r.useSqrt;const u="rgba4444"===o,c=function(r,e){const t="rgb444"===e?4096:65536,o=new Array(t),n=r.length;if("rgba4444"===e)for(let t=0;t<n;++t){var s=r[t],i=s>>24&255,a=s>>16&255,l=s>>8&255,s=255&s,u=L(s,l,a,i);let e=u in o?o[u]:o[u]=D();e.rc+=s,e.gc+=l,e.bc+=a,e.ac+=i,e.cnt++}else if("rgb444"===e)for(let t=0;t<n;++t){var c=r[t],d=c>>16&255,f=c>>8&255,c=255&c,h=P(c,f,d);let e=h in o?o[h]:o[h]=D();e.rc+=c,e.gc+=f,e.bc+=d,e.cnt++}else for(let t=0;t<n;++t){var p=r[t],m=p>>16&255,y=p>>8&255,p=255&p,g=k(p,y,m);let e=g in o?o[g]:o[g]=D();e.rc+=p,e.gc+=y,e.bc+=m,e.cnt++}return o}(e,o),d=c.length,f=d-1,h=new Uint32Array(d+1);for(var p=0,m=0;m<d;++m){const O=c[m];null!=O&&(E=1/O.cnt,u&&(O.ac*=E),O.rc*=E,O.gc*=E,O.bc*=E,c[p++]=O)}R(t)/p<.022&&(l=!1);for(var y,g,v,m=0;m<p-1;++m)c[m].fw=m+1,c[m+1].bk=m,l&&(c[m].cnt=Math.sqrt(c[m].cnt));l&&(c[m].cnt=Math.sqrt(c[m].cnt));for(m=0;m<p;++m){I(c,m,!1);var b=c[m].err;for(g=++h[0];1<g&&(v=g>>1,!(c[y=h[v]].err<=b));g=v)h[g]=y;h[g]=m}var j,_=p-t;for(m=0;m<_;){for(;;){var x=h[1];if((j=c[x]).tm>=j.mtm&&c[j.nn].mtm<=j.tm)break;j.mtm==f?x=h[1]=h[h[0]--]:(I(c,x,!1),j.tm=m);b=c[x].err;for(g=1;(v=g+g)<=h[0]&&(v<h[0]&&c[h[v]].err>c[h[v+1]].err&&v++,!(b<=c[y=h[v]].err));g=v)h[g]=y;h[g]=x}var w=c[j.nn],S=j.cnt,M=w.cnt,E=1/(S+M);u&&(j.ac=E*(S*j.ac+M*w.ac)),j.rc=E*(S*j.rc+M*w.rc),j.gc=E*(S*j.gc+M*w.gc),j.bc=E*(S*j.bc+M*w.bc),j.cnt+=w.cnt,j.mtm=++m,c[w.bk].fw=w.fw,c[w.fw].bk=w.bk,w.mtm=f}let T=[];for(m=0;;0){let e=A(Math.round(c[m].rc),0,255),t=A(Math.round(c[m].gc),0,255),r=A(Math.round(c[m].bc),0,255),o=255;u&&(o=A(Math.round(c[m].ac),0,255),a&&(C="number"==typeof a?a:127,o=o<=C?0:255),n&&o<=i&&(e=t=r=s,o=0));var C=u?[e,t,r,o]:[e,t,r];if(function(t,r){for(let e=0;e<t.length;e++){var o=t[e],n=o[0]===r[0]&&o[1]===r[1]&&o[2]===r[2],o=!(4<=o.length&&4<=r.length)||o[3]===r[3];if(n&&o)return!0}return!1}(T,C)||T.push(C),0==(m=c[m].fw))break}return T},snapColorsToPalette:()=>function(r,o,e=5){if(r.length&&o.length){var n=r.map(e=>e.slice(0,3)),s=e*e,i=r[0].length;for(let t=0;t<o.length;t++){let e=o[t];e=e.length<i?[e[0],e[1],e[2],255]:e.length>i?e.slice(0,3):e.slice();var a=d(n,e.slice(0,3),u),l=a[0],a=a[1];0<a&&a<=s&&(r[l]=e)}}}};for(o in i)n(s,o,{get:i[o],enumerable:!0});var a={signature:"GIF",version:"89a",trailer:59,extensionIntroducer:33,applicationExtensionLabel:255,graphicControlExtensionLabel:249,imageSeparator:44,signatureSize:3,versionSize:3,globalColorTableFlagMask:128,colorResolutionMask:112,sortFlagMask:8,globalColorTableSizeMask:7,applicationIdentifierSize:8,applicationAuthCodeSize:3,disposalMethodMask:28,userInputFlagMask:2,transparentColorFlagMask:1,localColorTableFlagMask:128,interlaceFlagMask:64,idSortFlagMask:32,localColorTableSizeMask:7};function T(e=256){let n=0,s=new Uint8Array(e);return{get buffer(){return s.buffer},reset(){n=0},bytesView(){return s.subarray(0,n)},bytes(){return s.slice(0,n)},writeByte(e){i(n+1),s[n]=e,n++},writeBytes(t,r=0,o=t.length){i(n+o);for(let e=0;e<o;e++)s[n++]=t[e+r]},writeBytesView(e,t=0,r=e.byteLength){i(n+r),s.set(e.subarray(t,t+r),n),n+=r}};function i(e){var t=s.length;if(!(e<=t)){e=Math.max(e,t*(t<1048576?2:1.125)>>>0),0!=t&&(e=Math.max(e,256));const r=s;s=new Uint8Array(e),0<n&&s.set(r.subarray(0,n),0)}}}var C=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];var S=function(e,t,r,o,n=T(512),s=new Uint8Array(256),i=new Int32Array(5003),a=new Int32Array(5003)){var l=i.length,o=Math.max(2,o);s.fill(0),a.fill(0),i.fill(-1);let u=0,c=0;var d=o+1;const f=d;let h=!1,p=f,m=(1<<p)-1;var y=1<<d-1;const g=1+y;let v=2+y,b=0,j=r[0],_=0;for(let e=l;e<65536;e*=2)++_;_=8-_,n.writeByte(o),E(y);var x=r.length;for(let t=1;t<x;t++)e:{var w=r[t],S=(w<<12)+j;let e=w<<_^j;if(i[e]===S)j=a[e];else{for(var M=0===e?1:l-e;0<=i[e];)if((e-=M)<0&&(e+=l),i[e]===S){j=a[e];break e}E(j),j=w,v<4096?(a[e]=v++,i[e]=S):(i.fill(-1),v=2+y,h=!0,E(y))}}return E(j),E(g),n.writeByte(0),n.bytesView();function E(e){for(u&=C[c],0<c?u|=e<<c:u=e,c+=p;8<=c;)s[b++]=255&u,254<=b&&(n.writeByte(b),n.writeBytesView(s,0,b),b=0),u>>=8,c-=8;if((v>m||h)&&(h?(p=f,m=(1<<p)-1,h=!1):(++p,m=12===p?1<<p:(1<<p)-1)),e==g){for(;0<c;)s[b++]=255&u,254<=b&&(n.writeByte(b),n.writeBytesView(s,0,b),b=0),u>>=8,c-=8;0<b&&(n.writeByte(b),n.writeBytesView(s,0,b),b=0)}}};function k(e,t,r){return e<<8&63488|t<<2&992|r>>3}function L(e,t,r,o){return e>>4|240&t|(240&r)<<4|(240&o)<<8}function P(e,t,r){return e>>4<<8|240&t|r>>4}function A(e,t,r){return e<t?t:r<e?r:e}function R(e){return e*e}function I(e,t,r){var o=0,n=1e100;const s=e[t];for(var i=s.cnt,a=s.ac,l=s.rc,u=s.gc,c=s.bc,d=s.fw;0!=d;d=e[d].fw){var f,h=e[d],p=h.cnt,p=i*p/(i+p);n<=p||(f=0,r&&n<=(f+=p*R(h.ac-a))||n<=(f+=p*R(h.rc-l))||n<=(f+=p*R(h.gc-u))||n<=(f+=p*R(h.bc-c))||(n=f,o=d))}s.err=n,s.nn=o}function D(){return{ac:0,rc:0,gc:0,bc:0,cnt:0,nn:0,fw:0,bk:0,tm:0,mtm:0,err:0}}function u(e,t){for(var r=0,o=0;o<e.length;o++){var n=e[o]-t[o];r+=n*n}return r}function c(e,t){return 1<t?Math.round(e/t)*t:e}function v(e){return e*e}function l(t,r,o=u){let n=1/0,s=-1;for(let e=0;e<t.length;e++){var i=o(r,t[e]);i<n&&(n=i,s=e)}return s}function d(t,r,o=u){let n=1/0,s=-1;for(let e=0;e<t.length;e++){var i=o(r,t[e]);i<n&&(n=i,s=e)}return[s,n]}function f(e={}){const{initialCapacity:t=4096,auto:g=!0}=e,v=T(t);const b=new Uint8Array(256),j=new Int32Array(5003),_=new Int32Array(5003);let x=!1;return{reset(){v.reset(),x=!1},finish(){v.writeByte(a.trailer)},bytes(){return v.bytes()},bytesView(){return v.bytesView()},get buffer(){return v.buffer},get stream(){return v},writeHeader:w,writeFrame(e,t,r,o={}){var{transparent:n=!1,transparentIndex:s=0,delay:i=0,palette:a=null,repeat:l=0,colorDepth:u=8,dispose:c=-1}=o;let d=!1;if(g?x||(d=!0,w(),x=!0):d=Boolean(o.first),t=Math.max(0,Math.floor(t)),r=Math.max(0,Math.floor(r)),d){if(!a)throw new Error("First frame must include a { palette } option");var[o,f,h,p,m=8]=[v,t,r,a,u];p=U(p.length)-1,m=128|m-1<<4|p,E(o,f),E(o,h),o.writeBytes([m,0,0]),M(v,a),0<=l&&(p=v,f=l,p.writeByte(33),p.writeByte(255),p.writeByte(11),O(p,"NETSCAPE2.0"),p.writeByte(3),p.writeByte(1),E(p,f),p.writeByte(0))}var y,h=Math.round(i/10),o=v,m=c,l=h,f=n,p=s,i=(o.writeByte(33),o.writeByte(249),o.writeByte(4),p<0&&(p=0,f=!1),f=f?(y=1,2):y=0,0<=m&&(f=7&m),f<<=2,o.writeByte(0|f|y),E(o,l),o.writeByte(p||0),o.writeByte(0),Boolean(a)&&!d);c=v,n=t,s=r,y=i?a:null,c.writeByte(44),E(c,0),E(c,0),E(c,n),E(c,s),y?(n=U(y.length)-1,c.writeByte(128|n)):c.writeByte(0),i&&M(v,a),[l,o,s,n,c=8,i,a,e]=[v,e,t,r,u,b,j,_],S(s,n,o,c,l,i,a,e)}};function w(){O(v,"GIF89a")}}function M(r,o){var e=1<<U(o.length);for(let t=0;t<e;t++){let e=[0,0,0];t<o.length&&(e=o[t]),r.writeByte(e[0]),r.writeByte(e[1]),r.writeByte(e[2])}}function E(e,t){e.writeByte(255&t),e.writeByte(t>>8&255)}function O(e,t){for(var r=0;r<t.length;r++)e.writeByte(t.charCodeAt(r))}function U(e){return Math.max(Math.ceil(Math.log2(e)),1)}var h=f},{}],238:[function(e,t,r){r.read=function(e,t,r,o,n){var s,i,a=8*n-o-1,l=(1<<a)-1,u=l>>1,c=-7,d=r?n-1:0,f=r?-1:1,n=e[t+d];for(d+=f,s=n&(1<<-c)-1,n>>=-c,c+=a;0<c;s=256*s+e[t+d],d+=f,c-=8);for(i=s&(1<<-c)-1,s>>=-c,c+=o;0<c;i=256*i+e[t+d],d+=f,c-=8);if(0===s)s=1-u;else{if(s===l)return i?NaN:1/0*(n?-1:1);i+=Math.pow(2,o),s-=u}return(n?-1:1)*i*Math.pow(2,s-o)},r.write=function(e,t,r,o,n,s){var i,a,l=8*s-n-1,u=(1<<l)-1,c=u>>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,f=o?0:s-1,h=o?1:-1,s=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,i=u):(i=Math.floor(Math.log(t)/Math.LN2),t*(o=Math.pow(2,-i))<1&&(i--,o*=2),2<=(t+=1<=i+c?d/o:d*Math.pow(2,1-c))*o&&(i++,o/=2),u<=i+c?(a=0,i=u):1<=i+c?(a=(t*o-1)*Math.pow(2,n),i+=c):(a=t*Math.pow(2,c-1)*Math.pow(2,n),i=0));8<=n;e[r+f]=255&a,f+=h,a/=256,n-=8);for(i=i<<n|a,l+=n;0<l;e[r+f]=255&i,f+=h,i/=256,l-=8);e[r+f-h]|=128*s}},{}],239:[function(o,e,c){"use strict";var t;function y(e,t){return e.b===t.b&&e.a===t.a}function g(e,t){return e.b<t.b||e.b===t.b&&e.a<=t.a}function v(e,t,r){var o=t.b-e.b,n=r.b-t.b;return 0<o+n?o<n?t.a-e.a+o/(o+n)*(e.a-r.a):t.a-r.a+n/(o+n)*(r.a-e.a):0}function b(e,t,r){var o=t.b-e.b,n=r.b-t.b;return 0<o+n?(t.a-r.a)*o+(t.a-e.a)*n:0}function j(e,t){return e.a<t.a||e.a===t.a&&e.b<=t.b}function V(e,t,r){var o=t.a-e.a,n=r.a-t.a;return 0<o+n?o<n?t.b-e.b+o/(o+n)*(e.b-r.b):t.b-r.b+n/(o+n)*(r.b-e.b):0}function z(e,t,r){var o=t.a-e.a,n=r.a-t.a;return 0<o+n?(t.b-r.b)*o+(t.b-e.b)*n:0}function _(e,t,r,o){return(e=e<0?0:e)<=(r=r<0?0:r)?0===r?(t+o)/2:t+e/(e+r)*(o-t):o+r/(e+r)*(t-o)}function d(e){var t=s(e.b);return n(t,e.c),n(t.b,e.c),i(t,e.a),t}function x(e,t){var r=!1,o=!1;e!==t&&(t.a!==e.a&&(o=!0,E(t.a,e.a)),t.d!==e.d&&(r=!0,a(t.d,e.d)),M(t,e),o||(n(t,e.a),e.a.c=e),r||(i(t,e.d),e.d.a=e))}function m(e){var t=e.b,r=!1;e.d!==e.b.d&&(r=!0,a(e.d,e.b.d)),e.c===e?E(e.a,null):(e.b.d.a=e.b.e,e.a.c=e.c,M(e,e.b.e),r||i(e,e.d)),t.c===t?(E(t.a,null),a(t.d,null)):(e.d.a=t.b.e,t.a.c=t.c,M(t,t.b.e)),H(e)}function w(e){var t=s(e),r=t.b;return M(t,e.e),t.a=e.b.a,n(r,t.a),t.d=r.d=e.d,t=t.b,M(e.b,e.b.b.e),M(e.b,t),e.b.a=t.a,t.b.a.c=t.b,t.b.d=e.b.d,t.f=e.f,t.b.f=e.b.f,t}function S(e,t){var r=!1,o=s(e),n=o.b;return t.d!==e.d&&(r=!0,a(t.d,e.d)),M(o,e.e),M(n,t),o.a=e.b.a,n.a=t.a,o.d=n.d=e.d,e.d.a=n,r||i(o,e.d),o}function s(e){var t=new u,r=new u,o=e.b.h;return(((r.h=o).b.h=t).h=e).b.h=r,t.b=r,((t.c=t).e=r).b=t,(r.c=r).e=t}function M(e,t){var r=e.c,o=t.c;r.b.e=t,(o.b.e=e).c=o,t.c=r}function n(e,t){var r=t.f,o=new D(t,r);for(r.e=o,r=(t.f=o).c=e;r.a=o,(r=r.c)!==e;);}function i(e,t){var r=t.d,o=new te(t,r);for(r.b=o,(t.d=o).a=e,o.c=t.c,r=e;r.d=o,(r=r.e)!==e;);}function H(e){var t=e.h;e=e.b.h,(t.b.h=e).b.h=t}function E(e,t){for(var r=e.c,o=r;o.a=t,(o=o.c)!==r;);r=e.f,((o=e.e).f=r).e=o}function a(e,t){for(var r=e.a,o=r;o.d=t,(o=o.e)!==r;);r=e.d,((o=e.b).d=r).b=o}function W(e){var t=0;return Math.abs(e[1])>Math.abs(e[0])&&(t=1),t=Math.abs(e[2])>Math.abs(e[t])?2:t}function T(e,t){e.f+=t.f,e.b.f+=t.b.f}function f(e,t,r){return e=e.a,t=t.a,r=r.a,t.b.a===e?r.b.a===e?g(t.a,r.a)?b(r.b.a,t.a,r.a)<=0:0<=b(t.b.a,r.a,t.a):b(r.b.a,e,r.a)<=0:r.b.a===e?0<=b(t.b.a,e,t.a):(t=v(t.b.a,e,t.a),(e=v(r.b.a,e,r.a))<=t)}function C(e){e.a.i=null;var t=e.e;t.a.c=t.c,t.c.a=t.a,e.e=null}function O(e,t){m(e.a),e.c=!1,(e.a=t).i=e}function k(e){for(var t=e.a.a;(e=G(e)).a.a===t;);return e.c&&(O(e,t=S(B(e).a.b,e.a.e)),e=G(e)),e}function q(e,t,r){var o=new F;return o.a=r,o.e=p(e.f,t.e,o),r.i=o}function X(e,t){switch(e.s){case 100130:return 0!=(1&t);case 100131:return 0!==t;case 100132:return 0<t;case 100133:return t<0;case 100134:return 2<=t||t<=-2}return!1}function h(e){var t=e.a,r=t.d;r.c=e.d,r.a=t,C(e)}function L(e,t,r){for(t=(e=t).a;e!==r;){e.c=!1;var o=B(e),n=o.a;if(n.a!==t.a){if(!o.c){h(e);break}O(o,n=S(t.c.b,n.b))}t.c!==n&&(x(n.b.e,n),x(t,n)),h(e),t=o.a,e=o}return t}function P(e,t,r,o,n,s){for(var i=!0;q(e,t,r.b),(r=r.c)!==o;);for(null===n&&(n=B(t).a.b.c);(r=(o=B(t)).a.b).a===n.a;)r.c!==n&&(x(r.b.e,r),x(n.b.e,r)),o.f=t.f-r.f,o.d=X(e,o.f),t.b=!0,!i&&R(e,t)&&(T(r,n),C(t),m(n)),i=!1,t=o,n=r;t.b=!0,s&&J(e,t)}function Y(e,t,r,o,n){var s=[t.g[0],t.g[1],t.g[2]];t.d=null,t.d=e.o&&e.o(s,r,o,e.c)||null,null===t.d&&(n?e.n||(l(e,100156),e.n=!0):t.d=r[0])}function A(e,t,r){var o=[null,null,null,null];o[0]=t.a.d,o[1]=r.a.d,Y(e,t.a,o,[.5,.5,0,0],!1),x(t,r)}function Z(e,t,r,o,n){var s=Math.abs(t.b-e.b)+Math.abs(t.a-e.a),i=Math.abs(r.b-e.b)+Math.abs(r.a-e.a),a=n+1;o[n]=.5*i/(s+i),o[a]=.5*s/(s+i),e.g[0]+=o[n]*t.g[0]+o[a]*r.g[0],e.g[1]+=o[n]*t.g[1]+o[a]*r.g[1],e.g[2]+=o[n]*t.g[2]+o[a]*r.g[2]}function R(e,t){var r=B(t),o=t.a,n=r.a;if(g(o.a,n.a)){if(0<b(n.b.a,o.a,n.a))return;if(y(o.a,n.a)){if(o.a!==n.a){var r=e.e,s=o.a.h;if(0<=s){var i=(r=r.b).d,a=r.e,l=r.c,u=l[s];i[u]=i[r.a],(l[i[u]]=u)<=--r.a&&(u<=1||g(a[i[u>>1]],a[i[u]])?N:ue)(r,u),a[s]=null,l[s]=r.b,r.b=s}else for(r.c[-(s+1)]=null;0<r.a&&null===r.c[r.d[r.a-1]];)--r.a;A(e,n.b.e,o)}}else w(n.b),x(o,n.b.e),t.b=r.b=!0}else{if(b(o.b.a,n.a,o.a)<0)return;G(t).b=t.b=!0,w(o.b),x(n.b.e,o)}return 1}function Q(e,t){var r=B(t),o=t.a,n=r.a,s=o.a,i=n.a,a=o.b.a,l=n.b.a,u=new D;if(b(a,e.a,s),b(l,e.a,i),!(s===i||Math.min(s.a,a.a)>Math.max(i.a,l.a))){if(g(s,i)){if(0<b(l,s,i))return}else if(b(a,i,s)<0)return;var c,d,f=a,h=s,p=l,m=i;if(g(f,h)||(c=f,f=h,h=c),g(p,m)||(c=p,p=m,m=c),g(f,p)||(c=f,f=p,p=c,c=h,h=m,m=c),g(p,h)?g(h,m)?((c=v(f,p,h))+(d=v(p,h,m))<0&&(c=-c,d=-d),u.b=_(c,p.b,d,h.b)):((c=b(f,p,h))+(d=-b(f,m,h))<0&&(c=-c,d=-d),u.b=_(c,p.b,d,m.b)):u.b=(p.b+h.b)/2,j(f,h)||(c=f,f=h,h=c),j(p,m)||(c=p,p=m,m=c),j(f,p)||(c=f,f=p,p=c,c=h,h=m,m=c),j(p,h)?j(h,m)?((c=V(f,p,h))+(d=V(p,h,m))<0&&(c=-c,d=-d),u.a=_(c,p.a,d,h.a)):((c=z(f,p,h))+(d=-z(f,m,h))<0&&(c=-c,d=-d),u.a=_(c,p.a,d,m.a)):u.a=(p.a+h.a)/2,g(u,e.a)&&(u.b=e.a.b,u.a=e.a.a),f=g(s,i)?s:i,g(f,u)&&(u.b=f.b,u.a=f.a),y(u,s)||y(u,i))return R(e,t),0;if(!y(a,e.a)&&0<=b(a,e.a,u)||!y(l,e.a)&&b(l,e.a,u)<=0){if(l===e.a)w(o.b),x(n.b,o),o=B(t=k(t)).a,L(e,B(t),r),P(e,t,o.b.e,o,o,!0);else{if(a!==e.a)return 0<=b(a,e.a,u)&&(G(t).b=t.b=!0,w(o.b),o.a.b=e.a.b,o.a.a=e.a.a),void(b(l,e.a,u)<=0&&(t.b=r.b=!0,w(n.b),n.a.b=e.a.b,n.a.a=e.a.a));for(w(n.b),x(o.e,n.b.e),i=(s=r=t).a.b.a;(s=G(s)).a.b.a===i;);s=B(t=s).a.b.c,r.a=n.b.e,P(e,t,(n=L(e,r,null)).c,o.b.c,s,!0)}return 1}w(o.b),w(n.b),x(n.b.e,o),o.a.b=u.b,o.a.a=u.a,o.a.h=ne(e.e,o.a),o=o.a,n=[0,0,0,0],u=[s.d,a.d,i.d,l.d],o.g[0]=o.g[1]=o.g[2]=0,Z(o,s,a,n,0),Z(o,i,l,n,2),Y(e,o,u,n,!0),G(t).b=t.b=r.b=!0}}function J(e,t){for(var r=B(t);;){for(;r.b;)r=B(t=r);if(!t.b&&(null===(t=G(r=t))||!t.b))break;t.b=!1;var o=t.a,n=r.a;if(s=o.b.a!==n.b.a)e:{var s,i=B(s=t),a=s.a,l=i.a,u=void 0;if(g(a.b.a,l.b.a)){if(b(a.b.a,l.b.a,a.a)<0){s=!1;break e}G(s).b=s.b=!0,u=w(a),x(l.b,u),u.d.c=s.d}else{if(0<b(l.b.a,a.b.a,l.a)){s=!1;break e}s.b=i.b=!0,u=w(l),x(a.e,l.b),u.b.d.c=s.d}s=!0}if(s&&(r.c?(C(r),m(n),n=(r=B(t)).a):t.c&&(C(t),m(o),o=(t=G(r)).a)),o.a!==n.a)if(o.b.a===n.b.a||t.c||r.c||o.b.a!==e.a&&n.b.a!==e.a)R(e,t);else if(Q(e,t))break;o.a===n.a&&o.b.a===n.b.a&&(T(n,o),C(t),m(o),t=G(r))}}function K(e,t){var r=new F,o=d(e.b);o.a.b=4e150,o.a.a=t,o.b.a.b=-4e150,o.b.a.a=t,e.a=o.b.a,r.a=o,r.f=0,r.d=!1,r.c=!1,r.h=!0,r.b=!1,o=p(o=e.f,o.a,r),r.e=o}function $(e){this.a=new ee,this.b=e,this.c=f}function p(e,t,r){for(;null!==(t=t.c).b&&!e.c(e.b,t.b,r););return e=new ee(r,t.a,t),t.a.c=e,t.a=e}function ee(e,t,r){this.b=e||null,this.a=t||this,this.c=r||this}function r(){this.d=0,this.p=this.b=this.q=null,this.j=[0,0,0],this.s=100130,this.n=!1,this.o=this.a=this.e=this.f=null,this.m=!1,this.c=this.r=this.i=this.k=this.l=this.h=null}function I(e,t){if(e.d!==t)for(;e.d!==t;)if(e.d<t)switch(e.d){case 0:l(e,100151),e.u(null);break;case 1:l(e,100152),e.t()}else switch(e.d){case 2:l(e,100154),e.v();break;case 1:l(e,100153),e.w()}}function l(e,t){e.p&&e.p(t,e.c)}function te(e,t){this.b=e||this,this.d=t||this,this.a=null,this.c=!1}function u(){(this.h=this).i=this.d=this.a=this.e=this.c=this.b=null,this.f=0}function re(){this.c=new D,this.a=new te,this.b=new u,this.d=new u,this.b.b=this.d,this.d.b=this.b}function D(e,t){this.e=e||this,this.f=t||this,this.d=this.c=null,this.g=[0,0,0],this.h=this.a=this.b=0}function oe(){this.c=[],this.d=null,this.a=0,this.e=!1,this.b=new ie}function ne(e,t){var r,o,n;return e.e?(2*(o=++(r=e.b).a)>r.f&&(r.f*=2,r.c=ae(r.c,r.f+1)),0===r.b?n=o:(n=r.b,r.b=r.c[r.b]),r.e[n]=t,r.c[n]=o,r.d[o]=n,r.h&&ue(r,o),n):(r=e.a++,e.c[r]=t,-(r+1))}function se(e){if(0===e.a)return le(e.b);var t=e.c[e.d[e.a-1]];if(0!==e.b.a&&g(U(e.b),t))return le(e.b);for(;--e.a,0<e.a&&null===e.c[e.d[e.a-1]];);return t}function ie(){this.d=ae([0],33),this.e=[null,null],this.c=[0,0],this.a=0,this.f=32,this.b=0,this.h=!1,this.d[1]=1}function ae(e,t){for(var r=Array(t),o=0;o<e.length;o++)r[o]=e[o];for(;o<t;o++)r[o]=0;return r}function U(e){return e.e[e.d[1]]}function le(e){var t=e.d,r=e.e,o=e.c,n=t[1],s=r[n];return 0<e.a&&(t[1]=t[e.a],o[t[1]]=1,r[n]=null,o[n]=e.b,e.b=n,0<--e.a&&N(e,1)),s}function N(e,t){for(var r=e.d,o=e.e,n=e.c,s=t,i=r[s];;){var a=s<<1,l=(a<e.a&&g(o[r[a+1]],o[r[a]])&&(a+=1),r[a]);if(a>e.a||g(o[i],o[l])){n[r[s]=i]=s;break}n[r[s]=l]=s,s=a}}function ue(e,t){for(var r=e.d,o=e.e,n=e.c,s=t,i=r[s];;){var a=s>>1,l=r[a];if(0==a||g(o[l],o[i])){n[r[s]=i]=s;break}n[r[s]=l]=s,s=a}}function F(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function B(e){return e.e.c.b}function G(e){return e.e.a.b}(t=r.prototype).x=function(){I(this,0)},t.B=function(e,t){switch(e){case 100142:return;case 100140:switch(t){case 100130:case 100131:case 100132:case 100133:case 100134:return void(this.s=t)}break;case 100141:return void(this.m=!!t);default:return void l(this,100900)}l(this,100901)},t.y=function(e){switch(e){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:l(this,100900)}return!1},t.A=function(e,t,r){this.j[0]=e,this.j[1]=t,this.j[2]=r},t.z=function(e,t){var r=t||null;switch(e){case 100100:case 100106:this.h=r;break;case 100104:case 100110:this.l=r;break;case 100101:case 100107:this.k=r;break;case 100102:case 100108:this.i=r;break;case 100103:case 100109:this.p=r;break;case 100105:case 100111:this.o=r;break;case 100112:this.r=r;break;default:l(this,100900)}},t.C=function(e,t){var r=!1,o=[0,0,0];I(this,2);for(var n=0;n<3;++n){var s=e[n];s<-1e150&&(s=-1e150,r=!0),1e150<s&&(s=1e150,r=!0),o[n]=s}r&&l(this,100155),null===(r=this.q)?x(r=d(this.b),r.b):(w(r),r=r.e),r.a.d=t,r.a.g[0]=o[0],r.a.g[1]=o[1],r.a.g[2]=o[2],r.f=1,r.b.f=-1,this.q=r},t.u=function(e){I(this,0),this.d=1,this.b=new re,this.c=e},t.t=function(){I(this,1),this.d=2,this.q=null},t.v=function(){I(this,2),this.d=1},t.w=function(){I(this,1),this.d=0;var e,t,r=this.j[0],o=this.j[1],n=this.j[2],s=!1,i=[r,o,n];if(0===r&&0===o&&0===n){for(var o=[-2e150,-2e150,-2e150],a=[2e150,2e150,2e150],n=[],l=[],r=(s=this.b.c).e;r!==s;r=r.e)for(var u=0;u<3;++u){var c=r.g[u];c<a[u]&&(a[u]=c,l[u]=r),c>o[u]&&(o[u]=c,n[u]=r)}if(o[1]-a[1]>o[r=0]-a[0]&&(r=1),a[r=o[2]-a[2]>o[r]-a[r]?2:r]>=o[r])i[0]=0,i[1]=0,i[2]=1;else{for(a=l[r],n=n[r],l=[o=0,0,0],a=[a.g[0]-n.g[0],a.g[1]-n.g[1],a.g[2]-n.g[2]],u=[0,0,0],r=s.e;r!==s;r=r.e)u[0]=r.g[0]-n.g[0],u[1]=r.g[1]-n.g[1],u[2]=r.g[2]-n.g[2],l[0]=a[1]*u[2]-a[2]*u[1],l[1]=a[2]*u[0]-a[0]*u[2],l[2]=a[0]*u[1]-a[1]*u[0],o<(c=l[0]*l[0]+l[1]*l[1]+l[2]*l[2])&&(o=c,i[0]=l[0],i[1]=l[1],i[2]=l[2]);o<=0&&(i[0]=i[1]=i[2]=0,i[W(a)]=1)}s=!0}for(l=W(i),r=this.b.c,o=(l+1)%3,n=(l+2)%3,l=0<i[l]?1:-1,i=r.e;i!==r;i=i.e)i.b=i.g[o],i.a=l*i.g[n];if(s){for(i=0,r=(s=this.b.a).b;r!==s;r=r.b)if(!((o=r.a).f<=0))for(;i+=(o.a.b-o.b.a.b)*(o.a.a+o.b.a.a),(o=o.e)!==r.a;);if(i<0)for(s=(i=this.b.c).e;s!==i;s=s.e)s.a=-s.a}for(this.n=!1,i=this.b.b,r=i.h;r!==i;r=s)s=r.h,o=r.e,y(r.a,r.b.a)&&r.e.e!==r&&(A(this,o,r),m(r),o=(r=o).e),o.e===r&&(o!==r&&(o!==s&&o!==s.b||(s=s.h),m(o)),r!==s&&r!==s.b||(s=s.h),m(r));for(this.e=i=new oe,s=this.b.c,r=s.e;r!==s;r=r.e)r.h=ne(i,r);var d=i;d.d=[];for(var f=0;f<d.a;f++)d.d[f]=f;d.d.sort(function(r){return function(e,t){return g(r[e],r[t])?1:-1}}(d.c)),d.e=!0;for(var h=d.b,p=h.a;1<=p;--p)N(h,p);for(h.h=!0,this.f=new $(this),K(this,-4e150),K(this,4e150);null!==(i=se(this.e));){for(;;){e:if(0===(r=this.e).a)s=U(r.b);else if(s=r.c[r.d[r.a-1]],0!==r.b.a&&g(r=U(r.b),s)){s=r;break e}if(null===s||!y(s,i))break;s=se(this.e),A(this,i.c,s.c)}!function e(t,r){for(var o,n=(t.a=r).c;null===n.i;)if((n=n.c)===r.c){var n=t,s=r;(c=new F).a=s.c.b;for(var i=(a=n.f).a;null!==(i=i.a).b&&!a.c(a.b,c,i.b););var a,l,u=B(a=i.b),c=a.a,i=u.a;return void(0===b(c.b.a,s,c.a)?y((c=a.a).a,s)||y(c.b.a,s)||(w(c.b),a.c&&(m(c.c),a.c=!1),x(s.c,c),e(n,s)):(l=g(i.b.a,c.b.a)?a:u,u=void 0,a.d||l.c?(u=l===a?S(s.c.b,c.e):S(i.b.c.b,s.c).b,l.c?O(l,u):((a=q(c=n,a,u)).f=G(a).f+a.a.f,a.d=X(c,a.f)),e(n,s)):P(n,a,s.c,s.c,null,!0)))}a=(c=B(n=k(n.i))).a,(c=L(t,c,null)).c===a?(c=(a=c).c,i=B(n),u=n.a,l=i.a,o=!1,u.b.a!==l.b.a&&Q(t,n),y(u.a,t.a)&&(x(c.b.e,u),c=B(n=k(n)).a,L(t,B(n),i),o=!0),y(l.a,t.a)&&(x(a,l.b.e),a=L(t,i,null),o=!0),o?P(t,n,a.c,c,c,!0):(s=g(l.a,u.a)?l.b.e:u,P(t,n,s=S(a.c.b,s),s.c,s.c,!1),s.b.i.c=!0,J(t,n))):P(t,n,c.c,a,a,!0)}(this,i)}for(this.a=this.f.a.a.b.a.a,i=0;null!==(s=this.f.a.a.b);)s.h||++i,C(s);for(this.f=null,(i=this.e).b=null,i.d=null,this.e=i.c=null,i=this.b,r=i.a.b;r!==i.a;r=s)s=r.b,(r=r.a).e.e===r&&(T(r.c,r),m(r));if(!this.n){if(i=this.b,this.m)for(r=i.b.h;r!==i.b;r=s)s=r.h,r.b.d.c!==r.d.c?r.f=r.d.c?1:-1:m(r);else for(r=i.a.b;r!==i.a;r=s)if(s=r.b,r.c){for(r=r.a;g(r.b.a,r.a);r=r.c.b);for(;g(r.a,r.b.a);r=r.e);for(o=r.c.b,n=void 0;r.e!==o;)if(g(r.b.a,o.a)){for(;o.e!==r&&(g((t=o.e).b.a,t.a)||b(o.a,o.b.a,o.e.b.a)<=0);)o=(n=S(o.e,o)).b;o=o.c.b}else{for(;o.e!==r&&(g((e=r.c.b).a,e.b.a)||0<=b(r.b.a,r.a,r.c.b.a));)r=(n=S(r,r.c.b)).b;r=r.e}for(;o.e.e!==r;)n=S(o.e,o),o=n.b}if(this.h||this.i||this.k||this.l)if(this.m){for(s=(i=this.b).a.b;s!==i.a;s=s.b)if(s.c){for(this.h&&this.h(2,this.c),r=s.a;this.k&&this.k(r.a.d,this.c),(r=r.e)!==s.a;);this.i&&this.i(this.c)}}else{for(i=this.b,s=!!this.l,r=!1,o=-1,n=i.a.d;n!==i.a;n=n.d)if(n.c)for(r||(this.h&&this.h(4,this.c),r=!0),l=n.a;s&&(a=l.b.d.c?0:1,o!==a&&(o=a,this.l&&this.l(!!o,this.c))),this.k&&this.k(l.a.d,this.c),(l=l.e)!==n.a;);r&&this.i&&this.i(this.c)}if(this.r){for(i=this.b,r=i.a.b;r!==i.a;r=s)if(s=r.b,!r.c){for(n=(o=r.a).e,l=void 0;n=(l=n).e,(l.d=null)===l.b.d&&(l.c===l?E(l.a,null):(l.a.c=l.c,M(l,l.b.e)),(a=l.b).c===a?E(a.a,null):(a.a.c=a.c,M(a,a.b.e)),H(l)),l!==o;);o=r.d,((r=r.b).d=o).b=r}return this.r(this.b),void(this.c=this.b=null)}}this.b=this.c=null},this.libtess={GluTesselator:r,windingRule:{GLU_TESS_WINDING_ODD:100130,GLU_TESS_WINDING_NONZERO:100131,GLU_TESS_WINDING_POSITIVE:100132,GLU_TESS_WINDING_NEGATIVE:100133,GLU_TESS_WINDING_ABS_GEQ_TWO:100134},primitiveType:{GL_LINE_LOOP:2,GL_TRIANGLES:4,GL_TRIANGLE_STRIP:5,GL_TRIANGLE_FAN:6},errorType:{GLU_TESS_MISSING_BEGIN_POLYGON:100151,GLU_TESS_MISSING_END_POLYGON:100153,GLU_TESS_MISSING_BEGIN_CONTOUR:100152,GLU_TESS_MISSING_END_CONTOUR:100154,GLU_TESS_COORD_TOO_LARGE:100155,GLU_TESS_NEED_COMBINE_CALLBACK:100156},gluEnum:{GLU_TESS_MESH:100112,GLU_TESS_TOLERANCE:100142,GLU_TESS_WINDING_RULE:100140,GLU_TESS_BOUNDARY_ONLY:100141,GLU_INVALID_ENUM:100900,GLU_INVALID_VALUE:100901,GLU_TESS_BEGIN:100100,GLU_TESS_VERTEX:100101,GLU_TESS_END:100102,GLU_TESS_ERROR:100103,GLU_TESS_EDGE_FLAG:100104,GLU_TESS_COMBINE:100105,GLU_TESS_BEGIN_DATA:100106,GLU_TESS_VERTEX_DATA:100107,GLU_TESS_END_DATA:100108,GLU_TESS_ERROR_DATA:100109,GLU_TESS_EDGE_FLAG_DATA:100110,GLU_TESS_COMBINE_DATA:100111}},r.prototype.gluDeleteTess=r.prototype.x,r.prototype.gluTessProperty=r.prototype.B,r.prototype.gluGetTessProperty=r.prototype.y,r.prototype.gluTessNormal=r.prototype.A,r.prototype.gluTessCallback=r.prototype.z,r.prototype.gluTessVertex=r.prototype.C,r.prototype.gluTessBeginPolygon=r.prototype.u,r.prototype.gluTessBeginContour=r.prototype.t,r.prototype.gluTessEndContour=r.prototype.v,r.prototype.gluTessEndPolygon=r.prototype.w,void 0!==e&&(e.exports=this.libtess)},{}],240:[function(e,t,r){"use strict";function o(g,e,t,r){var v=0,o=void 0===(r=void 0===r?{}:r).loop?null:r.loop,b=void 0===r.palette?null:r.palette;if(e<=0||t<=0||65535<e||65535<t)throw new Error("Width/Height invalid.");function j(e){e=e.length;if(e<2||256<e||e&e-1)throw new Error("Invalid code/color length, must be power of 2 and 2 .. 256.");return e}g[v++]=71,g[v++]=73,g[v++]=70,g[v++]=56,g[v++]=57,g[v++]=97;var n=0,s=0;if(null!==b){for(var i=j(b);i>>=1;)++n;if(i=1<<n,--n,void 0!==r.background){if(i<=(s=r.background))throw new Error("Background index out of range.");if(0===s)throw new Error("Background index explicitly passed as 0.")}}if(g[v++]=255&e,g[v++]=e>>8&255,g[v++]=255&t,g[v++]=t>>8&255,g[v++]=(null!==b?128:0)|n,g[v++]=s,g[v++]=0,null!==b)for(var a=0,l=b.length;a<l;++a){var u=b[a];g[v++]=u>>16&255,g[v++]=u>>8&255,g[v++]=255&u}if(null!==o){if(o<0||65535<o)throw new Error("Loop count invalid.");g[v++]=33,g[v++]=255,g[v++]=11,g[v++]=78,g[v++]=69,g[v++]=84,g[v++]=83,g[v++]=67,g[v++]=65,g[v++]=80,g[v++]=69,g[v++]=50,g[v++]=46,g[v++]=48,g[v++]=3,g[v++]=1,g[v++]=255&o,g[v++]=o>>8&255,g[v++]=0}var _=!1;this.addFrame=function(e,t,r,o,n,s){if(!0===_&&(--v,_=!1),s=void 0===s?{}:s,e<0||t<0||65535<e||65535<t)throw new Error("x/y invalid.");if(r<=0||o<=0||65535<r||65535<o)throw new Error("Width/Height invalid.");if(n.length<r*o)throw new Error("Not enough pixels for the frame size.");var i=!0,a=s.palette;if(null==a&&(i=!1,a=b),null==a)throw new Error("Must supply either a local or global palette.");for(var l=j(a),u=0;l>>=1;)++u;var l=1<<u,c=void 0===s.delay?0:s.delay,d=void 0===s.disposal?0:s.disposal;if(d<0||3<d)throw new Error("Disposal out of range.");var f=!1,h=0;if(void 0!==s.transparent&&null!==s.transparent&&(f=!0,(h=s.transparent)<0||l<=h))throw new Error("Transparent color index.");if(0===d&&!f&&0===c||(g[v++]=33,g[v++]=249,g[v++]=4,g[v++]=d<<2|(!0===f?1:0),g[v++]=255&c,g[v++]=c>>8&255,g[v++]=h,g[v++]=0),g[v++]=44,g[v++]=255&e,g[v++]=e>>8&255,g[v++]=255&t,g[v++]=t>>8&255,g[v++]=255&r,g[v++]=r>>8&255,g[v++]=255&o,g[v++]=o>>8&255,g[v++]=!0===i?128|u-1:0,!0===i)for(var p=0,m=a.length;p<m;++p){var y=a[p];g[v++]=y>>16&255,g[v++]=y>>8&255,g[v++]=255&y}return v=function(t,r,e,o){t[r++]=e;var n=r++,s=1<<e,i=s-1,a=1+s,l=1+a,u=e+1,c=0,d=0;function f(e){for(;e<=c;)t[r++]=255&d,d>>=8,c-=8,r===n+256&&(t[n]=255,n=r++)}function h(e){d|=e<<c,c+=u,f(8)}var p=o[0]&i,m={};h(s);for(var y=1,g=o.length;y<g;++y){var v=o[y]&i,b=p<<8|v,j=m[b];if(void 0===j){for(d|=p<<c,c+=u;8<=c;)t[r++]=255&d,d>>=8,c-=8,r===n+256&&(t[n]=255,n=r++);4096===l?(h(s),l=1+a,u=e+1,m={}):(1<<u<=l&&++u,m[b]=l++),p=v}else p=j}h(p),h(a),f(1),n+1===r?t[n]=0:(t[n]=r-n-1,t[r++]=0);return r}(g,v,u<2?2:u,n)},this.end=function(){return!1===_&&(g[v++]=59,_=!0),v},this.getOutputBuffer=function(){return g},this.setOutputBuffer=function(e){g=e},this.getOutputBufferPosition=function(){return v},this.setOutputBufferPosition=function(e){v=e}}function E(e,t,r,o){for(var n=e[t++],s=1<<n,i=1+s,a=1+i,l=n+1,u=(1<<l)-1,c=0,d=0,f=0,h=e[t++],p=new Int32Array(4096),m=null;;){for(;c<16&&0!==h;)d|=e[t++]<<c,c+=8,1===h?h=e[t++]:--h;if(c<l)break;var y=d&u;if(d>>=l,c-=l,y==s)a=1+i,u=(1<<(l=n+1))-1,m=null;else{if(y==i)break;for(var g=y<a?y:m,v=0,b=g;s<b;)b=p[b]>>8,++v;var j=b;if(o<f+v+(g!==y?1:0))return void console.log("Warning, gif stream longer than expected.");r[f++]=j;var _=f+=v;for(g!==y&&(r[f++]=j),b=g;v--;)b=p[b],r[--_]=255&b,b>>=8;null!==m&&a<4096&&(p[a++]=m<<8|j,u+1<=a&&l<12&&(++l,u=u<<1|1)),m=y}}f!==o&&console.log("Warning, gif stream shorter than expected.")}try{r.GifWriter=o,r.GifReader=function(b){var e=0;if(71!==b[e++]||73!==b[e++]||70!==b[e++]||56!==b[e++]||56!=(b[e++]+1&253)||97!==b[e++])throw new Error("Invalid GIF 87a/89a header.");var j=b[e++]|b[e++]<<8,t=b[e++]|b[e++]<<8,r=b[e++],o=1<<1+(7&r),n=(b[e++],b[e++],null),s=null,i=(r>>7&&(n=e,e+=3*(s=o)),!0),a=[],l=0,u=null,c=0,d=null;for(this.width=j,this.height=t;i&&e<b.length;)switch(b[e++]){case 33:switch(b[e++]){case 255:if(11!==b[e]||78==b[e+1]&&69==b[e+2]&&84==b[e+3]&&83==b[e+4]&&67==b[e+5]&&65==b[e+6]&&80==b[e+7]&&69==b[e+8]&&50==b[e+9]&&46==b[e+10]&&48==b[e+11]&&3==b[e+12]&&1==b[e+13]&&0==b[e+16])e+=14,d=b[e++]|b[e++]<<8,e++;else for(e+=12;;){if(!(0<=(h=b[e++])))throw Error("Invalid block size");if(0===h)break;e+=h}break;case 249:if(4!==b[e++]||0!==b[e+4])throw new Error("Invalid graphics extension block.");var f=b[e++],l=b[e++]|b[e++]<<8,u=b[e++];0==(1&f)&&(u=null),c=f>>2&7,e++;break;case 254:for(;;){if(!(0<=(h=b[e++])))throw Error("Invalid block size");if(0===h)break;e+=h}break;default:throw new Error("Unknown graphic control label: 0x"+b[e-1].toString(16))}break;case 44:var h,p=b[e++]|b[e++]<<8,m=b[e++]|b[e++]<<8,y=b[e++]|b[e++]<<8,g=b[e++]|b[e++]<<8,v=b[e++],_=v>>6&1,x=1<<1+(7&v),w=n,S=s,M=!1,v=(v>>7&&(M=!0,w=e,e+=3*(S=x)),e);for(e++;;){if(!(0<=(h=b[e++])))throw Error("Invalid block size");if(0===h)break;e+=h}a.push({x:p,y:m,width:y,height:g,has_local_palette:M,palette_offset:w,palette_size:S,data_offset:v,data_length:e-v,transparent_index:u,interlaced:!!_,delay:l,disposal:c});break;case 59:i=!1;break;default:throw new Error("Unknown gif block: 0x"+b[e-1].toString(16))}this.numFrames=function(){return a.length},this.loopCount=function(){return d},this.frameInfo=function(e){if(e<0||e>=a.length)throw new Error("Frame index out of range.");return a[e]},this.decodeAndBlitFrameBGRA=function(e,t){for(var e=this.frameInfo(e),r=e.width*e.height,o=new Uint8Array(r),n=(E(b,e.data_offset,o,r),e.palette_offset),s=e.transparent_index,i=(null===s&&(s=256),e.width),a=j-i,l=i,u=4*(e.y*j+e.x),c=4*((e.y+e.height)*j+e.x),d=u,f=4*a,h=(!0===e.interlaced&&(f+=4*j*7),8),p=0,m=o.length;p<m;++p){var y,g,v=o[p];0===l&&(l=i,c<=(d+=f)&&(f=4*a+4*j*(h-1),d=u+(i+a)*(h<<1),h>>=1)),v===s?d+=4:(y=b[n+3*v],g=b[n+3*v+1],v=b[n+3*v+2],t[d++]=v,t[d++]=g,t[d++]=y,t[d++]=255),--l}},this.decodeAndBlitFrameRGBA=function(e,t){for(var e=this.frameInfo(e),r=e.width*e.height,o=new Uint8Array(r),n=(E(b,e.data_offset,o,r),e.palette_offset),s=e.transparent_index,i=(null===s&&(s=256),e.width),a=j-i,l=i,u=4*(e.y*j+e.x),c=4*((e.y+e.height)*j+e.x),d=u,f=4*a,h=(!0===e.interlaced&&(f+=4*j*7),8),p=0,m=o.length;p<m;++p){var y,g,v=o[p];0===l&&(l=i,c<=(d+=f)&&(f=4*a+4*j*(h-1),d=u+(i+a)*(h<<1),h>>=1)),v===s?d+=4:(y=b[n+3*v],g=b[n+3*v+1],v=b[n+3*v+2],t[d++]=y,t[d++]=g,t[d++]=v,t[d++]=255),--l}}}}catch(e){}},{}],241:[function(Pr,r,o){!function(Lr){var e,t;e=this,t=function(j){"use strict";function D(e){if(null==this)throw TypeError();var t,r=String(this),o=r.length,e=e?Number(e):0;if(!((e=e!=e?0:e)<0||o<=e))return 55296<=(t=r.charCodeAt(e))&&t<=56319&&e+1<o&&56320<=(o=r.charCodeAt(e+1))&&o<=57343?1024*(t-55296)+o-56320+65536:t}String.prototype.codePointAt||((U=function(){try{var e={},t=Object.defineProperty,r=t(e,e,e)&&t}catch(e){}return r}())?U(String.prototype,"codePointAt",{value:D,configurable:!0,writable:!0}):String.prototype.codePointAt=D);var U,N=0,F=-3;function B(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function G(e,t){this.source=e,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=t,this.destLen=0,this.ltree=new B,this.dtree=new B}var V=new B,z=new B,H=new Uint8Array(30),W=new Uint16Array(30),q=new Uint8Array(30),X=new Uint16Array(30),Y=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Z=new B,v=new Uint8Array(320);function Q(e,t,r,o){for(var n,s=0;s<r;++s)e[s]=0;for(s=0;s<30-r;++s)e[s+r]=s/r|0;for(n=o,s=0;s<30;++s)t[s]=n,n+=1<<e[s]}var J=new Uint16Array(16);function K(e,t,r,o){for(var n,s=0;s<16;++s)e.table[s]=0;for(s=0;s<o;++s)e.table[t[r+s]]++;for(s=n=e.table[0]=0;s<16;++s)J[s]=n,n+=e.table[s];for(s=0;s<o;++s)t[r+s]&&(e.trans[J[t[r+s]]++]=s)}function b(e,t,r){if(!t)return r;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var o=e.tag&65535>>>16-t;return e.tag>>>=t,e.bitcount-=t,o+r}function $(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;for(var r=0,o=0,n=0,s=e.tag;o=2*o+(1&s),s>>>=1,r+=t.table[++n],0<=(o-=t.table[n]););return e.tag=s,e.bitcount-=n,t.trans[r+o]}function ee(e,t,r){for(;;){var o=$(e,t);if(256===o)return N;if(o<256)e.dest[e.destLen++]=o;else for(var n,s=b(e,H[o-=257],W[o]),o=$(e,r),i=n=e.destLen-b(e,q[o],X[o]);i<n+s;++i)e.dest[e.destLen++]=e.dest[i]}}for(var e=V,te=z,t=0;t<7;++t)e.table[t]=0;for(e.table[7]=24,e.table[8]=152,e.table[9]=112,t=0;t<24;++t)e.trans[t]=256+t;for(t=0;t<144;++t)e.trans[24+t]=t;for(t=0;t<8;++t)e.trans[168+t]=280+t;for(t=0;t<112;++t)e.trans[176+t]=144+t;for(t=0;t<5;++t)te.table[t]=0;for(te.table[5]=32,t=0;t<32;++t)te.trans[t]=t;Q(H,W,4,3),Q(q,X,2,1),H[28]=0,W[28]=258;var re=function(e,t){var r,o,n,s=new G(e,t);do{switch(n=void 0,(o=s).bitcount--||(o.tag=o.source[o.sourceIndex++],o.bitcount=7),n=1&o.tag,o.tag>>>=1,o=n,b(s,2,0)){case 0:r=function(e){for(var t,r;8<e.bitcount;)e.sourceIndex--,e.bitcount-=8;if((t=256*e.source[e.sourceIndex+1]+e.source[e.sourceIndex])!==(65535&~(256*e.source[e.sourceIndex+3]+e.source[e.sourceIndex+2])))return F;for(e.sourceIndex+=4,r=t;r;--r)e.dest[e.destLen++]=e.source[e.sourceIndex++];return e.bitcount=0,N}(s);break;case 1:r=ee(s,V,z);break;case 2:y=m=p=g=i=h=f=d=c=u=l=a=void 0;for(var i,a=s,l=s.ltree,u=s.dtree,c=b(a,5,257),d=b(a,5,1),f=b(a,4,4),h=0;h<19;++h)v[h]=0;for(h=0;h<f;++h){var p=b(a,3,0);v[Y[h]]=p}for(K(Z,v,0,19),i=0;i<c+d;){var m=$(a,Z);switch(m){case 16:for(var y=v[i-1],g=b(a,2,3);g;--g)v[i++]=y;break;case 17:for(g=b(a,3,3);g;--g)v[i++]=0;break;case 18:for(g=b(a,7,11);g;--g)v[i++]=0;break;default:v[i++]=m}}K(l,v,0,c),K(u,v,c,d),r=ee(s,s.ltree,s.dtree);break;default:r=F}if(r!==N)throw new Error("Data error")}while(!o);return s.destLen<s.dest.length?"function"==typeof s.dest.slice?s.dest.slice(0,s.destLen):s.dest.subarray(0,s.destLen):s.dest};function g(e,t,r,o,n){return Math.pow(1-n,3)*e+3*Math.pow(1-n,2)*n*t+3*(1-n)*Math.pow(n,2)*r+Math.pow(n,3)*o}function a(){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN}function f(){this.commands=[],this.fill="black",this.stroke=null,this.strokeWidth=1}function oe(e){throw new Error(e)}function ne(e,t){e||oe(t)}a.prototype.isEmpty=function(){return isNaN(this.x1)||isNaN(this.y1)||isNaN(this.x2)||isNaN(this.y2)},a.prototype.addPoint=function(e,t){"number"==typeof e&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=e,this.x2=e),e<this.x1&&(this.x1=e),e>this.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),t<this.y1&&(this.y1=t),t>this.y2&&(this.y2=t))},a.prototype.addX=function(e){this.addPoint(e,null)},a.prototype.addY=function(e){this.addPoint(null,e)},a.prototype.addBezier=function(e,t,r,o,n,s,i,a){var l=[e,t],u=[r,o],c=[n,s],d=[i,a];this.addPoint(e,t),this.addPoint(i,a);for(var f=0;f<=1;f++){var h,p=6*l[f]-12*u[f]+6*c[f],m=-3*l[f]+9*u[f]-9*c[f]+3*d[f],y=3*u[f]-3*l[f];0==m?0==p||0<(h=-y/p)&&h<1&&(0===f&&this.addX(g(l[f],u[f],c[f],d[f],h)),1===f&&this.addY(g(l[f],u[f],c[f],d[f],h))):(h=Math.pow(p,2)-4*y*m)<0||(0<(y=(-p+Math.sqrt(h))/(2*m))&&y<1&&(0===f&&this.addX(g(l[f],u[f],c[f],d[f],y)),1===f&&this.addY(g(l[f],u[f],c[f],d[f],y))),0<(y=(-p-Math.sqrt(h))/(2*m))&&y<1&&(0===f&&this.addX(g(l[f],u[f],c[f],d[f],y)),1===f&&this.addY(g(l[f],u[f],c[f],d[f],y))))}},a.prototype.addQuad=function(e,t,r,o,n,s){r=e+2/3*(r-e),o=t+2/3*(o-t);this.addBezier(e,t,r,o,r+1/3*(n-e),o+1/3*(s-t),n,s)},f.prototype.moveTo=function(e,t){this.commands.push({type:"M",x:e,y:t})},f.prototype.lineTo=function(e,t){this.commands.push({type:"L",x:e,y:t})},f.prototype.curveTo=f.prototype.bezierCurveTo=function(e,t,r,o,n,s){this.commands.push({type:"C",x1:e,y1:t,x2:r,y2:o,x:n,y:s})},f.prototype.quadTo=f.prototype.quadraticCurveTo=function(e,t,r,o){this.commands.push({type:"Q",x1:e,y1:t,x:r,y:o})},f.prototype.close=f.prototype.closePath=function(){this.commands.push({type:"Z"})},f.prototype.extend=function(e){var t;if(e.commands)e=e.commands;else if(e instanceof a)return t=e,this.moveTo(t.x1,t.y1),this.lineTo(t.x2,t.y1),this.lineTo(t.x2,t.y2),this.lineTo(t.x1,t.y2),void this.close();Array.prototype.push.apply(this.commands,e)},f.prototype.getBoundingBox=function(){for(var e=new a,t=0,r=0,o=0,n=0,s=0;s<this.commands.length;s++){var i=this.commands[s];switch(i.type){case"M":e.addPoint(i.x,i.y),t=o=i.x,r=n=i.y;break;case"L":e.addPoint(i.x,i.y),o=i.x,n=i.y;break;case"Q":e.addQuad(o,n,i.x1,i.y1,i.x,i.y),o=i.x,n=i.y;break;case"C":e.addBezier(o,n,i.x1,i.y1,i.x2,i.y2,i.x,i.y),o=i.x,n=i.y;break;case"Z":o=t,n=r;break;default:throw new Error("Unexpected path command "+i.type)}}return e.isEmpty()&&e.addPoint(0,0),e},f.prototype.draw=function(e){e.beginPath();for(var t=0;t<this.commands.length;t+=1){var r=this.commands[t];"M"===r.type?e.moveTo(r.x,r.y):"L"===r.type?e.lineTo(r.x,r.y):"C"===r.type?e.bezierCurveTo(r.x1,r.y1,r.x2,r.y2,r.x,r.y):"Q"===r.type?e.quadraticCurveTo(r.x1,r.y1,r.x,r.y):"Z"===r.type&&e.closePath()}this.fill&&(e.fillStyle=this.fill,e.fill()),this.stroke&&(e.strokeStyle=this.stroke,e.lineWidth=this.strokeWidth,e.stroke())},f.prototype.toPathData=function(n){function e(){for(var e=arguments,t="",r=0;r<arguments.length;r+=1){var o=e[r];0<=o&&0<r&&(t+=" "),t+=(o=o,Math.round(o)===o?""+Math.round(o):o.toFixed(n))}return t}n=void 0!==n?n:2;for(var t="",r=0;r<this.commands.length;r+=1){var o=this.commands[r];"M"===o.type?t+="M"+e(o.x,o.y):"L"===o.type?t+="L"+e(o.x,o.y):"C"===o.type?t+="C"+e(o.x1,o.y1,o.x2,o.y2,o.x,o.y):"Q"===o.type?t+="Q"+e(o.x1,o.y1,o.x,o.y):"Z"===o.type&&(t+="Z")}return t},f.prototype.toSVG=function(e){var t=(t='<path d="')+this.toPathData(e)+'"';return this.fill&&"black"!==this.fill&&(null===this.fill?t+=' fill="none"':t+=' fill="'+this.fill+'"'),this.stroke&&(t+=' stroke="'+this.stroke+'" stroke-width="'+this.strokeWidth+'"'),t+="/>"},f.prototype.toDOMElement=function(e){var e=this.toPathData(e),t=document.createElementNS("http://www.w3.org/2000/svg","path");return t.setAttribute("d",e),t};var A={fail:oe,argument:ne,assert:ne},m={},w={},l={};function r(e){return function(){return e}}w.BYTE=function(e){return A.argument(0<=e&&e<=255,"Byte value should be between 0 and 255."),[e]},l.BYTE=r(1),w.CHAR=function(e){return[e.charCodeAt(0)]},l.CHAR=r(1),w.CHARARRAY=function(e){for(var t=[],r=0;r<e.length;r+=1)t[r]=e.charCodeAt(r);return t},l.CHARARRAY=function(e){return e.length},w.USHORT=function(e){return[e>>8&255,255&e]},l.USHORT=r(2),w.SHORT=function(e){return[(e=32768<=e?-(65536-e):e)>>8&255,255&e]},l.SHORT=r(2),w.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},l.UINT24=r(3),w.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},l.ULONG=r(4),w.LONG=function(e){return[(e=2147483648<=e?-(4294967296-e):e)>>24&255,e>>16&255,e>>8&255,255&e]},l.LONG=r(4),w.FIXED=w.ULONG,l.FIXED=l.ULONG,w.FWORD=w.SHORT,l.FWORD=l.SHORT,w.UFWORD=w.USHORT,l.UFWORD=l.USHORT,w.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},l.LONGDATETIME=r(8),w.TAG=function(e){return A.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},l.TAG=r(4),w.Card8=w.BYTE,l.Card8=l.BYTE,w.Card16=w.USHORT,l.Card16=l.USHORT,w.OffSize=w.BYTE,l.OffSize=l.BYTE,w.SID=w.USHORT,l.SID=l.USHORT,w.NUMBER=function(e){return-107<=e&&e<=107?[e+139]:108<=e&&e<=1131?[247+((e-=108)>>8),255&e]:-1131<=e&&e<=-108?[251+((e=-e-108)>>8),255&e]:-32768<=e&&e<=32767?w.NUMBER16(e):w.NUMBER32(e)},l.NUMBER=function(e){return w.NUMBER(e).length},w.NUMBER16=function(e){return[28,e>>8&255,255&e]},l.NUMBER16=r(3),w.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},l.NUMBER32=r(5),w.REAL=function(e){for(var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t),o=(r&&(r=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length)),t=(Math.round(e*r)/r).toString()),""),n=0,s=t.length;n<s;n+=1){var i=t[n];o+="e"===i?"-"===t[++n]?"c":"b":"."===i?"a":"-"===i?"e":i}for(var a=[30],l=0,u=(o+=1&o.length?"f":"ff").length;l<u;l+=2)a.push(parseInt(o.substr(l,2),16));return a},l.REAL=function(e){return w.REAL(e).length},w.NAME=w.CHARARRAY,l.NAME=l.CHARARRAY,w.STRING=w.CHARARRAY,l.STRING=l.CHARARRAY,m.UTF8=function(e,t,r){for(var o=[],n=r,s=0;s<n;s++,t+=1)o[s]=e.getUint8(t);return String.fromCharCode.apply(null,o)},m.UTF16=function(e,t,r){for(var o=[],n=r/2,s=0;s<n;s++,t+=2)o[s]=e.getUint16(t);return String.fromCharCode.apply(null,o)},w.UTF16=function(e){for(var t=[],r=0;r<e.length;r+=1){var o=e.charCodeAt(r);t[t.length]=o>>8&255,t[t.length]=255&o}return t},l.UTF16=function(e){return 2*e.length};var se,ie={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"},ae=(m.MACSTRING=function(e,t,r,o){var n=ie[o];if(void 0!==n){for(var s="",i=0;i<r;i++){var a=e.getUint8(t+i);s+=a<=127?String.fromCharCode(a):n[127&a]}return s}},"function"==typeof WeakMap&&new WeakMap);function le(e){return-128<=e&&e<=127}w.MACSTRING=function(e,t){var r=function(e){if(!se)for(var t in se={},ie)se[t]=new String(t);var r=se[e];if(void 0!==r){if(ae){var o=ae.get(r);if(void 0!==o)return o}var n=ie[e];if(void 0!==n){for(var s={},i=0;i<n.length;i++)s[n.charCodeAt(i)]=i+128;return ae&&ae.set(r,s),s}}}(t);if(void 0!==r){for(var o=[],n=0;n<e.length;n++){var s=e.charCodeAt(n);if(128<=s&&void 0===(s=r[s]))return;o[n]=s}return o}},l.MACSTRING=function(e,t){e=w.MACSTRING(e,t);return void 0!==e?e.length:0},w.VARDELTAS=function(e){for(var t=0,r=[];t<e.length;)var o=e[t],t=(0===o?function(e,t,r){for(var o=0,n=e.length;t<n&&o<64&&0===e[t];)++t,++o;return r.push(128|o-1),t}:-128<=o&&o<=127?function(e,t,r){for(var o=0,n=e.length,s=t;s<n&&o<64;){var i=e[s];if(!le(i))break;if(0===i&&s+1<n&&0===e[s+1])break;++s,++o}r.push(o-1);for(var a=t;a<s;++a)r.push(e[a]+256&255);return s}:function(e,t,r){for(var o=0,n=e.length,s=t;s<n&&o<64;){var i=e[s];if(0===i)break;if(le(i)&&s+1<n&&le(e[s+1]))break;++s,++o}r.push(64|o-1);for(var a=t;a<s;++a){var l=e[a];r.push(l+65536>>8&255,l+256&255)}return s})(e,t,r);return r},w.INDEX=function(e){for(var t=1,r=[t],o=[],n=0;n<e.length;n+=1){var s=w.OBJECT(e[n]);Array.prototype.push.apply(o,s),t+=s.length,r.push(t)}if(0===o.length)return[0,0];for(var i=[],a=1+Math.floor(Math.log(t)/Math.log(2))/8|0,l=[void 0,w.BYTE,w.USHORT,w.UINT24,w.ULONG][a],u=0;u<r.length;u+=1){var c=l(r[u]);Array.prototype.push.apply(i,c)}return Array.prototype.concat(w.Card16(e.length),w.OffSize(a),i,o)},l.INDEX=function(e){return w.INDEX(e).length},w.DICT=function(e){for(var t=[],r=Object.keys(e),o=r.length,n=0;n<o;n+=1){var s=parseInt(r[n],0),i=e[s];t=(t=t.concat(w.OPERAND(i.value,i.type))).concat(w.OPERATOR(s))}return t},l.DICT=function(e){return w.DICT(e).length},w.OPERATOR=function(e){return e<1200?[e]:[12,e-1200]},w.OPERAND=function(e,t){var r=[];if(Array.isArray(t))for(var o=0;o<t.length;o+=1)A.argument(e.length===t.length,"Not enough arguments given for type"+t),r=r.concat(w.OPERAND(e[o],t[o]));else if("SID"===t)r=r.concat(w.NUMBER(e));else if("offset"===t)r=r.concat(w.NUMBER32(e));else if("number"===t)r=r.concat(w.NUMBER(e));else{if("real"!==t)throw new Error("Unknown operand type "+t);r=r.concat(w.REAL(e))}return r},w.OP=w.BYTE,l.OP=l.BYTE;var ue="function"==typeof WeakMap&&new WeakMap;function n(e,t,r){for(var o=0;o<t.length;o+=1){var n=t[o];this[n.name]=n.value}if(this.tableName=e,this.fields=t,r)for(var s=Object.keys(r),i=0;i<s.length;i+=1){var a=s[i],l=r[a];void 0!==this[a]&&(this[a]=l)}}function ce(e,t,r){void 0===r&&(r=t.length);var o=new Array(t.length+1);o[0]={name:e+"Count",type:"USHORT",value:r};for(var n=0;n<t.length;n++)o[n+1]={name:e+n,type:"USHORT",value:t[n]};return o}function de(e,t,r){var o=t.length,n=new Array(o+1);n[0]={name:e+"Count",type:"USHORT",value:o};for(var s=0;s<o;s++)n[s+1]={name:e+s,type:"TABLE",value:r(t[s],s)};return n}function fe(e,t,r){var o=t.length,n=[];n[0]={name:e+"Count",type:"USHORT",value:o};for(var s=0;s<o;s++)n=n.concat(r(t[s],s));return n}function he(e){1===e.format?n.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:1}].concat(ce("glyph",e.glyphs))):A.assert(!1,"Can't create coverage table format 2 yet.")}function pe(e){n.call(this,"scriptListTable",fe("scriptRecord",e,function(e,t){var r=e.script,o=r.defaultLangSys;return A.assert(!!o,"Unable to write GSUB: script "+e.tag+" has no default language system."),[{name:"scriptTag"+t,type:"TAG",value:e.tag},{name:"script"+t,type:"TABLE",value:new n("scriptTable",[{name:"defaultLangSys",type:"TABLE",value:new n("defaultLangSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:o.reqFeatureIndex}].concat(ce("featureIndex",o.featureIndexes)))}].concat(fe("langSys",r.langSysRecords,function(e,t){var r=e.langSys;return[{name:"langSysTag"+t,type:"TAG",value:e.tag},{name:"langSys"+t,type:"TABLE",value:new n("langSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:r.reqFeatureIndex}].concat(ce("featureIndex",r.featureIndexes)))}]})))}]}))}function me(e){n.call(this,"featureListTable",fe("featureRecord",e,function(e,t){var r=e.feature;return[{name:"featureTag"+t,type:"TAG",value:e.tag},{name:"feature"+t,type:"TABLE",value:new n("featureTable",[{name:"featureParams",type:"USHORT",value:r.featureParams}].concat(ce("lookupListIndex",r.lookupListIndexes)))}]}))}function ye(e,r){n.call(this,"lookupListTable",de("lookup",e,function(e){var t=r[e.lookupType];return A.assert(!!t,"Unable to write GSUB lookup type "+e.lookupType+" tables."),new n("lookupTable",[{name:"lookupType",type:"USHORT",value:e.lookupType},{name:"lookupFlag",type:"USHORT",value:e.lookupFlag}].concat(de("subtable",e.subtables,t)))}))}w.CHARSTRING=function(e){if(ue){var t=ue.get(e);if(void 0!==t)return t}for(var r=[],o=e.length,n=0;n<o;n+=1)var s=e[n],r=r.concat(w[s.type](s.value));return ue&&ue.set(e,r),r},l.CHARSTRING=function(e){return w.CHARSTRING(e).length},w.OBJECT=function(e){var t=w[e.type];return A.argument(void 0!==t,"No encoding function for type "+e.type),t(e.value)},l.OBJECT=function(e){var t=l[e.type];return A.argument(void 0!==t,"No sizeOf function for type "+e.type),t(e.value)},w.TABLE=function(e){for(var t=[],r=e.fields.length,o=[],n=[],s=0;s<r;s+=1){var i=e.fields[s],a=w[i.type],l=(A.argument(void 0!==a,"No encoding function for field type "+i.type+" ("+i.name+")"),e[i.name]),a=a(l=void 0===l?i.value:l);"TABLE"===i.type?(n.push(t.length),t=t.concat([0,0]),o.push(a)):t=t.concat(a)}for(var u=0;u<o.length;u+=1){var c=n[u],d=t.length;A.argument(d<65536,"Table "+e.tableName+" too big."),t[c]=d>>8,t[c+1]=255&d,t=t.concat(o[u])}return t},l.TABLE=function(e){for(var t=0,r=e.fields.length,o=0;o<r;o+=1){var n=e.fields[o],s=l[n.type],i=(A.argument(void 0!==s,"No sizeOf function for field type "+n.type+" ("+n.name+")"),e[n.name]);t+=s(i=void 0===i?n.value:i),"TABLE"===n.type&&(t+=2)}return t},w.RECORD=w.TABLE,l.RECORD=l.TABLE,w.LITERAL=function(e){return e},l.LITERAL=function(e){return e.length},n.prototype.encode=function(){return w.TABLE(this)},n.prototype.sizeOf=function(){return l.TABLE(this)};var S={Table:n,Record:n,Coverage:(he.prototype=Object.create(n.prototype)).constructor=he,ScriptList:(pe.prototype=Object.create(n.prototype)).constructor=pe,FeatureList:(me.prototype=Object.create(n.prototype)).constructor=me,LookupList:(ye.prototype=Object.create(n.prototype)).constructor=ye,ushortList:ce,tableList:de,recordList:fe};function ge(e,t){return e.getUint8(t)}function ve(e,t){return e.getUint16(t,!1)}function be(e,t){return e.getUint32(t,!1)}function je(e,t){return e.getInt16(t,!1)+e.getUint16(t+2,!1)/65535}var _e={byte:1,uShort:2,short:2,uLong:4,fixed:4,longDateTime:8,tag:4};function u(e,t){this.data=e,this.offset=t,this.relativeOffset=0}u.prototype.parseByte=function(){var e=this.data.getUint8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},u.prototype.parseChar=function(){var e=this.data.getInt8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},u.prototype.parseCard8=u.prototype.parseByte,u.prototype.parseCard16=u.prototype.parseUShort=function(){var e=this.data.getUint16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},u.prototype.parseSID=u.prototype.parseUShort,u.prototype.parseOffset16=u.prototype.parseUShort,u.prototype.parseShort=function(){var e=this.data.getInt16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},u.prototype.parseF2Dot14=function(){var e=this.data.getInt16(this.offset+this.relativeOffset)/16384;return this.relativeOffset+=2,e},u.prototype.parseOffset32=u.prototype.parseULong=function(){var e=be(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},u.prototype.parseFixed=function(){var e=je(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},u.prototype.parseString=function(e){var t=this.data,r=this.offset+this.relativeOffset,o="";this.relativeOffset+=e;for(var n=0;n<e;n++)o+=String.fromCharCode(t.getUint8(r+n));return o},u.prototype.parseTag=function(){return this.parseString(4)},u.prototype.parseLongDateTime=function(){var e=be(this.data,this.offset+this.relativeOffset+4);return e-=2082844800,this.relativeOffset+=8,e},u.prototype.parseVersion=function(e){var t=ve(this.data,this.offset+this.relativeOffset),r=ve(this.data,this.offset+this.relativeOffset+2);return this.relativeOffset+=4,t+r/(e=void 0===e?4096:e)/10},u.prototype.skip=function(e,t){this.relativeOffset+=_e[e]*(t=void 0===t?1:t)},u.prototype.parseULongList=function(e){void 0===e&&(e=this.parseULong());for(var t=new Array(e),r=this.data,o=this.offset+this.relativeOffset,n=0;n<e;n++)t[n]=r.getUint32(o),o+=4;return this.relativeOffset+=4*e,t},u.prototype.parseOffset16List=u.prototype.parseUShortList=function(e){void 0===e&&(e=this.parseUShort());for(var t=new Array(e),r=this.data,o=this.offset+this.relativeOffset,n=0;n<e;n++)t[n]=r.getUint16(o),o+=2;return this.relativeOffset+=2*e,t},u.prototype.parseShortList=function(e){for(var t=new Array(e),r=this.data,o=this.offset+this.relativeOffset,n=0;n<e;n++)t[n]=r.getInt16(o),o+=2;return this.relativeOffset+=2*e,t},u.prototype.parseByteList=function(e){for(var t=new Array(e),r=this.data,o=this.offset+this.relativeOffset,n=0;n<e;n++)t[n]=r.getUint8(o++);return this.relativeOffset+=e,t},u.prototype.parseList=function(e,t){t||(t=e,e=this.parseUShort());for(var r=new Array(e),o=0;o<e;o++)r[o]=t.call(this);return r},u.prototype.parseList32=function(e,t){t||(t=e,e=this.parseULong());for(var r=new Array(e),o=0;o<e;o++)r[o]=t.call(this);return r},u.prototype.parseRecordList=function(e,t){t||(t=e,e=this.parseUShort());for(var r=new Array(e),o=Object.keys(t),n=0;n<e;n++){for(var s={},i=0;i<o.length;i++){var a=o[i],l=t[a];s[a]=l.call(this)}r[n]=s}return r},u.prototype.parseRecordList32=function(e,t){t||(t=e,e=this.parseULong());for(var r=new Array(e),o=Object.keys(t),n=0;n<e;n++){for(var s={},i=0;i<o.length;i++){var a=o[i],l=t[a];s[a]=l.call(this)}r[n]=s}return r},u.prototype.parseStruct=function(e){if("function"==typeof e)return e.call(this);for(var t=Object.keys(e),r={},o=0;o<t.length;o++){var n=t[o],s=e[n];r[n]=s.call(this)}return r},u.prototype.parseValueRecord=function(e){var t;if(0!==(e=void 0===e?this.parseUShort():e))return t={},1&e&&(t.xPlacement=this.parseShort()),2&e&&(t.yPlacement=this.parseShort()),4&e&&(t.xAdvance=this.parseShort()),8&e&&(t.yAdvance=this.parseShort()),16&e&&(t.xPlaDevice=void 0,this.parseShort()),32&e&&(t.yPlaDevice=void 0,this.parseShort()),64&e&&(t.xAdvDevice=void 0,this.parseShort()),128&e&&(t.yAdvDevice=void 0,this.parseShort()),t},u.prototype.parseValueRecordList=function(){for(var e=this.parseUShort(),t=this.parseUShort(),r=new Array(t),o=0;o<t;o++)r[o]=this.parseValueRecord(e);return r},u.prototype.parsePointer=function(e){var t=this.parseOffset16();if(0<t)return new u(this.data,this.offset+t).parseStruct(e)},u.prototype.parsePointer32=function(e){var t=this.parseOffset32();if(0<t)return new u(this.data,this.offset+t).parseStruct(e)},u.prototype.parseListOfLists=function(e){for(var t=this.parseOffset16List(),r=t.length,o=this.relativeOffset,n=new Array(r),s=0;s<r;s++){var i=t[s];if(0===i)n[s]=void 0;else if(this.relativeOffset=i,e){for(var a=this.parseOffset16List(),l=new Array(a.length),u=0;u<a.length;u++)this.relativeOffset=i+a[u],l[u]=e.call(this);n[s]=l}else n[s]=this.parseUShortList()}return this.relativeOffset=o,n},u.prototype.parseCoverage=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort(),r=this.parseUShort();if(1===t)return{format:1,glyphs:this.parseUShortList(r)};if(2!==t)throw new Error("0x"+e.toString(16)+": Coverage format must be 1 or 2.");for(var o=new Array(r),n=0;n<r;n++)o[n]={start:this.parseUShort(),end:this.parseUShort(),index:this.parseUShort()};return{format:2,ranges:o}},u.prototype.parseClassDef=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(1===t)return{format:1,startGlyph:this.parseUShort(),classes:this.parseUShortList()};if(2===t)return{format:2,ranges:this.parseRecordList({start:u.uShort,end:u.uShort,classId:u.uShort})};throw new Error("0x"+e.toString(16)+": ClassDef format must be 1 or 2.")},u.list=function(e,t){return function(){return this.parseList(e,t)}},u.list32=function(e,t){return function(){return this.parseList32(e,t)}},u.recordList=function(e,t){return function(){return this.parseRecordList(e,t)}},u.recordList32=function(e,t){return function(){return this.parseRecordList32(e,t)}},u.pointer=function(e){return function(){return this.parsePointer(e)}},u.pointer32=function(e){return function(){return this.parsePointer32(e)}},u.tag=u.prototype.parseTag,u.byte=u.prototype.parseByte,u.uShort=u.offset16=u.prototype.parseUShort,u.uShortList=u.prototype.parseUShortList,u.uLong=u.offset32=u.prototype.parseULong,u.uLongList=u.prototype.parseULongList,u.struct=u.prototype.parseStruct,u.coverage=u.prototype.parseCoverage,u.classDef=u.prototype.parseClassDef;var xe={reserved:u.uShort,reqFeatureIndex:u.uShort,featureIndexes:u.uShortList},R=(u.prototype.parseScriptList=function(){return this.parsePointer(u.recordList({tag:u.tag,script:u.pointer({defaultLangSys:u.pointer(xe),langSysRecords:u.recordList({tag:u.tag,langSys:u.pointer(xe)})})}))||[]},u.prototype.parseFeatureList=function(){return this.parsePointer(u.recordList({tag:u.tag,feature:u.pointer({featureParams:u.offset16,lookupListIndexes:u.uShortList})}))||[]},u.prototype.parseLookupList=function(o){return this.parsePointer(u.list(u.pointer(function(){var e=this.parseUShort(),t=(A.argument(1<=e&&e<=9,"GPOS/GSUB lookup type "+e+" unknown."),this.parseUShort()),r=16&t;return{lookupType:e,lookupFlag:t,subtables:this.parseList(u.pointer(o[e])),markFilteringSet:r?this.parseUShort():void 0}})))||[]},u.prototype.parseFeatureVariationsList=function(){return this.parsePointer32(function(){var e=this.parseUShort(),t=this.parseUShort();return A.argument(1===e&&t<1,"GPOS/GSUB feature variations table unknown."),this.parseRecordList32({conditionSetOffset:u.offset32,featureTableSubstitutionOffset:u.offset32})})||[]},{getByte:ge,getCard8:ge,getUShort:ve,getCard16:ve,getShort:function(e,t){return e.getInt16(t,!1)},getULong:be,getFixed:je,getTag:function(e,t){for(var r="",o=t;o<t+4;o+=1)r+=String.fromCharCode(e.getInt8(o));return r},getOffset:function(e,t,r){for(var o=0,n=0;n<r;n+=1)o=(o<<=8)+e.getUint8(t+n);return o},getBytes:function(e,t,r){for(var o=[],n=t;n<r;n+=1)o.push(e.getUint8(n));return o},bytesToString:function(e){for(var t="",r=0;r<e.length;r+=1)t+=String.fromCharCode(e[r]);return t},Parser:u});var we={parse:function(e,t){for(var r={},o=(r.version=R.getUShort(e,t),A.argument(0===r.version,"cmap table version should be 0."),r.numTables=R.getUShort(e,t+2),-1),n=r.numTables-1;0<=n;--n){var s=R.getUShort(e,t+4+8*n),i=R.getUShort(e,t+4+8*n+2);if(3===s&&(0===i||1===i||10===i)||0===s&&(0===i||1===i||2===i||3===i||4===i)){o=R.getULong(e,t+4+8*n+4);break}}if(-1===o)throw new Error("No valid cmap sub-tables found.");var a=new R.Parser(e,t+o);if(r.format=a.parseUShort(),12===r.format){var l,u=r,c=a;c.parseUShort(),u.length=c.parseULong(),u.language=c.parseULong(),u.groupCount=l=c.parseULong(),u.glyphIndexMap={};for(var d=0;d<l;d+=1)for(var f=c.parseULong(),h=c.parseULong(),p=c.parseULong(),m=f;m<=h;m+=1)u.glyphIndexMap[m]=p,p++}else{if(4!==r.format)throw new Error("Only format 4 and 12 cmap tables are supported (found format "+r.format+").");var y=r,g=e,v=t,b=o;y.length=a.parseUShort(),y.language=a.parseUShort(),y.segCount=j=a.parseUShort()>>1,a.skip("uShort",3),y.glyphIndexMap={};for(var j,_=new R.Parser(g,v+b+14),x=new R.Parser(g,v+b+16+2*j),w=new R.Parser(g,v+b+16+4*j),S=new R.Parser(g,v+b+16+6*j),M=v+b+16+8*j,E=0;E<j-1;E+=1)for(var T=void 0,C=_.parseUShort(),O=x.parseUShort(),k=w.parseShort(),L=S.parseUShort(),P=O;P<=C;P+=1)0!==L?(M=(M=S.offset+S.relativeOffset-2)+L+2*(P-O),0!==(T=R.getUShort(g,M))&&(T=T+k&65535)):T=P+k&65535,y.glyphIndexMap[P]=T}return r},make:function(e){for(var t=!0,r=e.length-1;0<r;--r)if(65535<e.get(r).unicode){console.log("Adding CMAP format 12 (needed!)"),t=!1;break}var o,n,s=[{name:"version",type:"USHORT",value:0},{name:"numTables",type:"USHORT",value:t?1:2},{name:"platformID",type:"USHORT",value:3},{name:"encodingID",type:"USHORT",value:1},{name:"offset",type:"ULONG",value:t?12:20}],i=(s=(s=t?s:s.concat([{name:"cmap12PlatformID",type:"USHORT",value:3},{name:"cmap12EncodingID",type:"USHORT",value:10},{name:"cmap12Offset",type:"ULONG",value:0}])).concat([{name:"format",type:"USHORT",value:4},{name:"cmap4Length",type:"USHORT",value:0},{name:"language",type:"USHORT",value:0},{name:"segCountX2",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]),new S.Table("cmap",s));for(i.segments=[],r=0;r<e.length;r+=1){for(var a=e.get(r),l=0;l<a.unicodes.length;l+=1)o=a.unicodes[l],n=r,i.segments.push({end:o,start:o,delta:-(o-n),offset:0,glyphIndex:n});i.segments=i.segments.sort(function(e,t){return e.start-t.start})}i.segments.push({end:65535,start:65535,delta:1,offset:0});var u=i.segments.length,c=0,d=[],f=[],h=[],p=[],m=[],y=[];for(r=0;r<u;r+=1){var g=i.segments[r];g.end<=65535&&g.start<=65535?(d=d.concat({name:"end_"+r,type:"USHORT",value:g.end}),f=f.concat({name:"start_"+r,type:"USHORT",value:g.start}),h=h.concat({name:"idDelta_"+r,type:"SHORT",value:g.delta}),p=p.concat({name:"idRangeOffset_"+r,type:"USHORT",value:g.offset}),void 0!==g.glyphId&&(m=m.concat({name:"glyph_"+r,type:"USHORT",value:g.glyphId}))):c+=1,t||void 0===g.glyphIndex||(y=(y=(y=y.concat({name:"cmap12Start_"+r,type:"ULONG",value:g.start})).concat({name:"cmap12End_"+r,type:"ULONG",value:g.end})).concat({name:"cmap12Glyph_"+r,type:"ULONG",value:g.glyphIndex}))}return i.segCountX2=2*(u-c),i.searchRange=2*Math.pow(2,Math.floor(Math.log(u-c)/Math.log(2))),i.entrySelector=Math.log(i.searchRange/2)/Math.log(2),i.rangeShift=i.segCountX2-i.searchRange,i.fields=i.fields.concat(d),i.fields.push({name:"reservedPad",type:"USHORT",value:0}),i.fields=i.fields.concat(f),i.fields=i.fields.concat(h),i.fields=i.fields.concat(p),i.fields=i.fields.concat(m),i.cmap4Length=14+2*d.length+2+2*f.length+2*h.length+2*p.length+2*m.length,t||(s=16+4*y.length,i.cmap12Offset=20+i.cmap4Length,i.fields=i.fields.concat([{name:"cmap12Format",type:"USHORT",value:12},{name:"cmap12Reserved",type:"USHORT",value:0},{name:"cmap12Length",type:"ULONG",value:s},{name:"cmap12Language",type:"ULONG",value:0},{name:"cmap12nGroups",type:"ULONG",value:y.length/3}]),i.fields=i.fields.concat(y)),i}},Se=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","266 ff","onedotenleader","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall","001.000","001.001","001.002","001.003","Black","Bold","Book","Light","Medium","Regular","Roman","Semibold"],Me=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","","endash","dagger","daggerdbl","periodcentered","","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","","questiondown","","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","","ring","cedilla","","hungarumlaut","ogonek","caron","emdash","","","","","","","","","","","","","","","","","AE","","ordfeminine","","","","","Lslash","Oslash","OE","ordmasculine","","","","","","ae","","","","dotlessi","","","lslash","oslash","oe","germandbls"],Ee=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","","asuperior","bsuperior","centsuperior","dsuperior","esuperior","","","isuperior","","","lsuperior","msuperior","nsuperior","osuperior","","","rsuperior","ssuperior","tsuperior","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdownsmall","centoldstyle","Lslashsmall","","","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","","Dotaccentsmall","","","Macronsmall","","","figuredash","hypheninferior","","","Ogoneksmall","Ringsmall","Cedillasmall","","","","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"],c=[".notdef",".null","nonmarkingreturn","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","nonbreakingspace","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron","Lslash","lslash","Scaron","scaron","Zcaron","zcaron","brokenbar","Eth","eth","Yacute","yacute","Thorn","thorn","minus","multiply","onesuperior","twosuperior","threesuperior","onehalf","onequarter","threequarters","franc","Gbreve","gbreve","Idotaccent","Scedilla","scedilla","Cacute","cacute","Ccaron","ccaron","dcroat"];function Te(e){this.font=e}function Ce(e){this.cmap=e}function Oe(e,t){this.encoding=e,this.charset=t}function ke(e){switch(e.version){case 1:this.names=c.slice();break;case 2:this.names=new Array(e.numberOfGlyphs);for(var t=0;t<e.numberOfGlyphs;t++)e.glyphNameIndex[t]<c.length?this.names[t]=c[e.glyphNameIndex[t]]:this.names[t]=e.names[e.glyphNameIndex[t]-c.length];break;case 2.5:this.names=new Array(e.numberOfGlyphs);for(var r=0;r<e.numberOfGlyphs;r++)this.names[r]=c[r+e.glyphNameIndex[r]];break;default:this.names=[]}}Te.prototype.charToGlyphIndex=function(e){var t=e.codePointAt(0),r=this.font.glyphs;if(r)for(var o=0;o<r.length;o+=1)for(var n=r.get(o),s=0;s<n.unicodes.length;s+=1)if(n.unicodes[s]===t)return o;return null},Ce.prototype.charToGlyphIndex=function(e){return this.cmap.glyphIndexMap[e.codePointAt(0)]||0},Oe.prototype.charToGlyphIndex=function(e){e=e.codePointAt(0),e=this.encoding[e];return this.charset.indexOf(e)},ke.prototype.nameToGlyphIndex=function(e){return this.names.indexOf(e)},ke.prototype.glyphIndexToName=function(e){return this.names[e]};var d={line:function(e,t,r,o,n){e.beginPath(),e.moveTo(t,r),e.lineTo(o,n),e.stroke()}};function h(e){this.bindConstructorValues(e)}function Le(t,e,r){Object.defineProperty(t,e,{get:function(){return t.path,t[r]},set:function(e){t[r]=e},enumerable:!0,configurable:!0})}function Pe(e,t){if(this.font=e,this.glyphs={},Array.isArray(t))for(var r=0;r<t.length;r++)this.glyphs[r]=t[r];this.length=t&&t.length||0}h.prototype.bindConstructorValues=function(e){var t;this.index=e.index||0,this.name=e.name||null,this.unicode=e.unicode||void 0,this.unicodes=e.unicodes||void 0!==e.unicode?[e.unicode]:[],e.xMin&&(this.xMin=e.xMin),e.yMin&&(this.yMin=e.yMin),e.xMax&&(this.xMax=e.xMax),e.yMax&&(this.yMax=e.yMax),e.advanceWidth&&(this.advanceWidth=e.advanceWidth),Object.defineProperty(this,"path",(e=e.path,t=e||new f,{configurable:!0,get:function(){return t="function"==typeof t?t():t},set:function(e){t=e}}))},h.prototype.addUnicode=function(e){0===this.unicodes.length&&(this.unicode=e),this.unicodes.push(e)},h.prototype.getBoundingBox=function(){return this.path.getBoundingBox()},h.prototype.getPath=function(e,t,r,o,n){e=void 0!==e?e:0,t=void 0!==t?t:0,r=void 0!==r?r:72;for(var s,i,a=(o=o||{}).xScale,l=o.yScale,u=((s=o.hinting&&n&&n.hinting?this.path&&n.hinting.exec(this,r):s)?(i=n.hinting.getCommands(s),e=Math.round(e),t=Math.round(t),a=l=1):(i=this.path.commands,o=1/this.path.unitsPerEm*r,void 0===a&&(a=o),void 0===l&&(l=o)),new f),c=0;c<i.length;c+=1){var d=i[c];"M"===d.type?u.moveTo(e+d.x*a,t+-d.y*l):"L"===d.type?u.lineTo(e+d.x*a,t+-d.y*l):"Q"===d.type?u.quadraticCurveTo(e+d.x1*a,t+-d.y1*l,e+d.x*a,t+-d.y*l):"C"===d.type?u.curveTo(e+d.x1*a,t+-d.y1*l,e+d.x2*a,t+-d.y2*l,e+d.x*a,t+-d.y*l):"Z"===d.type&&u.closePath()}return u},h.prototype.getContours=function(){if(void 0===this.points)return[];for(var e=[],t=[],r=0;r<this.points.length;r+=1){var o=this.points[r];t.push(o),o.lastPointOfContour&&(e.push(t),t=[])}return A.argument(0===t.length,"There are still points left in the current contour."),e},h.prototype.getMetrics=function(){for(var e=this.path.commands,t=[],r=[],o=0;o<e.length;o+=1){var n=e[o];"Z"!==n.type&&(t.push(n.x),r.push(n.y)),"Q"!==n.type&&"C"!==n.type||(t.push(n.x1),r.push(n.y1)),"C"===n.type&&(t.push(n.x2),r.push(n.y2))}var s={xMin:Math.min.apply(null,t),yMin:Math.min.apply(null,r),xMax:Math.max.apply(null,t),yMax:Math.max.apply(null,r),leftSideBearing:this.leftSideBearing};return isFinite(s.xMin)||(s.xMin=0),isFinite(s.xMax)||(s.xMax=this.advanceWidth),isFinite(s.yMin)||(s.yMin=0),isFinite(s.yMax)||(s.yMax=0),s.rightSideBearing=this.advanceWidth-s.leftSideBearing-(s.xMax-s.xMin),s},h.prototype.draw=function(e,t,r,o,n){this.getPath(t,r,o,n).draw(e)},h.prototype.drawPoints=function(i,e,t,r){function o(e,t,r,o){var n=2*Math.PI;i.beginPath();for(var s=0;s<e.length;s+=1)i.moveTo(t+e[s].x*o,r+e[s].y*o),i.arc(t+e[s].x*o,r+e[s].y*o,2,0,n,!1);i.closePath(),i.fill()}e=void 0!==e?e:0,t=void 0!==t?t:0;for(var r=1/this.path.unitsPerEm*(r=void 0!==r?r:24),n=[],s=[],a=this.path,l=0;l<a.commands.length;l+=1){var u=a.commands[l];void 0!==u.x&&n.push({x:u.x,y:-u.y}),void 0!==u.x1&&s.push({x:u.x1,y:-u.y1}),void 0!==u.x2&&s.push({x:u.x2,y:-u.y2})}i.fillStyle="blue",o(n,e,t,r),i.fillStyle="red",o(s,e,t,r)},h.prototype.drawMetrics=function(e,t,r,o){t=void 0!==t?t:0,r=void 0!==r?r:0,o=1/this.path.unitsPerEm*(o=void 0!==o?o:24),e.lineWidth=1,e.strokeStyle="black",d.line(e,t,-1e4,t,1e4),d.line(e,-1e4,r,1e4,r);var n=this.xMin||0,s=this.yMin||0,i=this.xMax||0,a=this.yMax||0,l=this.advanceWidth||0;e.strokeStyle="blue",d.line(e,t+n*o,-1e4,t+n*o,1e4),d.line(e,t+i*o,-1e4,t+i*o,1e4),d.line(e,-1e4,r+-s*o,1e4,r+-s*o),d.line(e,-1e4,r+-a*o,1e4,r+-a*o),e.strokeStyle="green",d.line(e,t+l*o,-1e4,t+l*o,1e4)},Pe.prototype.get=function(e){return"function"==typeof this.glyphs[e]&&(this.glyphs[e]=this.glyphs[e]()),this.glyphs[e]},Pe.prototype.push=function(e,t){this.glyphs[e]=t,this.length++};var p={GlyphSet:Pe,glyphLoader:function(e,t){return new h({index:t,font:e})},ttfGlyphLoader:function(r,e,o,n,s,i){return function(){var t=new h({index:e,font:r});return t.path=function(){o(t,n,s);var e=i(r.glyphs,t);return e.unitsPerEm=r.unitsPerEm,e},Le(t,"xMin","_xMin"),Le(t,"xMax","_xMax"),Le(t,"yMin","_yMin"),Le(t,"yMax","_yMax"),t}},cffGlyphLoader:function(r,e,o,n){return function(){var t=new h({index:e,font:r});return t.path=function(){var e=o(r,t,n);return e.unitsPerEm=r.unitsPerEm,e},t}}};function Ae(e){e=e.length<1240?107:e.length<33900?1131:32768;return e}function y(e,t,r){var o,n=[],s=[],i=R.getCard16(e,t);if(0!==i){for(var a=R.getByte(e,t+2),l=t+(i+1)*a+2,u=t+3,c=0;c<i+1;c+=1)n.push(R.getOffset(e,u,a)),u+=a;o=l+n[i]}else o=t+2;for(var d=0;d<n.length-1;d+=1){var f=R.getBytes(e,l+n[d],l+n[d+1]);r&&(f=r(f)),s.push(f)}return{objects:s,startOffset:t,endOffset:o}}function Re(e,t){if(28===t)return e.parseByte()<<8|e.parseByte();if(29===t)return e.parseByte()<<24|e.parseByte()<<16|e.parseByte()<<8|e.parseByte();if(30===t){for(var r=e,o="",n=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];;){var s=r.parseByte(),i=s>>4,s=15&s;if(15==i)break;if(o+=n[i],15==s)break;o+=n[s]}return parseFloat(o)}if(32<=t&&t<=246)return t-139;if(247<=t&&t<=250)return 256*(t-247)+e.parseByte()+108;if(251<=t&&t<=254)return 256*-(t-251)-e.parseByte()-108;throw new Error("Invalid b0 "+t)}function Ie(e,t,r){var o=new R.Parser(e,t=void 0!==t?t:0),n=[],s=[];for(r=void 0!==r?r:e.length;o.relativeOffset<r;){var i=o.parseByte();i<=21?(12===i&&(i=1200+o.parseByte()),n.push([i,s]),s=[]):s.push(Re(o,i))}for(var a=n,l={},u=0;u<a.length;u+=1){var c=a[u][0],d=a[u][1],f=void 0,f=1===d.length?d[0]:d;if(l.hasOwnProperty(c)&&!isNaN(l[c]))throw new Error("Object "+l+" already has key "+c);l[c]=f}return l}function De(e,t){return t=t<=390?Se[t]:e[t-391]}function Ue(e,t,r){for(var o,n={},s=0;s<t.length;s+=1){var i=t[s];if(Array.isArray(i.type)){var a=[];a.length=i.type.length;for(var l=0;l<i.type.length;l++)void 0===(o=void 0!==e[i.op]?e[i.op][l]:void 0)&&(o=void 0!==i.value&&void 0!==i.value[l]?i.value[l]:null),"SID"===i.type[l]&&(o=De(r,o)),a[l]=o;n[i.name]=a}else void 0===(o=e[i.op])&&(o=void 0!==i.value?i.value:null),"SID"===i.type&&(o=De(r,o)),n[i.name]=o}return n}var Ne=[{name:"version",op:0,type:"SID"},{name:"notice",op:1,type:"SID"},{name:"copyright",op:1200,type:"SID"},{name:"fullName",op:2,type:"SID"},{name:"familyName",op:3,type:"SID"},{name:"weight",op:4,type:"SID"},{name:"isFixedPitch",op:1201,type:"number",value:0},{name:"italicAngle",op:1202,type:"number",value:0},{name:"underlinePosition",op:1203,type:"number",value:-100},{name:"underlineThickness",op:1204,type:"number",value:50},{name:"paintType",op:1205,type:"number",value:0},{name:"charstringType",op:1206,type:"number",value:2},{name:"fontMatrix",op:1207,type:["real","real","real","real","real","real"],value:[.001,0,0,.001,0,0]},{name:"uniqueId",op:13,type:"number"},{name:"fontBBox",op:5,type:["number","number","number","number"],value:[0,0,0,0]},{name:"strokeWidth",op:1208,type:"number",value:0},{name:"xuid",op:14,type:[],value:null},{name:"charset",op:15,type:"offset",value:0},{name:"encoding",op:16,type:"offset",value:0},{name:"charStrings",op:17,type:"offset",value:0},{name:"private",op:18,type:["number","offset"],value:[0,0]},{name:"ros",op:1230,type:["SID","SID","number"]},{name:"cidFontVersion",op:1231,type:"number",value:0},{name:"cidFontRevision",op:1232,type:"number",value:0},{name:"cidFontType",op:1233,type:"number",value:0},{name:"cidCount",op:1234,type:"number",value:8720},{name:"uidBase",op:1235,type:"number"},{name:"fdArray",op:1236,type:"offset"},{name:"fdSelect",op:1237,type:"offset"},{name:"fontName",op:1238,type:"SID"}],Fe=[{name:"subrs",op:19,type:"offset",value:0},{name:"defaultWidthX",op:20,type:"number",value:0},{name:"nominalWidthX",op:21,type:"number",value:0}];function Be(e,t,r,o){return Ue(Ie(e,t,r),Fe,o)}function Ge(e,t,r,o){for(var n=[],s=0;s<r.length;s+=1){var i=new DataView(new Uint8Array(r[s]).buffer),i=(a=o,Ue(Ie(i,0,i.byteLength),Ne,a)),a=(i._subrs=[],i._subrsBias=0,i.private[0]),l=i.private[1];0!==a&&0!==l&&(a=Be(e,l+t,a,o),i._defaultWidthX=a.defaultWidthX,i._nominalWidthX=a.nominalWidthX,0!==a.subrs&&(l=y(e,l+a.subrs+t),i._subrs=l.objects,i._subrsBias=Ae(i._subrs)),i._privateDict=a),n.push(i)}return n}function Ve(y,g,e){var v,b,j,_,t,x,w,r,S,M=new f,E=[],T=0,C=!1,O=!1,k=0,L=0,P=(S=(y.isCIDFont?(t=y.tables.cff.topDict._fdSelect[g.index],t=y.tables.cff.topDict._fdArray[t],x=t._subrs,w=t._subrsBias,r=t._defaultWidthX,t):(x=y.tables.cff.topDict._subrs,w=y.tables.cff.topDict._subrsBias,r=y.tables.cff.topDict._defaultWidthX,y.tables.cff.topDict))._nominalWidthX,r);function A(e,t){O&&M.closePath(),M.moveTo(e,t),O=!0}function R(){E.length%2==0||C||(P=E.shift()+S),T+=E.length>>1,E.length=0,C=!0}return function e(t){for(var r,o,n,s,i,a,l,u,c,d,f,h,p=0;p<t.length;){var m=t[p];switch(p+=1,m){case 1:case 3:R();break;case 4:1<E.length&&!C&&(P=E.shift()+S,C=!0),L+=E.pop(),A(k,L);break;case 5:for(;0<E.length;)k+=E.shift(),L+=E.shift(),M.lineTo(k,L);break;case 6:for(;0<E.length&&(k+=E.shift(),M.lineTo(k,L),0!==E.length);)L+=E.shift(),M.lineTo(k,L);break;case 7:for(;0<E.length&&(L+=E.shift(),M.lineTo(k,L),0!==E.length);)k+=E.shift(),M.lineTo(k,L);break;case 8:for(;0<E.length;)v=k+E.shift(),b=L+E.shift(),j=v+E.shift(),_=b+E.shift(),k=j+E.shift(),L=_+E.shift(),M.curveTo(v,b,j,_,k,L);break;case 10:i=E.pop()+w,(a=x[i])&&e(a);break;case 11:return;case 12:switch(m=t[p],p+=1,m){case 35:v=k+E.shift(),b=L+E.shift(),j=v+E.shift(),_=b+E.shift(),l=j+E.shift(),u=_+E.shift(),c=l+E.shift(),d=u+E.shift(),f=c+E.shift(),h=d+E.shift(),k=f+E.shift(),L=h+E.shift(),E.shift(),M.curveTo(v,b,j,_,l,u),M.curveTo(c,d,f,h,k,L);break;case 34:v=k+E.shift(),b=L,j=v+E.shift(),_=b+E.shift(),l=j+E.shift(),u=_,c=l+E.shift(),d=_,f=c+E.shift(),h=L,k=f+E.shift(),M.curveTo(v,b,j,_,l,u),M.curveTo(c,d,f,h,k,L);break;case 36:v=k+E.shift(),b=L+E.shift(),j=v+E.shift(),_=b+E.shift(),l=j+E.shift(),u=_,c=l+E.shift(),d=_,f=c+E.shift(),h=d+E.shift(),k=f+E.shift(),M.curveTo(v,b,j,_,l,u),M.curveTo(c,d,f,h,k,L);break;case 37:v=k+E.shift(),b=L+E.shift(),j=v+E.shift(),_=b+E.shift(),l=j+E.shift(),u=_+E.shift(),c=l+E.shift(),d=u+E.shift(),f=c+E.shift(),h=d+E.shift(),Math.abs(f-k)>Math.abs(h-L)?k=f+E.shift():L=h+E.shift(),M.curveTo(v,b,j,_,l,u),M.curveTo(c,d,f,h,k,L);break;default:console.log("Glyph "+g.index+": unknown operator 1200"+m),E.length=0}break;case 14:0<E.length&&!C&&(P=E.shift()+S,C=!0),O&&(M.closePath(),O=!1);break;case 18:R();break;case 19:case 20:R(),p+=T+7>>3;break;case 21:2<E.length&&!C&&(P=E.shift()+S,C=!0),L+=E.pop(),A(k+=E.pop(),L);break;case 22:1<E.length&&!C&&(P=E.shift()+S,C=!0),A(k+=E.pop(),L);break;case 23:R();break;case 24:for(;2<E.length;)v=k+E.shift(),b=L+E.shift(),j=v+E.shift(),_=b+E.shift(),k=j+E.shift(),L=_+E.shift(),M.curveTo(v,b,j,_,k,L);k+=E.shift(),L+=E.shift(),M.lineTo(k,L);break;case 25:for(;6<E.length;)k+=E.shift(),L+=E.shift(),M.lineTo(k,L);v=k+E.shift(),b=L+E.shift(),j=v+E.shift(),_=b+E.shift(),k=j+E.shift(),L=_+E.shift(),M.curveTo(v,b,j,_,k,L);break;case 26:for(E.length%2&&(k+=E.shift());0<E.length;)v=k,b=L+E.shift(),j=v+E.shift(),_=b+E.shift(),k=j,L=_+E.shift(),M.curveTo(v,b,j,_,k,L);break;case 27:for(E.length%2&&(L+=E.shift());0<E.length;)v=k+E.shift(),b=L,j=v+E.shift(),_=b+E.shift(),k=j+E.shift(),L=_,M.curveTo(v,b,j,_,k,L);break;case 28:r=t[p],o=t[p+1],E.push((r<<24|o<<16)>>16),p+=2;break;case 29:i=E.pop()+y.gsubrsBias,(a=y.gsubrs[i])&&e(a);break;case 30:for(;0<E.length&&(v=k,b=L+E.shift(),j=v+E.shift(),_=b+E.shift(),k=j+E.shift(),L=_+(1===E.length?E.shift():0),M.curveTo(v,b,j,_,k,L),0!==E.length);)v=k+E.shift(),b=L,j=v+E.shift(),_=b+E.shift(),L=_+E.shift(),k=j+(1===E.length?E.shift():0),M.curveTo(v,b,j,_,k,L);break;case 31:for(;0<E.length&&(v=k+E.shift(),b=L,j=v+E.shift(),_=b+E.shift(),L=_+E.shift(),k=j+(1===E.length?E.shift():0),M.curveTo(v,b,j,_,k,L),0!==E.length);)v=k,b=L+E.shift(),j=v+E.shift(),_=b+E.shift(),k=j+E.shift(),L=_+(1===E.length?E.shift():0),M.curveTo(v,b,j,_,k,L);break;default:m<32?console.log("Glyph "+g.index+": unknown operator "+m):m<247?E.push(m-139):m<251?(r=t[p],p+=1,E.push(256*(m-247)+r+108)):m<255?(r=t[p],p+=1,E.push(256*-(m-251)-r-108)):(r=t[p],o=t[p+1],n=t[p+2],s=t[p+3],p+=4,E.push((r<<24|o<<16|n<<8|s)/65536))}}}(e),g.advanceWidth=P,M}function ze(e,t){var r,o=Se.indexOf(e);return 0<=o&&(r=o),0<=(o=t.indexOf(e))?r=o+Se.length:(r=Se.length+t.length,t.push(e)),r}function He(e,t,r){for(var o={},n=0;n<e.length;n+=1){var s=e[n],i=t[s.name];void 0===i||function e(t,r){if(t===r)return 1;if(Array.isArray(t)&&Array.isArray(r)&&t.length===r.length){for(var o=0;o<t.length;o+=1)if(!e(t[o],r[o]))return;return 1}}(i,s.value)||("SID"===s.type&&(i=ze(i,r)),o[s.op]={name:s.name,type:s.type,value:i})}return o}function We(e,t){var r=new S.Record("Top DICT",[{name:"dict",type:"DICT",value:{}}]);return r.dict=He(Ne,e,t),r}function qe(e){var t=new S.Record("Top DICT INDEX",[{name:"topDicts",type:"INDEX",value:[]}]);return t.topDicts=[{name:"topDict_0",type:"TABLE",value:e}],t}function Xe(e){for(var t=new S.Record("CharStrings INDEX",[{name:"charStrings",type:"INDEX",value:[]}]),r=0;r<e.length;r+=1){var o=e.get(r),n=function(e){for(var t=[],r=e.path,o=(t.push({name:"width",type:"NUMBER",value:e.advanceWidth}),0),n=0,s=0;s<r.commands.length;s+=1){var i,a,l,u,c=void 0,d=void 0,f=r.commands[s];"M"===(f="Q"===f.type?{type:"C",x:f.x,y:f.y,x1:1/3*o+2/3*f.x1,y1:1/3*n+2/3*f.y1,x2:1/3*f.x+2/3*f.x1,y2:1/3*f.y+2/3*f.y1}:f).type?(c=Math.round(f.x-o),d=Math.round(f.y-n),t.push({name:"dx",type:"NUMBER",value:c}),t.push({name:"dy",type:"NUMBER",value:d}),t.push({name:"rmoveto",type:"OP",value:21}),o=Math.round(f.x),n=Math.round(f.y)):"L"===f.type?(c=Math.round(f.x-o),d=Math.round(f.y-n),t.push({name:"dx",type:"NUMBER",value:c}),t.push({name:"dy",type:"NUMBER",value:d}),t.push({name:"rlineto",type:"OP",value:5}),o=Math.round(f.x),n=Math.round(f.y)):"C"===f.type&&(i=Math.round(f.x1-o),a=Math.round(f.y1-n),l=Math.round(f.x2-f.x1),u=Math.round(f.y2-f.y1),c=Math.round(f.x-f.x2),d=Math.round(f.y-f.y2),t.push({name:"dx1",type:"NUMBER",value:i}),t.push({name:"dy1",type:"NUMBER",value:a}),t.push({name:"dx2",type:"NUMBER",value:l}),t.push({name:"dy2",type:"NUMBER",value:u}),t.push({name:"dx",type:"NUMBER",value:c}),t.push({name:"dy",type:"NUMBER",value:d}),t.push({name:"rrcurveto",type:"OP",value:8}),o=Math.round(f.x),n=Math.round(f.y))}return t.push({name:"endchar",type:"OP",value:14}),t}(o);t.charStrings.push({name:o.name,type:"CHARSTRING",value:n})}return t}var Ye={parse:function(e,t,r){r.tables.cff={},o=e,n=t,(s={}).formatMajor=R.getCard8(o,n),s.formatMinor=R.getCard8(o,n+1),s.size=R.getCard8(o,n+2),s.offsetSize=R.getCard8(o,n+3),s.startOffset=n,s.endOffset=n+4;var o=y(e,s.endOffset,R.bytesToString),n=y(e,o.endOffset),s=y(e,n.endOffset,R.bytesToString),o=y(e,s.endOffset);if(r.gsubrs=o.objects,r.gsubrsBias=Ae(r.gsubrs),1!==(o=Ge(e,t,n.objects,s.objects)).length)throw new Error("CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = "+o.length);if(n=o[0],(r.tables.cff.topDict=n)._privateDict&&(r.defaultWidthX=n._privateDict.defaultWidthX,r.nominalWidthX=n._privateDict.nominalWidthX),void 0!==n.ros[0]&&void 0!==n.ros[1]&&(r.isCIDFont=!0),r.isCIDFont){var o=n.fdArray,i=n.fdSelect;if(0===o||0===i)throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");o=Ge(e,t,y(e,o+=t).objects,s.objects);n._fdArray=o,n._fdSelect=function(e,t,r,o){var n,s=[],i=new R.Parser(e,t);if(0===(e=i.parseCard8()))for(var a=0;a<r;a++){if(o<=(n=i.parseCard8()))throw new Error("CFF table CID Font FDSelect has bad FD index value "+n+" (FD count "+o+")");s.push(n)}else{if(3!==e)throw new Error("CFF Table CID Font FDSelect table has unsupported format "+e);var l,u=i.parseCard16(),c=i.parseCard16();if(0!==c)throw new Error("CFF Table CID Font FDSelect format 3 range has bad initial GID "+c);for(var d=0;d<u;d++){if(n=i.parseCard8(),l=i.parseCard16(),o<=n)throw new Error("CFF table CID Font FDSelect has bad FD index value "+n+" (FD count "+o+")");if(r<l)throw new Error("CFF Table CID Font FDSelect format 3 range has bad GID "+l);for(;c<l;c++)s.push(n);c=l}if(l!==r)throw new Error("CFF Table CID Font FDSelect format 3 range has bad final GID "+l)}return s}(e,i+=t,r.numGlyphs,o.length)}var i=t+n.private[1],o=Be(e,i,n.private[0],s.objects),a=(r.defaultWidthX=o.defaultWidthX,r.nominalWidthX=o.nominalWidthX,0!==o.subrs?(i=y(e,i+o.subrs),r.subrs=i.objects,r.subrsBias=Ae(r.subrs)):(r.subrs=[],r.subrsBias=0),y(e,t+n.charStrings)),o=(r.nGlyphs=a.objects.length,function(e,t,r,o){var n=new R.Parser(e,t),s=(--r,[".notdef"]);if(0===(e=n.parseCard8()))for(var i=0;i<r;i+=1)a=n.parseSID(),s.push(De(o,a));else if(1===e)for(;s.length<=r;)for(var a=n.parseSID(),l=n.parseCard8(),u=0;u<=l;u+=1)s.push(De(o,a)),a+=1;else{if(2!==e)throw new Error("Unknown charset format "+e);for(;s.length<=r;){a=n.parseSID(),l=n.parseCard16();for(var c=0;c<=l;c+=1)s.push(De(o,a)),a+=1}}return s}(e,t+n.charset,r.nGlyphs,s.objects));0===n.encoding?r.cffEncoding=new Oe(Me,o):1===n.encoding?r.cffEncoding=new Oe(Ee,o):r.cffEncoding=function(e,t,r){var o={},n=new R.Parser(e,t);if(0===(e=n.parseCard8()))for(var s=n.parseCard8(),i=0;i<s;i+=1)o[l=n.parseCard8()]=i;else{if(1!==e)throw new Error("Unknown encoding format "+e);for(var a=n.parseCard8(),l=1,u=0;u<a;u+=1)for(var c=n.parseCard8(),d=n.parseCard8(),f=c;f<=c+d;f+=1)o[f]=l,l+=1}return new Oe(o,r)}(e,t+n.encoding,o),r.encoding=r.encoding||r.cffEncoding,r.glyphs=new p.GlyphSet(r);for(var l=0;l<r.nGlyphs;l+=1){var u=a.objects[l];r.glyphs.push(l,p.cffGlyphLoader(r,l,Ve,u))}},make:function(e,t){for(var r,o=new S.Table("CFF ",[{name:"header",type:"RECORD"},{name:"nameIndex",type:"RECORD"},{name:"topDictIndex",type:"RECORD"},{name:"stringIndex",type:"RECORD"},{name:"globalSubrIndex",type:"RECORD"},{name:"charsets",type:"RECORD"},{name:"charStringsIndex",type:"RECORD"},{name:"privateDict",type:"RECORD"}]),n=1/t.unitsPerEm,n={version:t.version,fullName:t.fullName,familyName:t.familyName,weight:t.weightName,fontBBox:t.fontBBox||[0,0,0,0],fontMatrix:[n,0,0,n,0,0],charset:999,encoding:0,charStrings:999,private:[0,999]},s=[],i=1;i<e.length;i+=1)r=e.get(i),s.push(r.name);var a,l,u=[],t=(o.header=new S.Record("Header",[{name:"major",type:"Card8",value:1},{name:"minor",type:"Card8",value:0},{name:"hdrSize",type:"Card8",value:4},{name:"major",type:"Card8",value:1}]),o.nameIndex=function(e){var t=new S.Record("Name INDEX",[{name:"names",type:"INDEX",value:[]}]);t.names=[];for(var r=0;r<e.length;r+=1)t.names.push({name:"name_"+r,type:"NAME",value:e[r]});return t}([t.postScriptName]),We(n,u)),c=(o.topDictIndex=qe(t),o.globalSubrIndex=new S.Record("Global Subr INDEX",[{name:"subrs",type:"INDEX",value:[]}]),o.charsets=function(e,t){for(var r=new S.Record("Charsets",[{name:"format",type:"Card8",value:0}]),o=0;o<e.length;o+=1){var n=ze(e[o],t);r.fields.push({name:"glyph_"+o,type:"SID",value:n})}return r}(s,u),o.charStringsIndex=Xe(e),o.privateDict=(c={},a=u,(l=new S.Record("Private DICT",[{name:"dict",type:"DICT",value:{}}])).dict=He(Fe,c,a),l),o.stringIndex=function(e){var t=new S.Record("String INDEX",[{name:"strings",type:"INDEX",value:[]}]);t.strings=[];for(var r=0;r<e.length;r+=1)t.strings.push({name:"string_"+r,type:"STRING",value:e[r]});return t}(u),o.header.sizeOf()+o.nameIndex.sizeOf()+o.topDictIndex.sizeOf()+o.stringIndex.sizeOf()+o.globalSubrIndex.sizeOf());return n.charset=c,n.encoding=0,n.charStrings=n.charset+o.charsets.sizeOf(),n.private[1]=n.charStrings+o.charStringsIndex.sizeOf(),t=We(n,u),o.topDictIndex=qe(t),o}};var Ze={parse:function(e,t){var r={},e=new R.Parser(e,t);return r.version=e.parseVersion(),r.fontRevision=Math.round(1e3*e.parseFixed())/1e3,r.checkSumAdjustment=e.parseULong(),r.magicNumber=e.parseULong(),A.argument(1594834165===r.magicNumber,"Font header has wrong magic number."),r.flags=e.parseUShort(),r.unitsPerEm=e.parseUShort(),r.created=e.parseLongDateTime(),r.modified=e.parseLongDateTime(),r.xMin=e.parseShort(),r.yMin=e.parseShort(),r.xMax=e.parseShort(),r.yMax=e.parseShort(),r.macStyle=e.parseUShort(),r.lowestRecPPEM=e.parseUShort(),r.fontDirectionHint=e.parseShort(),r.indexToLocFormat=e.parseShort(),r.glyphDataFormat=e.parseShort(),r},make:function(e){var t=Math.round((new Date).getTime()/1e3)+2082844800,r=t;return e.createdTimestamp&&(r=e.createdTimestamp+2082844800),new S.Table("head",[{name:"version",type:"FIXED",value:65536},{name:"fontRevision",type:"FIXED",value:65536},{name:"checkSumAdjustment",type:"ULONG",value:0},{name:"magicNumber",type:"ULONG",value:1594834165},{name:"flags",type:"USHORT",value:0},{name:"unitsPerEm",type:"USHORT",value:1e3},{name:"created",type:"LONGDATETIME",value:r},{name:"modified",type:"LONGDATETIME",value:t},{name:"xMin",type:"SHORT",value:0},{name:"yMin",type:"SHORT",value:0},{name:"xMax",type:"SHORT",value:0},{name:"yMax",type:"SHORT",value:0},{name:"macStyle",type:"USHORT",value:0},{name:"lowestRecPPEM",type:"USHORT",value:0},{name:"fontDirectionHint",type:"SHORT",value:2},{name:"indexToLocFormat",type:"SHORT",value:0},{name:"glyphDataFormat",type:"SHORT",value:0}],e)}};var Qe={parse:function(e,t){var r={},e=new R.Parser(e,t);return r.version=e.parseVersion(),r.ascender=e.parseShort(),r.descender=e.parseShort(),r.lineGap=e.parseShort(),r.advanceWidthMax=e.parseUShort(),r.minLeftSideBearing=e.parseShort(),r.minRightSideBearing=e.parseShort(),r.xMaxExtent=e.parseShort(),r.caretSlopeRise=e.parseShort(),r.caretSlopeRun=e.parseShort(),r.caretOffset=e.parseShort(),e.relativeOffset+=8,r.metricDataFormat=e.parseShort(),r.numberOfHMetrics=e.parseUShort(),r},make:function(e){return new S.Table("hhea",[{name:"version",type:"FIXED",value:65536},{name:"ascender",type:"FWORD",value:0},{name:"descender",type:"FWORD",value:0},{name:"lineGap",type:"FWORD",value:0},{name:"advanceWidthMax",type:"UFWORD",value:0},{name:"minLeftSideBearing",type:"FWORD",value:0},{name:"minRightSideBearing",type:"FWORD",value:0},{name:"xMaxExtent",type:"FWORD",value:0},{name:"caretSlopeRise",type:"SHORT",value:1},{name:"caretSlopeRun",type:"SHORT",value:0},{name:"caretOffset",type:"SHORT",value:0},{name:"reserved1",type:"SHORT",value:0},{name:"reserved2",type:"SHORT",value:0},{name:"reserved3",type:"SHORT",value:0},{name:"reserved4",type:"SHORT",value:0},{name:"metricDataFormat",type:"SHORT",value:0},{name:"numberOfHMetrics",type:"USHORT",value:0}],e)}};var Je={parse:function(e,t,r,o,n){for(var s,i,a=new R.Parser(e,t),l=0;l<o;l+=1){l<r&&(s=a.parseUShort(),i=a.parseShort());var u=n.get(l);u.advanceWidth=s,u.leftSideBearing=i}},make:function(e){for(var t=new S.Table("hmtx",[]),r=0;r<e.length;r+=1){var o=e.get(r),n=o.advanceWidth||0,o=o.leftSideBearing||0;t.fields.push({name:"advanceWidth_"+r,type:"USHORT",value:n}),t.fields.push({name:"leftSideBearing_"+r,type:"SHORT",value:o})}return t}};var Ke={make:function(e){for(var t=new S.Table("ltag",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"numTags",type:"ULONG",value:e.length}]),r="",o=12+4*e.length,n=0;n<e.length;++n){var s=r.indexOf(e[n]);s<0&&(s=r.length,r+=e[n]),t.fields.push({name:"offset "+n,type:"USHORT",value:o+s}),t.fields.push({name:"length "+n,type:"USHORT",value:e[n].length})}return t.fields.push({name:"stringPool",type:"CHARARRAY",value:r}),t},parse:function(e,t){for(var r=new R.Parser(e,t),o=r.parseULong(),n=(A.argument(1===o,"Unsupported ltag table version."),r.skip("uLong",1),r.parseULong()),s=[],i=0;i<n;i++){for(var a="",l=t+r.parseUShort(),u=r.parseUShort(),c=l;c<l+u;++c)a+=String.fromCharCode(e.getInt8(c));s.push(a)}return s}};var $e={parse:function(e,t){var r={},e=new R.Parser(e,t);return r.version=e.parseVersion(),r.numGlyphs=e.parseUShort(),1===r.version&&(r.maxPoints=e.parseUShort(),r.maxContours=e.parseUShort(),r.maxCompositePoints=e.parseUShort(),r.maxCompositeContours=e.parseUShort(),r.maxZones=e.parseUShort(),r.maxTwilightPoints=e.parseUShort(),r.maxStorage=e.parseUShort(),r.maxFunctionDefs=e.parseUShort(),r.maxInstructionDefs=e.parseUShort(),r.maxStackElements=e.parseUShort(),r.maxSizeOfInstructions=e.parseUShort(),r.maxComponentElements=e.parseUShort(),r.maxComponentDepth=e.parseUShort()),r},make:function(e){return new S.Table("maxp",[{name:"version",type:"FIXED",value:20480},{name:"numGlyphs",type:"USHORT",value:e}])}},et=["copyright","fontFamily","fontSubfamily","uniqueID","fullName","version","postScriptName","trademark","manufacturer","designer","description","manufacturerURL","designerURL","license","licenseURL","reserved","preferredFamily","preferredSubfamily","compatibleFullName","sampleText","postScriptFindFontName","wwsFamily","wwsSubfamily"],tt={0:"en",1:"fr",2:"de",3:"it",4:"nl",5:"sv",6:"es",7:"da",8:"pt",9:"no",10:"he",11:"ja",12:"ar",13:"fi",14:"el",15:"is",16:"mt",17:"tr",18:"hr",19:"zh-Hant",20:"ur",21:"hi",22:"th",23:"ko",24:"lt",25:"pl",26:"hu",27:"es",28:"lv",29:"se",30:"fo",31:"fa",32:"ru",33:"zh",34:"nl-BE",35:"ga",36:"sq",37:"ro",38:"cz",39:"sk",40:"si",41:"yi",42:"sr",43:"mk",44:"bg",45:"uk",46:"be",47:"uz",48:"kk",49:"az-Cyrl",50:"az-Arab",51:"hy",52:"ka",53:"mo",54:"ky",55:"tg",56:"tk",57:"mn-CN",58:"mn",59:"ps",60:"ks",61:"ku",62:"sd",63:"bo",64:"ne",65:"sa",66:"mr",67:"bn",68:"as",69:"gu",70:"pa",71:"or",72:"ml",73:"kn",74:"ta",75:"te",76:"si",77:"my",78:"km",79:"lo",80:"vi",81:"id",82:"tl",83:"ms",84:"ms-Arab",85:"am",86:"ti",87:"om",88:"so",89:"sw",90:"rw",91:"rn",92:"ny",93:"mg",94:"eo",128:"cy",129:"eu",130:"ca",131:"la",132:"qu",133:"gn",134:"ay",135:"tt",136:"ug",137:"dz",138:"jv",139:"su",140:"gl",141:"af",142:"br",143:"iu",144:"gd",145:"gv",146:"ga",147:"to",148:"el-polyton",149:"kl",150:"az",151:"nn"},rt={0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,10:5,11:1,12:4,13:0,14:6,15:0,16:0,17:0,18:0,19:2,20:4,21:9,22:21,23:3,24:29,25:29,26:29,27:29,28:29,29:0,30:0,31:4,32:7,33:25,34:0,35:0,36:0,37:0,38:29,39:29,40:0,41:5,42:7,43:7,44:7,45:7,46:7,47:7,48:7,49:7,50:4,51:24,52:23,53:7,54:7,55:7,56:7,57:27,58:7,59:4,60:4,61:4,62:4,63:26,64:9,65:9,66:9,67:13,68:13,69:11,70:10,71:12,72:17,73:16,74:14,75:15,76:18,77:19,78:20,79:22,80:30,81:0,82:0,83:0,84:4,85:28,86:28,87:28,88:0,89:0,90:0,91:0,92:0,93:0,94:0,128:0,129:0,130:0,131:0,132:0,133:0,134:0,135:7,136:4,137:26,138:0,139:0,140:0,141:0,142:0,143:28,144:0,145:0,146:0,147:0,148:6,149:0,150:0,151:0},ot={1078:"af",1052:"sq",1156:"gsw",1118:"am",5121:"ar-DZ",15361:"ar-BH",3073:"ar",2049:"ar-IQ",11265:"ar-JO",13313:"ar-KW",12289:"ar-LB",4097:"ar-LY",6145:"ary",8193:"ar-OM",16385:"ar-QA",1025:"ar-SA",10241:"ar-SY",7169:"aeb",14337:"ar-AE",9217:"ar-YE",1067:"hy",1101:"as",2092:"az-Cyrl",1068:"az",1133:"ba",1069:"eu",1059:"be",2117:"bn",1093:"bn-IN",8218:"bs-Cyrl",5146:"bs",1150:"br",1026:"bg",1027:"ca",3076:"zh-HK",5124:"zh-MO",2052:"zh",4100:"zh-SG",1028:"zh-TW",1155:"co",1050:"hr",4122:"hr-BA",1029:"cs",1030:"da",1164:"prs",1125:"dv",2067:"nl-BE",1043:"nl",3081:"en-AU",10249:"en-BZ",4105:"en-CA",9225:"en-029",16393:"en-IN",6153:"en-IE",8201:"en-JM",17417:"en-MY",5129:"en-NZ",13321:"en-PH",18441:"en-SG",7177:"en-ZA",11273:"en-TT",2057:"en-GB",1033:"en",12297:"en-ZW",1061:"et",1080:"fo",1124:"fil",1035:"fi",2060:"fr-BE",3084:"fr-CA",1036:"fr",5132:"fr-LU",6156:"fr-MC",4108:"fr-CH",1122:"fy",1110:"gl",1079:"ka",3079:"de-AT",1031:"de",5127:"de-LI",4103:"de-LU",2055:"de-CH",1032:"el",1135:"kl",1095:"gu",1128:"ha",1037:"he",1081:"hi",1038:"hu",1039:"is",1136:"ig",1057:"id",1117:"iu",2141:"iu-Latn",2108:"ga",1076:"xh",1077:"zu",1040:"it",2064:"it-CH",1041:"ja",1099:"kn",1087:"kk",1107:"km",1158:"quc",1159:"rw",1089:"sw",1111:"kok",1042:"ko",1088:"ky",1108:"lo",1062:"lv",1063:"lt",2094:"dsb",1134:"lb",1071:"mk",2110:"ms-BN",1086:"ms",1100:"ml",1082:"mt",1153:"mi",1146:"arn",1102:"mr",1148:"moh",1104:"mn",2128:"mn-CN",1121:"ne",1044:"nb",2068:"nn",1154:"oc",1096:"or",1123:"ps",1045:"pl",1046:"pt",2070:"pt-PT",1094:"pa",1131:"qu-BO",2155:"qu-EC",3179:"qu",1048:"ro",1047:"rm",1049:"ru",9275:"smn",4155:"smj-NO",5179:"smj",3131:"se-FI",1083:"se",2107:"se-SE",8251:"sms",6203:"sma-NO",7227:"sms",1103:"sa",7194:"sr-Cyrl-BA",3098:"sr",6170:"sr-Latn-BA",2074:"sr-Latn",1132:"nso",1074:"tn",1115:"si",1051:"sk",1060:"sl",11274:"es-AR",16394:"es-BO",13322:"es-CL",9226:"es-CO",5130:"es-CR",7178:"es-DO",12298:"es-EC",17418:"es-SV",4106:"es-GT",18442:"es-HN",2058:"es-MX",19466:"es-NI",6154:"es-PA",15370:"es-PY",10250:"es-PE",20490:"es-PR",3082:"es",1034:"es",21514:"es-US",14346:"es-UY",8202:"es-VE",2077:"sv-FI",1053:"sv",1114:"syr",1064:"tg",2143:"tzm",1097:"ta",1092:"tt",1098:"te",1054:"th",1105:"bo",1055:"tr",1090:"tk",1152:"ug",1058:"uk",1070:"hsb",1056:"ur",2115:"uz-Cyrl",1091:"uz",1066:"vi",1106:"cy",1160:"wo",1157:"sah",1144:"ii",1130:"yo"};var nt="utf-16",st={0:"macintosh",1:"x-mac-japanese",2:"x-mac-chinesetrad",3:"x-mac-korean",6:"x-mac-greek",7:"x-mac-cyrillic",9:"x-mac-devanagai",10:"x-mac-gurmukhi",11:"x-mac-gujarati",12:"x-mac-oriya",13:"x-mac-bengali",14:"x-mac-tamil",15:"x-mac-telugu",16:"x-mac-kannada",17:"x-mac-malayalam",18:"x-mac-sinhalese",19:"x-mac-burmese",20:"x-mac-khmer",21:"x-mac-thai",22:"x-mac-lao",23:"x-mac-georgian",24:"x-mac-armenian",25:"x-mac-chinesesimp",26:"x-mac-tibetan",27:"x-mac-mongolian",28:"x-mac-ethiopic",29:"x-mac-ce",30:"x-mac-vietnamese",31:"x-mac-extarabic"},it={15:"x-mac-icelandic",17:"x-mac-turkish",18:"x-mac-croatian",24:"x-mac-ce",25:"x-mac-ce",26:"x-mac-ce",27:"x-mac-ce",28:"x-mac-ce",30:"x-mac-icelandic",37:"x-mac-romanian",38:"x-mac-ce",39:"x-mac-ce",40:"x-mac-ce",143:"x-mac-inuit",146:"x-mac-gaelic"};function at(e,t,r){switch(e){case 0:return nt;case 1:return it[r]||st[t];case 3:if(1===t||10===t)return nt}}function lt(e){var t,r={};for(t in e)r[e[t]]=parseInt(t);return r}function ut(e,t,r,o,n,s){return new S.Record("NameRecord",[{name:"platformID",type:"USHORT",value:e},{name:"encodingID",type:"USHORT",value:t},{name:"languageID",type:"USHORT",value:r},{name:"nameID",type:"USHORT",value:o},{name:"length",type:"USHORT",value:n},{name:"offset",type:"USHORT",value:s}])}function ct(e,t){if((r=function(e,t){var r=e.length,o=t.length-r+1;e:for(var n=0;n<o;n++)for(;n<o;n++){for(var s=0;s<r;s++)if(t[n+s]!==e[s])continue e;return n}return-1}(e,t))<0)for(var r=t.length,o=0,n=e.length;o<n;++o)t.push(e[o]);return r}var dt={parse:function(e,t,r){for(var o={},n=new R.Parser(e,t),t=n.parseUShort(),s=n.parseUShort(),i=n.offset+n.parseUShort(),a=0;a<s;a++){var l=n.parseUShort(),u=n.parseUShort(),c=n.parseUShort(),d=n.parseUShort(),d=et[d]||d,f=n.parseUShort(),h=n.parseUShort(),p=function(e,t,r){switch(e){case 0:if(65535===t)return"und";if(r)return r[t];break;case 1:return tt[t];case 3:return ot[t]}}(l,c,r),l=at(l,u,c);void 0!==l&&void 0!==p&&(u=void 0,(u=l===nt?m.UTF16(e,i+h,f):m.MACSTRING(e,i+h,f,l))&&((c=void 0===(c=o[d])?o[d]={}:c)[p]=u))}return 1===t&&n.parseUShort(),o},make:function(e,t){var r,o=[],n={},s=lt(et);for(r in e){var i=s[r];if(void 0===i&&(i=r),f=parseInt(i),isNaN(f))throw new Error('Name table entry "'+r+'" does not exist, see nameTableNames for complete list.');n[f]=e[r],o.push(f)}for(var a=lt(tt),l=lt(ot),u=[],c=[],d=0;d<o.length;d++){var f,h,p=n[f=o[d]];for(h in p){var m=p[h],y=1,g=a[h],v=rt[g],b=at(y,v,g),b=w.MACSTRING(m,b),j=(void 0===b&&(y=0,(g=t.indexOf(h))<0&&(g=t.length,t.push(h)),v=4,b=w.UTF16(m)),ct(b,c)),y=(u.push(ut(y,v,g,f,b.length,j)),l[h]);void 0!==y&&(g=ct(v=w.UTF16(m),c),u.push(ut(3,1,y,f,v.length,g)))}}u.sort(function(e,t){return e.platformID-t.platformID||e.encodingID-t.encodingID||e.languageID-t.languageID||e.nameID-t.nameID});for(var _=new S.Table("name",[{name:"format",type:"USHORT",value:0},{name:"count",type:"USHORT",value:u.length},{name:"stringOffset",type:"USHORT",value:6+12*u.length}]),x=0;x<u.length;x++)_.fields.push({name:"record_"+x,type:"RECORD",value:u[x]});return _.fields.push({name:"strings",type:"LITERAL",value:c}),_}},ft=[{begin:0,end:127},{begin:128,end:255},{begin:256,end:383},{begin:384,end:591},{begin:592,end:687},{begin:688,end:767},{begin:768,end:879},{begin:880,end:1023},{begin:11392,end:11519},{begin:1024,end:1279},{begin:1328,end:1423},{begin:1424,end:1535},{begin:42240,end:42559},{begin:1536,end:1791},{begin:1984,end:2047},{begin:2304,end:2431},{begin:2432,end:2559},{begin:2560,end:2687},{begin:2688,end:2815},{begin:2816,end:2943},{begin:2944,end:3071},{begin:3072,end:3199},{begin:3200,end:3327},{begin:3328,end:3455},{begin:3584,end:3711},{begin:3712,end:3839},{begin:4256,end:4351},{begin:6912,end:7039},{begin:4352,end:4607},{begin:7680,end:7935},{begin:7936,end:8191},{begin:8192,end:8303},{begin:8304,end:8351},{begin:8352,end:8399},{begin:8400,end:8447},{begin:8448,end:8527},{begin:8528,end:8591},{begin:8592,end:8703},{begin:8704,end:8959},{begin:8960,end:9215},{begin:9216,end:9279},{begin:9280,end:9311},{begin:9312,end:9471},{begin:9472,end:9599},{begin:9600,end:9631},{begin:9632,end:9727},{begin:9728,end:9983},{begin:9984,end:10175},{begin:12288,end:12351},{begin:12352,end:12447},{begin:12448,end:12543},{begin:12544,end:12591},{begin:12592,end:12687},{begin:43072,end:43135},{begin:12800,end:13055},{begin:13056,end:13311},{begin:44032,end:55215},{begin:55296,end:57343},{begin:67840,end:67871},{begin:19968,end:40959},{begin:57344,end:63743},{begin:12736,end:12783},{begin:64256,end:64335},{begin:64336,end:65023},{begin:65056,end:65071},{begin:65040,end:65055},{begin:65104,end:65135},{begin:65136,end:65279},{begin:65280,end:65519},{begin:65520,end:65535},{begin:3840,end:4095},{begin:1792,end:1871},{begin:1920,end:1983},{begin:3456,end:3583},{begin:4096,end:4255},{begin:4608,end:4991},{begin:5024,end:5119},{begin:5120,end:5759},{begin:5760,end:5791},{begin:5792,end:5887},{begin:6016,end:6143},{begin:6144,end:6319},{begin:10240,end:10495},{begin:40960,end:42127},{begin:5888,end:5919},{begin:66304,end:66351},{begin:66352,end:66383},{begin:66560,end:66639},{begin:118784,end:119039},{begin:119808,end:120831},{begin:1044480,end:1048573},{begin:65024,end:65039},{begin:917504,end:917631},{begin:6400,end:6479},{begin:6480,end:6527},{begin:6528,end:6623},{begin:6656,end:6687},{begin:11264,end:11359},{begin:11568,end:11647},{begin:19904,end:19967},{begin:43008,end:43055},{begin:65536,end:65663},{begin:65856,end:65935},{begin:66432,end:66463},{begin:66464,end:66527},{begin:66640,end:66687},{begin:66688,end:66735},{begin:67584,end:67647},{begin:68096,end:68191},{begin:119552,end:119647},{begin:73728,end:74751},{begin:119648,end:119679},{begin:7040,end:7103},{begin:7168,end:7247},{begin:7248,end:7295},{begin:43136,end:43231},{begin:43264,end:43311},{begin:43312,end:43359},{begin:43520,end:43615},{begin:65936,end:65999},{begin:66e3,end:66047},{begin:66208,end:66271},{begin:127024,end:127135}];var ht={parse:function(e,t){var r={},o=new R.Parser(e,t);r.version=o.parseUShort(),r.xAvgCharWidth=o.parseShort(),r.usWeightClass=o.parseUShort(),r.usWidthClass=o.parseUShort(),r.fsType=o.parseUShort(),r.ySubscriptXSize=o.parseShort(),r.ySubscriptYSize=o.parseShort(),r.ySubscriptXOffset=o.parseShort(),r.ySubscriptYOffset=o.parseShort(),r.ySuperscriptXSize=o.parseShort(),r.ySuperscriptYSize=o.parseShort(),r.ySuperscriptXOffset=o.parseShort(),r.ySuperscriptYOffset=o.parseShort(),r.yStrikeoutSize=o.parseShort(),r.yStrikeoutPosition=o.parseShort(),r.sFamilyClass=o.parseShort(),r.panose=[];for(var n=0;n<10;n++)r.panose[n]=o.parseByte();return r.ulUnicodeRange1=o.parseULong(),r.ulUnicodeRange2=o.parseULong(),r.ulUnicodeRange3=o.parseULong(),r.ulUnicodeRange4=o.parseULong(),r.achVendID=String.fromCharCode(o.parseByte(),o.parseByte(),o.parseByte(),o.parseByte()),r.fsSelection=o.parseUShort(),r.usFirstCharIndex=o.parseUShort(),r.usLastCharIndex=o.parseUShort(),r.sTypoAscender=o.parseShort(),r.sTypoDescender=o.parseShort(),r.sTypoLineGap=o.parseShort(),r.usWinAscent=o.parseUShort(),r.usWinDescent=o.parseUShort(),1<=r.version&&(r.ulCodePageRange1=o.parseULong(),r.ulCodePageRange2=o.parseULong()),2<=r.version&&(r.sxHeight=o.parseShort(),r.sCapHeight=o.parseShort(),r.usDefaultChar=o.parseUShort(),r.usBreakChar=o.parseUShort(),r.usMaxContent=o.parseUShort()),r},make:function(e){return new S.Table("OS/2",[{name:"version",type:"USHORT",value:3},{name:"xAvgCharWidth",type:"SHORT",value:0},{name:"usWeightClass",type:"USHORT",value:0},{name:"usWidthClass",type:"USHORT",value:0},{name:"fsType",type:"USHORT",value:0},{name:"ySubscriptXSize",type:"SHORT",value:650},{name:"ySubscriptYSize",type:"SHORT",value:699},{name:"ySubscriptXOffset",type:"SHORT",value:0},{name:"ySubscriptYOffset",type:"SHORT",value:140},{name:"ySuperscriptXSize",type:"SHORT",value:650},{name:"ySuperscriptYSize",type:"SHORT",value:699},{name:"ySuperscriptXOffset",type:"SHORT",value:0},{name:"ySuperscriptYOffset",type:"SHORT",value:479},{name:"yStrikeoutSize",type:"SHORT",value:49},{name:"yStrikeoutPosition",type:"SHORT",value:258},{name:"sFamilyClass",type:"SHORT",value:0},{name:"bFamilyType",type:"BYTE",value:0},{name:"bSerifStyle",type:"BYTE",value:0},{name:"bWeight",type:"BYTE",value:0},{name:"bProportion",type:"BYTE",value:0},{name:"bContrast",type:"BYTE",value:0},{name:"bStrokeVariation",type:"BYTE",value:0},{name:"bArmStyle",type:"BYTE",value:0},{name:"bLetterform",type:"BYTE",value:0},{name:"bMidline",type:"BYTE",value:0},{name:"bXHeight",type:"BYTE",value:0},{name:"ulUnicodeRange1",type:"ULONG",value:0},{name:"ulUnicodeRange2",type:"ULONG",value:0},{name:"ulUnicodeRange3",type:"ULONG",value:0},{name:"ulUnicodeRange4",type:"ULONG",value:0},{name:"achVendID",type:"CHARARRAY",value:"XXXX"},{name:"fsSelection",type:"USHORT",value:0},{name:"usFirstCharIndex",type:"USHORT",value:0},{name:"usLastCharIndex",type:"USHORT",value:0},{name:"sTypoAscender",type:"SHORT",value:0},{name:"sTypoDescender",type:"SHORT",value:0},{name:"sTypoLineGap",type:"SHORT",value:0},{name:"usWinAscent",type:"USHORT",value:0},{name:"usWinDescent",type:"USHORT",value:0},{name:"ulCodePageRange1",type:"ULONG",value:0},{name:"ulCodePageRange2",type:"ULONG",value:0},{name:"sxHeight",type:"SHORT",value:0},{name:"sCapHeight",type:"SHORT",value:0},{name:"usDefaultChar",type:"USHORT",value:0},{name:"usBreakChar",type:"USHORT",value:0},{name:"usMaxContext",type:"USHORT",value:0}],e)},unicodeRanges:ft,getUnicodeRange:function(e){for(var t=0;t<ft.length;t+=1){var r=ft[t];if(e>=r.begin&&e<r.end)return t}return-1}};var pt={parse:function(e,t){var r={},o=new R.Parser(e,t);switch(r.version=o.parseVersion(),r.italicAngle=o.parseFixed(),r.underlinePosition=o.parseShort(),r.underlineThickness=o.parseShort(),r.isFixedPitch=o.parseULong(),r.minMemType42=o.parseULong(),r.maxMemType42=o.parseULong(),r.minMemType1=o.parseULong(),r.maxMemType1=o.parseULong(),r.version){case 1:r.names=c.slice();break;case 2:r.numberOfGlyphs=o.parseUShort(),r.glyphNameIndex=new Array(r.numberOfGlyphs);for(var n=0;n<r.numberOfGlyphs;n++)r.glyphNameIndex[n]=o.parseUShort();r.names=[];for(var s,i=0;i<r.numberOfGlyphs;i++)r.glyphNameIndex[i]>=c.length&&(s=o.parseChar(),r.names.push(o.parseString(s)));break;case 2.5:r.numberOfGlyphs=o.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var a=0;a<r.numberOfGlyphs;a++)r.offset[a]=o.parseChar()}return r},make:function(){return new S.Table("post",[{name:"version",type:"FIXED",value:196608},{name:"italicAngle",type:"FIXED",value:0},{name:"underlinePosition",type:"FWORD",value:0},{name:"underlineThickness",type:"FWORD",value:0},{name:"isFixedPitch",type:"ULONG",value:0},{name:"minMemType42",type:"ULONG",value:0},{name:"maxMemType42",type:"ULONG",value:0},{name:"minMemType1",type:"ULONG",value:0},{name:"maxMemType1",type:"ULONG",value:0}])}},o=new Array(9),s=(o[1]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();return 1===t?{substFormat:1,coverage:this.parsePointer(u.coverage),deltaGlyphId:this.parseUShort()}:2===t?{substFormat:2,coverage:this.parsePointer(u.coverage),substitute:this.parseOffset16List()}:void A.assert(!1,"0x"+e.toString(16)+": lookup type 1 format must be 1 or 2.")},o[2]=function(){var e=this.parseUShort();return A.argument(1===e,"GSUB Multiple Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(u.coverage),sequences:this.parseListOfLists()}},o[3]=function(){var e=this.parseUShort();return A.argument(1===e,"GSUB Alternate Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(u.coverage),alternateSets:this.parseListOfLists()}},o[4]=function(){var e=this.parseUShort();return A.argument(1===e,"GSUB ligature table identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(u.coverage),ligatureSets:this.parseListOfLists(function(){return{ligGlyph:this.parseUShort(),components:this.parseUShortList(this.parseUShort()-1)}})}},{sequenceIndex:u.uShort,lookupListIndex:u.uShort});o[5]=function(){var e,t,r=this.offset+this.relativeOffset,o=this.parseUShort();return 1===o?{substFormat:o,coverage:this.parsePointer(u.coverage),ruleSets:this.parseListOfLists(function(){var e=this.parseUShort(),t=this.parseUShort();return{input:this.parseUShortList(e-1),lookupRecords:this.parseRecordList(t,s)}})}:2===o?{substFormat:o,coverage:this.parsePointer(u.coverage),classDef:this.parsePointer(u.classDef),classSets:this.parseListOfLists(function(){var e=this.parseUShort(),t=this.parseUShort();return{classes:this.parseUShortList(e-1),lookupRecords:this.parseRecordList(t,s)}})}:3===o?(e=this.parseUShort(),t=this.parseUShort(),{substFormat:o,coverages:this.parseList(e,u.pointer(u.coverage)),lookupRecords:this.parseRecordList(t,s)}):void A.assert(!1,"0x"+r.toString(16)+": lookup type 5 format must be 1, 2 or 3.")},o[6]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();return 1===t?{substFormat:1,coverage:this.parsePointer(u.coverage),chainRuleSets:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(s)}})}:2===t?{substFormat:2,coverage:this.parsePointer(u.coverage),backtrackClassDef:this.parsePointer(u.classDef),inputClassDef:this.parsePointer(u.classDef),lookaheadClassDef:this.parsePointer(u.classDef),chainClassSet:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(s)}})}:3===t?{substFormat:3,backtrackCoverage:this.parseList(u.pointer(u.coverage)),inputCoverage:this.parseList(u.pointer(u.coverage)),lookaheadCoverage:this.parseList(u.pointer(u.coverage)),lookupRecords:this.parseRecordList(s)}:void A.assert(!1,"0x"+e.toString(16)+": lookup type 6 format must be 1, 2 or 3.")},o[7]=function(){var e=this.parseUShort(),e=(A.argument(1===e,"GSUB Extension Substitution subtable identifier-format must be 1"),this.parseUShort()),t=new u(this.data,this.offset+this.parseULong());return{substFormat:1,lookupType:e,extension:o[e].call(t)}},o[8]=function(){var e=this.parseUShort();return A.argument(1===e,"GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(u.coverage),backtrackCoverage:this.parseList(u.pointer(u.coverage)),lookaheadCoverage:this.parseList(u.pointer(u.coverage)),substitutes:this.parseUShortList()}};var mt=new Array(9);mt[1]=function(e){return 1===e.substFormat?new S.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new S.Coverage(e.coverage)},{name:"deltaGlyphID",type:"USHORT",value:e.deltaGlyphId}]):new S.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:2},{name:"coverage",type:"TABLE",value:new S.Coverage(e.coverage)}].concat(S.ushortList("substitute",e.substitute)))},mt[3]=function(e){return A.assert(1===e.substFormat,"Lookup type 3 substFormat must be 1."),new S.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new S.Coverage(e.coverage)}].concat(S.tableList("altSet",e.alternateSets,function(e){return new S.Table("alternateSetTable",S.ushortList("alternate",e))})))},mt[4]=function(e){return A.assert(1===e.substFormat,"Lookup type 4 substFormat must be 1."),new S.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new S.Coverage(e.coverage)}].concat(S.tableList("ligSet",e.ligatureSets,function(e){return new S.Table("ligatureSetTable",S.tableList("ligature",e,function(e){return new S.Table("ligatureTable",[{name:"ligGlyph",type:"USHORT",value:e.ligGlyph}].concat(S.ushortList("component",e.components,e.components.length+1)))}))})))};var yt={parse:function(e,t){return t=(e=new u(e,t=t||0)).parseVersion(1),A.argument(1===t||1.1===t,"Unsupported GSUB table version."),1===t?{version:t,scripts:e.parseScriptList(),features:e.parseFeatureList(),lookups:e.parseLookupList(o)}:{version:t,scripts:e.parseScriptList(),features:e.parseFeatureList(),lookups:e.parseLookupList(o),variations:e.parseFeatureVariationsList()}},make:function(e){return new S.Table("GSUB",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new S.ScriptList(e.scripts)},{name:"features",type:"TABLE",value:new S.FeatureList(e.features)},{name:"lookups",type:"TABLE",value:new S.LookupList(e.lookups,mt)}])}};var gt={parse:function(e,t){for(var r=new R.Parser(e,t),o=r.parseULong(),n=(A.argument(1===o,"Unsupported META table version."),r.parseULong(),r.parseULong(),r.parseULong()),s={},i=0;i<n;i++){var a=r.parseTag(),l=r.parseULong(),u=r.parseULong(),l=m.UTF8(e,t+l,u);s[a]=l}return s},make:function(e){var t,r=Object.keys(e).length,o="",n=16+12*r,s=new S.Table("meta",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"offset",type:"ULONG",value:n},{name:"numTags",type:"ULONG",value:r}]);for(t in e){var i=o.length;o+=e[t],s.fields.push({name:"tag "+t,type:"TAG",value:t}),s.fields.push({name:"offset "+t,type:"ULONG",value:n+i}),s.fields.push({name:"length "+t,type:"ULONG",value:e[t].length})}return s.fields.push({name:"stringPool",type:"CHARARRAY",value:o}),s}};function vt(e){return Math.log(e)/Math.log(2)|0}function bt(e){for(;e.length%4!=0;)e.push(0);for(var t=0,r=0;r<e.length;r+=4)t+=(e[r]<<24)+(e[r+1]<<16)+(e[r+2]<<8)+e[r+3];return t%=Math.pow(2,32)}function jt(e,t,r,o){return new S.Record("Table Record",[{name:"tag",type:"TAG",value:void 0!==e?e:""},{name:"checkSum",type:"ULONG",value:void 0!==t?t:0},{name:"offset",type:"ULONG",value:void 0!==r?r:0},{name:"length",type:"ULONG",value:void 0!==o?o:0}])}function _t(e){for(var t=new S.Table("sfnt",[{name:"version",type:"TAG",value:"OTTO"},{name:"numTables",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]),r=(t.tables=e,t.numTables=e.length,Math.pow(2,vt(t.numTables))),o=(t.searchRange=16*r,t.entrySelector=vt(r),t.rangeShift=16*t.numTables-t.searchRange,[]),n=[],s=t.sizeOf()+jt().sizeOf()*t.numTables;s%4!=0;)s+=1,n.push({name:"padding",type:"BYTE",value:0});for(var i=0;i<e.length;i+=1){var a=e[i],l=(A.argument(4===a.tableName.length,"Table name"+a.tableName+" is invalid."),a.sizeOf()),u=jt(a.tableName,bt(a.encode()),s,l);for(o.push({name:u.tag+" Table Record",type:"RECORD",value:u}),n.push({name:a.tableName+" table",type:"RECORD",value:a}),s+=l,A.argument(!isNaN(s),"Something went wrong calculating the offset.");s%4!=0;)s+=1,n.push({name:"padding",type:"BYTE",value:0})}return o.sort(function(e,t){return e.value.tag>t.value.tag?1:-1}),t.fields=t.fields.concat(o),t.fields=t.fields.concat(n),t}function xt(e,t,r){for(var o=0;o<t.length;o+=1){var n=e.charToGlyphIndex(t[o]);if(0<n)return e.glyphs.get(n).getMetrics()}return r}var wt={make:_t,fontToTable:function(e){for(var t,r=[],o=[],n=[],s=[],i=[],a=[],l=[],u=0,c=0,d=0,f=0,h=0,p=0;p<e.glyphs.length;p+=1){var m=e.glyphs.get(p),y=0|m.unicode;if(isNaN(m.advanceWidth))throw new Error("Glyph "+m.name+" ("+p+"): advanceWidth is not a number.");(y<t||void 0===t)&&0<y&&(t=y),u<y&&(u=y);var y=ht.getUnicodeRange(y);if(y<32)c|=1<<y;else if(y<64)d|=1<<y-32;else if(y<96)f|=1<<y-64;else{if(!(y<123))throw new Error("Unicode ranges bits > 123 are reserved for internal usage");h|=1<<y-96}".notdef"!==m.name&&(y=m.getMetrics(),r.push(y.xMin),o.push(y.yMin),n.push(y.xMax),s.push(y.yMax),a.push(y.leftSideBearing),l.push(y.rightSideBearing),i.push(m.advanceWidth))}var g,v={xMin:Math.min.apply(null,r),yMin:Math.min.apply(null,o),xMax:Math.max.apply(null,n),yMax:Math.max.apply(null,s),advanceWidthMax:Math.max.apply(null,i),advanceWidthAvg:function(e){for(var t=0,r=0;r<e.length;r+=1)t+=e[r];return t/e.length}(i),minLeftSideBearing:Math.min.apply(null,a),maxLeftSideBearing:Math.max.apply(null,a),minRightSideBearing:Math.min.apply(null,l)},b=(v.ascender=e.ascender,v.descender=e.descender,Ze.make({flags:3,unitsPerEm:e.unitsPerEm,xMin:v.xMin,yMin:v.yMin,xMax:v.xMax,yMax:v.yMax,lowestRecPPEM:3,createdTimestamp:e.createdTimestamp})),j=Qe.make({ascender:v.ascender,descender:v.descender,advanceWidthMax:v.advanceWidthMax,minLeftSideBearing:v.minLeftSideBearing,minRightSideBearing:v.minRightSideBearing,xMaxExtent:v.maxLeftSideBearing+(v.xMax-v.xMin),numberOfHMetrics:e.glyphs.length}),_=$e.make(e.glyphs.length),x=ht.make({xAvgCharWidth:Math.round(v.advanceWidthAvg),usWeightClass:e.tables.os2.usWeightClass,usWidthClass:e.tables.os2.usWidthClass,usFirstCharIndex:t,usLastCharIndex:u,ulUnicodeRange1:c,ulUnicodeRange2:d,ulUnicodeRange3:f,ulUnicodeRange4:h,fsSelection:e.tables.os2.fsSelection,sTypoAscender:v.ascender,sTypoDescender:v.descender,sTypoLineGap:0,usWinAscent:v.yMax,usWinDescent:Math.abs(v.yMin),ulCodePageRange1:1,sxHeight:xt(e,"xyvw",{yMax:Math.round(v.ascender/2)}).yMax,sCapHeight:xt(e,"HIKLEFJMNTZBDPRAGOQSUVWXY",v).yMax,usDefaultChar:e.hasChar(" ")?32:0,usBreakChar:e.hasChar(" ")?32:0}),w=Je.make(e.glyphs),S=we.make(e.glyphs),M=e.getEnglishName("fontFamily"),E=e.getEnglishName("fontSubfamily"),T=M+" "+E,C=(C=e.getEnglishName("postScriptName"))||M.replace(/\s/g,"")+"-"+E,O={};for(g in e.names)O[g]=e.names[g];O.uniqueID||(O.uniqueID={en:e.getEnglishName("manufacturer")+":"+T}),O.postScriptName||(O.postScriptName={en:C}),O.preferredFamily||(O.preferredFamily=e.names.fontFamily),O.preferredSubfamily||(O.preferredSubfamily=e.names.fontSubfamily);var k=[],L=dt.make(O,k),k=0<k.length?Ke.make(k):void 0,P=pt.make(),T=Ye.make(e.glyphs,{version:e.getEnglishName("version"),fullName:T,familyName:M,weightName:E,postScriptName:C,unitsPerEm:e.unitsPerEm,fontBBox:[0,v.yMin,v.ascender,v.advanceWidthMax]}),M=e.metas&&0<Object.keys(e.metas).length?gt.make(e.metas):void 0,E=[b,j,_,x,L,S,P,T,w];k&&E.push(k),e.tables.gsub&&E.push(yt.make(e.tables.gsub)),M&&E.push(M);for(var D=bt((C=_t(E)).encode()),A=C.fields,R=!1,I=0;I<A.length;I+=1)if("head table"===A[I].name){A[I].value.checkSumAdjustment=2981146554-D,R=!0;break}if(R)return C;throw new Error("Could not find head table with checkSum to adjust.")},computeCheckSum:bt};function St(e,t){for(var r=0,o=e.length-1;r<=o;){var n=r+o>>>1,s=e[n].tag;if(s===t)return n;s<t?r=1+n:o=n-1}return-r-1}function Mt(e,t){for(var r=0,o=e.length-1;r<=o;){var n=r+o>>>1,s=e[n];if(s===t)return n;s<t?r=1+n:o=n-1}return-r-1}function Et(e,t){for(var r=0,o=e.length-1;r<=o;){var n,s=r+o>>>1,i=(n=e[s]).start;if(i===t)return n;i<t?r=1+s:o=s-1}if(0<r)return t>(n=e[r-1]).end?0:n}function Tt(e,t){this.font=e,this.tableName=t}function Ct(e){Tt.call(this,e,"gpos")}function i(e){Tt.call(this,e,"gsub")}function Ot(e,t,r){for(var o=e.subtables,n=0;n<o.length;n++){var s=o[n];if(s.substFormat===t)return s}if(r)return o.push(r),r}function kt(e){for(var t=new ArrayBuffer(e.length),r=new Uint8Array(t),o=0;o<e.length;++o)r[o]=e[o];return t}function _(e,t){if(!e)throw t}function Lt(e,t,r,o,n){var s=0<(t&o)?(s=e.parseByte(),r+(s=0==(t&n)?-s:s)):0<(t&n)?r:r+e.parseShort();return s}function Pt(e,t,r){var o,n=new R.Parser(t,r);if(e.numberOfContours=n.parseShort(),e._xMin=n.parseShort(),e._yMin=n.parseShort(),e._xMax=n.parseShort(),e._yMax=n.parseShort(),0<e.numberOfContours){for(var s=e.endPointIndices=[],i=0;i<e.numberOfContours;i+=1)s.push(n.parseUShort());e.instructionLength=n.parseUShort(),e.instructions=[];for(var a=0;a<e.instructionLength;a+=1)e.instructions.push(n.parseByte());for(var l=s[s.length-1]+1,u=[],c=0;c<l;c+=1)if(o=n.parseByte(),u.push(o),0<(8&o))for(var d=n.parseByte(),f=0;f<d;f+=1)u.push(o),c+=1;if(A.argument(u.length===l,"Bad flags."),0<s.length){var h,p=[];if(0<l){for(var m=0;m<l;m+=1)o=u[m],(h={}).onCurve=!!(1&o),h.lastPointOfContour=0<=s.indexOf(m),p.push(h);for(var y=0,g=0;g<l;g+=1)o=u[g],(h=p[g]).x=Lt(n,o,y,2,16),y=h.x;for(var v=0,b=0;b<l;b+=1)o=u[b],(h=p[b]).y=Lt(n,o,v,4,32),v=h.y}e.points=p}else e.points=[]}else if(0===e.numberOfContours)e.points=[];else{e.isComposite=!0,e.points=[],e.components=[];for(var j=!0;j;){u=n.parseUShort();var _={glyphIndex:n.parseUShort(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};0<(1&u)?0<(2&u)?(_.dx=n.parseShort(),_.dy=n.parseShort()):_.matchedPoints=[n.parseUShort(),n.parseUShort()]:0<(2&u)?(_.dx=n.parseChar(),_.dy=n.parseChar()):_.matchedPoints=[n.parseByte(),n.parseByte()],0<(8&u)?_.xScale=_.yScale=n.parseF2Dot14():0<(64&u)?(_.xScale=n.parseF2Dot14(),_.yScale=n.parseF2Dot14()):0<(128&u)&&(_.xScale=n.parseF2Dot14(),_.scale01=n.parseF2Dot14(),_.scale10=n.parseF2Dot14(),_.yScale=n.parseF2Dot14()),e.components.push(_),j=!!(32&u)}if(256&u){e.instructionLength=n.parseUShort(),e.instructions=[];for(var x=0;x<e.instructionLength;x+=1)e.instructions.push(n.parseByte())}}}function At(e,t){for(var r=[],o=0;o<e.length;o+=1){var n=e[o],n={x:t.xScale*n.x+t.scale01*n.y+t.dx,y:t.scale10*n.x+t.yScale*n.y+t.dy,onCurve:n.onCurve,lastPointOfContour:n.lastPointOfContour};r.push(n)}return r}function Rt(e){var t=new f;if(e)for(var r=function(e){for(var t=[],r=[],o=0;o<e.length;o+=1){var n=e[o];r.push(n),n.lastPointOfContour&&(t.push(r),r=[])}return A.argument(0===r.length,"There are still points left in the current contour."),t}(e),o=0;o<r.length;++o){var n,s=r[o],i=s[s.length-1],a=s[0];i.onCurve?t.moveTo(i.x,i.y):a.onCurve?t.moveTo(a.x,a.y):(n={x:.5*(i.x+a.x),y:.5*(i.y+a.y)},t.moveTo(n.x,n.y));for(var l=0;l<s.length;++l){var u,c=i,i=a,a=s[(l+1)%s.length];i.onCurve?t.lineTo(i.x,i.y):(u=a,c.onCurve||(i.x,c.x,i.y,c.y),a.onCurve||(u={x:.5*(i.x+a.x),y:.5*(i.y+a.y)}),t.quadraticCurveTo(i.x,i.y,u.x,u.y))}t.closePath()}return t}function It(e,t){if(t.isComposite)for(var r=0;r<t.components.length;r+=1){var o=t.components[r],n=e.get(o.glyphIndex);if(n.getPath(),n.points){var s=void 0;if(void 0===o.matchedPoints)s=At(n.points,o);else{if(o.matchedPoints[0]>t.points.length-1||o.matchedPoints[1]>n.points.length-1)throw Error("Matched points out of range in "+t.name);var i=t.points[o.matchedPoints[0]],a=n.points[o.matchedPoints[1]],o={xScale:o.xScale,scale01:o.scale01,scale10:o.scale10,yScale:o.yScale,dx:0,dy:0},a=At([a],o)[0];o.dx=i.x-a.x,o.dy=i.y-a.y,s=At(n.points,o)}t.points=t.points.concat(s)}}return Rt(t.points)}(Ct.prototype=Tt.prototype={searchTag:St,binSearch:Mt,getTable:function(e){var t=this.font.tables[this.tableName];return t=!t&&e?this.font.tables[this.tableName]=this.createDefaultTable():t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,r=0;r<e.scripts.length;r++){var o=e.scripts[r].tag;if("DFLT"===o)return o;"latn"===o&&(t=!0)}return t?"latn":void 0}},getScriptTable:function(e,t){var r,o=this.getTable(t);if(o)return r=o.scripts,0<=(o=St(o.scripts,e=e||"DFLT"))?r[o].script:t?(r.splice(-1-o,0,t={tag:e,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}}),t.script):void 0},getLangSysTable:function(e,t,r){var o,e=this.getScriptTable(e,r);if(e)return t&&"dflt"!==t&&"DFLT"!==t?0<=(o=St(e.langSysRecords,t))?e.langSysRecords[o].langSys:r?(e.langSysRecords.splice(-1-o,0,r={tag:t,langSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]}}),r.langSys):void 0:e.defaultLangSys},getFeatureTable:function(e,t,r,o){e=this.getLangSysTable(e,t,o);if(e){for(var n,s=e.featureIndexes,i=this.font.tables[this.tableName].features,a=0;a<s.length;a++)if((n=i[s[a]]).tag===r)return n.feature;if(o)return t=i.length,A.assert(0===t||r>=i[t-1].tag,"Features must be added in alphabetical order."),i.push(n={tag:r,feature:{params:0,lookupListIndexes:[]}}),s.push(t),n.feature}},getLookupTables:function(e,t,r,o,n){var e=this.getFeatureTable(e,t,r,n),s=[];if(e){for(var i,a=e.lookupListIndexes,l=this.font.tables[this.tableName].lookups,u=0;u<a.length;u++)(i=l[a[u]]).lookupType===o&&s.push(i);if(0===s.length&&n)return t=l.length,l.push(i={lookupType:o,lookupFlag:0,subtables:[],markFilteringSet:void 0}),a.push(t),[i]}return s},getGlyphClass:function(e,t){switch(e.format){case 1:return e.startGlyph<=t&&t<e.startGlyph+e.classes.length?e.classes[t-e.startGlyph]:0;case 2:var r=Et(e.ranges,t);return r?r.classId:0}},getCoverageIndex:function(e,t){switch(e.format){case 1:var r=Mt(e.glyphs,t);return 0<=r?r:-1;case 2:r=Et(e.ranges,t);return r?r.index+t-r.start:-1}},expandCoverage:function(e){if(1===e.format)return e.glyphs;for(var t=[],r=e.ranges,o=0;o<r.length;o++)for(var n=r[o],s=n.start,i=n.end,a=s;a<=i;a++)t.push(a);return t}}).init=function(){var e=this.getDefaultScriptName();this.defaultKerningTables=this.getKerningTables(e)},Ct.prototype.getKerningValue=function(e,t,r){for(var o=0;o<e.length;o++)for(var n=e[o].subtables,s=0;s<n.length;s++){var i=n[s],a=this.getCoverageIndex(i.coverage,t);if(!(a<0))switch(i.posFormat){case 1:for(var l=i.pairSets[a],u=0;u<l.length;u++){var c=l[u];if(c.secondGlyph===r)return c.value1&&c.value1.xAdvance||0}break;case 2:var d=this.getGlyphClass(i.classDef1,t),f=this.getGlyphClass(i.classDef2,r),d=i.classRecords[d][f];return d.value1&&d.value1.xAdvance||0}}return 0},Ct.prototype.getKerningTables=function(e,t){if(this.font.tables.gpos)return this.getLookupTables(e,t,"kern",2)},(i.prototype=Tt.prototype).createDefaultTable=function(){return{version:1,scripts:[{tag:"DFLT",script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}}],features:[],lookups:[]}},i.prototype.getSingle=function(e,t,r){for(var o=[],n=this.getLookupTables(t,r,e,1),s=0;s<n.length;s++)for(var i=n[s].subtables,a=0;a<i.length;a++){var l=i[a],u=this.expandCoverage(l.coverage),c=void 0;if(1===l.substFormat)for(var d=l.deltaGlyphId,c=0;c<u.length;c++){var f=u[c];o.push({sub:f,by:f+d})}else{var h=l.substitute;for(c=0;c<u.length;c++)o.push({sub:u[c],by:h[c]})}}return o},i.prototype.getAlternates=function(e,t,r){for(var o=[],n=this.getLookupTables(t,r,e,3),s=0;s<n.length;s++)for(var i=n[s].subtables,a=0;a<i.length;a++)for(var l=i[a],u=this.expandCoverage(l.coverage),c=l.alternateSets,d=0;d<u.length;d++)o.push({sub:u[d],by:c[d]});return o},i.prototype.getLigatures=function(e,t,r){for(var o=[],n=this.getLookupTables(t,r,e,4),s=0;s<n.length;s++)for(var i=n[s].subtables,a=0;a<i.length;a++)for(var l=i[a],u=this.expandCoverage(l.coverage),c=l.ligatureSets,d=0;d<u.length;d++)for(var f=u[d],h=c[d],p=0;p<h.length;p++){var m=h[p];o.push({sub:[f].concat(m.components),by:m.ligGlyph})}return o},i.prototype.addSingle=function(e,t,r,o){r=Ot(this.getLookupTables(r,o,e,1,!0)[0],2,{substFormat:2,coverage:{format:1,glyphs:[]},substitute:[]}),A.assert(1===r.coverage.format,"Ligature: unable to modify coverage table format "+r.coverage.format),o=t.sub,e=this.binSearch(r.coverage.glyphs,o);e<0&&(r.coverage.glyphs.splice(e=-1-e,0,o),r.substitute.splice(e,0,0)),r.substitute[e]=t.by},i.prototype.addAlternate=function(e,t,r,o){r=Ot(this.getLookupTables(r,o,e,3,!0)[0],1,{substFormat:1,coverage:{format:1,glyphs:[]},alternateSets:[]}),A.assert(1===r.coverage.format,"Ligature: unable to modify coverage table format "+r.coverage.format),o=t.sub,e=this.binSearch(r.coverage.glyphs,o);e<0&&(r.coverage.glyphs.splice(e=-1-e,0,o),r.alternateSets.splice(e,0,0)),r.alternateSets[e]=t.by},i.prototype.addLigature=function(e,t,r,o){var r=this.getLookupTables(r,o,e,4,!0)[0],o=r.subtables[0],e=(o||(r.subtables[0]=o={substFormat:1,coverage:{format:1,glyphs:[]},ligatureSets:[]}),A.assert(1===o.coverage.format,"Ligature: unable to modify coverage table format "+o.coverage.format),t.sub[0]),n=t.sub.slice(1),r={ligGlyph:t.by,components:n},t=this.binSearch(o.coverage.glyphs,e);if(0<=t){for(var s=o.ligatureSets[t],i=0;i<s.length;i++)if(function(e,t){var r=e.length;if(r===t.length){for(var o=0;o<r;o++)if(e[o]!==t[o])return;return 1}}(s[i].components,n))return;s.push(r)}else o.coverage.glyphs.splice(t=-1-t,0,e),o.ligatureSets.splice(t,0,[r])},i.prototype.getFeature=function(e,t,r){if(/ss\d\d/.test(e))return this.getSingle(e,t,r);switch(e){case"aalt":case"salt":return this.getSingle(e,t,r).concat(this.getAlternates(e,t,r));case"dlig":case"liga":case"rlig":return this.getLigatures(e,t,r)}},i.prototype.add=function(e,t,r,o){if(/ss\d\d/.test(e))return this.addSingle(e,t,r,o);switch(e){case"aalt":case"salt":return"number"==typeof t.by?this.addSingle(e,t,r,o):this.addAlternate(e,t,r,o);case"dlig":case"liga":case"rlig":return this.addLigature(e,t,r,o)}};var Dt={getPath:Rt,parse:function(e,t,r,o){for(var n=new p.GlyphSet(o),s=0;s<r.length-1;s+=1){var i=r[s];i!==r[s+1]?n.push(s,p.ttfGlyphLoader(o,s,Pt,e,t+i,It)):n.push(s,p.glyphLoader(o,s))}return n}};function Ut(e){this.font=e,this.getCommands=function(e){return Dt.getPath(e).commands},this._fpgmState=this._prepState=void 0,this._errorState=0}function Nt(e){return e}function Ft(e){return Math.sign(e)*Math.round(Math.abs(e))}function Bt(e){return Math.sign(e)*Math.round(Math.abs(2*e))/2}function Gt(e){return Math.sign(e)*(Math.round(Math.abs(e)+.5)-.5)}function Vt(e){return Math.sign(e)*Math.ceil(Math.abs(e))}function zt(e){return Math.sign(e)*Math.floor(Math.abs(e))}function Ht(e){var t=this.srPeriod,r=this.srPhase,o=1;return e<0&&(e=-e,o=-1),e+=this.srThreshold-r,e=Math.trunc(e/t)*t,(e+=r)<0?r*o:e*o}var x={x:1,y:0,axis:"x",distance:function(e,t,r,o){return(r?e.xo:e.x)-(o?t.xo:t.x)},interpolate:function(e,t,r,o){var n,s,i,a,l,u,c;if(!o||o===this)return n=e.xo-t.xo,s=e.xo-r.xo,l=t.x-t.xo,u=r.x-r.xo,0===(c=(i=Math.abs(n))+(a=Math.abs(s)))?void(e.x=e.xo+(l+u)/2):void(e.x=e.xo+(l*a+u*i)/c);n=o.distance(e,t,!0,!0),s=o.distance(e,r,!0,!0),l=o.distance(t,t,!1,!0),u=o.distance(r,r,!1,!0),0===(c=(i=Math.abs(n))+(a=Math.abs(s)))?x.setRelative(e,e,(l+u)/2,o,!0):x.setRelative(e,e,(l*a+u*i)/c,o,!0)},normalSlope:Number.NEGATIVE_INFINITY,setRelative:function(e,t,r,o,n){var s,i;o&&o!==this?(s=n?t.xo:t.x,i=n?t.yo:t.y,s+=r*o.x,i+=r*o.y,e.x=s+(e.y-i)/o.normalSlope):e.x=(n?t.xo:t.x)+r},slope:0,touch:function(e){e.xTouched=!0},touched:function(e){return e.xTouched},untouch:function(e){e.xTouched=!1}},M={x:0,y:1,axis:"y",distance:function(e,t,r,o){return(r?e.yo:e.y)-(o?t.yo:t.y)},interpolate:function(e,t,r,o){var n,s,i,a,l,u,c;if(!o||o===this)return n=e.yo-t.yo,s=e.yo-r.yo,l=t.y-t.yo,u=r.y-r.yo,0===(c=(i=Math.abs(n))+(a=Math.abs(s)))?void(e.y=e.yo+(l+u)/2):void(e.y=e.yo+(l*a+u*i)/c);n=o.distance(e,t,!0,!0),s=o.distance(e,r,!0,!0),l=o.distance(t,t,!1,!0),u=o.distance(r,r,!1,!0),0===(c=(i=Math.abs(n))+(a=Math.abs(s)))?M.setRelative(e,e,(l+u)/2,o,!0):M.setRelative(e,e,(l*a+u*i)/c,o,!0)},normalSlope:0,setRelative:function(e,t,r,o,n){var s,i;o&&o!==this?(s=n?t.xo:t.x,i=n?t.yo:t.y,s+=r*o.x,i+=r*o.y,e.y=i+o.normalSlope*(e.x-s)):e.y=(n?t.yo:t.y)+r},slope:Number.POSITIVE_INFINITY,touch:function(e){e.yTouched=!0},touched:function(e){return e.yTouched},untouch:function(e){e.yTouched=!1}};function Wt(e,t){this.x=e,this.y=t,this.axis=void 0,this.slope=t/e,this.normalSlope=-e/t,Object.freeze(this)}function qt(e,t){var r=Math.sqrt(e*e+t*t);return t/=r,1===(e/=r)&&0===t?x:0===e&&1===t?M:new Wt(e,t)}function E(e,t,r,o){this.x=this.xo=Math.round(64*e)/64,this.y=this.yo=Math.round(64*t)/64,this.lastPointOfContour=r,this.onCurve=o,this.prevPointOnContour=void 0,this.nextPointOnContour=void 0,this.xTouched=!1,this.yTouched=!1,Object.preventExtensions(this)}Object.freeze(x),Object.freeze(M),Wt.prototype.distance=function(e,t,r,o){return this.x*x.distance(e,t,r,o)+this.y*M.distance(e,t,r,o)},Wt.prototype.interpolate=function(e,t,r,o){var n=o.distance(e,t,!0,!0),s=o.distance(e,r,!0,!0),t=o.distance(t,t,!1,!0),r=o.distance(r,r,!1,!0),n=Math.abs(n),s=Math.abs(s),i=n+s;0===i?this.setRelative(e,e,(t+r)/2,o,!0):this.setRelative(e,e,(t*s+r*n)/i,o,!0)},Wt.prototype.setRelative=function(e,t,r,o,n){var s=n?t.xo:t.x,n=n?t.yo:t.y,t=s+r*(o=o||this).x,s=n+r*o.y,n=o.normalSlope,r=this.slope,o=e.x,i=e.y;e.x=(r*o-n*t+s-i)/(r-n),e.y=r*(e.x-o)+i},Wt.prototype.touch=function(e){e.xTouched=!0,e.yTouched=!0},E.prototype.nextTouched=function(e){for(var t=this.nextPointOnContour;!e.touched(t)&&t!==this;)t=t.nextPointOnContour;return t},E.prototype.prevTouched=function(e){for(var t=this.prevPointOnContour;!e.touched(t)&&t!==this;)t=t.prevPointOnContour;return t};var Xt=Object.freeze(new E(0,0)),Yt={cvCutIn:17/16,deltaBase:9,deltaShift:.125,loop:1,minDis:1,autoFlip:!0};function T(e,t){switch(this.env=e,this.stack=[],this.prog=t,e){case"glyf":this.zp0=this.zp1=this.zp2=1,this.rp0=this.rp1=this.rp2=0;case"prep":this.fv=this.pv=this.dpv=x,this.round=Ft}}function Zt(e){for(var t=e.tZone=new Array(e.gZone.length),r=0;r<t.length;r++)t[r]=new E(0,0)}function Qt(e,t){var r,o=e.prog,n=e.ip,s=1;do{if(88===(r=o[++n]))s++;else if(89===r)s--;else if(64===r)n+=o[n+1]+1;else if(65===r)n+=2*o[n+1]+1;else if(176<=r&&r<=183)n+=r-176+1;else if(184<=r&&r<=191)n+=2*(r-184+1);else if(t&&1===s&&27===r)break}while(0<s);e.ip=n}function Jt(e,t){j.DEBUG&&console.log(t.step,"SVTCA["+e.axis+"]"),t.fv=t.pv=t.dpv=e}function Kt(e,t){j.DEBUG&&console.log(t.step,"SPVTCA["+e.axis+"]"),t.pv=t.dpv=e}function $t(e,t){j.DEBUG&&console.log(t.step,"SFVTCA["+e.axis+"]"),t.fv=e}function er(e,t){var r,o=t.stack,n=o.pop(),o=o.pop(),s=t.z2[n],i=t.z1[o];j.DEBUG&&console.log("SPVTL["+e+"]",n,o),n=e?(r=s.y-i.y,i.x-s.x):(r=i.x-s.x,i.y-s.y),t.pv=t.dpv=qt(r,n)}function tr(e,t){var r,o=t.stack,n=o.pop(),o=o.pop(),s=t.z2[n],i=t.z1[o];j.DEBUG&&console.log("SFVTL["+e+"]",n,o),n=e?(r=s.y-i.y,i.x-s.x):(r=i.x-s.x,i.y-s.y),t.fv=qt(r,n)}function rr(e){j.DEBUG&&console.log(e.step,"POP[]"),e.stack.pop()}function or(e,t){var r=t.stack.pop(),o=t.z0[r],n=t.fv,s=t.pv,i=(j.DEBUG&&console.log(t.step,"MDAP["+e+"]",r),s.distance(o,Xt));e&&(i=t.round(i)),n.setRelative(o,Xt,i,s),n.touch(o),t.rp0=t.rp1=r}function nr(e,t){var r,o,n,s=t.z2,i=s.length-2;j.DEBUG&&console.log(t.step,"IUP["+e.axis+"]");for(var a=0;a<i;a++)r=s[a],e.touched(r)||(o=r.prevTouched(e))!==r&&(o===(n=r.nextTouched(e))&&e.setRelative(r,r,e.distance(o,o,!1,!0),e,!0),e.interpolate(r,o,n,e))}function sr(e,t){for(var r=t.stack,o=e?t.rp1:t.rp2,n=(e?t.z0:t.z1)[o],s=t.fv,i=t.pv,a=t.loop,l=t.z2;a--;){var u=r.pop(),c=l[u],d=i.distance(n,n,!1,!0);s.setRelative(c,c,d,i),s.touch(c),j.DEBUG&&console.log(t.step,(1<t.loop?"loop "+(t.loop-a)+": ":"")+"SHP["+(e?"rp1":"rp2")+"]",u)}t.loop=1}function ir(e,t){for(var r=t.stack,o=e?t.rp1:t.rp2,n=(e?t.z0:t.z1)[o],s=t.fv,i=t.pv,o=r.pop(),a=t.z2[t.contours[o]],l=a,u=(j.DEBUG&&console.log(t.step,"SHC["+e+"]",o),i.distance(n,n,!1,!0));l!==n&&s.setRelative(l,l,u,i),(l=l.nextPointOnContour)!==a;);}function ar(e,t){var r,o,n=t.stack,s=e?t.rp1:t.rp2,s=(e?t.z0:t.z1)[s],i=t.fv,a=t.pv,n=n.pop();switch(j.DEBUG&&console.log(t.step,"SHZ["+e+"]",n),n){case 0:r=t.tZone;break;case 1:r=t.gZone;break;default:throw new Error("Invalid zone")}for(var l=a.distance(s,s,!1,!0),u=r.length-2,c=0;c<u;c++)o=r[c],i.setRelative(o,o,l,a)}function lr(e,t){var r=t.stack,o=r.pop()/64,r=r.pop(),n=t.z1[r],s=t.z0[t.rp0],i=t.fv,a=t.pv;i.setRelative(n,s,o,a),i.touch(n),j.DEBUG&&console.log(t.step,"MSIRP["+e+"]",o,r),t.rp1=t.rp0,t.rp2=r,e&&(t.rp0=r)}function ur(e,t){var r=t.stack,o=r.pop(),r=r.pop(),n=t.z0[r],s=t.fv,i=t.pv,a=t.cvt[o],o=(j.DEBUG&&console.log(t.step,"MIAP["+e+"]",o,"(",a,")",r),i.distance(n,Xt));e&&(Math.abs(o-a)<t.cvCutIn&&(o=a),o=t.round(o)),s.setRelative(n,Xt,o,i),0===t.zp0&&(n.xo=n.x,n.yo=n.y),s.touch(n),t.rp0=t.rp1=r}function cr(e,t){var r=t.stack,o=r.pop(),n=t.z2[o];j.DEBUG&&console.log(t.step,"GC["+e+"]",o),r.push(64*t.dpv.distance(n,Xt,e,!1))}function dr(e,t){var r=t.stack,o=r.pop(),r=r.pop(),n=t.z1[o],s=t.z0[r],s=t.dpv.distance(s,n,e,e);j.DEBUG&&console.log(t.step,"MD["+e+"]",o,r,"->",s),t.stack.push(Math.round(64*s))}function fr(e,t){var r=t.stack,o=r.pop(),n=t.fv,s=t.pv,i=t.ppem,a=t.deltaBase+16*(e-1),l=t.deltaShift,u=t.z0;j.DEBUG&&console.log(t.step,"DELTAP["+e+"]",o,r);for(var c=0;c<o;c++){var d=r.pop(),f=r.pop();a+((240&f)>>4)===i&&(0<=(f=(15&f)-8)&&f++,j.DEBUG&&console.log(t.step,"DELTAPFIX",d,"by",f*l),d=u[d],n.setRelative(d,d,f*l,s))}}function hr(e,t){var r=t.stack,o=r.pop();j.DEBUG&&console.log(t.step,"ROUND[]"),r.push(64*t.round(o/64))}function pr(e,t){var r=t.stack,o=r.pop(),n=t.ppem,s=t.deltaBase+16*(e-1),i=t.deltaShift;j.DEBUG&&console.log(t.step,"DELTAC["+e+"]",o,r);for(var a=0;a<o;a++){var l=r.pop(),u=r.pop();s+((240&u)>>4)===n&&(0<=(u=(15&u)-8)&&u++,u=u*i,j.DEBUG&&console.log(t.step,"DELTACFIX",l,"by",u),t.cvt[l]+=u)}}function mr(e,t){var r,o=t.stack,n=o.pop(),o=o.pop(),s=t.z2[n],i=t.z1[o];j.DEBUG&&console.log(t.step,"SDPVTL["+e+"]",n,o),n=e?(r=s.y-i.y,i.x-s.x):(r=i.x-s.x,i.y-s.y),t.dpv=qt(r,n)}function C(e,t){var r=t.stack,o=t.prog,n=t.ip;j.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(var s=0;s<e;s++)r.push(o[++n]);t.ip=n}function O(e,t){var r=t.ip,o=t.prog,n=t.stack;j.DEBUG&&console.log(t.ip,"PUSHW["+e+"]");for(var s=0;s<e;s++){var i=o[++r]<<8|o[++r];32768&i&&(i=-(1+(65535^i))),n.push(i)}t.ip=r}function k(e,t,r,o,n,s){var i,a,l=s.stack,u=e&&l.pop(),l=l.pop(),c=s.rp0,c=s.z0[c],d=s.z1[l],f=s.minDis,h=s.fv,p=s.dpv,m=i=p.distance(d,c,!0,!0),y=0<=m?1:-1;m=Math.abs(m),e&&(a=s.cvt[u],o&&Math.abs(m-a)<s.cvCutIn&&(m=a)),r&&m<f&&(m=f),o&&(m=s.round(m)),h.setRelative(d,c,y*m,p),h.touch(d),j.DEBUG&&console.log(s.step,(e?"MIRP[":"MDRP[")+(t?"M":"m")+(r?">":"_")+(o?"R":"_")+(0===n?"Gr":1===n?"Bl":2===n?"Wh":"")+"]",e?u+"("+s.cvt[u]+","+a+")":"",l,"(d =",i,"->",y*m,")"),s.rp1=s.rp0,s.rp2=l,t&&(s.rp0=l)}Ut.prototype.exec=function(e,t){if("number"!=typeof t)throw new Error("Point size is not a number!");if(!(2<this._errorState)){var r=this.font,o=this._prepState;if(!o||o.ppem!==t){var n=this._fpgmState;if(!n){T.prototype=Yt,(n=this._fpgmState=new T("fpgm",r.tables.fpgm)).funcs=[],n.font=r,j.DEBUG&&(console.log("---EXEC FPGM---"),n.step=-1);try{vr(n)}catch(e){return console.log("Hinting error in FPGM:"+e),void(this._errorState=3)}}T.prototype=n,(o=this._prepState=new T("prep",r.tables.prep)).ppem=t;var s=r.tables.cvt;if(s)for(var i=o.cvt=new Array(s.length),a=t/r.unitsPerEm,l=0;l<s.length;l++)i[l]=s[l]*a;else o.cvt=[];j.DEBUG&&(console.log("---EXEC PREP---"),o.step=-1);try{vr(o)}catch(e){this._errorState<2&&console.log("Hinting error in PREP:"+e),this._errorState=2}}if(!(1<this._errorState))try{return yr(e,o)}catch(e){this._errorState<1&&(console.log("Hinting error:"+e),console.log("Note: further hinting errors are silenced")),this._errorState=1}}};var yr=function(e,t){var r=t.ppem/t.font.unitsPerEm,o=r,n=e.components;if(T.prototype=t,n){for(var s=t.font,i=[],a=[],l=0;l<n.length;l++){var u=n[l],c=s.glyphs.get(u.glyphIndex),d=new T("glyf",c.instructions);j.DEBUG&&(console.log("---EXEC COMP "+l+"---"),d.step=-1),gr(c,d,r,o);for(var f=Math.round(u.dx*r),h=Math.round(u.dy*o),p=d.gZone,m=d.contours,y=0;y<p.length;y++){var g=p[y];g.xTouched=g.yTouched=!1,g.xo=g.x=g.x+f,g.yo=g.y=g.y+h}var v=i.length;i.push.apply(i,p);for(var b=0;b<m.length;b++)a.push(m[b]+v)}e.instructions&&!d.inhibitGridFit&&((d=new T("glyf",e.instructions)).gZone=d.z0=d.z1=d.z2=i,d.contours=a,i.push(new E(0,0),new E(Math.round(e.advanceWidth*r),0)),j.DEBUG&&(console.log("---EXEC COMPOSITE---"),d.step=-1),vr(d),i.length-=2)}else d=new T("glyf",e.instructions),j.DEBUG&&(console.log("---EXEC GLYPH---"),d.step=-1),gr(e,d,r,o),i=d.gZone;return i},gr=function(e,t,r,o){for(var n,s,i,a=e.points||[],l=a.length,u=t.gZone=t.z0=t.z1=t.z2=[],c=t.contours=[],d=0;d<l;d++)n=a[d],u[d]=new E(n.x*r,n.y*o,n.lastPointOfContour,n.onCurve);for(var f=0;f<l;f++)n=u[f],s||(s=n,c.push(f)),n.lastPointOfContour?((n.nextPointOnContour=s).prevPointOnContour=n,s=void 0):(i=u[f+1],(n.nextPointOnContour=i).prevPointOnContour=n);if(!t.inhibitGridFit){if(j.DEBUG){console.log("PROCESSING GLYPH",t.stack);for(var h=0;h<l;h++)console.log(h,u[h].x,u[h].y)}if(u.push(new E(0,0),new E(Math.round(e.advanceWidth*r),0)),vr(t),u.length-=2,j.DEBUG){console.log("FINISHED GLYPH",t.stack);for(var p=0;p<l;p++)console.log(p,u[p].x,u[p].y)}}},vr=function(e){var t=e.prog;if(t){var r,o=t.length;for(e.ip=0;e.ip<o;e.ip++){if(j.DEBUG&&e.step++,!(r=br[t[e.ip]]))throw new Error("unknown instruction: 0x"+Number(t[e.ip]).toString(16));r(e)}}},br=[Jt.bind(void 0,M),Jt.bind(void 0,x),Kt.bind(void 0,M),Kt.bind(void 0,x),$t.bind(void 0,M),$t.bind(void 0,x),er.bind(void 0,0),er.bind(void 0,1),tr.bind(void 0,0),tr.bind(void 0,1),function(e){var t=(r=e.stack).pop(),r=r.pop();j.DEBUG&&console.log(e.step,"SPVFS[]",t,r),e.pv=e.dpv=qt(r,t)},function(e){var t=(r=e.stack).pop(),r=r.pop();j.DEBUG&&console.log(e.step,"SPVFS[]",t,r),e.fv=qt(r,t)},function(e){var t=e.stack,r=e.pv;j.DEBUG&&console.log(e.step,"GPV[]"),t.push(16384*r.x),t.push(16384*r.y)},function(e){var t=e.stack,r=e.fv;j.DEBUG&&console.log(e.step,"GFV[]"),t.push(16384*r.x),t.push(16384*r.y)},function(e){e.fv=e.pv,j.DEBUG&&console.log(e.step,"SFVTPV[]")},function(e){var t=(s=e.stack).pop(),r=s.pop(),o=s.pop(),n=s.pop(),s=s.pop(),i=e.z0,a=e.z1,l=i[t],i=i[r],u=a[o],a=a[n],e=e.z2[s],t=(j.DEBUG&&console.log("ISECT[], ",t,r,o,n,s),l.x),r=l.y,o=i.x,n=i.y,s=u.x,l=u.y,i=a.x,u=a.y,a=(t-o)*(l-u)-(r-n)*(s-i),c=t*n-r*o,d=s*u-l*i;e.x=(c*(s-i)-d*(t-o))/a,e.y=(c*(l-u)-d*(r-n))/a},function(e){e.rp0=e.stack.pop(),j.DEBUG&&console.log(e.step,"SRP0[]",e.rp0)},function(e){e.rp1=e.stack.pop(),j.DEBUG&&console.log(e.step,"SRP1[]",e.rp1)},function(e){e.rp2=e.stack.pop(),j.DEBUG&&console.log(e.step,"SRP2[]",e.rp2)},function(e){var t=e.stack.pop();switch(j.DEBUG&&console.log(e.step,"SZP0[]",t),e.zp0=t){case 0:e.tZone||Zt(e),e.z0=e.tZone;break;case 1:e.z0=e.gZone;break;default:throw new Error("Invalid zone pointer")}},function(e){var t=e.stack.pop();switch(j.DEBUG&&console.log(e.step,"SZP1[]",t),e.zp1=t){case 0:e.tZone||Zt(e),e.z1=e.tZone;break;case 1:e.z1=e.gZone;break;default:throw new Error("Invalid zone pointer")}},function(e){var t=e.stack.pop();switch(j.DEBUG&&console.log(e.step,"SZP2[]",t),e.zp2=t){case 0:e.tZone||Zt(e),e.z2=e.tZone;break;case 1:e.z2=e.gZone;break;default:throw new Error("Invalid zone pointer")}},function(e){var t=e.stack.pop();switch(j.DEBUG&&console.log(e.step,"SZPS[]",t),e.zp0=e.zp1=e.zp2=t){case 0:e.tZone||Zt(e),e.z0=e.z1=e.z2=e.tZone;break;case 1:e.z0=e.z1=e.z2=e.gZone;break;default:throw new Error("Invalid zone pointer")}},function(e){e.loop=e.stack.pop(),j.DEBUG&&console.log(e.step,"SLOOP[]",e.loop)},function(e){j.DEBUG&&console.log(e.step,"RTG[]"),e.round=Ft},function(e){j.DEBUG&&console.log(e.step,"RTHG[]"),e.round=Gt},function(e){var t=e.stack.pop();j.DEBUG&&console.log(e.step,"SMD[]",t),e.minDis=t/64},function(e){j.DEBUG&&console.log(e.step,"ELSE[]"),Qt(e,!1)},function(e){var t=e.stack.pop();j.DEBUG&&console.log(e.step,"JMPR[]",t),e.ip+=t-1},function(e){var t=e.stack.pop();j.DEBUG&&console.log(e.step,"SCVTCI[]",t),e.cvCutIn=t/64},void 0,void 0,function(e){var t=e.stack;j.DEBUG&&console.log(e.step,"DUP[]"),t.push(t[t.length-1])},rr,function(e){j.DEBUG&&console.log(e.step,"CLEAR[]"),e.stack.length=0},function(e){var t=e.stack,r=t.pop(),o=t.pop();j.DEBUG&&console.log(e.step,"SWAP[]"),t.push(r),t.push(o)},function(e){var t=e.stack;j.DEBUG&&console.log(e.step,"DEPTH[]"),t.push(t.length)},function(e){var t=e.stack,r=t.pop();j.DEBUG&&console.log(e.step,"CINDEX[]",r),t.push(t[t.length-r])},function(e){var t=e.stack,r=t.pop();j.DEBUG&&console.log(e.step,"MINDEX[]",r),t.push(t.splice(t.length-r,1)[0])},void 0,void 0,void 0,function(e){var t=(o=e.stack).pop(),r=o.pop(),o=(j.DEBUG&&console.log(e.step,"LOOPCALL[]",t,r),e.ip),n=e.prog;e.prog=e.funcs[t];for(var s=0;s<r;s++)vr(e),j.DEBUG&&console.log(++e.step,s+1<r?"next loopcall":"done loopcall",s);e.ip=o,e.prog=n},function(e){var t=e.stack.pop(),r=(j.DEBUG&&console.log(e.step,"CALL[]",t),e.ip),o=e.prog;e.prog=e.funcs[t],vr(e),e.ip=r,e.prog=o,j.DEBUG&&console.log(++e.step,"returning from",t)},function(e){if("fpgm"!==e.env)throw new Error("FDEF not allowed here");var t=e.stack,r=e.prog,o=e.ip,t=t.pop(),n=o;for(j.DEBUG&&console.log(e.step,"FDEF[]",t);45!==r[++o];);e.ip=o,e.funcs[t]=r.slice(n+1,o)},void 0,or.bind(void 0,0),or.bind(void 0,1),nr.bind(void 0,M),nr.bind(void 0,x),sr.bind(void 0,0),sr.bind(void 0,1),ir.bind(void 0,0),ir.bind(void 0,1),ar.bind(void 0,0),ar.bind(void 0,1),function(e){for(var t=e.stack,r=e.loop,o=e.fv,n=t.pop()/64,s=e.z2;r--;){var i=t.pop(),a=s[i];j.DEBUG&&console.log(e.step,(1<e.loop?"loop "+(e.loop-r)+": ":"")+"SHPIX[]",i,n),o.setRelative(a,a,n),o.touch(a)}e.loop=1},function(e){for(var t=e.stack,r=e.rp1,o=e.rp2,n=e.loop,s=e.z0[r],i=e.z1[o],a=e.fv,l=e.dpv,u=e.z2;n--;){var c=t.pop(),d=u[c];j.DEBUG&&console.log(e.step,(1<e.loop?"loop "+(e.loop-n)+": ":"")+"IP[]",c,r,"<->",o),a.interpolate(d,s,i,l),a.touch(d)}e.loop=1},lr.bind(void 0,0),lr.bind(void 0,1),function(e){for(var t=e.stack,r=e.rp0,o=e.z0[r],n=e.loop,s=e.fv,i=e.pv,a=e.z1;n--;){var l=t.pop(),u=a[l];j.DEBUG&&console.log(e.step,(1<e.loop?"loop "+(e.loop-n)+": ":"")+"ALIGNRP[]",l),s.setRelative(u,o,0,i),s.touch(u)}e.loop=1},function(e){j.DEBUG&&console.log(e.step,"RTDG[]"),e.round=Bt},ur.bind(void 0,0),ur.bind(void 0,1),function(e){var t=e.prog,r=e.ip,o=e.stack,n=t[++r];j.DEBUG&&console.log(e.step,"NPUSHB[]",n);for(var s=0;s<n;s++)o.push(t[++r]);e.ip=r},function(e){var t=e.ip,r=e.prog,o=e.stack,n=r[++t];j.DEBUG&&console.log(e.step,"NPUSHW[]",n);for(var s=0;s<n;s++){var i=r[++t]<<8|r[++t];32768&i&&(i=-(1+(65535^i))),o.push(i)}e.ip=t},function(e){var t=e.stack,r=(r=e.store)||(e.store=[]),o=t.pop(),t=t.pop();j.DEBUG&&console.log(e.step,"WS",o,t),r[t]=o},function(e){var t=e.stack,r=e.store,o=t.pop(),e=(j.DEBUG&&console.log(e.step,"RS",o),r&&r[o]||0);t.push(e)},function(e){var t=(r=e.stack).pop(),r=r.pop();j.DEBUG&&console.log(e.step,"WCVTP",t,r),e.cvt[r]=t/64},function(e){var t=e.stack,r=t.pop();j.DEBUG&&console.log(e.step,"RCVT",r),t.push(64*e.cvt[r])},cr.bind(void 0,0),cr.bind(void 0,1),void 0,dr.bind(void 0,0),dr.bind(void 0,1),function(e){j.DEBUG&&console.log(e.step,"MPPEM[]"),e.stack.push(e.ppem)},void 0,function(e){j.DEBUG&&console.log(e.step,"FLIPON[]"),e.autoFlip=!0},void 0,void 0,function(e){var t=e.stack,r=t.pop(),o=t.pop();j.DEBUG&&console.log(e.step,"LT[]",r,o),t.push(o<r?1:0)},function(e){var t=e.stack,r=t.pop(),o=t.pop();j.DEBUG&&console.log(e.step,"LTEQ[]",r,o),t.push(o<=r?1:0)},function(e){var t=e.stack,r=t.pop(),o=t.pop();j.DEBUG&&console.log(e.step,"GT[]",r,o),t.push(r<o?1:0)},function(e){var t=e.stack,r=t.pop(),o=t.pop();j.DEBUG&&console.log(e.step,"GTEQ[]",r,o),t.push(r<=o?1:0)},function(e){var t=e.stack,r=t.pop(),o=t.pop();j.DEBUG&&console.log(e.step,"EQ[]",r,o),t.push(r===o?1:0)},function(e){var t=e.stack,r=t.pop(),o=t.pop();j.DEBUG&&console.log(e.step,"NEQ[]",r,o),t.push(r!==o?1:0)},function(e){var t=e.stack,r=t.pop();j.DEBUG&&console.log(e.step,"ODD[]",r),t.push(Math.trunc(r)%2?1:0)},function(e){var t=e.stack,r=t.pop();j.DEBUG&&console.log(e.step,"EVEN[]",r),t.push(Math.trunc(r)%2?0:1)},function(e){var t=e.stack.pop();j.DEBUG&&console.log(e.step,"IF[]",t),t||(Qt(e,!0),j.DEBUG&&console.log(e.step,"EIF[]"))},function(e){j.DEBUG&&console.log(e.step,"EIF[]")},function(e){var t=e.stack,r=t.pop(),o=t.pop();j.DEBUG&&console.log(e.step,"AND[]",r,o),t.push(r&&o?1:0)},function(e){var t=e.stack,r=t.pop(),o=t.pop();j.DEBUG&&console.log(e.step,"OR[]",r,o),t.push(r||o?1:0)},function(e){var t=e.stack,r=t.pop();j.DEBUG&&console.log(e.step,"NOT[]",r),t.push(r?0:1)},fr.bind(void 0,1),function(e){var t=e.stack.pop();j.DEBUG&&console.log(e.step,"SDB[]",t),e.deltaBase=t},function(e){var t=e.stack.pop();j.DEBUG&&console.log(e.step,"SDS[]",t),e.deltaShift=Math.pow(.5,t)},function(e){var t=e.stack,r=t.pop(),o=t.pop();j.DEBUG&&console.log(e.step,"ADD[]",r,o),t.push(o+r)},function(e){var t=e.stack,r=t.pop(),o=t.pop();j.DEBUG&&console.log(e.step,"SUB[]",r,o),t.push(o-r)},function(e){var t=e.stack,r=t.pop(),o=t.pop();j.DEBUG&&console.log(e.step,"DIV[]",r,o),t.push(64*o/r)},function(e){var t=e.stack,r=t.pop(),o=t.pop();j.DEBUG&&console.log(e.step,"MUL[]",r,o),t.push(o*r/64)},function(e){var t=e.stack,r=t.pop();j.DEBUG&&console.log(e.step,"ABS[]",r),t.push(Math.abs(r))},function(e){var t=e.stack,r=t.pop();j.DEBUG&&console.log(e.step,"NEG[]",r),t.push(-r)},function(e){var t=e.stack,r=t.pop();j.DEBUG&&console.log(e.step,"FLOOR[]",r),t.push(64*Math.floor(r/64))},function(e){var t=e.stack,r=t.pop();j.DEBUG&&console.log(e.step,"CEILING[]",r),t.push(64*Math.ceil(r/64))},hr.bind(void 0,0),hr.bind(void 0,1),hr.bind(void 0,2),hr.bind(void 0,3),void 0,void 0,void 0,void 0,function(e){var t=(r=e.stack).pop(),r=r.pop();j.DEBUG&&console.log(e.step,"WCVTF[]",t,r),e.cvt[r]=t*e.ppem/e.font.unitsPerEm},fr.bind(void 0,2),fr.bind(void 0,3),pr.bind(void 0,1),pr.bind(void 0,2),pr.bind(void 0,3),function(e){var t,r=e.stack.pop();switch(j.DEBUG&&console.log(e.step,"SROUND[]",r),e.round=Ht,192&r){case 0:t=.5;break;case 64:t=1;break;case 128:t=2;break;default:throw new Error("invalid SROUND value")}switch(e.srPeriod=t,48&r){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*t;break;case 32:e.srPhase=.5*t;break;case 48:e.srPhase=.75*t;break;default:throw new Error("invalid SROUND value")}e.srThreshold=0===(r&=15)?0:(r/8-.5)*t},function(e){var t,r=e.stack.pop();switch(j.DEBUG&&console.log(e.step,"S45ROUND[]",r),e.round=Ht,192&r){case 0:t=Math.sqrt(2)/2;break;case 64:t=Math.sqrt(2);break;case 128:t=2*Math.sqrt(2);break;default:throw new Error("invalid S45ROUND value")}switch(e.srPeriod=t,48&r){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*t;break;case 32:e.srPhase=.5*t;break;case 48:e.srPhase=.75*t;break;default:throw new Error("invalid S45ROUND value")}e.srThreshold=0===(r&=15)?0:(r/8-.5)*t},void 0,void 0,function(e){j.DEBUG&&console.log(e.step,"ROFF[]"),e.round=Nt},void 0,function(e){j.DEBUG&&console.log(e.step,"RUTG[]"),e.round=Vt},function(e){j.DEBUG&&console.log(e.step,"RDTG[]"),e.round=zt},rr,rr,void 0,void 0,void 0,void 0,void 0,function(e){var t=e.stack.pop();j.DEBUG&&console.log(e.step,"SCANCTRL[]",t)},mr.bind(void 0,0),mr.bind(void 0,1),function(e){var t=e.stack,r=t.pop(),o=0;j.DEBUG&&console.log(e.step,"GETINFO[]",r),1&r&&(o=35),32&r&&(o|=4096),t.push(o)},void 0,function(e){var t=e.stack,r=t.pop(),o=t.pop(),n=t.pop();j.DEBUG&&console.log(e.step,"ROLL[]"),t.push(o),t.push(r),t.push(n)},function(e){var t=e.stack,r=t.pop(),o=t.pop();j.DEBUG&&console.log(e.step,"MAX[]",r,o),t.push(Math.max(o,r))},function(e){var t=e.stack,r=t.pop(),o=t.pop();j.DEBUG&&console.log(e.step,"MIN[]",r,o),t.push(Math.min(o,r))},function(e){var t=e.stack.pop();j.DEBUG&&console.log(e.step,"SCANTYPE[]",t)},function(e){var t=e.stack.pop(),r=e.stack.pop();switch(j.DEBUG&&console.log(e.step,"INSTCTRL[]",t,r),t){case 1:return void(e.inhibitGridFit=!!r);case 2:return void(e.ignoreCvt=!!r);default:throw new Error("invalid INSTCTRL[] selector")}},void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,C.bind(void 0,1),C.bind(void 0,2),C.bind(void 0,3),C.bind(void 0,4),C.bind(void 0,5),C.bind(void 0,6),C.bind(void 0,7),C.bind(void 0,8),O.bind(void 0,1),O.bind(void 0,2),O.bind(void 0,3),O.bind(void 0,4),O.bind(void 0,5),O.bind(void 0,6),O.bind(void 0,7),O.bind(void 0,8),k.bind(void 0,0,0,0,0,0),k.bind(void 0,0,0,0,0,1),k.bind(void 0,0,0,0,0,2),k.bind(void 0,0,0,0,0,3),k.bind(void 0,0,0,0,1,0),k.bind(void 0,0,0,0,1,1),k.bind(void 0,0,0,0,1,2),k.bind(void 0,0,0,0,1,3),k.bind(void 0,0,0,1,0,0),k.bind(void 0,0,0,1,0,1),k.bind(void 0,0,0,1,0,2),k.bind(void 0,0,0,1,0,3),k.bind(void 0,0,0,1,1,0),k.bind(void 0,0,0,1,1,1),k.bind(void 0,0,0,1,1,2),k.bind(void 0,0,0,1,1,3),k.bind(void 0,0,1,0,0,0),k.bind(void 0,0,1,0,0,1),k.bind(void 0,0,1,0,0,2),k.bind(void 0,0,1,0,0,3),k.bind(void 0,0,1,0,1,0),k.bind(void 0,0,1,0,1,1),k.bind(void 0,0,1,0,1,2),k.bind(void 0,0,1,0,1,3),k.bind(void 0,0,1,1,0,0),k.bind(void 0,0,1,1,0,1),k.bind(void 0,0,1,1,0,2),k.bind(void 0,0,1,1,0,3),k.bind(void 0,0,1,1,1,0),k.bind(void 0,0,1,1,1,1),k.bind(void 0,0,1,1,1,2),k.bind(void 0,0,1,1,1,3),k.bind(void 0,1,0,0,0,0),k.bind(void 0,1,0,0,0,1),k.bind(void 0,1,0,0,0,2),k.bind(void 0,1,0,0,0,3),k.bind(void 0,1,0,0,1,0),k.bind(void 0,1,0,0,1,1),k.bind(void 0,1,0,0,1,2),k.bind(void 0,1,0,0,1,3),k.bind(void 0,1,0,1,0,0),k.bind(void 0,1,0,1,0,1),k.bind(void 0,1,0,1,0,2),k.bind(void 0,1,0,1,0,3),k.bind(void 0,1,0,1,1,0),k.bind(void 0,1,0,1,1,1),k.bind(void 0,1,0,1,1,2),k.bind(void 0,1,0,1,1,3),k.bind(void 0,1,1,0,0,0),k.bind(void 0,1,1,0,0,1),k.bind(void 0,1,1,0,0,2),k.bind(void 0,1,1,0,0,3),k.bind(void 0,1,1,0,1,0),k.bind(void 0,1,1,0,1,1),k.bind(void 0,1,1,0,1,2),k.bind(void 0,1,1,0,1,3),k.bind(void 0,1,1,1,0,0),k.bind(void 0,1,1,1,0,1),k.bind(void 0,1,1,1,0,2),k.bind(void 0,1,1,1,0,3),k.bind(void 0,1,1,1,1,0),k.bind(void 0,1,1,1,1,1),k.bind(void 0,1,1,1,1,2),k.bind(void 0,1,1,1,1,3)],jr=Array.from||function(e){return e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]?|[^\uD800-\uDFFF]|./g)||[]};function L(e){(e=e||{}).empty||(_(e.familyName,"When creating a new Font object, familyName is required."),_(e.styleName,"When creating a new Font object, styleName is required."),_(e.unitsPerEm,"When creating a new Font object, unitsPerEm is required."),_(e.ascender,"When creating a new Font object, ascender is required."),_(e.descender,"When creating a new Font object, descender is required."),_(e.descender<0,"Descender should be negative (e.g. -512)."),this.names={fontFamily:{en:e.familyName||" "},fontSubfamily:{en:e.styleName||" "},fullName:{en:e.fullName||e.familyName+" "+e.styleName},postScriptName:{en:e.postScriptName||(e.familyName+e.styleName).replace(/\s/g,"")},designer:{en:e.designer||" "},designerURL:{en:e.designerURL||" "},manufacturer:{en:e.manufacturer||" "},manufacturerURL:{en:e.manufacturerURL||" "},license:{en:e.license||" "},licenseURL:{en:e.licenseURL||" "},version:{en:e.version||"Version 0.1"},description:{en:e.description||" "},copyright:{en:e.copyright||" "},trademark:{en:e.trademark||" "}},this.unitsPerEm=e.unitsPerEm||1e3,this.ascender=e.ascender,this.descender=e.descender,this.createdTimestamp=e.createdTimestamp,this.tables={os2:{usWeightClass:e.weightClass||this.usWeightClasses.MEDIUM,usWidthClass:e.widthClass||this.usWidthClasses.MEDIUM,fsSelection:e.fsSelection||this.fsSelectionValues.REGULAR}}),this.supported=!0,this.glyphs=new p.GlyphSet(this,e.glyphs||[]),this.encoding=new Te(this),this.position=new Ct(this),this.substitution=new i(this),this.tables=this.tables||{},Object.defineProperty(this,"hinting",{get:function(){return this._hinting||("truetype"===this.outlinesFormat?this._hinting=new Ut(this):void 0)}})}function _r(e,t){var r,o=JSON.stringify(e),n=256;for(r in t){var s=parseInt(r);if(s&&!(s<256)){if(JSON.stringify(t[r])===o)return s;n<=s&&(n=s+1)}}return t[n]=e,n}L.prototype.hasChar=function(e){return null!==this.encoding.charToGlyphIndex(e)},L.prototype.charToGlyphIndex=function(e){return this.encoding.charToGlyphIndex(e)},L.prototype.charToGlyph=function(e){e=this.charToGlyphIndex(e);return this.glyphs.get(e)||this.glyphs.get(0)},L.prototype.stringToGlyphs=function(e,t){t=t||this.defaultRenderOptions;for(var r=jr(e),o=[],n=0;n<r.length;n+=1){var s=r[n];o.push(this.charToGlyphIndex(s))}var i=o.length;if(t.features){var e=t.script||this.substitution.getDefaultScriptName(),a=[];t.features.liga&&(a=a.concat(this.substitution.getFeature("liga",e,t.language))),t.features.rlig&&(a=a.concat(this.substitution.getFeature("rlig",e,t.language)));for(var l=0;l<i;l+=1)for(var u=0;u<a.length;u++){for(var c=a[u],d=c.sub,f=d.length,h=0;h<f&&d[h]===o[l+h];)h++;h===f&&(o.splice(l,f,c.by),i=i-f+1)}}for(var p=new Array(i),m=this.glyphs.get(0),y=0;y<i;y+=1)p[y]=this.glyphs.get(o[y])||m;return p},L.prototype.nameToGlyphIndex=function(e){return this.glyphNames.nameToGlyphIndex(e)},L.prototype.nameToGlyph=function(e){e=this.nameToGlyphIndex(e);return this.glyphs.get(e)||this.glyphs.get(0)},L.prototype.glyphIndexToName=function(e){return this.glyphNames.glyphIndexToName?this.glyphNames.glyphIndexToName(e):""},L.prototype.getKerningValue=function(e,t){e=e.index||e,t=t.index||t;var r=this.position.defaultKerningTables;return r?this.position.getKerningValue(r,e,t):this.kerningPairs[e+","+t]||0},L.prototype.defaultRenderOptions={kerning:!0,features:{liga:!0,rlig:!0}},L.prototype.forEachGlyph=function(e,t,r,o,n,s){t=void 0!==t?t:0,r=void 0!==r?r:0,n=n||this.defaultRenderOptions;var i,a=1/this.unitsPerEm*(o=void 0!==o?o:72),l=this.stringToGlyphs(e,n);n.kerning&&(e=n.script||this.position.getDefaultScriptName(),i=this.position.getKerningTables(e,n.language));for(var u=0;u<l.length;u+=1){var c=l[u];s.call(this,c,t,r,o,n),c.advanceWidth&&(t+=c.advanceWidth*a),n.kerning&&u<l.length-1&&(t+=(i?this.position.getKerningValue(i,c.index,l[u+1].index):this.getKerningValue(c,l[u+1]))*a),n.letterSpacing?t+=n.letterSpacing*o:n.tracking&&(t+=n.tracking/1e3*o)}return t},L.prototype.getPath=function(e,t,r,o,n){var s=new f;return this.forEachGlyph(e,t,r,o,n,function(e,t,r,o){e=e.getPath(t,r,o,n,this);s.extend(e)}),s},L.prototype.getPaths=function(e,t,r,o,n){var s=[];return this.forEachGlyph(e,t,r,o,n,function(e,t,r,o){e=e.getPath(t,r,o,n,this);s.push(e)}),s},L.prototype.getAdvanceWidth=function(e,t,r){return this.forEachGlyph(e,0,0,t,r,function(){})},L.prototype.draw=function(e,t,r,o,n,s){this.getPath(t,r,o,n,s).draw(e)},L.prototype.drawPoints=function(n,e,t,r,o,s){this.forEachGlyph(e,t,r,o,s,function(e,t,r,o){e.drawPoints(n,t,r,o)})},L.prototype.drawMetrics=function(n,e,t,r,o,s){this.forEachGlyph(e,t,r,o,s,function(e,t,r,o){e.drawMetrics(n,t,r,o)})},L.prototype.getEnglishName=function(e){e=this.names[e];if(e)return e.en},L.prototype.validate=function(){var t=this;function e(e){e=t.getEnglishName(e);e&&e.trim().length}e("fontFamily"),e("weightName"),e("manufacturer"),e("copyright"),e("version"),this.unitsPerEm},L.prototype.toTables=function(){return wt.fontToTable(this)},L.prototype.toBuffer=function(){return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."),this.toArrayBuffer()},L.prototype.toArrayBuffer=function(){for(var e=this.toTables().encode(),t=new ArrayBuffer(e.length),r=new Uint8Array(t),o=0;o<e.length;o++)r[o]=e[o];return t},L.prototype.download=function(t){var e=this.getEnglishName("fontFamily"),r=this.getEnglishName("fontSubfamily"),o=(t=t||e.replace(/\s/g,"")+"-"+r+".otf",this.toArrayBuffer());"undefined"!=typeof window?(window.requestFileSystem=window.requestFileSystem||window.webkitRequestFileSystem,window.requestFileSystem(window.TEMPORARY,o.byteLength,function(e){e.root.getFile(t,{create:!0},function(r){r.createWriter(function(e){var t=new DataView(o),t=new Blob([t],{type:"font/opentype"});e.write(t),e.addEventListener("writeend",function(){location.href=r.toURL()},!1)})})},function(e){throw new Error(e.name+": "+e.message)})):(e=Pr("fs"),r=function(e){for(var t=new Lr(e.byteLength),r=new Uint8Array(e),o=0;o<t.length;++o)t[o]=r[o];return t}(o),e.writeFileSync(t,r))},L.prototype.fsSelectionValues={ITALIC:1,UNDERSCORE:2,NEGATIVE:4,OUTLINED:8,STRIKEOUT:16,BOLD:32,REGULAR:64,USER_TYPO_METRICS:128,WWS:256,OBLIQUE:512},L.prototype.usWidthClasses={ULTRA_CONDENSED:1,EXTRA_CONDENSED:2,CONDENSED:3,SEMI_CONDENSED:4,MEDIUM:5,SEMI_EXPANDED:6,EXPANDED:7,EXTRA_EXPANDED:8,ULTRA_EXPANDED:9},L.prototype.usWeightClasses={THIN:100,EXTRA_LIGHT:200,LIGHT:300,NORMAL:400,MEDIUM:500,SEMI_BOLD:600,BOLD:700,EXTRA_BOLD:800,BLACK:900};var xr={make:function(e,t){var r=new S.Table("fvar",[{name:"version",type:"ULONG",value:65536},{name:"offsetToData",type:"USHORT",value:0},{name:"countSizePairs",type:"USHORT",value:2},{name:"axisCount",type:"USHORT",value:e.axes.length},{name:"axisSize",type:"USHORT",value:20},{name:"instanceCount",type:"USHORT",value:e.instances.length},{name:"instanceSize",type:"USHORT",value:4+4*e.axes.length}]);r.offsetToData=r.sizeOf();for(var o,n,s,i=0;i<e.axes.length;i++)r.fields=r.fields.concat((o=i,n=e.axes[i],s=t,s=_r(n.name,t),[{name:"tag_"+o,type:"TAG",value:n.tag},{name:"minValue_"+o,type:"FIXED",value:n.minValue<<16},{name:"defaultValue_"+o,type:"FIXED",value:n.defaultValue<<16},{name:"maxValue_"+o,type:"FIXED",value:n.maxValue<<16},{name:"flags_"+o,type:"USHORT",value:0},{name:"nameID_"+o,type:"USHORT",value:s}]));for(var a=0;a<e.instances.length;a++)r.fields=r.fields.concat(function(e,t,r,o){for(var n=[{name:"nameID_"+e,type:"USHORT",value:_r(t.name,o)},{name:"flags_"+e,type:"USHORT",value:0}],s=0;s<r.length;++s){var i=r[s].tag;n.push({name:"axis_"+e+" "+i,type:"FIXED",value:t.coordinates[i]<<16})}return n}(a,e.instances[a],e.axes,t));return r},parse:function(e,t,r){for(var o,n,s,i,a=new R.Parser(e,t),l=a.parseULong(),u=(A.argument(65536===l,"Unsupported fvar table version."),a.parseOffset16()),c=(a.skip("uShort",1),a.parseUShort()),d=a.parseUShort(),f=a.parseUShort(),h=a.parseUShort(),p=[],m=0;m<c;m++)p.push((o=e,n=t+u+m*d,s=r,void 0,i={},o=new R.Parser(o,n),i.tag=o.parseTag(),i.minValue=o.parseFixed(),i.defaultValue=o.parseFixed(),i.maxValue=o.parseFixed(),o.skip("uShort",1),i.name=s[o.parseUShort()]||{},i));for(var y=[],g=t+u+c*d,v=0;v<f;v++)y.push(function(e,t,r,o){var n={},s=new R.Parser(e,t);n.name=o[s.parseUShort()]||{},s.skip("uShort",1),n.coordinates={};for(var i=0;i<r.length;++i)n.coordinates[r[i].tag]=s.parseFixed();return n}(e,g+v*h,p,r));return{axes:p,instances:y}}},P=new Array(10);P[1]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();return 1===t?{posFormat:1,coverage:this.parsePointer(u.coverage),value:this.parseValueRecord()}:2===t?{posFormat:2,coverage:this.parsePointer(u.coverage),values:this.parseValueRecordList()}:void A.assert(!1,"0x"+e.toString(16)+": GPOS lookup type 1 format must be 1 or 2.")},P[2]=function(){var e,t,r,o,n=this.offset+this.relativeOffset,s=this.parseUShort(),n=(A.assert(1===s||2===s,"0x"+n.toString(16)+": GPOS lookup type 2 format must be 1 or 2."),this.parsePointer(u.coverage)),i=this.parseUShort(),a=this.parseUShort();return 1===s?{posFormat:s,coverage:n,valueFormat1:i,valueFormat2:a,pairSets:this.parseList(u.pointer(u.list(function(){return{secondGlyph:this.parseUShort(),value1:this.parseValueRecord(i),value2:this.parseValueRecord(a)}})))}:2===s?(e=this.parsePointer(u.classDef),t=this.parsePointer(u.classDef),r=this.parseUShort(),o=this.parseUShort(),{posFormat:s,coverage:n,valueFormat1:i,valueFormat2:a,classDef1:e,classDef2:t,class1Count:r,class2Count:o,classRecords:this.parseList(r,u.list(o,function(){return{value1:this.parseValueRecord(i),value2:this.parseValueRecord(a)}}))}):void 0},P[3]=function(){return{error:"GPOS Lookup 3 not supported"}},P[4]=function(){return{error:"GPOS Lookup 4 not supported"}},P[5]=function(){return{error:"GPOS Lookup 5 not supported"}},P[6]=function(){return{error:"GPOS Lookup 6 not supported"}},P[7]=function(){return{error:"GPOS Lookup 7 not supported"}},P[8]=function(){return{error:"GPOS Lookup 8 not supported"}},P[9]=function(){return{error:"GPOS Lookup 9 not supported"}};var wr=new Array(10);var Sr={parse:function(e,t){return t=(e=new u(e,t=t||0)).parseVersion(1),A.argument(1===t||1.1===t,"Unsupported GPOS table version "+t),1===t?{version:t,scripts:e.parseScriptList(),features:e.parseFeatureList(),lookups:e.parseLookupList(P)}:{version:t,scripts:e.parseScriptList(),features:e.parseFeatureList(),lookups:e.parseLookupList(P),variations:e.parseFeatureVariationsList()}},make:function(e){return new S.Table("GPOS",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new S.ScriptList(e.scripts)},{name:"features",type:"TABLE",value:new S.FeatureList(e.features)},{name:"lookups",type:"TABLE",value:new S.LookupList(e.lookups,wr)}])}};var Mr={parse:function(e,t){if(e=new R.Parser(e,t),0===(t=e.parseUShort())){var r=e,o={},n=(r.skip("uShort"),r.parseUShort()),s=(A.argument(0===n,"Unsupported kern sub-table version."),r.skip("uShort",2),r.parseUShort());r.skip("uShort",3);for(var i=0;i<s;i+=1){var a=r.parseUShort(),l=r.parseUShort(),u=r.parseShort();o[a+","+l]=u}return o}if(1!==t)throw new Error("Unsupported kern table version ("+t+").");var c=e,d={},n=(c.skip("uShort"),1<c.parseULong()&&console.warn("Only the first kern subtable is supported."),c.skip("uLong"),255&c.parseUShort());if(c.skip("uShort"),0==n){var f=c.parseUShort();c.skip("uShort",3);for(var h=0;h<f;h+=1){var p=c.parseUShort(),m=c.parseUShort(),y=c.parseShort();d[p+","+m]=y}}return d}};var Er={parse:function(e,t,r,o){for(var n=new R.Parser(e,t),s=o?n.parseUShort:n.parseULong,i=[],a=0;a<r+1;a+=1){var l=s.call(n);o&&(l*=2),i.push(l)}return i}};function Tr(e,r){Pr("fs").readFile(e,function(e,t){if(e)return r(e.message);r(null,kt(t))})}function Cr(e,t){var r=new XMLHttpRequest;r.open("get",e,!0),r.responseType="arraybuffer",r.onload=function(){return r.response?t(null,r.response):t("Font could not be loaded: "+r.statusText)},r.onerror=function(){t("Font could not be loaded")},r.send()}function Or(e,t){for(var r=[],o=12,n=0;n<t;n+=1){var s=R.getTag(e,o),i=R.getULong(e,o+4),a=R.getULong(e,o+8),l=R.getULong(e,o+12);r.push({tag:s,checksum:i,offset:a,length:l,compression:!1}),o+=16}return r}function I(e,t){if("WOFF"!==t.compression)return{data:e,offset:t.offset};var e=new Uint8Array(e.buffer,t.offset+2,t.compressedLength-2),r=new Uint8Array(t.length);if(re(e,r),r.byteLength!==t.length)throw new Error("Decompression error: "+t.tag+" decompressed length doesn't match recorded length");return{data:new DataView(r.buffer,0),offset:0}}function kr(e){var t,r,o,n,s,i,a,l,u,c,d,f,h,p,m=new L({empty:!0}),y=new DataView(e,0),g=[],e=R.getTag(y,0);if(e===String.fromCharCode(0,1,0,0)||"true"===e||"typ1"===e)m.outlinesFormat="truetype",g=Or(y,o=R.getUShort(y,4));else if("OTTO"===e)m.outlinesFormat="cff",g=Or(y,o=R.getUShort(y,4));else{if("wOFF"!==e)throw new Error("Unsupported OpenType signature "+e);var v=R.getTag(y,4);if(v===String.fromCharCode(0,1,0,0))m.outlinesFormat="truetype";else{if("OTTO"!==v)throw new Error("Unsupported OpenType flavor "+e);m.outlinesFormat="cff"}g=function(e,t){for(var r=[],o=44,n=0;n<t;n+=1){var s=R.getTag(e,o),i=R.getULong(e,o+4),a=R.getULong(e,o+8),l=R.getULong(e,o+12),u=void 0,u=a<l&&"WOFF";r.push({tag:s,offset:i,compression:u,compressedLength:a,length:l}),o+=20}return r}(y,o=R.getUShort(y,12))}for(var b=0;b<o;b+=1){var j=g[b],_=void 0;switch(j.tag){case"cmap":_=I(y,j),m.tables.cmap=we.parse(_.data,_.offset),m.encoding=new Ce(m.tables.cmap);break;case"cvt ":_=I(y,j),p=new R.Parser(_.data,_.offset),m.tables.cvt=p.parseShortList(j.length/2);break;case"fvar":s=j;break;case"fpgm":_=I(y,j),p=new R.Parser(_.data,_.offset),m.tables.fpgm=p.parseByteList(j.length);break;case"head":_=I(y,j),m.tables.head=Ze.parse(_.data,_.offset),m.unitsPerEm=m.tables.head.unitsPerEm,t=m.tables.head.indexToLocFormat;break;case"hhea":_=I(y,j),m.tables.hhea=Qe.parse(_.data,_.offset),m.ascender=m.tables.hhea.ascender,m.descender=m.tables.hhea.descender,m.numberOfHMetrics=m.tables.hhea.numberOfHMetrics;break;case"hmtx":u=j;break;case"ltag":_=I(y,j),r=Ke.parse(_.data,_.offset);break;case"maxp":_=I(y,j),m.tables.maxp=$e.parse(_.data,_.offset),m.numGlyphs=m.tables.maxp.numGlyphs;break;case"name":f=j;break;case"OS/2":_=I(y,j),m.tables.os2=ht.parse(_.data,_.offset);break;case"post":_=I(y,j),m.tables.post=pt.parse(_.data,_.offset),m.glyphNames=new ke(m.tables.post);break;case"prep":_=I(y,j),p=new R.Parser(_.data,_.offset),m.tables.prep=p.parseByteList(j.length);break;case"glyf":i=j;break;case"loca":d=j;break;case"CFF ":n=j;break;case"kern":c=j;break;case"GPOS":a=j;break;case"GSUB":l=j;break;case"meta":h=j}}v=I(y,f);if(m.tables.name=dt.parse(v.data,v.offset,r),m.names=m.tables.name,i&&d){e=0===t,v=I(y,d),v=Er.parse(v.data,v.offset,m.numGlyphs,e),e=I(y,i);m.glyphs=Dt.parse(e.data,e.offset,v,m)}else{if(!n)throw new Error("Font doesn't contain TrueType or CFF outlines.");e=I(y,n);Ye.parse(e.data,e.offset,m)}for(var v=I(y,u),x=(Je.parse(v.data,v.offset,m.numberOfHMetrics,m.numGlyphs,m.glyphs),m),w=x.tables.cmap.glyphIndexMap,S=Object.keys(w),M=0;M<S.length;M+=1){var E,T=S[M],C=w[T];(E=x.glyphs.get(C)).addUnicode(parseInt(T))}for(var O=0;O<x.glyphs.length;O+=1)E=x.glyphs.get(O),x.cffEncoding?x.isCIDFont?E.name="gid"+O:E.name=x.cffEncoding.charset[O]:x.glyphNames.names&&(E.name=x.glyphNames.glyphIndexToName(O));return c?(e=I(y,c),m.kerningPairs=Mr.parse(e.data,e.offset)):m.kerningPairs={},a&&(v=I(y,a),m.tables.gpos=Sr.parse(v.data,v.offset),m.position.init()),l&&(e=I(y,l),m.tables.gsub=yt.parse(e.data,e.offset)),s&&(v=I(y,s),m.tables.fvar=xr.parse(v.data,v.offset,m.names)),h&&(e=I(y,h),m.tables.meta=gt.parse(e.data,e.offset),m.metas=m.tables.meta),m}j.Font=L,j.Glyph=h,j.Path=f,j.BoundingBox=a,j._parse=R,j.parse=kr,j.load=function(e,o){("undefined"==typeof window?Tr:Cr)(e,function(e,t){if(e)return o(e);var r;try{r=kr(t)}catch(e){return o(e,null)}return o(null,r)})},j.loadSync=function(e){return kr(kt(Pr("fs").readFileSync(e)))},Object.defineProperty(j,"__esModule",{value:!0})},"object"==typeof o&&void 0!==r?t(o):"function"==typeof s&&s.amd?s(["exports"],t):t(e.opentype={})}.call(this,Pr("buffer").Buffer)},{buffer:4,fs:2}],242:[function(e,t,u){!function(n){function s(e,t){for(var r=0,o=e.length-1;0<=o;o--){var n=e[o];"."===n?e.splice(o,1):".."===n?(e.splice(o,1),r++):r&&(e.splice(o,1),r--)}if(t)for(;r--;)e.unshift("..");return e}function i(e,t){if(e.filter)return e.filter(t);for(var r=[],o=0;o<e.length;o++)t(e[o],o,e)&&r.push(e[o]);return r}u.resolve=function(){for(var e="",t=!1,r=arguments.length-1;-1<=r&&!t;r--){var o=0<=r?arguments[r]:n.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(e=o+"/"+e,t="/"===o.charAt(0))}return(t?"/":"")+(e=s(i(e.split("/"),function(e){return!!e}),!t).join("/"))||"."},u.normalize=function(e){var t=u.isAbsolute(e),r="/"===o(e,-1);return(e=(e=s(i(e.split("/"),function(e){return!!e}),!t).join("/"))||t?e:".")&&r&&(e+="/"),(t?"/":"")+e},u.isAbsolute=function(e){return"/"===e.charAt(0)},u.join=function(){var e=Array.prototype.slice.call(arguments,0);return u.normalize(i(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},u.relative=function(e,t){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;0<=r&&""===e[r];r--);return r<t?[]:e.slice(t,r-t+1)}e=u.resolve(e).substr(1),t=u.resolve(t).substr(1);for(var o=r(e.split("/")),n=r(t.split("/")),s=Math.min(o.length,n.length),i=s,a=0;a<s;a++)if(o[a]!==n[a]){i=a;break}for(var l=[],a=i;a<o.length;a++)l.push("..");return(l=l.concat(n.slice(i))).join("/")},u.sep="/",u.delimiter=":",u.dirname=function(e){if("string"!=typeof e&&(e+=""),0===e.length)return".";for(var t=47===e.charCodeAt(0),r=-1,o=!0,n=e.length-1;1<=n;--n)if(47===e.charCodeAt(n)){if(!o){r=n;break}}else o=!1;return-1===r?t?"/":".":t&&1===r?"/":e.slice(0,r)},u.basename=function(e,t){e=function(e){"string"!=typeof e&&(e+="");for(var t=0,r=-1,o=!0,n=e.length-1;0<=n;--n)if(47===e.charCodeAt(n)){if(!o){t=n+1;break}}else-1===r&&(o=!1,r=n+1);return-1===r?"":e.slice(t,r)}(e);return e=t&&e.substr(-1*t.length)===t?e.substr(0,e.length-t.length):e},u.extname=function(e){"string"!=typeof e&&(e+="");for(var t=-1,r=0,o=-1,n=!0,s=0,i=e.length-1;0<=i;--i){var a=e.charCodeAt(i);if(47===a){if(n)continue;r=i+1;break}-1===o&&(n=!1,o=i+1),46===a?-1===t?t=i:1!==s&&(s=1):-1!==t&&(s=-1)}return-1===t||-1===o||0===s||1===s&&t===o-1&&t===r+1?"":e.slice(t,o)};var o="b"==="ab".substr(-1)?function(e,t,r){return e.substr(t,r)}:function(e,t,r){return t<0&&(t=e.length+t),e.substr(t,r)}}.call(this,e("_process"))},{_process:243}],243:[function(e,t,r){var o,n,t=t.exports={};function s(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}try{o="function"==typeof setTimeout?setTimeout:s}catch(e){o=s}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}function a(t){if(o===setTimeout)return setTimeout(t,0);if((o===s||!o)&&setTimeout)return(o=setTimeout)(t,0);try{return o(t,0)}catch(e){try{return o.call(null,t,0)}catch(e){return o.call(this,t,0)}}}var l,u=[],c=!1,d=-1;function f(){c&&l&&(c=!1,l.length?u=l.concat(u):d=-1,u.length&&h())}function h(){if(!c){for(var e=a(f),t=(c=!0,u.length);t;){for(l=u,u=[];++d<t;)l&&l[d].run();d=-1,t=u.length}l=null,c=!1,!function(t){if(n===clearTimeout)return clearTimeout(t);if((n===i||!n)&&clearTimeout)return(n=clearTimeout)(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function m(){}t.nextTick=function(e){var t=new Array(arguments.length-1);if(1<arguments.length)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new p(e,t)),1!==u.length||c||a(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={},t.on=m,t.addListener=m,t.once=m,t.off=m,t.removeListener=m,t.removeAllListeners=m,t.emit=m,t.prependListener=m,t.prependOnceListener=m,t.listeners=function(e){return[]},t.binding=function(e){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(e){throw new Error("process.chdir is not supported")},t.umask=function(){return 0}},{}],244:[function(e,t,r){t=function(s){"use strict";var l,e=Object.prototype,u=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",r=t.asyncIterator||"@@asyncIterator",n=t.toStringTag||"@@toStringTag";function i(e,t,r,o){var n,s,i,a,t=t&&t.prototype instanceof y?t:y,t=Object.create(t.prototype),o=new S(o||[]);return t._invoke=(n=e,s=r,i=o,a=d,function(e,t){if(a===h)throw new Error("Generator is already running");if(a===p){if("throw"===e)throw t;return E()}for(i.method=e,i.arg=t;;){var r=i.delegate;if(r){r=function e(t,r){var o=t.iterator[r.method];if(o===l){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=l,e(t,r),"throw"===r.method))return m;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}o=c(o,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,m;o=o.arg;if(!o)return r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m;{if(!o.done)return o;r[t.resultName]=o.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=l)}r.delegate=null;return m}(r,i);if(r){if(r===m)continue;return r}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(a===d)throw a=p,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);a=h;r=c(n,s,i);if("normal"===r.type){if(a=i.done?p:f,r.arg!==m)return{value:r.arg,done:i.done}}else"throw"===r.type&&(a=p,i.method="throw",i.arg=r.arg)}}),t}function c(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}s.wrap=i;var d="suspendedStart",f="suspendedYield",h="executing",p="completed",m={};function y(){}function a(){}function g(){}var t={},v=(t[o]=function(){return this},Object.getPrototypeOf),v=v&&v(v(M([]))),b=(v&&v!==e&&u.call(v,o)&&(t=v),g.prototype=y.prototype=Object.create(t));function j(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function _(i){var t;this._invoke=function(r,o){function e(){return new Promise(function(e,t){!function t(e,r,o,n){var s,e=c(i[e],i,r);if("throw"!==e.type)return(r=(s=e.arg).value)&&"object"==typeof r&&u.call(r,"__await")?Promise.resolve(r.__await).then(function(e){t("next",e,o,n)},function(e){t("throw",e,o,n)}):Promise.resolve(r).then(function(e){s.value=e,o(s)},function(e){return t("throw",e,o,n)});n(e.arg)}(r,o,e,t)})}return t=t?t.then(e,e):e()}}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function w(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function M(t){if(t){var r,e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return r=-1,(e=function e(){for(;++r<t.length;)if(u.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=l,e.done=!0,e}).next=e}return{next:E}}function E(){return{value:l,done:!0}}return(a.prototype=b.constructor=g).constructor=a,g[n]=a.displayName="GeneratorFunction",s.isGeneratorFunction=function(e){e="function"==typeof e&&e.constructor;return!!e&&(e===a||"GeneratorFunction"===(e.displayName||e.name))},s.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,n in e||(e[n]="GeneratorFunction")),e.prototype=Object.create(b),e},s.awrap=function(e){return{__await:e}},j(_.prototype),_.prototype[r]=function(){return this},s.AsyncIterator=_,s.async=function(e,t,r,o){var n=new _(i(e,t,r,o));return s.isGeneratorFunction(t)?n:n.next().then(function(e){return e.done?e.value:n.next()})},j(b),b[n]="Generator",b[o]=function(){return this},b.toString=function(){return"[object Generator]"},s.keys=function(r){var e,o=[];for(e in r)o.push(e);return o.reverse(),function e(){for(;o.length;){var t=o.pop();if(t in r)return e.value=t,e.done=!1,e}return e.done=!0,e}},s.values=M,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=l,this.done=!1,this.delegate=null,this.method="next",this.arg=l,this.tryEntries.forEach(w),!e)for(var t in this)"t"===t.charAt(0)&&u.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=l)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var o=this;function e(e,t){return s.type="throw",s.arg=r,o.next=e,t&&(o.method="next",o.arg=l),!!t}for(var t=this.tryEntries.length-1;0<=t;--t){var n=this.tryEntries[t],s=n.completion;if("root"===n.tryLoc)return e("end");if(n.tryLoc<=this.prev){var i=u.call(n,"catchLoc"),a=u.call(n,"finallyLoc");if(i&&a){if(this.prev<n.catchLoc)return e(n.catchLoc,!0);if(this.prev<n.finallyLoc)return e(n.finallyLoc)}else if(i){if(this.prev<n.catchLoc)return e(n.catchLoc,!0)}else{if(!a)throw new Error("try statement without catch or finally");if(this.prev<n.finallyLoc)return e(n.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;0<=r;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&u.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var n=o;break}}var s=(n=n&&("break"===e||"continue"===e)&&n.tryLoc<=t&&t<=n.finallyLoc?null:n)?n.completion:{};return s.type=e,s.arg=t,n?(this.method="next",this.next=n.finallyLoc,m):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),w(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var r,o,n=this.tryEntries[t];if(n.tryLoc===e)return"throw"===(r=n.completion).type&&(o=r.arg,w(n)),o}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:M(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=l),m}},s}("object"==typeof t?t.exports:{});try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}},{}],245:[function(e,t,r){!function(e){"use strict";var t,r,i,o,n,s,a,l,u,c;function d(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function f(e){return e="string"!=typeof e?String(e):e}function h(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return r&&(e[Symbol.iterator]=function(){return e}),e}function p(t){this.map={},t instanceof p?t.forEach(function(e,t){this.append(t,e)},this):Array.isArray(t)?t.forEach(function(e){this.append(e[0],e[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function m(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function y(r){return new Promise(function(e,t){r.onload=function(){e(r.result)},r.onerror=function(){t(r.error)}})}function g(e){var t=new FileReader,r=y(t);return t.readAsArrayBuffer(e),r}function v(e){var t;return e.slice?e.slice(0):((t=new Uint8Array(e.byteLength)).set(new Uint8Array(e)),t.buffer)}function b(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e)if("string"==typeof e)this._bodyText=e;else if(i&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(o&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(t&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(n&&i&&a(e))this._bodyArrayBuffer=v(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!n||!ArrayBuffer.prototype.isPrototypeOf(e)&&!l(e))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=v(e)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=m(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?m(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(g)}),this.text=function(){var e,t,r=m(this);if(r)return r;if(this._bodyBlob)return r=this._bodyBlob,e=new FileReader,t=y(e),e.readAsText(r),t;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),o=0;o<t.length;o++)r[o]=String.fromCharCode(t[o]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o&&(this.formData=function(){return this.text().then(_)}),this.json=function(){return this.text().then(JSON.parse)},this}function j(e,t){var r,o=(t=t||{}).body;if(e instanceof j){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new p(e.headers)),this.method=e.method,this.mode=e.mode,o||null==e._bodyInit||(o=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new p(t.headers)),this.method=(e=t.method||this.method||"GET",r=e.toUpperCase(),-1<u.indexOf(r)?r:e),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}function _(e){var r=new FormData;return e.trim().split("&").forEach(function(e){var t;e&&(t=(e=e.split("=")).shift().replace(/\+/g," "),e=e.join("=").replace(/\+/g," "),r.append(decodeURIComponent(t),decodeURIComponent(e)))}),r}function x(e,t){t=t||{},this.type="default",this.status=void 0===t.status?200:t.status,this.ok=200<=this.status&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new p(t.headers),this.url=t.url||"",this._initBody(e)}e.fetch||(t="URLSearchParams"in e,r="Symbol"in e&&"iterator"in Symbol,i="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),o="FormData"in e,(n="ArrayBuffer"in e)&&(s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],a=function(e){return e&&DataView.prototype.isPrototypeOf(e)},l=ArrayBuffer.isView||function(e){return e&&-1<s.indexOf(Object.prototype.toString.call(e))}),p.prototype.append=function(e,t){e=d(e),t=f(t);var r=this.map[e];this.map[e]=r?r+","+t:t},p.prototype.delete=function(e){delete this.map[d(e)]},p.prototype.get=function(e){return e=d(e),this.has(e)?this.map[e]:null},p.prototype.has=function(e){return this.map.hasOwnProperty(d(e))},p.prototype.set=function(e,t){this.map[d(e)]=f(t)},p.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},p.prototype.keys=function(){var r=[];return this.forEach(function(e,t){r.push(t)}),h(r)},p.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),h(t)},p.prototype.entries=function(){var r=[];return this.forEach(function(e,t){r.push([t,e])}),h(r)},r&&(p.prototype[Symbol.iterator]=p.prototype.entries),u=["DELETE","GET","HEAD","OPTIONS","POST","PUT"],j.prototype.clone=function(){return new j(this,{body:this._bodyInit})},b.call(j.prototype),b.call(x.prototype),x.prototype.clone=function(){return new x(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},x.error=function(){var e=new x(null,{status:0,statusText:""});return e.type="error",e},c=[301,302,303,307,308],x.redirect=function(e,t){if(-1===c.indexOf(t))throw new RangeError("Invalid status code");return new x(null,{status:t,headers:{location:e}})},e.Headers=p,e.Request=j,e.Response=x,e.fetch=function(r,s){return new Promise(function(o,e){var t=new j(r,s),n=new XMLHttpRequest;n.onload=function(){var r,e={status:n.status,statusText:n.statusText,headers:(e=n.getAllResponseHeaders()||"",r=new p,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(e){var e=e.split(":"),t=e.shift().trim();t&&(e=e.join(":").trim(),r.append(t,e))}),r)},t=(e.url="responseURL"in n?n.responseURL:e.headers.get("X-Request-URL"),"response"in n?n.response:n.responseText);o(new x(t,e))},n.onerror=function(){e(new TypeError("Network request failed"))},n.ontimeout=function(){e(new TypeError("Network request failed"))},n.open(t.method,t.url,!0),"include"===t.credentials?n.withCredentials=!0:"omit"===t.credentials&&(n.withCredentials=!1),"responseType"in n&&i&&(n.responseType="blob"),t.headers.forEach(function(e,t){n.setRequestHeader(t,e)}),n.send(void 0===t._bodyInit?null:t._bodyInit)})},e.fetch.polyfill=!0)}("undefined"!=typeof self?self:this)},{}],246:[function(e,t,r){"use strict";e("core-js/modules/es.function.name"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.split"),e("core-js/modules/es.function.name"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.split"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var l,o=n(e("../core/main")),u=n(e("../color/color_conversion"));function n(e){return e&&e.__esModule?e:{default:e}}var c=[{h:0,s:0,b:.8275,name:"gray"},{h:0,s:0,b:.8627,name:"gray"},{h:0,s:0,b:.7529,name:"gray"},{h:.0167,s:.1176,b:1,name:"light pink"}],d=[{h:0,s:0,b:0,name:"black"},{h:0,s:0,b:.5,name:"gray"},{h:0,s:0,b:1,name:"white"},{h:0,s:.5,b:.5,name:"dark maroon"},{h:0,s:.5,b:1,name:"salmon pink"},{h:0,s:1,b:0,name:"black"},{h:0,s:1,b:.5,name:"dark red"},{h:0,s:1,b:1,name:"red"},{h:5,s:0,b:1,name:"very light peach"},{h:5,s:.5,b:.5,name:"brown"},{h:5,s:.5,b:1,name:"peach"},{h:5,s:1,b:.5,name:"brick red"},{h:5,s:1,b:1,name:"crimson"},{h:10,s:0,b:1,name:"light peach"},{h:10,s:.5,b:.5,name:"brown"},{h:10,s:.5,b:1,name:"light orange"},{h:10,s:1,b:.5,name:"brown"},{h:10,s:1,b:1,name:"orange"},{h:15,s:0,b:1,name:"very light yellow"},{h:15,s:.5,b:.5,name:"olive green"},{h:15,s:.5,b:1,name:"light yellow"},{h:15,s:1,b:0,name:"dark olive green"},{h:15,s:1,b:.5,name:"olive green"},{h:15,s:1,b:1,name:"yellow"},{h:20,s:0,b:1,name:"very light yellow"},{h:20,s:.5,b:.5,name:"olive green"},{h:20,s:.5,b:1,name:"light yellow green"},{h:20,s:1,b:0,name:"dark olive green"},{h:20,s:1,b:.5,name:"dark yellow green"},{h:20,s:1,b:1,name:"yellow green"},{h:25,s:.5,b:.5,name:"dark yellow green"},{h:25,s:.5,b:1,name:"light green"},{h:25,s:1,b:.5,name:"dark green"},{h:25,s:1,b:1,name:"green"},{h:30,s:.5,b:1,name:"light green"},{h:30,s:1,b:.5,name:"dark green"},{h:30,s:1,b:1,name:"green"},{h:35,s:0,b:.5,name:"light green"},{h:35,s:0,b:1,name:"very light green"},{h:35,s:.5,b:.5,name:"dark green"},{h:35,s:.5,b:1,name:"light green"},{h:35,s:1,b:0,name:"very dark green"},{h:35,s:1,b:.5,name:"dark green"},{h:35,s:1,b:1,name:"green"},{h:40,s:0,b:1,name:"very light green"},{h:40,s:.5,b:.5,name:"dark green"},{h:40,s:.5,b:1,name:"light green"},{h:40,s:1,b:.5,name:"dark green"},{h:40,s:1,b:1,name:"green"},{h:45,s:.5,b:1,name:"light turquoise"},{h:45,s:1,b:.5,name:"dark turquoise"},{h:45,s:1,b:1,name:"turquoise"},{h:50,s:0,b:1,name:"light sky blue"},{h:50,s:.5,b:.5,name:"dark cyan"},{h:50,s:.5,b:1,name:"light cyan"},{h:50,s:1,b:.5,name:"dark cyan"},{h:50,s:1,b:1,name:"cyan"},{h:55,s:0,b:1,name:"light sky blue"},{h:55,s:.5,b:1,name:"light sky blue"},{h:55,s:1,b:.5,name:"dark blue"},{h:55,s:1,b:1,name:"sky blue"},{h:60,s:0,b:.5,name:"gray"},{h:60,s:0,b:1,name:"very light blue"},{h:60,s:.5,b:.5,name:"blue"},{h:60,s:.5,b:1,name:"light blue"},{h:60,s:1,b:.5,name:"navy blue"},{h:60,s:1,b:1,name:"blue"},{h:65,s:0,b:1,name:"lavender"},{h:65,s:.5,b:.5,name:"navy blue"},{h:65,s:.5,b:1,name:"light purple"},{h:65,s:1,b:.5,name:"dark navy blue"},{h:65,s:1,b:1,name:"blue"},{h:70,s:0,b:1,name:"lavender"},{h:70,s:.5,b:.5,name:"navy blue"},{h:70,s:.5,b:1,name:"lavender blue"},{h:70,s:1,b:.5,name:"dark navy blue"},{h:70,s:1,b:1,name:"blue"},{h:75,s:.5,b:1,name:"lavender"},{h:75,s:1,b:.5,name:"dark purple"},{h:75,s:1,b:1,name:"purple"},{h:80,s:.5,b:1,name:"pinkish purple"},{h:80,s:1,b:.5,name:"dark purple"},{h:80,s:1,b:1,name:"purple"},{h:85,s:0,b:1,name:"light pink"},{h:85,s:.5,b:.5,name:"purple"},{h:85,s:.5,b:1,name:"light fuchsia"},{h:85,s:1,b:.5,name:"dark fuchsia"},{h:85,s:1,b:1,name:"fuchsia"},{h:90,s:.5,b:.5,name:"dark fuchsia"},{h:90,s:.5,b:1,name:"hot pink"},{h:90,s:1,b:.5,name:"dark fuchsia"},{h:90,s:1,b:1,name:"fuchsia"},{h:95,s:0,b:1,name:"pink"},{h:95,s:.5,b:1,name:"light pink"},{h:95,s:1,b:.5,name:"dark magenta"},{h:95,s:1,b:1,name:"magenta"}];o.default.prototype._rgbColorName=function(e){var t,r,e=u.default._rgbaToHSBA(e),o=[(l=e)[0],e[1],e[2]];0!==o[0]&&(o[0]=Math.round(100*o[0]),(e=o[0].toString().split(""))[r=e.length-1]=parseInt(e[r]),e[r]<2.5?e[r]=0:2.5<=e[r]&&e[r]<7.5&&(e[r]=5),2===e.length?(e[0]=parseInt(e[0]),7.5<=e[r]&&(e[r]=0,e[0]=e[0]+1),o[0]=10*e[0]+e[1]):7.5<=e[r]?o[0]=10:o[0]=e[r]),o[2]=o[2]/255;for(var n=o.length-1;1<=n;n--)o[n]<=.25?o[n]=0:.25<o[n]&&o[n]<.75?o[n]=.5:o[n]=1;if(0===o[0]&&0===o[1]&&1===o[2]){for(var s=2;0<=s;s--)l[s]=Math.round(1e4*l[s])/1e4;for(var i=0;i<c.length;i++){if(c[i].h===l[0]&&c[i].s===l[1]&&c[i].b===l[2]){t=c[i].name;break}t="white"}}else for(var a=0;a<d.length;a++)if(d[a].h===o[0]&&d[a].s===o[1]&&d[a].b===o[2]){t=d[a].name;break}return t};e=o.default;r.default=e},{"../color/color_conversion":252,"../core/main":267,"core-js/modules/es.function.name":165,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.string.split":191}],247:[function(e,t,r){"use strict";e("core-js/modules/es.array.concat"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.ends-with"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.ends-with"),e("core-js/modules/es.string.replace"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var s=(e=e("../core/main"))&&e.__esModule?e:{default:e};var i="_Description",a="_fallbackDesc",l="_fallbackTable",u="_Label",c="_labelDesc",d="_labelTable";function f(e){if("label"===e||"fallback"===e)throw new Error("description should not be LABEL or FALLBACK");return e.endsWith(".")||e.endsWith(";")||e.endsWith(",")||e.endsWith("?")||e.endsWith("!")||(e+="."),e}s.default.prototype.describe=function(e,t){var r;s.default._validateParameters("describe",arguments),"string"==typeof e&&(r=this.canvas.id,e=f(e),this.dummyDOM||(this.dummyDOM=document.getElementById(r).parentNode),this.descriptions||(this.descriptions={}),this.descriptions.fallback?this.descriptions.fallback.innerHTML!==e&&(this.descriptions.fallback.innerHTML=e):this._describeHTML("fallback",e),t===this.LABEL&&(this.descriptions.label?this.descriptions.label.innerHTML!==e&&(this.descriptions.label.innerHTML=e):this._describeHTML("label",e)))},s.default.prototype.describeElement=function(e,t,r){var o,n;s.default._validateParameters("describeElement",arguments),"string"==typeof t&&"string"==typeof e&&(o=this.canvas.id,t=f(t),n=function(e){if("label"===e||"fallback"===e)throw new Error("element name should not be LABEL or FALLBACK");e.endsWith(".")||e.endsWith(";")||e.endsWith(",")?e=e.replace(/.$/,":"):e.endsWith(":")||(e+=":");return e}(e),e=e.replace(/[^a-zA-Z0-9]/g,""),n='<th scope="row">'.concat(n,"</th><td>").concat(t,"</td>"),this.dummyDOM||(this.dummyDOM=document.getElementById(o).parentNode),this.descriptions?this.descriptions.fallbackElements||(this.descriptions.fallbackElements={}):this.descriptions={fallbackElements:{}},this.descriptions.fallbackElements[e]?this.descriptions.fallbackElements[e].innerHTML!==n&&(this.descriptions.fallbackElements[e].innerHTML=n):this._describeElementHTML("fallback",e,n),r===this.LABEL&&(this.descriptions.labelElements||(this.descriptions.labelElements={}),this.descriptions.labelElements[e]?this.descriptions.labelElements[e].innerHTML!==n&&(this.descriptions.labelElements[e].innerHTML=n):this._describeElementHTML("label",e,n)))},s.default.prototype._describeHTML=function(e,t){var r,o=this.canvas.id;"fallback"===e?(this.dummyDOM.querySelector("#".concat(o+i))?this.dummyDOM.querySelector("#"+o+l).insertAdjacentHTML("beforebegin",'<p id="'.concat(o+a,'"></p>')):(r='<div id="'.concat(o).concat(i,'" role="region" aria-label="Canvas Description"><p id="').concat(o).concat(a,'"></p></div>'),this.dummyDOM.querySelector("#".concat(o,"accessibleOutput"))?this.dummyDOM.querySelector("#".concat(o,"accessibleOutput")).insertAdjacentHTML("beforebegin",r):this.dummyDOM.querySelector("#".concat(o)).innerHTML=r),this.descriptions.fallback=this.dummyDOM.querySelector("#".concat(o).concat(a)),this.descriptions.fallback.innerHTML=t):"label"===e&&(this.dummyDOM.querySelector("#".concat(o+u))?this.dummyDOM.querySelector("#".concat(o+d))&&this.dummyDOM.querySelector("#".concat(o+d)).insertAdjacentHTML("beforebegin",'<p id="'.concat(o).concat(c,'"></p>')):(r='<div id="'.concat(o).concat(u,'" class="p5Label"><p id="').concat(o).concat(c,'"></p></div>'),this.dummyDOM.querySelector("#".concat(o,"accessibleOutputLabel"))?this.dummyDOM.querySelector("#".concat(o,"accessibleOutputLabel")).insertAdjacentHTML("beforebegin",r):this.dummyDOM.querySelector("#"+o).insertAdjacentHTML("afterend",r)),this.descriptions.label=this.dummyDOM.querySelector("#"+o+c),this.descriptions.label.innerHTML=t)},s.default.prototype._describeElementHTML=function(e,t,r){var o,n=this.canvas.id;"fallback"===e?(this.dummyDOM.querySelector("#".concat(n+i))?this.dummyDOM.querySelector("#"+n+l)||this.dummyDOM.querySelector("#"+n+a).insertAdjacentHTML("afterend",'<table id="'.concat(n).concat(l,'"><caption>Canvas elements and their descriptions</caption></table>')):(o='<div id="'.concat(n).concat(i,'" role="region" aria-label="Canvas Description"><table id="').concat(n).concat(l,'"><caption>Canvas elements and their descriptions</caption></table></div>'),this.dummyDOM.querySelector("#".concat(n,"accessibleOutput"))?this.dummyDOM.querySelector("#".concat(n,"accessibleOutput")).insertAdjacentHTML("beforebegin",o):this.dummyDOM.querySelector("#"+n).innerHTML=o),(o=document.createElement("tr")).id=n+"_fte_"+t,this.dummyDOM.querySelector("#"+n+l).appendChild(o),this.descriptions.fallbackElements[t]=this.dummyDOM.querySelector("#".concat(n).concat("_fte_").concat(t)),this.descriptions.fallbackElements[t].innerHTML=r):"label"===e&&(this.dummyDOM.querySelector("#".concat(n+u))?this.dummyDOM.querySelector("#".concat(n+d))||this.dummyDOM.querySelector("#"+n+c).insertAdjacentHTML("afterend",'<table id="'.concat(n+d,'"></table>')):(o='<div id="'.concat(n).concat(u,'" class="p5Label"><table id="').concat(n).concat(d,'"></table></div>'),this.dummyDOM.querySelector("#".concat(n,"accessibleOutputLabel"))?this.dummyDOM.querySelector("#".concat(n,"accessibleOutputLabel")).insertAdjacentHTML("beforebegin",o):this.dummyDOM.querySelector("#"+n).insertAdjacentHTML("afterend",o)),(e=document.createElement("tr")).id=n+"_lte_"+t,this.dummyDOM.querySelector("#"+n+d).appendChild(e),this.descriptions.labelElements[t]=this.dummyDOM.querySelector("#".concat(n).concat("_lte_").concat(t)),this.descriptions.labelElements[t].innerHTML=r)};e=s.default;r.default=e},{"../core/main":267,"core-js/modules/es.array.concat":149,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.string.ends-with":184,"core-js/modules/es.string.replace":189}],248:[function(e,t,r){"use strict";e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.map"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;e=(e=e("../core/main"))&&e.__esModule?e:{default:e};e.default.prototype._updateGridOutput=function(e){var t,r,o,n;this.dummyDOM.querySelector("#".concat(e,"_summary"))&&(t=this._accessibleOutputs[e],o=function(e,t,r,o){t="".concat(t," canvas, ").concat(r," by ").concat(o," pixels, contains ").concat(e[0]);t=(1===e[0]?"".concat(t," shape: "):"".concat(t," shapes: ")).concat(e[1]);return t}((r=function(e,t){var r,o="",n="",s=0;for(r in t){var i,a=0;for(i in t[r]){var l='<li id="'.concat(e,"shape").concat(s,'">').concat(t[r][i].color," ").concat(r,",");"line"===r?l+=" location = ".concat(t[r][i].pos,", length = ").concat(t[r][i].length," pixels"):(l+=" location = ".concat(t[r][i].pos),"point"!==r&&(l+=", area = ".concat(t[r][i].area," %")),l+="</li>"),o+=l,a++,s++}n=1<a?"".concat(n," ").concat(a," ").concat(r,"s"):"".concat(n," ").concat(a," ").concat(r)}return{numShapes:[s,n],details:o}}(e,this.ingredients.shapes)).numShapes,this.ingredients.colors.background,this.width,this.height),n=function(e,t){var r,o,n,s=0,i="",a=Array.apply(null,Array(10)).map(function(){});for(r in a)a[r]=Array.apply(null,Array(10)).map(function(){});for(o in t)for(var l in t[o]){var u=void 0;u="line"!==o?'<a href="#'.concat(e,"shape").concat(s,'">').concat(t[o][l].color," ").concat(o,"</a>"):'<a href="#'.concat(e,"shape").concat(s,'">').concat(t[o][l].color," ").concat(o," midpoint</a>"),a[t[o][l].loc.locY][t[o][l].loc.locX]?a[t[o][l].loc.locY][t[o][l].loc.locX]=a[t[o][l].loc.locY][t[o][l].loc.locX]+" "+u:a[t[o][l].loc.locY][t[o][l].loc.locX]=u,s++}for(n in a){var c,d="<tr>";for(c in a[n])d+="<td>",void 0!==a[n][c]&&(d+=a[n][c]),d+="</td>";i=i+d+"</tr>"}return i}(e,this.ingredients.shapes),o!==t.summary.innerHTML&&(t.summary.innerHTML=o),n!==t.map.innerHTML&&(t.map.innerHTML=n),r.details!==t.shapeDetails.innerHTML&&(t.shapeDetails.innerHTML=r.details),this._accessibleOutputs[e]=t)};e=e.default;r.default=e},{"../core/main":267,"core-js/modules/es.array.concat":149,"core-js/modules/es.array.map":161}],249:[function(e,t,r){"use strict";e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.map"),e("core-js/modules/es.number.to-fixed"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.map"),e("core-js/modules/es.number.to-fixed"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(e=e("../core/main"))&&e.__esModule?e:{default:e};function l(e,t,r){return e[0]<.4*t?e[1]<.4*r?"top left":e[1]>.6*r?"bottom left":"mid left":e[0]>.6*t?e[1]<.4*r?"top right":e[1]>.6*r?"bottom right":"mid right":e[1]<.4*r?"top middle":e[1]>.6*r?"bottom middle":"middle"}function u(e,t,r){t=Math.floor(e[0]/t*10),e=Math.floor(e[1]/r*10);return 10===t&&(t-=1),10===e&&(e-=1),{locX:t,locY:e}}o.default.prototype.textOutput=function(e){o.default._validateParameters("textOutput",arguments),this._accessibleOutputs.text||(this._accessibleOutputs.text=!0,this._createOutput("textOutput","Fallback"),e===this.LABEL&&(this._accessibleOutputs.textLabel=!0,this._createOutput("textOutput","Label")))},o.default.prototype.gridOutput=function(e){o.default._validateParameters("gridOutput",arguments),this._accessibleOutputs.grid||(this._accessibleOutputs.grid=!0,this._createOutput("gridOutput","Fallback"),e===this.LABEL&&(this._accessibleOutputs.gridLabel=!0,this._createOutput("gridOutput","Label")))},o.default.prototype._addAccsOutput=function(){return this._accessibleOutputs||(this._accessibleOutputs={text:!1,grid:!1,textLabel:!1,gridLabel:!1}),this._accessibleOutputs.grid||this._accessibleOutputs.text},o.default.prototype._createOutput=function(e,t){var r,o,n,s=this.canvas.id,i=(this.ingredients||(this.ingredients={shapes:{},colors:{background:"white",fill:"white",stroke:"black"},pShapes:""}),this.dummyDOM||(this.dummyDOM=document.getElementById(s).parentNode),"");"Fallback"===t?(r=s+e,this.dummyDOM.querySelector("#".concat(o=s+"accessibleOutput"))||(this.dummyDOM.querySelector("#".concat(s,"_Description"))?this.dummyDOM.querySelector("#".concat(s,"_Description")).insertAdjacentHTML("afterend",'<div id="'.concat(o,'" role="region" aria-label="Canvas Outputs"></div>')):this.dummyDOM.querySelector("#".concat(s)).innerHTML='<div id="'.concat(o,'" role="region" aria-label="Canvas Outputs"></div>'))):"Label"===t&&(r=s+e+(i=t),this.dummyDOM.querySelector("#".concat(o=s+"accessibleOutput"+t))||(this.dummyDOM.querySelector("#".concat(s,"_Label"))?this.dummyDOM.querySelector("#".concat(s,"_Label")):this.dummyDOM.querySelector("#".concat(s))).insertAdjacentHTML("afterend",'<div id="'.concat(o,'"></div>'))),this._accessibleOutputs[r]={},"textOutput"===e?(i="#".concat(s,"gridOutput").concat(i),n='<div id="'.concat(r,'">Text Output<div id="').concat(r,'Summary" aria-label="text output summary"><p id="').concat(r,'_summary"></p><ul id="').concat(r,'_list"></ul></div><table id="').concat(r,'_shapeDetails" summary="text output shape details"></table></div>'),this.dummyDOM.querySelector(i)?this.dummyDOM.querySelector(i).insertAdjacentHTML("beforebegin",n):this.dummyDOM.querySelector("#".concat(o)).innerHTML=n,this._accessibleOutputs[r].list=this.dummyDOM.querySelector("#".concat(r,"_list"))):"gridOutput"===e&&(i="#".concat(s,"textOutput").concat(i),n='<div id="'.concat(r,'">Grid Output<p id="').concat(r,'_summary" aria-label="grid output summary"><table id="').concat(r,'_map" summary="grid output content"></table><ul id="').concat(r,'_shapeDetails" aria-label="grid output shape details"></ul></div>'),this.dummyDOM.querySelector(i)?this.dummyDOM.querySelector(i).insertAdjacentHTML("afterend",n):this.dummyDOM.querySelector("#".concat(o)).innerHTML=n,this._accessibleOutputs[r].map=this.dummyDOM.querySelector("#".concat(r,"_map"))),this._accessibleOutputs[r].shapeDetails=this.dummyDOM.querySelector("#".concat(r,"_shapeDetails")),this._accessibleOutputs[r].summary=this.dummyDOM.querySelector("#".concat(r,"_summary"))},o.default.prototype._updateAccsOutput=function(){var e=this.canvas.id;JSON.stringify(this.ingredients.shapes)!==this.ingredients.pShapes&&(this.ingredients.pShapes=JSON.stringify(this.ingredients.shapes),this._accessibleOutputs.text&&this._updateTextOutput(e+"textOutput"),this._accessibleOutputs.grid&&this._updateGridOutput(e+"gridOutput"),this._accessibleOutputs.textLabel&&this._updateTextOutput(e+"textOutputLabel"),this._accessibleOutputs.gridLabel&&this._updateGridOutput(e+"gridOutputLabel"))},o.default.prototype._accsBackground=function(e){this.ingredients.pShapes=JSON.stringify(this.ingredients.shapes),this.ingredients.shapes={},this.ingredients.colors.backgroundRGBA!==e&&(this.ingredients.colors.backgroundRGBA=e,this.ingredients.colors.background=this._rgbColorName(e))},o.default.prototype._accsCanvasColors=function(e,t){"fill"===e?this.ingredients.colors.fillRGBA!==t&&(this.ingredients.colors.fillRGBA=t,this.ingredients.colors.fill=this._rgbColorName(t)):"stroke"===e&&this.ingredients.colors.strokeRGBA!==t&&(this.ingredients.colors.strokeRGBA=t,this.ingredients.colors.stroke=this._rgbColorName(t))},o.default.prototype._accsOutput=function(e,t){"ellipse"===e&&t[2]===t[3]?e="circle":"rectangle"===e&&t[2]===t[3]&&(e="square");var r,o,n={},s=!0,i=function(e,t){var r;e="rectangle"===e||"ellipse"===e||"arc"===e||"circle"===e||"square"===e?(r=Math.round(t[0]+t[2]/2),Math.round(t[1]+t[3]/2)):"triangle"===e?(r=(t[0]+t[2]+t[4])/3,(t[1]+t[3]+t[5])/3):"quadrilateral"===e?(r=(t[0]+t[2]+t[4]+t[6])/4,(t[1]+t[3]+t[5]+t[7])/4):"line"===e?(r=(t[0]+t[2])/2,(t[1]+t[3])/2):(r=t[0],t[1]);return[r,e]}(e,t);if("line"===e?(n.color=this.ingredients.colors.stroke,n.length=Math.round(this.dist(t[0],t[1],t[2],t[3])),r=l([t[0],[1]],this.width,this.height),o=l([t[2],[3]],this.width,this.height),n.loc=u(i,this.width,this.height),n.pos=r===o?"at ".concat(r):"from ".concat(r," to ").concat(o)):("point"===e?n.color=this.ingredients.colors.stroke:(n.color=this.ingredients.colors.fill,n.area=function(e,t,r,o){var n=0;{var s,i,a,l,u,c,d;"arc"===e?(s=((t[5]-t[4])%(2*Math.PI)+2*Math.PI)%(2*Math.PI),n=s*t[2]*t[3]/8,"open"!==t[6]&&"chord"!==t[6]||(d=t[0],i=t[1],a=t[0]+t[2]/2*Math.cos(t[4]).toFixed(2),l=t[1]+t[3]/2*Math.sin(t[4]).toFixed(2),u=t[0]+t[2]/2*Math.cos(t[5]).toFixed(2),c=t[1]+t[3]/2*Math.sin(t[5]).toFixed(2),d=Math.abs(d*(l-c)+a*(c-i)+u*(i-l))/2,s>Math.PI?n+=d:n-=d)):"ellipse"===e||"circle"===e?n=3.14*t[2]/2*t[3]/2:"line"===e||"point"===e?n=0:"quadrilateral"===e?n=Math.abs((t[6]+t[0])*(t[7]-t[1])+(t[0]+t[2])*(t[1]-t[3])+(t[2]+t[4])*(t[3]-t[5])+(t[4]+t[6])*(t[5]-t[7]))/2:"rectangle"===e||"square"===e?n=t[2]*t[3]:"triangle"===e&&(n=Math.abs(t[0]*(t[3]-t[5])+t[2]*(t[5]-t[1])+t[4]*(t[1]-t[3]))/2)}return Math.round(100*n/(r*o))}(e,t,this.width,this.height)),n.pos=l(i,this.width,this.height),n.loc=u(i,this.width,this.height)),this.ingredients.shapes[e]){if(this.ingredients.shapes[e]!==[n]){for(var a in this.ingredients.shapes[e])JSON.stringify(this.ingredients.shapes[e][a])===JSON.stringify(n)&&(s=!1);!0===s&&this.ingredients.shapes[e].push(n)}}else this.ingredients.shapes[e]=[n]};e=o.default;r.default=e},{"../core/main":267,"core-js/modules/es.array.concat":149,"core-js/modules/es.array.fill":152,"core-js/modules/es.array.map":161,"core-js/modules/es.number.to-fixed":171}],250:[function(e,t,r){"use strict";e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.concat"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;e=(e=e("../core/main"))&&e.__esModule?e:{default:e};e.default.prototype._updateTextOutput=function(e){var t,r,o,n;this.dummyDOM.querySelector("#".concat(e,"_summary"))&&(t=this._accessibleOutputs[e],o=function(e,t,r,o){r="Your output is a, ".concat(r," by ").concat(o," pixels, ").concat(t," canvas containing the following");r=1===e?"".concat(r," shape:"):"".concat(r," ").concat(e," shapes:");return r}((r=function(e,t){var r,o="",n=0;for(r in t)for(var s in t[r]){var i='<li><a href="#'.concat(e,"shape").concat(n,'">').concat(t[r][s].color," ").concat(r,"</a>");"line"===r?i+=", ".concat(t[r][s].pos,", ").concat(t[r][s].length," pixels long.</li>"):(i+=", at ".concat(t[r][s].pos),"point"!==r&&(i+=", covering ".concat(t[r][s].area,"% of the canvas")),i+=".</li>"),o+=i,n++}return{numShapes:n,listShapes:o}}(e,this.ingredients.shapes)).numShapes,this.ingredients.colors.background,this.width,this.height),n=function(e,t){var r,o="",n=0;for(r in t)for(var s in t[r]){var i='<tr id="'.concat(e,"shape").concat(n,'"><th>').concat(t[r][s].color," ").concat(r,"</th>");"line"===r?i+="<td>location = ".concat(t[r][s].pos,"</td><td>length = ").concat(t[r][s].length," pixels</td></tr>"):(i+="<td>location = ".concat(t[r][s].pos,"</td>"),"point"!==r&&(i+="<td> area = ".concat(t[r][s].area,"%</td>")),i+="</tr>"),o+=i,n++}return o}(e,this.ingredients.shapes),o!==t.summary.innerHTML&&(t.summary.innerHTML=o),r.listShapes!==t.list.innerHTML&&(t.list.innerHTML=r.listShapes),n!==t.shapeDetails.innerHTML&&(t.shapeDetails.innerHTML=n),this._accessibleOutputs[e]=t)};e=e.default;r.default=e},{"../core/main":267,"core-js/modules/es.array.concat":149}],251:[function(e,t,r){"use strict";var o=(o=e("./core/main"))&&o.__esModule?o:{default:o};e("./core/constants"),e("./core/environment"),e("./core/friendly_errors/stacktrace"),e("./core/friendly_errors/validate_params"),e("./core/friendly_errors/file_errors"),e("./core/friendly_errors/fes_core"),e("./core/friendly_errors/sketch_reader"),e("./core/helpers"),e("./core/legacy"),e("./core/preload"),e("./core/p5.Element"),e("./core/p5.Graphics"),e("./core/p5.Renderer"),e("./core/p5.Renderer2D"),e("./core/rendering"),e("./core/shim"),e("./core/structure"),e("./core/transform"),e("./core/shape/2d_primitives"),e("./core/shape/attributes"),e("./core/shape/curves"),e("./core/shape/vertex"),e("./accessibility/outputs"),e("./accessibility/textOutput"),e("./accessibility/gridOutput"),e("./accessibility/color_namer"),e("./color/color_conversion"),e("./color/creating_reading"),e("./color/p5.Color"),e("./color/setting"),e("./data/p5.TypedDict"),e("./data/local_storage.js"),e("./dom/dom"),e("./accessibility/describe"),e("./events/acceleration"),e("./events/keyboard"),e("./events/mouse"),e("./events/touch"),e("./image/filters"),e("./image/image"),e("./image/loading_displaying"),e("./image/p5.Image"),e("./image/pixels"),e("./io/files"),e("./io/p5.Table"),e("./io/p5.TableRow"),e("./io/p5.XML"),e("./math/calculation"),e("./math/math"),e("./math/noise"),e("./math/p5.Vector"),e("./math/random"),e("./math/trigonometry"),e("./typography/attributes"),e("./typography/loading_displaying"),e("./typography/p5.Font"),e("./utilities/array_functions"),e("./utilities/conversion"),e("./utilities/string_functions"),e("./utilities/time_date"),e("./webgl/3d_primitives"),e("./webgl/interaction"),e("./webgl/light"),e("./webgl/loading"),e("./webgl/material"),e("./webgl/p5.Camera"),e("./webgl/p5.Geometry"),e("./webgl/p5.Matrix"),e("./webgl/p5.RendererGL.Immediate"),e("./webgl/p5.RendererGL"),e("./webgl/p5.RendererGL.Retained"),e("./webgl/p5.Shader"),e("./webgl/p5.RenderBuffer"),e("./webgl/p5.Texture"),e("./webgl/text"),e("./core/init"),t.exports=o.default},{"./accessibility/color_namer":246,"./accessibility/describe":247,"./accessibility/gridOutput":248,"./accessibility/outputs":249,"./accessibility/textOutput":250,"./color/color_conversion":252,"./color/creating_reading":253,"./color/p5.Color":254,"./color/setting":255,"./core/constants":256,"./core/environment":257,"./core/friendly_errors/fes_core":258,"./core/friendly_errors/file_errors":259,"./core/friendly_errors/sketch_reader":260,"./core/friendly_errors/stacktrace":261,"./core/friendly_errors/validate_params":262,"./core/helpers":263,"./core/init":264,"./core/legacy":266,"./core/main":267,"./core/p5.Element":268,"./core/p5.Graphics":269,"./core/p5.Renderer":270,"./core/p5.Renderer2D":271,"./core/preload":272,"./core/rendering":273,"./core/shape/2d_primitives":274,"./core/shape/attributes":275,"./core/shape/curves":276,"./core/shape/vertex":277,"./core/shim":278,"./core/structure":279,"./core/transform":280,"./data/local_storage.js":281,"./data/p5.TypedDict":282,"./dom/dom":283,"./events/acceleration":284,"./events/keyboard":285,"./events/mouse":286,"./events/touch":287,"./image/filters":288,"./image/image":289,"./image/loading_displaying":290,"./image/p5.Image":291,"./image/pixels":292,"./io/files":293,"./io/p5.Table":294,"./io/p5.TableRow":295,"./io/p5.XML":296,"./math/calculation":297,"./math/math":298,"./math/noise":299,"./math/p5.Vector":300,"./math/random":301,"./math/trigonometry":302,"./typography/attributes":303,"./typography/loading_displaying":304,"./typography/p5.Font":305,"./utilities/array_functions":306,"./utilities/conversion":307,"./utilities/string_functions":308,"./utilities/time_date":309,"./webgl/3d_primitives":310,"./webgl/interaction":311,"./webgl/light":312,"./webgl/loading":313,"./webgl/material":314,"./webgl/p5.Camera":315,"./webgl/p5.Geometry":316,"./webgl/p5.Matrix":317,"./webgl/p5.RenderBuffer":318,"./webgl/p5.RendererGL":321,"./webgl/p5.RendererGL.Immediate":319,"./webgl/p5.RendererGL.Retained":320,"./webgl/p5.Shader":322,"./webgl/p5.Texture":323,"./webgl/text":324}],252:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;e=(e=e("../core/main"))&&e.__esModule?e:{default:e};e.default.ColorConversion={},e.default.ColorConversion._hsbaToHSLA=function(e){var t=e[0],r=e[1],o=e[2],n=(2-r)*o/2;return 0!=n&&(1==n?r=0:n<.5?r/=2-r:r=r*o/(2-2*n)),[t,r,n,e[3]]},e.default.ColorConversion._hsbaToRGBA=function(e){var t,r,o,n,s,i=6*e[0],a=e[1],l=e[2];return 0===a?[l,l,l,e[3]]:(r=l*(1-a),o=l*(1-a*(i-(t=Math.floor(i)))),a=l*(1-a*(1+t-i)),i=1===t?(n=o,s=l,r):2===t?(n=r,s=l,a):3===t?(n=r,s=o,l):4===t?(n=a,s=r,l):5===t?(n=l,s=r,o):(n=l,s=a,r),[n,s,i,e[3]])},e.default.ColorConversion._hslaToHSBA=function(e){var t=e[0],r=e[1],o=e[2],n=o<.5?(1+r)*o:o+r-o*r;return[t,r=2*(n-o)/n,n,e[3]]},e.default.ColorConversion._hslaToRGBA=function(e){var t,r=6*e[0],o=e[1],n=e[2];return 0===o?[n,n,n,e[3]]:[(t=function(e,t,r){return e<0?e+=6:6<=e&&(e-=6),e<1?t+(r-t)*e:e<3?r:e<4?t+(r-t)*(4-e):t})(2+r,o=2*n-(n=n<.5?(1+o)*n:n+o-n*o),n),t(r,o,n),t(r-2,o,n),e[3]]},e.default.ColorConversion._rgbaToHSBA=function(e){var t,r,o=e[0],n=e[1],s=e[2],i=Math.max(o,n,s),a=i-Math.min(o,n,s);return 0==a?r=t=0:(r=a/i,o===i?t=(n-s)/a:n===i?t=2+(s-o)/a:s===i&&(t=4+(o-n)/a),t<0?t+=6:6<=t&&(t-=6)),[t/6,r,i,e[3]]},e.default.ColorConversion._rgbaToHSLA=function(e){var t,r,o=e[0],n=e[1],s=e[2],i=Math.max(o,n,s),a=Math.min(o,n,s),l=i+a,a=i-a;return 0==a?r=t=0:(r=l<1?a/l:a/(2-l),o===i?t=(n-s)/a:n===i?t=2+(s-o)/a:s===i&&(t=4+(o-n)/a),t<0?t+=6:6<=t&&(t-=6)),[t/6,r,l/2,e[3]]};e=e.default.ColorConversion;r.default=e},{"../core/main":267}],253:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.map"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.map"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var l=(n=e("../core/main"))&&n.__esModule?n:{default:n},u=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}e("./p5.Color"),e("../core/friendly_errors/validate_params"),e("../core/friendly_errors/file_errors"),e("../core/friendly_errors/fes_core"),l.default.prototype.alpha=function(e){return l.default._validateParameters("alpha",arguments),this.color(e)._getAlpha()},l.default.prototype.blue=function(e){return l.default._validateParameters("blue",arguments),this.color(e)._getBlue()},l.default.prototype.brightness=function(e){return l.default._validateParameters("brightness",arguments),this.color(e)._getBrightness()},l.default.prototype.color=function(){var e;return l.default._validateParameters("color",arguments),arguments[0]instanceof l.default.Color?arguments[0]:(e=arguments[0]instanceof Array?arguments[0]:arguments,new l.default.Color(this,e))},l.default.prototype.green=function(e){return l.default._validateParameters("green",arguments),this.color(e)._getGreen()},l.default.prototype.hue=function(e){return l.default._validateParameters("hue",arguments),this.color(e)._getHue()},l.default.prototype.lerpColor=function(e,t,r){l.default._validateParameters("lerpColor",arguments);var o,n,s,i=this._colorMode,a=this._colorMaxes;if(i===u.RGB)n=e.levels.map(function(e){return e/255}),s=t.levels.map(function(e){return e/255});else if(i===u.HSB)e._getBrightness(),t._getBrightness(),n=e.hsba,s=t.hsba;else{if(i!==u.HSL)throw new Error("".concat(i,"cannot be used for interpolation."));e._getLightness(),t._getLightness(),n=e.hsla,s=t.hsla}return r=Math.max(Math.min(r,1),0),void 0===this.lerp&&(this.lerp=function(e,t,r){return r*(t-e)+e}),e=this.lerp(n[0],s[0],r),t=this.lerp(n[1],s[1],r),o=this.lerp(n[2],s[2],r),n=this.lerp(n[3],s[3],r),e*=a[i][0],t*=a[i][1],o*=a[i][2],n*=a[i][3],this.color(e,t,o,n)},l.default.prototype.lightness=function(e){return l.default._validateParameters("lightness",arguments),this.color(e)._getLightness()},l.default.prototype.red=function(e){return l.default._validateParameters("red",arguments),this.color(e)._getRed()},l.default.prototype.saturation=function(e){return l.default._validateParameters("saturation",arguments),this.color(e)._getSaturation()};var n=l.default;r.default=n},{"../core/constants":256,"../core/friendly_errors/fes_core":258,"../core/friendly_errors/file_errors":259,"../core/friendly_errors/validate_params":262,"../core/main":267,"./p5.Color":254,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.map":161,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],254:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.trim"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.trim"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var c=n(e("../core/main")),d=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants")),f=n(e("./color_conversion"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}function n(e){return e&&e.__esModule?e:{default:e}}c.default.Color=function(e,t){if(this._storeModeAndMaxes(e._colorMode,e._colorMaxes),this.mode!==d.RGB&&this.mode!==d.HSL&&this.mode!==d.HSB)throw new Error("".concat(this.mode," is an invalid colorMode."));return this._array=c.default.Color._parseInputs.apply(this,t),this._calculateLevels(),this},c.default.Color.prototype.toString=function(e){var t=this.levels,r=this._array,o=r[3];switch(e){case"#rrggbb":return"#".concat(t[0]<16?"0".concat(t[0].toString(16)):t[0].toString(16),t[1]<16?"0".concat(t[1].toString(16)):t[1].toString(16),t[2]<16?"0".concat(t[2].toString(16)):t[2].toString(16));case"#rrggbbaa":return"#".concat(t[0]<16?"0".concat(t[0].toString(16)):t[0].toString(16),t[1]<16?"0".concat(t[1].toString(16)):t[1].toString(16),t[2]<16?"0".concat(t[2].toString(16)):t[2].toString(16),t[3]<16?"0".concat(t[3].toString(16)):t[3].toString(16));case"#rgb":return"#".concat(Math.round(15*r[0]).toString(16),Math.round(15*r[1]).toString(16),Math.round(15*r[2]).toString(16));case"#rgba":return"#".concat(Math.round(15*r[0]).toString(16),Math.round(15*r[1]).toString(16),Math.round(15*r[2]).toString(16),Math.round(15*r[3]).toString(16));case"rgb":return"rgb(".concat(t[0],", ",t[1],", ",t[2],")");case"rgb%":return"rgb(".concat((100*r[0]).toPrecision(3),"%, ",(100*r[1]).toPrecision(3),"%, ",(100*r[2]).toPrecision(3),"%)");case"rgba%":return"rgba(".concat((100*r[0]).toPrecision(3),"%, ",(100*r[1]).toPrecision(3),"%, ",(100*r[2]).toPrecision(3),"%, ",(100*r[3]).toPrecision(3),"%)");case"hsb":case"hsv":return this.hsba||(this.hsba=f.default._rgbaToHSBA(this._array)),"hsb(".concat(this.hsba[0]*this.maxes[d.HSB][0],", ",this.hsba[1]*this.maxes[d.HSB][1],", ",this.hsba[2]*this.maxes[d.HSB][2],")");case"hsb%":case"hsv%":return this.hsba||(this.hsba=f.default._rgbaToHSBA(this._array)),"hsb(".concat((100*this.hsba[0]).toPrecision(3),"%, ",(100*this.hsba[1]).toPrecision(3),"%, ",(100*this.hsba[2]).toPrecision(3),"%)");case"hsba":case"hsva":return this.hsba||(this.hsba=f.default._rgbaToHSBA(this._array)),"hsba(".concat(this.hsba[0]*this.maxes[d.HSB][0],", ",this.hsba[1]*this.maxes[d.HSB][1],", ",this.hsba[2]*this.maxes[d.HSB][2],", ",o,")");case"hsba%":case"hsva%":return this.hsba||(this.hsba=f.default._rgbaToHSBA(this._array)),"hsba(".concat((100*this.hsba[0]).toPrecision(3),"%, ",(100*this.hsba[1]).toPrecision(3),"%, ",(100*this.hsba[2]).toPrecision(3),"%, ",(100*o).toPrecision(3),"%)");case"hsl":return this.hsla||(this.hsla=f.default._rgbaToHSLA(this._array)),"hsl(".concat(this.hsla[0]*this.maxes[d.HSL][0],", ",this.hsla[1]*this.maxes[d.HSL][1],", ",this.hsla[2]*this.maxes[d.HSL][2],")");case"hsl%":return this.hsla||(this.hsla=f.default._rgbaToHSLA(this._array)),"hsl(".concat((100*this.hsla[0]).toPrecision(3),"%, ",(100*this.hsla[1]).toPrecision(3),"%, ",(100*this.hsla[2]).toPrecision(3),"%)");case"hsla":return this.hsla||(this.hsla=f.default._rgbaToHSLA(this._array)),"hsla(".concat(this.hsla[0]*this.maxes[d.HSL][0],", ",this.hsla[1]*this.maxes[d.HSL][1],", ",this.hsla[2]*this.maxes[d.HSL][2],", ",o,")");case"hsla%":return this.hsla||(this.hsla=f.default._rgbaToHSLA(this._array)),"hsl(".concat((100*this.hsla[0]).toPrecision(3),"%, ",(100*this.hsla[1]).toPrecision(3),"%, ",(100*this.hsla[2]).toPrecision(3),"%, ",(100*o).toPrecision(3),"%)");default:return"rgba(".concat(t[0],",",t[1],",",t[2],",",o,")")}},c.default.Color.prototype.setRed=function(e){this._array[0]=e/this.maxes[d.RGB][0],this._calculateLevels()},c.default.Color.prototype.setGreen=function(e){this._array[1]=e/this.maxes[d.RGB][1],this._calculateLevels()},c.default.Color.prototype.setBlue=function(e){this._array[2]=e/this.maxes[d.RGB][2],this._calculateLevels()},c.default.Color.prototype.setAlpha=function(e){this._array[3]=e/this.maxes[this.mode][3],this._calculateLevels()},c.default.Color.prototype._calculateLevels=function(){for(var e=this._array,t=this.levels=new Array(e.length),r=e.length-1;0<=r;--r)t[r]=Math.round(255*e[r]);this.hsla=null,this.hsba=null},c.default.Color.prototype._getAlpha=function(){return this._array[3]*this.maxes[this.mode][3]},c.default.Color.prototype._storeModeAndMaxes=function(e,t){this.mode=e,this.maxes=t},c.default.Color.prototype._getMode=function(){return this.mode},c.default.Color.prototype._getMaxes=function(){return this.maxes},c.default.Color.prototype._getBlue=function(){return this._array[2]*this.maxes[d.RGB][2]},c.default.Color.prototype._getBrightness=function(){return this.hsba||(this.hsba=f.default._rgbaToHSBA(this._array)),this.hsba[2]*this.maxes[d.HSB][2]},c.default.Color.prototype._getGreen=function(){return this._array[1]*this.maxes[d.RGB][1]},c.default.Color.prototype._getHue=function(){return this.mode===d.HSB?(this.hsba||(this.hsba=f.default._rgbaToHSBA(this._array)),this.hsba[0]*this.maxes[d.HSB][0]):(this.hsla||(this.hsla=f.default._rgbaToHSLA(this._array)),this.hsla[0]*this.maxes[d.HSL][0])},c.default.Color.prototype._getLightness=function(){return this.hsla||(this.hsla=f.default._rgbaToHSLA(this._array)),this.hsla[2]*this.maxes[d.HSL][2]},c.default.Color.prototype._getRed=function(){return this._array[0]*this.maxes[d.RGB][0]},c.default.Color.prototype._getSaturation=function(){return this.mode===d.HSB?(this.hsba||(this.hsba=f.default._rgbaToHSBA(this._array)),this.hsba[1]*this.maxes[d.HSB][1]):(this.hsla||(this.hsla=f.default._rgbaToHSLA(this._array)),this.hsla[1]*this.maxes[d.HSL][1])};var h={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},e=/\s*/,s=/(\d{1,3})/,l=/((?:\d+(?:\.\d+)?)|(?:\.\d+))/,u=new RegExp("".concat(l.source,"%")),p={HEX3:/^#([a-f0-9])([a-f0-9])([a-f0-9])$/i,HEX4:/^#([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])$/i,HEX6:/^#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/i,HEX8:/^#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/i,RGB:new RegExp(["^rgb\\(",s.source,",",s.source,",",s.source,"\\)$"].join(e.source),"i"),RGB_PERCENT:new RegExp(["^rgb\\(",u.source,",",u.source,",",u.source,"\\)$"].join(e.source),"i"),RGBA:new RegExp(["^rgba\\(",s.source,",",s.source,",",s.source,",",l.source,"\\)$"].join(e.source),"i"),RGBA_PERCENT:new RegExp(["^rgba\\(",u.source,",",u.source,",",u.source,",",l.source,"\\)$"].join(e.source),"i"),HSL:new RegExp(["^hsl\\(",s.source,",",u.source,",",u.source,"\\)$"].join(e.source),"i"),HSLA:new RegExp(["^hsla\\(",s.source,",",u.source,",",u.source,",",l.source,"\\)$"].join(e.source),"i"),HSB:new RegExp(["^hsb\\(",s.source,",",u.source,",",u.source,"\\)$"].join(e.source),"i"),HSBA:new RegExp(["^hsba\\(",s.source,",",u.source,",",u.source,",",l.source,"\\)$"].join(e.source),"i")},s=(c.default.Color._parseInputs=function(e,t,r,o){var n,s=arguments.length,i=this.mode,a=this.maxes[i],l=[];if(3<=s){for(l[0]=e/a[0],l[1]=t/a[1],l[2]=r/a[2],l[3]="number"==typeof o?o/a[3]:1,n=l.length-1;0<=n;--n){var u=l[n];u<0?l[n]=0:1<u&&(l[n]=1)}return i===d.HSL?f.default._hslaToRGBA(l):i===d.HSB?f.default._hsbaToRGBA(l):l}if(1===s&&"string"==typeof e){r=e.trim().toLowerCase();if(h[r])return c.default.Color._parseInputs.call(this,h[r]);if(p.HEX3.test(r))return(l=p.HEX3.exec(r).slice(1).map(function(e){return parseInt(e+e,16)/255}))[3]=1,l;if(p.HEX6.test(r))return(l=p.HEX6.exec(r).slice(1).map(function(e){return parseInt(e,16)/255}))[3]=1,l;if(p.HEX4.test(r))return l=p.HEX4.exec(r).slice(1).map(function(e){return parseInt(e+e,16)/255});if(p.HEX8.test(r))return l=p.HEX8.exec(r).slice(1).map(function(e){return parseInt(e,16)/255});if(p.RGB.test(r))return(l=p.RGB.exec(r).slice(1).map(function(e){return e/255}))[3]=1,l;if(p.RGB_PERCENT.test(r))return(l=p.RGB_PERCENT.exec(r).slice(1).map(function(e){return parseFloat(e)/100}))[3]=1,l;if(p.RGBA.test(r))return l=p.RGBA.exec(r).slice(1).map(function(e,t){return 3===t?parseFloat(e):e/255});if(p.RGBA_PERCENT.test(r))return l=p.RGBA_PERCENT.exec(r).slice(1).map(function(e,t){return 3===t?parseFloat(e):parseFloat(e)/100});if(p.HSL.test(r)?(l=p.HSL.exec(r).slice(1).map(function(e,t){return 0===t?parseInt(e,10)/360:parseInt(e,10)/100}))[3]=1:p.HSLA.test(r)&&(l=p.HSLA.exec(r).slice(1).map(function(e,t){return 0===t?parseInt(e,10)/360:3===t?parseFloat(e):parseInt(e,10)/100})),(l=l.map(function(e){return Math.max(Math.min(e,1),0)})).length)return f.default._hslaToRGBA(l);if(p.HSB.test(r)?(l=p.HSB.exec(r).slice(1).map(function(e,t){return 0===t?parseInt(e,10)/360:parseInt(e,10)/100}))[3]=1:p.HSBA.test(r)&&(l=p.HSBA.exec(r).slice(1).map(function(e,t){return 0===t?parseInt(e,10)/360:3===t?parseFloat(e):parseInt(e,10)/100})),l.length){for(n=l.length-1;0<=n;--n)l[n]=Math.max(Math.min(l[n],1),0);return f.default._hsbaToRGBA(l)}l=[1,1,1,1]}else{if(1!==s&&2!==s||"number"!=typeof e)throw new Error("".concat(arguments,"is not a valid color representation."));l[0]=e/a[2],l[1]=e/a[2],l[2]=e/a[2],l[3]="number"==typeof t?t/a[3]:1,l=l.map(function(e){return Math.max(Math.min(e,1),0)})}return l},c.default.Color);r.default=s},{"../core/constants":256,"../core/main":267,"./color_conversion":252,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.join":159,"core-js/modules/es.array.map":161,"core-js/modules/es.array.slice":162,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.constructor":180,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.string.iterator":186,"core-js/modules/es.string.trim":193,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],255:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.fill"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var s=(n=e("../core/main"))&&n.__esModule?n:{default:n},a=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants"));function l(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,l=function(){return e},e)}e("./p5.Color"),s.default.prototype.background=function(){var e;return(e=this._renderer).background.apply(e,arguments),this},s.default.prototype.clear=function(){return this._renderer.clear((arguments.length<=0?void 0:arguments[0])||0,(arguments.length<=1?void 0:arguments[1])||0,(arguments.length<=2?void 0:arguments[2])||0,(arguments.length<=3?void 0:arguments[3])||0),this},s.default.prototype.colorMode=function(e,t,r,o,n){return s.default._validateParameters("colorMode",arguments),e!==a.RGB&&e!==a.HSB&&e!==a.HSL||(this._colorMode=e,e=this._colorMaxes[e],2===arguments.length?(e[0]=t,e[1]=t,e[2]=t,e[3]=t):4===arguments.length?(e[0]=t,e[1]=r,e[2]=o):5===arguments.length&&(e[0]=t,e[1]=r,e[2]=o,e[3]=n)),this},s.default.prototype.fill=function(){var e;return this._renderer._setProperty("_fillSet",!0),this._renderer._setProperty("_doFill",!0),(e=this._renderer).fill.apply(e,arguments),this},s.default.prototype.noFill=function(){return this._renderer._setProperty("_doFill",!1),this},s.default.prototype.noStroke=function(){return this._renderer._setProperty("_doStroke",!1),this},s.default.prototype.stroke=function(){var e;return this._renderer._setProperty("_strokeSet",!0),this._renderer._setProperty("_doStroke",!0),(e=this._renderer).stroke.apply(e,arguments),this},s.default.prototype.erase=function(){return this._renderer.erase(0<arguments.length&&void 0!==arguments[0]?arguments[0]:255,1<arguments.length&&void 0!==arguments[1]?arguments[1]:255),this},s.default.prototype.noErase=function(){return this._renderer.noErase(),this};var n=s.default;r.default=n},{"../core/constants":256,"../core/main":267,"./p5.Color":254,"core-js/modules/es.array.fill":152,"core-js/modules/es.array.iterator":158,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],256:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.BEZIER=r.QUADRATIC=r.LINEAR=r._CTX_MIDDLE=r._DEFAULT_LEADMULT=r._DEFAULT_TEXT_FILL=r.WORD=r.CHAR=r.BOLDITALIC=r.BOLD=r.ITALIC=r.NORMAL=r.BLUR=r.ERODE=r.DILATE=r.POSTERIZE=r.INVERT=r.OPAQUE=r.GRAY=r.THRESHOLD=r.BURN=r.DODGE=r.SOFT_LIGHT=r.HARD_LIGHT=r.OVERLAY=r.REPLACE=r.SCREEN=r.MULTIPLY=r.EXCLUSION=r.SUBTRACT=r.DIFFERENCE=r.LIGHTEST=r.DARKEST=r.ADD=r.REMOVE=r.BLEND=r.UP_ARROW=r.TAB=r.SHIFT=r.RIGHT_ARROW=r.RETURN=r.OPTION=r.LEFT_ARROW=r.ESCAPE=r.ENTER=r.DOWN_ARROW=r.DELETE=r.CONTROL=r.BACKSPACE=r.ALT=r.AUTO=r.HSL=r.HSB=r.RGB=r.MITER=r.BEVEL=r.ROUND=r.SQUARE=r.PROJECT=r.PIE=r.CHORD=r.OPEN=r.CLOSE=r.TESS=r.QUAD_STRIP=r.QUADS=r.TRIANGLE_STRIP=r.TRIANGLE_FAN=r.TRIANGLES=r.LINE_LOOP=r.LINE_STRIP=r.LINES=r.POINTS=r.BASELINE=r.BOTTOM=r.TOP=r.CENTER=r.LEFT=r.RIGHT=r.RADIUS=r.CORNERS=r.CORNER=r.RAD_TO_DEG=r.DEG_TO_RAD=r.RADIANS=r.DEGREES=r.TWO_PI=r.TAU=r.QUARTER_PI=r.PI=r.HALF_PI=r.WAIT=r.TEXT=r.MOVE=r.HAND=r.CROSS=r.ARROW=r.WEBGL=r.P2D=r.VERSION=void 0,r.COVER=r.CONTAIN=r.FALLBACK=r.LABEL=r.AXES=r.GRID=r._DEFAULT_FILL=r._DEFAULT_STROKE=r.PORTRAIT=r.LANDSCAPE=r.MIRROR=r.CLAMP=r.REPEAT=r.NEAREST=r.IMAGE=r.IMMEDIATE=r.TEXTURE=r.FILL=r.STROKE=r.CURVE=void 0;var o=Math.PI,n=(r.VERSION="1.6.0",r.P2D="p2d",r.WEBGL="webgl",r.ARROW="default",r.CROSS="crosshair",r.HAND="pointer",r.MOVE="move",r.TEXT="text",r.WAIT="wait",o/2),n=(r.HALF_PI=n,o),n=(r.PI=n,o/4),n=(r.QUARTER_PI=n,2*o),n=(r.TAU=n,2*o),n=(r.TWO_PI=n,r.DEGREES="degrees",r.RADIANS="radians",o/180),n=(r.DEG_TO_RAD=n,180/o);r.RAD_TO_DEG=n,r.CORNER="corner",r.CORNERS="corners",r.RADIUS="radius",r.RIGHT="right",r.LEFT="left",r.CENTER="center",r.TOP="top",r.BOTTOM="bottom",r.BASELINE="alphabetic",r.POINTS=0,r.LINES=1,r.LINE_STRIP=3,r.LINE_LOOP=2,r.TRIANGLES=4,r.TRIANGLE_FAN=6,r.TRIANGLE_STRIP=5,r.QUADS="quads",r.QUAD_STRIP="quad_strip",r.TESS="tess",r.CLOSE="close",r.OPEN="open",r.CHORD="chord",r.PIE="pie",r.PROJECT="square",r.SQUARE="butt",r.ROUND="round",r.BEVEL="bevel",r.MITER="miter",r.RGB="rgb",r.HSB="hsb",r.HSL="hsl",r.AUTO="auto",r.ALT=18,r.BACKSPACE=8,r.CONTROL=17,r.DELETE=46,r.DOWN_ARROW=40,r.ENTER=13,r.ESCAPE=27,r.LEFT_ARROW=37,r.OPTION=18,r.RETURN=13,r.RIGHT_ARROW=39,r.SHIFT=16,r.TAB=9,r.UP_ARROW=38,r.BLEND="source-over",r.REMOVE="destination-out",r.ADD="lighter",r.DARKEST="darken",r.LIGHTEST="lighten",r.DIFFERENCE="difference",r.SUBTRACT="subtract",r.EXCLUSION="exclusion",r.MULTIPLY="multiply",r.SCREEN="screen",r.REPLACE="copy",r.OVERLAY="overlay",r.HARD_LIGHT="hard-light",r.SOFT_LIGHT="soft-light",r.DODGE="color-dodge",r.BURN="color-burn",r.THRESHOLD="threshold",r.GRAY="gray",r.OPAQUE="opaque",r.INVERT="invert",r.POSTERIZE="posterize",r.DILATE="dilate",r.ERODE="erode",r.BLUR="blur",r.NORMAL="normal",r.ITALIC="italic",r.BOLD="bold",r.BOLDITALIC="bold italic",r.CHAR="CHAR",r.WORD="WORD",r._DEFAULT_TEXT_FILL="#000000",r._DEFAULT_LEADMULT=1.25,r._CTX_MIDDLE="middle",r.LINEAR="linear",r.QUADRATIC="quadratic",r.BEZIER="bezier",r.CURVE="curve",r.STROKE="stroke",r.FILL="fill",r.TEXTURE="texture",r.IMMEDIATE="immediate",r.IMAGE="image",r.NEAREST="nearest",r.REPEAT="repeat",r.CLAMP="clamp",r.MIRROR="mirror",r.LANDSCAPE="landscape",r.PORTRAIT="portrait",r._DEFAULT_STROKE="#000000",r._DEFAULT_FILL="#FFFFFF",r.GRID="grid",r.AXES="axes",r.LABEL="label",r.FALLBACK="fallback",r.CONTAIN="contain";r.COVER="cover"},{}],257:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.search"),e("core-js/modules/es.string.split"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.search"),e("core-js/modules/es.string.split"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(s=e("./main"))&&s.__esModule?s:{default:s},s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("./constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}var l=[s.ARROW,s.CROSS,s.HAND,s.MOVE,s.TEXT,s.WAIT],u=(n.default.prototype._frameRate=0,n.default.prototype._lastFrameTime=window.performance.now(),n.default.prototype._targetFrameRate=60,window.print);function c(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth||0}function d(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight||0}n.default.prototype.print=function(){var e;arguments.length?(e=console).log.apply(e,arguments):u()},n.default.prototype.frameCount=0,n.default.prototype.deltaTime=0,n.default.prototype.focused=document.hasFocus(),n.default.prototype.cursor=function(e,t,r){var o,n="auto",s=this._curElement.elt;l.includes(e)?n=e:"string"==typeof e&&(o="",t&&r&&"number"==typeof t&&"number"==typeof r&&(o="".concat(t," ").concat(r)),n="http://"===e.substring(0,7)||"https://"===e.substring(0,8)||/\.(cur|jpg|jpeg|gif|png|CUR|JPG|JPEG|GIF|PNG)$/.test(e)?"url(".concat(e,") ").concat(o,", auto"):e),s.style.cursor=n},n.default.prototype.frameRate=function(e){return n.default._validateParameters("frameRate",arguments),"number"!=typeof e||e<0?this._frameRate:(this._setProperty("_targetFrameRate",e),0===e&&this._setProperty("_frameRate",e),this)},n.default.prototype.getFrameRate=function(){return this.frameRate()},n.default.prototype.setFrameRate=function(e){return this.frameRate(e)},n.default.prototype.getTargetFrameRate=function(){return this._targetFrameRate},n.default.prototype.noCursor=function(){this._curElement.elt.style.cursor="none"},n.default.prototype.displayWidth=screen.width,n.default.prototype.displayHeight=screen.height,n.default.prototype.windowWidth=c(),n.default.prototype.windowHeight=d(),n.default.prototype._onresize=function(e){this._setProperty("windowWidth",c()),this._setProperty("windowHeight",d());var t=this._isGlobal?window:this;"function"!=typeof t.windowResized||void 0===(t=t.windowResized(e))||t||e.preventDefault()},n.default.prototype.width=0,n.default.prototype.height=0,n.default.prototype.fullscreen=function(e){if(n.default._validateParameters("fullscreen",arguments),void 0===e)return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement;if(e){e=document.documentElement;if(!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled))throw new Error("Fullscreen not enabled in this browser.");e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.msRequestFullscreen&&e.msRequestFullscreen()}else document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen()},n.default.prototype.pixelDensity=function(e){var t;return n.default._validateParameters("pixelDensity",arguments),"number"==typeof e?(e!==this._pixelDensity&&(this._pixelDensity=e),(t=this).resizeCanvas(this.width,this.height,!0)):t=this._pixelDensity,t},n.default.prototype.displayDensity=function(){return window.devicePixelRatio},n.default.prototype.getURL=function(){return location.href},n.default.prototype.getURLPath=function(){return location.pathname.split("/").filter(function(e){return""!==e})},n.default.prototype.getURLParams=function(){for(var e,t=/[?&]([^&=]+)(?:[&=])([^&=]+)/gim,r={};null!=(e=t.exec(location.search));)e.index===t.lastIndex&&t.lastIndex++,r[e[1]]=e[2];return r};e=n.default;r.default=e},{"./constants":256,"./main":267,"core-js/modules/es.array.concat":149,"core-js/modules/es.array.filter":153,"core-js/modules/es.array.includes":156,"core-js/modules/es.array.iterator":158,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.string.includes":185,"core-js/modules/es.string.iterator":186,"core-js/modules/es.string.search":190,"core-js/modules/es.string.split":191,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],258:[function(r,e,t){"use strict";r("core-js/modules/es.symbol"),r("core-js/modules/es.symbol.description"),r("core-js/modules/es.symbol.iterator"),r("core-js/modules/es.array.concat"),r("core-js/modules/es.array.filter"),r("core-js/modules/es.array.for-each"),r("core-js/modules/es.array.includes"),r("core-js/modules/es.array.iterator"),r("core-js/modules/es.array.join"),r("core-js/modules/es.array.map"),r("core-js/modules/es.array.slice"),r("core-js/modules/es.array.some"),r("core-js/modules/es.function.name"),r("core-js/modules/es.object.assign"),r("core-js/modules/es.object.get-own-property-names"),r("core-js/modules/es.object.keys"),r("core-js/modules/es.object.to-string"),r("core-js/modules/es.regexp.constructor"),r("core-js/modules/es.regexp.exec"),r("core-js/modules/es.regexp.to-string"),r("core-js/modules/es.string.iterator"),r("core-js/modules/es.string.match"),r("core-js/modules/es.string.replace"),r("core-js/modules/es.string.search"),r("core-js/modules/es.string.split"),r("core-js/modules/web.dom-collections.for-each"),r("core-js/modules/web.dom-collections.iterator"),r("core-js/modules/es.symbol"),r("core-js/modules/es.symbol.description"),r("core-js/modules/es.symbol.iterator"),r("core-js/modules/es.array.concat"),r("core-js/modules/es.array.filter"),r("core-js/modules/es.array.for-each"),r("core-js/modules/es.array.includes"),r("core-js/modules/es.array.iterator"),r("core-js/modules/es.array.join"),r("core-js/modules/es.array.map"),r("core-js/modules/es.array.slice"),r("core-js/modules/es.array.some"),r("core-js/modules/es.function.name"),r("core-js/modules/es.object.assign"),r("core-js/modules/es.object.get-own-property-names"),r("core-js/modules/es.object.keys"),r("core-js/modules/es.object.to-string"),r("core-js/modules/es.regexp.constructor"),r("core-js/modules/es.regexp.exec"),r("core-js/modules/es.regexp.to-string"),r("core-js/modules/es.string.iterator"),r("core-js/modules/es.string.match"),r("core-js/modules/es.string.replace"),r("core-js/modules/es.string.search"),r("core-js/modules/es.string.split"),r("core-js/modules/web.dom-collections.for-each"),r("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=(l=r("../main"))&&l.__esModule?l:{default:l};r("../internationalization");function n(r,o){o=o||console.log.bind(console),s||i(),s.some(function(e){var t;if(r.message&&null!==r.message.match("\\W?".concat(e.name,"\\W")))return t="function"===e.type?"".concat(e.name,"()"):e.name,o("Did you just try to use p5.js's ".concat(t," ").concat(e.type,"? If so, you may want to move it into your sketch's setup() function.\n\nFor more details, see: ").concat(a)),!0})}var s=null,i=null,a=(o.default._friendlyError=o.default._checkForUserDefinedFunctions=o.default._fesErrorMonitor=function(){},s=null,"https://github.com/processing/p5.js/wiki/p5.js-overview#why-cant-i-assign-variables-using-p5-functions-and-variables-before-setup"),i=function(){function e(r){return Object.getOwnPropertyNames(r).filter(function(e){return"_"!==e[0]&&(!(e in t)&&(t[e]=!0))}).map(function(e){var t="function"==typeof r[e]?"function":e===e.toUpperCase()?"constant":"variable";return{name:e,type:t}})}var t={};(s=[].concat(e(o.default.prototype),e(r("../constants")))).sort(function(e,t){return t.name.length-e.name.length})},l=(o.default.prototype._helpForMisusedAtTopLevelCode=n,"complete"!==document.readyState&&(window.addEventListener("error",n,!1),window.addEventListener("load",function(){window.removeEventListener("error",n,!1)})),o.default);t.default=l},{"../constants":256,"../internationalization":265,"../main":267,"./browser_errors":void 0,"core-js/modules/es.array.concat":149,"core-js/modules/es.array.filter":153,"core-js/modules/es.array.for-each":154,"core-js/modules/es.array.includes":156,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.join":159,"core-js/modules/es.array.map":161,"core-js/modules/es.array.slice":162,"core-js/modules/es.array.some":163,"core-js/modules/es.function.name":165,"core-js/modules/es.object.assign":172,"core-js/modules/es.object.get-own-property-names":174,"core-js/modules/es.object.keys":176,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.constructor":180,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.string.iterator":186,"core-js/modules/es.string.match":187,"core-js/modules/es.string.replace":189,"core-js/modules/es.string.search":190,"core-js/modules/es.string.split":191,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/web.dom-collections.for-each":229,"core-js/modules/web.dom-collections.iterator":230}],259:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(o=e("../main"))&&o.__esModule?o:{default:o};e("../internationalization");o.default._friendlyFileLoadError=function(){};e=o.default;r.default=e},{"../internationalization":265,"../main":267}],260:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.trim"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.trim"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=k(e("../main")),s=e("../internationalization"),a=O(e("../constants")),l,u,c,d,f,h,p,m,y,g,v,b,j,_,x,w,S,M,E,T,I;function C(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,C=function(){return e},e)}function O(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=C();if(t&&t.has(e))return t.get(e);var r,o,n={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e)Object.prototype.hasOwnProperty.call(e,r)&&((o=s?Object.getOwnPropertyDescriptor(e,r):null)&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]);return n.default=e,t&&t.set(e,n),n}function k(e){return e&&e.__esModule?e:{default:e}}function D(e){return A(e)||P(e)||L()}function L(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function P(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function A(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}n.default._fesCodeReader=function(){};var R=n.default;r.default=R},{"../constants":256,"../internationalization":265,"../main":267,"core-js/modules/es.array.filter":153,"core-js/modules/es.array.for-each":154,"core-js/modules/es.array.from":155,"core-js/modules/es.array.includes":156,"core-js/modules/es.array.index-of":157,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.join":159,"core-js/modules/es.array.map":161,"core-js/modules/es.array.slice":162,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.keys":176,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.constructor":180,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.string.includes":185,"core-js/modules/es.string.iterator":186,"core-js/modules/es.string.match":187,"core-js/modules/es.string.split":191,"core-js/modules/es.string.trim":193,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.for-each":229,"core-js/modules/web.dom-collections.iterator":230}],261:[function(e,t,r){"use strict";e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;e=(e=e("../main"))&&e.__esModule?e:{default:e};function o(){var t=/(^|@)\S+:\d+/,r=/^\s*at .*(\S+:\d+|\(native\))/m,o=/^(eval@)?(\[native code])?$/;return{parse:function(e){return void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(r)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):void 0},extractLocation:function(e){return-1===e.indexOf(":")?[e]:[(e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,"")))[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(r)},this).map(function(e){var t=(e=-1<e.indexOf("(eval ")?e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""):e).replace(/^\s+/,"").replace(/\(eval code/g,"("),r=t.match(/ (\((.+):(\d+):(\d+)\)$)/),t=(t=r?t.replace(r[0],""):t).split(/\s+/).slice(1),r=this.extractLocation(r?r[1]:t.pop());return{functionName:t.join(" ")||void 0,fileName:-1<["eval","<anonymous>"].indexOf(r[0])?void 0:r[0],lineNumber:r[1],columnNumber:r[2],source:e}},this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter(function(e){return!e.match(o)},this).map(function(e){var t,r;return-1===(e=-1<e.indexOf(" > eval")?e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1"):e).indexOf("@")&&-1===e.indexOf(":")?{functionName:e}:{functionName:(r=e.match(t=/((.*".+"[^@]*)?[^@]*)(?:@)/))&&r[1]?r[1]:void 0,fileName:(r=this.extractLocation(e.replace(t,"")))[0],lineNumber:r[1],columnNumber:r[2],source:e}},this)},parseOpera:function(e){return!e.stacktrace||-1<e.message.indexOf("\n")&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),o=[],n=2,s=r.length;n<s;n+=2){var i=t.exec(r[n]);i&&o.push({fileName:i[2],lineNumber:i[1],source:r[n]})}return o},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),o=[],n=0,s=r.length;n<s;n+=2){var i=t.exec(r[n]);i&&o.push({functionName:i[3]||void 0,fileName:i[2],lineNumber:i[1],source:r[n]})}return o},parseOpera11:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(t)&&!e.match(/^Error created at/)},this).map(function(e){var t,r=e.split("@"),o=this.extractLocation(r.pop()),r=r.shift()||"";return{functionName:r.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,args:void 0===(t=r.match(/\(([^)]*)\)/)?r.replace(/^[^(]+\(([^)]*)\)$/,"$1"):t)||"[arguments not available]"===t?void 0:t.split(","),fileName:o[0],lineNumber:o[1],columnNumber:o[2],source:e}},this)}}}e.default._getErrorStackParser=function(){return new o};e=e.default;r.default=e},{"../main":267,"core-js/modules/es.array.filter":153,"core-js/modules/es.array.index-of":157,"core-js/modules/es.array.join":159,"core-js/modules/es.array.map":161,"core-js/modules/es.array.slice":162,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.string.match":187,"core-js/modules/es.string.replace":189,"core-js/modules/es.string.split":191}],262:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.last-index-of"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.function.name"),e("core-js/modules/es.map"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.get-prototype-of"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.reflect.construct"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.set"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.last-index-of"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.function.name"),e("core-js/modules/es.map"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.object.get-prototype-of"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.reflect.construct"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.set"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(n=e("../main"))&&n.__esModule?n:{default:n};(function(e){if(e&&e.__esModule)return;if(null===e||"object"!==a(e)&&"function"!=typeof e)return;var t=i();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o)})(e("../constants")),e("../internationalization");function i(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,i=function(){return e},e)}function a(e){return(a="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}n.default._validateParameters=n.default._clearValidateParamsCache=function(){};e=n.default;r.default=e},{"../../../docs/parameterData.json":void 0,"../constants":256,"../internationalization":265,"../main":267,"core-js/modules/es.array.concat":149,"core-js/modules/es.array.for-each":154,"core-js/modules/es.array.includes":156,"core-js/modules/es.array.index-of":157,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.join":159,"core-js/modules/es.array.last-index-of":160,"core-js/modules/es.array.map":161,"core-js/modules/es.array.slice":162,"core-js/modules/es.function.name":165,"core-js/modules/es.map":166,"core-js/modules/es.number.constructor":169,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.get-prototype-of":175,"core-js/modules/es.object.keys":176,"core-js/modules/es.object.to-string":177,"core-js/modules/es.reflect.construct":179,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.set":183,"core-js/modules/es.string.includes":185,"core-js/modules/es.string.iterator":186,"core-js/modules/es.string.split":191,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.for-each":229,"core-js/modules/web.dom-collections.iterator":230}],263:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("./constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}r.default={modeAdjust:function(e,t,r,o,n){return n===s.CORNER?{x:e,y:t,w:r,h:o}:n===s.CORNERS?{x:e,y:t,w:r-e,h:o-t}:n===s.RADIUS?{x:e-r,y:t-o,w:2*r,h:2*o}:n===s.CENTER?{x:e-.5*r,y:t-.5*o,w:r,h:o}:void 0}}},{"./constants":256,"core-js/modules/es.array.iterator":158,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],264:[function(e,t,r){"use strict";e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator");var o=(n=e("../core/main"))&&n.__esModule?n:{default:n};e("./internationalization");var n=Promise.resolve();Promise.all([new Promise(function(e,t){"complete"===document.readyState?e():window.addEventListener("load",e,!1)}),n]).then(function(){void 0!==window._setupDone?console.warn("p5.js seems to have been imported multiple times. Please remove the duplicate import"):window.mocha||(window.setup&&"function"==typeof window.setup||window.draw&&"function"==typeof window.draw)&&!o.default.instance&&new o.default})},{"../core/main":267,"./internationalization":265,"core-js/modules/es.array.iterator":158,"core-js/modules/es.object.to-string":177,"core-js/modules/es.promise":178,"core-js/modules/es.string.iterator":186,"core-js/modules/web.dom-collections.iterator":230}],265:[function(e,t,r){"use strict";e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.setTranslatorLanguage=r.currentTranslatorLanguage=r.availableTranslatorLanguages=r.initialize=r.translator=void 0;var n,s,o=a(e("i18next")),i=a(e("i18next-browser-languagedetector"));function a(e){return e&&e.__esModule?e:{default:e}}function l(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}var u=function(){function r(e,t){if(!(this instanceof r))throw new TypeError("Cannot call a class as a function");this.init(e,t)}var e,t,o;return e=r,(t=[{key:"fetchWithTimeout",value:function(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:2e3;return Promise.race([fetch(e,t),new Promise(function(e,t){return setTimeout(function(){return t(new Error("timeout"))},r)})])}},{key:"init",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};this.services=e,this.options=t}},{key:"read",value:function(e,t,r){var o=this.options.loadPath;e===this.options.fallback?r(null,n[e][t]):s.includes(e)?(o=this.services.interpolator.interpolate(o,{lng:e,ns:t}),this.loadUrl(o,r)):r("Not found",!1)}},{key:"loadUrl",value:function(t,r){this.fetchWithTimeout(t).then(function(e){if(e.ok)return e.json();throw new Error("failed loading ".concat(t))},function(){throw new Error("failed loading ".concat(t))}).then(function(e){return r(null,e)}).catch(r)}}])&&l(e.prototype,t),o&&l(e,o),r}();u.type="backend",r.translator=function(e,t){console.debug("p5.js translator called before translations were loaded"),o.default.t(e,t)},r.initialize=function(){return o.default.use(i.default).use(u).init({fallbackLng:"en",nestingPrefix:"$tr(",nestingSuffix:")",defaultNS:"translation",returnEmptyString:!1,interpolation:{escapeValue:!1},detection:{checkWhitelist:!1,order:["querystring","navigator","htmlTag","path","subdomain"],caches:[]},backend:{fallback:"en",loadPath:"https://cdn.jsdelivr.net/npm/p5/translations/{{lng}}/{{ns}}.json"},partialBundledLanguages:!0,resources:n}).then(function(e){r.translator=e},function(e){return console.debug("Translations failed to load (".concat(e,")"))})},r.availableTranslatorLanguages=function(){return o.default.languages},r.currentTranslatorLanguage=function(e){return o.default.language};r.setTranslatorLanguage=function(e){return o.default.changeLanguage(e||void 0,function(e){return console.debug("Translations failed to load (".concat(e,")"))})}},{"../../translations":void 0,"../../translations/dev":void 0,"core-js/modules/es.array.includes":156,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.join":159,"core-js/modules/es.array.slice":162,"core-js/modules/es.object.keys":176,"core-js/modules/es.object.to-string":177,"core-js/modules/es.promise":178,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.string.includes":185,"core-js/modules/es.string.iterator":186,"core-js/modules/es.string.split":191,"core-js/modules/web.dom-collections.iterator":230,i18next:3,"i18next-browser-languagedetector":3}],266:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;e=(e=e("./main"))&&e.__esModule?e:{default:e};e.default.prototype.pushStyle=function(){throw new Error("pushStyle() not used, see push()")},e.default.prototype.popStyle=function(){throw new Error("popStyle() not used, see pop()")},e.default.prototype.popMatrix=function(){throw new Error("popMatrix() not used, see pop()")},e.default.prototype.pushMatrix=function(){throw new Error("pushMatrix() not used, see push()")};e=e.default;r.default=e},{"./main":267}],267:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.get-own-property-names"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.get-own-property-names"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,e("./shim");var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("./constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}function s(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}var l,u=function(){function v(e,t,r){var d=this;if(!(this instanceof v))throw new TypeError("Cannot call a class as a function");this._setupDone=!1,this._preloadDone=!1,this._pixelDensity=Math.ceil(window.devicePixelRatio)||1,this._userNode=t,this._curElement=null,this._elements=[],this._glAttributes=null,this._requestAnimId=0,this._preloadCount=0,this._isGlobal=!1,this._loop=!0,this._initializeInstanceVariables(),this._defaultCanvasSize={width:100,height:100},this._events={mousemove:null,mousedown:null,mouseup:null,dragend:null,dragover:null,click:null,dblclick:null,mouseover:null,mouseout:null,keydown:null,keyup:null,keypress:null,touchstart:null,touchmove:null,touchend:null,resize:null,blur:null},this._millisStart=-1,this._recording=!1,this._lcg_random_state=null,this._gaussian_previous=!1,this._events.wheel=null,this._loadingScreenId="p5_loading",this._registeredMethods={};var t=Object.getOwnPropertyNames(v.prototype._registeredMethods),o=!0,n=!1,s=void 0;try{for(var i,a=t[Symbol.iterator]();!(o=(i=a.next()).done);o=!0){var l=i.value;this._registeredMethods[l]=v.prototype._registeredMethods[l].slice()}}catch(e){n=!0,s=e}finally{try{o||null==a.return||a.return()}finally{if(n)throw s}}window.DeviceOrientationEvent&&(this._events.deviceorientation=null),window.DeviceMotionEvent&&!window._isNodeWebkit&&(this._events.devicemotion=null),this._start=function(){d._userNode&&"string"==typeof d._userNode&&(d._userNode=document.getElementById(d._userNode));var e=d._isGlobal?window:d;if(e.preload){var t,r=document.getElementById(d._loadingScreenId),o=(r||((r=document.createElement("div")).innerHTML="Loading...",r.style.position="absolute",r.id=d._loadingScreenId,(d._userNode||document.body).appendChild(r)),d._preloadMethods);for(t in o){o[t]=o[t]||v;var n=o[t];n!==v.prototype&&n!==v||(d._isGlobal&&(window[t]=d._wrapPreload(d,t)),n=d),d._registeredPreloadMethods[t]=n[t],n[t]=d._wrapPreload(n,t)}e.preload(),d._runIfPreloadsAreDone()}else d._setup(),d._recording||d._draw()},this._runIfPreloadsAreDone=function(){var e,t=this._isGlobal?window:this;0===t._preloadCount&&((e=document.getElementById(t._loadingScreenId))&&e.parentNode.removeChild(e),this._setupDone||(this._lastTargetFrameTime=window.performance.now(),this._lastRealFrameTime=window.performance.now(),t._setup(),this._recording||t._draw()))},this._decrementPreload=function(){var e=this._isGlobal?window:this;e._preloadDone||"function"!=typeof e.preload||(e._setProperty("_preloadCount",e._preloadCount-1),e._runIfPreloadsAreDone())},this._wrapPreload=function(o,n){var s=this;return function(){s._incrementPreload();for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return s._registeredPreloadMethods[n].apply(o,t)}},this._incrementPreload=function(){var e=this._isGlobal?window:this;e._preloadDone||e._setProperty("_preloadCount",e._preloadCount+1)},this._setup=function(){d.createCanvas(d._defaultCanvasSize.width,d._defaultCanvasSize.height,"p2d");var e=d._isGlobal?window:d;if("function"==typeof e.preload)for(var t in d._preloadMethods)e[t]=d._preloadMethods[t][t],e[t]&&d&&(e[t]=e[t].bind(d));d._millisStart=window.performance.now(),e._preloadDone=!0,"function"==typeof e.setup&&e.setup();var r=document.getElementsByTagName("canvas"),o=!0,n=!1,s=void 0;try{for(var i,a=r[Symbol.iterator]();!(o=(i=a.next()).done);o=!0){var l=i.value;"true"===l.dataset.hidden&&(l.style.visibility="",delete l.dataset.hidden)}}catch(e){n=!0,s=e}finally{try{o||null==a.return||a.return()}finally{if(n)throw s}}d._lastTargetFrameTime=window.performance.now(),d._lastRealFrameTime=window.performance.now(),d._setupDone=!0,(d._accessibleOutputs.grid||d._accessibleOutputs.text)&&d._updateAccsOutput()},this._draw=function(){var e=window.performance.now(),t=e-d._lastTargetFrameTime,r=1e3/d._targetFrameRate;(!d._loop||r-5<=t)&&(d.redraw(),d._frameRate=1e3/(e-d._lastRealFrameTime),d.deltaTime=e-d._lastRealFrameTime,d._setProperty("deltaTime",d.deltaTime),d._lastTargetFrameTime=Math.max(d._lastTargetFrameTime+r,e),d._lastRealFrameTime=e,void 0!==d._updateMouseCoords&&(d._updateMouseCoords(),d._setProperty("movedX",0),d._setProperty("movedY",0))),d._loop&&(d._requestAnimId=window.requestAnimationFrame(d._draw))},this._setProperty=function(e,t){d[e]=t,d._isGlobal&&(window[e]=t)},this.remove=function(){var t=document.getElementById(d._loadingScreenId);if(t&&(t.parentNode.removeChild(t),d._incrementPreload()),d._curElement){for(var e in d._loop=!1,d._requestAnimId&&window.cancelAnimationFrame(d._requestAnimId),d._events)window.removeEventListener(e,d._events[e]);var r=!0,t=!1,o=void 0;try{for(var n,s=d._elements[Symbol.iterator]();!(r=(n=s.next()).done);r=!0){var i,a=n.value;for(i in a.elt&&a.elt.parentNode&&a.elt.parentNode.removeChild(a.elt),a._events)a.elt.removeEventListener(i,a._events[i])}}catch(e){t=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(t)throw o}}var l=d;d._registeredMethods.remove.forEach(function(e){void 0!==e&&e.call(l)})}if(d._isGlobal){for(var u in v.prototype)try{delete window[u]}catch(e){window[u]=void 0}for(var c in d)if(d.hasOwnProperty(c))try{delete window[c]}catch(e){window[c]=void 0}v.instance=null}},this._registeredMethods.init.forEach(function(e){void 0!==e&&e.call(this)},this),this._setupPromisePreloads();var u,c,f=this._createFriendlyGlobalFunctionBinder();if(e)e(this),v._checkForUserDefinedFunctions(this);else{for(var h in this._isGlobal=!0,v.instance=this,v.prototype)"function"==typeof v.prototype[h]?(u=h.substring(2),this._events.hasOwnProperty(u)||(Math.hasOwnProperty(h)&&Math[h]===v.prototype[h]?f(h,v.prototype[h]):f(h,v.prototype[h].bind(this)))):f(h,v.prototype[h]);for(var p in this)this.hasOwnProperty(p)&&f(p,this[p])}for(c in this._events){var m=this["_on".concat(c)];m&&(m=m.bind(this),window.addEventListener(c,m,{passive:!1}),this._events[c]=m)}function y(){d._setProperty("focused",!0)}function g(){d._setProperty("focused",!1)}window.addEventListener("focus",y),window.addEventListener("blur",g),this.registerMethod("remove",function(){window.removeEventListener("focus",y),window.removeEventListener("blur",g)}),"complete"===document.readyState?this._start():window.addEventListener("load",this._start.bind(this),!1)}var e,t,r;return e=v,(t=[{key:"_initializeInstanceVariables",value:function(){this._accessibleOutputs={text:!1,grid:!1,textLabel:!1,gridLabel:!1},this._styles=[],this._bezierDetail=20,this._curveDetail=20,this._colorMode=n.RGB,this._colorMaxes={rgb:[255,255,255,255],hsb:[360,100,100,1],hsl:[360,100,100,1]},this._downKeys={}}},{key:"registerPreloadMethod",value:function(e,t){v.prototype._preloadMethods.hasOwnProperty(e)||(v.prototype._preloadMethods[e]=t)}},{key:"registerMethod",value:function(e,t){var r=this||v.prototype;r._registeredMethods.hasOwnProperty(e)||(r._registeredMethods[e]=[]),r._registeredMethods[e].push(t)}},{key:"_createFriendlyGlobalFunctionBinder",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},r=e.globalObject||window;e.log||console.log.bind(console);return function(e,t){v.disableFriendlyErrors,r[e]=t}}}])&&s(e.prototype,t),r&&s(e,r),v}();for(l in u.instance=null,u.disableFriendlyErrors=!1,n)u.prototype[l]=n[l];u.VERSION=n.VERSION,u.prototype._preloadMethods={loadJSON:u.prototype,loadImage:u.prototype,loadStrings:u.prototype,loadXML:u.prototype,loadBytes:u.prototype,loadTable:u.prototype,loadFont:u.prototype,loadModel:u.prototype,loadShader:u.prototype},u.prototype._registeredMethods={init:[],pre:[],post:[],remove:[]},u.prototype._registeredPreloadMethods={},r.default=u},{"./constants":256,"./shim":278,"core-js/modules/es.array.for-each":154,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.slice":162,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.get-own-property-names":174,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.for-each":229,"core-js/modules/web.dom-collections.iterator":230}],268:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(e=e("./main"))&&e.__esModule?e:{default:e};o.default.Element=function(e,t){this.elt=e,this._pInst=this._pixelsState=t,this._events={},this.width=this.elt.offsetWidth,this.height=this.elt.offsetHeight},o.default.Element.prototype.parent=function(e){return void 0===e?this.elt.parentNode:("string"==typeof e?("#"===e[0]&&(e=e.substring(1)),e=document.getElementById(e)):e instanceof o.default.Element&&(e=e.elt),e.appendChild(this.elt),this)},o.default.Element.prototype.id=function(e){return void 0===e?this.elt.id:(this.elt.id=e,this.width=this.elt.offsetWidth,this.height=this.elt.offsetHeight,this)},o.default.Element.prototype.class=function(e){return void 0===e?this.elt.className:(this.elt.className=e,this)},o.default.Element.prototype.mousePressed=function(t){return o.default.Element._adjustListener("mousedown",function(e){return this._pInst._setProperty("mouseIsPressed",!0),this._pInst._setMouseButton(e),t.call(this,e)},this),this},o.default.Element.prototype.doubleClicked=function(e){return o.default.Element._adjustListener("dblclick",e,this),this},o.default.Element.prototype.mouseWheel=function(e){return o.default.Element._adjustListener("wheel",e,this),this},o.default.Element.prototype.mouseReleased=function(e){return o.default.Element._adjustListener("mouseup",e,this),this},o.default.Element.prototype.mouseClicked=function(e){return o.default.Element._adjustListener("click",e,this),this},o.default.Element.prototype.mouseMoved=function(e){return o.default.Element._adjustListener("mousemove",e,this),this},o.default.Element.prototype.mouseOver=function(e){return o.default.Element._adjustListener("mouseover",e,this),this},o.default.Element.prototype.mouseOut=function(e){return o.default.Element._adjustListener("mouseout",e,this),this},o.default.Element.prototype.touchStarted=function(e){return o.default.Element._adjustListener("touchstart",e,this),this},o.default.Element.prototype.touchMoved=function(e){return o.default.Element._adjustListener("touchmove",e,this),this},o.default.Element.prototype.touchEnded=function(e){return o.default.Element._adjustListener("touchend",e,this),this},o.default.Element.prototype.dragOver=function(e){return o.default.Element._adjustListener("dragover",e,this),this},o.default.Element.prototype.dragLeave=function(e){return o.default.Element._adjustListener("dragleave",e,this),this},o.default.Element._adjustListener=function(e,t,r){return!1===t?o.default.Element._detachListener(e,r):o.default.Element._attachListener(e,t,r),this},o.default.Element._attachListener=function(e,t,r){r._events[e]&&o.default.Element._detachListener(e,r);t=t.bind(r);r.elt.addEventListener(e,t,!1),r._events[e]=t},o.default.Element._detachListener=function(e,t){var r=t._events[e];t.elt.removeEventListener(e,r,!1),t._events[e]=null},o.default.Element.prototype._setProperty=function(e,t){this[e]=t};e=o.default.Element;r.default=e},{"./main":267}],269:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.splice"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.splice"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var s=(n=e("./main"))&&n.__esModule?n:{default:n},a=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("./constants"));function l(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,l=function(){return e},e)}s.default.Graphics=function(e,t,r,o){var n,r=r||a.P2D;for(n in this.canvas=document.createElement("canvas"),(o._userNode||document.body).appendChild(this.canvas),s.default.Element.call(this,this.canvas,o),s.default.prototype)this[n]||("function"==typeof s.default.prototype[n]?this[n]=s.default.prototype[n].bind(this):this[n]=s.default.prototype[n]);return s.default.prototype._initializeInstanceVariables.apply(this),this.width=e,this.height=t,this._pixelDensity=o._pixelDensity,r===a.WEBGL?this._renderer=new s.default.RendererGL(this.canvas,this,!1):this._renderer=new s.default.Renderer2D(this.canvas,this,!1),o._elements.push(this),Object.defineProperty(this,"deltaTime",{get:function(){return this._pInst.deltaTime}}),this._renderer.resize(e,t),this._renderer._applyDefaults(),this},s.default.Graphics.prototype=Object.create(s.default.Element.prototype),s.default.Graphics.prototype.reset=function(){this._renderer.resetMatrix(),this._renderer.isP3D&&this._renderer._update()},s.default.Graphics.prototype.remove=function(){this.elt.parentNode&&this.elt.parentNode.removeChild(this.elt);var e,t=this._pInst._elements.indexOf(this);for(e in-1!==t&&this._pInst._elements.splice(t,1),this._events)this.elt.removeEventListener(e,this._events[e])};var n=s.default.Graphics;r.default=n},{"./constants":256,"./main":267,"core-js/modules/es.array.index-of":157,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.splice":164,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],270:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.trim"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.trim"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var a=(n=e("./main"))&&n.__esModule?n:{default:n},L=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==l(e)&&"function"!=typeof e)return{default:e};var t=i();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants"));function i(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,i=function(){return e},e)}function l(e){return(l="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}function u(e){var t=0,r=0;if(e.offsetParent)for(;t+=e.offsetLeft,r+=e.offsetTop,e=e.offsetParent;);else t+=e.offsetLeft,r+=e.offsetTop;return[t,r]}a.default.Renderer=function(e,t,r){a.default.Element.call(this,e,t),this.canvas=e,this._pixelsState=t,r?(this._isMainCanvas=!0,this._pInst._setProperty("_curElement",this),this._pInst._setProperty("canvas",this.canvas),this._pInst._setProperty("width",this.width),this._pInst._setProperty("height",this.height)):(this.canvas.style.display="none",this._styles=[]),this._textSize=12,this._textLeading=15,this._textFont="sans-serif",this._textStyle=L.NORMAL,this._textAscent=null,this._textDescent=null,this._textAlign=L.LEFT,this._textBaseline=L.BASELINE,this._textWrap=L.WORD,this._rectMode=L.CORNER,this._ellipseMode=L.CENTER,this._curveTightness=0,this._imageMode=L.CORNER,this._tint=null,this._doStroke=!0,this._doFill=!0,this._strokeSet=!1,this._fillSet=!1,this._leadingSet=!1},a.default.Renderer.prototype=Object.create(a.default.Element.prototype),a.default.Renderer.prototype.push=function(){return{properties:{_doStroke:this._doStroke,_strokeSet:this._strokeSet,_doFill:this._doFill,_fillSet:this._fillSet,_tint:this._tint,_imageMode:this._imageMode,_rectMode:this._rectMode,_ellipseMode:this._ellipseMode,_textFont:this._textFont,_textLeading:this._textLeading,_leadingSet:this._leadingSet,_textSize:this._textSize,_textAlign:this._textAlign,_textBaseline:this._textBaseline,_textStyle:this._textStyle,_textWrap:this._textWrap}}},a.default.Renderer.prototype.pop=function(e){e.properties&&Object.assign(this,e.properties)},a.default.Renderer.prototype.resize=function(e,t){this.width=e,this.height=t,this.elt.width=e*this._pInst._pixelDensity,this.elt.height=t*this._pInst._pixelDensity,this.elt.style.width="".concat(e,"px"),this.elt.style.height="".concat(t,"px"),this._isMainCanvas&&(this._pInst._setProperty("width",this.width),this._pInst._setProperty("height",this.height))},a.default.Renderer.prototype.get=function(e,t,r,o){var n=this._pixelsState,s=n._pixelDensity,i=this.canvas;if(void 0===e&&void 0===t)e=t=0,r=n.width,o=n.height;else if(e*=s,t*=s,void 0===r&&void 0===o)return e<0||t<0||e>=i.width||t>=i.height?[0,0,0,0]:this._getPixel(e,t);n=new a.default.Image(r,o);return n.canvas.getContext("2d").drawImage(i,e,t,r*s,o*s,0,0,r,o),n},a.default.Renderer.prototype.textLeading=function(e){return"number"==typeof e?(this._setProperty("_leadingSet",!0),this._setProperty("_textLeading",e),this._pInst):this._textLeading},a.default.Renderer.prototype.textSize=function(e){return"number"==typeof e?(this._setProperty("_textSize",e),this._leadingSet||this._setProperty("_textLeading",e*L._DEFAULT_LEADMULT),this._applyTextProperties()):this._textSize},a.default.Renderer.prototype.textStyle=function(e){return e?(e!==L.NORMAL&&e!==L.ITALIC&&e!==L.BOLD&&e!==L.BOLDITALIC||this._setProperty("_textStyle",e),this._applyTextProperties()):this._textStyle},a.default.Renderer.prototype.textAscent=function(){return null===this._textAscent&&this._updateTextMetrics(),this._textAscent},a.default.Renderer.prototype.textDescent=function(){return null===this._textDescent&&this._updateTextMetrics(),this._textDescent},a.default.Renderer.prototype.textAlign=function(e,t){return void 0!==e?(this._setProperty("_textAlign",e),void 0!==t&&this._setProperty("_textBaseline",t),this._applyTextProperties()):{horizontal:this._textAlign,vertical:this._textBaseline}},a.default.Renderer.prototype.textWrap=function(e){return this._setProperty("_textWrap",e),this._textWrap},a.default.Renderer.prototype.text=function(e,t,r,o,n){var s,i,a,l,u=this._pInst,c=this._textWrap,d=Number.MAX_VALUE,f=r;if((this._doFill||this._doStroke)&&void 0!==e){if(s=(e=(e="string"!=typeof e?e.toString():e).replace(/(\t)/g," ")).split("\n"),void 0!==o){switch(this._rectMode===L.CENTER&&(t-=o/2),this._textAlign){case L.CENTER:t+=o/2;break;case L.RIGHT:t+=o}if(void 0!==n){this._rectMode===L.CENTER&&(r-=n/2,f-=n/2);var e=r,h=u.textAscent();switch(this._textBaseline){case L.BOTTOM:l=r+n,r=Math.max(l,r),f+=h;break;case L.CENTER:l=r+n/2,r=Math.max(l,r),f+=h/2}d=r+n-h,this._textBaseline===L.CENTER&&(d=e+n-h/2)}else{if(this._textBaseline===L.BOTTOM)return console.warn("textAlign(*, BOTTOM) requires x, y, width and height");if(this._textBaseline===L.CENTER)return console.warn("textAlign(*, CENTER) requires x, y, width and height")}if(c===L.WORD){for(var p=[],m=0;m<s.length;m++){for(var y="",g=s[m].split(" "),v=0;v<g.length;v++)i="".concat(y+g[v])+" ",y=o<(a=this.textWidth(i))&&0<y.length?(p.push(y),"".concat(g[v])+" "):i;p.push(y)}var b=0;this._textBaseline===L.CENTER?b=(p.length-1)*u.textLeading()/2:this._textBaseline===L.BOTTOM&&(b=(p.length-1)*u.textLeading());for(var j=0;j<s.length;j++){y="",g=s[j].split(" ");for(var _=0;_<g.length;_++)i="".concat(y+g[_])+" ",o<(a=this.textWidth(i))&&0<y.length?(this._renderText(u,y.trim(),t,r-b,d,f),y="".concat(g[_])+" ",r+=u.textLeading()):y=i;this._renderText(u,y.trim(),t,r-b,d,f),r+=u.textLeading()}}else{for(var x=[],w=0;w<s.length;w++)for(var S=s[w].split(y=""),M=0;M<S.length;M++)i="".concat(y+S[M]),(a=this.textWidth(i))<=o?y+=S[M]:o<a&&0<y.length&&(x.push(y),y="".concat(S[M]));x.push(y);var E=0;this._textBaseline===L.CENTER?E=(x.length-1)*u.textLeading()/2:this._textBaseline===L.BOTTOM&&(E=(x.length-1)*u.textLeading());for(var T=0;T<s.length;T++){S=s[T].split(y="");for(var C=0;C<S.length;C++)i="".concat(y+S[C]),(a=this.textWidth(i))<=o?y+=S[C]:o<a&&0<y.length&&(this._renderText(u,y.trim(),t,r-E,d,f),r+=u.textLeading(),y="".concat(S[C]))}this._renderText(u,y.trim(),t,r-E,d,f),r+=u.textLeading()}}else{var O=0;this._textBaseline===L.CENTER?O=(s.length-1)*u.textLeading()/2:this._textBaseline===L.BOTTOM&&(O=(s.length-1)*u.textLeading());for(var k=0;k<s.length;k++)this._renderText(u,s[k],t,r-O,d,f-O),r+=u.textLeading()}return u}},a.default.Renderer.prototype._applyDefaults=function(){return this},a.default.Renderer.prototype._isOpenType=function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this._textFont;return"object"===l(e)&&e.font&&e.font.supported},a.default.Renderer.prototype._updateTextMetrics=function(){var e,t,r,o,n,s;return this._isOpenType()?(this._setProperty("_textAscent",this._textFont._textAscent()),this._setProperty("_textDescent",this._textFont._textDescent())):((e=document.createElement("span")).style.fontFamily=this._textFont,e.style.fontSize="".concat(this._textSize,"px"),e.innerHTML="ABCjgq|",(s=document.createElement("div")).style.display="inline-block",s.style.width="1px",s.style.height="0px",o=((t=document.createElement("div")).appendChild(e),t.appendChild(s),t.style.height="0px",t.style.overflow="hidden",document.body.appendChild(t),s.style.verticalAlign="baseline",u(s)),n=u(e),r=o[1]-n[1],o=(s.style.verticalAlign="bottom",u(s)),n=u(e),s=o[1]-n[1]-r,document.body.removeChild(t),this._setProperty("_textAscent",r),this._setProperty("_textDescent",s)),this};var n=a.default.Renderer;r.default=n},{"../core/constants":256,"./main":267,"core-js/modules/es.array.iterator":158,"core-js/modules/es.number.constructor":169,"core-js/modules/es.object.assign":172,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.string.iterator":186,"core-js/modules/es.string.replace":189,"core-js/modules/es.string.split":191,"core-js/modules/es.string.trim":193,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],271:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.function.name"),e("core-js/modules/es.number.to-fixed"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.function.name"),e("core-js/modules/es.number.to-fixed"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var d=(n=e("./main"))&&n.__esModule?n:{default:n},p=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("./constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}e("./p5.Renderer");var h="rgba(0,0,0,0)",n=(d.default.Renderer2D=function(e,t,r){return d.default.Renderer.call(this,e,t,r),this.drawingContext=this.canvas.getContext("2d"),this._pInst._setProperty("drawingContext",this.drawingContext),this},d.default.Renderer2D.prototype=Object.create(d.default.Renderer.prototype),d.default.Renderer2D.prototype._applyDefaults=function(){this._cachedFillStyle=this._cachedStrokeStyle=void 0,this._cachedBlendMode=p.BLEND,this._setFill(p._DEFAULT_FILL),this._setStroke(p._DEFAULT_STROKE),this.drawingContext.lineCap=p.ROUND,this.drawingContext.font="normal 12px sans-serif"},d.default.Renderer2D.prototype.resize=function(e,t){d.default.Renderer.prototype.resize.call(this,e,t),this.drawingContext.scale(this._pInst._pixelDensity,this._pInst._pixelDensity)},d.default.Renderer2D.prototype.background=function(){var e,t;this.drawingContext.save(),this.resetMatrix(),(arguments.length<=0?void 0:arguments[0])instanceof d.default.Image?0<=(arguments.length<=1?void 0:arguments[1])?(e=arguments.length<=0?void 0:arguments[0],this.drawingContext.globalAlpha=(arguments.length<=1?void 0:arguments[1])/255,this._pInst.image(e,0,0,this.width,this.height)):this._pInst.image(arguments.length<=0?void 0:arguments[0],0,0,this.width,this.height):(e=this._getFill(),t=(t=this._pInst).color.apply(t,arguments),this._pInst._addAccsOutput()&&this._pInst._accsBackground(t.levels),t=t.toString(),this._setFill(t),this._isErasing&&this.blendMode(this._cachedBlendMode),this.drawingContext.fillRect(0,0,this.width,this.height),this._setFill(e),this._isErasing&&this._pInst.erase()),this.drawingContext.restore()},d.default.Renderer2D.prototype.clear=function(){this.drawingContext.save(),this.resetMatrix(),this.drawingContext.clearRect(0,0,this.width,this.height),this.drawingContext.restore()},d.default.Renderer2D.prototype.fill=function(){var e=(e=this._pInst).color.apply(e,arguments);this._setFill(e.toString()),this._pInst._addAccsOutput()&&this._pInst._accsCanvasColors("fill",e.levels)},d.default.Renderer2D.prototype.stroke=function(){var e=(e=this._pInst).color.apply(e,arguments);this._setStroke(e.toString()),this._pInst._addAccsOutput()&&this._pInst._accsCanvasColors("stroke",e.levels)},d.default.Renderer2D.prototype.erase=function(e,t){this._isErasing||(this._cachedFillStyle=this.drawingContext.fillStyle,e=this._pInst.color(255,e).toString(),this.drawingContext.fillStyle=e,this._cachedStrokeStyle=this.drawingContext.strokeStyle,e=this._pInst.color(255,t).toString(),this.drawingContext.strokeStyle=e,t=this._cachedBlendMode,this.blendMode(p.REMOVE),this._cachedBlendMode=t,this._isErasing=!0)},d.default.Renderer2D.prototype.noErase=function(){this._isErasing&&(this.drawingContext.fillStyle=this._cachedFillStyle,this.drawingContext.strokeStyle=this._cachedStrokeStyle,this.blendMode(this._cachedBlendMode),this._isErasing=!1)},d.default.Renderer2D.prototype.image=function(e,t,r,o,n,s,i,a,l){e.gifProperties&&e._animateGif(this._pInst);try{d.default.MediaElement&&e instanceof d.default.MediaElement&&e._ensureCanvas();var u=(u=this._tint&&e.canvas?this._getTintedImageCanvas(e):u)||e.canvas||e.elt,c=1;e.width&&0<e.width&&(c=u.width/e.width),this._isErasing&&this.blendMode(this._cachedBlendMode),this.drawingContext.drawImage(u,c*t,c*r,c*o,c*n,s,i,a,l),this._isErasing&&this._pInst.erase()}catch(e){if("NS_ERROR_NOT_AVAILABLE"!==e.name)throw e}},d.default.Renderer2D.prototype._getTintedImageCanvas=function(e){if(!e.canvas)return e;e.tintCanvas||(e.tintCanvas=document.createElement("canvas")),e.tintCanvas.width!==e.canvas.width&&(e.tintCanvas.width=e.canvas.width),e.tintCanvas.height!==e.canvas.height&&(e.tintCanvas.height=e.canvas.height);var t=e.tintCanvas.getContext("2d");return t.save(),t.clearRect(0,0,e.canvas.width,e.canvas.height),(this._tint[0]<255||this._tint[1]<255||this._tint[2]<255)&&(t.drawImage(e.canvas,0,0),t.globalCompositeOperation="luminosity",t.drawImage(e.canvas,0,0),t.globalCompositeOperation="color",t.drawImage(e.canvas,0,0),t.globalCompositeOperation="multiply",t.fillStyle="rgb(".concat(this._tint.slice(0,3).join(", "),")"),t.fillRect(0,0,e.canvas.width,e.canvas.height),t.globalCompositeOperation="destination-in"),t.globalAlpha=this._tint[3]/255,t.drawImage(e.canvas,0,0),t.restore(),e.tintCanvas},d.default.Renderer2D.prototype.blendMode=function(e){if(e===p.SUBTRACT)console.warn("blendMode(SUBTRACT) only works in WEBGL mode.");else{if(e!==p.BLEND&&e!==p.REMOVE&&e!==p.DARKEST&&e!==p.LIGHTEST&&e!==p.DIFFERENCE&&e!==p.MULTIPLY&&e!==p.EXCLUSION&&e!==p.SCREEN&&e!==p.REPLACE&&e!==p.OVERLAY&&e!==p.HARD_LIGHT&&e!==p.SOFT_LIGHT&&e!==p.DODGE&&e!==p.BURN&&e!==p.ADD)throw new Error("Mode ".concat(e," not recognized."));this._cachedBlendMode=e,this.drawingContext.globalCompositeOperation=e}},d.default.Renderer2D.prototype.blend=function(){for(var e=this.drawingContext.globalCompositeOperation,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];var n=r[r.length-1],s=Array.prototype.slice.call(r,0,r.length-1);this.drawingContext.globalCompositeOperation=n,d.default.prototype.copy.apply(this,s),this.drawingContext.globalCompositeOperation=e},d.default.Renderer2D.prototype._getPixel=function(e,t){e=this.drawingContext.getImageData(e,t,1,1).data;return[e[0],e[1],e[2],e[3]]},d.default.Renderer2D.prototype.loadPixels=function(){var e=this._pixelsState,t=e._pixelDensity,r=this.width*t,t=this.height*t,r=this.drawingContext.getImageData(0,0,r,t);e._setProperty("imageData",r),e._setProperty("pixels",r.data)},d.default.Renderer2D.prototype.set=function(e,t,r){e=Math.floor(e),t=Math.floor(t);var o=this._pixelsState;if(r instanceof d.default.Image)this.drawingContext.save(),this.drawingContext.setTransform(1,0,0,1,0,0),this.drawingContext.scale(o._pixelDensity,o._pixelDensity),this.drawingContext.clearRect(e,t,r.width,r.height),this.drawingContext.drawImage(r.canvas,e,t),this.drawingContext.restore();else{var n=0,s=0,i=0,a=0,l=4*(t*o._pixelDensity*(this.width*o._pixelDensity)+e*o._pixelDensity);if(o.imageData||o.loadPixels.call(o),"number"==typeof r)l<o.pixels.length&&(i=s=n=r,a=255);else if(r instanceof Array){if(r.length<4)throw new Error("pixel array must be of the form [R, G, B, A]");l<o.pixels.length&&(n=r[0],s=r[1],i=r[2],a=r[3])}else r instanceof d.default.Color&&l<o.pixels.length&&(n=r.levels[0],s=r.levels[1],i=r.levels[2],a=r.levels[3]);for(var u=0;u<o._pixelDensity;u++)for(var c=0;c<o._pixelDensity;c++)l=4*((t*o._pixelDensity+c)*this.width*o._pixelDensity+(e*o._pixelDensity+u)),o.pixels[l]=n,o.pixels[l+1]=s,o.pixels[l+2]=i,o.pixels[l+3]=a}},d.default.Renderer2D.prototype.updatePixels=function(e,t,r,o){var n=this._pixelsState,s=n._pixelDensity;void 0===e&&void 0===t&&void 0===r&&void 0===o&&(t=e=0,r=this.width,o=this.height),e*=s,t*=s,r*=s,o*=s,this.gifProperties&&(this.gifProperties.frames[this.gifProperties.displayIndex].image=n.imageData),this.drawingContext.putImageData(n.imageData,e,t,0,0,r,o)},d.default.Renderer2D.prototype._acuteArcToBezier=function(e,t){var r=t/2,o=Math.cos(r),n=Math.sin(r),s=1/Math.tan(r),r=e+r,i=Math.cos(r),r=Math.sin(r),a=(4-o)/3,n=n+(o-a)*s;return{ax:Math.cos(e).toFixed(7),ay:Math.sin(e).toFixed(7),bx:(a*i+n*r).toFixed(7),by:(a*r-n*i).toFixed(7),cx:(a*i-n*r).toFixed(7),cy:(a*r+n*i).toFixed(7),dx:Math.cos(e+t).toFixed(7),dy:Math.sin(e+t).toFixed(7)}},d.default.Renderer2D.prototype.arc=function(r,o,e,t,n,s,i){var a,l=this.drawingContext,u=e/2,c=t/2,d=[];for(r+=u,o+=c;1e-5<=s-n;)a=Math.min(s-n,p.HALF_PI),d.push(this._acuteArcToBezier(n,a)),n+=a;return this._doFill&&(l.beginPath(),d.forEach(function(e,t){0===t&&l.moveTo(r+e.ax*u,o+e.ay*c),l.bezierCurveTo(r+e.bx*u,o+e.by*c,r+e.cx*u,o+e.cy*c,r+e.dx*u,o+e.dy*c)}),i!==p.PIE&&null!=i||l.lineTo(r,o),l.closePath(),l.fill()),this._doStroke&&(l.beginPath(),d.forEach(function(e,t){0===t&&l.moveTo(r+e.ax*u,o+e.ay*c),l.bezierCurveTo(r+e.bx*u,o+e.by*c,r+e.cx*u,o+e.cy*c,r+e.dx*u,o+e.dy*c)}),i===p.PIE?(l.lineTo(r,o),l.closePath()):i===p.CHORD&&l.closePath(),l.stroke()),this},d.default.Renderer2D.prototype.ellipse=function(e){var t=this.drawingContext,r=this._doFill,o=this._doStroke,n=parseFloat(e[0]),s=parseFloat(e[1]),i=parseFloat(e[2]),e=parseFloat(e[3]);if(r&&!o){if(this._getFill()===h)return this}else if(!r&&o&&this._getStroke()===h)return this;var a=i/2*.5522847498,l=e/2*.5522847498,u=n+i,c=s+e,i=n+i/2,e=s+e/2;t.beginPath(),t.moveTo(n,e),t.bezierCurveTo(n,e-l,i-a,s,i,s),t.bezierCurveTo(i+a,s,u,e-l,u,e),t.bezierCurveTo(u,e+l,i+a,c,i,c),t.bezierCurveTo(i-a,c,n,e+l,n,e),r&&t.fill(),o&&t.stroke()},d.default.Renderer2D.prototype.line=function(e,t,r,o){var n=this.drawingContext;return this._doStroke&&this._getStroke()!==h&&(n.beginPath(),n.moveTo(e,t),n.lineTo(r,o),n.stroke()),this},d.default.Renderer2D.prototype.point=function(e,t){var r,o,n=this.drawingContext;return!this._doStroke||this._getStroke()===h?this:(r=this._getStroke(),o=this._getFill(),this._setFill(r),n.beginPath(),n.arc(e,t,n.lineWidth/2,0,p.TWO_PI,!1),n.fill(),void this._setFill(o))},d.default.Renderer2D.prototype.quad=function(e,t,r,o,n,s,i,a){var l=this.drawingContext,u=this._doFill,c=this._doStroke;if(u&&!c){if(this._getFill()===h)return this}else if(!u&&c&&this._getStroke()===h)return this;return l.beginPath(),l.moveTo(e,t),l.lineTo(r,o),l.lineTo(n,s),l.lineTo(i,a),l.closePath(),u&&l.fill(),c&&l.stroke(),this},d.default.Renderer2D.prototype.rect=function(e){var t,r,o=e[0],n=e[1],s=e[2],i=e[3],a=e[4],l=e[5],u=e[6],e=e[7],c=this.drawingContext,d=this._doFill,f=this._doStroke;if(d&&!f){if(this._getFill()===h)return this}else if(!d&&f&&this._getStroke()===h)return this;return c.beginPath(),void 0===a?c.rect(o,n,s,i):(void 0===l&&(l=a),void 0===u&&(u=l),void 0===e&&(e=u),f=(d=Math.abs(s))/2,r=(t=Math.abs(i))/2,t<2*(a=d<2*a?f:a)&&(a=r),t<2*(l=d<2*l?f:l)&&(l=r),t<2*(u=d<2*u?f:u)&&(u=r),t<2*(e=d<2*e?f:e)&&(e=r),c.beginPath(),c.moveTo(o+a,n),c.arcTo(o+s,n,o+s,n+i,l),c.arcTo(o+s,n+i,o,n+i,u),c.arcTo(o,n+i,o,n,e),c.arcTo(o,n,o+s,n,a),c.closePath()),this._doFill&&c.fill(),this._doStroke&&c.stroke(),this},d.default.Renderer2D.prototype.triangle=function(e){var t=this.drawingContext,r=this._doFill,o=this._doStroke,n=e[0],s=e[1],i=e[2],a=e[3],l=e[4],e=e[5];if(r&&!o){if(this._getFill()===h)return this}else if(!r&&o&&this._getStroke()===h)return this;t.beginPath(),t.moveTo(n,s),t.lineTo(i,a),t.lineTo(l,e),t.closePath(),r&&t.fill(),o&&t.stroke()},d.default.Renderer2D.prototype.endShape=function(e,t,r,o,n,s,i){if(0!==t.length&&(this._doStroke||this._doFill)){var a,l,u,c=e===p.CLOSE,d=(c&&!s&&t.push(t[0]),t.length);if(!r||i!==p.POLYGON&&null!==i)if(!o||i!==p.POLYGON&&null!==i)if(!n||i!==p.POLYGON&&null!==i)if(i===p.POINTS)for(l=0;l<d;l++)a=t[l],this._doStroke&&this._pInst.stroke(a[6]),this._pInst.point(a[0],a[1]);else if(i===p.LINES)for(l=0;l+1<d;l+=2)a=t[l],this._doStroke&&this._pInst.stroke(t[l+1][6]),this._pInst.line(a[0],a[1],t[l+1][0],t[l+1][1]);else if(i===p.TRIANGLES)for(l=0;l+2<d;l+=3)a=t[l],this.drawingContext.beginPath(),this.drawingContext.moveTo(a[0],a[1]),this.drawingContext.lineTo(t[l+1][0],t[l+1][1]),this.drawingContext.lineTo(t[l+2][0],t[l+2][1]),this.drawingContext.closePath(),this._doFill&&(this._pInst.fill(t[l+2][5]),this.drawingContext.fill()),this._doStroke&&(this._pInst.stroke(t[l+2][6]),this.drawingContext.stroke());else if(i===p.TRIANGLE_STRIP)for(l=0;l+1<d;l++)a=t[l],this.drawingContext.beginPath(),this.drawingContext.moveTo(t[l+1][0],t[l+1][1]),this.drawingContext.lineTo(a[0],a[1]),this._doStroke&&this._pInst.stroke(t[l+1][6]),this._doFill&&this._pInst.fill(t[l+1][5]),l+2<d&&(this.drawingContext.lineTo(t[l+2][0],t[l+2][1]),this._doStroke&&this._pInst.stroke(t[l+2][6]),this._doFill&&this._pInst.fill(t[l+2][5])),this._doFillStrokeClose(c);else if(i===p.TRIANGLE_FAN){if(2<d){for(this.drawingContext.beginPath(),l=2;l<d;l++)a=t[l],this.drawingContext.moveTo(t[0][0],t[0][1]),this.drawingContext.lineTo(t[l-1][0],t[l-1][1]),this.drawingContext.lineTo(a[0],a[1]),this.drawingContext.lineTo(t[0][0],t[0][1]),l<d-1&&(this._doFill&&a[5]!==t[l+1][5]||this._doStroke&&a[6]!==t[l+1][6])&&(this._doFill&&(this._pInst.fill(a[5]),this.drawingContext.fill(),this._pInst.fill(t[l+1][5])),this._doStroke&&(this._pInst.stroke(a[6]),this.drawingContext.stroke(),this._pInst.stroke(t[l+1][6])),this.drawingContext.closePath(),this.drawingContext.beginPath());this._doFillStrokeClose(c)}}else if(i===p.QUADS)for(l=0;l+3<d;l+=4){for(a=t[l],this.drawingContext.beginPath(),this.drawingContext.moveTo(a[0],a[1]),u=1;u<4;u++)this.drawingContext.lineTo(t[l+u][0],t[l+u][1]);this.drawingContext.lineTo(a[0],a[1]),this._doFill&&this._pInst.fill(t[l+3][5]),this._doStroke&&this._pInst.stroke(t[l+3][6]),this._doFillStrokeClose(c)}else if(i===p.QUAD_STRIP){if(3<d)for(l=0;l+1<d;l+=2)a=t[l],this.drawingContext.beginPath(),l+3<d?(this.drawingContext.moveTo(t[l+2][0],t[l+2][1]),this.drawingContext.lineTo(a[0],a[1]),this.drawingContext.lineTo(t[l+1][0],t[l+1][1]),this.drawingContext.lineTo(t[l+3][0],t[l+3][1]),this._doFill&&this._pInst.fill(t[l+3][5]),this._doStroke&&this._pInst.stroke(t[l+3][6])):(this.drawingContext.moveTo(a[0],a[1]),this.drawingContext.lineTo(t[l+1][0],t[l+1][1])),this._doFillStrokeClose(c)}else{for(this.drawingContext.beginPath(),this.drawingContext.moveTo(t[0][0],t[0][1]),l=1;l<d;l++)(a=t[l]).isVert&&(a.moveTo?this.drawingContext.moveTo(a[0],a[1]):this.drawingContext.lineTo(a[0],a[1]));this._doFillStrokeClose(c)}else{for(this.drawingContext.beginPath(),l=0;l<d;l++)t[l].isVert?t[l].moveTo?this.drawingContext.moveTo(t[l][0],t[l][1]):this.drawingContext.lineTo(t[l][0],t[l][1]):this.drawingContext.quadraticCurveTo(t[l][0],t[l][1],t[l][2],t[l][3]);this._doFillStrokeClose(c)}else{for(this.drawingContext.beginPath(),l=0;l<d;l++)t[l].isVert?t[l].moveTo?this.drawingContext.moveTo(t[l][0],t[l][1]):this.drawingContext.lineTo(t[l][0],t[l][1]):this.drawingContext.bezierCurveTo(t[l][0],t[l][1],t[l][2],t[l][3],t[l][4],t[l][5]);this._doFillStrokeClose(c)}else if(3<d){var f=[],h=1-this._curveTightness;for(this.drawingContext.beginPath(),this.drawingContext.moveTo(t[1][0],t[1][1]),l=1;l+2<d;l++)a=t[l],f[0]=[a[0],a[1]],f[1]=[a[0]+(h*t[l+1][0]-h*t[l-1][0])/6,a[1]+(h*t[l+1][1]-h*t[l-1][1])/6],f[2]=[t[l+1][0]+(h*t[l][0]-h*t[l+2][0])/6,t[l+1][1]+(h*t[l][1]-h*t[l+2][1])/6],f[3]=[t[l+1][0],t[l+1][1]],this.drawingContext.bezierCurveTo(f[1][0],f[1][1],f[2][0],f[2][1],f[3][0],f[3][1]);c&&this.drawingContext.lineTo(t[l+1][0],t[l+1][1]),this._doFillStrokeClose(c)}s=n=o=r=!1,c&&t.pop()}return this},d.default.Renderer2D.prototype.strokeCap=function(e){return e!==p.ROUND&&e!==p.SQUARE&&e!==p.PROJECT||(this.drawingContext.lineCap=e),this},d.default.Renderer2D.prototype.strokeJoin=function(e){return e!==p.ROUND&&e!==p.BEVEL&&e!==p.MITER||(this.drawingContext.lineJoin=e),this},d.default.Renderer2D.prototype.strokeWeight=function(e){return this.drawingContext.lineWidth=void 0===e||0===e?1e-4:e,this},d.default.Renderer2D.prototype._getFill=function(){return this._cachedFillStyle||(this._cachedFillStyle=this.drawingContext.fillStyle),this._cachedFillStyle},d.default.Renderer2D.prototype._setFill=function(e){e!==this._cachedFillStyle&&(this.drawingContext.fillStyle=e,this._cachedFillStyle=e)},d.default.Renderer2D.prototype._getStroke=function(){return this._cachedStrokeStyle||(this._cachedStrokeStyle=this.drawingContext.strokeStyle),this._cachedStrokeStyle},d.default.Renderer2D.prototype._setStroke=function(e){e!==this._cachedStrokeStyle&&(this.drawingContext.strokeStyle=e,this._cachedStrokeStyle=e)},d.default.Renderer2D.prototype.bezier=function(e,t,r,o,n,s,i,a){return this._pInst.beginShape(),this._pInst.vertex(e,t),this._pInst.bezierVertex(r,o,n,s,i,a),this._pInst.endShape(),this},d.default.Renderer2D.prototype.curve=function(e,t,r,o,n,s,i,a){return this._pInst.beginShape(),this._pInst.curveVertex(e,t),this._pInst.curveVertex(r,o),this._pInst.curveVertex(n,s),this._pInst.curveVertex(i,a),this._pInst.endShape(),this},d.default.Renderer2D.prototype._doFillStrokeClose=function(e){e&&this.drawingContext.closePath(),this._doFill&&this.drawingContext.fill(),this._doStroke&&this.drawingContext.stroke()},d.default.Renderer2D.prototype.applyMatrix=function(e,t,r,o,n,s){this.drawingContext.transform(e,t,r,o,n,s)},d.default.Renderer2D.prototype.resetMatrix=function(){return this.drawingContext.setTransform(1,0,0,1,0,0),this.drawingContext.scale(this._pInst._pixelDensity,this._pInst._pixelDensity),this},d.default.Renderer2D.prototype.rotate=function(e){this.drawingContext.rotate(e)},d.default.Renderer2D.prototype.scale=function(e,t){return this.drawingContext.scale(e,t),this},d.default.Renderer2D.prototype.translate=function(e,t){return e instanceof d.default.Vector&&(t=e.y,e=e.x),this.drawingContext.translate(e,t),this},d.default.Renderer2D.prototype.text=function(e,t,r,o,n){void 0!==o&&this.drawingContext.textBaseline===p.BASELINE&&(s=!0,this.drawingContext.textBaseline=p.TOP);var s,o=d.default.Renderer.prototype.text.apply(this,arguments);return s&&(this.drawingContext.textBaseline=p.BASELINE),o},d.default.Renderer2D.prototype._renderText=function(e,t,r,o,n,s){if(!(o<s||n<=o))return e.push(),this._isOpenType()?this._textFont._renderPath(t,r,o,{renderer:this}):(this._doStroke&&this._strokeSet&&this.drawingContext.strokeText(t,r,o),this._doFill&&(this._fillSet||this._setFill(p._DEFAULT_TEXT_FILL),this.drawingContext.fillText(t,r,o))),e.pop(),e},d.default.Renderer2D.prototype.textWidth=function(e){return this._isOpenType()?this._textFont._textWidth(e,this._textSize):this.drawingContext.measureText(e).width},d.default.Renderer2D.prototype._applyTextProperties=function(){var e,t=this._pInst;return this._setProperty("_textAscent",null),this._setProperty("_textDescent",null),e=this._textFont,this._isOpenType()&&(e=this._textFont.font.familyName,this._setProperty("_textStyle",this._textFont.font.styleName)),this.drawingContext.font="".concat(this._textStyle||"normal"," ").concat(this._textSize||12,"px ").concat(e||"sans-serif"),this.drawingContext.textAlign=this._textAlign,this._textBaseline===p.CENTER?this.drawingContext.textBaseline=p._CTX_MIDDLE:this.drawingContext.textBaseline=this._textBaseline,t},d.default.Renderer2D.prototype.push=function(){return this.drawingContext.save(),d.default.Renderer.prototype.push.apply(this)},d.default.Renderer2D.prototype.pop=function(e){this.drawingContext.restore(),this._cachedFillStyle=this.drawingContext.fillStyle,this._cachedStrokeStyle=this.drawingContext.strokeStyle,d.default.Renderer.prototype.pop.call(this,e)},d.default.Renderer2D);r.default=n},{"./constants":256,"./main":267,"./p5.Renderer":270,"core-js/modules/es.array.concat":149,"core-js/modules/es.array.fill":152,"core-js/modules/es.array.for-each":154,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.join":159,"core-js/modules/es.array.slice":162,"core-js/modules/es.function.name":165,"core-js/modules/es.number.to-fixed":171,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],272:[function(e,t,r){"use strict";e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator");var f=(e=e("./main"))&&e.__esModule?e:{default:e};f.default.prototype._promisePreloads=[];function s(){return{}}var h=!(f.default.prototype.registerPromisePreload=function(e){f.default.prototype._promisePreloads.push(e)});f.default.prototype._setupPromisePreloads=function(){var e=!0,t=!1,r=void 0;try{for(var o,n=this._promisePreloads[Symbol.iterator]();!(e=(o=n.next()).done);e=!0){var s=o.value,i=this,a=s.method,l=s.addCallbacks,u=s.legacyPreloadSetup,c=s.target||this,d=c[a].bind(c);if(c===f.default.prototype){if(h)continue;i=null,d=c[a]}c[a]=this._wrapPromisePreload(i,d,l),u&&(c[u.method]=this._legacyPreloadGenerator(i,u,c[a]))}}catch(e){t=!0,r=e}finally{try{e||null==n.return||n.return()}finally{if(t)throw r}}h=!0},f.default.prototype._wrapPromisePreload=function(e,l,u){var t=function(){for(var e=this,t=(this._incrementPreload(),null),r=null,o=arguments.length,n=new Array(o),s=0;s<o;s++)n[s]=arguments[s];if(u)for(var i=n.length-1;0<=i&&!r&&"function"==typeof n[i];i--)r=t,t=n.pop();var a=Promise.resolve(l.apply(this,n));return t&&a.then(t),r&&a.catch(r),a.then(function(){return e._decrementPreload()}),a};return t=e?t.bind(e):t};f.default.prototype._legacyPreloadGenerator=function(e,t,o){var n=t.createBaseObject||s,t=function(){var t=this,r=(this._incrementPreload(),n.apply(this,arguments));return o.apply(this,arguments).then(function(e){Object.assign(r,e),t._decrementPreload()}),r};return t=e?t.bind(e):t}},{"./main":267,"core-js/modules/es.array.iterator":158,"core-js/modules/es.object.assign":172,"core-js/modules/es.object.to-string":177,"core-js/modules/es.promise":178,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/web.dom-collections.iterator":230}],273:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var a=(n=e("./main"))&&n.__esModule?n:{default:n},l=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==u(e)&&"function"!=typeof e)return{default:e};var t=i();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("./constants"));function i(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,i=function(){return e},e)}function u(e){return(u="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("./p5.Graphics"),e("./p5.Renderer2D"),e("../webgl/p5.RendererGL");var c="defaultCanvas0",n=(a.default.prototype.createCanvas=function(e,t,r){a.default._validateParameters("createCanvas",arguments);var o,n,s,r=r||l.P2D;if(r===l.WEBGL)(n=document.getElementById(c))&&(n.parentNode.removeChild(n),o=this._renderer,this._elements=this._elements.filter(function(e){return e!==o})),(n=document.createElement("canvas")).id=c,n.classList.add("p5Canvas");else if(this._defaultGraphicsCreated)n=this.canvas;else{n=document.createElement("canvas");for(var i=0;document.getElementById("defaultCanvas".concat(i));)i++;c="defaultCanvas".concat(i),n.id=c,n.classList.add("p5Canvas")}return this._setupDone||(n.dataset.hidden=!0,n.style.visibility="hidden"),(this._userNode||(0===document.getElementsByTagName("main").length&&(s=document.createElement("main"),document.body.appendChild(s)),document.getElementsByTagName("main")[0])).appendChild(n),r===l.WEBGL?(this._setProperty("_renderer",new a.default.RendererGL(n,this,!0)),this._elements.push(this._renderer)):this._defaultGraphicsCreated||(this._setProperty("_renderer",new a.default.Renderer2D(n,this,!0)),this._defaultGraphicsCreated=!0,this._elements.push(this._renderer)),this._renderer.resize(e,t),this._renderer._applyDefaults(),this._renderer},a.default.prototype.resizeCanvas=function(e,t,r){if(a.default._validateParameters("resizeCanvas",arguments),this._renderer){var o,n,s={};for(o in this.drawingContext){var i=this.drawingContext[o];"object"!==u(i)&&"function"!=typeof i&&(s[o]=i)}for(n in this._renderer.resize(e,t),this.width=e,this.height=t,s)try{this.drawingContext[n]=s[n]}catch(e){}r||this.redraw()}this._addAccsOutput()&&this._updateAccsOutput()},a.default.prototype.noCanvas=function(){this.canvas&&this.canvas.parentNode.removeChild(this.canvas)},a.default.prototype.createGraphics=function(e,t,r){return a.default._validateParameters("createGraphics",arguments),new a.default.Graphics(e,t,r,this)},a.default.prototype.blendMode=function(e){a.default._validateParameters("blendMode",arguments),e===l.NORMAL&&(console.warn("NORMAL has been deprecated for use in blendMode. defaulting to BLEND instead."),e=l.BLEND),this._renderer.blendMode(e)},a.default);r.default=n},{"../webgl/p5.RendererGL":321,"./constants":256,"./main":267,"./p5.Graphics":269,"./p5.Renderer2D":271,"core-js/modules/es.array.filter":153,"core-js/modules/es.array.iterator":158,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],274:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.slice"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var l=n(e("../main")),a=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=c();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../constants")),u=n(e("../helpers"));function c(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,c=function(){return e},e)}function n(e){return e&&e.__esModule?e:{default:e}}e("../friendly_errors/fes_core"),e("../friendly_errors/file_errors"),e("../friendly_errors/validate_params"),l.default.prototype._normalizeArcAngles=function(e,t,r,o,n){var s;return e-=a.TWO_PI*Math.floor(e/a.TWO_PI),t-=a.TWO_PI*Math.floor(t/a.TWO_PI),s=Math.min(Math.abs(e-t),a.TWO_PI-Math.abs(e-t)),n&&(e=e<=a.HALF_PI?Math.atan(r/o*Math.tan(e)):e>a.HALF_PI&&e<=3*a.HALF_PI?Math.atan(r/o*Math.tan(e))+a.PI:Math.atan(r/o*Math.tan(e))+a.TWO_PI,t=t<=a.HALF_PI?Math.atan(r/o*Math.tan(t)):t>a.HALF_PI&&t<=3*a.HALF_PI?Math.atan(r/o*Math.tan(t))+a.PI:Math.atan(r/o*Math.tan(t))+a.TWO_PI),t<e&&(t+=a.TWO_PI),{start:e,stop:t,correspondToSamePoint:s<1e-5}},l.default.prototype.arc=function(e,t,r,o,n,s,i,a){return l.default._validateParameters("arc",arguments),(this._renderer._doStroke||this._renderer._doFill)&&n!==s&&(n=this._toRadians(n),s=this._toRadians(s),r=Math.abs(r),o=Math.abs(o),e=u.default.modeAdjust(e,t,r,o,this._renderer._ellipseMode),(t=this._normalizeArcAngles(n,s,e.w,e.h,!0)).correspondToSamePoint?this._renderer.ellipse([e.x,e.y,e.w,e.h,a]):(this._renderer.arc(e.x,e.y,e.w,e.h,t.start,t.stop,i,a),(this._accessibleOutputs.grid||this._accessibleOutputs.text)&&this._accsOutput("arc",[e.x,e.y,e.w,e.h,t.start,t.stop,i]))),this},l.default.prototype.ellipse=function(e,t,r,o,n){return l.default._validateParameters("ellipse",arguments),this._renderEllipse.apply(this,arguments)},l.default.prototype.circle=function(){l.default._validateParameters("circle",arguments);var e=Array.prototype.slice.call(arguments,0,2);return e.push(arguments[2]),e.push(arguments[2]),this._renderEllipse.apply(this,e)},l.default.prototype._renderEllipse=function(e,t,r,o,n){return(this._renderer._doStroke||this._renderer._doFill)&&(r<0&&(r=Math.abs(r)),void 0===o?o=r:o<0&&(o=Math.abs(o)),e=u.default.modeAdjust(e,t,r,o,this._renderer._ellipseMode),this._renderer.ellipse([e.x,e.y,e.w,e.h,n]),(this._accessibleOutputs.grid||this._accessibleOutputs.text)&&this._accsOutput("ellipse",[e.x,e.y,e.w,e.h])),this},l.default.prototype.line=function(){for(var e,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return l.default._validateParameters("line",r),this._renderer._doStroke&&(e=this._renderer).line.apply(e,r),(this._accessibleOutputs.grid||this._accessibleOutputs.text)&&this._accsOutput("line",r),this},l.default.prototype.point=function(){for(var e,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return l.default._validateParameters("point",r),this._renderer._doStroke&&(1===r.length&&r[0]instanceof l.default.Vector?this._renderer.point.call(this._renderer,r[0].x,r[0].y,r[0].z):((e=this._renderer).point.apply(e,r),(this._accessibleOutputs.grid||this._accessibleOutputs.text)&&this._accsOutput("point",r))),this},l.default.prototype.quad=function(){for(var e,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return l.default._validateParameters("quad",r),(this._renderer._doStroke||this._renderer._doFill)&&(this._renderer.isP3D&&r.length<12?this._renderer.quad.call(this._renderer,r[0],r[1],0,r[2],r[3],0,r[4],r[5],0,r[6],r[7],0,r[8],r[9]):((e=this._renderer).quad.apply(e,r),(this._accessibleOutputs.grid||this._accessibleOutputs.text)&&this._accsOutput("quadrilateral",r))),this},l.default.prototype.rect=function(){return l.default._validateParameters("rect",arguments),this._renderRect.apply(this,arguments)},l.default.prototype.square=function(e,t,r,o,n,s,i){return l.default._validateParameters("square",arguments),this._renderRect.call(this,e,t,r,r,o,n,s,i)},l.default.prototype._renderRect=function(){if(this._renderer._doStroke||this._renderer._doFill){3===arguments.length&&(arguments[3]=arguments[2]);for(var e=u.default.modeAdjust(arguments[0],arguments[1],arguments[2],arguments[3],this._renderer._rectMode),t=[e.x,e.y,e.w,e.h],r=4;r<arguments.length;r++)t[r]=arguments[r];this._renderer.rect(t),(this._accessibleOutputs.grid||this._accessibleOutputs.text)&&this._accsOutput("rectangle",[e.x,e.y,e.w,e.h])}return this},l.default.prototype.triangle=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return l.default._validateParameters("triangle",t),(this._renderer._doStroke||this._renderer._doFill)&&this._renderer.triangle(t),(this._accessibleOutputs.grid||this._accessibleOutputs.text)&&this._accsOutput("triangle",t),this};e=l.default;r.default=e},{"../constants":256,"../friendly_errors/fes_core":258,"../friendly_errors/file_errors":259,"../friendly_errors/validate_params":262,"../helpers":263,"../main":267,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.slice":162,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],275:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(l=e("../main"))&&l.__esModule?l:{default:l},s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}n.default.prototype.ellipseMode=function(e){return n.default._validateParameters("ellipseMode",arguments),e!==s.CORNER&&e!==s.CORNERS&&e!==s.RADIUS&&e!==s.CENTER||(this._renderer._ellipseMode=e),this},n.default.prototype.noSmooth=function(){return this._renderer.isP3D?this.setAttributes("antialias",!1):"imageSmoothingEnabled"in this.drawingContext&&(this.drawingContext.imageSmoothingEnabled=!1),this},n.default.prototype.rectMode=function(e){return n.default._validateParameters("rectMode",arguments),e!==s.CORNER&&e!==s.CORNERS&&e!==s.RADIUS&&e!==s.CENTER||(this._renderer._rectMode=e),this},n.default.prototype.smooth=function(){return this.setAttributes("antialias",!0),this._renderer.isP3D||"imageSmoothingEnabled"in this.drawingContext&&(this.drawingContext.imageSmoothingEnabled=!0),this},n.default.prototype.strokeCap=function(e){return n.default._validateParameters("strokeCap",arguments),e!==s.ROUND&&e!==s.SQUARE&&e!==s.PROJECT||this._renderer.strokeCap(e),this},n.default.prototype.strokeJoin=function(e){return n.default._validateParameters("strokeJoin",arguments),e!==s.ROUND&&e!==s.BEVEL&&e!==s.MITER||this._renderer.strokeJoin(e),this},n.default.prototype.strokeWeight=function(e){return n.default._validateParameters("strokeWeight",arguments),this._renderer.strokeWeight(e),this};var l=n.default;r.default=l},{"../constants":256,"../main":267,"core-js/modules/es.array.iterator":158,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],276:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var l=(o=e("../main"))&&o.__esModule?o:{default:o};e("../friendly_errors/fes_core"),e("../friendly_errors/file_errors"),e("../friendly_errors/validate_params"),l.default.prototype.bezier=function(){for(var e,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return l.default._validateParameters("bezier",r),(this._renderer._doStroke||this._renderer._doFill)&&(e=this._renderer).bezier.apply(e,r),this},l.default.prototype.bezierDetail=function(e){return l.default._validateParameters("bezierDetail",arguments),this._bezierDetail=e,this},l.default.prototype.bezierPoint=function(e,t,r,o,n){l.default._validateParameters("bezierPoint",arguments);var s=1-n;return Math.pow(s,3)*e+3*Math.pow(s,2)*n*t+3*s*Math.pow(n,2)*r+Math.pow(n,3)*o},l.default.prototype.bezierTangent=function(e,t,r,o,n){l.default._validateParameters("bezierTangent",arguments);var s=1-n;return 3*o*Math.pow(n,2)-3*r*Math.pow(n,2)+6*r*s*n-6*t*s*n+3*t*Math.pow(s,2)-3*e*Math.pow(s,2)},l.default.prototype.curve=function(){for(var e,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return l.default._validateParameters("curve",r),this._renderer._doStroke&&(e=this._renderer).curve.apply(e,r),this},l.default.prototype.curveDetail=function(e){return l.default._validateParameters("curveDetail",arguments),this._curveDetail=e<3?3:e,this},l.default.prototype.curveTightness=function(e){return l.default._validateParameters("curveTightness",arguments),this._renderer._curveTightness=e,this},l.default.prototype.curvePoint=function(e,t,r,o,n){l.default._validateParameters("curvePoint",arguments);var s=this._renderer._curveTightness,i=n*n*n,a=n*n;return e*((s-1)/2*i+(1-s)*a+(s-1)/2*n)+t*((s+3)/2*i+(-5-s)/2*a+1)+r*((-3-s)/2*i+(s+2)*a+(1-s)/2*n)+o*((1-s)/2*i+(s-1)/2*a)},l.default.prototype.curveTangent=function(e,t,r,o,n){l.default._validateParameters("curveTangent",arguments);var s=this._renderer._curveTightness,i=n*n*3,n=2*n;return e*((s-1)/2*i+(1-s)*n+(s-1)/2)+t*((s+3)/2*i+(-5-s)/2*n)+r*((-3-s)/2*i+(s+2)*n+(1-s)/2)+o*((1-s)/2*i+(s-1)/2*n)};var o=l.default;r.default=o},{"../friendly_errors/fes_core":258,"../friendly_errors/file_errors":259,"../friendly_errors/validate_params":262,"../main":267}],277:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.slice"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var a=(y=e("../main"))&&y.__esModule?y:{default:y},l=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../constants"));function u(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,u=function(){return e},e)}var n=null,c=[],d=[],f=!1,s=!1,h=!1,p=!1,m=!0,y=(a.default.prototype.beginContour=function(){return d=[],p=!0,this},a.default.prototype.beginShape=function(e){var t;return a.default._validateParameters("beginShape",arguments),this._renderer.isP3D?(t=this._renderer).beginShape.apply(t,arguments):(n=e===l.POINTS||e===l.LINES||e===l.TRIANGLES||e===l.TRIANGLE_FAN||e===l.TRIANGLE_STRIP||e===l.QUADS||e===l.QUAD_STRIP?e:null,c=[],d=[]),this},a.default.prototype.bezierVertex=function(){for(var e,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];if(a.default._validateParameters("bezierVertex",r),this._renderer.isP3D)(e=this._renderer).bezierVertex.apply(e,r);else if(0===c.length)a.default._friendlyError("vertex() must be used once before calling bezierVertex()","bezierVertex");else{f=!0;for(var n=[],s=0;s<r.length;s++)n[s]=r[s];n.isVert=!1,(p?d:c).push(n)}return this},a.default.prototype.curveVertex=function(){for(var e,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return a.default._validateParameters("curveVertex",r),this._renderer.isP3D?(e=this._renderer).curveVertex.apply(e,r):(s=!0,this.vertex(r[0],r[1])),this},a.default.prototype.endContour=function(){var e=d[0].slice();e.isVert=d[0].isVert,e.moveTo=!1,d.push(e),m&&(c.push(c[0]),m=!1);for(var t=0;t<d.length;t++)c.push(d[t]);return this},a.default.prototype.endShape=function(e){if(a.default._validateParameters("endShape",arguments),this._renderer.isP3D)this._renderer.endShape(e,s,f,h,p,n);else{if(0===c.length)return this;if(!this._renderer._doStroke&&!this._renderer._doFill)return this;var t=e===l.CLOSE;t&&!p&&c.push(c[0]),this._renderer.endShape(e,c,s,f,h,p,n),m=!(p=h=f=s=!1),t&&c.pop()}return this},a.default.prototype.quadraticVertex=function(){for(var e,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];if(a.default._validateParameters("quadraticVertex",r),this._renderer.isP3D)(e=this._renderer).quadraticVertex.apply(e,r);else{if(this._contourInited)return(e={}).x=r[0],e.y=r[1],e.x3=r[2],e.y3=r[3],e.type=l.QUADRATIC,this._contourVertices.push(e),this;if(0<c.length){h=!0;for(var n=[],s=0;s<r.length;s++)n[s]=r[s];n.isVert=!1,(p?d:c).push(n)}else a.default._friendlyError("vertex() must be used once before calling quadraticVertex()","quadraticVertex")}return this},a.default.prototype.vertex=function(e,t,r,o,n){var s;return this._renderer.isP3D?(s=this._renderer).vertex.apply(s,arguments):((s=[]).isVert=!0,s[0]=e,s[1]=t,s[2]=0,s[3]=0,s[4]=0,s[5]=this._renderer._getFill(),s[6]=this._renderer._getStroke(),r&&(s.moveTo=r),(p?(0===d.length&&(s.moveTo=!0),d):c).push(s)),this},a.default.prototype.normal=function(e,t,r){var o;return this._assert3d("normal"),a.default._validateParameters("normal",arguments),(o=this._renderer).normal.apply(o,arguments),this},a.default);r.default=y},{"../constants":256,"../main":267,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.slice":162,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],278:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e){return(n="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}var a,l,u;e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.typed-array.uint8-clamped-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.typed-array.uint8-clamped-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/web.dom-collections.iterator"),window.requestAnimationFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e,t){window.setTimeout(e,1e3/60)},"undefined"==typeof Uint8ClampedArray||Uint8ClampedArray.prototype.slice||Object.defineProperty(Uint8ClampedArray.prototype,"slice",{value:Array.prototype.slice,writable:!0,configurable:!0,enumerable:!1}),Object.assign||(a=Object.keys,e=Object.defineProperty,l="function"==typeof Symbol&&"symbol"===n(Symbol()),u=Object.prototype.propertyIsEnumerable,e(Object,"assign",{value:function(e,t){if(null==e)throw new TypeError("target must be an object");for(var r,o,n,s=Object(e),i=1;i<arguments.length;++i)for(r=Object(arguments[i]),n=a(r),l&&Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter(function(t){return function(e){return u.call(t,e)}}(r))),o=0;o<n.length;++o)s[n[o]]=r[n[o]];return s},configurable:!0,enumerable:!1,writable:!0}))},{"core-js/modules/es.array.filter":153,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.slice":162,"core-js/modules/es.object.assign":172,"core-js/modules/es.object.keys":176,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.typed-array.copy-within":197,"core-js/modules/es.typed-array.every":198,"core-js/modules/es.typed-array.fill":199,"core-js/modules/es.typed-array.filter":200,"core-js/modules/es.typed-array.find":202,"core-js/modules/es.typed-array.find-index":201,"core-js/modules/es.typed-array.for-each":205,"core-js/modules/es.typed-array.includes":206,"core-js/modules/es.typed-array.index-of":207,"core-js/modules/es.typed-array.iterator":210,"core-js/modules/es.typed-array.join":211,"core-js/modules/es.typed-array.last-index-of":212,"core-js/modules/es.typed-array.map":213,"core-js/modules/es.typed-array.reduce":215,"core-js/modules/es.typed-array.reduce-right":214,"core-js/modules/es.typed-array.reverse":216,"core-js/modules/es.typed-array.set":217,"core-js/modules/es.typed-array.slice":218,"core-js/modules/es.typed-array.some":219,"core-js/modules/es.typed-array.sort":220,"core-js/modules/es.typed-array.subarray":221,"core-js/modules/es.typed-array.to-locale-string":222,"core-js/modules/es.typed-array.to-string":223,"core-js/modules/es.typed-array.uint8-clamped-array":227,"core-js/modules/web.dom-collections.iterator":230}],279:[function(e,t,r){"use strict";e("core-js/modules/es.array.for-each"),e("core-js/modules/es.object.assign"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.object.assign"),e("core-js/modules/web.dom-collections.for-each"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;e=(e=e("./main"))&&e.__esModule?e:{default:e};e.default.prototype.noLoop=function(){this._loop=!1},e.default.prototype.loop=function(){this._loop||(this._loop=!0,this._setupDone&&this._draw())},e.default.prototype.isLooping=function(){return this._loop},e.default.prototype.push=function(){this._styles.push({props:{_colorMode:this._colorMode},renderer:this._renderer.push()})},e.default.prototype.pop=function(){var e=this._styles.pop();e?(this._renderer.pop(e.renderer),Object.assign(this,e.props)):console.warn("pop() was called without matching push()")},e.default.prototype.redraw=function(e){if(!this._inUserDraw&&this._setupDone){var t=parseInt(e),r=((isNaN(t)||t<1)&&(t=1),this._isGlobal?window:this);if("function"==typeof r.draw){void 0===r.setup&&r.scale(r._pixelDensity,r._pixelDensity);for(var o=function(e){e.call(r)},n=0;n<t;n++){r.resetMatrix(),(this._accessibleOutputs.grid||this._accessibleOutputs.text)&&this._updateAccsOutput(),r._renderer.isP3D&&r._renderer._update(),r._setProperty("frameCount",r.frameCount+1),r._registeredMethods.pre.forEach(o),this._inUserDraw=!0;try{r.draw()}finally{this._inUserDraw=!1}r._registeredMethods.post.forEach(o)}}}};e=e.default;r.default=e},{"./main":267,"core-js/modules/es.array.for-each":154,"core-js/modules/es.object.assign":172,"core-js/modules/web.dom-collections.for-each":229}],280:[function(e,t,r){"use strict";e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-prototype-of"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-prototype-of"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(e=e("./main"))&&e.__esModule?e:{default:e};function o(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}n.default.prototype.applyMatrix=function(){var e=arguments[0]instanceof Object.getPrototypeOf(Uint8Array);return Array.isArray(arguments[0])||e?(e=this._renderer).applyMatrix.apply(e,o(arguments[0])):(e=this._renderer).applyMatrix.apply(e,arguments),this},n.default.prototype.resetMatrix=function(){return this._renderer.resetMatrix(),this},n.default.prototype.rotate=function(e,t){return n.default._validateParameters("rotate",arguments),this._renderer.rotate(this._toRadians(e),t),this},n.default.prototype.rotateX=function(e){return this._assert3d("rotateX"),n.default._validateParameters("rotateX",arguments),this._renderer.rotateX(this._toRadians(e)),this},n.default.prototype.rotateY=function(e){return this._assert3d("rotateY"),n.default._validateParameters("rotateY",arguments),this._renderer.rotateY(this._toRadians(e)),this},n.default.prototype.rotateZ=function(e){return this._assert3d("rotateZ"),n.default._validateParameters("rotateZ",arguments),this._renderer.rotateZ(this._toRadians(e)),this},n.default.prototype.scale=function(e,t,r){var o;return n.default._validateParameters("scale",arguments),e instanceof n.default.Vector?(e=(o=e).x,t=o.y,r=o.z):e instanceof Array&&(e=(o=e)[0],t=o[1],r=o[2]||1),isNaN(t)?t=r=e:isNaN(r)&&(r=1),this._renderer.scale.call(this._renderer,e,t,r),this},n.default.prototype.shearX=function(e){n.default._validateParameters("shearX",arguments);e=this._toRadians(e);return this._renderer.applyMatrix(1,0,Math.tan(e),1,0,0),this},n.default.prototype.shearY=function(e){n.default._validateParameters("shearY",arguments);e=this._toRadians(e);return this._renderer.applyMatrix(1,Math.tan(e),0,1,0,0),this},n.default.prototype.translate=function(e,t,r){return n.default._validateParameters("translate",arguments),this._renderer.isP3D?this._renderer.translate(e,t,r):this._renderer.translate(e,t),this};e=n.default;r.default=e},{"./main":267,"core-js/modules/es.array.from":155,"core-js/modules/es.array.iterator":158,"core-js/modules/es.object.get-prototype-of":175,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.typed-array.copy-within":197,"core-js/modules/es.typed-array.every":198,"core-js/modules/es.typed-array.fill":199,"core-js/modules/es.typed-array.filter":200,"core-js/modules/es.typed-array.find":202,"core-js/modules/es.typed-array.find-index":201,"core-js/modules/es.typed-array.for-each":205,"core-js/modules/es.typed-array.includes":206,"core-js/modules/es.typed-array.index-of":207,"core-js/modules/es.typed-array.iterator":210,"core-js/modules/es.typed-array.join":211,"core-js/modules/es.typed-array.last-index-of":212,"core-js/modules/es.typed-array.map":213,"core-js/modules/es.typed-array.reduce":215,"core-js/modules/es.typed-array.reduce-right":214,"core-js/modules/es.typed-array.reverse":216,"core-js/modules/es.typed-array.set":217,"core-js/modules/es.typed-array.slice":218,"core-js/modules/es.typed-array.some":219,"core-js/modules/es.typed-array.sort":220,"core-js/modules/es.typed-array.subarray":221,"core-js/modules/es.typed-array.to-locale-string":222,"core-js/modules/es.typed-array.to-string":223,"core-js/modules/es.typed-array.uint8-array":226,"core-js/modules/web.dom-collections.iterator":230}],281:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.ends-with"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.ends-with"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator");var n=(e=e("../core/main"))&&e.__esModule?e:{default:e};function s(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}n.default.prototype.storeItem=function(e,t){"string"!=typeof e&&console.log("The argument that you passed to storeItem() - ".concat(e," is not a string.")),e.endsWith("p5TypeID")&&console.log("The argument that you passed to storeItem() - ".concat(e," must not end with 'p5TypeID'.")),void 0===t&&console.log("You cannot store undefined variables using storeItem().");var r=i(t);switch(r){case"number":case"boolean":t=t.toString();break;case"object":t instanceof n.default.Color?r="p5.Color":t instanceof n.default.Vector&&(r="p5.Vector",t=[t.x,t.y,t.z]),t=JSON.stringify(t)}localStorage.setItem(e,t);e="".concat(e,"p5TypeID");localStorage.setItem(e,r)},n.default.prototype.getItem=function(e){var t=localStorage.getItem(e),r=localStorage.getItem("".concat(e,"p5TypeID"));if(void 0===r)console.log("Unable to determine type of item stored under ".concat(e,"in local storage. Did you save the item with something other than setItem()?"));else if(null!==t)switch(r){case"number":t=parseFloat(t);break;case"boolean":t="true"===t;break;case"object":t=JSON.parse(t);break;case"p5.Color":t=JSON.parse(t),t=this.color.apply(this,s(t.levels));break;case"p5.Vector":t=JSON.parse(t),t=this.createVector.apply(this,s(t))}return t},n.default.prototype.clearStorage=function(){localStorage.clear()},n.default.prototype.removeItem=function(e){"string"!=typeof e&&console.log("The argument that you passed to removeItem() - ".concat(e," is not a string.")),localStorage.removeItem(e),localStorage.removeItem("".concat(e,"p5TypeID"))}},{"../core/main":267,"core-js/modules/es.array.from":155,"core-js/modules/es.array.iterator":158,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.string.ends-with":184,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/web.dom-collections.iterator":230}],282:[function(e,t,r){"use strict";e("core-js/modules/es.array.concat"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.string.sub"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.string.sub"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(e=e("../core/main"))&&e.__esModule?e:{default:e};n.default.prototype.createStringDict=function(e,t){return n.default._validateParameters("createStringDict",arguments),new n.default.StringDict(e,t)},n.default.prototype.createNumberDict=function(e,t){return n.default._validateParameters("createNumberDict",arguments),new n.default.NumberDict(e,t)},n.default.TypedDict=function(e,t){return e instanceof Object?this.data=e:(this.data={},this.data[e]=t),this},n.default.TypedDict.prototype.size=function(){return Object.keys(this.data).length},n.default.TypedDict.prototype.hasKey=function(e){return this.data.hasOwnProperty(e)},n.default.TypedDict.prototype.get=function(e){if(this.data.hasOwnProperty(e))return this.data[e];console.log("".concat(e," does not exist in this Dictionary"))},n.default.TypedDict.prototype.set=function(e,t){this._validate(t)?this.data[e]=t:console.log("Those values dont work for this dictionary type.")},n.default.TypedDict.prototype._addObj=function(e){for(var t in e)this.set(t,e[t])},n.default.TypedDict.prototype.create=function(e,t){e instanceof Object&&void 0===t?this._addObj(e):void 0!==e?this.set(e,t):console.log("In order to create a new Dictionary entry you must pass an object or a key, value pair")},n.default.TypedDict.prototype.clear=function(){this.data={}},n.default.TypedDict.prototype.remove=function(e){if(!this.data.hasOwnProperty(e))throw new Error("".concat(e," does not exist in this Dictionary"));delete this.data[e]},n.default.TypedDict.prototype.print=function(){for(var e in this.data)console.log("key:".concat(e," value:").concat(this.data[e]))},n.default.TypedDict.prototype.saveTable=function(e){var t,r="";for(t in this.data)r+="".concat(t,",").concat(this.data[t],"\n");var o=new Blob([r],{type:"text/csv"});n.default.prototype.downloadFile(o,e||"mycsv","csv")},n.default.TypedDict.prototype.saveJSON=function(e,t){n.default.prototype.saveJSON(this.data,e,t)},n.default.TypedDict.prototype._validate=function(e){return!0},n.default.StringDict=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];n.default.TypedDict.apply(this,t)},n.default.StringDict.prototype=Object.create(n.default.TypedDict.prototype),n.default.StringDict.prototype._validate=function(e){return"string"==typeof e},n.default.NumberDict=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];n.default.TypedDict.apply(this,t)},n.default.NumberDict.prototype=Object.create(n.default.TypedDict.prototype),n.default.NumberDict.prototype._validate=function(e){return"number"==typeof e},n.default.NumberDict.prototype.add=function(e,t){this.data.hasOwnProperty(e)?this.data[e]+=t:console.log("The key - ".concat(e," does not exist in this dictionary."))},n.default.NumberDict.prototype.sub=function(e,t){this.add(e,-t)},n.default.NumberDict.prototype.mult=function(e,t){this.data.hasOwnProperty(e)?this.data[e]*=t:console.log("The key - ".concat(e," does not exist in this dictionary."))},n.default.NumberDict.prototype.div=function(e,t){this.data.hasOwnProperty(e)?this.data[e]/=t:console.log("The key - ".concat(e," does not exist in this dictionary."))},n.default.NumberDict.prototype._valueTest=function(e){if(0===Object.keys(this.data).length)throw new Error("Unable to search for a minimum or maximum value on an empty NumberDict");if(1===Object.keys(this.data).length)return this.data[Object.keys(this.data)[0]];var t,r=this.data[Object.keys(this.data)[0]];for(t in this.data)this.data[t]*e<r*e&&(r=this.data[t]);return r},n.default.NumberDict.prototype.minValue=function(){return this._valueTest(1)},n.default.NumberDict.prototype.maxValue=function(){return this._valueTest(-1)},n.default.NumberDict.prototype._keyTest=function(e){if(0===Object.keys(this.data).length)throw new Error("Unable to use minValue on an empty NumberDict");if(1===Object.keys(this.data).length)return Object.keys(this.data)[0];for(var t=Object.keys(this.data)[0],r=1;r<Object.keys(this.data).length;r++)Object.keys(this.data)[r]*e<t*e&&(t=Object.keys(this.data)[r]);return t},n.default.NumberDict.prototype.minKey=function(){return this._keyTest(1)},n.default.NumberDict.prototype.maxKey=function(){return this._keyTest(-1)};e=n.default.TypedDict;r.default=e},{"../core/main":267,"core-js/modules/es.array.concat":149,"core-js/modules/es.object.keys":176,"core-js/modules/es.string.sub":192}],283:[function(t,r,o){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}t("core-js/modules/es.symbol"),t("core-js/modules/es.symbol.description"),t("core-js/modules/es.symbol.iterator"),t("core-js/modules/es.array.every"),t("core-js/modules/es.array.filter"),t("core-js/modules/es.array.for-each"),t("core-js/modules/es.array.from"),t("core-js/modules/es.array.index-of"),t("core-js/modules/es.array.iterator"),t("core-js/modules/es.array.map"),t("core-js/modules/es.array.slice"),t("core-js/modules/es.array.splice"),t("core-js/modules/es.function.name"),t("core-js/modules/es.object.to-string"),t("core-js/modules/es.promise"),t("core-js/modules/es.regexp.exec"),t("core-js/modules/es.regexp.to-string"),t("core-js/modules/es.string.iterator"),t("core-js/modules/es.string.replace"),t("core-js/modules/es.string.split"),t("core-js/modules/es.string.trim"),t("core-js/modules/web.dom-collections.for-each"),t("core-js/modules/web.dom-collections.iterator"),t("core-js/modules/web.url"),t("core-js/modules/es.symbol"),t("core-js/modules/es.symbol.description"),t("core-js/modules/es.symbol.iterator"),t("core-js/modules/es.array.every"),t("core-js/modules/es.array.filter"),t("core-js/modules/es.array.for-each"),t("core-js/modules/es.array.from"),t("core-js/modules/es.array.index-of"),t("core-js/modules/es.array.iterator"),t("core-js/modules/es.array.map"),t("core-js/modules/es.array.slice"),t("core-js/modules/es.array.splice"),t("core-js/modules/es.function.name"),t("core-js/modules/es.object.to-string"),t("core-js/modules/es.promise"),t("core-js/modules/es.regexp.exec"),t("core-js/modules/es.regexp.to-string"),t("core-js/modules/es.string.iterator"),t("core-js/modules/es.string.replace"),t("core-js/modules/es.string.split"),t("core-js/modules/es.string.trim"),t("core-js/modules/web.dom-collections.for-each"),t("core-js/modules/web.dom-collections.iterator"),t("core-js/modules/web.url"),Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0;var h=(t=t("../core/main"))&&t.__esModule?t:{default:t};function f(e){return(f="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}function p(e,t,r){(t._userNode||document.body).appendChild(e);r=new(r?h.default.MediaElement:h.default.Element)(e,t);return t._elements.push(r),r}function s(e,t,r,o){var n=document.createElement(t),s=("string"==typeof(r=r||"")&&(r=[r]),!0),t=!1,i=void 0;try{for(var a,l=r[Symbol.iterator]();!(s=(a=l.next()).done);s=!0){var u=a.value,c=document.createElement("source");c.setAttribute("src",u),n.appendChild(c)}}catch(e){t=!0,i=e}finally{try{s||null==l.return||l.return()}finally{if(t)throw i}}"function"==typeof o&&n.addEventListener("canplaythrough",function e(){o(),n.removeEventListener("canplaythrough",e)});var d=p(n,e,!0);return d.loadedmetadata=!1,n.addEventListener("loadedmetadata",function(){d.width=n.videoWidth,d.height=n.videoHeight,0===d.elt.width&&(d.elt.width=n.videoWidth),0===d.elt.height&&(d.elt.height=n.videoHeight),d.presetPlaybackRate&&(d.elt.playbackRate=d.presetPlaybackRate,delete d.presetPlaybackRate),d.loadedmetadata=!0}),d}h.default.prototype.select=function(e,t){h.default._validateParameters("select",arguments);t=this._getContainer(t).querySelector(e);return t?this._wrapElement(t):null},h.default.prototype.selectAll=function(e,t){h.default._validateParameters("selectAll",arguments);var r=[],o=this._getContainer(t).querySelectorAll(e);if(o)for(var n=0;n<o.length;n++){var s=this._wrapElement(o[n]);r.push(s)}return r},h.default.prototype._getContainer=function(e){var t=document;return"string"==typeof e?t=document.querySelector(e)||document:e instanceof h.default.Element?t=e.elt:e instanceof HTMLElement&&(t=e),t},h.default.prototype._wrapElement=function(e){var t,r=Array.prototype.slice.call(e.children);return"INPUT"===e.tagName&&"checkbox"===e.type?((t=new h.default.Element(e,this)).checked=function(){return 0===arguments.length?this.elt.checked:(this.elt.checked=!!arguments[0],this)},t):"VIDEO"===e.tagName||"AUDIO"===e.tagName?new h.default.MediaElement(e,this):"SELECT"===e.tagName?this.createSelect(new h.default.Element(e,this)):0<r.length&&r.every(function(e){return"INPUT"===e.tagName||"LABEL"===e.tagName})?this.createRadio(new h.default.Element(e,this)):new h.default.Element(e,this)},h.default.prototype.removeElements=function(e){h.default._validateParameters("removeElements",arguments);this._elements.filter(function(e){return!(e.elt instanceof HTMLCanvasElement)}).map(function(e){return e.remove()})},h.default.Element.prototype.changed=function(e){return h.default.Element._adjustListener("change",e,this),this},h.default.Element.prototype.input=function(e){return h.default.Element._adjustListener("input",e,this),this},h.default.prototype.createDiv=function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",t=document.createElement("div");return t.innerHTML=e,p(t,this)},h.default.prototype.createP=function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",t=document.createElement("p");return t.innerHTML=e,p(t,this)},h.default.prototype.createSpan=function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",t=document.createElement("span");return t.innerHTML=e,p(t,this)},h.default.prototype.createImg=function(){h.default._validateParameters("createImg",arguments);var t,r=document.createElement("img"),o=arguments;return 1<o.length&&"string"==typeof o[1]&&(r.alt=o[1]),2<o.length&&"string"==typeof o[2]&&(r.crossOrigin=o[2]),r.src=o[0],t=p(r,this),r.addEventListener("load",function(){t.width=r.offsetWidth||r.width,t.height=r.offsetHeight||r.height;var e=o[o.length-1];"function"==typeof e&&e(t)}),t},h.default.prototype.createA=function(e,t,r){h.default._validateParameters("createA",arguments);var o=document.createElement("a");return o.href=e,o.innerHTML=t,r&&(o.target=r),p(o,this)},h.default.prototype.createSlider=function(e,t,r,o){h.default._validateParameters("createSlider",arguments);var n=document.createElement("input");return n.type="range",n.min=e,n.max=t,0===o?n.step=1e-18:o&&(n.step=o),"number"==typeof r&&(n.value=r),p(n,this)},h.default.prototype.createButton=function(e,t){h.default._validateParameters("createButton",arguments);var r=document.createElement("button");return r.innerHTML=e,t&&(r.value=t),p(r,this)},h.default.prototype.createCheckbox=function(){h.default._validateParameters("createCheckbox",arguments);var e=document.createElement("div"),t=document.createElement("input"),r=(t.type="checkbox",document.createElement("label")),o=(r.appendChild(t),e.appendChild(r),p(e,this));return o.checked=function(){var e=o.elt.firstElementChild.getElementsByTagName("input")[0];if(e){if(0===arguments.length)return e.checked;e.checked=!!arguments[0]}return o},this.value=function(e){return o.value=e,this},arguments[0]&&(o.value(arguments[0]),(e=document.createElement("span")).innerHTML=arguments[0],r.appendChild(e)),arguments[1]&&(t.checked=!0),o},h.default.prototype.createSelect=function(){h.default._validateParameters("createSelect",arguments);var e,t,r=arguments[0];return r instanceof h.default.Element&&r.elt instanceof HTMLSelectElement?this.elt=(e=r).elt:r instanceof HTMLSelectElement?(e=p(r,this),this.elt=r):(t=document.createElement("select"),r&&"boolean"==typeof r&&t.setAttribute("multiple","true"),e=p(t,this),this.elt=t),e.option=function(e,t){var r;if(void 0!==e){for(var o,n=0;n<this.elt.length;n+=1)if(this.elt[n].textContent===e){r=n;break}void 0!==r?!1===t?this.elt.remove(r):this.elt[r].value=t:((o=document.createElement("option")).textContent=e,o.value=void 0===t?e:t,this.elt.appendChild(o),this._pInst._elements.push(o))}},e.selected=function(e){if(void 0!==e){for(var t=0;t<this.elt.length;t+=1)this.elt[t].value.toString()===e.toString()&&(this.elt.selectedIndex=t);return this}if(this.elt.getAttribute("multiple")){var r=[],o=!0,n=!1,s=void 0;try{for(var i,a=this.elt.selectedOptions[Symbol.iterator]();!(o=(i=a.next()).done);o=!0){var l=i.value;r.push(l.value)}}catch(e){n=!0,s=e}finally{try{o||null==a.return||a.return()}finally{if(n)throw s}}return r}return this.elt.value},e.disable=function(e){if("string"==typeof e)for(var t=0;t<this.elt.length;t++)this.elt[t].value.toString()===e&&(this.elt[t].disabled=!0,this.elt[t].selected=!1);else this.elt.disabled=!0;return this},e},h.default.prototype.createRadio=function(){function t(e){return e instanceof HTMLInputElement&&"radio"===e.type}function d(e){return e instanceof HTMLLabelElement}var f,e,r,o=arguments[0];o instanceof h.default.Element&&(o.elt instanceof HTMLDivElement||o.elt instanceof HTMLSpanElement)?(f=o,this.elt=o.elt):o instanceof HTMLDivElement||o instanceof HTMLSpanElement?(f=p(o,this),e=this.elt=o,"string"==typeof arguments[1]&&(r=arguments[1])):("string"==typeof o&&(r=o),e=document.createElement("div"),f=p(e,this),this.elt=e),f._name=r||"radioOption";return f._getOptionsArray=function(){return Array.from(this.elt.children).filter(function(e){return t(e)||d(e)&&t(e.firstElementChild)}).map(function(e){return t(e)?e:e.firstElementChild})},f.option=function(e,t){var r,o,n,s=!0,i=!1,a=void 0;try{for(var l,u=f._getOptionsArray()[Symbol.iterator]();!(s=(l=u.next()).done);s=!0){var c=l.value;if(c.value===e){r=c;break}}}catch(e){i=!0,a=e}finally{try{s||null==u.return||u.return()}finally{if(i)throw a}}return void 0===r&&((r=document.createElement("input")).setAttribute("type","radio"),r.setAttribute("value",e)),r.setAttribute("name",f._name),d(r.parentElement)?o=r.parentElement:(o=document.createElement("label")).insertAdjacentElement("afterbegin",r),o.lastElementChild instanceof HTMLSpanElement?n=o.lastElementChild:(n=document.createElement("span"),r.insertAdjacentElement("afterend",n)),n.innerHTML=void 0===t?e:t,this.elt.appendChild(o),r},f.remove=function(e){var t=!0,r=!1,o=void 0;try{for(var n,s=f._getOptionsArray()[Symbol.iterator]();!(t=(n=s.next()).done);t=!0){var i=n.value;if(i.value===e)return void(d(i.parentElement)?i.parentElement:i).remove()}}catch(e){r=!0,o=e}finally{try{t||null==s.return||s.return()}finally{if(r)throw o}}},f.value=function(){var e="",t=!0,r=!1,o=void 0;try{for(var n,s=f._getOptionsArray()[Symbol.iterator]();!(t=(n=s.next()).done);t=!0){var i=n.value;if(i.checked){e=i.value;break}}}catch(e){r=!0,o=e}finally{try{t||null==s.return||s.return()}finally{if(r)throw o}}return e},f.selected=function(e){var t=null;if(void 0===e){var r=!0,o=!1,n=void 0;try{for(var s,i=f._getOptionsArray()[Symbol.iterator]();!(r=(s=i.next()).done);r=!0){var a=s.value;if(a.checked){t=a;break}}}catch(e){o=!0,n=e}finally{try{r||null==i.return||i.return()}finally{if(o)throw n}}}else{f._getOptionsArray().forEach(function(e){e.checked=!1,e.removeAttribute("checked")});var l=!0,o=!1,n=void 0;try{for(var u,c=f._getOptionsArray()[Symbol.iterator]();!(l=(u=c.next()).done);l=!0){var d=u.value;d.value===e&&(d.setAttribute("checked",!0),d.checked=!0,t=d)}}catch(e){o=!0,n=e}finally{try{l||null==c.return||c.return()}finally{if(o)throw n}}}return t},f.disable=function(){var e=!(0<arguments.length&&void 0!==arguments[0])||arguments[0],t=!0,r=!1,o=void 0;try{for(var n,s=f._getOptionsArray()[Symbol.iterator]();!(t=(n=s.next()).done);t=!0)n.value.setAttribute("disabled",e)}catch(e){r=!0,o=e}finally{try{t||null==s.return||s.return()}finally{if(r)throw o}}},f},h.default.prototype.createColorPicker=function(e){h.default._validateParameters("createColorPicker",arguments);var t=document.createElement("input");return t.type="color",e?e instanceof h.default.Color?t.value=e.toString("#rrggbb"):(h.default.prototype._colorMode="rgb",h.default.prototype._colorMaxes={rgb:[255,255,255,255],hsb:[360,100,100,1],hsl:[360,100,100,1]},t.value=h.default.prototype.color(e).toString("#rrggbb")):t.value="#000000",(t=p(t,this)).color=function(){return e&&(e.mode&&(h.default.prototype._colorMode=e.mode),e.maxes&&(h.default.prototype._colorMaxes=e.maxes)),h.default.prototype.color(this.elt.value)},t},h.default.prototype.createInput=function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"text",r=(h.default._validateParameters("createInput",arguments),document.createElement("input"));return r.setAttribute("value",e),r.setAttribute("type",t),p(r,this)},h.default.prototype.createFileInput=function(a){var e,t=1<arguments.length&&void 0!==arguments[1]&&arguments[1];h.default._validateParameters("createFileInput",arguments);if(window.File&&window.FileReader&&window.FileList&&window.Blob)return(e=document.createElement("input")).setAttribute("type","file"),t&&e.setAttribute("multiple",!0),e.addEventListener("change",function(e){var t=!0,r=!1,o=void 0;try{for(var n,s=e.target.files[Symbol.iterator]();!(t=(n=s.next()).done);t=!0){var i=n.value;h.default.File._load(i,a)}}catch(e){r=!0,o=e}finally{try{t||null==s.return||s.return()}finally{if(r)throw o}}},!1),p(e,this);console.log("The File APIs are not fully supported in this browser. Cannot create element.")},h.default.prototype.createVideo=function(e,t){return h.default._validateParameters("createVideo",arguments),s(this,"video",e,t)},h.default.prototype.createAudio=function(e,t){return h.default._validateParameters("createAudio",arguments),s(this,"audio",e,t)},h.default.prototype.VIDEO="video",h.default.prototype.AUDIO="audio",void 0===navigator.mediaDevices&&(navigator.mediaDevices={}),void 0===navigator.mediaDevices.getUserMedia&&(navigator.mediaDevices.getUserMedia=function(r){var o=navigator.webkitGetUserMedia||navigator.mozGetUserMedia;return o?new Promise(function(e,t){o.call(navigator,r,e,t)}):Promise.reject(new Error("getUserMedia is not implemented in this browser"))}),h.default.prototype.createCapture=function(){if(h.default._validateParameters("createCapture",arguments),!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia)throw new DOMException("getUserMedia not supported in this browser");var e,t=!0,r=!0,o=!0,n=!1,s=void 0;try{for(var i,a=arguments[Symbol.iterator]();!(o=(i=a.next()).done);o=!0){var l=i.value;l===h.default.prototype.VIDEO?r=!1:l===h.default.prototype.AUDIO?t=!1:"object"===f(l)?u=l:"function"==typeof l&&(e=l)}}catch(e){n=!0,s=e}finally{try{o||null==a.return||a.return()}finally{if(n)throw s}}var u=u||{video:t,audio:r},c=document.createElement("video"),d=(c.setAttribute("playsinline",""),navigator.mediaDevices.getUserMedia(u).then(function(t){try{"srcObject"in c?c.srcObject=t:c.src=window.URL.createObjectURL(t)}catch(e){c.src=t}},console.log),p(c,this,!0));return d.loadedmetadata=!1,c.addEventListener("loadedmetadata",function(){c.play(),c.width?(d.width=c.width,d.height=c.height):(d.width=d.elt.width=c.videoWidth,d.height=d.elt.height=c.videoHeight),d.loadedmetadata=!0,e&&e(c.srcObject)}),d},h.default.prototype.createElement=function(e,t){h.default._validateParameters("createElement",arguments);e=document.createElement(e);return void 0!==t&&(e.innerHTML=t),p(e,this)},h.default.Element.prototype.addClass=function(e){return this.elt.className?this.hasClass(e)||(this.elt.className=this.elt.className+" "+e):this.elt.className=e,this},h.default.Element.prototype.removeClass=function(e){return this.elt.classList.remove(e),this},h.default.Element.prototype.hasClass=function(e){return this.elt.classList.contains(e)},h.default.Element.prototype.toggleClass=function(e){return this.elt.classList.contains(e)?this.elt.classList.remove(e):this.elt.classList.add(e),this},h.default.Element.prototype.child=function(e){return void 0===e?this.elt.childNodes:("string"==typeof e?("#"===e[0]&&(e=e.substring(1)),e=document.getElementById(e)):e instanceof h.default.Element&&(e=e.elt),e instanceof HTMLElement&&this.elt.appendChild(e),this)},h.default.Element.prototype.center=function(e){var t=this.elt.style.display,r="none"===this.elt.style.display,o="none"===this.parent().style.display,n={x:this.elt.offsetLeft,y:this.elt.offsetTop},s=(r&&this.show(),o&&this.parent().show(),this.elt.style.display="block",this.position(0,0),Math.abs(this.parent().offsetWidth-this.elt.offsetWidth)),i=Math.abs(this.parent().offsetHeight-this.elt.offsetHeight);return"both"===e||void 0===e?this.position(s/2+this.parent().offsetLeft,i/2+this.parent().offsetTop):"horizontal"===e?this.position(s/2+this.parent().offsetLeft,n.y):"vertical"===e&&this.position(n.x,i/2+this.parent().offsetTop),this.style("display",t),r&&this.hide(),o&&this.parent().hide(),this},h.default.Element.prototype.html=function(){return 0===arguments.length?this.elt.innerHTML:(arguments[1]?this.elt.insertAdjacentHTML("beforeend",arguments[0]):this.elt.innerHTML=arguments[0],this)},h.default.Element.prototype.position=function(){return 0===arguments.length?{x:this.elt.offsetLeft,y:this.elt.offsetTop}:(this.elt.style.position="static"!==arguments[2]&&"fixed"!==arguments[2]&&"relative"!==arguments[2]&&"sticky"!==arguments[2]&&"initial"!==arguments[2]&&"inherit"!==arguments[2]?"absolute":arguments[2],this.elt.style.left=arguments[0]+"px",this.elt.style.top=arguments[1]+"px",this.x=arguments[0],this.y=arguments[1],this)},h.default.Element.prototype._translate=function(){this.elt.style.position="absolute";var e="";return this.elt.style.transform&&(e=(e=this.elt.style.transform.replace(/translate3d\(.*\)/g,"")).replace(/translate[X-Z]?\(.*\)/g,"")),2===arguments.length?this.elt.style.transform="translate("+arguments[0]+"px, "+arguments[1]+"px)":2<arguments.length&&(this.elt.style.transform="translate3d("+arguments[0]+"px,"+arguments[1]+"px,"+arguments[2]+"px)",this.elt.parentElement.style.perspective=3===arguments.length?"1000px":arguments[3]+"px"),this.elt.style.transform+=e,this},h.default.Element.prototype._rotate=function(){var e="";return this.elt.style.transform&&(e=(e=this.elt.style.transform.replace(/rotate3d\(.*\)/g,"")).replace(/rotate[X-Z]?\(.*\)/g,"")),1===arguments.length?this.elt.style.transform="rotate("+arguments[0]+"deg)":2===arguments.length?this.elt.style.transform="rotate("+arguments[0]+"deg, "+arguments[1]+"deg)":3===arguments.length&&(this.elt.style.transform="rotateX("+arguments[0]+"deg)",this.elt.style.transform+="rotateY("+arguments[1]+"deg)",this.elt.style.transform+="rotateZ("+arguments[2]+"deg)"),this.elt.style.transform+=e,this},h.default.Element.prototype.style=function(e,t){if(void 0===(t=t instanceof h.default.Color?"rgba("+t.levels[0]+","+t.levels[1]+","+t.levels[2]+","+t.levels[3]/255+")":t)){if(-1===e.indexOf(":"))return window.getComputedStyle(this.elt).getPropertyValue(e);for(var r=e.split(";"),o=0;o<r.length;o++){var n=r[o].split(":");n[0]&&n[1]&&(this.elt.style[n[0].trim()]=n[1].trim())}}else this.elt.style[e]=t,"width"!==e&&"height"!==e&&"left"!==e&&"top"!==e||(t=window.getComputedStyle(this.elt).getPropertyValue(e).replace(/[^\d.]/g,""),this[e]=Math.round(parseFloat(t,10)));return this},h.default.Element.prototype.attribute=function(e,t){if(null==this.elt.firstChild||"checkbox"!==this.elt.firstChild.type&&"radio"!==this.elt.firstChild.type)return void 0===t?this.elt.getAttribute(e):(this.elt.setAttribute(e,t),this);if(void 0===t)return this.elt.firstChild.getAttribute(e);for(var r=0;r<this.elt.childNodes.length;r++)this.elt.childNodes[r].setAttribute(e,t)},h.default.Element.prototype.removeAttribute=function(e){if(null!=this.elt.firstChild&&("checkbox"===this.elt.firstChild.type||"radio"===this.elt.firstChild.type))for(var t=0;t<this.elt.childNodes.length;t++)this.elt.childNodes[t].removeAttribute(e);return this.elt.removeAttribute(e),this},h.default.Element.prototype.value=function(){return 0<arguments.length?(this.elt.value=arguments[0],this):"range"===this.elt.type?parseFloat(this.elt.value):this.elt.value},h.default.Element.prototype.show=function(){return this.elt.style.display="block",this},h.default.Element.prototype.hide=function(){return this.elt.style.display="none",this},h.default.Element.prototype.size=function(e,t){if(0===arguments.length)return{width:this.elt.offsetWidth,height:this.elt.offsetHeight};var r=e,o=t,n=h.default.prototype.AUTO;if(r!==n||o!==n){if(r===n?r=t*this.width/this.height:o===n&&(o=e*this.height/this.width),this.elt instanceof HTMLCanvasElement){var s,i={},a=this.elt.getContext("2d");for(s in a)i[s]=a[s];for(s in this.elt.setAttribute("width",r*this._pInst._pixelDensity),this.elt.setAttribute("height",o*this._pInst._pixelDensity),this.elt.style.width=r+"px",this.elt.style.height=o+"px",this._pInst.scale(this._pInst._pixelDensity,this._pInst._pixelDensity),i)this.elt.getContext("2d")[s]=i[s]}else this.elt.style.width=r+"px",this.elt.style.height=o+"px",this.elt.width=r,this.elt.height=o;this.width=this.elt.offsetWidth,this.height=this.elt.offsetHeight,this._pInst&&this._pInst._curElement&&this._pInst._curElement.elt===this.elt&&(this._pInst._setProperty("width",this.elt.offsetWidth),this._pInst._setProperty("height",this.elt.offsetHeight))}return this},h.default.Element.prototype.remove=function(){this instanceof h.default.MediaElement&&(this.stop(),null!==(t=this.elt.srcObject)&&t.getTracks().forEach(function(e){e.stop()}));var e,t=this._pInst._elements.indexOf(this);for(e in-1!==t&&this._pInst._elements.splice(t,1),this._events)this.elt.removeEventListener(e,this._events[e]);this.elt&&this.elt.parentNode&&this.elt.parentNode.removeChild(this.elt)},h.default.Element.prototype.drop=function(n,s){var e;return window.File&&window.FileReader&&window.FileList&&window.Blob?(this._dragDisabled||(this._dragDisabled=!0,this.elt.addEventListener("dragover",e=function(e){e.preventDefault()}),this.elt.addEventListener("dragleave",e)),h.default.Element._attachListener("drop",function(e){e.preventDefault(),"function"==typeof s&&s.call(this,e);for(var t=e.dataTransfer.files,r=0;r<t.length;r++){var o=t[r];h.default.File._load(o,n)}},this)):console.log("The File APIs are not fully supported in this browser."),this},h.default.MediaElement=function(o,e){h.default.Element.call(this,o,e);var n=this;this.elt.crossOrigin="anonymous",this._prevTime=0,this._cueIDCounter=0,this._cues=[],(this._pixelsState=this)._pixelDensity=1,this._modified=!1,Object.defineProperty(n,"src",{get:function(){var e=n.elt.children[0].src,t=n.elt.src===window.location.href?"":n.elt.src;return e===window.location.href?t:e},set:function(e){for(var t=0;t<n.elt.children.length;t++)n.elt.removeChild(n.elt.children[t]);var r=document.createElement("source");r.src=e,o.appendChild(r),n.elt.src=e,n.modified=!0}}),n._onended=function(){},n.elt.onended=function(){n._onended(n)}},h.default.MediaElement.prototype=Object.create(h.default.Element.prototype),h.default.MediaElement.prototype.play=function(){var e;return this.elt.currentTime===this.elt.duration&&(this.elt.currentTime=0),1<this.elt.readyState||this.elt.load(),(e=this.elt.play())&&e.catch&&e.catch(function(e){"NotAllowedError"===e.name?console.error(e):console.error("Media play method encountered an unexpected error",e)}),this},h.default.MediaElement.prototype.stop=function(){return this.elt.pause(),this.elt.currentTime=0,this},h.default.MediaElement.prototype.pause=function(){return this.elt.pause(),this},h.default.MediaElement.prototype.loop=function(){return this.elt.setAttribute("loop",!0),this.play(),this},h.default.MediaElement.prototype.noLoop=function(){return this.elt.removeAttribute("loop"),this},h.default.MediaElement.prototype._setupAutoplayFailDetection=function(){var t=setTimeout(function(){console.error(e)},500);this.elt.addEventListener("play",function(){return clearTimeout(t)},{passive:!0,once:!0})},h.default.MediaElement.prototype.autoplay=function(e){var t=this,r=this.elt.getAttribute("autoplay");return this.elt.setAttribute("autoplay",e),e&&!r&&(e=function(){return t._setupAutoplayFailDetection()},4===this.elt.readyState?e():this.elt.addEventListener("canplay",e,{passive:!0,once:!0})),this},h.default.MediaElement.prototype.volume=function(e){if(void 0===e)return this.elt.volume;this.elt.volume=e},h.default.MediaElement.prototype.speed=function(e){if(void 0===e)return this.presetPlaybackRate||this.elt.playbackRate;this.loadedmetadata?this.elt.playbackRate=e:this.presetPlaybackRate=e},h.default.MediaElement.prototype.time=function(e){return void 0===e?this.elt.currentTime:(this.elt.currentTime=e,this)},h.default.MediaElement.prototype.duration=function(){return this.elt.duration},h.default.MediaElement.prototype.pixels=[],h.default.MediaElement.prototype._ensureCanvas=function(){this.canvas||(this.canvas=document.createElement("canvas"),this.drawingContext=this.canvas.getContext("2d"),this.setModified(!0)),this.loadedmetadata&&(this.canvas.width!==this.elt.width&&(this.canvas.width=this.elt.width,this.canvas.height=this.elt.height,this.width=this.canvas.width,this.height=this.canvas.height),this.drawingContext.drawImage(this.elt,0,0,this.canvas.width,this.canvas.height),this.setModified(!0))},h.default.MediaElement.prototype.loadPixels=function(){return this._ensureCanvas(),h.default.Renderer2D.prototype.loadPixels.apply(this,arguments)},h.default.MediaElement.prototype.updatePixels=function(e,t,r,o){return this.loadedmetadata&&(this._ensureCanvas(),h.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,o)),this.setModified(!0),this},h.default.MediaElement.prototype.get=function(){return this._ensureCanvas(),h.default.Renderer2D.prototype.get.apply(this,arguments)},h.default.MediaElement.prototype._getPixel=function(){return this.loadPixels(),h.default.Renderer2D.prototype._getPixel.apply(this,arguments)},h.default.MediaElement.prototype.set=function(e,t,r){this.loadedmetadata&&(this._ensureCanvas(),h.default.Renderer2D.prototype.set.call(this,e,t,r),this.setModified(!0))},h.default.MediaElement.prototype.copy=function(){this._ensureCanvas(),h.default.prototype.copy.apply(this,arguments)},h.default.MediaElement.prototype.mask=function(){this.loadPixels(),this.setModified(!0),h.default.Image.prototype.mask.apply(this,arguments)},h.default.MediaElement.prototype.isModified=function(){return this._modified},h.default.MediaElement.prototype.setModified=function(e){this._modified=e},h.default.MediaElement.prototype.onended=function(e){return this._onended=e,this},h.default.MediaElement.prototype.connect=function(e){var t,r;if("function"==typeof h.default.prototype.getAudioContext)t=h.default.prototype.getAudioContext(),r=h.default.soundOut.input;else try{r=(t=e.context).destination}catch(e){throw"connect() is meant to be used with Web Audio API or p5.sound.js"}this.audioSourceNode||(this.audioSourceNode=t.createMediaElementSource(this.elt),this.audioSourceNode.connect(r)),e?e.input?this.audioSourceNode.connect(e.input):this.audioSourceNode.connect(e):this.audioSourceNode.connect(r)},h.default.MediaElement.prototype.disconnect=function(){if(!this.audioSourceNode)throw"nothing to disconnect";this.audioSourceNode.disconnect()},h.default.MediaElement.prototype.showControls=function(){this.elt.style["text-align"]="inherit",this.elt.controls=!0},h.default.MediaElement.prototype.hideControls=function(){this.elt.controls=!1};function i(e,t,r,o){this.callback=e,this.time=t,this.id=r,this.val=o}h.default.MediaElement.prototype.addCue=function(e,t,r){var o=this._cueIDCounter++,t=new i(t,e,o,r);return this._cues.push(t),this.elt.ontimeupdate||(this.elt.ontimeupdate=this._onTimeUpdate.bind(this)),o},h.default.MediaElement.prototype.removeCue=function(e){for(var t=0;t<this._cues.length;t++)this._cues[t].id===e&&(console.log(e),this._cues.splice(t,1));0===this._cues.length&&(this.elt.ontimeupdate=null)},h.default.MediaElement.prototype.clearCues=function(){this._cues=[],this.elt.ontimeupdate=null},h.default.MediaElement.prototype._onTimeUpdate=function(){for(var e=this.time(),t=0;t<this._cues.length;t++){var r=this._cues[t].time,o=this._cues[t].val;this._prevTime<r&&r<=e&&this._cues[t].callback(o)}this._prevTime=e},h.default.File=function(e,t){this.file=e,this._pInst=t;t=e.type.split("/");this.type=t[0],this.subtype=t[1],this.name=e.name,this.size=e.size,this.data=void 0},h.default.File._createLoader=function(o,n){var e=new FileReader;return e.onload=function(e){var t,r=new h.default.File(o);"application/json"===r.file.type?r.data=JSON.parse(e.target.result):"text/xml"===r.file.type?(t=(new DOMParser).parseFromString(e.target.result,"text/xml"),r.data=new h.default.XML(t.documentElement)):r.data=e.target.result,n(r)},e},h.default.File._load=function(e,t){var r;/^text\//.test(e.type)||"application/json"===e.type?h.default.File._createLoader(e,t).readAsText(e):/^(video|audio)\//.test(e.type)?((r=new h.default.File(e)).data=URL.createObjectURL(e),t(r)):h.default.File._createLoader(e,t).readAsDataURL(e)};t=h.default;o.default=t},{"../core/main":267,"core-js/modules/es.array.every":151,"core-js/modules/es.array.filter":153,"core-js/modules/es.array.for-each":154,"core-js/modules/es.array.from":155,"core-js/modules/es.array.index-of":157,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.map":161,"core-js/modules/es.array.slice":162,"core-js/modules/es.array.splice":164,"core-js/modules/es.function.name":165,"core-js/modules/es.object.to-string":177,"core-js/modules/es.promise":178,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.string.iterator":186,"core-js/modules/es.string.replace":189,"core-js/modules/es.string.split":191,"core-js/modules/es.string.trim":193,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/web.dom-collections.for-each":229,"core-js/modules/web.dom-collections.iterator":230,"core-js/modules/web.url":232}],284:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(y=e("../core/main"))&&y.__esModule?y:{default:y},s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}n.default.prototype.deviceOrientation=1<window.innerWidth/window.innerHeight?"landscape":"portrait",n.default.prototype.accelerationX=0,n.default.prototype.accelerationY=0,n.default.prototype.accelerationZ=0,n.default.prototype.pAccelerationX=0,n.default.prototype.pAccelerationY=0,n.default.prototype.pAccelerationZ=0,n.default.prototype._updatePAccelerations=function(){this._setProperty("pAccelerationX",this.accelerationX),this._setProperty("pAccelerationY",this.accelerationY),this._setProperty("pAccelerationZ",this.accelerationZ)},n.default.prototype.rotationX=0,n.default.prototype.rotationY=0,n.default.prototype.rotationZ=0,n.default.prototype.pRotationX=0,n.default.prototype.pRotationY=0;var l=n.default.prototype.pRotationZ=0,u=0,c=0,d="clockwise",f="clockwise",h="clockwise",p=(n.default.prototype.pRotateDirectionX=void 0,n.default.prototype.pRotateDirectionY=void 0,n.default.prototype.pRotateDirectionZ=void 0,n.default.prototype._updatePRotations=function(){this._setProperty("pRotationX",this.rotationX),this._setProperty("pRotationY",this.rotationY),this._setProperty("pRotationZ",this.rotationZ)},n.default.prototype.turnAxis=void 0,.5),m=30,y=(n.default.prototype.setMoveThreshold=function(e){n.default._validateParameters("setMoveThreshold",arguments),p=e},n.default.prototype.setShakeThreshold=function(e){n.default._validateParameters("setShakeThreshold",arguments),m=e},n.default.prototype._ondeviceorientation=function(e){this._updatePRotations(),this._angleMode===s.radians&&(e.beta=e.beta*(_PI/180),e.gamma=e.gamma*(_PI/180),e.alpha=e.alpha*(_PI/180)),this._setProperty("rotationX",e.beta),this._setProperty("rotationY",e.gamma),this._setProperty("rotationZ",e.alpha),this._handleMotion()},n.default.prototype._ondevicemotion=function(e){this._updatePAccelerations(),this._setProperty("accelerationX",2*e.acceleration.x),this._setProperty("accelerationY",2*e.acceleration.y),this._setProperty("accelerationZ",2*e.acceleration.z),this._handleMotion()},n.default.prototype._handleMotion=function(){90===window.orientation||-90===window.orientation?this._setProperty("deviceOrientation","landscape"):0===window.orientation?this._setProperty("deviceOrientation","portrait"):void 0===window.orientation&&this._setProperty("deviceOrientation","undefined");var e,t,r,o,n,s=this._isGlobal?window:this;"function"==typeof s.deviceMoved&&(Math.abs(this.accelerationX-this.pAccelerationX)>p||Math.abs(this.accelerationY-this.pAccelerationY)>p||Math.abs(this.accelerationZ-this.pAccelerationZ)>p)&&s.deviceMoved(),"function"==typeof s.deviceTurned&&(t=this.rotationX+180,e=this.pRotationX+180,r=l+180,0<t-e&&t-e<270||t-e<-270?d="clockwise":(t-e<0||270<t-e)&&(d="counter-clockwise"),d!==this.pRotateDirectionX&&(r=t),90<Math.abs(t-r)&&Math.abs(t-r)<270&&(r=t,this._setProperty("turnAxis","X"),s.deviceTurned()),this.pRotateDirectionX=d,l=r-180,e=this.rotationY+180,t=this.pRotationY+180,r=u+180,0<e-t&&e-t<270||e-t<-270?f="clockwise":(e-t<0||270<e-this.pRotationY)&&(f="counter-clockwise"),f!==this.pRotateDirectionY&&(r=e),90<Math.abs(e-r)&&Math.abs(e-r)<270&&(r=e,this._setProperty("turnAxis","Y"),s.deviceTurned()),this.pRotateDirectionY=f,u=r-180,0<this.rotationZ-this.pRotationZ&&this.rotationZ-this.pRotationZ<270||this.rotationZ-this.pRotationZ<-270?h="clockwise":(this.rotationZ-this.pRotationZ<0||270<this.rotationZ-this.pRotationZ)&&(h="counter-clockwise"),h!==this.pRotateDirectionZ&&(c=this.rotationZ),90<Math.abs(this.rotationZ-c)&&Math.abs(this.rotationZ-c)<270&&(c=this.rotationZ,this._setProperty("turnAxis","Z"),s.deviceTurned()),this.pRotateDirectionZ=h,this._setProperty("turnAxis",void 0)),"function"==typeof s.deviceShaken&&(null!==this.pAccelerationX&&(o=Math.abs(this.accelerationX-this.pAccelerationX),n=Math.abs(this.accelerationY-this.pAccelerationY)),m<o+n&&s.deviceShaken())},n.default);r.default=y},{"../core/constants":256,"../core/main":267,"core-js/modules/es.array.iterator":158,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],285:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(e=e("../core/main"))&&e.__esModule?e:{default:e};o.default.prototype.isKeyPressed=!1,o.default.prototype.keyIsPressed=!1,o.default.prototype.key="",o.default.prototype.keyCode=0,o.default.prototype._onkeydown=function(e){var t;this._downKeys[e.which]||(this._setProperty("isKeyPressed",!0),this._setProperty("keyIsPressed",!0),this._setProperty("keyCode",e.which),this._downKeys[e.which]=!0,this._setProperty("key",e.key||String.fromCharCode(e.which)||e.which),"function"!=typeof(t=this._isGlobal?window:this).keyPressed||e.charCode||!1===t.keyPressed(e)&&e.preventDefault())},o.default.prototype._onkeyup=function(e){this._downKeys[e.which]=!1,this._areDownKeys()||(this._setProperty("isKeyPressed",!1),this._setProperty("keyIsPressed",!1)),this._setProperty("_lastKeyCodeTyped",null),this._setProperty("key",e.key||String.fromCharCode(e.which)||e.which),this._setProperty("keyCode",e.which);var t=this._isGlobal?window:this;"function"==typeof t.keyReleased&&!1===t.keyReleased(e)&&e.preventDefault()},o.default.prototype._onkeypress=function(e){var t;e.which!==this._lastKeyCodeTyped&&(this._setProperty("_lastKeyCodeTyped",e.which),this._setProperty("key",e.key||String.fromCharCode(e.which)||e.which),"function"==typeof(t=this._isGlobal?window:this).keyTyped&&!1===t.keyTyped(e)&&e.preventDefault())},o.default.prototype._onblur=function(e){this._downKeys={}},o.default.prototype.keyIsDown=function(e){return o.default._validateParameters("keyIsDown",arguments),this._downKeys[e]||!1},o.default.prototype._areDownKeys=function(){for(var e in this._downKeys)if(this._downKeys.hasOwnProperty(e)&&!0===this._downKeys[e])return!0;return!1};e=o.default;r.default=e},{"../core/main":267}],286:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.string.includes"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(n=e("../core/main"))&&n.__esModule?n:{default:n},s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}n.default.prototype.movedX=0,n.default.prototype.movedY=0,n.default.prototype._hasMouseInteracted=!1,n.default.prototype.mouseX=0,n.default.prototype.mouseY=0,n.default.prototype.pmouseX=0,n.default.prototype.pmouseY=0,n.default.prototype.winMouseX=0,n.default.prototype.winMouseY=0,n.default.prototype.pwinMouseX=0,n.default.prototype.pwinMouseY=0,n.default.prototype.mouseButton=0,n.default.prototype.mouseIsPressed=!1,n.default.prototype._updateNextMouseCoords=function(e){var t,r,o,n,s;null!==this._curElement&&(!e.touches||0<e.touches.length)&&(t=this._curElement.elt,r=this.width,o=this.height,(n=e)&&!n.clientX&&(n.touches?n=n.touches[0]:n.changedTouches&&(n=n.changedTouches[0])),s=t.getBoundingClientRect(),r=t.scrollWidth/r||1,t=t.scrollHeight/o||1,o={x:(n.clientX-s.left)/r,y:(n.clientY-s.top)/t,winX:n.clientX,winY:n.clientY,id:n.identifier},this._setProperty("movedX",e.movementX),this._setProperty("movedY",e.movementY),this._setProperty("mouseX",o.x),this._setProperty("mouseY",o.y),this._setProperty("winMouseX",o.winX),this._setProperty("winMouseY",o.winY)),this._hasMouseInteracted||(this._updateMouseCoords(),this._setProperty("_hasMouseInteracted",!0))},n.default.prototype._updateMouseCoords=function(){this._setProperty("pmouseX",this.mouseX),this._setProperty("pmouseY",this.mouseY),this._setProperty("pwinMouseX",this.winMouseX),this._setProperty("pwinMouseY",this.winMouseY),this._setProperty("_pmouseWheelDeltaY",this._mouseWheelDeltaY)},n.default.prototype._setMouseButton=function(e){1===e.button?this._setProperty("mouseButton",s.CENTER):2===e.button?this._setProperty("mouseButton",s.RIGHT):this._setProperty("mouseButton",s.LEFT)},n.default.prototype._onmousemove=function(e){var t=this._isGlobal?window:this;this._updateNextMouseCoords(e),this.mouseIsPressed?"function"==typeof t.mouseDragged?!1===t.mouseDragged(e)&&e.preventDefault():"function"==typeof t.touchMoved&&!1===t.touchMoved(e)&&e.preventDefault():"function"==typeof t.mouseMoved&&!1===t.mouseMoved(e)&&e.preventDefault()},n.default.prototype._onmousedown=function(e){var t=this._isGlobal?window:this;this._setProperty("mouseIsPressed",!0),this._setMouseButton(e),this._updateNextMouseCoords(e),"function"==typeof t.mousePressed?!1===t.mousePressed(e)&&e.preventDefault():navigator.userAgent.toLowerCase().includes("safari")&&"function"==typeof t.touchStarted&&!1===t.touchStarted(e)&&e.preventDefault()},n.default.prototype._onmouseup=function(e){var t=this._isGlobal?window:this;this._setProperty("mouseIsPressed",!1),"function"==typeof t.mouseReleased?!1===t.mouseReleased(e)&&e.preventDefault():"function"==typeof t.touchEnded&&!1===t.touchEnded(e)&&e.preventDefault()},n.default.prototype._ondragend=n.default.prototype._onmouseup,n.default.prototype._ondragover=n.default.prototype._onmousemove,n.default.prototype._onclick=function(e){var t=this._isGlobal?window:this;"function"==typeof t.mouseClicked&&!1===t.mouseClicked(e)&&e.preventDefault()},n.default.prototype._ondblclick=function(e){var t=this._isGlobal?window:this;"function"==typeof t.doubleClicked&&!1===t.doubleClicked(e)&&e.preventDefault()},n.default.prototype._mouseWheelDeltaY=0,n.default.prototype._pmouseWheelDeltaY=0,n.default.prototype._onwheel=function(e){var t=this._isGlobal?window:this;this._setProperty("_mouseWheelDeltaY",e.deltaY),"function"==typeof t.mouseWheel&&(e.delta=e.deltaY,!1===t.mouseWheel(e)&&e.preventDefault())},n.default.prototype.requestPointerLock=function(){var e=this._curElement.elt;return e.requestPointerLock=e.requestPointerLock||e.mozRequestPointerLock,e.requestPointerLock?(e.requestPointerLock(),!0):(console.log("requestPointerLock is not implemented in this browser"),!1)},n.default.prototype.exitPointerLock=function(){document.exitPointerLock()};e=n.default;r.default=e},{"../core/constants":256,"../core/main":267,"core-js/modules/es.array.includes":156,"core-js/modules/es.array.iterator":158,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.includes":185,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],287:[function(e,t,r){"use strict";e("core-js/modules/es.array.includes"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.string.includes"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;e=(e=e("../core/main"))&&e.__esModule?e:{default:e};e.default.prototype.touches=[],e.default.prototype._updateTouchCoords=function(e){if(null!==this._curElement){for(var t=[],r=0;r<e.touches.length;r++)t[r]=function(e,t,r,o){var n=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0,s=e.getBoundingClientRect(),t=e.scrollWidth/t||1,e=e.scrollHeight/r||1,r=o.touches[n]||o.changedTouches[n];return{x:(r.clientX-s.left)/t,y:(r.clientY-s.top)/e,winX:r.clientX,winY:r.clientY,id:r.identifier}}(this._curElement.elt,this.width,this.height,e,r);this._setProperty("touches",t)}},e.default.prototype._ontouchstart=function(e){var t=this._isGlobal?window:this;this._setProperty("mouseIsPressed",!0),this._updateTouchCoords(e),this._updateNextMouseCoords(e),this._updateMouseCoords(),"function"==typeof t.touchStarted?!1===t.touchStarted(e)&&e.preventDefault():navigator.userAgent.toLowerCase().includes("safari")&&"function"==typeof t.mousePressed&&!1===t.mousePressed(e)&&e.preventDefault()},e.default.prototype._ontouchmove=function(e){var t=this._isGlobal?window:this;this._updateTouchCoords(e),this._updateNextMouseCoords(e),"function"==typeof t.touchMoved?!1===t.touchMoved(e)&&e.preventDefault():"function"==typeof t.mouseDragged&&!1===t.mouseDragged(e)&&e.preventDefault()},e.default.prototype._ontouchend=function(e){this._setProperty("mouseIsPressed",!1),this._updateTouchCoords(e),this._updateNextMouseCoords(e);var t=this._isGlobal?window:this;"function"==typeof t.touchEnded?!1===t.touchEnded(e)&&e.preventDefault():"function"==typeof t.mouseReleased&&!1===t.mouseReleased(e)&&e.preventDefault()};e=e.default;r.default=e},{"../core/main":267,"core-js/modules/es.array.includes":156,"core-js/modules/es.string.includes":185}],288:[function(e,t,r){"use strict";e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.typed-array.int32-array"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.typed-array.int32-array"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var N,F,B,G,V={};function o(e,D){for(var t,r,o,n,s,i,a,l,u,c,d=V._toPixels(e),f=e.width,h=e.height,p=f*h,m=new Int32Array(p),y=0;y<p;y++)m[y]=V._getARGB(d,y);var g,v,b,j=new Int32Array(p),_=new Int32Array(p),x=new Int32Array(p),w=new Int32Array(p),S=0,M=3.5*D|0;if(N!==(M=M<1?1:M<248?M:248)){F=1+(N=M)<<1,B=new Int32Array(F),G=new Array(F);for(var E,T,C=0;C<F;C++)G[C]=new Int32Array(256);for(var O=1,k=M-1;O<M;O++){B[M+O]=B[k]=T=k*k;for(var L=G[M+O],U=G[k--],P=0;P<256;P++)L[P]=U[P]=T*P}E=B[M]=M*M,L=G[M];for(var A=0;A<256;A++)L[A]=E*A}for(v=0;v<h;v++){for(g=0;g<f;g++){if(n=o=r=s=t=0,(i=g-N)<0)c=-i,i=0;else{if(f<=i)break;c=0}for(b=c;b<F&&!(f<=i);b++){var R,I=m[i+S];s+=(R=G[b])[(-16777216&I)>>>24],r+=R[(16711680&I)>>16],o+=R[(65280&I)>>8],n+=R[255&I],t+=B[b],i++}j[a=S+g]=s/t,_[a]=r/t,x[a]=o/t,w[a]=n/t}S+=f}for(u=(l=-N)*f,v=S=0;v<h;v++){for(g=0;g<f;g++){if(l<(n=o=r=s=t=0))c=a=-l,i=g;else{if(h<=l)break;c=0,a=l,i=g+u}for(b=c;b<F&&!(h<=a);b++)s+=(R=G[b])[j[i]],r+=R[_[i]],o+=R[x[i]],n+=R[w[i]],t+=B[b],a++,i+=f;m[g+S]=s/t<<24|r/t<<16|o/t<<8|n/t}S+=f,u+=f,l++}V._setPixels(d,m)}V._toPixels=function(e){var t,r;return e instanceof ImageData?e.data:e.getContext("2d")?e.getContext("2d").getImageData(0,0,e.width,e.height).data:e.getContext("webgl")?(r=(t=e.getContext("webgl")).drawingBufferWidth*t.drawingBufferHeight*4,r=new Uint8Array(r),t.readPixels(0,0,e.width,e.height,t.RGBA,t.UNSIGNED_BYTE,r),r):void 0},V._getARGB=function(e,t){t*=4;return e[3+t]<<24&4278190080|e[t]<<16&16711680|e[1+t]<<8&65280|255&e[2+t]},V._setPixels=function(e,t){for(var r,o=0,n=e.length;o<n;o++)e[0+(r=4*o)]=(16711680&t[o])>>>16,e[1+r]=(65280&t[o])>>>8,e[2+r]=255&t[o],e[3+r]=(4278190080&t[o])>>>24},V._toImageData=function(e){return e instanceof ImageData?e:e.getContext("2d").getImageData(0,0,e.width,e.height)},V._createImageData=function(e,t){return V._tmpCanvas=document.createElement("canvas"),V._tmpCtx=V._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(e,t)},V.apply=function(e,t,r){var o=e.getContext("2d"),n=o.getImageData(0,0,e.width,e.height),t=t(n,r);t instanceof ImageData?o.putImageData(t,0,0,0,0,e.width,e.height):o.putImageData(n,0,0,0,0,e.width,e.height)},V.threshold=function(e,t){for(var r=V._toPixels(e),o=(void 0===t&&(t=.5),Math.floor(255*t)),n=0;n<r.length;n+=4){var s=void 0,s=o<=.2126*r[n]+.7152*r[n+1]+.0722*r[n+2]?255:0;r[n]=r[n+1]=r[n+2]=s}},V.gray=function(e){for(var t=V._toPixels(e),r=0;r<t.length;r+=4){var o=t[r],n=t[r+1],s=t[r+2];t[r]=t[r+1]=t[r+2]=.2126*o+.7152*n+.0722*s}},V.opaque=function(e){for(var t=V._toPixels(e),r=0;r<t.length;r+=4)t[r+3]=255;return t},V.invert=function(e){for(var t=V._toPixels(e),r=0;r<t.length;r+=4)t[r]=255-t[r],t[r+1]=255-t[r+1],t[r+2]=255-t[r+2]},V.posterize=function(e,t){var r=V._toPixels(e);if(t<2||255<t)throw new Error("Level must be greater than 2 and less than 255 for posterize");for(var o=t-1,n=0;n<r.length;n+=4){var s=r[n],i=r[n+1],a=r[n+2];r[n]=255*(s*t>>8)/o,r[n+1]=255*(i*t>>8)/o,r[n+2]=255*(a*t>>8)/o}},V.dilate=function(e){for(var t,r,o,n,s,i,a,l,u,c=V._toPixels(e),d=0,f=c.length?c.length/4:0,h=new Int32Array(f);d<f;)for(r=(t=d)+e.width;d<r;)n=o=V._getARGB(c,d),(u=d-1)<t&&(u=d),r<=(l=d+1)&&(l=d),(s=d-e.width)<0&&(s=0),f<=(i=d+e.width)&&(i=d),s=V._getARGB(c,s),u=V._getARGB(c,u),i=V._getARGB(c,i),(n=77*(n>>16&255)+151*(n>>8&255)+28*(255&n))<(a=77*(u>>16&255)+151*(u>>8&255)+28*(255&u))&&(o=u,n=a),n<(a=77*((u=V._getARGB(c,l))>>16&255)+151*(u>>8&255)+28*(255&u))&&(o=u,n=a),n<(l=77*(s>>16&255)+151*(s>>8&255)+28*(255&s))&&(o=s,n=l),n<(u=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))&&(o=i,n=u),h[d++]=o;V._setPixels(c,h)},V.erode=function(e){for(var t,r,o,n,s,i,a,l,u,c=V._toPixels(e),d=0,f=c.length?c.length/4:0,h=new Int32Array(f);d<f;)for(r=(t=d)+e.width;d<r;)n=o=V._getARGB(c,d),(u=d-1)<t&&(u=d),r<=(l=d+1)&&(l=d),(s=d-e.width)<0&&(s=0),f<=(i=d+e.width)&&(i=d),s=V._getARGB(c,s),u=V._getARGB(c,u),i=V._getARGB(c,i),(a=77*(u>>16&255)+151*(u>>8&255)+28*(255&u))<(n=77*(n>>16&255)+151*(n>>8&255)+28*(255&n))&&(o=u,n=a),(a=77*((u=V._getARGB(c,l))>>16&255)+151*(u>>8&255)+28*(255&u))<n&&(o=u,n=a),(l=77*(s>>16&255)+151*(s>>8&255)+28*(255&s))<n&&(o=s,n=l),(u=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))<n&&(o=i,n=u),h[d++]=o;V._setPixels(c,h)},V.blur=function(e,t){o(e,t)},r.default=V},{"core-js/modules/es.array.iterator":158,"core-js/modules/es.object.to-string":177,"core-js/modules/es.typed-array.copy-within":197,"core-js/modules/es.typed-array.every":198,"core-js/modules/es.typed-array.fill":199,"core-js/modules/es.typed-array.filter":200,"core-js/modules/es.typed-array.find":202,"core-js/modules/es.typed-array.find-index":201,"core-js/modules/es.typed-array.for-each":205,"core-js/modules/es.typed-array.includes":206,"core-js/modules/es.typed-array.index-of":207,"core-js/modules/es.typed-array.int32-array":209,"core-js/modules/es.typed-array.iterator":210,"core-js/modules/es.typed-array.join":211,"core-js/modules/es.typed-array.last-index-of":212,"core-js/modules/es.typed-array.map":213,"core-js/modules/es.typed-array.reduce":215,"core-js/modules/es.typed-array.reduce-right":214,"core-js/modules/es.typed-array.reverse":216,"core-js/modules/es.typed-array.set":217,"core-js/modules/es.typed-array.slice":218,"core-js/modules/es.typed-array.some":219,"core-js/modules/es.typed-array.sort":220,"core-js/modules/es.typed-array.subarray":221,"core-js/modules/es.typed-array.to-locale-string":222,"core-js/modules/es.typed-array.to-string":223,"core-js/modules/es.typed-array.uint8-array":226}],289:[function(e,t,r){"use strict";e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.set"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.uint32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.set"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.uint32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var O=o(e("../core/main")),k=o(e("omggif"));function o(e){return e&&e.__esModule?e:{default:e}}function L(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}O.default.prototype.createImage=function(e,t){return O.default._validateParameters("createImage",arguments),new O.default.Image(e,t)},O.default.prototype.saveCanvas=function(){O.default._validateParameters("saveCanvas",arguments);var e,t,r,o,n=[].slice.call(arguments);switch(arguments[0]instanceof HTMLCanvasElement?(e=arguments[0],n.shift()):arguments[0]instanceof O.default.Element?(e=arguments[0].elt,n.shift()):e=this._curElement&&this._curElement.elt,1<=n.length&&(t=n[0]),r=(r=2<=n.length?n[1]:r)||O.default.prototype._checkFileExtension(t,r)[1]||"png"){default:o="image/png";break;case"jpeg":case"jpg":o="image/jpeg"}e.toBlob(function(e){O.default.prototype.downloadFile(e,t,r)},o)},O.default.prototype.encodeAndDownloadGif=function(h,e){for(var p=h.gifProperties,t=p.loopLimit,r=(1===t?t=null:null===t&&(t=0),new Uint8Array(h.width*h.height*p.numFrames)),m=[],o={},n=0;n<p.numFrames;n++){for(var s=new Set,i=p.frames[n].image.data,a=i.length,l=new Uint32Array(h.width*h.height),u=0,c=0;u<a;u+=4,c++){var d=i[u+0]<<16|i[u+1]<<8|i[u+2]<<0;s.add(d),l[c]=d}var f=L(s).sort().toString();void 0===o[f]?o[f]={freq:1,frames:[n]}:(o[f].freq+=1,o[f].frames.push(n)),m.push(l)}for(var y=[],g=Object.keys(o).sort(function(e,t){return o[t].freq-o[e].freq}),v=g[0].split(",").map(function(e){return parseInt(e)}),y=y.concat(o[v].frames),b=new Set(v),j=1;j<g.length;j++){var _=g[j].split(",").map(function(e){return parseInt(e)}).filter(function(e){return!b.has(e)});if(v.length+_.length<=256){for(var x=0;x<_.length;x++)v.push(_[x]),b.add(_[x]);y=y.concat(o[g[j]].frames)}}y=new Set(y);for(var w={},S=0;S<v.length;S++)w[v[S]]||(w[v[S]]=S);for(var M=1;M<v.length;)M<<=1;v.length=M;for(var t={loop:t,palette:new Uint32Array(v)},E=new k.default.GifWriter(r,h.width,h.height,t),T={},C=0;C<p.numFrames;C++)!function(e){for(var t=!y.has(e),r=t?[]:v,o=new Uint8Array(h.width*h.height),n={},s=new Set,i=0;i<m[e].length;i++){var a=m[e][i];t?(void 0===n[a]&&(n[a]=r.length,r.push(a)),o[i]=n[a]):o[i]=w[a],0<e&&m[e-1][i]!==a&&s.add(a)}var l={},u=r.filter(function(e){return!s.has(e)});if(0<u.length){var u=u[0],c=(t?n:w)[u];if(0<e){for(var d=0;d<m[e].length;d++)m[e-1][d]===m[e][d]&&(o[d]=c);l.transparent=c,T.frameOpts.disposal=1}}if(l.delay=p.frames[e].delay/10,t){for(var f=1;f<r.length;)f<<=1;r.length=f,l.palette=new Uint32Array(r)}0<e&&E.addFrame(0,0,h.width,h.height,T.pixelPaletteIndex,T.frameOpts),T={pixelPaletteIndex:o,frameOpts:l}}(C);T.frameOpts.disposal=1,E.addFrame(0,0,h.width,h.height,T.pixelPaletteIndex,T.frameOpts);t=new Blob([r.slice(0,E.end())],{type:"image/gif"});O.default.prototype.downloadFile(t,e,"gif")},O.default.prototype.saveFrames=function(e,t,r,o,i){O.default._validateParameters("saveFrames",arguments);r=O.default.prototype.constrain(r=r||3,0,15);r*=1e3;var o=O.default.prototype.constrain(o||15,0,22),n=0,s=O.default.prototype._makeFrame,a=this._curElement.elt,l=[],u=setInterval(function(){l.push(s(e+n,t,a)),n++},1e3/o);setTimeout(function(){if(clearInterval(u),i)i(l);else{var e=!0,t=!1,r=void 0;try{for(var o,n=l[Symbol.iterator]();!(e=(o=n.next()).done);e=!0){var s=o.value;O.default.prototype.downloadFile(s.imageData,s.filename,s.ext)}}catch(e){t=!0,r=e}finally{try{e||null==n.return||n.return()}finally{if(t)throw r}}}l=[]},.01+r)},O.default.prototype._makeFrame=function(e,t,r){var o,r=this?this._curElement.elt:r;if(t)switch(t.toLowerCase()){case"png":o="image/png";break;case"jpeg":case"jpg":o="image/jpeg";break;default:o="image/png"}else t="png",o="image/png";var r=(r=r.toDataURL(o)).replace(o,"image/octet-stream"),n={};return n.imageData=r,n.filename=e,n.ext=t,n};e=O.default;r.default=e},{"../core/main":267,"core-js/modules/es.array.concat":149,"core-js/modules/es.array.filter":153,"core-js/modules/es.array.from":155,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.map":161,"core-js/modules/es.array.slice":162,"core-js/modules/es.object.keys":176,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.set":183,"core-js/modules/es.string.iterator":186,"core-js/modules/es.string.replace":189,"core-js/modules/es.string.split":191,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.typed-array.copy-within":197,"core-js/modules/es.typed-array.every":198,"core-js/modules/es.typed-array.fill":199,"core-js/modules/es.typed-array.filter":200,"core-js/modules/es.typed-array.find":202,"core-js/modules/es.typed-array.find-index":201,"core-js/modules/es.typed-array.for-each":205,"core-js/modules/es.typed-array.includes":206,"core-js/modules/es.typed-array.index-of":207,"core-js/modules/es.typed-array.iterator":210,"core-js/modules/es.typed-array.join":211,"core-js/modules/es.typed-array.last-index-of":212,"core-js/modules/es.typed-array.map":213,"core-js/modules/es.typed-array.reduce":215,"core-js/modules/es.typed-array.reduce-right":214,"core-js/modules/es.typed-array.reverse":216,"core-js/modules/es.typed-array.set":217,"core-js/modules/es.typed-array.slice":218,"core-js/modules/es.typed-array.some":219,"core-js/modules/es.typed-array.sort":220,"core-js/modules/es.typed-array.subarray":221,"core-js/modules/es.typed-array.to-locale-string":222,"core-js/modules/es.typed-array.to-string":223,"core-js/modules/es.typed-array.uint32-array":225,"core-js/modules/es.typed-array.uint8-array":226,"core-js/modules/web.dom-collections.iterator":230,omggif:240}],290:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.copy-within"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.uint8-clamped-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.copy-within"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.uint8-clamped-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,e("regenerator-runtime/runtime");var T=n(e("../core/main")),m=n(e("../core/helpers")),j=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants")),g=n(e("omggif")),C=e("gifenc");function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}function n(e){return e&&e.__esModule?e:{default:e}}function l(e,t,r,o,n,s,i){try{var a=e[s](i),l=a.value}catch(e){return void r(e)}a.done?t(l):Promise.resolve(l).then(o,n)}function y(e,t,r,o,n,s,i,a,l,u,c){var d,f,h,p,m,y,g,v,b;return e===j.COVER&&(d=t,h=r,g=s,v=i,y=a,b=l,f=u,p=c,m=Math.max(g/f,v/p),g/=m,v/=m,m=y,y=b,d===j.CENTER?m+=(f-g)/2:d===j.RIGHT&&(m+=f-g),h===j.CENTER?y+=(p-v)/2:h===j.BOTTOM&&(y+=p-v),a=(b={x:m,y:y,w:g,h:v}).x,l=b.y,u=b.w,c=b.h),e===j.CONTAIN&&(d=t,f=r,h=o,p=n,m=s,y=i,g=u,v=c,b=Math.max(g/m,v/y),g/=b,v/=b,b=h,h=p,d===j.CENTER?b+=(m-g)/2:d===j.RIGHT&&(b+=m-g),f===j.CENTER?h+=(y-v)/2:f===j.BOTTOM&&(h+=y-v),o=(e={x:b,y:h,w:g,h:v}).x,n=e.y,s=e.w,i=e.h),{sx:a,sy:l,sw:u,sh:c,dx:o,dy:n,dw:s,dh:i}}function v(e,t){return 0<e&&e<t?e:t}e("../core/friendly_errors/validate_params"),e("../core/friendly_errors/file_errors"),e("../core/friendly_errors/fes_core"),T.default.prototype.loadImage=function(o,h,p){T.default._validateParameters("loadImage",arguments);var m=new T.default.Image(1,1,this),y=this,e=new Request(o,{method:"GET",mode:"cors"});return fetch(o,e).then(function(e){var t,r=e.headers.get("content-type");null===r&&console.warn("The image you loaded does not have a Content-Type header. If you are using the online editor consider reuploading the asset."),r&&r.includes("image/gif")?e.arrayBuffer().then(function(e){if(e){var e=new Uint8Array(e),r=m,t=h,o=p,n=function(e){y._decrementPreload()}.bind(y),s=new g.default.GifReader(e),i=(r.width=r.canvas.width=s.width,r.height=r.canvas.height=s.height,[]),a=s.numFrames(),l=new Uint8ClampedArray(r.width*r.height*4);if(1<a){for(var u=0;u<a;u++){var c=s.frameInfo(u),d=r.drawingContext.getImageData(0,0,r.width,r.height),f=(l=d.data.slice(),!function(e,t){try{t.decodeAndBlitFrameRGBA(e,l)}catch(e){T.default._friendlyFileLoadError(8,r.src),"function"==typeof o?o(e):console.error(e)}}(u,s),new ImageData(l,r.width,r.height)),f=(r.drawingContext.putImageData(f,0,0),c.delay);0===f&&(f=10),i.push({image:r.drawingContext.getImageData(0,0,r.width,r.height),delay:10*f}),2===c.disposal?r.drawingContext.clearRect(c.x,c.y,c.width,c.height):3===c.disposal&&r.drawingContext.putImageData(d,0,0,c.x,c.y,c.width,c.height)}e=s.loopCount();null===e?e=1:0===e&&(e=null),r.drawingContext.putImageData(i[0].image,0,0),r.gifProperties={displayIndex:0,loopLimit:e,loopCount:0,frames:i,numFrames:a,playing:!0,timeDisplayed:0,lastChangeTime:0}}"function"==typeof t&&t(r),n()}},function(e){"function"==typeof p?(p(e),y._decrementPreload()):console.error(e)}):((t=new Image).onload=function(){m.width=m.canvas.width=t.width,m.height=m.canvas.height=t.height,m.drawingContext.drawImage(t,0,0),m.modified=!0,"function"==typeof h&&h(m),y._decrementPreload()},t.onerror=function(e){T.default._friendlyFileLoadError(0,t.src),"function"==typeof p?(p(e),y._decrementPreload()):console.error(e)},0!==o.indexOf("data:image/")&&(t.crossOrigin="Anonymous"),t.src=o),m.modified=!0}).catch(function(e){T.default._friendlyFileLoadError(0,o),"function"==typeof p?(p(e),y._decrementPreload()):console.error(e)}),m},T.default.prototype.saveGif=function(){a=regeneratorRuntime.mark(function e(t,r){var o,n,s,i,a,l,u,c,d,f,h,p,m,y,g,v,b,j,_,x,w,S,M,E=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(o=2<E.length&&void 0!==E[2]?E[2]:{delay:0,units:"seconds"},"string"!=typeof t)throw TypeError("fileName parameter must be a string");e.next=3;break;case 3:if("number"!=typeof r)throw TypeError("Duration parameter must be a number");e.next=5;break;case 5:if(n=o&&o.delay||0,s=o&&o.units||"seconds","number"!=typeof n)throw TypeError("Delay parameter must be a number");e.next=9;break;case 9:if("seconds"!==s&&"frames"!==s)throw TypeError('Units parameter must be either "frames" or "seconds"');e.next=11;break;case 11:this._recording=!0,u=this._targetFrameRate,i=(i=1/(u=u!==1/0&&void 0!==u&&0!==u?u:60)*1e3)<20?20:i,l=(a="seconds"===s?r*u:r)+(u="seconds"===s?n*u:n),u=u,this.frameCount=u,c=this._pixelDensity,this.pixelDensity(1),d=[],f="p5.gif.progressBar",null!==document.getElementById(f)&&document.getElementById(f).remove(),(f=this.createP("")).id("progressBar"),f.style("font-size","16px"),f.style("font-family","Montserrat"),f.style("background-color","#ffffffa0"),f.style("padding","8px"),f.style("border-radius","10px"),f.position(0,0),this.drawingContext instanceof WebGLRenderingContext&&(p=document.getElementById("defaultCanvas0").getContext("webgl"),h=new Uint8Array(p.drawingBufferWidth*p.drawingBufferHeight*4)),this.noLoop();case 36:if(u<l)return this.redraw(),w=void 0,w=this.drawingContext instanceof WebGLRenderingContext?(h=new Uint8Array(p.drawingBufferWidth*p.drawingBufferHeight*4),p.readPixels(0,0,p.drawingBufferWidth,p.drawingBufferHeight,p.RGBA,p.UNSIGNED_BYTE,h),function(e){for(var t=parseInt(height/2),r=4*width,o=new Uint8Array(4*width),n=0;n<t;++n){var s=n*r,i=(height-n-1)*r;o.set(e.subarray(s,s+r)),e.copyWithin(s,i,i+r),e.set(o,i)}return e}(h)):this.drawingContext.getImageData(0,0,this.width,this.height).data,d.push(w),u++,f.html("Saved frame <b>"+d.length.toString()+"</b> out of "+a.toString()),e.next=45,new Promise(function(e){return setTimeout(e,0)});e.next=47;break;case 45:e.next=36;break;case 47:f.html("Frames processed, generating color palette..."),this.loop(),this.pixelDensity(c),m=(0,C.GIFEncoder)(),y=function(e){for(var t=new Uint8Array(e.length*e[0].length),r=0;r<e.length;r++)t.set(e[r],r*e[0].length);var o=(0,C.quantize)(t,256,{format:"rgba4444",oneBitAlpha:!0});256===o.length?o[o.length-1]=[255*Math.random(),255*Math.random(),255*Math.random(),0]:o.push([255*Math.random(),255*Math.random(),255*Math.random(),0]);return o}(d),g={},v=function(e){for(var t=e.length/4,r=new Uint8Array(t),o=0;o<t;o++){var n=e[4*o]<<24|e[4*o+1]<<16|e[4*o+2]<<8|e[4*o+3];void 0===g[n]&&(g[n]=(0,C.nearestColorIndex)(y,e.slice(4*o,4*(o+1)))),r[o]=g[n]}return r},b=y.length-1,j=[],_=0;case 57:if(!(_<d.length)){e.next=68;break}if(x=v(d[_]),w=x.slice(),0===_)m.writeFrame(x,this.width,this.height,{palette:y,delay:i,dispose:1});else{for(S=0;S<x.length;S++)x[S]===j[S]&&(x[S]=b);m.writeFrame(x,this.width,this.height,{delay:i,transparent:!0,transparentIndex:b,dispose:1})}return j=w,f.html("Rendered frame <b>"+_.toString()+"</b> out of "+a.toString()),e.next=65,new Promise(function(e){return setTimeout(e,0)});case 65:_++,e.next=57;break;case 68:m.finish(),M=m.bytesView(),M=new Blob([M],{type:"image/gif"}),d=[],this._recording=!1,this.loop(),f.html("Done. Downloading your gif!🌸"),T.default.prototype.downloadFile(M,t,"gif");case 77:case"end":return e.stop()}},e,this)});var a,r=function(){var e=this,i=arguments;return new Promise(function(t,r){var o=a.apply(e,i);function n(e){l(o,t,r,n,s,"next",e)}function s(e){l(o,t,r,n,s,"throw",e)}n(void 0)})};return function(e,t){return r.apply(this,arguments)}}(),T.default.prototype.image=function(e,t,r,o,n,s,i,a,l,u,c,d){T.default._validateParameters("image",arguments);var f=e.width,h=e.height,p=(d=d||j.CENTER,c=c||j.CENTER,e.elt&&e.elt.videoWidth&&!e.canvas&&(f=e.elt.videoWidth,h=e.elt.videoHeight),o||f),n=n||h,s=s||0,i=i||0,a=v(a||f,f),f=v(l||h,h),l=1;e.elt&&!e.canvas&&e.elt.style.width&&(l=e.elt.videoWidth&&!o?e.elt.videoWidth:e.elt.width,l/=parseInt(e.elt.style.width,10)),s*=l,i*=l,f*=l,a*=l;h=y(u,c,d,(h=m.default.modeAdjust(t,r,p,n,this._renderer._imageMode)).x,h.y,h.w,h.h,s,i,a,f);this._renderer.image(e,h.sx,h.sy,h.sw,h.sh,h.dx,h.dy,h.dw,h.dh)},T.default.prototype.tint=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];T.default._validateParameters("tint",t);var o=this.color.apply(this,t);this._renderer._tint=o.levels},T.default.prototype.noTint=function(){this._renderer._tint=null},T.default.prototype._getTintedImageCanvas=T.default.Renderer2D.prototype._getTintedImageCanvas,T.default.prototype.imageMode=function(e){T.default._validateParameters("imageMode",arguments),e!==j.CORNER&&e!==j.CORNERS&&e!==j.CENTER||(this._renderer._imageMode=e)};e=T.default;r.default=e},{"../core/constants":256,"../core/friendly_errors/fes_core":258,"../core/friendly_errors/file_errors":259,"../core/friendly_errors/validate_params":262,"../core/helpers":263,"../core/main":267,"core-js/modules/es.array.copy-within":150,"core-js/modules/es.array.includes":156,"core-js/modules/es.array.index-of":157,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.slice":162,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.promise":178,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.string.includes":185,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.typed-array.copy-within":197,"core-js/modules/es.typed-array.every":198,"core-js/modules/es.typed-array.fill":199,"core-js/modules/es.typed-array.filter":200,"core-js/modules/es.typed-array.find":202,"core-js/modules/es.typed-array.find-index":201,"core-js/modules/es.typed-array.for-each":205,"core-js/modules/es.typed-array.includes":206,"core-js/modules/es.typed-array.index-of":207,"core-js/modules/es.typed-array.iterator":210,"core-js/modules/es.typed-array.join":211,"core-js/modules/es.typed-array.last-index-of":212,"core-js/modules/es.typed-array.map":213,"core-js/modules/es.typed-array.reduce":215,"core-js/modules/es.typed-array.reduce-right":214,"core-js/modules/es.typed-array.reverse":216,"core-js/modules/es.typed-array.set":217,"core-js/modules/es.typed-array.slice":218,"core-js/modules/es.typed-array.some":219,"core-js/modules/es.typed-array.sort":220,"core-js/modules/es.typed-array.subarray":221,"core-js/modules/es.typed-array.to-locale-string":222,"core-js/modules/es.typed-array.to-string":223,"core-js/modules/es.typed-array.uint8-array":226,"core-js/modules/es.typed-array.uint8-clamped-array":227,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230,gifenc:237,omggif:240,"regenerator-runtime/runtime":244}],291:[function(e,t,r){"use strict";e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var s=n(e("../core/main")),o=n(e("./filters"));function n(e){return e&&e.__esModule?e:{default:e}}s.default.Image=function(e,t){this.width=e,this.height=t,this.canvas=document.createElement("canvas"),this.canvas.width=this.width,this.canvas.height=this.height,this.drawingContext=this.canvas.getContext("2d"),(this._pixelsState=this)._pixelDensity=1,this.gifProperties=null,this._modified=!1,this.pixels=[]},s.default.Image.prototype._animateGif=function(e){var t,r=this.gifProperties,e=e._lastFrameTime;0===r.lastChangeTime&&(r.lastChangeTime=e),r.playing&&(r.timeDisplayed=e-r.lastChangeTime,t=r.frames[r.displayIndex].delay,r.timeDisplayed>=t&&(t=Math.floor(r.timeDisplayed/t),r.timeDisplayed=0,r.lastChangeTime=e,r.displayIndex+=t,r.loopCount=Math.floor(r.displayIndex/r.numFrames),null!==r.loopLimit&&r.loopCount>=r.loopLimit?r.playing=!1:(e=r.displayIndex%r.numFrames,this.drawingContext.putImageData(r.frames[e].image,0,0),r.displayIndex=e,this.setModified(!0))))},s.default.Image.prototype._setProperty=function(e,t){this[e]=t,this.setModified(!0)},s.default.Image.prototype.loadPixels=function(){s.default.Renderer2D.prototype.loadPixels.call(this),this.setModified(!0)},s.default.Image.prototype.updatePixels=function(e,t,r,o){s.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,o),this.setModified(!0)},s.default.Image.prototype.get=function(e,t,r,o){return s.default._validateParameters("p5.Image.get",arguments),s.default.Renderer2D.prototype.get.apply(this,arguments)},s.default.Image.prototype._getPixel=s.default.Renderer2D.prototype._getPixel,s.default.Image.prototype.set=function(e,t,r){s.default.Renderer2D.prototype.set.call(this,e,t,r),this.setModified(!0)},s.default.Image.prototype.resize=function(e,t){0===e&&0===t?(e=this.canvas.width,t=this.canvas.height):0===e?e=this.canvas.width*t/this.canvas.height:0===t&&(t=this.canvas.height*e/this.canvas.width),e=Math.floor(e),t=Math.floor(t);var r=document.createElement("canvas");if(r.width=e,r.height=t,this.gifProperties)for(var o=this.gifProperties,n=0;n<o.numFrames;n++){for(var s=this.drawingContext.createImageData(e,t),i=(d=d=c=u=l=void 0,o.frames[n].image),a=s,l=0,u=0;u<a.height;u++)for(var c=0;c<a.width;c++){var d=Math.floor(c*i.width/a.width),d=4*(Math.floor(u*i.height/a.height)*i.width+d);a.data[l++]=i.data[d++],a.data[l++]=i.data[d++],a.data[l++]=i.data[d++],a.data[l++]=i.data[+d]}o.frames[n].image=s}r.getContext("2d").drawImage(this.canvas,0,0,this.canvas.width,this.canvas.height,0,0,r.width,r.height),this.canvas.width=this.width=e,this.canvas.height=this.height=t,this.drawingContext.drawImage(r,0,0,e,t,0,0,e,t),0<this.pixels.length&&this.loadPixels(),this.setModified(!0)},s.default.Image.prototype.copy=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];s.default.prototype.copy.apply(this,t)},s.default.Image.prototype.mask=function(e){var t=this.drawingContext.globalCompositeOperation,r=1,o=[e=void 0===e?this:e,0,0,(r=e instanceof s.default.Renderer?e._pInst._pixelDensity:r)*e.width,r*e.height,0,0,this.width,this.height];if(this.drawingContext.globalCompositeOperation="destination-in",this.gifProperties){for(var n=0;n<this.gifProperties.frames.length;n++)this.drawingContext.putImageData(this.gifProperties.frames[n].image,0,0),s.default.Image.prototype.copy.apply(this,o),this.gifProperties.frames[n].image=this.drawingContext.getImageData(0,0,this.width,this.height);this.drawingContext.putImageData(this.gifProperties.frames[this.gifProperties.displayIndex].image,0,0)}else s.default.Image.prototype.copy.apply(this,o);this.drawingContext.globalCompositeOperation=t,this.setModified(!0)},s.default.Image.prototype.filter=function(e,t){o.default.apply(this.canvas,o.default[e],t),this.setModified(!0)},s.default.Image.prototype.blend=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];s.default._validateParameters("p5.Image.blend",arguments),s.default.prototype.blend.apply(this,t),this.setModified(!0)},s.default.Image.prototype.setModified=function(e){this._modified=e},s.default.Image.prototype.isModified=function(){return this._modified},s.default.Image.prototype.save=function(e,t){this.gifProperties?s.default.prototype.encodeAndDownloadGif(this,e):s.default.prototype.saveCanvas(this.canvas,e,t)},s.default.Image.prototype.reset=function(){var e;this.gifProperties&&((e=this.gifProperties).playing=!0,e.timeSinceStart=0,e.timeDisplayed=0,e.lastChangeTime=0,e.loopCount=0,e.displayIndex=0,this.drawingContext.putImageData(e.frames[0].image,0,0))},s.default.Image.prototype.getCurrentFrame=function(){var e;if(this.gifProperties)return(e=this.gifProperties).displayIndex%e.numFrames},s.default.Image.prototype.setFrame=function(e){var t;this.gifProperties&&(e<(t=this.gifProperties).numFrames&&0<=e?(t.timeDisplayed=0,t.lastChangeTime=0,t.displayIndex=e,this.drawingContext.putImageData(t.frames[e].image,0,0)):console.log("Cannot set GIF to a frame number that is higher than total number of frames or below zero."))},s.default.Image.prototype.numFrames=function(){if(this.gifProperties)return this.gifProperties.numFrames},s.default.Image.prototype.play=function(){this.gifProperties&&(this.gifProperties.playing=!0)},s.default.Image.prototype.pause=function(){this.gifProperties&&(this.gifProperties.playing=!1)},s.default.Image.prototype.delay=function(e,t){if(this.gifProperties){var r=this.gifProperties;if(t<r.numFrames&&0<=t)r.frames[t].delay=e;else{var o=!0,t=!1,n=void 0;try{for(var s,i=r.frames[Symbol.iterator]();!(o=(s=i.next()).done);o=!0)s.value.delay=e}catch(e){t=!0,n=e}finally{try{o||null==i.return||i.return()}finally{if(t)throw n}}}}};e=s.default.Image;r.default=e},{"../core/main":267,"./filters":288,"core-js/modules/es.array.filter":153,"core-js/modules/es.array.iterator":158,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/web.dom-collections.iterator":230}],292:[function(e,t,r){"use strict";e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.filter"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var h=n(e("../core/main")),o=n(e("./filters"));function n(e){return e&&e.__esModule?e:{default:e}}e("../color/p5.Color"),h.default.prototype.pixels=[],h.default.prototype.blend=function(){for(var e,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];h.default._validateParameters("blend",r),this._renderer?(e=this._renderer).blend.apply(e,r):h.default.Renderer2D.prototype.blend.apply(this,r)},h.default.prototype.copy=function(){for(var e,t,r,o,n,s,i,a,l,u=arguments.length,c=new Array(u),d=0;d<u;d++)c[d]=arguments[d];if(h.default._validateParameters("copy",c),9===c.length)e=c[0],t=c[1],r=c[2],o=c[3],n=c[4],s=c[5],i=c[6],a=c[7],l=c[8];else{if(8!==c.length)throw new Error("Signature not supported");e=this,t=c[0],r=c[1],o=c[2],n=c[3],s=c[4],i=c[5],a=c[6],l=c[7]}h.default.prototype._copyHelper(this,e,t,r,o,n,s,i,a,l)},h.default.prototype._copyHelper=function(e,t,r,o,n,s,i,a,l,u){t.loadPixels();var c=t.canvas.width/t.width,d=0,f=0;t._renderer&&t._renderer.isP3D&&(d=t.width/2,f=t.height/2),e._renderer&&e._renderer.isP3D?h.default.RendererGL.prototype.image.call(e._renderer,t,r+d,o+f,n,s,i,a,l,u):e.drawingContext.drawImage(t.canvas,c*(r+d),c*(o+f),c*n,c*s,i,a,l,u)},h.default.prototype.filter=function(e,t){h.default._validateParameters("filter",arguments),void 0!==this.canvas?o.default.apply(this.canvas,o.default[e],t):o.default.apply(this.elt,o.default[e],t)},h.default.prototype.get=function(e,t,r,o){var n;return h.default._validateParameters("get",arguments),(n=this._renderer).get.apply(n,arguments)},h.default.prototype.loadPixels=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];h.default._validateParameters("loadPixels",t),this._renderer.loadPixels()},h.default.prototype.set=function(e,t,r){this._renderer.set(e,t,r)},h.default.prototype.updatePixels=function(e,t,r,o){h.default._validateParameters("updatePixels",arguments),0!==this.pixels.length&&this._renderer.updatePixels(e,t,r,o)};e=h.default;r.default=e},{"../color/p5.Color":254,"../core/main":267,"./filters":288,"core-js/modules/es.array.filter":153}],293:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.last-index-of"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.splice"),e("core-js/modules/es.function.name"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/web.url"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.last-index-of"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.splice"),e("core-js/modules/es.function.name"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/web.url"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var v=s(e("../core/main")),m=(e("whatwg-fetch"),e("es6-promise/auto"),s(e("fetch-jsonp"))),n=s(e("file-saver"));function s(e){return e&&e.__esModule?e:{default:e}}function y(e){return(y="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}function g(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function i(e,t){t&&!0!==t&&"true"!==t||(t="");var r="";return(e=e||"untitled")&&e.includes(".")&&(r=e.split(".").pop()),t&&r!==t&&(r=t,e="".concat(e,".").concat(r)),[e,r]}e("../core/friendly_errors/validate_params"),e("../core/friendly_errors/file_errors"),e("../core/friendly_errors/fes_core"),v.default.prototype.loadJSON=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];v.default._validateParameters("loadJSON",t);for(var o,n,s,i=t[0],a={},l="json",u=1;u<t.length;u++){var c=t[u];"string"==typeof c?"jsonp"!==c&&"json"!==c||(l=c):"function"==typeof c?o?n=c:o=c:"object"===y(c)&&(c.hasOwnProperty("jsonpCallback")||c.hasOwnProperty("jsonpCallbackFunction"))&&(l="jsonp",s=c)}var d=this;return this.httpDo(i,"GET",s,l,function(e){for(var t in e)a[t]=e[t];void 0!==o&&o(e),d._decrementPreload()},function(e){if(v.default._friendlyFileLoadError(5,i),!n)throw e;n(e)}),a},v.default.prototype.loadStrings=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];v.default._validateParameters("loadStrings",t);for(var n,o,s=[],i=1;i<t.length;i++){var a=t[i];"function"==typeof a&&(void 0===n?n=a:void 0===o&&(o=a))}var l=this;return v.default.prototype.httpDo.call(this,t[0],"GET","text",function(e){for(var t=e.replace(/\r\n/g,"\r").replace(/\n/g,"\r").split(/\r/),r=0,o=t.length;r<o;r+=32768)Array.prototype.push.apply(s,t.slice(r,Math.min(r+32768,o)));void 0!==n&&n(s),l._decrementPreload()},function(e){if(v.default._friendlyFileLoadError(3,e),!o)throw e;o(e)}),s},v.default.prototype.loadTable=function(t){var h,r,p,e=[],m=!1,o=t.substring(t.lastIndexOf(".")+1,t.length);"csv"===o?p=",":"ssv"===o?p=";":"tsv"===o&&(p="\t");for(var n=1;n<arguments.length;n++)"function"==typeof arguments[n]?void 0===h?h=arguments[n]:void 0===r&&(r=arguments[n]):"string"==typeof arguments[n]&&(e.push(arguments[n]),"header"===arguments[n]&&(m=!0),"csv"===arguments[n]?p=",":"ssv"===arguments[n]?p=";":"tsv"===arguments[n]&&(p="\t"));var y=new v.default.Table,g=this;return this.httpDo(t,"GET","table",function(e){for(var t,r,o={},n=0,s=[],i=0,a=null,l=function(){o.currentState=n,o.token=""},u=function(){a.push(o.token),l()},c=function(){o.currentState=4,s.push(a),a=null};;){if(null==(t=e[i++])){if(o.escaped)throw new Error("Unclosed quote in file.");if(a){u(),c();break}}if(null===a&&(o.escaped=!1,a=[],l()),o.currentState===n){if('"'===t){o.escaped=!0,o.currentState=1;continue}o.currentState=1}if(1===o.currentState&&o.escaped)if('"'===t)'"'===e[i]?(o.token+='"',i++):(o.escaped=!1,o.currentState=2);else{if("\r"===t)continue;o.token+=t}else"\r"===t?("\n"===e[i]&&i++,u(),c()):"\n"===t?(u(),c()):t===p?u():1===o.currentState&&(o.token+=t)}if(m)y.columns=s.shift();else for(var d=0;d<s[0].length;d++)y.columns[d]="null";for(var f=0;f<s.length;f++)(1!==s[f].length||"undefined"!==s[f][0]&&""!==s[f][0])&&((r=new v.default.TableRow).arr=s[f],r.obj=function(e,t){var r={};if(void 0===(t=t||[]))for(var o=0;o<e.length;o++)t[o.toString()]=o;for(var n=0;n<t.length;n++){var s=t[n],i=e[n];r[s]=i}return r}(s[f],y.columns),y.addRow(r));"function"==typeof h&&h(y),g._decrementPreload()},function(e){v.default._friendlyFileLoadError(2,t),r?r(e):console.error(e)}),y},v.default.prototype.loadXML=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var o,n,s=new v.default.XML,i=1;i<t.length;i++){var a=t[i];"function"==typeof a&&(void 0===o?o=a:void 0===n&&(n=a))}var l=this;return this.httpDo(t[0],"GET","xml",function(e){for(var t in e)s[t]=e[t];void 0!==o&&o(s),l._decrementPreload()},function(e){if(v.default._friendlyFileLoadError(1,e),!n)throw e;n(e)}),s},v.default.prototype.loadBytes=function(t,r,o){var n={},s=this;return this.httpDo(t,"GET","arrayBuffer",function(e){n.bytes=new Uint8Array(e),"function"==typeof r&&r(n),s._decrementPreload()},function(e){if(v.default._friendlyFileLoadError(6,t),!o)throw e;o(e)}),n},v.default.prototype.httpGet=function(){v.default._validateParameters("httpGet",arguments);var e=Array.prototype.slice.call(arguments);return e.splice(1,0,"GET"),v.default.prototype.httpDo.apply(this,e)},v.default.prototype.httpPost=function(){v.default._validateParameters("httpPost",arguments);var e=Array.prototype.slice.call(arguments);return e.splice(1,0,"POST"),v.default.prototype.httpDo.apply(this,e)},v.default.prototype.httpDo=function(){for(var r,e,t,o={},n=0,s="text/plain",i=arguments.length-1;0<i&&"function"==typeof(i<0||arguments.length<=i?void 0:arguments[i]);i--)n++;var a=arguments.length-n,l=arguments.length<=0?void 0:arguments[0];if(2==a&&"string"==typeof l&&"object"===y(arguments.length<=1?void 0:arguments[1]))p=new Request(l,arguments.length<=1?void 0:arguments[1]),e=arguments.length<=2?void 0:arguments[2],t=arguments.length<=3?void 0:arguments[3];else{for(var u,c="GET",d=1;d<arguments.length;d++){var f=d<0||arguments.length<=d?void 0:arguments[d];if("string"==typeof f)"GET"===f||"POST"===f||"PUT"===f||"DELETE"===f?c=f:"json"===f||"jsonp"===f||"binary"===f||"arrayBuffer"===f||"xml"===f||"text"===f||"table"===f?r=f:u=f;else if("number"==typeof f)u=f.toString();else if("object"===y(f))if(f.hasOwnProperty("jsonpCallback")||f.hasOwnProperty("jsonpCallbackFunction"))for(var h in f)o[h]=f[h];else s=f instanceof v.default.XML?(u=f.serialize(),"application/xml"):(u=JSON.stringify(f),"application/json");else"function"==typeof f&&(e?t=f:e=f)}var a="GET"===c?new Headers:new Headers({"Content-Type":s}),p=new Request(l,{method:c,mode:"cors",body:u,headers:a})}return(a=(a="jsonp"===(r=r||(l.includes("json")?"json":l.includes("xml")?"xml":"text"))?(0,m.default)(l,o):fetch(p)).then(function(e){if(!e.ok)throw(t=new Error(e.body)).status=e.status,t.ok=!1,t;var t=0;switch((t="jsonp"!==r?e.headers.get("content-length"):t)&&64e6<t&&v.default._friendlyFileLoadError(7,l),r){case"json":case"jsonp":return e.json();case"binary":return e.blob();case"arrayBuffer":return e.arrayBuffer();case"xml":return e.text().then(function(e){e=(new DOMParser).parseFromString(e,"text/xml");return new v.default.XML(e.documentElement)});default:return e.text()}})).then(e||function(){}),a.catch(t||console.error),a},window.URL=window.URL||window.webkitURL,v.default.prototype._pWriters=[],v.default.prototype.createWriter=function(e,t){var r,o;for(o in v.default.prototype._pWriters)if(v.default.prototype._pWriters[o].name===e)return r=new v.default.PrintWriter(e+this.millis(),t),v.default.prototype._pWriters.push(r),r;return r=new v.default.PrintWriter(e,t),v.default.prototype._pWriters.push(r),r},v.default.PrintWriter=function(r,o){var n=this;this.name=r,this.content="",this.write=function(e){this.content+=e},this.print=function(e){this.content+="".concat(e,"\n")},this.clear=function(){this.content=""},this.close=function(){var e,t=[];for(e in t.push(this.content),v.default.prototype.writeFile(t,r,o),v.default.prototype._pWriters)v.default.prototype._pWriters[e].name===this.name&&v.default.prototype._pWriters.splice(e,1);n.clear(),n={}}},v.default.prototype.save=function(e,t,r){var o=arguments,n=(this._curElement||this).elt;if(0===o.length)v.default.prototype.saveCanvas(n);else if(o[0]instanceof v.default.Renderer||o[0]instanceof v.default.Graphics)v.default.prototype.saveCanvas(o[0].elt,o[1],o[2]);else if(1===o.length&&"string"==typeof o[0])v.default.prototype.saveCanvas(n,o[0]);else switch(i(o[1],o[2])[1]){case"json":return void v.default.prototype.saveJSON(o[0],o[1],o[2]);case"txt":return void v.default.prototype.saveStrings(o[0],o[1],o[2]);default:o[0]instanceof Array?v.default.prototype.saveStrings(o[0],o[1],o[2]):o[0]instanceof v.default.Table?v.default.prototype.saveTable(o[0],o[1],o[2]):o[0]instanceof v.default.Image?v.default.prototype.saveCanvas(o[0].canvas,o[1]):o[0]instanceof v.default.SoundFile&&v.default.prototype.saveSound(o[0],o[1],o[2],o[3])}},v.default.prototype.saveJSON=function(e,t,r){v.default._validateParameters("saveJSON",arguments),r=r?JSON.stringify(e):JSON.stringify(e,void 0,2),this.saveStrings(r.split("\n"),t,"json")},v.default.prototype.saveJSONObject=v.default.prototype.saveJSON,v.default.prototype.saveJSONArray=v.default.prototype.saveJSON,v.default.prototype.saveStrings=function(e,t,r,o){v.default._validateParameters("saveStrings",arguments);for(var n=this.createWriter(t,r||"txt"),s=0;s<e.length;s++)o?n.write(e[s]+"\r\n"):n.write(e[s]+"\n");n.close(),n.clear()},v.default.prototype.saveTable=function(e,t,r){v.default._validateParameters("saveTable",arguments),o=void 0===r?t.substring(t.lastIndexOf(".")+1,t.length):r;var o,n=this.createWriter(t,o),s=e.columns,i="tsv"===o?"\t":",";if("html"!==o){if("0"!==s[0]){for(var a=0;a<s.length;a++)a<s.length-1?n.write(s[a]+i):n.write(s[a]);n.write("\n")}for(var l=0;l<e.rows.length;l++){for(var u=void 0,u=0;u<e.rows[l].arr.length;u++)u<e.rows[l].arr.length-1?"csv"===o&&String(e.rows[l].arr[u]).includes(",")?n.write('"'+e.rows[l].arr[u]+'"'+i):n.write(e.rows[l].arr[u]+i):"csv"===o&&String(e.rows[l].arr[u]).includes(",")?n.write('"'+e.rows[l].arr[u]+'"'):n.write(e.rows[l].arr[u]);n.write("\n")}}else{n.print("<html>"),n.print("<head>");if(n.print(' <meta http-equiv="content-type" content="text/html;charset=utf-8" />'),n.print("</head>"),n.print("<body>"),n.print(" <table>"),"0"!==s[0]){n.print(" <tr>");for(var c=0;c<s.length;c++){var d=g(s[c]);n.print(" <td>".concat(d)),n.print(" </td>")}n.print(" </tr>")}for(var f=0;f<e.rows.length;f++){n.print(" <tr>");for(var h=0;h<e.columns.length;h++){var p=g(e.rows[f].getString(h));n.print(" <td>".concat(p)),n.print(" </td>")}n.print(" </tr>")}n.print(" </table>"),n.print("</body>"),n.print("</html>")}n.close(),n.clear()},v.default.prototype.writeFile=function(e,t,r){var o="application/octet-stream",e=(v.default.prototype._isSafari()&&(o="text/plain"),new Blob(e,{type:o}));v.default.prototype.downloadFile(e,t,r)},v.default.prototype.downloadFile=function(e,t,r){var o,t=i(t,r),r=t[0];e instanceof Blob?n.default.saveAs(e,r):((o=document.createElement("a")).href=e,o.download=r,o.onclick=function(e){document.body.removeChild(e.target),e.stopPropagation()},o.style.display="none",document.body.appendChild(o),v.default.prototype._isSafari()&&(e=(e='Hello, Safari user! To download this file...\n1. Go to File --\x3e Save As.\n2. Choose "Page Source" as the Format.\n')+'3. Name it with this extension: ."'.concat(t[1],'"'),alert(e)),o.click())},v.default.prototype._checkFileExtension=i,v.default.prototype._isSafari=function(){return 0<Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")};e=v.default;r.default=e},{"../core/friendly_errors/fes_core":258,"../core/friendly_errors/file_errors":259,"../core/friendly_errors/validate_params":262,"../core/main":267,"core-js/modules/es.array.concat":149,"core-js/modules/es.array.includes":156,"core-js/modules/es.array.index-of":157,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.last-index-of":160,"core-js/modules/es.array.slice":162,"core-js/modules/es.array.splice":164,"core-js/modules/es.function.name":165,"core-js/modules/es.object.to-string":177,"core-js/modules/es.promise":178,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.string.includes":185,"core-js/modules/es.string.iterator":186,"core-js/modules/es.string.replace":189,"core-js/modules/es.string.split":191,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.typed-array.copy-within":197,"core-js/modules/es.typed-array.every":198,"core-js/modules/es.typed-array.fill":199,"core-js/modules/es.typed-array.filter":200,"core-js/modules/es.typed-array.find":202,"core-js/modules/es.typed-array.find-index":201,"core-js/modules/es.typed-array.for-each":205,"core-js/modules/es.typed-array.includes":206,"core-js/modules/es.typed-array.index-of":207,"core-js/modules/es.typed-array.iterator":210,"core-js/modules/es.typed-array.join":211,"core-js/modules/es.typed-array.last-index-of":212,"core-js/modules/es.typed-array.map":213,"core-js/modules/es.typed-array.reduce":215,"core-js/modules/es.typed-array.reduce-right":214,"core-js/modules/es.typed-array.reverse":216,"core-js/modules/es.typed-array.set":217,"core-js/modules/es.typed-array.slice":218,"core-js/modules/es.typed-array.some":219,"core-js/modules/es.typed-array.sort":220,"core-js/modules/es.typed-array.subarray":221,"core-js/modules/es.typed-array.to-locale-string":222,"core-js/modules/es.typed-array.to-string":223,"core-js/modules/es.typed-array.uint8-array":226,"core-js/modules/web.dom-collections.iterator":230,"core-js/modules/web.url":232,"es6-promise/auto":233,"fetch-jsonp":235,"file-saver":236,"whatwg-fetch":245}],294:[function(e,t,r){"use strict";e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.splice"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.trim"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.splice"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.trim"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(e=e("../core/main"))&&e.__esModule?e:{default:e};o.default.Table=function(e){this.columns=[],this.rows=[]},o.default.Table.prototype.addRow=function(e){e=e||new o.default.TableRow;if(void 0===e.arr||void 0===e.obj)throw new Error("invalid TableRow: ".concat(e));return(e.table=this).rows.push(e),e},o.default.Table.prototype.removeRow=function(e){this.rows[e].table=null;e=this.rows.splice(e+1,this.rows.length);this.rows.pop(),this.rows=this.rows.concat(e)},o.default.Table.prototype.getRow=function(e){return this.rows[e]},o.default.Table.prototype.getRows=function(){return this.rows},o.default.Table.prototype.findRow=function(e,t){if("string"==typeof t){for(var r=0;r<this.rows.length;r++)if(this.rows[r].obj[t]===e)return this.rows[r]}else for(var o=0;o<this.rows.length;o++)if(this.rows[o].arr[t]===e)return this.rows[o];return null},o.default.Table.prototype.findRows=function(e,t){var r=[];if("string"==typeof t)for(var o=0;o<this.rows.length;o++)this.rows[o].obj[t]===e&&r.push(this.rows[o]);else for(var n=0;n<this.rows.length;n++)this.rows[n].arr[t]===e&&r.push(this.rows[n]);return r},o.default.Table.prototype.matchRow=function(e,t){if("number"==typeof t){for(var r=0;r<this.rows.length;r++)if(this.rows[r].arr[t].match(e))return this.rows[r]}else for(var o=0;o<this.rows.length;o++)if(this.rows[o].obj[t].match(e))return this.rows[o];return null},o.default.Table.prototype.matchRows=function(e,t){var r=[];if("number"==typeof t)for(var o=0;o<this.rows.length;o++)this.rows[o].arr[t].match(e)&&r.push(this.rows[o]);else for(var n=0;n<this.rows.length;n++)this.rows[n].obj[t].match(e)&&r.push(this.rows[n]);return r},o.default.Table.prototype.getColumn=function(e){var t=[];if("string"==typeof e)for(var r=0;r<this.rows.length;r++)t.push(this.rows[r].obj[e]);else for(var o=0;o<this.rows.length;o++)t.push(this.rows[o].arr[e]);return t},o.default.Table.prototype.clearRows=function(){delete this.rows,this.rows=[]},o.default.Table.prototype.addColumn=function(e){this.columns.push(e||null)},o.default.Table.prototype.getColumnCount=function(){return this.columns.length},o.default.Table.prototype.getRowCount=function(){return this.rows.length},o.default.Table.prototype.removeTokens=function(e,t){for(var r=[],o=0;o<e.length;o++)r.push(e.charAt(o).replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"));var n=new RegExp(r.join("|"),"g");if(void 0===t)for(var s=0;s<this.columns.length;s++)for(var i=0;i<this.rows.length;i++){var a=(a=this.rows[i].arr[s]).replace(n,"");this.rows[i].arr[s]=a,this.rows[i].obj[this.columns[s]]=a}else if("string"==typeof t)for(var l=0;l<this.rows.length;l++){var u=(u=this.rows[l].obj[t]).replace(n,""),c=(this.rows[l].obj[t]=u,this.columns.indexOf(t));this.rows[l].arr[c]=u}else for(var d=0;d<this.rows.length;d++){var f=(f=this.rows[d].arr[t]).replace(n,"");this.rows[d].arr[t]=f,this.rows[d].obj[this.columns[t]]=f}},o.default.Table.prototype.trim=function(e){var t=new RegExp(" ","g");if(void 0===e)for(var r=0;r<this.columns.length;r++)for(var o=0;o<this.rows.length;o++){var n=(n=this.rows[o].arr[r]).replace(t,"");this.rows[o].arr[r]=n,this.rows[o].obj[this.columns[r]]=n}else if("string"==typeof e)for(var s=0;s<this.rows.length;s++){var i=(i=this.rows[s].obj[e]).replace(t,""),a=(this.rows[s].obj[e]=i,this.columns.indexOf(e));this.rows[s].arr[a]=i}else for(var l=0;l<this.rows.length;l++){var u=(u=this.rows[l].arr[e]).replace(t,"");this.rows[l].arr[e]=u,this.rows[l].obj[this.columns[e]]=u}},o.default.Table.prototype.removeColumn=function(e){"string"==typeof e?r=this.columns.indexOf(t=e):t=this.columns[r=e];var t,r,e=this.columns.splice(r+1,this.columns.length);this.columns.pop(),this.columns=this.columns.concat(e);for(var o=0;o<this.rows.length;o++){var n=this.rows[o].arr,s=n.splice(r+1,n.length);n.pop(),this.rows[o].arr=n.concat(s),delete this.rows[o].obj[t]}},o.default.Table.prototype.set=function(e,t,r){this.rows[e].set(t,r)},o.default.Table.prototype.setNum=function(e,t,r){this.rows[e].setNum(t,r)},o.default.Table.prototype.setString=function(e,t,r){this.rows[e].setString(t,r)},o.default.Table.prototype.get=function(e,t){return this.rows[e].get(t)},o.default.Table.prototype.getNum=function(e,t){return this.rows[e].getNum(t)},o.default.Table.prototype.getString=function(e,t){return this.rows[e].getString(t)},o.default.Table.prototype.getObject=function(e){for(var t,r={},o=0;o<this.rows.length;o++)if(t=this.rows[o].obj,"string"==typeof e){if(!(0<=this.columns.indexOf(e)))throw new Error('This table has no column named "'.concat(e,'"'));r[t[e]]=t}else r[o]=this.rows[o].obj;return r},o.default.Table.prototype.getArray=function(){for(var e=[],t=0;t<this.rows.length;t++)e.push(this.rows[t].arr);return e};e=o.default;r.default=e},{"../core/main":267,"core-js/modules/es.array.concat":149,"core-js/modules/es.array.index-of":157,"core-js/modules/es.array.join":159,"core-js/modules/es.array.splice":164,"core-js/modules/es.regexp.constructor":180,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.string.match":187,"core-js/modules/es.string.replace":189,"core-js/modules/es.string.trim":193}],295:[function(e,t,r){"use strict";e("core-js/modules/es.array.index-of"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.split"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.split"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;e=(e=e("../core/main"))&&e.__esModule?e:{default:e};e.default.TableRow=function(e,t){var r=[],o={};e&&(r=e.split(t=t||","));for(var n=0;n<r.length;n++){var s=n,i=r[n];o[s]=i}this.arr=r,this.obj=o,this.table=null},e.default.TableRow.prototype.set=function(e,t){if("string"==typeof e){var r=this.table.columns.indexOf(e);if(!(0<=r))throw new Error('This table has no column named "'.concat(e,'"'));this.obj[e]=t,this.arr[r]=t}else{if(!(e<this.table.columns.length))throw new Error("Column #".concat(e," is out of the range of this table"));this.arr[e]=t;r=this.table.columns[e];this.obj[r]=t}},e.default.TableRow.prototype.setNum=function(e,t){t=parseFloat(t);this.set(e,t)},e.default.TableRow.prototype.setString=function(e,t){t=t.toString();this.set(e,t)},e.default.TableRow.prototype.get=function(e){return("string"==typeof e?this.obj:this.arr)[e]},e.default.TableRow.prototype.getNum=function(e){var t="string"==typeof e?parseFloat(this.obj[e]):parseFloat(this.arr[e]);if("NaN"===t.toString())throw"Error: ".concat(this.obj[e]," is NaN (Not a Number)");return t},e.default.TableRow.prototype.getString=function(e){return("string"==typeof e?this.obj:this.arr)[e].toString()};e=e.default;r.default=e},{"../core/main":267,"core-js/modules/es.array.index-of":157,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.string.split":191}],296:[function(e,t,r){"use strict";e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.replace"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.replace"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var a=(e=e("../core/main"))&&e.__esModule?e:{default:e};function o(e){for(var t=[],r=0;r<e.length;r++)t.push(new a.default.XML(e[r]));return t}a.default.XML=function(e){e?this.DOM=e:(e=document.implementation.createDocument(null,"doc"),this.DOM=e.createElement("root"))},a.default.XML.prototype.getParent=function(){return new a.default.XML(this.DOM.parentElement)},a.default.XML.prototype.getName=function(){return this.DOM.tagName},a.default.XML.prototype.setName=function(e){var t=this.DOM.innerHTML,r=this.DOM.attributes,o=document.implementation.createDocument(null,"default").createElement(e);o.innerHTML=t;for(var n=0;n<r.length;n++)o.setAttribute(r[n].nodeName,r.nodeValue);this.DOM=o},a.default.XML.prototype.hasChildren=function(){return 0<this.DOM.children.length},a.default.XML.prototype.listChildren=function(){for(var e=[],t=0;t<this.DOM.childNodes.length;t++)e.push(this.DOM.childNodes[t].nodeName);return e},a.default.XML.prototype.getChildren=function(e){return o(e?this.DOM.getElementsByTagName(e):this.DOM.children)},a.default.XML.prototype.getChild=function(e){if("string"!=typeof e)return new a.default.XML(this.DOM.children[e]);var t=!0,r=!1,o=void 0;try{for(var n,s=this.DOM.children[Symbol.iterator]();!(t=(n=s.next()).done);t=!0){var i=n.value;if(i.tagName===e)return new a.default.XML(i)}}catch(e){r=!0,o=e}finally{try{t||null==s.return||s.return()}finally{if(r)throw o}}},a.default.XML.prototype.addChild=function(e){e instanceof a.default.XML&&this.DOM.appendChild(e.DOM)},a.default.XML.prototype.removeChild=function(e){var t=-1;if("string"==typeof e){for(var r=0;r<this.DOM.children.length;r++)if(this.DOM.children[r].tagName===e){t=r;break}}else t=e;-1!==t&&this.DOM.removeChild(this.DOM.children[t])},a.default.XML.prototype.getAttributeCount=function(){return this.DOM.attributes.length},a.default.XML.prototype.listAttributes=function(){var e=[],t=!0,r=!1,o=void 0;try{for(var n,s=this.DOM.attributes[Symbol.iterator]();!(t=(n=s.next()).done);t=!0){var i=n.value;e.push(i.nodeName)}}catch(e){r=!0,o=e}finally{try{t||null==s.return||s.return()}finally{if(r)throw o}}return e},a.default.XML.prototype.hasAttribute=function(e){var t={},r=!0,o=!1,n=void 0;try{for(var s,i=this.DOM.attributes[Symbol.iterator]();!(r=(s=i.next()).done);r=!0){var a=s.value;t[a.nodeName]=a.nodeValue}}catch(e){o=!0,n=e}finally{try{r||null==i.return||i.return()}finally{if(o)throw n}}return!!t[e]},a.default.XML.prototype.getNum=function(e,t){var r={},o=!0,n=!1,s=void 0;try{for(var i,a=this.DOM.attributes[Symbol.iterator]();!(o=(i=a.next()).done);o=!0){var l=i.value;r[l.nodeName]=l.nodeValue}}catch(e){n=!0,s=e}finally{try{o||null==a.return||a.return()}finally{if(n)throw s}}return Number(r[e])||t||0},a.default.XML.prototype.getString=function(e,t){var r={},o=!0,n=!1,s=void 0;try{for(var i,a=this.DOM.attributes[Symbol.iterator]();!(o=(i=a.next()).done);o=!0){var l=i.value;r[l.nodeName]=l.nodeValue}}catch(e){n=!0,s=e}finally{try{o||null==a.return||a.return()}finally{if(n)throw s}}return r[e]?String(r[e]):t||null},a.default.XML.prototype.setAttribute=function(e,t){this.DOM.setAttribute(e,t)},a.default.XML.prototype.getContent=function(e){var t=this.DOM.textContent;return(t=t.replace(/\s\s+/g,","))||e||null},a.default.XML.prototype.setContent=function(e){this.DOM.children.length||(this.DOM.textContent=e)},a.default.XML.prototype.serialize=function(){return(new XMLSerializer).serializeToString(this.DOM)};e=a.default;r.default=e},{"../core/main":267,"core-js/modules/es.array.iterator":158,"core-js/modules/es.number.constructor":169,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.string.iterator":186,"core-js/modules/es.string.replace":189,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/web.dom-collections.iterator":230}],297:[function(e,t,r){"use strict";e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.math.hypot"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.math.hypot"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.string.includes"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=(e=e("../core/main"))&&e.__esModule?e:{default:e};function o(){if("function"==typeof Math.hypot)return Math.hypot.apply(null,arguments);for(var e=arguments.length,t=[],r=0,o=0;o<e;o++){var n=arguments[o];if((n=+n)===1/0||n===-1/0)return 1/0;r<(n=Math.abs(n))&&(r=n),t[o]=n}0===r&&(r=1);for(var s=0,i=0,a=0;a<e;a++)var l=t[a]/r,l=l*l-i,u=s+l,i=u-s-l,s=u;return Math.sqrt(s)*r}i.default.prototype.abs=Math.abs,i.default.prototype.ceil=Math.ceil,i.default.prototype.constrain=function(e,t,r){return i.default._validateParameters("constrain",arguments),Math.max(Math.min(e,r),t)},i.default.prototype.dist=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return i.default._validateParameters("dist",t),4===t.length?o(t[2]-t[0],t[3]-t[1]):6===t.length?o(t[3]-t[0],t[4]-t[1],t[5]-t[2]):void 0},i.default.prototype.exp=Math.exp,i.default.prototype.floor=Math.floor,i.default.prototype.lerp=function(e,t,r){return i.default._validateParameters("lerp",arguments),r*(t-e)+e},i.default.prototype.log=Math.log,i.default.prototype.mag=function(e,t){return i.default._validateParameters("mag",arguments),o(e,t)},i.default.prototype.map=function(e,t,r,o,n,s){i.default._validateParameters("map",arguments);e=(e-t)/(r-t)*(n-o)+o;return s?o<n?this.constrain(e,o,n):this.constrain(e,n,o):e},i.default.prototype.max=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t[0]instanceof Array?Math.max.apply(null,t[0]):Math.max.apply(null,t)},i.default.prototype.min=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t[0]instanceof Array?Math.min.apply(null,t[0]):Math.min.apply(null,t)},i.default.prototype.norm=function(e,t,r){return i.default._validateParameters("norm",arguments),this.map(e,t,r,0,1)},i.default.prototype.pow=Math.pow,i.default.prototype.round=function(e,t){return t?(t=Math.pow(10,t),Math.round(e*t)/t):Math.round(e)},i.default.prototype.sq=function(e){return e*e},i.default.prototype.sqrt=Math.sqrt,i.default.prototype.fract=function(e){i.default._validateParameters("fract",arguments);var t,r=0,e=Number(e);return isNaN(e)||Math.abs(e)===1/0?e:(e<0&&(e=-e,r=1),String(e).includes(".")&&!String(e).includes("e")?(t=String(e),t=Number("0"+t.slice(t.indexOf("."))),Math.abs(r-t)):e<1?Math.abs(r-e):0)};e=i.default;r.default=e},{"../core/main":267,"core-js/modules/es.array.includes":156,"core-js/modules/es.array.index-of":157,"core-js/modules/es.array.map":161,"core-js/modules/es.array.slice":162,"core-js/modules/es.math.hypot":167,"core-js/modules/es.number.constructor":169,"core-js/modules/es.string.includes":185}],298:[function(e,t,r){"use strict";e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.reflect.construct"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.reflect.construct"),e("core-js/modules/es.regexp.to-string"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(e=e("../core/main"))&&e.__esModule?e:{default:e};function n(e,t,r){return(n=function(){if("undefined"!=typeof Reflect&&Reflect.construct&&!Reflect.construct.sham){if("function"==typeof Proxy)return 1;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),1}catch(e){}}}()?Reflect.construct:function(e,t,r){var o=[null];o.push.apply(o,t);t=new(Function.bind.apply(e,o));return r&&s(t,r.prototype),t}).apply(null,arguments)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}o.default.prototype.createVector=function(e,t,r){return this instanceof o.default?n(o.default.Vector,[this._fromRadians.bind(this),this._toRadians.bind(this)].concat(Array.prototype.slice.call(arguments))):new o.default.Vector(e,t,r)};e=o.default;r.default=e},{"../core/main":267,"core-js/modules/es.array.concat":149,"core-js/modules/es.array.slice":162,"core-js/modules/es.object.to-string":177,"core-js/modules/es.reflect.construct":179,"core-js/modules/es.regexp.to-string":182}],299:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;e=(e=e("../core/main"))&&e.__esModule?e:{default:e};function b(e){return.5*(1-Math.cos(e*Math.PI))}var j,_=4095,x=4,w=.5,e=(e.default.prototype.noise=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0;if(null==j){j=new Array(4096);for(var o=0;o<4096;o++)j[o]=Math.random()}e<0&&(e=-e),t<0&&(t=-t),r<0&&(r=-r);for(var n,s,i=Math.floor(e),a=Math.floor(t),l=Math.floor(r),u=e-i,c=t-a,d=r-l,f=0,h=.5,p=0;p<x;p++){var m=i+(a<<4)+(l<<8),y=b(u),g=b(c),v=j[m&_];v+=y*(j[m+1&_]-v),n=j[m+16&_],v+=g*((n+=y*(j[m+16+1&_]-n))-v),n=j[(m+=256)&_],n+=y*(j[m+1&_]-n),s=j[m+16&_],n+=g*((s+=y*(j[m+16+1&_]-s))-n),f+=(v+=b(d)*(n-v))*h,h*=w,i<<=1,a<<=1,l<<=1,1<=(u*=2)&&(i++,u--),1<=(c*=2)&&(a++,c--),1<=(d*=2)&&(l++,d--)}return f},e.default.prototype.noiseDetail=function(e,t){0<e&&(x=e),0<t&&(w=t)},e.default.prototype.noiseSeed=function(e){o=4294967296;var t,r,o,n={setSeed:function(e){r=t=(null==e?Math.random()*o:e)>>>0},getSeed:function(){return t},rand:function(){return(r=(1664525*r+1013904223)%o)/o}};n.setSeed(e),j=new Array(4096);for(var s=0;s<4096;s++)j[s]=n.rand()},e.default);r.default=e},{"../core/main":267}],300:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.every"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.some"),e("core-js/modules/es.math.sign"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.number.is-finite"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.sub"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.every"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.some"),e("core-js/modules/es.math.sign"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.number.is-finite"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.sub"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var a=(s=e("../core/main"))&&s.__esModule?s:{default:s},n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants"));function l(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,l=function(){return e},e)}a.default.Vector=function(){var e,t,r="[object Function]"==={}.toString.call(arguments[0])?(this.isPInst=!0,this._fromRadians=arguments[0],this._toRadians=arguments[1],e=arguments[2]||0,t=arguments[3]||0,arguments[4]||0):(e=arguments[0]||0,t=arguments[1]||0,arguments[2]||0);this.x=e,this.y=t,this.z=r},a.default.Vector.prototype.toString=function(){return"p5.Vector Object : [".concat(this.x,", ").concat(this.y,", ").concat(this.z,"]")},a.default.Vector.prototype.set=function(e,t,r){return e instanceof a.default.Vector?(this.x=e.x||0,this.y=e.y||0,this.z=e.z||0):e instanceof Array?(this.x=e[0]||0,this.y=e[1]||0,this.z=e[2]||0):(this.x=e||0,this.y=t||0,this.z=r||0),this},a.default.Vector.prototype.copy=function(){return this.isPInst?new a.default.Vector(this._fromRadians,this._toRadians,this.x,this.y,this.z):new a.default.Vector(this.x,this.y,this.z)},a.default.Vector.prototype.add=function(e,t,r){return e instanceof a.default.Vector?(this.x+=e.x||0,this.y+=e.y||0,this.z+=e.z||0):e instanceof Array?(this.x+=e[0]||0,this.y+=e[1]||0,this.z+=e[2]||0):(this.x+=e||0,this.y+=t||0,this.z+=r||0),this};function u(e,t){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),this}function c(e,t,r){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),0!==r&&(this.z=this.z%r),this}a.default.Vector.prototype.rem=function(e,t,r){var o;if(e instanceof a.default.Vector){if(Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z))return n=parseFloat(e.x),s=parseFloat(e.y),o=parseFloat(e.z),c.call(this,n,s,o)}else if(e instanceof Array){if(e.every(function(e){return Number.isFinite(e)}))return 2===e.length?u.call(this,e[0],e[1]):3===e.length?c.call(this,e[0],e[1],e[2]):void 0}else if(1===arguments.length){if(Number.isFinite(e)&&0!==e)return this.x=this.x%e,this.y=this.y%e,this.z=this.z%e,this}else if(2===arguments.length){var n=Array.prototype.slice.call(arguments);if(n.every(function(e){return Number.isFinite(e)})&&2===n.length)return u.call(this,n[0],n[1])}else if(3===arguments.length){var s=Array.prototype.slice.call(arguments);if(s.every(function(e){return Number.isFinite(e)})&&3===s.length)return c.call(this,s[0],s[1],s[2])}},a.default.Vector.prototype.sub=function(e,t,r){return e instanceof a.default.Vector?(this.x-=e.x||0,this.y-=e.y||0,this.z-=e.z||0):e instanceof Array?(this.x-=e[0]||0,this.y-=e[1]||0,this.z-=e[2]||0):(this.x-=e||0,this.y-=t||0,this.z-=r||0),this},a.default.Vector.prototype.mult=function(e,t,r){var o;return e instanceof a.default.Vector?Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)&&"number"==typeof e.x&&"number"==typeof e.y&&"number"==typeof e.z?(this.x*=e.x,this.y*=e.y,this.z*=e.z):console.warn("p5.Vector.prototype.mult:","x contains components that are either undefined or not finite numbers"):e instanceof Array?e.every(function(e){return Number.isFinite(e)})&&e.every(function(e){return"number"==typeof e})?1===e.length?(this.x*=e[0],this.y*=e[0],this.z*=e[0]):2===e.length?(this.x*=e[0],this.y*=e[1]):3===e.length&&(this.x*=e[0],this.y*=e[1],this.z*=e[2]):console.warn("p5.Vector.prototype.mult:","x contains elements that are either undefined or not finite numbers"):(o=Array.prototype.slice.call(arguments)).every(function(e){return Number.isFinite(e)})&&o.every(function(e){return"number"==typeof e})?(1===arguments.length&&(this.x*=e,this.y*=e,this.z*=e),2===arguments.length&&(this.x*=e,this.y*=t),3===arguments.length&&(this.x*=e,this.y*=t,this.z*=r)):console.warn("p5.Vector.prototype.mult:","x, y, or z arguments are either undefined or not a finite number"),this},a.default.Vector.prototype.div=function(e,t,r){if(e instanceof a.default.Vector)if(Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)&&"number"==typeof e.x&&"number"==typeof e.y&&"number"==typeof e.z){var o=0===e.z&&0===this.z;if(0===e.x||0===e.y||!o&&0===e.z)return console.warn("p5.Vector.prototype.div:","divide by 0"),this;this.x/=e.x,this.y/=e.y,o||(this.z/=e.z)}else console.warn("p5.Vector.prototype.div:","x contains components that are either undefined or not finite numbers");else if(e instanceof Array)if(e.every(function(e){return Number.isFinite(e)})&&e.every(function(e){return"number"==typeof e})){if(e.some(function(e){return 0===e}))return console.warn("p5.Vector.prototype.div:","divide by 0"),this;1===e.length?(this.x/=e[0],this.y/=e[0],this.z/=e[0]):2===e.length?(this.x/=e[0],this.y/=e[1]):3===e.length&&(this.x/=e[0],this.y/=e[1],this.z/=e[2])}else console.warn("p5.Vector.prototype.div:","x contains components that are either undefined or not finite numbers");else{o=Array.prototype.slice.call(arguments);if(o.every(function(e){return Number.isFinite(e)})&&o.every(function(e){return"number"==typeof e})){if(o.some(function(e){return 0===e}))return console.warn("p5.Vector.prototype.div:","divide by 0"),this;1===arguments.length&&(this.x/=e,this.y/=e,this.z/=e),2===arguments.length&&(this.x/=e,this.y/=t),3===arguments.length&&(this.x/=e,this.y/=t,this.z/=r)}else console.warn("p5.Vector.prototype.div:","x, y, or z arguments are either undefined or not a finite number")}return this},a.default.Vector.prototype.mag=function(){return Math.sqrt(this.magSq())},a.default.Vector.prototype.magSq=function(){var e=this.x,t=this.y,r=this.z;return e*e+t*t+r*r},a.default.Vector.prototype.dot=function(e,t,r){return e instanceof a.default.Vector?this.dot(e.x,e.y,e.z):this.x*(e||0)+this.y*(t||0)+this.z*(r||0)},a.default.Vector.prototype.cross=function(e){var t=this.y*e.z-this.z*e.y,r=this.z*e.x-this.x*e.z,e=this.x*e.y-this.y*e.x;return this.isPInst?new a.default.Vector(this._fromRadians,this._toRadians,t,r,e):new a.default.Vector(t,r,e)},a.default.Vector.prototype.dist=function(e){return e.copy().sub(this).mag()},a.default.Vector.prototype.normalize=function(){var e=this.mag();return 0!==e&&this.mult(1/e),this},a.default.Vector.prototype.limit=function(e){var t=this.magSq();return e*e<t&&this.div(Math.sqrt(t)).mult(e),this},a.default.Vector.prototype.setMag=function(e){return this.normalize().mult(e)},a.default.Vector.prototype.heading=function(){var e=Math.atan2(this.y,this.x);return this.isPInst?this._fromRadians(e):e},a.default.Vector.prototype.setHeading=function(e){this.isPInst&&(e=this._toRadians(e));var t=this.mag();return this.x=t*Math.cos(e),this.y=t*Math.sin(e),this},a.default.Vector.prototype.rotate=function(e){var e=this.heading()+e,t=(this.isPInst&&(e=this._toRadians(e)),this.mag());return this.x=Math.cos(e)*t,this.y=Math.sin(e)*t,this},a.default.Vector.prototype.angleBetween=function(e){var t=this.dot(e)/(this.mag()*e.mag()),t=Math.acos(Math.min(1,Math.max(-1,t)));return t*=Math.sign(this.cross(e).z||1),t=this.isPInst?this._fromRadians(t):t},a.default.Vector.prototype.lerp=function(e,t,r,o){return e instanceof a.default.Vector?this.lerp(e.x,e.y,e.z,t):(this.x+=(e-this.x)*o||0,this.y+=(t-this.y)*o||0,this.z+=(r-this.z)*o||0,this)},a.default.Vector.prototype.reflect=function(e){return e.normalize(),this.sub(e.mult(2*this.dot(e)))},a.default.Vector.prototype.array=function(){return[this.x||0,this.y||0,this.z||0]},a.default.Vector.prototype.equals=function(e,t,r){var o,n,e=e instanceof a.default.Vector?(o=e.x||0,n=e.y||0,e.z||0):e instanceof Array?(o=e[0]||0,n=e[1]||0,e[2]||0):(o=e||0,n=t||0,r||0);return this.x===o&&this.y===n&&this.z===e},a.default.Vector.fromAngle=function(e,t){return new a.default.Vector((t=void 0===t?1:t)*Math.cos(e),t*Math.sin(e),0)},a.default.Vector.fromAngles=function(e,t,r){void 0===r&&(r=1);var o=Math.cos(t),t=Math.sin(t),n=Math.cos(e),e=Math.sin(e);return new a.default.Vector(r*e*t,-r*n,r*e*o)},a.default.Vector.random2D=function(){return this.fromAngle(Math.random()*n.TWO_PI)},a.default.Vector.random3D=function(){var e=Math.random()*n.TWO_PI,t=2*Math.random()-1,r=Math.sqrt(1-t*t),o=r*Math.cos(e),r=r*Math.sin(e);return new a.default.Vector(o,r,t)},a.default.Vector.copy=function(e){return e.copy(e)},a.default.Vector.add=function(e,t,r){return r?r.set(e):(r=e.copy(),3===arguments.length&&a.default._friendlyError("The target parameter is undefined, it should be of type p5.Vector","p5.Vector.add")),r.add(t),r},a.default.Vector.rem=function(e,t){if(e instanceof a.default.Vector&&t instanceof a.default.Vector)return(e=e.copy()).rem(t),e},a.default.Vector.sub=function(e,t,r){return r?r.set(e):(r=e.copy(),3===arguments.length&&a.default._friendlyError("The target parameter is undefined, it should be of type p5.Vector","p5.Vector.sub")),r.sub(t),r},a.default.Vector.mult=function(e,t,r){return r?r.set(e):(r=e.copy(),3===arguments.length&&a.default._friendlyError("The target parameter is undefined, it should be of type p5.Vector","p5.Vector.mult")),r.mult(t),r},a.default.Vector.rotate=function(e,t,r){return 2===arguments.length?r=e.copy():(r instanceof a.default.Vector||a.default._friendlyError("The target parameter should be of type p5.Vector","p5.Vector.rotate"),r.set(e)),r.rotate(t),r},a.default.Vector.div=function(e,t,r){return r?r.set(e):(r=e.copy(),3===arguments.length&&a.default._friendlyError("The target parameter is undefined, it should be of type p5.Vector","p5.Vector.div")),r.div(t),r},a.default.Vector.dot=function(e,t){return e.dot(t)},a.default.Vector.cross=function(e,t){return e.cross(t)},a.default.Vector.dist=function(e,t){return e.dist(t)},a.default.Vector.lerp=function(e,t,r,o){return o?o.set(e):(o=e.copy(),4===arguments.length&&a.default._friendlyError("The target parameter is undefined, it should be of type p5.Vector","p5.Vector.lerp")),o.lerp(t,r),o},a.default.Vector.mag=function(e){return e.mag()},a.default.Vector.magSq=function(e){return e.magSq()},a.default.Vector.normalize=function(e,t){return arguments.length<2?t=e.copy():(t instanceof a.default.Vector||a.default._friendlyError("The target parameter should be of type p5.Vector","p5.Vector.normalize"),t.set(e)),t.normalize()},a.default.Vector.limit=function(e,t,r){return arguments.length<3?r=e.copy():(r instanceof a.default.Vector||a.default._friendlyError("The target parameter should be of type p5.Vector","p5.Vector.limit"),r.set(e)),r.limit(t)},a.default.Vector.setMag=function(e,t,r){return arguments.length<3?r=e.copy():(r instanceof a.default.Vector||a.default._friendlyError("The target parameter should be of type p5.Vector","p5.Vector.setMag"),r.set(e)),r.setMag(t)},a.default.Vector.heading=function(e){return e.heading()},a.default.Vector.angleBetween=function(e,t){return e.angleBetween(t)},a.default.Vector.reflect=function(e,t,r){return arguments.length<3?r=e.copy():(r instanceof a.default.Vector||a.default._friendlyError("The target parameter should be of type p5.Vector","p5.Vector.reflect"),r.set(e)),r.reflect(t)},a.default.Vector.array=function(e){return e.array()},a.default.Vector.equals=function(e,t){var r;return e instanceof a.default.Vector?r=e:e instanceof Array?r=(new a.default.Vector).set(e):a.default._friendlyError("The v1 parameter should be of type Array or p5.Vector","p5.Vector.equals"),r.equals(t)};var s=a.default.Vector;r.default=s},{"../core/constants":256,"../core/main":267,"core-js/modules/es.array.concat":149,"core-js/modules/es.array.every":151,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.slice":162,"core-js/modules/es.array.some":163,"core-js/modules/es.math.sign":168,"core-js/modules/es.number.constructor":169,"core-js/modules/es.number.is-finite":170,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.string.iterator":186,"core-js/modules/es.string.sub":192,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],301:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(e=e("../core/main"))&&e.__esModule?e:{default:e};var s="_lcg_random_state",o=4294967296,i=0,e=(n.default.prototype._lcg=function(e){return this[e]=(1664525*this[e]+1013904223)%o,this[e]/o},n.default.prototype._lcgSetSeed=function(e,t){this[e]=(null==t?Math.random()*o:t)>>>0},n.default.prototype.randomSeed=function(e){this._lcgSetSeed(s,e),this._gaussian_previous=!1},n.default.prototype.random=function(e,t){var r,o;return n.default._validateParameters("random",arguments),r=null!=this[s]?this._lcg(s):Math.random(),void 0===e?r:void 0===t?e instanceof Array?e[Math.floor(r*e.length)]:r*e:(t<e&&(o=e,e=t,t=o),r*(t-e)+e)},n.default.prototype.randomGaussian=function(e){var t,r,o,n,s=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1;if(this._gaussian_previous)t=i,this._gaussian_previous=!1;else{for(;1<=(n=(r=this.random(2)-1)*r+(o=this.random(2)-1)*o););t=r*(n=Math.sqrt(-2*Math.log(n)/n)),i=o*n,this._gaussian_previous=!0}return t*s+(e||0)},n.default);r.default=e},{"../core/main":267}],302:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(l=e("../core/main"))&&l.__esModule?l:{default:l},s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}n.default.prototype._angleMode=s.RADIANS,n.default.prototype.acos=function(e){return this._fromRadians(Math.acos(e))},n.default.prototype.asin=function(e){return this._fromRadians(Math.asin(e))},n.default.prototype.atan=function(e){return this._fromRadians(Math.atan(e))},n.default.prototype.atan2=function(e,t){return this._fromRadians(Math.atan2(e,t))},n.default.prototype.cos=function(e){return Math.cos(this._toRadians(e))},n.default.prototype.sin=function(e){return Math.sin(this._toRadians(e))},n.default.prototype.tan=function(e){return Math.tan(this._toRadians(e))},n.default.prototype.degrees=function(e){return e*s.RAD_TO_DEG},n.default.prototype.radians=function(e){return e*s.DEG_TO_RAD},n.default.prototype.angleMode=function(e){if(n.default._validateParameters("angleMode",arguments),void 0===e)return this._angleMode;e!==s.DEGREES&&e!==s.RADIANS||(this._angleMode=e)},n.default.prototype._toRadians=function(e){return this._angleMode===s.DEGREES?e*s.DEG_TO_RAD:e},n.default.prototype._toDegrees=function(e){return this._angleMode===s.RADIANS?e*s.RAD_TO_DEG:e},n.default.prototype._fromRadians=function(e){return this._angleMode===s.DEGREES?e*s.RAD_TO_DEG:e};var l=n.default;r.default=l},{"../core/constants":256,"../core/main":267,"core-js/modules/es.array.iterator":158,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],303:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(e=e("../core/main"))&&e.__esModule?e:{default:e};n.default.prototype.textAlign=function(e,t){var r;return n.default._validateParameters("textAlign",arguments),(r=this._renderer).textAlign.apply(r,arguments)},n.default.prototype.textLeading=function(e){var t;return n.default._validateParameters("textLeading",arguments),(t=this._renderer).textLeading.apply(t,arguments)},n.default.prototype.textSize=function(e){var t;return n.default._validateParameters("textSize",arguments),(t=this._renderer).textSize.apply(t,arguments)},n.default.prototype.textStyle=function(e){var t;return n.default._validateParameters("textStyle",arguments),(t=this._renderer).textStyle.apply(t,arguments)},n.default.prototype.textWidth=function(){for(var e,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return r[0]+="",n.default._validateParameters("textWidth",r),0===r[0].length?0:(e=this._renderer).textWidth.apply(e,r)},n.default.prototype.textAscent=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.default._validateParameters("textAscent",t),this._renderer.textAscent()},n.default.prototype.textDescent=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.default._validateParameters("textDescent",t),this._renderer.textDescent()},n.default.prototype._updateTextMetrics=function(){return this._renderer._updateTextMetrics()},n.default.prototype.textWrap=function(e){if("WORD"!==e&&"CHAR"!==e)throw"Error: textWrap accepts only WORD or CHAR";return this._renderer.textWrap(e)};e=n.default;r.default=e},{"../core/main":267}],304:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.last-index-of"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.last-index-of"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.split"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var l=(c=e("../core/main"))&&c.__esModule?c:{default:c},n=s(e("../core/constants")),u=s(e("opentype.js"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}function s(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o,n={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e)Object.prototype.hasOwnProperty.call(e,r)&&((o=s?Object.getOwnPropertyDescriptor(e,r):null)&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]);return n.default=e,t&&t.set(e,n),n}e("../core/friendly_errors/validate_params"),e("../core/friendly_errors/file_errors"),e("../core/friendly_errors/fes_core"),l.default.prototype.loadFont=function(o,n,s){l.default._validateParameters("loadFont",arguments);var i=new l.default.Font(this),a=this;return u.load(o,function(e,t){if(e)return l.default._friendlyFileLoadError(4,o),void 0!==s?s(e):void console.error(e,o);i.font=t,void 0!==n&&n(i),a._decrementPreload();var e=o.split("\\").pop().split("/").pop(),t=e.lastIndexOf("."),r=t<1?null:e.slice(t+1);["ttf","otf","woff","woff2"].includes(r)&&(r=e.slice(0,-1!==t?t:0),(e=document.createElement("style")).appendChild(document.createTextNode("\n@font-face {\nfont-family: ".concat(r,";\nsrc: url(").concat(o,");\n}\n"))),document.head.appendChild(e))}),i},l.default.prototype.text=function(e,t,r,o,n){var s;return l.default._validateParameters("text",arguments),this._renderer._doFill||this._renderer._doStroke?(s=this._renderer).text.apply(s,arguments):this},l.default.prototype.textFont=function(e,t){if(l.default._validateParameters("textFont",arguments),arguments.length){if(e)return this._renderer._setProperty("_textFont",e),t&&(this._renderer._setProperty("_textSize",t),this._renderer._leadingSet||this._renderer._setProperty("_textLeading",t*n._DEFAULT_LEADMULT)),this._renderer._applyTextProperties();throw new Error("null font passed to textFont")}return this._renderer._textFont};var c=l.default;r.default=c},{"../core/constants":256,"../core/friendly_errors/fes_core":258,"../core/friendly_errors/file_errors":259,"../core/friendly_errors/validate_params":262,"../core/main":267,"core-js/modules/es.array.concat":149,"core-js/modules/es.array.includes":156,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.last-index-of":160,"core-js/modules/es.array.slice":162,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.string.iterator":186,"core-js/modules/es.string.split":191,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230,"opentype.js":241}],305:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.splice"),e("core-js/modules/es.function.name"),e("core-js/modules/es.number.to-fixed"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.splice"),e("core-js/modules/es.function.name"),e("core-js/modules/es.number.to-fixed"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(n=e("../core/main"))&&n.__esModule?n:{default:n},v=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==p(e)&&"function"!=typeof e)return{default:e};var t=i();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants"));function i(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,i=function(){return e},e)}function p(e){return(p="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}function m(e,t){var r=e.length;return e[t<0?t%r+r:t%r]}function y(e,t,r,o){var n,s,i;return o?(void 0===y.tmpPoint1&&(y.tmpPoint1=[],y.tmpPoint2=[]),s=y.tmpPoint1,i=y.tmpPoint2,s.x=t.x-e.x,s.y=t.y-e.y,i.x=r.x-t.x,i.y=r.y-t.y,n=s.x*i.x+s.y*i.y,s=Math.sqrt(s.x*s.x+s.y*s.y),i=Math.sqrt(i.x*i.x+i.y*i.y),Math.acos(n/(s*i))<o):0==(t[0]-e[0])*(r[1]-e[1])-(r[0]-e[0])*(t[1]-e[1])}function d(e,t,r,o,n,s,i,a,l){var u=1-l,c=Math.pow(u,3),d=Math.pow(u,2),f=l*l,h=f*l,p=c*e+3*d*l*r+3*u*l*l*n+h*i,c=c*t+3*d*l*o+3*u*l*l*s+h*a,d=e+2*l*(r-e)+f*(n-2*r+e),h=t+2*l*(o-t)+f*(s-2*o+t),m=r+2*l*(n-r)+f*(i-2*n+r),f=o+2*l*(s-o)+f*(a-2*s+o),e=u*e+l*r,r=u*t+l*o,t=u*n+l*i,o=u*s+l*a,n=90-180*Math.atan2(d-m,h-f)/Math.PI;return(m<d||h<f)&&(n+=180),{x:p,y:c,m:{x:d,y:h},n:{x:m,y:f},start:{x:e,y:r},end:{x:t,y:o},alpha:n}}function f(e,t,r,o,n,s,i,a,l){return null==l?h(e,t,r,o,n,s,i,a):d(e,t,r,o,n,s,i,a,function(e,t,r,o,n,s,i,a,l){if(!(l<0||h(e,t,r,o,n,s,i,a)<l)){var u,c=.5,d=1-c;for(u=h(e,t,r,o,n,s,i,a,d);.01<Math.abs(u-l);)u=h(e,t,r,o,n,s,i,a,d+=(u<l?1:-1)*(c/=2));return d}}(e,t,r,o,n,s,i,a,l))}function g(e,t,r){for(var o,n,s,i,a,l=0,u=0,c=(e=function(e,t){function r(e,t,r){var o,n;if(!e)return["C",t.x,t.y,t.x,t.y,t.x,t.y];switch(e[0]in{T:1,Q:1}||(t.qx=t.qy=null),e[0]){case"M":t.X=e[1],t.Y=e[2];break;case"A":e=["C"].concat(E.apply(0,[t.x,t.y].concat(e.slice(1))));break;case"S":n="C"===r||"S"===r?(o=2*t.x-t.bx,2*t.y-t.by):(o=t.x,t.y),e=["C",o,n].concat(e.slice(1));break;case"T":"Q"===r||"T"===r?(t.qx=2*t.x-t.qx,t.qy=2*t.y-t.qy):(t.qx=t.x,t.qy=t.y),e=["C"].concat(x(t.x,t.y,t.qx,t.qy,e[1],e[2]));break;case"Q":t.qx=e[1],t.qy=e[2],e=["C"].concat(x(t.x,t.y,e[1],e[2],e[3],e[4]));break;case"L":e=["C"].concat(_(t.x,t.y,e[1],e[2]));break;case"H":e=["C"].concat(_(t.x,t.y,e[1],t.y));break;case"V":e=["C"].concat(_(t.x,t.y,t.x,e[1]));break;case"Z":e=["C"].concat(_(t.x,t.y,t.X,t.Y))}return e}function o(e,t){if(7<e[t].length){e[t].shift();for(var r=e[t];r.length;)c[t]="A",a&&(d[t]="A"),e.splice(t++,0,["C"].concat(r.splice(0,6)));e.splice(t,1),s=Math.max(i.length,a&&a.length||0)}}function n(e,t,r,o,n){e&&t&&"M"===e[n][0]&&"M"!==t[n][0]&&(t.splice(n,0,["M",o.x,o.y]),r.bx=0,r.by=0,r.x=e[n][1],r.y=e[n][2],s=Math.max(i.length,a&&a.length||0))}var s,i=b(e),a=t&&b(t),l={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},u={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},c=[],d=[],f="",h="";s=Math.max(i.length,a&&a.length||0);for(var p=0;p<s;p++){"C"!==(f=i[p]?i[p][0]:f)&&(c[p]=f,p&&(h=c[p-1])),i[p]=r(i[p],l,h),"A"!==c[p]&&"C"===f&&(c[p]="C"),o(i,p),a&&("C"!==(f=a[p]?a[p][0]:f)&&(d[p]=f,p&&(h=d[p-1])),a[p]=r(a[p],u,h),"A"!==d[p]&&"C"===f&&(d[p]="C"),o(a,p)),n(i,a,l,u,p),n(a,i,u,l,p);var m=i[p],y=a&&a[p],g=m.length,v=a&&y.length;l.x=m[g-2],l.y=m[g-1],l.bx=parseFloat(m[g-4])||l.x,l.by=parseFloat(m[g-3])||l.y,u.bx=a&&(parseFloat(y[v-4])||u.x),u.by=a&&(parseFloat(y[v-3])||u.y),u.x=a&&y[v-2],u.y=a&&y[v-1]}return a?[i,a]:i}(e)).length;u<c;u++){if("M"===(s=e[u])[0])o=+s[1],n=+s[2];else{if(t<l+(i=f(o,n,s[1],s[2],s[3],s[4],s[5],s[6]))&&!r)return{x:(a=f(o,n,s[1],s[2],s[3],s[4],s[5],s[6],t-l)).x,y:a.y,alpha:a.alpha};l+=i,o=+s[5],n=+s[6]}s.shift()}return a=(a=r?l:d(o,n,s[0],s[1],s[2],s[3],s[4],s[5],1)).alpha?{x:a.x,y:a.y,alpha:a.alpha}:a}function b(e){var t=[],r=0,o=0,n=0,s=0,i=0;if(e){"M"===e[0][0]&&(n=r=+e[0][1],s=o=+e[0][2],i++,t[0]=["M",r,o]);for(var a,l,u=3===e.length&&"M"===e[0][0]&&"R"===e[1][0].toUpperCase()&&"Z"===e[2][0].toUpperCase(),c=i,d=e.length;c<d;c++){if(t.push(a=[]),(l=e[c])[0]!==String.prototype.toUpperCase.call(l[0]))switch(a[0]=String.prototype.toUpperCase.call(l[0]),a[0]){case"A":a[1]=l[1],a[2]=l[2],a[3]=l[3],a[4]=l[4],a[5]=l[5],a[6]=+(l[6]+r),a[7]=+(l[7]+o);break;case"V":a[1]=+l[1]+o;break;case"H":a[1]=+l[1]+r;break;case"R":for(var f,h=2,p=(f=[r,o].concat(l.slice(1))).length;h<p;h++)f[h]=+f[h]+r,f[++h]=+f[h]+o;t.pop(),t=t.concat(j(f,u));break;case"M":n=+l[1]+r,s=+l[2]+o;break;default:for(var m=1,y=l.length;m<y;m++)a[m]=+l[m]+(m%2?r:o)}else if("R"===l[0])f=[r,o].concat(l.slice(1)),t.pop(),t=t.concat(j(f,u)),a=["R"].concat(l.slice(-2));else for(var g=0,v=l.length;g<v;g++)a[g]=l[g];switch(a[0]){case"Z":r=n,o=s;break;case"H":r=a[1];break;case"V":o=a[1];break;case"M":n=a[a.length-2],s=a[a.length-1];break;default:r=a[a.length-2],o=a[a.length-1]}}}return t}function E(e,t,r,o,n,s,i,a,l,u){function c(e,t,r){return{x:e*Math.cos(r)-t*Math.sin(r),y:e*Math.sin(r)+t*Math.cos(r)}}var d,f=Math.PI,h=120*f/180,p=f/180*(+n||0),m=[],y=(u?(x=u[0],d=u[1],j=u[2],_=u[3]):(e=(v=c(e,t,-p)).x,t=v.y,1<(y=(g=(e-(a=(v=c(a,l,-p)).x))/2)*g/(r*r)+(v=(t-(l=v.y))/2)*v/(o*o))&&(r*=y=Math.sqrt(y),o*=y),y=r*r,b=o*o,j=(s=(s===i?-1:1)*Math.sqrt(Math.abs((y*b-y*v*v-b*g*g)/(y*v*v+b*g*g))))*r*v/o+(e+a)/2,_=s*-o*g/r+(t+l)/2,x=Math.asin(((t-_)/o).toFixed(9)),d=Math.asin(((l-_)/o).toFixed(9)),(x=e<j?f-x:x)<0&&(x=2*f+x),(d=a<j?f-d:d)<0&&(d=2*f+d),i&&d<x&&(x-=2*f),!i&&x<d&&(d-=2*f)),d-x),g=(Math.abs(y)>h&&(b=d,v=a,s=l,d=x+h*(i&&x<d?1:-1),m=E(a=j+r*Math.cos(d),l=_+o*Math.sin(d),r,o,n,0,i,v,s,[d,b,j,_])),y=d-x,Math.cos(x)),f=Math.sin(x),h=Math.cos(d),n=Math.sin(d),i=Math.tan(y/4),v=4/3*r*i,s=4/3*o*i,b=[e,t],j=[e+v*f,t-s*g],_=[a+v*n,l-s*h],x=[a,l];if(j[0]=2*b[0]-j[0],j[1]=2*b[1]-j[1],u)return[j,_,x].concat(m);for(var w=[],S=0,M=(m=[j,_,x].concat(m).join().split(",")).length;S<M;S++)w[S]=S%2?c(m[S-1],m[S],p).y:c(m[S],m[S+1],p).x;return w}function j(e,t){for(var r=[],o=0,n=e.length;o<n-2*!t;o+=2){var s=[{x:+e[o-2],y:+e[o-1]},{x:+e[o],y:+e[o+1]},{x:+e[o+2],y:+e[o+3]},{x:+e[o+4],y:+e[o+5]}];t?o?n-4===o?s[3]={x:+e[0],y:+e[1]}:n-2===o&&(s[2]={x:+e[0],y:+e[1]},s[3]={x:+e[2],y:+e[3]}):s[0]={x:+e[n-2],y:+e[n-1]}:n-4===o?s[3]=s[2]:o||(s[0]={x:+e[o],y:+e[o+1]}),r.push(["C",(-s[0].x+6*s[1].x+s[2].x)/6,(-s[0].y+6*s[1].y+s[2].y)/6,(s[1].x+6*s[2].x-s[3].x)/6,(s[1].y+6*s[2].y-s[3].y)/6,s[2].x,s[2].y])}return r}function _(e,t,r,o){return[e,t,r,o,r,o]}function x(e,t,r,o,n,s){return[1/3*e+2/3*r,1/3*t+2/3*o,1/3*n+2/3*r,1/3*s+2/3*o,n,s]}function h(e,t,r,o,n,s,i,a,l){for(var u=(l=1<(l=null==l?1:l)?1:l<0?0:l)/2,c=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],d=0,f=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],h=0;h<12;h++){var p=u*c[h]+u,m=w(p,e,r,n,i),p=w(p,t,o,s,a);d+=f[h]*Math.sqrt(m*m+p*p)}return u*d}function w(e,t,r,o,n){return e*(e*(-3*t+9*r-9*o+3*n)+6*t-12*r+6*o)-3*t+3*r}n.default.Font=function(e){this.parent=e,this.cache={},this.font=void 0},n.default.Font.prototype.textBounds=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,o=3<arguments.length?arguments[3]:void 0,n=4<arguments.length?arguments[4]:void 0,s=n&&n.renderer&&n.renderer._pInst||this.parent,i=s._renderer.drawingContext,o=(i.textAlign||v.LEFT,i.textBaseline||v.BASELINE,o||s._renderer._textSize);if(!g){for(var a=[],l=[],u=[],c=(u[0]=[],[]),d=this._scale(o),f=s._renderer.textLeading(),h=0,p=(this.font.forEachGlyph(e,t,r,o,n,function(e,t,r,o){var n=e.getMetrics();0===e.index||10===e.index?u[h+=1]=[]:(u[h].push(t+n.xMin*d),u[h].push(t+n.xMax*d),c.push(r+h*f+-n.yMin*d),c.push(r+h*f+-n.yMax*d))}),0<u[h].length&&(a[h]=Math.min.apply(null,u[h]),l[h]=Math.max.apply(null,u[h])),0),m=0;m<=h;m++){a[m]=Math.min.apply(null,u[m]),l[m]=Math.max.apply(null,u[m]);var y=l[m]-a[m];p<y&&(p=y)}var i=Math.min.apply(null,a),g={x:i,y:r=Math.min.apply(null,c),h:Math.max.apply(null,c)-r,w:p,advance:i-t},o=this._handleAlignment(s._renderer,e,g.x,g.y,g.w+g.advance);g.x=o.x,g.y=o.y}return g},n.default.Font.prototype.textToPoints=function(e,t,r,o,n){var s=0,i=[],a=this._getGlyphs(e);o=o||this.parent._renderer._textSize;for(var l,u=0;u<a.length;u++){if(!(a[l=u].name&&"space"===a[l].name||e.length===a.length&&" "===e[l]))for(var c=function(e){for(var t,r=[],o=0;o<e.length;o++)"M"===e[o].type&&(t&&r.push(t),t=[]),t.push(function(e){var t=[e.type];"M"===e.type||"L"===e.type?t.push(e.x,e.y):"C"===e.type?t.push(e.x1,e.y1,e.x2,e.y2,e.x,e.y):"Q"===e.type&&t.push(e.x1,e.y1,e.x,e.y);return t}(e[o]));return r.push(t),r}(a[u].getPath(t,r,o).commands),d=0;d<c.length;d++)for(var f=function(e,t){for(var t=function(e,t){if("object"!==p(e))e=t;else for(var r in t)void 0===e[r]&&(e[r]=t[r]);return e}(t,{sampleFactor:.1,simplifyThreshold:0}),r=g(e,0,1),o=r/(r*t.sampleFactor),n=[],s=0;s<r;s+=o)n.push(g(e,s));t.simplifyThreshold&&!function(e){for(var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,r=0,o=e.length-1;3<e.length&&0<=o;--o)y(m(e,o-1),m(e,o),m(e,o+1),t)&&(e.splice(o%e.length,1),r++)}(n,t.simplifyThreshold);return n}(c[d],n),h=0;h<f.length;h++)f[h].x+=s,i.push(f[h]);s+=a[u].advanceWidth*this._scale(o)}return i},n.default.Font.prototype._getGlyphs=function(e){return this.font.stringToGlyphs(e)},n.default.Font.prototype._getPath=function(e,t,r,o){var n=(o&&o.renderer&&o.renderer._pInst||this.parent)._renderer,t=this._handleAlignment(n,e,t,r);return this.font.getPath(e,t.x,t.y,n._textSize,o)},n.default.Font.prototype._getPathData=function(e,t,r,o){var n=3;return"string"==typeof e&&2<arguments.length?e=this._getPath(e,t,r,o):"object"===p(t)&&(o=t),o&&"number"==typeof o.decimals&&(n=o.decimals),e.toPathData(n)},n.default.Font.prototype._getSVG=function(e,t,r,o){var n=3;return"string"==typeof e&&2<arguments.length?e=this._getPath(e,t,r,o):"object"===p(t)&&(o=t),o&&("number"==typeof o.decimals&&(n=o.decimals),"number"==typeof o.strokeWidth&&(e.strokeWidth=o.strokeWidth),void 0!==o.fill&&(e.fill=o.fill),void 0!==o.stroke&&(e.stroke=o.stroke)),e.toSVG(n)},n.default.Font.prototype._renderPath=function(e,t,r,o){var n=o&&o.renderer||this.parent._renderer,s=n.drawingContext,e=("object"===p(e)&&e.commands?e:this._getPath(e,t,r,o)).commands,i=(s.beginPath(),!0),t=!1,r=void 0;try{for(var a,l=e[Symbol.iterator]();!(i=(a=l.next()).done);i=!0){var u=a.value;"M"===u.type?s.moveTo(u.x,u.y):"L"===u.type?s.lineTo(u.x,u.y):"C"===u.type?s.bezierCurveTo(u.x1,u.y1,u.x2,u.y2,u.x,u.y):"Q"===u.type?s.quadraticCurveTo(u.x1,u.y1,u.x,u.y):"Z"===u.type&&s.closePath()}}catch(e){t=!0,r=e}finally{try{i||null==l.return||l.return()}finally{if(t)throw r}}return n._doStroke&&n._strokeSet&&s.stroke(),n._doFill&&(n._fillSet||n._setFill(v._DEFAULT_TEXT_FILL),s.fill()),this},n.default.Font.prototype._textWidth=function(e,t){return this.font.getAdvanceWidth(e,t)},n.default.Font.prototype._textAscent=function(e){return this.font.ascender*this._scale(e)},n.default.Font.prototype._textDescent=function(e){return-this.font.descender*this._scale(e)},n.default.Font.prototype._scale=function(e){return 1/this.font.unitsPerEm*(e||this.parent._renderer._textSize)},n.default.Font.prototype._handleAlignment=function(e,t,r,o,n){var s=e._textSize;switch(void 0===n&&(n=this._textWidth(t,s)),e._textAlign){case v.CENTER:r-=n/2;break;case v.RIGHT:r-=n}switch(e._textBaseline){case v.TOP:o+=this._textAscent(s);break;case v.CENTER:o+=this._textAscent(s)/2;break;case v.BOTTOM:o-=this._textDescent(s)}return{x:r,y:o}};e=n.default;r.default=e},{"../core/constants":256,"../core/main":267,"core-js/modules/es.array.concat":149,"core-js/modules/es.array.fill":152,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.join":159,"core-js/modules/es.array.slice":162,"core-js/modules/es.array.splice":164,"core-js/modules/es.function.name":165,"core-js/modules/es.number.to-fixed":171,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.string.iterator":186,"core-js/modules/es.string.split":191,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],306:[function(e,t,r){"use strict";e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.splice"),e("core-js/modules/es.array-buffer.constructor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.splice"),e("core-js/modules/es.array-buffer.constructor"),e("core-js/modules/es.object.to-string"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;e=(e=e("../core/main"))&&e.__esModule?e:{default:e};e.default.prototype.append=function(e,t){return e.push(t),e},e.default.prototype.arrayCopy=function(e,t,r,o,n){var s,i;e=void 0!==n?(i=Math.min(n,e.length),s=o,e.slice(t,i+t)):(i=void 0!==r?(i=r,Math.min(i,e.length)):e.length,r=t,e.slice(s=0,i)),Array.prototype.splice.apply(r,[s,i].concat(e))},e.default.prototype.concat=function(e,t){return e.concat(t)},e.default.prototype.reverse=function(e){return e.reverse()},e.default.prototype.shorten=function(e){return e.pop(),e},e.default.prototype.shuffle=function(e,t){for(var r,o,n=ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(e),s=(e=t||n?e:e.slice()).length;1<s;)r=this.random(0,1)*s|0,o=e[--s],e[s]=e[r],e[r]=o;return e},e.default.prototype.sort=function(e,t){var r=t?e.slice(0,Math.min(t,e.length)):e,t=t?e.slice(Math.min(t,e.length)):[];return(r="string"==typeof r[0]?r.sort():r.sort(function(e,t){return e-t})).concat(t)},e.default.prototype.splice=function(e,t,r){return Array.prototype.splice.apply(e,[r,0].concat(t)),e},e.default.prototype.subset=function(e,t,r){return void 0!==r?e.slice(t,t+r):e.slice(t,e.length)};e=e.default;r.default=e},{"../core/main":267,"core-js/modules/es.array-buffer.constructor":148,"core-js/modules/es.array.concat":149,"core-js/modules/es.array.slice":162,"core-js/modules/es.array.splice":164,"core-js/modules/es.object.to-string":177}],307:[function(e,t,r){"use strict";e("core-js/modules/es.array.map"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.repeat"),e("core-js/modules/es.array.map"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.repeat"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(e=e("../core/main"))&&e.__esModule?e:{default:e};o.default.prototype.float=function(e){return e instanceof Array?e.map(parseFloat):parseFloat(e)},o.default.prototype.int=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:10;return e===1/0||"Infinity"===e?1/0:e===-1/0||"-Infinity"===e?-1/0:"string"==typeof e?parseInt(e,t):"number"==typeof e?0|e:"boolean"==typeof e?e?1:0:e instanceof Array?e.map(function(e){return o.default.prototype.int(e,t)}):void 0},o.default.prototype.str=function(e){return e instanceof Array?e.map(o.default.prototype.str):String(e)},o.default.prototype.boolean=function(e){return"number"==typeof e?0!==e:"string"==typeof e?"true"===e.toLowerCase():"boolean"==typeof e?e:e instanceof Array?e.map(o.default.prototype.boolean):void 0},o.default.prototype.byte=function(e){e=o.default.prototype.int(e,10);return"number"==typeof e?(e+128)%256-128:e instanceof Array?e.map(o.default.prototype.byte):void 0},o.default.prototype.char=function(e){return"number"!=typeof e||isNaN(e)?e instanceof Array?e.map(o.default.prototype.char):"string"==typeof e?o.default.prototype.char(parseInt(e,10)):void 0:String.fromCharCode(e)},o.default.prototype.unchar=function(e){return"string"==typeof e&&1===e.length?e.charCodeAt(0):e instanceof Array?e.map(o.default.prototype.unchar):void 0},o.default.prototype.hex=function(e,t){if(t=null==t?8:t,e instanceof Array)return e.map(function(e){return o.default.prototype.hex(e,t)});if(e===1/0||e===-1/0)return(e===1/0?"F":"0").repeat(t);if("number"==typeof e){e<0&&(e=4294967295+e+1);for(var r=Number(e).toString(16).toUpperCase();r.length<t;)r="0".concat(r);return r=r.length>=t?r.substring(r.length-t,r.length):r}},o.default.prototype.unhex=function(e){return e instanceof Array?e.map(o.default.prototype.unhex):parseInt("0x".concat(e),16)};e=o.default;r.default=e},{"../core/main":267,"core-js/modules/es.array.map":161,"core-js/modules/es.number.constructor":169,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.string.repeat":188}],308:[function(e,t,r){"use strict";e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.trim"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.trim"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var s=(l=e("../core/main"))&&l.__esModule?l:{default:l};function o(e,t,r){var o=e<0,e=o?e.toString().substring(1):e.toString(),n=e.indexOf("."),s=-1!==n?e.substring(0,n):e,i=-1!==n?e.substring(n+1):"",a=o?"-":"";if(void 0!==r){o="";(-1!==n||0<r-i.length)&&(o="."),i.length>r&&(i=i.substring(0,r));for(var l=0;l<t-s.length;l++)a+="0";for(var a=(a+=s)+o+i,u=0;u<r-i.length;u++)a+="0";return a}for(var c=0;c<Math.max(t-s.length,0);c++)a+="0";return a+=e}function n(e,t){var r=(e=e.toString()).indexOf("."),o=-1!==r?e.substring(r):"",e=(e=-1!==r?e.substring(0,r):e).toString().replace(/\B(?=(\d{3})+(?!\d))/g,",");if(0===t)o="";else if(void 0!==t)if(t>o.length)for(var n=t-(o+=-1===r?".":"").length+1,s=0;s<n;s++)o+="0";else o=o.substring(0,t+1);return e+o}function i(e){return 0<parseFloat(e)?"+".concat(e.toString()):e.toString()}function a(e){return 0<=parseFloat(e)?" ".concat(e.toString()):e.toString()}e("../core/friendly_errors/validate_params"),e("../core/friendly_errors/file_errors"),e("../core/friendly_errors/fes_core"),s.default.prototype.join=function(e,t){return s.default._validateParameters("join",arguments),e.join(t)},s.default.prototype.match=function(e,t){return s.default._validateParameters("match",arguments),e.match(t)},s.default.prototype.matchAll=function(e,t){s.default._validateParameters("matchAll",arguments);for(var r=new RegExp(t,"g"),o=r.exec(e),n=[];null!==o;)n.push(o),o=r.exec(e);return n},s.default.prototype.nf=function(e,t,r){return s.default._validateParameters("nf",arguments),e instanceof Array?e.map(function(e){return o(e,t,r)}):"[object Arguments]"===Object.prototype.toString.call(e)?3===e.length?this.nf(e[0],e[1],e[2]):2===e.length?this.nf(e[0],e[1]):this.nf(e[0]):o(e,t,r)},s.default.prototype.nfc=function(e,t){return s.default._validateParameters("nfc",arguments),e instanceof Array?e.map(function(e){return n(e,t)}):n(e,t)},s.default.prototype.nfp=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];s.default._validateParameters("nfp",t);var o=s.default.prototype.nf.apply(this,t);return o instanceof Array?o.map(i):i(o)},s.default.prototype.nfs=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];s.default._validateParameters("nfs",t);var o=s.default.prototype.nf.apply(this,t);return o instanceof Array?o.map(a):a(o)},s.default.prototype.split=function(e,t){return s.default._validateParameters("split",arguments),e.split(t)},s.default.prototype.splitTokens=function(e,t){var r,o;return s.default._validateParameters("splitTokens",arguments),o=void 0!==t?(o=/\]/g.exec(t=t),(r=/\[/g.exec(t))&&o?(t=t.slice(0,o.index)+t.slice(o.index+1),r=/\[/g.exec(t),t=t.slice(0,r.index)+t.slice(r.index+1),new RegExp("[\\[".concat(t,"\\]]"),"g")):o?(t=t.slice(0,o.index)+t.slice(o.index+1),new RegExp("[".concat(t,"\\]]"),"g")):r?(t=t.slice(0,r.index)+t.slice(r.index+1),new RegExp("[".concat(t,"\\[]"),"g")):new RegExp("[".concat(t,"]"),"g")):/\s/g,e.split(o).filter(function(e){return e})},s.default.prototype.trim=function(e){return s.default._validateParameters("trim",arguments),e instanceof Array?e.map(this.trim):e.trim()};var l=s.default;r.default=l},{"../core/friendly_errors/fes_core":258,"../core/friendly_errors/file_errors":259,"../core/friendly_errors/validate_params":262,"../core/main":267,"core-js/modules/es.array.filter":153,"core-js/modules/es.array.index-of":157,"core-js/modules/es.array.join":159,"core-js/modules/es.array.map":161,"core-js/modules/es.array.slice":162,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.constructor":180,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.string.match":187,"core-js/modules/es.string.replace":189,"core-js/modules/es.string.split":191,"core-js/modules/es.string.trim":193}],309:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;e=(e=e("../core/main"))&&e.__esModule?e:{default:e};e.default.prototype.day=function(){return(new Date).getDate()},e.default.prototype.hour=function(){return(new Date).getHours()},e.default.prototype.minute=function(){return(new Date).getMinutes()},e.default.prototype.millis=function(){return-1===this._millisStart?0:window.performance.now()-this._millisStart},e.default.prototype.month=function(){return(new Date).getMonth()+1},e.default.prototype.second=function(){return(new Date).getSeconds()},e.default.prototype.year=function(){return(new Date).getFullYear()};e=e.default;r.default=e},{"../core/main":267}],310:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.math.hypot"),e("core-js/modules/es.number.to-fixed"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.math.hypot"),e("core-js/modules/es.number.to-fixed"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var S=(n=e("../core/main"))&&n.__esModule?n:{default:n},_=(e("./p5.Geometry"),function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants")));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}S.default.prototype.plane=function(e,t,r,o){this._assert3d("plane"),S.default._validateParameters("plane",arguments),void 0===e&&(e=50),void 0===t&&(t=e),void 0===o&&(o=1);var n,s="plane|".concat(r=void 0===r?1:r,"|").concat(o);return this._renderer.geometryInHash(s)||((n=new S.default.Geometry(r,o,function(){for(var e,t,r=0;r<=this.detailY;r++)for(var o=r/this.detailY,n=0;n<=this.detailX;n++)e=n/this.detailX,t=new S.default.Vector(e-.5,o-.5,0),this.vertices.push(t),this.uvs.push(e,o)})).computeFaces().computeNormals(),r<=1&&o<=1?n._makeTriangleEdges()._edgesToVertices():this._renderer._doStroke&&console.log("Cannot draw stroke on plane objects with more than 1 detailX or 1 detailY"),this._renderer.createBuffers(s,n)),this._renderer.drawBuffersScaled(s,e,t,1),this},S.default.prototype.box=function(e,t,r,o,n){this._assert3d("box"),S.default._validateParameters("box",arguments),void 0===e&&(e=50),void 0===t&&(t=e),void 0===r&&(r=t);var s,i=this._renderer.attributes&&this._renderer.attributes.perPixelLighting,i=(void 0===n&&(n=i?1:4),"box|".concat(o=void 0===o?i?1:4:o,"|").concat(n));return this._renderer.geometryInHash(i)||((s=new S.default.Geometry(o,n,function(){var e=[[0,4,2,6],[1,3,5,7],[0,1,4,5],[2,6,3,7],[0,2,1,3],[4,5,6,7]];this.strokeIndices=[[0,1],[1,3],[3,2],[6,7],[8,9],[9,11],[14,15],[16,17],[17,19],[18,19],[20,21],[22,23]];for(var t=0;t<e.length;t++){for(var r=e[t],o=4*t,n=0;n<4;n++){var s=r[n],s=new S.default.Vector((2*(1&s)-1)/2,((2&s)-1)/2,((4&s)/2-1)/2);this.vertices.push(s),this.uvs.push(1&n,(2&n)/2)}this.faces.push([o,1+o,2+o]),this.faces.push([2+o,1+o,3+o])}})).computeNormals(),o<=4&&n<=4?s._makeTriangleEdges()._edgesToVertices():this._renderer._doStroke&&console.log("Cannot draw stroke on box objects with more than 4 detailX or 4 detailY"),this._renderer.createBuffers(i,s)),this._renderer.drawBuffersScaled(i,e,t,r),this},S.default.prototype.sphere=function(e,t,r){return this._assert3d("sphere"),S.default._validateParameters("sphere",arguments),this.ellipsoid(e=void 0===e?50:e,e,e,t=void 0===t?24:t,r=void 0===r?16:r),this};function l(e,t,r,o,n,s,i){e=e<=0?1:e,t=t<0?0:t,r=r<=0?e:r,o=o<3?3:o;for(var a,l,u=(s=void 0===s||s)?-2:0,c=(n=n<1?1:n)+((i=void 0===i?0!==t:i)?2:0),d=Math.atan2(e-t,r),f=Math.sin(d),h=Math.cos(d),p=u;p<=c;++p){var m=p/n,y=r*m,g=void 0,g=p<0?(m=y=0,e):n<p?(y=r,m=1,t):e+(t-e)*m;for(-2!==p&&p!==n+2||(g=0),y-=r/2,a=0;a<o;++a){var v=a/(o-1),b=2*Math.PI*v,j=Math.sin(b),b=Math.cos(b),_=(this.vertices.push(new S.default.Vector(j*g,y,b*g)),void 0),_=p<0?new S.default.Vector(0,-1,0):n<p&&t?new S.default.Vector(0,1,0):new S.default.Vector(j*h,f,b*h);this.vertexNormals.push(_),this.uvs.push(v,m)}}var x=0;if(s){for(l=0;l<o;++l)this.faces.push([x+l,x+o+(l+1)%o,x+o+l]);x+=2*o}for(p=0;p<n;++p){for(a=0;a<o;++a){var w=(a+1)%o;this.faces.push([x+a,x+w,x+o+w]),this.faces.push([x+a,x+o+w,x+o+a])}x+=o}if(i)for(x+=o,a=0;a<o;++a)this.faces.push([x+a,x+(a+1)%o,x+o])}S.default.prototype.cylinder=function(e,t,r,o,n,s){this._assert3d("cylinder"),S.default._validateParameters("cylinder",arguments),void 0===e&&(e=50),void 0===t&&(t=e),void 0===o&&(o=1),void 0===s&&(s=!0),void 0===n&&(n=!0);var i,a="cylinder|".concat(r=void 0===r?24:r,"|").concat(o,"|").concat(n,"|").concat(s);return this._renderer.geometryInHash(a)||(i=new S.default.Geometry(r,o),l.call(i,1,1,1,r,o,n,s),r<=24&&o<=16?i._makeTriangleEdges()._edgesToVertices():this._renderer._doStroke&&console.log("Cannot draw stroke on cylinder objects with more than 24 detailX or 16 detailY"),this._renderer.createBuffers(a,i)),this._renderer.drawBuffersScaled(a,e,t,e),this},S.default.prototype.cone=function(e,t,r,o,n){this._assert3d("cone"),S.default._validateParameters("cone",arguments),void 0===e&&(e=50),void 0===t&&(t=e),void 0===o&&(o=1),void 0===n&&(n=!0);var s,i="cone|".concat(r=void 0===r?24:r,"|").concat(o,"|").concat(n);return this._renderer.geometryInHash(i)||(s=new S.default.Geometry(r,o),l.call(s,1,0,1,r,o,n,!1),r<=24&&o<=16?s._makeTriangleEdges()._edgesToVertices():this._renderer._doStroke&&console.log("Cannot draw stroke on cone objects with more than 24 detailX or 16 detailY"),this._renderer.createBuffers(i,s)),this._renderer.drawBuffersScaled(i,e,t,e),this},S.default.prototype.ellipsoid=function(e,t,r,o,n){this._assert3d("ellipsoid"),S.default._validateParameters("ellipsoid",arguments),void 0===e&&(e=50),void 0===t&&(t=e),void 0===r&&(r=e),void 0===n&&(n=16);var s,i="ellipsoid|".concat(o=void 0===o?24:o,"|").concat(n);return this._renderer.geometryInHash(i)||((s=new S.default.Geometry(o,n,function(){for(var e=0;e<=this.detailY;e++)for(var t=e/this.detailY,r=Math.PI*t-Math.PI/2,o=Math.cos(r),n=Math.sin(r),s=0;s<=this.detailX;s++){var i=s/this.detailX,a=2*Math.PI*i,l=Math.cos(a),a=Math.sin(a),a=new S.default.Vector(o*a,n,o*l);this.vertices.push(a),this.vertexNormals.push(a),this.uvs.push(i,t)}})).computeFaces(),o<=24&&n<=24?s._makeTriangleEdges()._edgesToVertices():this._renderer._doStroke&&console.log("Cannot draw stroke on ellipsoids with more than 24 detailX or 24 detailY"),this._renderer.createBuffers(i,s)),this._renderer.drawBuffersScaled(i,e,t,r),this},S.default.prototype.torus=function(e,t,r,o){if(this._assert3d("torus"),S.default._validateParameters("torus",arguments),void 0===e)e=50;else if(!e)return;if(void 0===t)t=10;else if(!t)return;void 0===r&&(r=24),void 0===o&&(o=16);var n,d=(t/e).toPrecision(4),t="torus|".concat(d,"|").concat(r,"|").concat(o);return this._renderer.geometryInHash(t)||((n=new S.default.Geometry(r,o,function(){for(var e=0;e<=this.detailY;e++)for(var t=e/this.detailY,r=2*Math.PI*t,o=Math.cos(r),n=Math.sin(r),s=1+d*o,i=0;i<=this.detailX;i++){var a=i/this.detailX,l=2*Math.PI*a,u=Math.cos(l),l=Math.sin(l),c=new S.default.Vector(s*u,s*l,d*n),u=new S.default.Vector(o*u,o*l,n);this.vertices.push(c),this.vertexNormals.push(u),this.uvs.push(a,t)}})).computeFaces(),r<=24&&o<=16?n._makeTriangleEdges()._edgesToVertices():this._renderer._doStroke&&console.log("Cannot draw strokes on torus object with more than 24 detailX or 16 detailY"),this._renderer.createBuffers(t,n)),this._renderer.drawBuffersScaled(t,e,e,e),this},S.default.RendererGL.prototype.point=function(e,t,r){var o=[];return o.push(new S.default.Vector(e,t,r=void 0===r?0:r)),this._drawPoints(o,this.immediateMode.buffers.point),this},S.default.RendererGL.prototype.triangle=function(e){var t=e[0],r=e[1],o=e[2],n=e[3],s=e[4],e=e[5],i=(this.geometryInHash("tri")||((i=new S.default.Geometry(1,1,function(){var e=[];e.push(new S.default.Vector(0,0,0)),e.push(new S.default.Vector(1,0,0)),e.push(new S.default.Vector(0,1,0)),this.strokeIndices=[[0,1],[1,2],[2,0]],this.vertices=e,this.faces=[[0,1,2]],this.uvs=[0,0,1,0,1,1]}))._makeTriangleEdges()._edgesToVertices(),i.computeNormals(),this.createBuffers("tri",i)),this.uMVMatrix.copy());try{var a=new S.default.Matrix([o-t,n-r,0,0,s-t,e-r,0,0,0,0,1,0,t,r,0,1]).mult(this.uMVMatrix);this.uMVMatrix=a,this.drawBuffers("tri")}finally{this.uMVMatrix=i}return this},S.default.RendererGL.prototype.ellipse=function(e){this.arc(e[0],e[1],e[2],e[3],0,_.TWO_PI,_.OPEN,e[4])},S.default.RendererGL.prototype.arc=function(e){var t,r=arguments[1],o=arguments[2],n=arguments[3],s=arguments[4],i=arguments[5],a=arguments[6],l=arguments[7]||25,u=(Math.abs(i-s)>=_.TWO_PI?"".concat(c="ellipse","|"):"".concat(c="arc","|").concat(s,"|").concat(i,"|").concat(a,"|")).concat(l,"|"),c=(this.geometryInHash(u)||((t=new S.default.Geometry(l,1,function(){if(this.strokeIndices=[],s.toFixed(10)!==i.toFixed(10)){a!==_.PIE&&void 0!==a||(this.vertices.push(new S.default.Vector(.5,.5,0)),this.uvs.push([.5,.5]));for(var e=0;e<=l;e++){var t=(i-s)*(e/l)+s,r=.5+Math.cos(t)/2,t=.5+Math.sin(t)/2;this.vertices.push(new S.default.Vector(r,t,0)),this.uvs.push([r,t]),e<l-1&&(this.faces.push([0,e+1,e+2]),this.strokeIndices.push([e+1,e+2]))}switch(a){case _.PIE:this.faces.push([0,this.vertices.length-2,this.vertices.length-1]),this.strokeIndices.push([0,1]),this.strokeIndices.push([this.vertices.length-2,this.vertices.length-1]),this.strokeIndices.push([0,this.vertices.length-1]);break;case _.CHORD:this.strokeIndices.push([0,1]),this.strokeIndices.push([0,this.vertices.length-1]);break;case _.OPEN:this.strokeIndices.push([0,1]);break;default:this.faces.push([0,this.vertices.length-2,this.vertices.length-1]),this.strokeIndices.push([this.vertices.length-2,this.vertices.length-1])}}})).computeNormals(),l<=50?t._makeTriangleEdges()._edgesToVertices(t):this._doStroke&&console.log("Cannot apply a stroke to an ".concat(c," with more than 50 detail")),this.createBuffers(u,t)),this.uMVMatrix.copy());try{this.uMVMatrix.translate([e,r,0]),this.uMVMatrix.scale(o,n,1),this.drawBuffers(u)}finally{this.uMVMatrix=c}return this},S.default.RendererGL.prototype.rect=function(e){var t=e[0],r=e[1],o=e[2],n=e[3];if(void 0===e[4]){var s=this._pInst._glAttributes.perPixelLighting,i=e[4]||(s?1:24),a=e[5]||(s?1:16),s="rect|".concat(i,"|").concat(a),l=(this.geometryInHash(s)||((l=new S.default.Geometry(i,a,function(){for(var e=0;e<=this.detailY;e++)for(var t=e/this.detailY,r=0;r<=this.detailX;r++){var o=r/this.detailX,n=new S.default.Vector(o,t,0);this.vertices.push(n),this.uvs.push(o,t)}0<i&&0<a&&(this.strokeIndices=[[0,i],[i,(i+1)*(a+1)-1],[(i+1)*(a+1)-1,(i+1)*a],[(i+1)*a,0]])})).computeFaces().computeNormals()._makeTriangleEdges()._edgesToVertices(),this.createBuffers(s,l)),this.uMVMatrix.copy());try{this.uMVMatrix.translate([t,r,0]),this.uMVMatrix.scale(o,n,1),this.drawBuffers(s)}finally{this.uMVMatrix=l}}else{var s=e[4],l=void 0===e[5]?s:e[5],u=void 0===e[6]?l:e[6],e=void 0===e[7]?u:e[7],c=o,d=n,f=((c+=t)<t&&(f=t,t=c,c=f),(d+=r)<r&&(f=r,r=d,d=f),Math.min((c-t)/2,(d-r)/2)),h=(f<s&&(s=f),f<l&&(l=f),f<u&&(u=f),f<e&&(e=f),t),p=r,f=c,t=d,m=(this.beginShape(),0!==l?(this.vertex(f-l,p),this.quadraticVertex(f,p,f,p+l)):this.vertex(f,p),0!==u?(this.vertex(f,t-u),this.quadraticVertex(f,t,f-u,t)):this.vertex(f,t),0!==e?(this.vertex(h+e,t),this.quadraticVertex(h,t,h,t-e)):this.vertex(h,t),0!==s?(this.vertex(h,p+s),this.quadraticVertex(h,p,h+s,p)):this.vertex(h,p),!(this.immediateMode.geometry.uvs.length=0)),r=!1,c=void 0;try{for(var y,g=this.immediateMode.geometry.vertices[Symbol.iterator]();!(m=(y=g.next()).done);m=!0){var v=y.value,b=(v.x-h)/o,j=(v.y-p)/n;this.immediateMode.geometry.uvs.push(b,j)}}catch(e){r=!0,c=e}finally{try{m||null==g.return||g.return()}finally{if(r)throw c}}this.endShape(_.CLOSE)}return this},S.default.RendererGL.prototype.quad=function(i,a,l,u,c,d,f,h,p,m,y,g,e,t){void 0===e&&(e=2),void 0===t&&(t=2);var r="quad|".concat(i,"|").concat(a,"|").concat(l,"|").concat(u,"|").concat(c,"|").concat(d,"|").concat(f,"|").concat(h,"|").concat(p,"|").concat(m,"|").concat(y,"|").concat(g,"|").concat(e,"|").concat(t);if(!this.geometryInHash(r)){var o=new S.default.Geometry(e,t,function(){for(var e=1/(this.detailX-1),t=1/(this.detailY-1),r=0;r<this.detailY;r++)for(var o=0;o<this.detailX;o++){var n=o*e,s=r*t;this.vertices.push(new S.default.Vector((1-n)*((1-s)*i+s*m)+n*((1-s)*u+s*f),(1-n)*((1-s)*a+s*y)+n*((1-s)*c+s*h),(1-n)*((1-s)*l+s*g)+n*((1-s)*d+s*p))),this.uvs.push([n,s])}});o.faces=[];for(var n=0;n<t-1;n++)for(var s=0;s<e-1;s++){var v=s+n*e,b=s+1+(n+1)*e,j=s+(n+1)*e;o.faces.push([v,s+1+n*e,b]),o.faces.push([v,b,j])}o.computeNormals()._makeTriangleEdges()._edgesToVertices(),this.createBuffers(r,o)}return this.drawBuffers(r),this},S.default.RendererGL.prototype.bezier=function(e,t,r,o,n,s,i,a,l,u,c,d){8===arguments.length&&(c=a,u=i,a=s,i=n,n=o,o=r,r=s=l=d=0);var f=this._pInst._bezierDetail||20;this.beginShape();for(var h=0;h<=f;h++){var p=Math.pow(1-h/f,3),m=h/f*3*Math.pow(1-h/f,2),y=3*Math.pow(h/f,2)*(1-h/f),g=Math.pow(h/f,3);this.vertex(e*p+o*m+i*y+u*g,t*p+n*m+a*y+c*g,r*p+s*m+l*y+d*g)}return this.endShape(),this},S.default.RendererGL.prototype.curve=function(e,t,r,o,n,s,i,a,l,u,c,d){8===arguments.length&&(u=i,c=a,i=n,a=o,n=o=r,r=s=l=d=0);var f=this._pInst._curveDetail;this.beginShape();for(var h=0;h<=f;h++){var p=.5*Math.pow(h/f,3),m=.5*Math.pow(h/f,2),y=h/f*.5;this.vertex(p*(3*o-e-3*i+u)+m*(2*e-5*o+4*i-u)+y*(-e+i)+2*o*.5,p*(3*n-t-3*a+c)+m*(2*t-5*n+4*a-c)+y*(-t+a)+2*n*.5,p*(3*s-r-3*l+d)+m*(2*r-5*s+4*l-d)+y*(-r+l)+2*s*.5)}return this.endShape(),this},S.default.RendererGL.prototype.line=function(){return 6===arguments.length?(this.beginShape(_.LINES),this.vertex(arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2]),this.vertex(arguments.length<=3?void 0:arguments[3],arguments.length<=4?void 0:arguments[4],arguments.length<=5?void 0:arguments[5]),this.endShape()):4===arguments.length&&(this.beginShape(_.LINES),this.vertex(arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],0),this.vertex(arguments.length<=2?void 0:arguments[2],arguments.length<=3?void 0:arguments[3],0),this.endShape()),this},S.default.RendererGL.prototype.bezierVertex=function(){if(0===this.immediateMode._bezierVertex.length)throw Error("vertex() must be used once before calling bezierVertex()");var e,t,r,o,n,s,i=[],a=[],l=arguments.length;if(0===this._lookUpTableBezier.length||this._lutBezierDetail!==this._pInst._curveDetail){this._lookUpTableBezier=[],this._lutBezierDetail=this._pInst._curveDetail;for(var u=1/this._lutBezierDetail,c=0,d=1,f=0;c<1;){if(s=parseFloat(c.toFixed(6)),this._lookUpTableBezier[f]=this._bezierCoefficients(s),d.toFixed(6)===u.toFixed(6)){s=parseFloat(d.toFixed(6))+parseFloat(c.toFixed(6)),++f,this._lookUpTableBezier[f]=this._bezierCoefficients(s);break}c+=u,d-=u,++f}}for(var h=this._lookUpTableBezier.length,p=[],m=0;m<4;m++)p.push([]);p[0]=this.immediateMode.geometry.vertexColors.slice(-4),p[3]=this.curFillColor.slice();var y=[];for(m=0;m<4;m++)y.push([]);if(y[0]=this.immediateMode.geometry.vertexStrokeColors.slice(-4),y[3]=this.curStrokeColor.slice(),6===l){this.isBezier=!0;var i=[this.immediateMode._bezierVertex[0],arguments.length<=0?void 0:arguments[0],arguments.length<=2?void 0:arguments[2],arguments.length<=4?void 0:arguments[4]],a=[this.immediateMode._bezierVertex[1],arguments.length<=1?void 0:arguments[1],arguments.length<=3?void 0:arguments[3],arguments.length<=5?void 0:arguments[5]],g=Math.hypot(i[0]-i[1],a[0]-a[1]),v=Math.hypot(i[1]-i[2],a[1]-a[2]),b=Math.hypot(i[2]-i[3],a[2]-a[3]),v=g+v+b;for(g/=v,b/=v,n=0;n<4;n++)p[1].push(p[0][n]*(1-g)+p[3][n]*g),p[2].push(p[0][n]*b+p[3][n]*(1-b)),y[1].push(y[0][n]*(1-g)+y[3][n]*g),y[2].push(y[0][n]*b+y[3][n]*(1-b));for(o=0;o<h;o++){for(this.curFillColor=[0,0,0,0],this.curStrokeColor=[0,0,0,0],m=e=t=0;m<4;m++){for(n=0;n<4;n++)this.curFillColor[n]+=this._lookUpTableBezier[o][m]*p[m][n],this.curStrokeColor[n]+=this._lookUpTableBezier[o][m]*y[m][n];e+=i[m]*this._lookUpTableBezier[o][m],t+=a[m]*this._lookUpTableBezier[o][m]}this.vertex(e,t)}this.curFillColor=p[3],this.curStrokeColor=y[3],this.immediateMode._bezierVertex[0]=arguments.length<=4?void 0:arguments[4],this.immediateMode._bezierVertex[1]=arguments.length<=5?void 0:arguments[5]}else if(9===l){this.isBezier=!0,i=[this.immediateMode._bezierVertex[0],arguments.length<=0?void 0:arguments[0],arguments.length<=3?void 0:arguments[3],arguments.length<=6?void 0:arguments[6]],a=[this.immediateMode._bezierVertex[1],arguments.length<=1?void 0:arguments[1],arguments.length<=4?void 0:arguments[4],arguments.length<=7?void 0:arguments[7]];var j=[this.immediateMode._bezierVertex[2],arguments.length<=2?void 0:arguments[2],arguments.length<=5?void 0:arguments[5],arguments.length<=8?void 0:arguments[8]],_=Math.hypot(i[0]-i[1],a[0]-a[1],j[0]-j[1]),v=Math.hypot(i[1]-i[2],a[1]-a[2],j[1]-j[2]),x=Math.hypot(i[2]-i[3],a[2]-a[3],j[2]-j[3]),l=_+v+x;for(_/=l,x/=l,n=0;n<4;n++)p[1].push(p[0][n]*(1-_)+p[3][n]*_),p[2].push(p[0][n]*x+p[3][n]*(1-x)),y[1].push(y[0][n]*(1-_)+y[3][n]*_),y[2].push(y[0][n]*x+y[3][n]*(1-x));for(o=0;o<h;o++){for(this.curFillColor=[0,0,0,0],this.curStrokeColor=[0,0,0,0],m=e=t=r=0;m<4;m++){for(n=0;n<4;n++)this.curFillColor[n]+=this._lookUpTableBezier[o][m]*p[m][n],this.curStrokeColor[n]+=this._lookUpTableBezier[o][m]*y[m][n];e+=i[m]*this._lookUpTableBezier[o][m],t+=a[m]*this._lookUpTableBezier[o][m],r+=j[m]*this._lookUpTableBezier[o][m]}this.vertex(e,t,r)}this.curFillColor=p[3],this.curStrokeColor=y[3],this.immediateMode._bezierVertex[0]=arguments.length<=6?void 0:arguments[6],this.immediateMode._bezierVertex[1]=arguments.length<=7?void 0:arguments[7],this.immediateMode._bezierVertex[2]=arguments.length<=8?void 0:arguments[8]}},S.default.RendererGL.prototype.quadraticVertex=function(){if(0===this.immediateMode._quadraticVertex.length)throw Error("vertex() must be used once before calling quadraticVertex()");var e,t,r,o,n,s,i=[],a=[],l=arguments.length;if(0===this._lookUpTableQuadratic.length||this._lutQuadraticDetail!==this._pInst._curveDetail){this._lookUpTableQuadratic=[],this._lutQuadraticDetail=this._pInst._curveDetail;for(var u=1/this._lutQuadraticDetail,c=0,d=1,f=0;c<1;){if(s=parseFloat(c.toFixed(6)),this._lookUpTableQuadratic[f]=this._quadraticCoefficients(s),d.toFixed(6)===u.toFixed(6)){s=parseFloat(d.toFixed(6))+parseFloat(c.toFixed(6)),++f,this._lookUpTableQuadratic[f]=this._quadraticCoefficients(s);break}c+=u,d-=u,++f}}for(var h=this._lookUpTableQuadratic.length,p=[],m=0;m<3;m++)p.push([]);p[0]=this.immediateMode.geometry.vertexColors.slice(-4),p[2]=this.curFillColor.slice();var y=[];for(m=0;m<3;m++)y.push([]);if(y[0]=this.immediateMode.geometry.vertexStrokeColors.slice(-4),y[2]=this.curStrokeColor.slice(),4===l){this.isQuadratic=!0;var i=[this.immediateMode._quadraticVertex[0],arguments.length<=0?void 0:arguments[0],arguments.length<=2?void 0:arguments[2]],a=[this.immediateMode._quadraticVertex[1],arguments.length<=1?void 0:arguments[1],arguments.length<=3?void 0:arguments[3]],g=Math.hypot(i[0]-i[1],a[0]-a[1]);for(g/=g+Math.hypot(i[1]-i[2],a[1]-a[2]),n=0;n<4;n++)p[1].push(p[0][n]*(1-g)+p[2][n]*g),y[1].push(y[0][n]*(1-g)+y[2][n]*g);for(o=0;o<h;o++){for(this.curFillColor=[0,0,0,0],this.curStrokeColor=[0,0,0,0],m=e=t=0;m<3;m++){for(n=0;n<4;n++)this.curFillColor[n]+=this._lookUpTableQuadratic[o][m]*p[m][n],this.curStrokeColor[n]+=this._lookUpTableQuadratic[o][m]*y[m][n];e+=i[m]*this._lookUpTableQuadratic[o][m],t+=a[m]*this._lookUpTableQuadratic[o][m]}this.vertex(e,t)}this.curFillColor=p[2],this.curStrokeColor=y[2],this.immediateMode._quadraticVertex[0]=arguments.length<=2?void 0:arguments[2],this.immediateMode._quadraticVertex[1]=arguments.length<=3?void 0:arguments[3]}else if(6===l){this.isQuadratic=!0,i=[this.immediateMode._quadraticVertex[0],arguments.length<=0?void 0:arguments[0],arguments.length<=3?void 0:arguments[3]],a=[this.immediateMode._quadraticVertex[1],arguments.length<=1?void 0:arguments[1],arguments.length<=4?void 0:arguments[4]];var v=[this.immediateMode._quadraticVertex[2],arguments.length<=2?void 0:arguments[2],arguments.length<=5?void 0:arguments[5]],b=Math.hypot(i[0]-i[1],a[0]-a[1],v[0]-v[1]);for(b/=b+Math.hypot(i[1]-i[2],a[1]-a[2],v[1]-v[2]),n=0;n<4;n++)p[1].push(p[0][n]*(1-b)+p[2][n]*b),y[1].push(y[0][n]*(1-b)+y[2][n]*b);for(o=0;o<h;o++){for(this.curFillColor=[0,0,0,0],this.curStrokeColor=[0,0,0,0],m=e=t=r=0;m<3;m++){for(n=0;n<4;n++)this.curFillColor[n]+=this._lookUpTableQuadratic[o][m]*p[m][n],this.curStrokeColor[n]+=this._lookUpTableQuadratic[o][m]*y[m][n];e+=i[m]*this._lookUpTableQuadratic[o][m],t+=a[m]*this._lookUpTableQuadratic[o][m],r+=v[m]*this._lookUpTableQuadratic[o][m]}this.vertex(e,t,r)}this.curFillColor=p[2],this.curStrokeColor=y[2],this.immediateMode._quadraticVertex[0]=arguments.length<=3?void 0:arguments[3],this.immediateMode._quadraticVertex[1]=arguments.length<=4?void 0:arguments[4],this.immediateMode._quadraticVertex[2]=arguments.length<=5?void 0:arguments[5]}},S.default.RendererGL.prototype.curveVertex=function(){var e,t,r,o,n,s,i=[],a=[],l=arguments.length;if(0===this._lookUpTableBezier.length||this._lutBezierDetail!==this._pInst._curveDetail){this._lookUpTableBezier=[],this._lutBezierDetail=this._pInst._curveDetail;for(var u=1/this._lutBezierDetail,c=0,d=1,f=0;c<1;){if(s=parseFloat(c.toFixed(6)),this._lookUpTableBezier[f]=this._bezierCoefficients(s),d.toFixed(6)===u.toFixed(6)){s=parseFloat(d.toFixed(6))+parseFloat(c.toFixed(6)),++f,this._lookUpTableBezier[f]=this._bezierCoefficients(s);break}c+=u,d-=u,++f}}var h=this._lookUpTableBezier.length;if(2===l){if(this.immediateMode._curveVertex.push(arguments.length<=0?void 0:arguments[0]),this.immediateMode._curveVertex.push(arguments.length<=1?void 0:arguments[1]),8===this.immediateMode._curveVertex.length){for(this.isCurve=!0,i=this._bezierToCatmull([this.immediateMode._curveVertex[0],this.immediateMode._curveVertex[2],this.immediateMode._curveVertex[4],this.immediateMode._curveVertex[6]]),a=this._bezierToCatmull([this.immediateMode._curveVertex[1],this.immediateMode._curveVertex[3],this.immediateMode._curveVertex[5],this.immediateMode._curveVertex[7]]),n=0;n<h;n++)t=i[0]*this._lookUpTableBezier[n][0]+i[1]*this._lookUpTableBezier[n][1]+i[2]*this._lookUpTableBezier[n][2]+i[3]*this._lookUpTableBezier[n][3],r=a[0]*this._lookUpTableBezier[n][0]+a[1]*this._lookUpTableBezier[n][1]+a[2]*this._lookUpTableBezier[n][2]+a[3]*this._lookUpTableBezier[n][3],this.vertex(t,r);for(n=0;n<l;n++)this.immediateMode._curveVertex.shift()}}else if(3===l&&(this.immediateMode._curveVertex.push(arguments.length<=0?void 0:arguments[0]),this.immediateMode._curveVertex.push(arguments.length<=1?void 0:arguments[1]),this.immediateMode._curveVertex.push(arguments.length<=2?void 0:arguments[2]),12===this.immediateMode._curveVertex.length)){for(this.isCurve=!0,i=this._bezierToCatmull([this.immediateMode._curveVertex[0],this.immediateMode._curveVertex[3],this.immediateMode._curveVertex[6],this.immediateMode._curveVertex[9]]),a=this._bezierToCatmull([this.immediateMode._curveVertex[1],this.immediateMode._curveVertex[4],this.immediateMode._curveVertex[7],this.immediateMode._curveVertex[10]]),e=this._bezierToCatmull([this.immediateMode._curveVertex[2],this.immediateMode._curveVertex[5],this.immediateMode._curveVertex[8],this.immediateMode._curveVertex[11]]),n=0;n<h;n++)t=i[0]*this._lookUpTableBezier[n][0]+i[1]*this._lookUpTableBezier[n][1]+i[2]*this._lookUpTableBezier[n][2]+i[3]*this._lookUpTableBezier[n][3],r=a[0]*this._lookUpTableBezier[n][0]+a[1]*this._lookUpTableBezier[n][1]+a[2]*this._lookUpTableBezier[n][2]+a[3]*this._lookUpTableBezier[n][3],o=e[0]*this._lookUpTableBezier[n][0]+e[1]*this._lookUpTableBezier[n][1]+e[2]*this._lookUpTableBezier[n][2]+e[3]*this._lookUpTableBezier[n][3],this.vertex(t,r,o);for(n=0;n<l;n++)this.immediateMode._curveVertex.shift()}},S.default.RendererGL.prototype.image=function(e,t,r,o,n,s,i,a,l){this._isErasing&&this.blendMode(this._cachedBlendMode),this._pInst.push(),this._pInst.noLights(),this._pInst.noStroke(),this._pInst.texture(e),this._pInst.textureMode(_.NORMAL);var u=0,c=(t<=e.width&&(u=t/e.width),1),t=(t+o<=e.width&&(c=(t+o)/e.width),0),o=(r<=e.height&&(t=r/e.height),1);r+n<=e.height&&(o=(r+n)/e.height),this.beginShape(),this.vertex(s,i,0,u,t),this.vertex(s+a,i,0,c,t),this.vertex(s+a,i+l,0,c,o),this.vertex(s,i+l,0,u,o),this.endShape(_.CLOSE),this._pInst.pop(),this._isErasing&&this.blendMode(_.REMOVE)};var n=S.default;r.default=n},{"../core/constants":256,"../core/main":267,"./p5.Geometry":316,"core-js/modules/es.array.concat":149,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.slice":162,"core-js/modules/es.math.hypot":167,"core-js/modules/es.number.to-fixed":171,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],311:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.splice"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.splice"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var s=(l=e("../core/main"))&&l.__esModule?l:{default:l},n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}s.default.prototype.orbitControl=function(e,t,r){var o,n;if(this._assert3d("orbitControl"),s.default._validateParameters("orbitControl",arguments),this.mouseX<this.width&&0<this.mouseX&&this.mouseY<this.height&&0<this.mouseY)return o=this._renderer._curCamera,void 0===e&&(e=1),void 0===t&&(t=e),void 0===r&&(r=.5),!0!==this.contextMenuDisabled&&(this.canvas.oncontextmenu=function(){return!1},this._setProperty("contextMenuDisabled",!0)),!0!==this.wheelDefaultDisabled&&(this.canvas.onwheel=function(){return!1},this._setProperty("wheelDefaultDisabled",!0)),n=this.height<this.width?this.height:this.width,this._mouseWheelDeltaY!==this._pmouseWheelDeltaY&&(0<this._mouseWheelDeltaY?this._renderer._curCamera._orbit(0,0,r*n):this._renderer._curCamera._orbit(0,0,-r*n)),this.mouseIsPressed&&(this.mouseButton===this.LEFT?(r=-e*(this.mouseX-this.pmouseX)/n,n=t*(this.mouseY-this.pmouseY)/n,this._renderer._curCamera._orbit(r,n,0)):this.mouseButton===this.RIGHT&&(r=o._getLocalAxes(),0!==(n=Math.sqrt(r.x[0]*r.x[0]+r.x[2]*r.x[2]))&&(r.x[0]/=n,r.x[2]/=n),0!==(n=Math.sqrt(r.y[0]*r.y[0]+r.y[2]*r.y[2]))&&(r.y[0]/=n,r.y[2]/=n),n=-1*e*(this.mouseX-this.pmouseX),e=-1*t*(this.mouseY-this.pmouseY),o.setPosition(o.eyeX+n*r.x[0]+e*r.z[0],o.eyeY,o.eyeZ+n*r.x[2]+e*r.z[2]))),this},s.default.prototype.debugMode=function(){this._assert3d("debugMode");for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];s.default._validateParameters("debugMode",t);for(var o=this._registeredMethods.post.length-1;0<=o;o--)this._registeredMethods.post[o].toString()!==this._grid().toString()&&this._registeredMethods.post[o].toString()!==this._axesIcon().toString()||this._registeredMethods.post.splice(o,1);t[0]===n.GRID?this.registerMethod("post",this._grid.call(this,t[1],t[2],t[3],t[4],t[5])):t[0]===n.AXES?this.registerMethod("post",this._axesIcon.call(this,t[1],t[2],t[3],t[4])):(this.registerMethod("post",this._grid.call(this,t[0],t[1],t[2],t[3],t[4])),this.registerMethod("post",this._axesIcon.call(this,t[5],t[6],t[7],t[8])))},s.default.prototype.noDebugMode=function(){this._assert3d("noDebugMode");for(var e=this._registeredMethods.post.length-1;0<=e;e--)this._registeredMethods.post[e].toString()!==this._grid().toString()&&this._registeredMethods.post[e].toString()!==this._axesIcon().toString()||this._registeredMethods.post.splice(e,1)},s.default.prototype._grid=function(e,r,o,n,s){void 0===e&&(e=this.width/2),void 0===r&&(r=Math.round(e/30)<4?4:Math.round(e/30)),void 0===o&&(o=0),void 0===n&&(n=0),void 0===s&&(s=0);var i=e/r,a=e/2;return function(){this.push(),this.stroke(255*this._renderer.curStrokeColor[0],255*this._renderer.curStrokeColor[1],255*this._renderer.curStrokeColor[2]),this._renderer.uMVMatrix.set(this._renderer._curCamera.cameraMatrix.mat4[0],this._renderer._curCamera.cameraMatrix.mat4[1],this._renderer._curCamera.cameraMatrix.mat4[2],this._renderer._curCamera.cameraMatrix.mat4[3],this._renderer._curCamera.cameraMatrix.mat4[4],this._renderer._curCamera.cameraMatrix.mat4[5],this._renderer._curCamera.cameraMatrix.mat4[6],this._renderer._curCamera.cameraMatrix.mat4[7],this._renderer._curCamera.cameraMatrix.mat4[8],this._renderer._curCamera.cameraMatrix.mat4[9],this._renderer._curCamera.cameraMatrix.mat4[10],this._renderer._curCamera.cameraMatrix.mat4[11],this._renderer._curCamera.cameraMatrix.mat4[12],this._renderer._curCamera.cameraMatrix.mat4[13],this._renderer._curCamera.cameraMatrix.mat4[14],this._renderer._curCamera.cameraMatrix.mat4[15]);for(var e=0;e<=r;e++)this.beginShape(this.LINES),this.vertex(-a+o,n,e*i-a+s),this.vertex(a+o,n,e*i-a+s),this.endShape();for(var t=0;t<=r;t++)this.beginShape(this.LINES),this.vertex(t*i-a+o,n,-a+s),this.vertex(t*i-a+o,n,a+s),this.endShape();this.pop()}},s.default.prototype._axesIcon=function(e,t,r,o){return void 0===e&&(e=40<this.width/20?this.width/20:40),void 0===t&&(t=-this.width/4),void 0===r&&(r=t),void 0===o&&(o=t),function(){this.push(),this._renderer.uMVMatrix.set(this._renderer._curCamera.cameraMatrix.mat4[0],this._renderer._curCamera.cameraMatrix.mat4[1],this._renderer._curCamera.cameraMatrix.mat4[2],this._renderer._curCamera.cameraMatrix.mat4[3],this._renderer._curCamera.cameraMatrix.mat4[4],this._renderer._curCamera.cameraMatrix.mat4[5],this._renderer._curCamera.cameraMatrix.mat4[6],this._renderer._curCamera.cameraMatrix.mat4[7],this._renderer._curCamera.cameraMatrix.mat4[8],this._renderer._curCamera.cameraMatrix.mat4[9],this._renderer._curCamera.cameraMatrix.mat4[10],this._renderer._curCamera.cameraMatrix.mat4[11],this._renderer._curCamera.cameraMatrix.mat4[12],this._renderer._curCamera.cameraMatrix.mat4[13],this._renderer._curCamera.cameraMatrix.mat4[14],this._renderer._curCamera.cameraMatrix.mat4[15]),this.strokeWeight(2),this.stroke(255,0,0),this.beginShape(this.LINES),this.vertex(t,r,o),this.vertex(t+e,r,o),this.endShape(),this.stroke(0,255,0),this.beginShape(this.LINES),this.vertex(t,r,o),this.vertex(t,r+e,o),this.endShape(),this.stroke(0,0,255),this.beginShape(this.LINES),this.vertex(t,r,o),this.vertex(t,r,o+e),this.endShape(),this.pop()}};var l=s.default;r.default=l},{"../core/constants":256,"../core/main":267,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.splice":164,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],312:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var m=(s=e("../core/main"))&&s.__esModule?s:{default:s},n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}m.default.prototype.ambientLight=function(e,t,r,o){this._assert3d("ambientLight"),m.default._validateParameters("ambientLight",arguments);var n=this.color.apply(this,arguments);return this._renderer.ambientLightColors.push(n._array[0],n._array[1],n._array[2]),this._renderer._enableLighting=!0,this},m.default.prototype.specularColor=function(e,t,r){this._assert3d("specularColor"),m.default._validateParameters("specularColor",arguments);var o=this.color.apply(this,arguments);return this._renderer.specularColors=[o._array[0],o._array[1],o._array[2]],this},m.default.prototype.directionalLight=function(e,t,r,o,n,s){this._assert3d("directionalLight"),m.default._validateParameters("directionalLight",arguments),e=e instanceof m.default.Color?e:this.color(e,t,r);var i,a,t=arguments[arguments.length-1],r="number"==typeof t?(i=arguments[arguments.length-3],a=arguments[arguments.length-2],arguments[arguments.length-1]):(i=t.x,a=t.y,t.z),t=Math.sqrt(i*i+a*a+r*r);return this._renderer.directionalLightDirections.push(i/t,a/t,r/t),this._renderer.directionalLightDiffuseColors.push(e._array[0],e._array[1],e._array[2]),Array.prototype.push.apply(this._renderer.directionalLightSpecularColors,this._renderer.specularColors),this._renderer._enableLighting=!0,this},m.default.prototype.pointLight=function(e,t,r,o,n,s){this._assert3d("pointLight"),m.default._validateParameters("pointLight",arguments),e=e instanceof m.default.Color?e:this.color(e,t,r);var i,a,t=arguments[arguments.length-1],r="number"==typeof t?(i=arguments[arguments.length-3],a=arguments[arguments.length-2],arguments[arguments.length-1]):(i=t.x,a=t.y,t.z);return this._renderer.pointLightPositions.push(i,a,r),this._renderer.pointLightDiffuseColors.push(e._array[0],e._array[1],e._array[2]),Array.prototype.push.apply(this._renderer.pointLightSpecularColors,this._renderer.specularColors),this._renderer._enableLighting=!0,this},m.default.prototype.lights=function(){var e;return this._assert3d("lights"),this._colorMode===n.RGB?(this.ambientLight(128,128,128),this.directionalLight(128,128,128,0,0,-1)):(e=this._colorMaxes[this._colorMode][2],this.ambientLight(0,0,e),this.directionalLight(0,0,e,0,0,-1)),this},m.default.prototype.lightFalloff=function(e,t,r){return this._assert3d("lightFalloff"),m.default._validateParameters("lightFalloff",arguments),e<0&&(e=0,console.warn("Value of constant argument in lightFalloff() should be never be negative. Set to 0.")),t<0&&(t=0,console.warn("Value of linear argument in lightFalloff() should be never be negative. Set to 0.")),r<0&&(r=0,console.warn("Value of quadratic argument in lightFalloff() should be never be negative. Set to 0.")),0===e&&0===t&&0===r&&(e=1,console.warn("Either one of the three arguments in lightFalloff() should be greater than zero. Set constant argument to 1.")),this._renderer.constantAttenuation=e,this._renderer.linearAttenuation=t,this._renderer.quadraticAttenuation=r,this},m.default.prototype.spotLight=function(e,t,r,o,n,s,i,a,l,u,c){this._assert3d("spotLight"),m.default._validateParameters("spotLight",arguments);var d,f,h,p=arguments.length;switch(p){case 11:case 10:d=this.color(e,t,r),f=new m.default.Vector(o,n,s),h=new m.default.Vector(i,a,l);break;case 9:e instanceof m.default.Color?(d=e,f=new m.default.Vector(t,r,o),h=new m.default.Vector(n,s,i),u=a,c=l):o instanceof m.default.Vector?(d=this.color(e,t,r),f=o,h=new m.default.Vector(n,s,i),u=a,c=l):i instanceof m.default.Vector?(d=this.color(e,t,r),f=new m.default.Vector(o,n,s),h=i,u=a,c=l):(d=this.color(e,t,r),f=new m.default.Vector(o,n,s),h=new m.default.Vector(i,a,l));break;case 8:u=(h=e instanceof m.default.Color?(d=e,f=new m.default.Vector(t,r,o),new m.default.Vector(n,s,i)):o instanceof m.default.Vector?(d=this.color(e,t,r),f=o,new m.default.Vector(n,s,i)):(d=this.color(e,t,r),f=new m.default.Vector(o,n,s),i),a);break;case 7:e instanceof m.default.Color&&t instanceof m.default.Vector?(d=e,f=t,h=new m.default.Vector(r,o,n),u=s,c=i):e instanceof m.default.Color&&n instanceof m.default.Vector?(d=e,f=new m.default.Vector(t,r,o),h=n,u=s,c=i):o instanceof m.default.Vector&&n instanceof m.default.Vector?(d=this.color(e,t,r),f=o,h=n,u=s,c=i):h=e instanceof m.default.Color?(d=e,f=new m.default.Vector(t,r,o),new m.default.Vector(n,s,i)):o instanceof m.default.Vector?(d=this.color(e,t,r),f=o,new m.default.Vector(n,s,i)):(d=this.color(e,t,r),f=new m.default.Vector(o,n,s),i);break;case 6:o instanceof m.default.Vector&&n instanceof m.default.Vector?(d=this.color(e,t,r),f=o,h=n,u=s):e instanceof m.default.Color&&n instanceof m.default.Vector?(d=e,f=new m.default.Vector(t,r,o),h=n,u=s):e instanceof m.default.Color&&t instanceof m.default.Vector&&(d=e,f=t,h=new m.default.Vector(r,o,n),u=s);break;case 5:e instanceof m.default.Color&&t instanceof m.default.Vector&&r instanceof m.default.Vector?(d=e,f=t,h=r,u=o,c=n):o instanceof m.default.Vector&&n instanceof m.default.Vector?(d=this.color(e,t,r),f=o,h=n):e instanceof m.default.Color&&n instanceof m.default.Vector?(d=e,f=new m.default.Vector(t,r,o),h=n):e instanceof m.default.Color&&t instanceof m.default.Vector&&(d=e,f=t,h=new m.default.Vector(r,o,n));break;case 4:d=e,f=t,h=r,u=o;break;case 3:d=e,f=t,h=r;break;default:return console.warn("Sorry, input for spotlight() is not in prescribed format. Too ".concat(p<3?"few":"many"," arguments were provided")),this}return this._renderer.spotLightDiffuseColors.push(d._array[0],d._array[1],d._array[2]),Array.prototype.push.apply(this._renderer.spotLightSpecularColors,this._renderer.specularColors),this._renderer.spotLightPositions.push(f.x,f.y,f.z),h.normalize(),this._renderer.spotLightDirections.push(h.x,h.y,h.z),void 0===u&&(u=Math.PI/3),void 0!==c&&c<1?(c=1,console.warn("Value of concentration needs to be greater than 1. Setting it to 1")):void 0===c&&(c=100),u=this._renderer._pInst._toRadians(u),this._renderer.spotLightAngle.push(Math.cos(u)),this._renderer.spotLightConc.push(c),this._renderer._enableLighting=!0,this},m.default.prototype.noLights=function(){return this._assert3d("noLights"),m.default._validateParameters("noLights",arguments),this._renderer._enableLighting=!1,this._renderer.ambientLightColors.length=0,this._renderer.specularColors=[1,1,1],this._renderer.directionalLightDirections.length=0,this._renderer.directionalLightDiffuseColors.length=0,this._renderer.directionalLightSpecularColors.length=0,this._renderer.pointLightPositions.length=0,this._renderer.pointLightDiffuseColors.length=0,this._renderer.pointLightSpecularColors.length=0,this._renderer.spotLightPositions.length=0,this._renderer.spotLightDirections.length=0,this._renderer.spotLightDiffuseColors.length=0,this._renderer.spotLightSpecularColors.length=0,this._renderer.spotLightAngle.length=0,this._renderer.spotLightConc.length=0,this._renderer.constantAttenuation=1,this._renderer.linearAttenuation=0,this._renderer.quadraticAttenuation=0,this._renderer._useShininess=1,this};var s=m.default;r.default=s},{"../core/constants":256,"../core/main":267,"core-js/modules/es.array.iterator":158,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],313:[function(e,t,r){"use strict";e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.splice"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.trim"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.splice"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.trim"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var x=(o=e("../core/main"))&&o.__esModule?o:{default:o};e("./p5.Geometry"),x.default.prototype.loadModel=function(e){x.default._validateParameters("loadModel",arguments);var y,g,t,r=e.slice(-4),v=("boolean"==typeof arguments[1]?(y=arguments[1],g=arguments[2],t=arguments[3],void 0!==arguments[4]&&(r=arguments[4])):(y=!1,g=arguments[1],t=arguments[2],void 0!==arguments[3]&&(r=arguments[3])),new x.default.Geometry),b=(v.gid="".concat(e,"|").concat(y),this);return r.match(/\.stl$/i)?this.httpDo(e,"GET","arrayBuffer",function(e){!function(e,t){if(function(e){for(var t=new DataView(e),r=[115,111,108,105,100],o=0;o<5;o++)if(function(e,t,r){for(var o=0,n=e.length;o<n;o++)if(e[o]!==t.getUint8(r+o,!1))return;return 1}(r,t,o))return;return 1}(t))!function(e,t){for(var r,o,n,s,i,a,l,u=new DataView(t),c=u.getUint32(80,!0),d=!1,f=0;f<70;f++)1129270351===u.getUint32(f,!1)&&82===u.getUint8(f+4)&&61===u.getUint8(f+5)&&(d=!0,s=[],i=u.getUint8(f+6)/255,a=u.getUint8(f+7)/255,l=u.getUint8(f+8)/255);for(var h=0;h<c;h++){for(var p,m=84+50*h,y=u.getFloat32(m,!0),g=u.getFloat32(4+m,!0),v=u.getFloat32(8+m,!0),b=(d&&(p=u.getUint16(48+m,!0),n=0==(32768&p)?(r=(31&p)/31,o=(p>>5&31)/31,(p>>10&31)/31):(r=i,o=a,l)),new x.default.Vector(y,g,v)),j=1;j<=3;j++){var _=m+12*j,_=new x.default.Vector(u.getFloat32(_,!0),u.getFloat32(4+_,!0),u.getFloat32(8+_,!0));e.vertices.push(_),e.vertexNormals.push(b),d&&s.push(r,o,n)}e.faces.push([3*h,3*h+1,3*h+2]),e.uvs.push([0,0],[0,0],[0,0])}}(e,t);else{t=new DataView(t);if(!("TextDecoder"in window))return console.warn("Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)");t=new TextDecoder("utf-8").decode(t).split("\n");!function(e,t){for(var r,o,n="",s=[],i=0;i<t.length;++i){for(var a=t[i].trim(),l=a.split(" "),u=0;u<l.length;++u)""===l[u]&&l.splice(u,1);if(0!==l.length)switch(n){case"":if("solid"!==l[0])return console.error(a),console.error('Invalid state "'.concat(l[0],'", should be "solid"'));n="solid";break;case"solid":if("facet"!==l[0]||"normal"!==l[1])return console.error(a),console.error('Invalid state "'.concat(l[0],'", should be "facet normal"'));r=new x.default.Vector(parseFloat(l[2]),parseFloat(l[3]),parseFloat(l[4])),e.vertexNormals.push(r,r,r),n="facet normal";break;case"facet normal":if("outer"!==l[0]||"loop"!==l[1])return console.error(a),console.error('Invalid state "'.concat(l[0],'", should be "outer loop"'));n="vertex";break;case"vertex":if("vertex"===l[0])o=new x.default.Vector(parseFloat(l[1]),parseFloat(l[2]),parseFloat(l[3])),e.vertices.push(o),e.uvs.push([0,0]),s.push(e.vertices.indexOf(o));else{if("endloop"!==l[0])return console.error(a),console.error('Invalid state "'.concat(l[0],'", should be "vertex" or "endloop"'));e.faces.push(s),s=[],n="endloop"}break;case"endloop":if("endfacet"!==l[0])return console.error(a),console.error('Invalid state "'.concat(l[0],'", should be "endfacet"'));n="endfacet";break;case"endfacet":if("endsolid"!==l[0]){if("facet"!==l[0]||"normal"!==l[1])return console.error(a),console.error('Invalid state "'.concat(l[0],'", should be "endsolid" or "facet normal"'));r=new x.default.Vector(parseFloat(l[2]),parseFloat(l[3]),parseFloat(l[4])),e.vertexNormals.push(r,r,r),n="facet normal"}break;default:console.error('Invalid state "'.concat(n,'"'))}}}(e,t)}}(v,e),y&&v.normalize(),b._decrementPreload(),"function"==typeof g&&g(v)},t):r.match(/\.obj$/i)?this.loadStrings(e,function(e){for(var t=v,r=e,o={v:[],vt:[],vn:[]},n={},s=0;s<r.length;++s){var i=r[s].trim().split(/\b\s+/);if(0<i.length)if("v"===i[0]||"vn"===i[0]){var a=new x.default.Vector(parseFloat(i[1]),parseFloat(i[2]),parseFloat(i[3]));o[i[0]].push(a)}else if("vt"===i[0]){a=[parseFloat(i[1]),1-parseFloat(i[2])];o[i[0]].push(a)}else if("f"===i[0])for(var l=3;l<i.length;++l){for(var u=[],c=[1,l-1,l],d=0;d<c.length;++d){var f=i[c[d]],h=0;if(void 0!==n[f])h=n[f];else{for(var p=f.split("/"),m=0;m<p.length;m++)p[m]=parseInt(p[m])-1;h=n[f]=t.vertices.length,t.vertices.push(o.v[p[0]].copy()),o.vt[p[1]]?t.uvs.push(o.vt[p[1]].slice()):t.uvs.push([0,0]),o.vn[p[2]]&&t.vertexNormals.push(o.vn[p[2]].copy())}u.push(h)}u[0]!==u[1]&&u[0]!==u[2]&&u[1]!==u[2]&&t.faces.push(u)}}0===t.vertexNormals.length&&t.computeNormals(),y&&v.normalize(),b._decrementPreload(),"function"==typeof g&&g(v)},t):(x.default._friendlyFileLoadError(3,e),t?t():console.error("Sorry, the file type is invalid. Only OBJ and STL files are supported.")),v},x.default.prototype.model=function(e){this._assert3d("model"),x.default._validateParameters("model",arguments),0<e.vertices.length&&(this._renderer.geometryInHash(e.gid)||(e._makeTriangleEdges()._edgesToVertices(),this._renderer.createBuffers(e.gid,e)),this._renderer.drawBuffers(e.gid))};var o=x.default;r.default=o},{"../core/main":267,"./p5.Geometry":316,"core-js/modules/es.array.concat":149,"core-js/modules/es.array.index-of":157,"core-js/modules/es.array.slice":162,"core-js/modules/es.array.splice":164,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.string.match":187,"core-js/modules/es.string.split":191,"core-js/modules/es.string.trim":193}],314:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.join"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var u=(s=e("../core/main"))&&s.__esModule?s:{default:s},n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}e("./p5.Texture"),u.default.prototype.loadShader=function(e,t,r,o){u.default._validateParameters("loadShader",arguments),o=o||console.error;function n(){i._decrementPreload(),r&&r(s)}var s=new u.default.Shader,i=this,a=!1,l=!1;return this.loadStrings(e,function(e){s._vertSrc=e.join("\n"),l=!0,a&&n()},o),this.loadStrings(t,function(e){s._fragSrc=e.join("\n"),a=!0,l&&n()},o),s},u.default.prototype.createShader=function(e,t){return this._assert3d("createShader"),u.default._validateParameters("createShader",arguments),new u.default.Shader(this._renderer,e,t)},u.default.prototype.shader=function(e){return this._assert3d("shader"),u.default._validateParameters("shader",arguments),void 0===e._renderer&&(e._renderer=this._renderer),e.init(),e.isStrokeShader()?this._renderer.userStrokeShader=e:(this._renderer.userFillShader=e,this._renderer._useNormalMaterial=!1),this},u.default.prototype.resetShader=function(){return this._renderer.userFillShader=this._renderer.userStrokeShader=null,this},u.default.prototype.texture=function(e){return this._assert3d("texture"),u.default._validateParameters("texture",arguments),e.gifProperties&&e._animateGif(this),this._renderer.drawMode=n.TEXTURE,this._renderer._useSpecularMaterial=!1,this._renderer._useEmissiveMaterial=!1,this._renderer._useNormalMaterial=!1,this._renderer._tex=e,this._renderer._setProperty("_doFill",!0),this},u.default.prototype.textureMode=function(e){e!==n.IMAGE&&e!==n.NORMAL?console.warn("You tried to set ".concat(e," textureMode only supports IMAGE & NORMAL ")):this._renderer.textureMode=e},u.default.prototype.textureWrap=function(e){for(var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:e,r=(this._renderer.textureWrapX=e,this._renderer.textureWrapY=t,this._renderer.textures),o=0;o<r.length;o++)r[o].setWrapMode(e,t)},u.default.prototype.normalMaterial=function(){this._assert3d("normalMaterial");for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return u.default._validateParameters("normalMaterial",t),this._renderer.drawMode=n.FILL,this._renderer._useSpecularMaterial=!1,this._renderer._useEmissiveMaterial=!1,this._renderer._useNormalMaterial=!0,this._renderer.curFillColor=[1,1,1,1],this._renderer._setProperty("_doFill",!0),this.noStroke(),this},u.default.prototype.ambientMaterial=function(e,t,r){this._assert3d("ambientMaterial"),u.default._validateParameters("ambientMaterial",arguments);var o=u.default.prototype.color.apply(this,arguments);return this._renderer.curAmbientColor=o._array,this._renderer._useNormalMaterial=!1,this._renderer._enableLighting=!0,this._renderer._tex=null,this._renderer._setProperty("_doFill",!0),this},u.default.prototype.emissiveMaterial=function(e,t,r,o){this._assert3d("emissiveMaterial"),u.default._validateParameters("emissiveMaterial",arguments);var n=u.default.prototype.color.apply(this,arguments);return this._renderer.curEmissiveColor=n._array,this._renderer._useEmissiveMaterial=!0,this._renderer._useNormalMaterial=!1,this._renderer._enableLighting=!0,this._renderer._tex=null,this},u.default.prototype.specularMaterial=function(e,t,r,o){this._assert3d("specularMaterial"),u.default._validateParameters("specularMaterial",arguments);var n=u.default.prototype.color.apply(this,arguments);return this._renderer.curSpecularColor=n._array,this._renderer._useSpecularMaterial=!0,this._renderer._useNormalMaterial=!1,this._renderer._enableLighting=!0,this._renderer._tex=null,this},u.default.prototype.shininess=function(e){return this._assert3d("shininess"),u.default._validateParameters("shininess",arguments),this._renderer._useShininess=e=e<1?1:e,this},u.default.RendererGL.prototype._applyColorBlend=function(e){var t=this.GL,r=this.drawMode===n.TEXTURE,r=this.userFillShader||this.userStrokeShader||this.userPointShader||r||this.curBlendMode!==n.BLEND||e[e.length-1]<1||this._isErasing;return r!==this._isBlending&&(r||this.curBlendMode!==n.BLEND&&this.curBlendMode!==n.ADD?t.enable(t.BLEND):t.disable(t.BLEND),t.depthMask(!0),this._isBlending=r),this._applyBlendMode(),e},u.default.RendererGL.prototype._applyBlendMode=function(){if(this._cachedBlendMode!==this.curBlendMode){var e=this.GL;switch(this.curBlendMode){case n.BLEND:e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case n.ADD:e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ONE);break;case n.REMOVE:e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ZERO,e.ONE_MINUS_SRC_ALPHA);break;case n.MULTIPLY:e.blendEquation(e.FUNC_ADD),e.blendFunc(e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA);break;case n.SCREEN:e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_COLOR);break;case n.EXCLUSION:e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ONE_MINUS_DST_COLOR,e.ONE_MINUS_SRC_COLOR,e.ONE,e.ONE);break;case n.REPLACE:e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ZERO);break;case n.SUBTRACT:e.blendEquationSeparate(e.FUNC_REVERSE_SUBTRACT,e.FUNC_ADD),e.blendFuncSeparate(e.ONE,e.ONE,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case n.DARKEST:this.blendExt?(e.blendEquationSeparate(this.blendExt.MIN_EXT,e.FUNC_ADD),e.blendFuncSeparate(e.ONE,e.ONE,e.ONE,e.ONE)):console.warn("blendMode(DARKEST) does not work in your browser in WEBGL mode.");break;case n.LIGHTEST:this.blendExt?(e.blendEquationSeparate(this.blendExt.MAX_EXT,e.FUNC_ADD),e.blendFuncSeparate(e.ONE,e.ONE,e.ONE,e.ONE)):console.warn("blendMode(LIGHTEST) does not work in your browser in WEBGL mode.");break;default:console.error("Oops! Somehow RendererGL set curBlendMode to an unsupported mode.")}this._isErasing||(this._cachedBlendMode=this.curBlendMode)}};var s=u.default;r.default=s},{"../core/constants":256,"../core/main":267,"./p5.Texture":323,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.join":159,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],315:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var f=(e=e("../core/main"))&&e.__esModule?e:{default:e};f.default.prototype.camera=function(){var e;this._assert3d("camera");for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return f.default._validateParameters("camera",r),(e=this._renderer._curCamera).camera.apply(e,r),this},f.default.prototype.perspective=function(){var e;this._assert3d("perspective");for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return f.default._validateParameters("perspective",r),(e=this._renderer._curCamera).perspective.apply(e,r),this},f.default.prototype.ortho=function(){var e;this._assert3d("ortho");for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return f.default._validateParameters("ortho",r),(e=this._renderer._curCamera).ortho.apply(e,r),this},f.default.prototype.frustum=function(){var e;this._assert3d("frustum");for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return f.default._validateParameters("frustum",r),(e=this._renderer._curCamera).frustum.apply(e,r),this},f.default.prototype.createCamera=function(){this._assert3d("createCamera");var e=new f.default.Camera(this._renderer);return e._computeCameraDefaultSettings(),e._setDefaultCamera(),this._renderer._curCamera=e},f.default.Camera=function(e){this._renderer=e,this.cameraType="default",this.cameraMatrix=new f.default.Matrix,this.projMatrix=new f.default.Matrix},f.default.Camera.prototype.perspective=function(e,t,r,o){this.cameraType=0<arguments.length?"custom":"default",void 0===e?(e=this.defaultCameraFOV,this.cameraFOV=e):this.cameraFOV=this._renderer._pInst._toRadians(e),void 0===t&&(t=this.defaultAspectRatio),void 0===r&&(r=this.defaultCameraNear),void 0===o&&(o=this.defaultCameraFar),r<=1e-4&&(r=.01,console.log("Avoid perspective near plane values close to or below 0. Setting value to 0.01.")),o<r&&console.log("Perspective far plane value is less than near plane value. Nothing will be shown."),this.aspectRatio=t,this.cameraNear=r,this.cameraFar=o,this.projMatrix=f.default.Matrix.identity();var e=1/Math.tan(this.cameraFOV/2),n=1/(this.cameraNear-this.cameraFar);this.projMatrix.set(e/t,0,0,0,0,-e,0,0,0,0,(o+r)*n,-1,0,0,2*o*r*n,0),this._isActive()&&this._renderer.uPMatrix.set(this.projMatrix.mat4[0],this.projMatrix.mat4[1],this.projMatrix.mat4[2],this.projMatrix.mat4[3],this.projMatrix.mat4[4],this.projMatrix.mat4[5],this.projMatrix.mat4[6],this.projMatrix.mat4[7],this.projMatrix.mat4[8],this.projMatrix.mat4[9],this.projMatrix.mat4[10],this.projMatrix.mat4[11],this.projMatrix.mat4[12],this.projMatrix.mat4[13],this.projMatrix.mat4[14],this.projMatrix.mat4[15])},f.default.Camera.prototype.ortho=function(e,t,r,o,n,s){void 0===e&&(e=-this._renderer.width/2),void 0===t&&(t=+this._renderer.width/2),void 0===r&&(r=-this._renderer.height/2),void 0===n&&(n=0);var i=t-e,a=(o=void 0===o?+this._renderer.height/2:o)-r,l=(s=void 0===s?Math.max(this._renderer.width,this._renderer.height):s)-n,u=2/i,c=2/a,d=-2/l,t=-(t+e)/i,e=-(o+r)/a,i=-(s+n)/l;this.projMatrix=f.default.Matrix.identity(),this.projMatrix.set(u,0,0,0,0,-c,0,0,0,0,d,0,t,e,i,1),this._isActive()&&this._renderer.uPMatrix.set(this.projMatrix.mat4[0],this.projMatrix.mat4[1],this.projMatrix.mat4[2],this.projMatrix.mat4[3],this.projMatrix.mat4[4],this.projMatrix.mat4[5],this.projMatrix.mat4[6],this.projMatrix.mat4[7],this.projMatrix.mat4[8],this.projMatrix.mat4[9],this.projMatrix.mat4[10],this.projMatrix.mat4[11],this.projMatrix.mat4[12],this.projMatrix.mat4[13],this.projMatrix.mat4[14],this.projMatrix.mat4[15]),this.cameraType="custom"},f.default.Camera.prototype.frustum=function(e,t,r,o,n,s){void 0===e&&(e=-this._renderer.width/2),void 0===t&&(t=+this._renderer.width/2),void 0===r&&(r=-this._renderer.height/2),void 0===n&&(n=0);var i=t-e,a=(o=void 0===o?+this._renderer.height/2:o)-r,l=(s=void 0===s?Math.max(this._renderer.width,this._renderer.height):s)-n,u=2*n/i,c=2*n/a,d=-2*s*n/l,t=(t+e)/i,e=(o+r)/a,i=-(s+n)/l;this.projMatrix=f.default.Matrix.identity(),this.projMatrix.set(u,0,0,0,0,c,0,0,t,e,i,-1,0,0,d,0),this._isActive()&&this._renderer.uPMatrix.set(this.projMatrix.mat4[0],this.projMatrix.mat4[1],this.projMatrix.mat4[2],this.projMatrix.mat4[3],this.projMatrix.mat4[4],this.projMatrix.mat4[5],this.projMatrix.mat4[6],this.projMatrix.mat4[7],this.projMatrix.mat4[8],this.projMatrix.mat4[9],this.projMatrix.mat4[10],this.projMatrix.mat4[11],this.projMatrix.mat4[12],this.projMatrix.mat4[13],this.projMatrix.mat4[14],this.projMatrix.mat4[15]),this.cameraType="custom"},f.default.Camera.prototype._rotateView=function(e,t,r,o){var n=this.centerX,s=this.centerY,i=this.centerZ,a=(n-=this.eyeX,s-=this.eyeY,i-=this.eyeZ,f.default.Matrix.identity(this._renderer._pInst)),e=(a.rotate(this._renderer._pInst._toRadians(e),t,r,o),[n*a.mat4[0]+s*a.mat4[4]+i*a.mat4[8],n*a.mat4[1]+s*a.mat4[5]+i*a.mat4[9],n*a.mat4[2]+s*a.mat4[6]+i*a.mat4[10]]);e[0]+=this.eyeX,e[1]+=this.eyeY,e[2]+=this.eyeZ,this.camera(this.eyeX,this.eyeY,this.eyeZ,e[0],e[1],e[2],this.upX,this.upY,this.upZ)},f.default.Camera.prototype.pan=function(e){var t=this._getLocalAxes();this._rotateView(e,t.y[0],t.y[1],t.y[2])},f.default.Camera.prototype.tilt=function(e){var t=this._getLocalAxes();this._rotateView(e,t.x[0],t.x[1],t.x[2])},f.default.Camera.prototype.lookAt=function(e,t,r){this.camera(this.eyeX,this.eyeY,this.eyeZ,e,t,r,this.upX,this.upY,this.upZ)},f.default.Camera.prototype.camera=function(e,t,r,o,n,s,i,a,l){void 0===e&&(e=this.defaultEyeX,t=this.defaultEyeY,r=this.defaultEyeZ,o=e,n=t,a=1,l=i=s=0),this.eyeX=e,this.eyeY=t,this.eyeZ=r,void 0!==o&&(this.centerX=o,this.centerY=n,this.centerZ=s),void 0!==i&&(this.upX=i,this.upY=a,this.upZ=l);o=this._getLocalAxes(),this.cameraMatrix.set(o.x[0],o.y[0],o.z[0],0,o.x[1],o.y[1],o.z[1],0,o.x[2],o.y[2],o.z[2],0,0,0,0,1),n=-e;return this.cameraMatrix.translate([n,-t,-r]),this._isActive()&&this._renderer.uMVMatrix.set(this.cameraMatrix.mat4[0],this.cameraMatrix.mat4[1],this.cameraMatrix.mat4[2],this.cameraMatrix.mat4[3],this.cameraMatrix.mat4[4],this.cameraMatrix.mat4[5],this.cameraMatrix.mat4[6],this.cameraMatrix.mat4[7],this.cameraMatrix.mat4[8],this.cameraMatrix.mat4[9],this.cameraMatrix.mat4[10],this.cameraMatrix.mat4[11],this.cameraMatrix.mat4[12],this.cameraMatrix.mat4[13],this.cameraMatrix.mat4[14],this.cameraMatrix.mat4[15]),this},f.default.Camera.prototype.move=function(e,t,r){var o=this._getLocalAxes(),e=[o.x[0]*e,o.x[1]*e,o.x[2]*e],t=[o.y[0]*t,o.y[1]*t,o.y[2]*t],o=[o.z[0]*r,o.z[1]*r,o.z[2]*r];this.camera(this.eyeX+e[0]+t[0]+o[0],this.eyeY+e[1]+t[1]+o[1],this.eyeZ+e[2]+t[2]+o[2],this.centerX+e[0]+t[0]+o[0],this.centerY+e[1]+t[1]+o[1],this.centerZ+e[2]+t[2]+o[2],this.upX,this.upY,this.upZ)},f.default.Camera.prototype.setPosition=function(e,t,r){var o=e-this.eyeX,n=t-this.eyeY,s=r-this.eyeZ;this.camera(e,t,r,this.centerX+o,this.centerY+n,this.centerZ+s,this.upX,this.upY,this.upZ)},f.default.Camera.prototype._computeCameraDefaultSettings=function(){this.defaultCameraFOV=60/180*Math.PI,this.defaultAspectRatio=this._renderer.width/this._renderer.height,this.defaultEyeX=0,this.defaultEyeY=0,this.defaultEyeZ=this._renderer.height/2/Math.tan(this.defaultCameraFOV/2),this.defaultCenterX=0,this.defaultCenterY=0,this.defaultCenterZ=0,this.defaultCameraNear=.1*this.defaultEyeZ,this.defaultCameraFar=10*this.defaultEyeZ},f.default.Camera.prototype._setDefaultCamera=function(){this.cameraFOV=this.defaultCameraFOV,this.aspectRatio=this.defaultAspectRatio,this.eyeX=this.defaultEyeX,this.eyeY=this.defaultEyeY,this.eyeZ=this.defaultEyeZ,this.centerX=this.defaultCenterX,this.centerY=this.defaultCenterY,this.centerZ=this.defaultCenterZ,this.upX=0,this.upY=1,this.upZ=0,this.cameraNear=this.defaultCameraNear,this.cameraFar=this.defaultCameraFar,this.perspective(),this.camera(),this.cameraType="default"},f.default.Camera.prototype._resize=function(){"default"===this.cameraType?(this._computeCameraDefaultSettings(),this._setDefaultCamera()):this.perspective(this.cameraFOV,this._renderer.width/this._renderer.height)},f.default.Camera.prototype.copy=function(){var e=new f.default.Camera(this._renderer);return e.cameraFOV=this.cameraFOV,e.aspectRatio=this.aspectRatio,e.eyeX=this.eyeX,e.eyeY=this.eyeY,e.eyeZ=this.eyeZ,e.centerX=this.centerX,e.centerY=this.centerY,e.centerZ=this.centerZ,e.cameraNear=this.cameraNear,e.cameraFar=this.cameraFar,e.cameraType=this.cameraType,e.cameraMatrix=this.cameraMatrix.copy(),e.projMatrix=this.projMatrix.copy(),e},f.default.Camera.prototype._getLocalAxes=function(){var e=this.eyeX-this.centerX,t=this.eyeY-this.centerY,r=this.eyeZ-this.centerZ,o=Math.sqrt(e*e+t*t+r*r),o=(0!==o&&(e/=o,t/=o,r/=o),this.upX),n=(a=this.upY)*r-(l=this.upZ)*t,s=-o*r+l*e,i=o*t-a*e,o=t*i-r*s,a=-e*i+r*n,l=e*s-t*n,u=Math.sqrt(n*n+s*s+i*i),u=(0!==u&&(n/=u,s/=u,i/=u),Math.sqrt(o*o+a*a+l*l));return 0!==u&&(o/=u,a/=u,l/=u),{x:[n,s,i],y:[o,a,l],z:[e,t,r]}},f.default.Camera.prototype._orbit=function(e,t,r){var o=this.eyeX-this.centerX,n=this.eyeY-this.centerY,s=this.eyeZ-this.centerZ,i=Math.sqrt(o*o+n*n+s*s),o=Math.atan2(o,s),s=Math.acos(Math.max(-1,Math.min(1,n/i))),n=0<this.upY?1:-1,e=(o+=n*e,((s+=n*t)<=0||s>=Math.PI)&&(n*=-1),(i+=r)<0&&(i=.1),Math.sin(s)*i*Math.sin(o)),t=Math.cos(s)*i,r=Math.sin(s)*i*Math.cos(o);this.camera(e+this.centerX,t+this.centerY,r+this.centerZ,this.centerX,this.centerY,this.centerZ,0,n,0)},f.default.Camera.prototype._isActive=function(){return this===this._renderer._curCamera},f.default.prototype.setCamera=function(e){this._renderer._curCamera=e,this._renderer.uPMatrix.set(e.projMatrix.mat4[0],e.projMatrix.mat4[1],e.projMatrix.mat4[2],e.projMatrix.mat4[3],e.projMatrix.mat4[4],e.projMatrix.mat4[5],e.projMatrix.mat4[6],e.projMatrix.mat4[7],e.projMatrix.mat4[8],e.projMatrix.mat4[9],e.projMatrix.mat4[10],e.projMatrix.mat4[11],e.projMatrix.mat4[12],e.projMatrix.mat4[13],e.projMatrix.mat4[14],e.projMatrix.mat4[15])};e=f.default.Camera;r.default=e},{"../core/main":267}],316:[function(e,t,r){"use strict";e("core-js/modules/es.array.slice"),e("core-js/modules/es.string.sub"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.string.sub"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var l=(e=e("../core/main"))&&e.__esModule?e:{default:e};l.default.Geometry=function(e,t,r){return this.vertices=[],this.lineVertices=[],this.lineTangentsIn=[],this.lineTangentsOut=[],this.lineSides=[],this.vertexNormals=[],this.faces=[],this.uvs=[],this.edges=[],this.vertexColors=[],this.vertexStrokeColors=[],this.lineVertexColors=[],this.detailX=void 0!==e?e:1,this.detailY=void 0!==t?t:1,this.dirtyFlags={},r instanceof Function&&r.call(this),this},l.default.Geometry.prototype.reset=function(){this.lineVertices.length=0,this.lineTangentsIn.length=0,this.lineTangentsOut.length=0,this.lineSides.length=0,this.vertices.length=0,this.edges.length=0,this.vertexColors.length=0,this.vertexStrokeColors.length=0,this.lineVertexColors.length=0,this.vertexNormals.length=0,this.uvs.length=0,this.dirtyFlags={}},l.default.Geometry.prototype.computeFaces=function(){this.faces.length=0;for(var e,t,r,o=this.detailX+1,n=0;n<this.detailY;n++)for(var s=0;s<this.detailX;s++)t=(n+1)*o+s+1,this.faces.push([n*o+s,e=n*o+s+1,r=(n+1)*o+s]),this.faces.push([r,e,t]);return this},l.default.Geometry.prototype._getFaceNormal=function(e){var e=this.faces[e],t=this.vertices[e[0]],r=this.vertices[e[1]],e=this.vertices[e[2]],r=l.default.Vector.sub(r,t),e=l.default.Vector.sub(e,t),t=l.default.Vector.cross(r,e),o=l.default.Vector.mag(t),r=o/(l.default.Vector.mag(r)*l.default.Vector.mag(e));return 0===r||isNaN(r)?(console.warn("p5.Geometry.prototype._getFaceNormal:","face has colinear sides or a repeated vertex"),t):(1<r&&(r=1),t.mult(Math.asin(r)/o))},l.default.Geometry.prototype.computeNormals=function(){for(var e=this.vertexNormals,t=this.vertices,r=this.faces,o=e.length=0;o<t.length;++o)e.push(new l.default.Vector);for(var n=0;n<r.length;++n)for(var s=r[n],i=this._getFaceNormal(n),a=0;a<3;++a)e[s[a]].add(i);for(o=0;o<t.length;++o)e[o].normalize();return this},l.default.Geometry.prototype.averageNormals=function(){for(var e=0;e<=this.detailY;e++){var t=this.detailX+1,r=l.default.Vector.add(this.vertexNormals[e*t],this.vertexNormals[e*t+this.detailX]),r=l.default.Vector.div(r,2);this.vertexNormals[e*t]=r,this.vertexNormals[e*t+this.detailX]=r}return this},l.default.Geometry.prototype.averagePoleNormals=function(){for(var e=new l.default.Vector(0,0,0),t=0;t<this.detailX;t++)e.add(this.vertexNormals[t]);for(var e=l.default.Vector.div(e,this.detailX),r=0;r<this.detailX;r++)this.vertexNormals[r]=e;e=new l.default.Vector(0,0,0);for(var o=this.vertices.length-1;o>this.vertices.length-1-this.detailX;o--)e.add(this.vertexNormals[o]);e=l.default.Vector.div(e,this.detailX);for(var n=this.vertices.length-1;n>this.vertices.length-1-this.detailX;n--)this.vertexNormals[n]=e;return this},l.default.Geometry.prototype._makeTriangleEdges=function(){if(this.edges.length=0,Array.isArray(this.strokeIndices))for(var e=0,t=this.strokeIndices.length;e<t;e++)this.edges.push(this.strokeIndices[e]);else for(var r=0;r<this.faces.length;r++)this.edges.push([this.faces[r][0],this.faces[r][1]]),this.edges.push([this.faces[r][1],this.faces[r][2]]),this.edges.push([this.faces[r][2],this.faces[r][0]]);return this},l.default.Geometry.prototype._edgesToVertices=function(){this.lineVertices.length=0,this.lineTangentsIn.length=0,this.lineTangentsOut.length=0,this.lineSides.length=0;for(var e,t=1<this.edges.length&&this.edges[0][0]===this.edges[this.edges.length-1][1],r=!1,o=0;o<this.edges.length;o++){var n=this.edges[o-1],s=this.edges[o],i=this.vertices[s[0]],a=this.vertices[s[1]],l=0<this.vertexStrokeColors.length?this.vertexStrokeColors.slice(4*s[0],4*(s[0]+1)):[0,0,0,0],u=0<this.vertexStrokeColors.length?this.vertexStrokeColors.slice(4*s[1],4*(s[1]+1)):[0,0,0,0],c=a.copy().sub(i).normalize(),d=0<c.magSq();d&&this._addSegment(i,a,l,u,c),0<o&&n[1]===s[0]?(e&&d&&c.dot(e)<1-1e-8&&this._addJoin(i,e,c,l),!d||r||t||(this._addCap(i,c.copy().mult(-1),l),r=!0)):(r=!1,d&&(!t||0<o)&&(this._addCap(i,c.copy().mult(-1),l),r=!0),e&&(!t||o<this.edges.length-1)&&(this._addCap(this.vertices[n[1]],e,l),e=void 0)),o===this.edges.length-1&&(t?this._addJoin(a,c,this.vertices[this.edges[0][1]].copy().sub(a).normalize(),u):this._addCap(a,c,u)),d&&(e=c)}return this},l.default.Geometry.prototype._addSegment=function(e,t,r,o,n){var e=e.array(),t=t.array(),s=n.array();this.lineSides.push(1,-1,1,1,-1,-1);for(var i=0,a=[this.lineTangentsIn,this.lineTangentsOut];i<a.length;i++)a[i].push(s,s,s,s,s,s);return this.lineVertices.push(e,e,t,t,e,t),this.lineVertexColors.push(r,r,o,o,r,o),this},l.default.Geometry.prototype._addCap=function(e,t,r){for(var o=e.array(),n=t.array(),s=[0,0,0],i=0;i<6;i++)this.lineVertices.push(o),this.lineTangentsIn.push(n),this.lineTangentsOut.push(s),this.lineVertexColors.push(r);return this.lineSides.push(-1,-2,2,2,1,-1),this},l.default.Geometry.prototype._addJoin=function(e,t,r,o){for(var n=e.array(),s=t.array(),i=r.array(),a=0;a<12;a++)this.lineVertices.push(n),this.lineTangentsIn.push(s),this.lineTangentsOut.push(i),this.lineVertexColors.push(o);for(var l=0,u=[-1,1];l<u.length;l++){var c=u[l];this.lineSides.push(c,2*c,3*c,c,3*c,0)}return this},l.default.Geometry.prototype.normalize=function(){if(0<this.vertices.length){for(var e=this.vertices[0].copy(),t=this.vertices[0].copy(),r=0;r<this.vertices.length;r++)e.x=Math.max(e.x,this.vertices[r].x),t.x=Math.min(t.x,this.vertices[r].x),e.y=Math.max(e.y,this.vertices[r].y),t.y=Math.min(t.y,this.vertices[r].y),e.z=Math.max(e.z,this.vertices[r].z),t.z=Math.min(t.z,this.vertices[r].z);for(var o=l.default.Vector.lerp(e,t,.5),n=l.default.Vector.sub(e,t),s=200/Math.max(Math.max(n.x,n.y),n.z),i=0;i<this.vertices.length;i++)this.vertices[i].sub(o),this.vertices[i].mult(s)}return this};e=l.default.Geometry;r.default=e},{"../core/main":267,"core-js/modules/es.array.slice":162,"core-js/modules/es.string.sub":192}],317:[function(e,t,r){"use strict";e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var O=(e=e("../core/main"))&&e.__esModule?e:{default:e};var o=Array,k=function(e){return e instanceof Array},e=("undefined"!=typeof Float32Array&&(o=Float32Array,k=function(e){return e instanceof Array||e instanceof Float32Array}),O.default.Matrix=function(){for(var e=new Array(arguments.length),t=0;t<e.length;++t)e[t]=arguments[t];return e.length&&e[e.length-1]instanceof O.default&&(this.p5=e[e.length-1]),"mat3"===e[0]?this.mat3=Array.isArray(e[1])?e[1]:new o([1,0,0,0,1,0,0,0,1]):this.mat4=Array.isArray(e[0])?e[0]:new o([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this},O.default.Matrix.prototype.set=function(e){return e instanceof O.default.Matrix?this.mat4=e.mat4:k(e)?this.mat4=e:16===arguments.length&&(this.mat4[0]=e,this.mat4[1]=arguments[1],this.mat4[2]=arguments[2],this.mat4[3]=arguments[3],this.mat4[4]=arguments[4],this.mat4[5]=arguments[5],this.mat4[6]=arguments[6],this.mat4[7]=arguments[7],this.mat4[8]=arguments[8],this.mat4[9]=arguments[9],this.mat4[10]=arguments[10],this.mat4[11]=arguments[11],this.mat4[12]=arguments[12],this.mat4[13]=arguments[13],this.mat4[14]=arguments[14],this.mat4[15]=arguments[15]),this},O.default.Matrix.prototype.get=function(){return new O.default.Matrix(this.mat4,this.p5)},O.default.Matrix.prototype.copy=function(){var e=new O.default.Matrix(this.p5);return e.mat4[0]=this.mat4[0],e.mat4[1]=this.mat4[1],e.mat4[2]=this.mat4[2],e.mat4[3]=this.mat4[3],e.mat4[4]=this.mat4[4],e.mat4[5]=this.mat4[5],e.mat4[6]=this.mat4[6],e.mat4[7]=this.mat4[7],e.mat4[8]=this.mat4[8],e.mat4[9]=this.mat4[9],e.mat4[10]=this.mat4[10],e.mat4[11]=this.mat4[11],e.mat4[12]=this.mat4[12],e.mat4[13]=this.mat4[13],e.mat4[14]=this.mat4[14],e.mat4[15]=this.mat4[15],e},O.default.Matrix.identity=function(e){return new O.default.Matrix(e)},O.default.Matrix.prototype.transpose=function(e){var t,r,o,n,s,i;return e instanceof O.default.Matrix?(t=e.mat4[1],r=e.mat4[2],o=e.mat4[3],n=e.mat4[6],s=e.mat4[7],i=e.mat4[11],this.mat4[0]=e.mat4[0],this.mat4[1]=e.mat4[4],this.mat4[2]=e.mat4[8],this.mat4[3]=e.mat4[12],this.mat4[4]=t,this.mat4[5]=e.mat4[5],this.mat4[6]=e.mat4[9],this.mat4[7]=e.mat4[13],this.mat4[8]=r,this.mat4[9]=n,this.mat4[10]=e.mat4[10],this.mat4[11]=e.mat4[14],this.mat4[12]=o,this.mat4[13]=s,this.mat4[14]=i,this.mat4[15]=e.mat4[15]):k(e)&&(t=e[1],r=e[2],o=e[3],n=e[6],s=e[7],i=e[11],this.mat4[0]=e[0],this.mat4[1]=e[4],this.mat4[2]=e[8],this.mat4[3]=e[12],this.mat4[4]=t,this.mat4[5]=e[5],this.mat4[6]=e[9],this.mat4[7]=e[13],this.mat4[8]=r,this.mat4[9]=n,this.mat4[10]=e[10],this.mat4[11]=e[14],this.mat4[12]=o,this.mat4[13]=s,this.mat4[14]=i,this.mat4[15]=e[15]),this},O.default.Matrix.prototype.invert=function(e){e instanceof O.default.Matrix?(t=e.mat4[0],r=e.mat4[1],o=e.mat4[2],n=e.mat4[3],s=e.mat4[4],i=e.mat4[5],a=e.mat4[6],l=e.mat4[7],u=e.mat4[8],c=e.mat4[9],d=e.mat4[10],f=e.mat4[11],h=e.mat4[12],p=e.mat4[13],m=e.mat4[14],y=e.mat4[15]):k(e)&&(t=e[0],r=e[1],o=e[2],n=e[3],s=e[4],i=e[5],a=e[6],l=e[7],u=e[8],c=e[9],d=e[10],f=e[11],h=e[12],p=e[13],m=e[14],y=e[15]);var t,r,o,n,s,i,a,l,u,c,d,f,h,p,m,y,e=t*i-r*s,g=t*a-o*s,v=t*l-n*s,b=r*a-o*i,j=r*l-n*i,_=o*l-n*a,x=u*p-c*h,w=u*m-d*h,S=u*y-f*h,M=c*m-d*p,E=c*y-f*p,T=d*y-f*m,C=e*T-g*E+v*M+b*S-j*w+_*x;return C?(this.mat4[0]=(i*T-a*E+l*M)*(C=1/C),this.mat4[1]=(o*E-r*T-n*M)*C,this.mat4[2]=(p*_-m*j+y*b)*C,this.mat4[3]=(d*j-c*_-f*b)*C,this.mat4[4]=(a*S-s*T-l*w)*C,this.mat4[5]=(t*T-o*S+n*w)*C,this.mat4[6]=(m*v-h*_-y*g)*C,this.mat4[7]=(u*_-d*v+f*g)*C,this.mat4[8]=(s*E-i*S+l*x)*C,this.mat4[9]=(r*S-t*E-n*x)*C,this.mat4[10]=(h*j-p*v+y*e)*C,this.mat4[11]=(c*v-u*j-f*e)*C,this.mat4[12]=(i*w-s*M-a*x)*C,this.mat4[13]=(t*M-r*w+o*x)*C,this.mat4[14]=(p*g-h*b-m*e)*C,this.mat4[15]=(u*b-c*g+d*e)*C,this):null},O.default.Matrix.prototype.invert3x3=function(){var e=this.mat3[0],t=this.mat3[1],r=this.mat3[2],o=this.mat3[3],n=this.mat3[4],s=this.mat3[5],i=this.mat3[6],a=this.mat3[7],l=this.mat3[8],u=l*n-s*a,c=-l*o+s*i,d=a*o-n*i,f=e*u+t*c+r*d;return f?(this.mat3[0]=u*(f=1/f),this.mat3[1]=(-l*t+r*a)*f,this.mat3[2]=(s*t-r*n)*f,this.mat3[3]=c*f,this.mat3[4]=(l*e-r*i)*f,this.mat3[5]=(-s*e+r*o)*f,this.mat3[6]=d*f,this.mat3[7]=(-a*e+t*i)*f,this.mat3[8]=(n*e-t*o)*f,this):null},O.default.Matrix.prototype.transpose3x3=function(e){var t=e[1],r=e[2],o=e[5];return this.mat3[1]=e[3],this.mat3[2]=e[6],this.mat3[3]=t,this.mat3[5]=e[7],this.mat3[6]=r,this.mat3[7]=o,this},O.default.Matrix.prototype.inverseTranspose=function(e){void 0===this.mat3?console.error("sorry, this function only works with mat3"):(this.mat3[0]=e.mat4[0],this.mat3[1]=e.mat4[1],this.mat3[2]=e.mat4[2],this.mat3[3]=e.mat4[4],this.mat3[4]=e.mat4[5],this.mat3[5]=e.mat4[6],this.mat3[6]=e.mat4[8],this.mat3[7]=e.mat4[9],this.mat3[8]=e.mat4[10]);e=this.invert3x3();if(e)e.transpose3x3(this.mat3);else for(var t=0;t<9;t++)this.mat3[t]=0;return this},O.default.Matrix.prototype.determinant=function(){var e=this.mat4[0]*this.mat4[5]-this.mat4[1]*this.mat4[4],t=this.mat4[0]*this.mat4[6]-this.mat4[2]*this.mat4[4],r=this.mat4[0]*this.mat4[7]-this.mat4[3]*this.mat4[4],o=this.mat4[1]*this.mat4[6]-this.mat4[2]*this.mat4[5],n=this.mat4[1]*this.mat4[7]-this.mat4[3]*this.mat4[5],s=this.mat4[2]*this.mat4[7]-this.mat4[3]*this.mat4[6],i=this.mat4[8]*this.mat4[13]-this.mat4[9]*this.mat4[12],a=this.mat4[8]*this.mat4[14]-this.mat4[10]*this.mat4[12],l=this.mat4[8]*this.mat4[15]-this.mat4[11]*this.mat4[12],u=this.mat4[9]*this.mat4[14]-this.mat4[10]*this.mat4[13],c=this.mat4[9]*this.mat4[15]-this.mat4[11]*this.mat4[13];return e*(this.mat4[10]*this.mat4[15]-this.mat4[11]*this.mat4[14])-t*c+r*u+o*l-n*a+s*i},O.default.Matrix.prototype.mult=function(e){var t;if(e===this||e===this.mat4)t=this.copy().mat4;else if(e instanceof O.default.Matrix)t=e.mat4;else if(k(e))t=e;else{if(16!==arguments.length)return;t=arguments}var e=this.mat4[0],r=this.mat4[1],o=this.mat4[2],n=this.mat4[3];return this.mat4[0]=e*t[0]+r*t[4]+o*t[8]+n*t[12],this.mat4[1]=e*t[1]+r*t[5]+o*t[9]+n*t[13],this.mat4[2]=e*t[2]+r*t[6]+o*t[10]+n*t[14],this.mat4[3]=e*t[3]+r*t[7]+o*t[11]+n*t[15],e=this.mat4[4],r=this.mat4[5],o=this.mat4[6],n=this.mat4[7],this.mat4[4]=e*t[0]+r*t[4]+o*t[8]+n*t[12],this.mat4[5]=e*t[1]+r*t[5]+o*t[9]+n*t[13],this.mat4[6]=e*t[2]+r*t[6]+o*t[10]+n*t[14],this.mat4[7]=e*t[3]+r*t[7]+o*t[11]+n*t[15],e=this.mat4[8],r=this.mat4[9],o=this.mat4[10],n=this.mat4[11],this.mat4[8]=e*t[0]+r*t[4]+o*t[8]+n*t[12],this.mat4[9]=e*t[1]+r*t[5]+o*t[9]+n*t[13],this.mat4[10]=e*t[2]+r*t[6]+o*t[10]+n*t[14],this.mat4[11]=e*t[3]+r*t[7]+o*t[11]+n*t[15],e=this.mat4[12],r=this.mat4[13],o=this.mat4[14],n=this.mat4[15],this.mat4[12]=e*t[0]+r*t[4]+o*t[8]+n*t[12],this.mat4[13]=e*t[1]+r*t[5]+o*t[9]+n*t[13],this.mat4[14]=e*t[2]+r*t[6]+o*t[10]+n*t[14],this.mat4[15]=e*t[3]+r*t[7]+o*t[11]+n*t[15],this},O.default.Matrix.prototype.apply=function(e){var t;if(e===this||e===this.mat4)t=this.copy().mat4;else if(e instanceof O.default.Matrix)t=e.mat4;else if(k(e))t=e;else{if(16!==arguments.length)return;t=arguments}var e=this.mat4,r=e[0],o=e[4],n=e[8],s=e[12],r=(e[0]=t[0]*r+t[1]*o+t[2]*n+t[3]*s,e[4]=t[4]*r+t[5]*o+t[6]*n+t[7]*s,e[8]=t[8]*r+t[9]*o+t[10]*n+t[11]*s,e[12]=t[12]*r+t[13]*o+t[14]*n+t[15]*s,e[1]),o=e[5],n=e[9],s=e[13],r=(e[1]=t[0]*r+t[1]*o+t[2]*n+t[3]*s,e[5]=t[4]*r+t[5]*o+t[6]*n+t[7]*s,e[9]=t[8]*r+t[9]*o+t[10]*n+t[11]*s,e[13]=t[12]*r+t[13]*o+t[14]*n+t[15]*s,e[2]),o=e[6],n=e[10],s=e[14],r=(e[2]=t[0]*r+t[1]*o+t[2]*n+t[3]*s,e[6]=t[4]*r+t[5]*o+t[6]*n+t[7]*s,e[10]=t[8]*r+t[9]*o+t[10]*n+t[11]*s,e[14]=t[12]*r+t[13]*o+t[14]*n+t[15]*s,e[3]),o=e[7],n=e[11],s=e[15];return e[3]=t[0]*r+t[1]*o+t[2]*n+t[3]*s,e[7]=t[4]*r+t[5]*o+t[6]*n+t[7]*s,e[11]=t[8]*r+t[9]*o+t[10]*n+t[11]*s,e[15]=t[12]*r+t[13]*o+t[14]*n+t[15]*s,this},O.default.Matrix.prototype.scale=function(e,t,r){return e instanceof O.default.Vector?(t=e.y,r=e.z,e=e.x):e instanceof Array&&(t=e[1],r=e[2],e=e[0]),this.mat4[0]*=e,this.mat4[1]*=e,this.mat4[2]*=e,this.mat4[3]*=e,this.mat4[4]*=t,this.mat4[5]*=t,this.mat4[6]*=t,this.mat4[7]*=t,this.mat4[8]*=r,this.mat4[9]*=r,this.mat4[10]*=r,this.mat4[11]*=r,this},O.default.Matrix.prototype.rotate=function(e,t,r,o){t instanceof O.default.Vector?(r=t.y,o=t.z,t=t.x):t instanceof Array&&(r=t[1],o=t[2],t=t[0]);var n=Math.sqrt(t*t+r*r+o*o),n=(t*=1/n,r*=1/n,o*=1/n,this.mat4[0]),s=this.mat4[1],i=this.mat4[2],a=this.mat4[3],l=this.mat4[4],u=this.mat4[5],c=this.mat4[6],d=this.mat4[7],f=this.mat4[8],h=this.mat4[9],p=this.mat4[10],m=this.mat4[11],y=Math.sin(e),e=Math.cos(e),g=1-e,v=t*t*g+e,b=r*t*g+o*y,j=o*t*g-r*y,_=t*r*g-o*y,x=r*r*g+e,w=o*r*g+t*y,S=t*o*g+r*y,r=r*o*g-t*y,t=o*o*g+e;return this.mat4[0]=n*v+l*b+f*j,this.mat4[1]=s*v+u*b+h*j,this.mat4[2]=i*v+c*b+p*j,this.mat4[3]=a*v+d*b+m*j,this.mat4[4]=n*_+l*x+f*w,this.mat4[5]=s*_+u*x+h*w,this.mat4[6]=i*_+c*x+p*w,this.mat4[7]=a*_+d*x+m*w,this.mat4[8]=n*S+l*r+f*t,this.mat4[9]=s*S+u*r+h*t,this.mat4[10]=i*S+c*r+p*t,this.mat4[11]=a*S+d*r+m*t,this},O.default.Matrix.prototype.translate=function(e){var t=e[0],r=e[1],e=e[2]||0;this.mat4[12]+=this.mat4[0]*t+this.mat4[4]*r+this.mat4[8]*e,this.mat4[13]+=this.mat4[1]*t+this.mat4[5]*r+this.mat4[9]*e,this.mat4[14]+=this.mat4[2]*t+this.mat4[6]*r+this.mat4[10]*e,this.mat4[15]+=this.mat4[3]*t+this.mat4[7]*r+this.mat4[11]*e},O.default.Matrix.prototype.rotateX=function(e){this.rotate(e,1,0,0)},O.default.Matrix.prototype.rotateY=function(e){this.rotate(e,0,1,0)},O.default.Matrix.prototype.rotateZ=function(e){this.rotate(e,0,0,1)},O.default.Matrix.prototype.perspective=function(e,t,r,o){var e=1/Math.tan(e/2),n=1/(r-o);return this.mat4[0]=e/t,this.mat4[1]=0,this.mat4[2]=0,this.mat4[3]=0,this.mat4[4]=0,this.mat4[5]=e,this.mat4[6]=0,this.mat4[7]=0,this.mat4[8]=0,this.mat4[9]=0,this.mat4[10]=(o+r)*n,this.mat4[11]=-1,this.mat4[12]=0,this.mat4[13]=0,this.mat4[14]=2*o*r*n,this.mat4[15]=0,this},O.default.Matrix.prototype.ortho=function(e,t,r,o,n,s){var i=1/(e-t),a=1/(r-o),l=1/(n-s);return this.mat4[0]=-2*i,this.mat4[1]=0,this.mat4[2]=0,this.mat4[3]=0,this.mat4[4]=0,this.mat4[5]=-2*a,this.mat4[6]=0,this.mat4[7]=0,this.mat4[8]=0,this.mat4[9]=0,this.mat4[10]=2*l,this.mat4[11]=0,this.mat4[12]=(e+t)*i,this.mat4[13]=(o+r)*a,this.mat4[14]=(s+n)*l,this.mat4[15]=1,this},O.default.Matrix);r.default=e},{"../core/main":267,"core-js/modules/es.array.iterator":158,"core-js/modules/es.object.to-string":177,"core-js/modules/es.typed-array.copy-within":197,"core-js/modules/es.typed-array.every":198,"core-js/modules/es.typed-array.fill":199,"core-js/modules/es.typed-array.filter":200,"core-js/modules/es.typed-array.find":202,"core-js/modules/es.typed-array.find-index":201,"core-js/modules/es.typed-array.float32-array":203,"core-js/modules/es.typed-array.for-each":205,"core-js/modules/es.typed-array.includes":206,"core-js/modules/es.typed-array.index-of":207,"core-js/modules/es.typed-array.iterator":210,"core-js/modules/es.typed-array.join":211,"core-js/modules/es.typed-array.last-index-of":212,"core-js/modules/es.typed-array.map":213,"core-js/modules/es.typed-array.reduce":215,"core-js/modules/es.typed-array.reduce-right":214,"core-js/modules/es.typed-array.reverse":216,"core-js/modules/es.typed-array.set":217,"core-js/modules/es.typed-array.slice":218,"core-js/modules/es.typed-array.some":219,"core-js/modules/es.typed-array.sort":220,"core-js/modules/es.typed-array.subarray":221,"core-js/modules/es.typed-array.to-locale-string":222,"core-js/modules/es.typed-array.to-string":223}],318:[function(e,t,r){"use strict";e("core-js/modules/es.array.map"),e("core-js/modules/es.array.map"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;e=(e=e("../core/main"))&&e.__esModule?e:{default:e};e.default.RenderBuffer=function(e,t,r,o,n,s){this.size=e,this.src=t,this.dst=r,this.attr=o,this._renderer=n,this.map=s},e.default.RenderBuffer.prototype._prepareBuffer=function(e,t){var r,o,n,s=t.attributes,i=this._renderer.GL,a=e.model||e,s=s[this.attr];s&&(r=e[this.dst],0<(o=a[this.src]).length?((n=!r)&&(e[this.dst]=r=i.createBuffer()),i.bindBuffer(i.ARRAY_BUFFER,r),!n&&!1===a.dirtyFlags[this.src]||(n=(e=this.map)?e(o):o,this._renderer._bindBuffer(r,i.ARRAY_BUFFER,n),a.dirtyFlags[this.src]=!1),t.enableAttrib(s,this.size)):-1!==(e=s.location)&&this._renderer.registerEnabled[e]&&(i.disableVertexAttribArray(e),this._renderer.registerEnabled[e]=!1))};e=e.default.RenderBuffer;r.default=e},{"../core/main":267,"core-js/modules/es.array.map":161}],319:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var l=(n=e("../core/main"))&&n.__esModule?n:{default:n},u=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}function c(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}e("./p5.RenderBuffer"),l.default.RendererGL.prototype.beginShape=function(e){return this.immediateMode.shapeMode=void 0!==e?e:u.TESS,this.immediateMode.geometry.reset(),this};var d={vertices:1,vertexNormals:1,vertexColors:4,vertexStrokeColors:4,uvs:2},n=(l.default.RendererGL.prototype.vertex=function(e,t){if(this.immediateMode.shapeMode===u.QUADS&&this.immediateMode.geometry.vertices.length%6==3)for(var r in d){var o=d[r],r=this.immediateMode.geometry[r];r.push.apply(r,c(r.slice(r.length-3*o,r.length-2*o)).concat(c(r.slice(r.length-o,r.length))))}var n,s,i=n=s=0,a=(3===arguments.length?i=arguments[2]:4===arguments.length?(n=arguments[2],s=arguments[3]):5===arguments.length&&(i=arguments[2],n=arguments[3],s=arguments[4]),new l.default.Vector(e,t,i)),a=(this.immediateMode.geometry.vertices.push(a),this.immediateMode.geometry.vertexNormals.push(this._currentNormal),this.curFillColor||[.5,.5,.5,1]),a=(this.immediateMode.geometry.vertexColors.push(a[0],a[1],a[2],a[3]),this.curStrokeColor||[.5,.5,.5,1]);return this.immediateMode.geometry.vertexStrokeColors.push(a[0],a[1],a[2],a[3]),this.textureMode===u.IMAGE&&(null!==this._tex?0<this._tex.width&&0<this._tex.height&&(n/=this._tex.width,s/=this._tex.height):!this.isProcessingVertices&&null===this._tex&&4<=arguments.length&&console.warn("You must first call texture() before using vertex() with image based u and v coordinates")),this.immediateMode.geometry.uvs.push(n,s),this.immediateMode._bezierVertex[0]=e,this.immediateMode._bezierVertex[1]=t,this.immediateMode._bezierVertex[2]=i,this.immediateMode._quadraticVertex[0]=e,this.immediateMode._quadraticVertex[1]=t,this.immediateMode._quadraticVertex[2]=i,this},l.default.RendererGL.prototype.normal=function(e,t,r){return e instanceof l.default.Vector?this._currentNormal=e:this._currentNormal=new l.default.Vector(e,t,r),this},l.default.RendererGL.prototype.endShape=function(e,t,r,o,n,s){return this.immediateMode.shapeMode===u.POINTS?this._drawPoints(this.immediateMode.geometry.vertices,this.immediateMode.buffers.point):(this.isProcessingVertices=!0,this._processVertices.apply(this,arguments),this.isProcessingVertices=!1,this._doFill&&1<this.immediateMode.geometry.vertices.length&&this._drawImmediateFill(),this._doStroke&&1<this.immediateMode.geometry.lineVertices.length&&this._drawImmediateStroke(),this.isBezier=!1,this.isQuadratic=!1,this.isCurve=!1,this.immediateMode._bezierVertex.length=0,this.immediateMode._quadraticVertex.length=0,this.immediateMode._curveVertex.length=0),this},l.default.RendererGL.prototype._processVertices=function(e){var t;0!==this.immediateMode.geometry.vertices.length&&(t=this._doStroke,e=e===u.CLOSE,t&&(this.immediateMode.geometry.edges=this._calculateEdges(this.immediateMode.shapeMode,this.immediateMode.geometry.vertices,e),this.immediateMode.geometry._edgesToVertices()),t=this.immediateMode.shapeMode===u.TESS,this._doFill&&(this.isBezier||this.isQuadratic||this.isCurve||t)&&this.immediateMode.shapeMode!==u.LINES&&this._tesselateShape())},l.default.RendererGL.prototype._calculateEdges=function(e,t,r){var o=[],n=0;switch(e){case u.TRIANGLE_STRIP:for(n=0;n<t.length-2;n++)o.push([n,n+1]),o.push([n,n+2]);o.push([n,n+1]);break;case u.TRIANGLE_FAN:for(n=1;n<t.length-1;n++)o.push([0,n]),o.push([n,n+1]);o.push([0,t.length-1]);break;case u.TRIANGLES:for(n=0;n<t.length-2;n+=3)o.push([n,n+1]),o.push([n+1,n+2]),o.push([n+2,n]);break;case u.LINES:for(n=0;n<t.length-1;n+=2)o.push([n,n+1]);break;case u.QUADS:for(n=0;n<t.length-5;n+=6)o.push([n,n+1]),o.push([n+1,n+2]),o.push([n+3,n+5]),o.push([n+4,n+5]);break;case u.QUAD_STRIP:for(n=0;n<t.length-2;n+=2)o.push([n,n+1]),o.push([n,n+2]),o.push([n+1,n+3]);o.push([n,n+1]);break;default:for(n=0;n<t.length-1;n++)o.push([n,n+1])}return r&&o.push([t.length-1,0]),o},l.default.RendererGL.prototype._tesselateShape=function(){for(var r=this,e=(this.immediateMode.shapeMode=u.TRIANGLES,[this._flatten(this.immediateMode.geometry.vertices.map(function(e,t){return[e.x,e.y,e.z,r.immediateMode.geometry.uvs[2*t],r.immediateMode.geometry.uvs[2*t+1],r.immediateMode.geometry.vertexColors[4*t],r.immediateMode.geometry.vertexColors[4*t+1],r.immediateMode.geometry.vertexColors[4*t+2],r.immediateMode.geometry.vertexColors[4*t+3],r.immediateMode.geometry.vertexNormals[t].x,r.immediateMode.geometry.vertexNormals[t].y,r.immediateMode.geometry.vertexNormals[t].z]}))]),t=this._triangulate(e),o=(this.immediateMode.geometry.vertices=[],this.immediateMode.geometry.vertexNormals=[],this.immediateMode.geometry.uvs=[],[]),n=0,s=t.length;n<s;n+=l.default.RendererGL.prototype.tessyVertexSize)o.push.apply(o,c(t.slice(n+5,n+9))),this.normal.apply(this,c(t.slice(n+9,n+12))),this.vertex.apply(this,c(t.slice(n,n+5)));this.immediateMode.geometry.vertexColors=o},l.default.RendererGL.prototype._drawImmediateFill=function(){var e=this.GL,t=(this._useVertexColor=0<this.immediateMode.geometry.vertexColors.length,this._getImmediateFillShader()),r=(this._setFillUniforms(t),!0),o=!1,n=void 0;try{for(var s,i=this.immediateMode.buffers.fill[Symbol.iterator]();!(r=(s=i.next()).done);r=!0)s.value._prepareBuffer(this.immediateMode.geometry,t)}catch(e){o=!0,n=e}finally{try{r||null==i.return||i.return()}finally{if(o)throw n}}this.immediateMode.shapeMode!==u.LINE_STRIP&&this.immediateMode.shapeMode!==u.LINES||(this.immediateMode.shapeMode=u.TRIANGLE_FAN),this.immediateMode.shapeMode===u.QUADS?this.immediateMode.shapeMode=u.TRIANGLES:this.immediateMode.shapeMode===u.QUAD_STRIP&&(this.immediateMode.shapeMode=u.TRIANGLE_STRIP),this._applyColorBlend(this.curFillColor),e.drawArrays(this.immediateMode.shapeMode,0,this.immediateMode.geometry.vertices.length),t.unbindShader()},l.default.RendererGL.prototype._drawImmediateStroke=function(){var e=this.GL,t=e.isEnabled(e.CULL_FACE),r=(e.disable(e.CULL_FACE),this._getImmediateStrokeShader()),o=(this._useLineColor=0<this.immediateMode.geometry.vertexStrokeColors.length,this._setStrokeUniforms(r),!0),n=!1,s=void 0;try{for(var i,a=this.immediateMode.buffers.stroke[Symbol.iterator]();!(o=(i=a.next()).done);o=!0)i.value._prepareBuffer(this.immediateMode.geometry,r)}catch(e){n=!0,s=e}finally{try{o||null==a.return||a.return()}finally{if(n)throw s}}this._applyColorBlend(this.curStrokeColor),e.drawArrays(e.TRIANGLES,0,this.immediateMode.geometry.lineVertices.length),t&&e.enable(e.CULL_FACE),r.unbindShader()},l.default.RendererGL);r.default=n},{"../core/constants":256,"../core/main":267,"./p5.RenderBuffer":318,"core-js/modules/es.array.concat":149,"core-js/modules/es.array.fill":152,"core-js/modules/es.array.from":155,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.map":161,"core-js/modules/es.array.slice":162,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],320:[function(e,t,r){"use strict";e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.some"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.uint16-array"),e("core-js/modules/es.typed-array.uint32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.some"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.uint16-array"),e("core-js/modules/es.typed-array.uint32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var a=(n=e("../core/main"))&&n.__esModule?n:{default:n};e("./p5.RendererGL"),e("./p5.RenderBuffer");var o=0,n=(a.default.RendererGL.prototype._initBufferDefaults=function(e){var t;return this._freeBuffers(e),1e3<++o&&(t=Object.keys(this.retainedMode.geometry)[0],delete this.retainedMode.geometry[t],o--),this.retainedMode.geometry[e]={}},a.default.RendererGL.prototype._freeBuffers=function(e){var a,l=this.retainedMode.geometry[e];function t(e){var t=!0,r=!1,o=void 0;try{for(var n,s=e[Symbol.iterator]();!(t=(n=s.next()).done);t=!0){var i=n.value;l[i.dst]&&(a.deleteBuffer(l[i.dst]),l[i.dst]=null)}}catch(e){r=!0,o=e}finally{try{t||null==s.return||s.return()}finally{if(r)throw o}}}l&&(delete this.retainedMode.geometry[e],o--,a=this.GL,l.indexBuffer&&a.deleteBuffer(l.indexBuffer),t(this.retainedMode.buffers.stroke),t(this.retainedMode.buffers.fill))},a.default.RendererGL.prototype.createBuffers=function(e,t){var r,o,n,s=this.GL,e=this._initBufferDefaults(e),i=(e.model=t,e.indexBuffer);return t.faces.length?(i=i||(e.indexBuffer=s.createBuffer()),n=(o=(r=a.default.RendererGL.prototype._flatten(t.faces)).some(function(e){return 65535<e}))?Uint32Array:Uint16Array,this._bindBuffer(i,s.ELEMENT_ARRAY_BUFFER,r,n),e.indexBufferType=o?s.UNSIGNED_INT:s.UNSIGNED_SHORT,e.vertexCount=3*t.faces.length):(i&&(s.deleteBuffer(i),e.indexBuffer=null),e.vertexCount=t.vertices?t.vertices.length:0),e.lineVertexCount=t.lineVertices?t.lineVertices.length:0,e},a.default.RendererGL.prototype.drawBuffers=function(e){var t=this.GL,r=this.retainedMode.geometry[e];if(this._doStroke&&0<r.lineVertexCount){var o=t.isEnabled(t.CULL_FACE),n=(t.disable(t.CULL_FACE),this._getRetainedStrokeShader()),s=(this._useLineColor=0<r.model.vertexStrokeColors.length,this._setStrokeUniforms(n),!0),i=!1,a=void 0;try{for(var l,u=this.retainedMode.buffers.stroke[Symbol.iterator]();!(s=(l=u.next()).done);s=!0)l.value._prepareBuffer(r,n)}catch(e){i=!0,a=e}finally{try{s||null==u.return||u.return()}finally{if(i)throw a}}this._applyColorBlend(this.curStrokeColor),this._drawArrays(t.TRIANGLES,e),o&&t.enable(t.CULL_FACE),n.unbindShader()}if(this._doFill){this._useVertexColor=0<r.model.vertexColors.length;var c=this._getRetainedFillShader(),d=(this._setFillUniforms(c),!0),i=!1,a=void 0;try{for(var f,h=this.retainedMode.buffers.fill[Symbol.iterator]();!(d=(f=h.next()).done);d=!0)f.value._prepareBuffer(r,c)}catch(e){i=!0,a=e}finally{try{d||null==h.return||h.return()}finally{if(i)throw a}}r.indexBuffer&&this._bindBuffer(r.indexBuffer,t.ELEMENT_ARRAY_BUFFER),this._applyColorBlend(this.curFillColor),this._drawElements(t.TRIANGLES,e),c.unbindShader()}return this},a.default.RendererGL.prototype.drawBuffersScaled=function(e,t,r,o){var n=this.uMVMatrix.copy();try{this.uMVMatrix.scale(t,r,o),this.drawBuffers(e)}finally{this.uMVMatrix=n}},a.default.RendererGL.prototype._drawArrays=function(e,t){return this.GL.drawArrays(e,0,this.retainedMode.geometry[t].lineVertexCount),this},a.default.RendererGL.prototype._drawElements=function(e,t){var t=this.retainedMode.geometry[t],r=this.GL;if(t.indexBuffer){if(t.indexBufferType===r.UNSIGNED_INT&&!r.getExtension("OES_element_index_uint"))throw new Error("Unable to render a 3d model with > 65535 triangles. Your web browser does not support the WebGL Extension OES_element_index_uint.");r.drawElements(r.TRIANGLES,t.vertexCount,t.indexBufferType,0)}else r.drawArrays(e||r.TRIANGLES,0,t.vertexCount)},a.default.RendererGL.prototype._drawPoints=function(e,t){var r=this.GL,o=this._getImmediatePointShader();this._setPointUniforms(o),this._bindBuffer(t,r.ARRAY_BUFFER,this._vToNArray(e),Float32Array,r.STATIC_DRAW),o.enableAttrib(o.attributes.aPosition,3),r.drawArrays(r.Points,0,e.length),o.unbindShader()},a.default.RendererGL);r.default=n},{"../core/main":267,"./p5.RenderBuffer":318,"./p5.RendererGL":321,"core-js/modules/es.array.fill":152,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.some":163,"core-js/modules/es.object.keys":176,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.typed-array.copy-within":197,"core-js/modules/es.typed-array.every":198,"core-js/modules/es.typed-array.fill":199,"core-js/modules/es.typed-array.filter":200,"core-js/modules/es.typed-array.find":202,"core-js/modules/es.typed-array.find-index":201,"core-js/modules/es.typed-array.float32-array":203,"core-js/modules/es.typed-array.for-each":205,"core-js/modules/es.typed-array.includes":206,"core-js/modules/es.typed-array.index-of":207,"core-js/modules/es.typed-array.iterator":210,"core-js/modules/es.typed-array.join":211,"core-js/modules/es.typed-array.last-index-of":212,"core-js/modules/es.typed-array.map":213,"core-js/modules/es.typed-array.reduce":215,"core-js/modules/es.typed-array.reduce-right":214,"core-js/modules/es.typed-array.reverse":216,"core-js/modules/es.typed-array.set":217,"core-js/modules/es.typed-array.slice":218,"core-js/modules/es.typed-array.some":219,"core-js/modules/es.typed-array.sort":220,"core-js/modules/es.typed-array.subarray":221,"core-js/modules/es.typed-array.to-locale-string":222,"core-js/modules/es.typed-array.to-string":223,"core-js/modules/es.typed-array.uint16-array":224,"core-js/modules/es.typed-array.uint32-array":225,"core-js/modules/web.dom-collections.iterator":230}],321:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.float64-array"),e("core-js/modules/es.typed-array.int16-array"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.uint16-array"),e("core-js/modules/es.typed-array.uint32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.float64-array"),e("core-js/modules/es.typed-array.int16-array"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.uint16-array"),e("core-js/modules/es.typed-array.uint32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var p=l(e("../core/main")),s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants")),n=l(e("libtess"));e("./p5.Shader"),e("./p5.Camera"),e("../core/p5.Renderer"),e("./p5.Matrix"),e("path");function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}function l(e){return e&&e.__esModule?e:{default:e}}function u(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function c(e,t){m+="#define STROKE_CAP_".concat(e," ").concat(t,"\n"),f[s[e]]=t}function d(e,t){m+="#define STROKE_JOIN_".concat(e," ").concat(t,"\n"),h[s[e]]=t}var f={},h={},m="",e=(c("ROUND",0),c("PROJECT",1),c("SQUARE",2),d("ROUND",0),d("MITER",1),d("BEVEL",2),"precision highp float;\nprecision highp int;\n\nuniform mat4 uViewMatrix;\n\nuniform bool uUseLighting;\n\nuniform int uAmbientLightCount;\nuniform vec3 uAmbientColor[5];\n\nuniform int uDirectionalLightCount;\nuniform vec3 uLightingDirection[5];\nuniform vec3 uDirectionalDiffuseColors[5];\nuniform vec3 uDirectionalSpecularColors[5];\n\nuniform int uPointLightCount;\nuniform vec3 uPointLightLocation[5];\nuniform vec3 uPointLightDiffuseColors[5];\t\nuniform vec3 uPointLightSpecularColors[5];\n\nuniform int uSpotLightCount;\nuniform float uSpotLightAngle[5];\nuniform float uSpotLightConc[5];\nuniform vec3 uSpotLightDiffuseColors[5];\nuniform vec3 uSpotLightSpecularColors[5];\nuniform vec3 uSpotLightLocation[5];\nuniform vec3 uSpotLightDirection[5];\n\nuniform bool uSpecular;\nuniform float uShininess;\n\nuniform float uConstantAttenuation;\nuniform float uLinearAttenuation;\nuniform float uQuadraticAttenuation;\n\nconst float specularFactor = 2.0;\nconst float diffuseFactor = 0.73;\n\nstruct LightResult {\n float specular;\n float diffuse;\n};\n\nfloat _phongSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float shininess) {\n\n vec3 R = reflect(lightDirection, surfaceNormal);\n return pow(max(0.0, dot(R, viewDirection)), shininess);\n}\n\nfloat _lambertDiffuse(vec3 lightDirection, vec3 surfaceNormal) {\n return max(0.0, dot(-lightDirection, surfaceNormal));\n}\n\nLightResult _light(vec3 viewDirection, vec3 normal, vec3 lightVector) {\n\n vec3 lightDir = normalize(lightVector);\n\n //compute our diffuse & specular terms\n LightResult lr;\n if (uSpecular)\n lr.specular = _phongSpecular(lightDir, viewDirection, normal, uShininess);\n lr.diffuse = _lambertDiffuse(lightDir, normal);\n return lr;\n}\n\nvoid totalLight(\n vec3 modelPosition,\n vec3 normal,\n out vec3 totalDiffuse,\n out vec3 totalSpecular\n) {\n\n totalSpecular = vec3(0.0);\n\n if (!uUseLighting) {\n totalDiffuse = vec3(1.0);\n return;\n }\n\n totalDiffuse = vec3(0.0);\n\n vec3 viewDirection = normalize(-modelPosition);\n\n for (int j = 0; j < 5; j++) {\n if (j < uDirectionalLightCount) {\n vec3 lightVector = (uViewMatrix * vec4(uLightingDirection[j], 0.0)).xyz;\n vec3 lightColor = uDirectionalDiffuseColors[j];\n vec3 specularColor = uDirectionalSpecularColors[j];\n LightResult result = _light(viewDirection, normal, lightVector);\n totalDiffuse += result.diffuse * lightColor;\n totalSpecular += result.specular * lightColor * specularColor;\n }\n\n if (j < uPointLightCount) {\n vec3 lightPosition = (uViewMatrix * vec4(uPointLightLocation[j], 1.0)).xyz;\n vec3 lightVector = modelPosition - lightPosition;\n \n //calculate attenuation\n float lightDistance = length(lightVector);\n float lightFalloff = 1.0 / (uConstantAttenuation + lightDistance * uLinearAttenuation + (lightDistance * lightDistance) * uQuadraticAttenuation);\n vec3 lightColor = lightFalloff * uPointLightDiffuseColors[j];\n vec3 specularColor = lightFalloff * uPointLightSpecularColors[j];\n\n LightResult result = _light(viewDirection, normal, lightVector);\n totalDiffuse += result.diffuse * lightColor;\n totalSpecular += result.specular * lightColor * specularColor;\n }\n\n if(j < uSpotLightCount) {\n vec3 lightPosition = (uViewMatrix * vec4(uSpotLightLocation[j], 1.0)).xyz;\n vec3 lightVector = modelPosition - lightPosition;\n \n float lightDistance = length(lightVector);\n float lightFalloff = 1.0 / (uConstantAttenuation + lightDistance * uLinearAttenuation + (lightDistance * lightDistance) * uQuadraticAttenuation);\n\n vec3 lightDirection = (uViewMatrix * vec4(uSpotLightDirection[j], 0.0)).xyz;\n float spotDot = dot(normalize(lightVector), normalize(lightDirection));\n float spotFalloff;\n if(spotDot < uSpotLightAngle[j]) {\n spotFalloff = 0.0;\n }\n else {\n spotFalloff = pow(spotDot, uSpotLightConc[j]);\n }\n lightFalloff *= spotFalloff;\n\n vec3 lightColor = uSpotLightDiffuseColors[j];\n vec3 specularColor = uSpotLightSpecularColors[j];\n \n LightResult result = _light(viewDirection, normal, lightVector);\n \n totalDiffuse += result.diffuse * lightColor * lightFalloff;\n totalSpecular += result.specular * lightColor * specularColor * lightFalloff;\n }\n }\n\n totalDiffuse *= diffuseFactor;\n totalSpecular *= specularFactor;\n}\n"),y={immediateVert:"attribute vec3 aPosition;\nattribute vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uResolution;\nuniform float uPointSize;\n\nvarying vec4 vColor;\nvoid main(void) {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vColor = aVertexColor;\n gl_PointSize = uPointSize;\n}\n",vertexColorVert:"attribute vec3 aPosition;\nattribute vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\n\nvarying vec4 vColor;\n\nvoid main(void) {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vColor = aVertexColor;\n}\n",vertexColorFrag:"precision mediump float;\nvarying vec4 vColor;\nvoid main(void) {\n gl_FragColor = vec4(vColor.rgb, 1.) * vColor.a;\n}\n",normalVert:"attribute vec3 aPosition;\nattribute vec3 aNormal;\nattribute vec2 aTexCoord;\nattribute vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\n\nuniform vec4 uMaterialColor;\nuniform bool uUseVertexColor;\n\nvarying vec3 vVertexNormal;\nvarying highp vec2 vVertTexCoord;\nvarying vec4 vColor;\n\nvoid main(void) {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vVertexNormal = normalize(vec3( uNormalMatrix * aNormal ));\n vVertTexCoord = aTexCoord;\n vColor = (uUseVertexColor ? aVertexColor : uMaterialColor);\n}\n",normalFrag:"precision mediump float;\nvarying vec3 vVertexNormal;\nvoid main(void) {\n gl_FragColor = vec4(vVertexNormal, 1.0);\n}",basicFrag:"precision mediump float;\nvarying vec4 vColor;\nvoid main(void) {\n gl_FragColor = vec4(vColor.rgb, 1.) * vColor.a;\n}\n",lightVert:e+"// include lighting.glgl\n\nattribute vec3 aPosition;\nattribute vec3 aNormal;\nattribute vec2 aTexCoord;\nattribute vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\n\nuniform bool uUseVertexColor;\nuniform vec4 uMaterialColor;\n\nvarying highp vec2 vVertTexCoord;\nvarying vec3 vDiffuseColor;\nvarying vec3 vSpecularColor;\nvarying vec4 vColor;\n\nvoid main(void) {\n\n vec4 viewModelPosition = uModelViewMatrix * vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * viewModelPosition;\n\n vec3 vertexNormal = normalize(uNormalMatrix * aNormal);\n vVertTexCoord = aTexCoord;\n\n totalLight(viewModelPosition.xyz, vertexNormal, vDiffuseColor, vSpecularColor);\n\n for (int i = 0; i < 8; i++) {\n if (i < uAmbientLightCount) {\n vDiffuseColor += uAmbientColor[i];\n }\n }\n \n vColor = (uUseVertexColor ? aVertexColor : uMaterialColor);\n}\n",lightTextureFrag:"precision highp float;\n\nuniform vec4 uTint;\nuniform sampler2D uSampler;\nuniform bool isTexture;\nuniform bool uEmissive;\n\nvarying highp vec2 vVertTexCoord;\nvarying vec3 vDiffuseColor;\nvarying vec3 vSpecularColor;\nvarying vec4 vColor;\n\nvoid main(void) {\n if(uEmissive && !isTexture) {\n gl_FragColor = vColor;\n }\n else {\n vec4 baseColor = isTexture ? texture2D(uSampler, vVertTexCoord) * (uTint / vec4(255, 255, 255, 255)) : vColor;\n gl_FragColor = vec4(gl_FragColor.rgb * vDiffuseColor + vSpecularColor, 1.) * baseColor.a;\n }\n}\n",phongVert:"precision highp float;\nprecision highp int;\n\nattribute vec3 aPosition;\nattribute vec3 aNormal;\nattribute vec2 aTexCoord;\nattribute vec4 aVertexColor;\n\nuniform vec3 uAmbientColor[5];\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\nuniform int uAmbientLightCount;\n\nuniform bool uUseVertexColor;\nuniform vec4 uMaterialColor;\n\nvarying vec3 vNormal;\nvarying vec2 vTexCoord;\nvarying vec3 vViewPosition;\nvarying vec3 vAmbientColor;\nvarying vec4 vColor;\n\nvoid main(void) {\n\n vec4 viewModelPosition = uModelViewMatrix * vec4(aPosition, 1.0);\n\n // Pass varyings to fragment shader\n vViewPosition = viewModelPosition.xyz;\n gl_Position = uProjectionMatrix * viewModelPosition; \n\n vNormal = uNormalMatrix * aNormal;\n vTexCoord = aTexCoord;\n\n // TODO: this should be a uniform\n vAmbientColor = vec3(0.0);\n for (int i = 0; i < 5; i++) {\n if (i < uAmbientLightCount) {\n vAmbientColor += uAmbientColor[i];\n }\n }\n \n vColor = (uUseVertexColor ? aVertexColor : uMaterialColor);\n}\n",phongFrag:e+"// include lighting.glsl\nprecision highp float;\nprecision highp int;\n\nuniform vec4 uSpecularMatColor;\nuniform vec4 uAmbientMatColor;\nuniform vec4 uEmissiveMatColor;\n\nuniform vec4 uTint;\nuniform sampler2D uSampler;\nuniform bool isTexture;\n\nvarying vec3 vNormal;\nvarying vec2 vTexCoord;\nvarying vec3 vViewPosition;\nvarying vec3 vAmbientColor;\nvarying vec4 vColor;\n\nvoid main(void) {\n\n vec3 diffuse;\n vec3 specular;\n totalLight(vViewPosition, normalize(vNormal), diffuse, specular);\n\n // Calculating final color as result of all lights (plus emissive term).\n\n vec4 baseColor = isTexture ? texture2D(uSampler, vTexCoord) * (uTint / vec4(255, 255, 255, 255)) : vColor;\n gl_FragColor = vec4(diffuse * baseColor.rgb + \n vAmbientColor * uAmbientMatColor.rgb + \n specular * uSpecularMatColor.rgb + \n uEmissiveMatColor.rgb, 1.) * baseColor.a;\n}\n",fontVert:"precision mediump float;\n\nattribute vec3 aPosition;\nattribute vec2 aTexCoord;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\n\nuniform vec4 uGlyphRect;\nuniform float uGlyphOffset;\n\nvarying vec2 vTexCoord;\nvarying float w;\n\nvoid main() {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n\n // scale by the size of the glyph's rectangle\n positionVec4.xy *= uGlyphRect.zw - uGlyphRect.xy;\n\n // Expand glyph bounding boxes by 1px on each side to give a bit of room\n // for antialiasing\n vec2 pixelScale = vec2(\n 1. / uModelViewMatrix[0][0],\n 1. / uModelViewMatrix[1][1]\n );\n vec2 offset = pixelScale * normalize(aTexCoord - vec2(0.5, 0.5)) * vec2(1., -1.);\n vec2 textureOffset = offset * (1. / vec2(\n uGlyphRect.z - uGlyphRect.x,\n uGlyphRect.w - uGlyphRect.y\n ));\n\n // move to the corner of the glyph\n positionVec4.xy += uGlyphRect.xy;\n\n // move to the letter's line offset\n positionVec4.x += uGlyphOffset;\n\n positionVec4.xy += offset;\n \n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vTexCoord = aTexCoord + textureOffset;\n w = gl_Position.w;\n}\n",fontFrag:"#extension GL_OES_standard_derivatives : enable\nprecision mediump float;\n\n#if 0\n // simulate integer math using floats\n\t#define int float\n\t#define ivec2 vec2\n\t#define INT(x) float(x)\n\n\tint ifloor(float v) { return floor(v); }\n\tivec2 ifloor(vec2 v) { return floor(v); }\n\n#else\n // use native integer math\n\tprecision highp int;\n\t#define INT(x) x\n\n\tint ifloor(float v) { return int(v); }\n\tint ifloor(int v) { return v; }\n\tivec2 ifloor(vec2 v) { return ivec2(v); }\n\n#endif\n\nuniform sampler2D uSamplerStrokes;\nuniform sampler2D uSamplerRowStrokes;\nuniform sampler2D uSamplerRows;\nuniform sampler2D uSamplerColStrokes;\nuniform sampler2D uSamplerCols;\n\nuniform ivec2 uStrokeImageSize;\nuniform ivec2 uCellsImageSize;\nuniform ivec2 uGridImageSize;\n\nuniform ivec2 uGridOffset;\nuniform ivec2 uGridSize;\nuniform vec4 uMaterialColor;\n\nvarying vec2 vTexCoord;\n\n// some helper functions\nint round(float v) { return ifloor(v + 0.5); }\nivec2 round(vec2 v) { return ifloor(v + 0.5); }\nfloat saturate(float v) { return clamp(v, 0.0, 1.0); }\nvec2 saturate(vec2 v) { return clamp(v, 0.0, 1.0); }\n\nint mul(float v1, int v2) {\n return ifloor(v1 * float(v2));\n}\n\nivec2 mul(vec2 v1, ivec2 v2) {\n return ifloor(v1 * vec2(v2) + 0.5);\n}\n\n// unpack a 16-bit integer from a float vec2\nint getInt16(vec2 v) {\n ivec2 iv = round(v * 255.0);\n return iv.x * INT(128) + iv.y;\n}\n\nvec2 pixelScale;\nvec2 coverage = vec2(0.0);\nvec2 weight = vec2(0.5);\nconst float minDistance = 1.0/8192.0;\nconst float hardness = 1.05; // amount of antialias\n\n// the maximum number of curves in a glyph\nconst int N = INT(250);\n\n// retrieves an indexed pixel from a sampler\nvec4 getTexel(sampler2D sampler, int pos, ivec2 size) {\n int width = size.x;\n int y = ifloor(pos / width);\n int x = pos - y * width; // pos % width\n\n return texture2D(sampler, (vec2(x, y) + 0.5) / vec2(size));\n}\n\nvoid calulateCrossings(vec2 p0, vec2 p1, vec2 p2, out vec2 C1, out vec2 C2) {\n\n // get the coefficients of the quadratic in t\n vec2 a = p0 - p1 * 2.0 + p2;\n vec2 b = p0 - p1;\n vec2 c = p0 - vTexCoord;\n\n // found out which values of 't' it crosses the axes\n vec2 surd = sqrt(max(vec2(0.0), b * b - a * c));\n vec2 t1 = ((b - surd) / a).yx;\n vec2 t2 = ((b + surd) / a).yx;\n\n // approximate straight lines to avoid rounding errors\n if (abs(a.y) < 0.001)\n t1.x = t2.x = c.y / (2.0 * b.y);\n\n if (abs(a.x) < 0.001)\n t1.y = t2.y = c.x / (2.0 * b.x);\n\n // plug into quadratic formula to find the corrdinates of the crossings\n C1 = ((a * t1 - b * 2.0) * t1 + c) * pixelScale;\n C2 = ((a * t2 - b * 2.0) * t2 + c) * pixelScale;\n}\n\nvoid coverageX(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n // determine on which side of the x-axis the points lie\n bool y0 = p0.y > vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n gl_FragColor = vec4(uMaterialColor.rgb, 1.) * uMaterialColor.a;\n gl_FragColor *= saturate(max(antialias, cover));\n}\n",lineVert:m+"/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nprecision mediump float;\nprecision mediump int;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform bool uUseLineColor;\nuniform vec4 uMaterialColor;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\nuniform int uStrokeJoin;\n\nattribute vec4 aPosition;\nattribute vec3 aTangentIn;\nattribute vec3 aTangentOut;\nattribute float aSide;\nattribute vec4 aVertexColor;\n\nvarying vec4 vColor;\nvarying vec2 vTangent;\nvarying vec2 vCenter;\nvarying vec2 vPosition;\nvarying float vMaxDist;\nvarying float vCap;\nvarying float vJoin;\n\nvec2 lineIntersection(vec2 aPoint, vec2 aDir, vec2 bPoint, vec2 bDir) {\n // Rotate and translate so a starts at the origin and goes out to the right\n bPoint -= aPoint;\n vec2 rotatedBFrom = vec2(\n bPoint.x*aDir.x + bPoint.y*aDir.y,\n bPoint.y*aDir.x - bPoint.x*aDir.y\n );\n vec2 bTo = bPoint + bDir;\n vec2 rotatedBTo = vec2(\n bTo.x*aDir.x + bTo.y*aDir.y,\n bTo.y*aDir.x - bTo.x*aDir.y\n );\n float intersectionDistance =\n rotatedBTo.x + (rotatedBFrom.x - rotatedBTo.x) * rotatedBTo.y /\n (rotatedBTo.y - rotatedBFrom.y);\n return aPoint + aDir * intersectionDistance;\n}\n\nvoid main() {\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n vec3 scale = vec3(0.9995);\n\n // Caps have one of either the in or out tangent set to 0\n vCap = (aTangentIn == vec3(0.)) != (aTangentOut == (vec3(0.)))\n ? 1. : 0.;\n\n // Joins have two unique, defined tangents\n vJoin = (\n aTangentIn != vec3(0.) &&\n aTangentOut != vec3(0.) &&\n aTangentIn != aTangentOut\n ) ? 1. : 0.;\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posqIn = uModelViewMatrix * (aPosition + vec4(aTangentIn, 0));\n vec4 posqOut = uModelViewMatrix * (aPosition + vec4(aTangentOut, 0));\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posqIn.xyz = posqIn.xyz * scale;\n posqOut.xyz = posqOut.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 qIn = uProjectionMatrix * posqIn;\n vec4 qOut = uProjectionMatrix * posqOut;\n vCenter = p.xy;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don't care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can't remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangentIn = normalize((qIn.xy*p.w - p.xy*qIn.w) * uViewport.zw);\n vec2 tangentOut = normalize((qOut.xy*p.w - p.xy*qOut.w) * uViewport.zw);\n\n vec2 curPerspScale;\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n // invert Y, projections in Processing invert Y\n curPerspScale = (uProjectionMatrix * vec4(1, -1, 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n vec2 offset;\n if (vJoin == 1.) {\n vTangent = normalize(tangentIn + tangentOut);\n vec2 normalIn = vec2(-tangentIn.y, tangentIn.x);\n vec2 normalOut = vec2(-tangentOut.y, tangentOut.x);\n float side = sign(aSide);\n float sideEnum = abs(aSide);\n\n // We generate vertices for joins on either side of the centerline, but\n // the \"elbow\" side is the only one needing a join. By not setting the\n // offset for the other side, all its vertices will end up in the same\n // spot and not render, effectively discarding it.\n if (sign(dot(tangentOut, vec2(-tangentIn.y, tangentIn.x))) != side) {\n // Side enums:\n // 1: the side going into the join\n // 2: the middle of the join\n // 3: the side going out of the join\n if (sideEnum == 2.) {\n // Calculate the position + tangent on either side of the join, and\n // find where the lines intersect to find the elbow of the join\n vec2 c = (posp.xy/posp.w + vec2(1.,1.)) * 0.5 * uViewport.zw;\n vec2 intersection = lineIntersection(\n c + (side * normalIn * uStrokeWeight / 2.) * curPerspScale,\n tangentIn,\n c + (side * normalOut * uStrokeWeight / 2.) * curPerspScale,\n tangentOut\n );\n offset = (intersection - c);\n\n // When lines are thick and the angle of the join approaches 180, the\n // elbow might be really far from the center. We'll apply a limit to\n // the magnitude to avoid lines going across the whole screen when this\n // happens.\n float mag = length(offset);\n float maxMag = 3. * uStrokeWeight;\n if (mag > maxMag) {\n offset *= maxMag / mag;\n }\n } else if (sideEnum == 1.) {\n offset = side * normalIn * curPerspScale * uStrokeWeight / 2.;\n } else if (sideEnum == 3.) {\n offset = side * normalOut * curPerspScale * uStrokeWeight / 2.;\n }\n }\n if (uStrokeJoin == STROKE_JOIN_BEVEL) {\n vec2 avgNormal = vec2(-vTangent.y, vTangent.x);\n vMaxDist = abs(dot(avgNormal, normalIn * uStrokeWeight / 2.));\n } else {\n vMaxDist = uStrokeWeight / 2.;\n }\n } else {\n vec2 tangent = aTangentIn == vec3(0.) ? tangentOut : tangentIn;\n vTangent = tangent;\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float normalOffset = sign(aSide);\n // Caps will have side values of -2 or 2 on the edge of the cap that\n // extends out from the line\n float tangentOffset = abs(aSide) - 1.;\n offset = (normal * normalOffset + tangent * tangentOffset) *\n uStrokeWeight * 0.5 * curPerspScale;\n vMaxDist = uStrokeWeight / 2.;\n }\n vPosition = vCenter + offset / curPerspScale;\n\n gl_Position.xy = p.xy + offset.xy;\n gl_Position.zw = p.zw;\n \n vColor = (uUseLineColor ? aVertexColor : uMaterialColor);\n}\n",lineFrag:m+"precision mediump float;\nprecision mediump int;\n\nuniform vec4 uMaterialColor;\nuniform int uStrokeCap;\nuniform int uStrokeJoin;\nuniform float uStrokeWeight;\n\nvarying vec4 vColor;\nvarying vec2 vTangent;\nvarying vec2 vCenter;\nvarying vec2 vPosition;\nvarying float vMaxDist;\nvarying float vCap;\nvarying float vJoin;\n\nfloat distSquared(vec2 a, vec2 b) {\n vec2 aToB = b - a;\n return dot(aToB, aToB);\n}\n\nvoid main() {\n if (vCap > 0.) {\n if (\n uStrokeCap == STROKE_CAP_ROUND &&\n distSquared(vPosition, vCenter) > uStrokeWeight * uStrokeWeight * 0.25\n ) {\n discard;\n } else if (\n uStrokeCap == STROKE_CAP_SQUARE &&\n dot(vPosition - vCenter, vTangent) > 0.\n ) {\n discard;\n }\n // Use full area for PROJECT\n } else if (vJoin > 0.) {\n if (\n uStrokeJoin == STROKE_JOIN_ROUND &&\n distSquared(vPosition, vCenter) > uStrokeWeight * uStrokeWeight * 0.25\n ) {\n discard;\n } else if (uStrokeJoin == STROKE_JOIN_BEVEL) {\n vec2 normal = vec2(-vTangent.y, vTangent.x);\n if (abs(dot(vPosition - vCenter, normal)) > vMaxDist) {\n discard;\n }\n }\n // Use full area for MITER\n }\n gl_FragColor = vec4(vColor.rgb, 1.) * vColor.a;\n}\n",pointVert:"attribute vec3 aPosition;\nuniform float uPointSize;\nvarying float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}",pointFrag:"precision mediump float;\nprecision mediump int;\nuniform vec4 uMaterialColor;\nvarying float vStrokeWeight;\n\nvoid main(){\n float mask = 0.0;\n\n // make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n mask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n // if strokeWeight is 1 or less lets just draw a square\n // this prevents weird artifacting from carving circles when our points are really small\n // if strokeWeight is larger than 1, we just use it as is\n\n mask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n // throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n if(mask > 0.98){\n discard;\n }\n\n gl_FragColor = vec4(uMaterialColor.rgb, 1.) * uMaterialColor.a;\n}\n"},e=(p.default.RendererGL=function(e,t,r,o){return p.default.Renderer.call(this,e,t,r),this._setAttributeDefaults(t),this._initContext(),this.isP3D=!0,this.GL=this.drawingContext,this._pInst._setProperty("drawingContext",this.drawingContext),this._isErasing=!1,this._enableLighting=!1,this.ambientLightColors=[],this.specularColors=[1,1,1],this.directionalLightDirections=[],this.directionalLightDiffuseColors=[],this.directionalLightSpecularColors=[],this.pointLightPositions=[],this.pointLightDiffuseColors=[],this.pointLightSpecularColors=[],this.spotLightPositions=[],this.spotLightDirections=[],this.spotLightDiffuseColors=[],this.spotLightSpecularColors=[],this.spotLightAngle=[],this.spotLightConc=[],this.drawMode=s.FILL,this.curFillColor=this._cachedFillStyle=[1,1,1,1],this.curAmbientColor=this._cachedFillStyle=[1,1,1,1],this.curSpecularColor=this._cachedFillStyle=[0,0,0,0],this.curEmissiveColor=this._cachedFillStyle=[0,0,0,0],this.curStrokeColor=this._cachedStrokeStyle=[0,0,0,1],this.curBlendMode=s.BLEND,this._cachedBlendMode=void 0,this.blendExt=this.GL.getExtension("EXT_blend_minmax"),this._isBlending=!1,this._useSpecularMaterial=!1,this._useEmissiveMaterial=!1,this._useNormalMaterial=!1,this._useShininess=1,this._useLineColor=!1,this._useVertexColor=!1,this.registerEnabled=[],this._tint=[255,255,255,255],this.constantAttenuation=1,this.linearAttenuation=0,this.quadraticAttenuation=0,this.uMVMatrix=new p.default.Matrix,this.uPMatrix=new p.default.Matrix,this.uNMatrix=new p.default.Matrix("mat3"),this._currentNormal=new p.default.Vector(0,0,1),this._curCamera=new p.default.Camera(this),this._curCamera._computeCameraDefaultSettings(),this._curCamera._setDefaultCamera(),this._defaultLightShader=void 0,this._defaultImmediateModeShader=void 0,this._defaultNormalShader=void 0,this._defaultColorShader=void 0,this._defaultPointShader=void 0,this.userFillShader=void 0,this.userStrokeShader=void 0,this.userPointShader=void 0,this.retainedMode={geometry:{},buffers:{stroke:[new p.default.RenderBuffer(4,"lineVertexColors","lineColorBuffer","aVertexColor",this,this._flatten),new p.default.RenderBuffer(3,"lineVertices","lineVerticesBuffer","aPosition",this,this._flatten),new p.default.RenderBuffer(3,"lineTangentsIn","lineTangentsInBuffer","aTangentIn",this,this._flatten),new p.default.RenderBuffer(3,"lineTangentsOut","lineTangentsOutBuffer","aTangentOut",this,this._flatten),new p.default.RenderBuffer(1,"lineSides","lineSidesBuffer","aSide",this)],fill:[new p.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new p.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new p.default.RenderBuffer(4,"vertexColors","colorBuffer","aVertexColor",this),new p.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new p.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],text:[new p.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new p.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)]}},this.immediateMode={geometry:new p.default.Geometry,shapeMode:s.TRIANGLE_FAN,_bezierVertex:[],_quadraticVertex:[],_curveVertex:[],buffers:{fill:[new p.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new p.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new p.default.RenderBuffer(4,"vertexColors","colorBuffer","aVertexColor",this),new p.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new p.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],stroke:[new p.default.RenderBuffer(4,"lineVertexColors","lineColorBuffer","aVertexColor",this,this._flatten),new p.default.RenderBuffer(3,"lineVertices","lineVerticesBuffer","aPosition",this,this._flatten),new p.default.RenderBuffer(3,"lineTangentsIn","lineTangentsInBuffer","aTangentIn",this,this._flatten),new p.default.RenderBuffer(3,"lineTangentsOut","lineTangentsOutBuffer","aTangentOut",this,this._flatten),new p.default.RenderBuffer(1,"lineSides","lineSidesBuffer","aSide",this)],point:this.GL.createBuffer()}},this.pointSize=5,this.curStrokeWeight=1,this.curStrokeCap=s.ROUND,this.curStrokeJoin=s.ROUND,this.textures=[],this.textureMode=s.IMAGE,this.textureWrapX=s.CLAMP,this.textureWrapY=s.CLAMP,this._tex=null,this._curveTightness=6,this._lookUpTableBezier=[],this._lookUpTableQuadratic=[],this._lutBezierDetail=0,this._lutQuadraticDetail=0,this.isProcessingVertices=!1,this._tessy=this._initTessy(),this.fontInfos={},this._curShader=void 0,this},p.default.RendererGL.prototype=Object.create(p.default.Renderer.prototype),p.default.RendererGL.prototype._setAttributeDefaults=function(e){var t={alpha:!0,depth:!0,stencil:!0,antialias:navigator.userAgent.toLowerCase().includes("safari"),premultipliedAlpha:!0,preserveDrawingBuffer:!0,perPixelLighting:!0};null===e._glAttributes?e._glAttributes=t:e._glAttributes=Object.assign(t,e._glAttributes)},p.default.RendererGL.prototype._initContext=function(){if(this.drawingContext=this.canvas.getContext("webgl",this._pInst._glAttributes)||this.canvas.getContext("experimental-webgl",this._pInst._glAttributes),null===this.drawingContext)throw new Error("Error creating webgl context");var e=this.drawingContext;e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),this._viewport=this.drawingContext.getParameter(this.drawingContext.VIEWPORT)},p.default.RendererGL.prototype._resetContext=function(e,t){var r,o=this.width,n=this.height,s=this.canvas.id,i=this._pInst instanceof p.default.Graphics,s=(i?((r=this._pInst).canvas.parentNode.removeChild(r.canvas),r.canvas=document.createElement("canvas"),(r._pInst._userNode||document.body).appendChild(r.canvas),p.default.Element.call(r,r.canvas,r._pInst),r.width=o,r.height=n):((r=this.canvas)&&r.parentNode.removeChild(r),(r=document.createElement("canvas")).id=s,(this._pInst._userNode||document.body).appendChild(r),this._pInst.canvas=r,this.canvas=r),new p.default.RendererGL(this._pInst.canvas,this._pInst,!i));this._pInst._setProperty("_renderer",s),s.resize(o,n),s._applyDefaults(),i||this._pInst._elements.push(s),"function"==typeof t&&setTimeout(function(){t.apply(window._renderer,e)},0)},p.default.prototype.setAttributes=function(e,t){if(void 0===this._glAttributes)console.log("You are trying to use setAttributes on a p5.Graphics object that does not use a WEBGL renderer.");else{var r=!0;if(void 0!==t?(null===this._glAttributes&&(this._glAttributes={}),this._glAttributes[e]!==t&&(this._glAttributes[e]=t,r=!1)):e instanceof Object&&this._glAttributes!==e&&(this._glAttributes=e,r=!1),this._renderer.isP3D&&!r){if(!this._setupDone)for(var o in this._renderer.retainedMode.geometry)if(this._renderer.retainedMode.geometry.hasOwnProperty(o))return void console.error("Sorry, Could not set the attributes, you need to call setAttributes() before calling the other drawing methods in setup()");this.push(),this._renderer._resetContext(),this.pop(),this._renderer._curCamera&&(this._renderer._curCamera._renderer=this._renderer)}}},p.default.RendererGL.prototype._update=function(){this.uMVMatrix.set(this._curCamera.cameraMatrix.mat4[0],this._curCamera.cameraMatrix.mat4[1],this._curCamera.cameraMatrix.mat4[2],this._curCamera.cameraMatrix.mat4[3],this._curCamera.cameraMatrix.mat4[4],this._curCamera.cameraMatrix.mat4[5],this._curCamera.cameraMatrix.mat4[6],this._curCamera.cameraMatrix.mat4[7],this._curCamera.cameraMatrix.mat4[8],this._curCamera.cameraMatrix.mat4[9],this._curCamera.cameraMatrix.mat4[10],this._curCamera.cameraMatrix.mat4[11],this._curCamera.cameraMatrix.mat4[12],this._curCamera.cameraMatrix.mat4[13],this._curCamera.cameraMatrix.mat4[14],this._curCamera.cameraMatrix.mat4[15]),this.ambientLightColors.length=0,this.specularColors=[1,1,1],this.directionalLightDirections.length=0,this.directionalLightDiffuseColors.length=0,this.directionalLightSpecularColors.length=0,this.pointLightPositions.length=0,this.pointLightDiffuseColors.length=0,this.pointLightSpecularColors.length=0,this.spotLightPositions.length=0,this.spotLightDirections.length=0,this.spotLightDiffuseColors.length=0,this.spotLightSpecularColors.length=0,this.spotLightAngle.length=0,this.spotLightConc.length=0,this._enableLighting=!1,this._tint=[255,255,255,255],this.GL.clear(this.GL.DEPTH_BUFFER_BIT)},p.default.RendererGL.prototype.background=function(){var e=(e=this._pInst).color.apply(e,arguments),t=e.levels[0]/255,r=e.levels[1]/255,o=e.levels[2]/255,e=e.levels[3]/255;this.clear(t,r,o,e)},p.default.RendererGL.prototype.fill=function(e,t,r,o){var n=p.default.prototype.color.apply(this._pInst,arguments);this.curFillColor=n._array,this.drawMode=s.FILL,this._useNormalMaterial=!1,this._tex=null},p.default.RendererGL.prototype.stroke=function(e,t,r,o){var n=p.default.prototype.color.apply(this._pInst,arguments);this.curStrokeColor=n._array},p.default.RendererGL.prototype.strokeCap=function(e){this.curStrokeCap=e},p.default.RendererGL.prototype.strokeJoin=function(e){this.curStrokeJoin=e},p.default.RendererGL.prototype.filter=function(e){console.error("filter() does not work in WEBGL mode")},p.default.RendererGL.prototype.blendMode=function(e){e===s.DARKEST||e===s.LIGHTEST||e===s.ADD||e===s.BLEND||e===s.SUBTRACT||e===s.SCREEN||e===s.EXCLUSION||e===s.REPLACE||e===s.MULTIPLY||e===s.REMOVE?this.curBlendMode=e:e!==s.BURN&&e!==s.OVERLAY&&e!==s.HARD_LIGHT&&e!==s.SOFT_LIGHT&&e!==s.DODGE||console.warn("BURN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, and DODGE only work for blendMode in 2D mode.")},p.default.RendererGL.prototype.erase=function(e,t){this._isErasing||(this._applyBlendMode(s.REMOVE),this._isErasing=!0,this._cachedFillStyle=this.curFillColor.slice(),this.curFillColor=[1,1,1,e/255],this._cachedStrokeStyle=this.curStrokeColor.slice(),this.curStrokeColor=[1,1,1,t/255])},p.default.RendererGL.prototype.noErase=function(){this._isErasing&&(this._isErasing=!1,this.curFillColor=this._cachedFillStyle.slice(),this.curStrokeColor=this._cachedStrokeStyle.slice(),this.blendMode(this._cachedBlendMode))},p.default.RendererGL.prototype.strokeWeight=function(e){this.curStrokeWeight!==e&&(this.pointSize=e,this.curStrokeWeight=e)},p.default.RendererGL.prototype._getPixel=function(e,t){var r=new Uint8Array(4);return this.drawingContext.readPixels(e,t,1,1,this.drawingContext.RGBA,this.drawingContext.UNSIGNED_BYTE,r),[r[0],r[1],r[2],r[3]]},p.default.RendererGL.prototype.loadPixels=function(){var e,t=this._pixelsState;!0!==this._pInst._glAttributes.preserveDrawingBuffer?console.log("loadPixels only works in WebGL when preserveDrawingBuffer is true."):(t=t.pixels,e=this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4,t instanceof Uint8Array&&t.length===e||(t=new Uint8Array(e),this._pixelsState._setProperty("pixels",t)),e=this._pInst._pixelDensity,this.GL.readPixels(0,0,this.width*e,this.height*e,this.GL.RGBA,this.GL.UNSIGNED_BYTE,t))},p.default.RendererGL.prototype.geometryInHash=function(e){return void 0!==this.retainedMode.geometry[e]},p.default.RendererGL.prototype.resize=function(e,t){p.default.Renderer.prototype.resize.call(this,e,t),this.GL.viewport(0,0,this.GL.drawingBufferWidth,this.GL.drawingBufferHeight),this._viewport=this.GL.getParameter(this.GL.VIEWPORT),this._curCamera._resize();e=this._pixelsState;void 0!==e.pixels&&e._setProperty("pixels",new Uint8Array(this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4))},p.default.RendererGL.prototype.clear=function(){var e=(arguments.length<=0?void 0:arguments[0])||0,t=(arguments.length<=1?void 0:arguments[1])||0,r=(arguments.length<=2?void 0:arguments[2])||0,o=(arguments.length<=3?void 0:arguments[3])||0;this.GL.clearColor(e*o,t*o,r*o,o),this.GL.clearDepth(1),this.GL.clear(this.GL.COLOR_BUFFER_BIT|this.GL.DEPTH_BUFFER_BIT)},p.default.RendererGL.prototype.applyMatrix=function(e,t,r,o,n,s){16===arguments.length?p.default.Matrix.prototype.apply.apply(this.uMVMatrix,arguments):this.uMVMatrix.apply([e,t,0,0,r,o,0,0,0,0,1,0,n,s,0,1])},p.default.RendererGL.prototype.translate=function(e,t,r){return e instanceof p.default.Vector&&(r=e.z,t=e.y,e=e.x),this.uMVMatrix.translate([e,t,r]),this},p.default.RendererGL.prototype.scale=function(e,t,r){return this.uMVMatrix.scale(e,t,r),this},p.default.RendererGL.prototype.rotate=function(e,t){return void 0===t?this.rotateZ(e):(p.default.Matrix.prototype.rotate.apply(this.uMVMatrix,arguments),this)},p.default.RendererGL.prototype.rotateX=function(e){return this.rotate(e,1,0,0),this},p.default.RendererGL.prototype.rotateY=function(e){return this.rotate(e,0,1,0),this},p.default.RendererGL.prototype.rotateZ=function(e){return this.rotate(e,0,0,1),this},p.default.RendererGL.prototype.push=function(){var e=p.default.Renderer.prototype.push.apply(this),t=e.properties;return t.uMVMatrix=this.uMVMatrix.copy(),t.uPMatrix=this.uPMatrix.copy(),t._curCamera=this._curCamera,this._curCamera=this._curCamera.copy(),t.ambientLightColors=this.ambientLightColors.slice(),t.specularColors=this.specularColors.slice(),t.directionalLightDirections=this.directionalLightDirections.slice(),t.directionalLightDiffuseColors=this.directionalLightDiffuseColors.slice(),t.directionalLightSpecularColors=this.directionalLightSpecularColors.slice(),t.pointLightPositions=this.pointLightPositions.slice(),t.pointLightDiffuseColors=this.pointLightDiffuseColors.slice(),t.pointLightSpecularColors=this.pointLightSpecularColors.slice(),t.spotLightPositions=this.spotLightPositions.slice(),t.spotLightDirections=this.spotLightDirections.slice(),t.spotLightDiffuseColors=this.spotLightDiffuseColors.slice(),t.spotLightSpecularColors=this.spotLightSpecularColors.slice(),t.spotLightAngle=this.spotLightAngle.slice(),t.spotLightConc=this.spotLightConc.slice(),t.userFillShader=this.userFillShader,t.userStrokeShader=this.userStrokeShader,t.userPointShader=this.userPointShader,t.pointSize=this.pointSize,t.curStrokeWeight=this.curStrokeWeight,t.curStrokeColor=this.curStrokeColor,t.curFillColor=this.curFillColor,t.curAmbientColor=this.curAmbientColor,t.curSpecularColor=this.curSpecularColor,t.curEmissiveColor=this.curEmissiveColor,t._useSpecularMaterial=this._useSpecularMaterial,t._useEmissiveMaterial=this._useEmissiveMaterial,t._useShininess=this._useShininess,t.constantAttenuation=this.constantAttenuation,t.linearAttenuation=this.linearAttenuation,t.quadraticAttenuation=this.quadraticAttenuation,t._enableLighting=this._enableLighting,t._useNormalMaterial=this._useNormalMaterial,t._tex=this._tex,t.drawMode=this.drawMode,t._currentNormal=this._currentNormal,t.curBlendMode=this.curBlendMode,e},p.default.RendererGL.prototype.resetMatrix=function(){return this.uMVMatrix.set(this._curCamera.cameraMatrix.mat4[0],this._curCamera.cameraMatrix.mat4[1],this._curCamera.cameraMatrix.mat4[2],this._curCamera.cameraMatrix.mat4[3],this._curCamera.cameraMatrix.mat4[4],this._curCamera.cameraMatrix.mat4[5],this._curCamera.cameraMatrix.mat4[6],this._curCamera.cameraMatrix.mat4[7],this._curCamera.cameraMatrix.mat4[8],this._curCamera.cameraMatrix.mat4[9],this._curCamera.cameraMatrix.mat4[10],this._curCamera.cameraMatrix.mat4[11],this._curCamera.cameraMatrix.mat4[12],this._curCamera.cameraMatrix.mat4[13],this._curCamera.cameraMatrix.mat4[14],this._curCamera.cameraMatrix.mat4[15]),this},p.default.RendererGL.prototype._getImmediateStrokeShader=function(){var e=this.userStrokeShader;return e&&e.isStrokeShader()?e:this._getLineShader()},p.default.RendererGL.prototype._getRetainedStrokeShader=p.default.RendererGL.prototype._getImmediateStrokeShader,p.default.RendererGL.prototype._getImmediateFillShader=function(){var e=this.userFillShader;if(this._useNormalMaterial&&(!e||!e.isNormalShader()))return this._getNormalShader();if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getImmediateModeShader();return e},p.default.RendererGL.prototype._getRetainedFillShader=function(){if(this._useNormalMaterial)return this._getNormalShader();var e=this.userFillShader;if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getColorShader();return e},p.default.RendererGL.prototype._getImmediatePointShader=function(){var e=this.userPointShader;return e&&e.isPointShader()?e:this._getPointShader()},p.default.RendererGL.prototype._getRetainedLineShader=p.default.RendererGL.prototype._getImmediateLineShader,p.default.RendererGL.prototype._getLightShader=function(){return this._defaultLightShader||(this._pInst._glAttributes.perPixelLighting?this._defaultLightShader=new p.default.Shader(this,y.phongVert,y.phongFrag):this._defaultLightShader=new p.default.Shader(this,y.lightVert,y.lightTextureFrag)),this._defaultLightShader},p.default.RendererGL.prototype._getImmediateModeShader=function(){return this._defaultImmediateModeShader||(this._defaultImmediateModeShader=new p.default.Shader(this,y.immediateVert,y.vertexColorFrag)),this._defaultImmediateModeShader},p.default.RendererGL.prototype._getNormalShader=function(){return this._defaultNormalShader||(this._defaultNormalShader=new p.default.Shader(this,y.normalVert,y.normalFrag)),this._defaultNormalShader},p.default.RendererGL.prototype._getColorShader=function(){return this._defaultColorShader||(this._defaultColorShader=new p.default.Shader(this,y.normalVert,y.basicFrag)),this._defaultColorShader},p.default.RendererGL.prototype._getPointShader=function(){return this._defaultPointShader||(this._defaultPointShader=new p.default.Shader(this,y.pointVert,y.pointFrag)),this._defaultPointShader},p.default.RendererGL.prototype._getLineShader=function(){return this._defaultLineShader||(this._defaultLineShader=new p.default.Shader(this,y.lineVert,y.lineFrag)),this._defaultLineShader},p.default.RendererGL.prototype._getFontShader=function(){return this._defaultFontShader||(this.GL.getExtension("OES_standard_derivatives"),this._defaultFontShader=new p.default.Shader(this,y.fontVert,y.fontFrag)),this._defaultFontShader},p.default.RendererGL.prototype._getEmptyTexture=function(){var e;return this._emptyTexture||((e=new p.default.Image(1,1)).set(0,0,255),this._emptyTexture=new p.default.Texture(this,e)),this._emptyTexture},p.default.RendererGL.prototype.getTexture=function(e){var t=this.textures,r=!0,o=!1,n=void 0;try{for(var s,i=t[Symbol.iterator]();!(r=(s=i.next()).done);r=!0){var a=s.value;if(a.src===e)return a}}catch(e){o=!0,n=e}finally{try{r||null==i.return||i.return()}finally{if(o)throw n}}o=new p.default.Texture(this,e);return t.push(o),o},p.default.RendererGL.prototype._setStrokeUniforms=function(e){e.bindShader(),e.setUniform("uUseLineColor",this._useLineColor),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uStrokeWeight",this.curStrokeWeight),e.setUniform("uStrokeCap",f[this.curStrokeCap]),e.setUniform("uStrokeJoin",h[this.curStrokeJoin])},p.default.RendererGL.prototype._setFillUniforms=function(e){e.bindShader(),e.setUniform("uUseVertexColor",this._useVertexColor),e.setUniform("uMaterialColor",this.curFillColor),e.setUniform("isTexture",!!this._tex),this._tex&&e.setUniform("uSampler",this._tex),e.setUniform("uTint",this._tint),e.setUniform("uAmbientMatColor",this.curAmbientColor),e.setUniform("uSpecularMatColor",this.curSpecularColor),e.setUniform("uEmissiveMatColor",this.curEmissiveColor),e.setUniform("uSpecular",this._useSpecularMaterial),e.setUniform("uEmissive",this._useEmissiveMaterial),e.setUniform("uShininess",this._useShininess),e.setUniform("uUseLighting",this._enableLighting);var t=this.pointLightDiffuseColors.length/3,t=(e.setUniform("uPointLightCount",t),e.setUniform("uPointLightLocation",this.pointLightPositions),e.setUniform("uPointLightDiffuseColors",this.pointLightDiffuseColors),e.setUniform("uPointLightSpecularColors",this.pointLightSpecularColors),this.directionalLightDiffuseColors.length/3),t=(e.setUniform("uDirectionalLightCount",t),e.setUniform("uLightingDirection",this.directionalLightDirections),e.setUniform("uDirectionalDiffuseColors",this.directionalLightDiffuseColors),e.setUniform("uDirectionalSpecularColors",this.directionalLightSpecularColors),this.ambientLightColors.length/3),t=(e.setUniform("uAmbientLightCount",t),e.setUniform("uAmbientColor",this.ambientLightColors),this.spotLightDiffuseColors.length/3);e.setUniform("uSpotLightCount",t),e.setUniform("uSpotLightAngle",this.spotLightAngle),e.setUniform("uSpotLightConc",this.spotLightConc),e.setUniform("uSpotLightDiffuseColors",this.spotLightDiffuseColors),e.setUniform("uSpotLightSpecularColors",this.spotLightSpecularColors),e.setUniform("uSpotLightLocation",this.spotLightPositions),e.setUniform("uSpotLightDirection",this.spotLightDirections),e.setUniform("uConstantAttenuation",this.constantAttenuation),e.setUniform("uLinearAttenuation",this.linearAttenuation),e.setUniform("uQuadraticAttenuation",this.quadraticAttenuation),e.bindTextures()},p.default.RendererGL.prototype._setPointUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uPointSize",this.pointSize*this._pInst._pixelDensity)},p.default.RendererGL.prototype._bindBuffer=function(e,t,r,o,n){t=t||this.GL.ARRAY_BUFFER,this.GL.bindBuffer(t,e),void 0!==r&&(e=new(o||Float32Array)(r),this.GL.bufferData(t,e,n||this.GL.STATIC_DRAW))},p.default.RendererGL.prototype._arraysEqual=function(e,t){var r=e.length;if(r!==t.length)return!1;for(var o=0;o<r;o++)if(e[o]!==t[o])return!1;return!0},p.default.RendererGL.prototype._isTypedArray=function(e){0 instanceof Float32Array;return 0 instanceof Float64Array,0 instanceof Int16Array,0 instanceof Uint16Array,e instanceof Uint32Array},p.default.RendererGL.prototype._flatten=function(e){if(0===e.length)return[];var t;if(2e4<e.length){for(var r=Object.prototype.toString,o=[],n=e.slice(),s=n.pop();"[object Array]"===r.call(s)?n.push.apply(n,u(s)):o.push(s),n.length&&void 0!==(s=n.pop()););return o.reverse(),o}return(t=[]).concat.apply(t,u(e))},p.default.RendererGL.prototype._vToNArray=function(e){var t=[],r=!0,o=!1,n=void 0;try{for(var s,i=e[Symbol.iterator]();!(r=(s=i.next()).done);r=!0){var a=s.value;t.push(a.x,a.y,a.z)}}catch(e){o=!0,n=e}finally{try{r||null==i.return||i.return()}finally{if(o)throw n}}return t},p.default.prototype._assert3d=function(e){if(!this._renderer.isP3D)throw new Error("".concat(e,"() is only supported in WEBGL mode. If you'd like to use 3D graphics and WebGL, see https://p5js.org/examples/form-3d-primitives.html for more information."))},p.default.RendererGL.prototype.tessyVertexSize=12,p.default.RendererGL.prototype._initTessy=function(){var e=new n.default.GluTesselator;return e.gluTessCallback(n.default.gluEnum.GLU_TESS_VERTEX_DATA,function(e,t){for(var r=0;r<e.length;r++)t[t.length]=e[r]}),e.gluTessCallback(n.default.gluEnum.GLU_TESS_BEGIN,function(e){e!==n.default.primitiveType.GL_TRIANGLES&&console.log("expected TRIANGLES but got type: ".concat(e))}),e.gluTessCallback(n.default.gluEnum.GLU_TESS_ERROR,function(e){console.log("error callback"),console.log("error number: ".concat(e))}),e.gluTessCallback(n.default.gluEnum.GLU_TESS_COMBINE,function(e,t,r){for(var o=new Array(p.default.RendererGL.prototype.tessyVertexSize).fill(0),n=0;n<r.length;n++)for(var s=0;s<o.length;s++)0!==r[n]&&t[n]&&(o[s]+=t[n][s]*r[n]);return o}),e.gluTessCallback(n.default.gluEnum.GLU_TESS_EDGE_FLAG,function(e){}),e},p.default.RendererGL.prototype._triangulate=function(e){var t=e[0]?e[0][2]:void 0,r=!0,o=!0,n=!1,s=void 0;try{for(var i,a=e[Symbol.iterator]();!(o=(i=a.next()).done);o=!0)for(var l=i.value,u=0;u<l.length;u+=p.default.RendererGL.prototype.tessyVertexSize)if(l[u+2]!==t){r=!1;break}}catch(e){n=!0,s=e}finally{try{o||null==a.return||a.return()}finally{if(n)throw s}}r?this._tessy.gluTessNormal(0,0,1):this._tessy.gluTessNormal(0,0,0);n=[];this._tessy.gluTessBeginPolygon(n);for(var c=0;c<e.length;c++){this._tessy.gluTessBeginContour();for(var d=e[c],f=0;f<d.length;f+=p.default.RendererGL.prototype.tessyVertexSize){var h=d.slice(f,f+p.default.RendererGL.prototype.tessyVertexSize);this._tessy.gluTessVertex(h,h)}this._tessy.gluTessEndContour()}return this._tessy.gluTessEndPolygon(),n},p.default.RendererGL.prototype._bezierCoefficients=function(e){var t=e*e,r=1-e,o=r*r;return[o*r,3*o*e,3*r*t,t*e]},p.default.RendererGL.prototype._quadraticCoefficients=function(e){var t=1-e;return[t*t,2*t*e,e*e]},p.default.RendererGL.prototype._bezierToCatmull=function(e){return[e[1],e[1]+(e[2]-e[0])/this._curveTightness,e[2]-(e[3]-e[1])/this._curveTightness,e[2]]},p.default.RendererGL);r.default=e},{"../core/constants":256,"../core/main":267,"../core/p5.Renderer":270,"./p5.Camera":315,"./p5.Matrix":317,"./p5.Shader":322,"core-js/modules/es.array.concat":149,"core-js/modules/es.array.fill":152,"core-js/modules/es.array.filter":153,"core-js/modules/es.array.from":155,"core-js/modules/es.array.includes":156,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.slice":162,"core-js/modules/es.object.assign":172,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.string.includes":185,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.typed-array.copy-within":197,"core-js/modules/es.typed-array.every":198,"core-js/modules/es.typed-array.fill":199,"core-js/modules/es.typed-array.filter":200,"core-js/modules/es.typed-array.find":202,"core-js/modules/es.typed-array.find-index":201,"core-js/modules/es.typed-array.float32-array":203,"core-js/modules/es.typed-array.float64-array":204,"core-js/modules/es.typed-array.for-each":205,"core-js/modules/es.typed-array.includes":206,"core-js/modules/es.typed-array.index-of":207,"core-js/modules/es.typed-array.int16-array":208,"core-js/modules/es.typed-array.iterator":210,"core-js/modules/es.typed-array.join":211,"core-js/modules/es.typed-array.last-index-of":212,"core-js/modules/es.typed-array.map":213,"core-js/modules/es.typed-array.reduce":215,"core-js/modules/es.typed-array.reduce-right":214,"core-js/modules/es.typed-array.reverse":216,"core-js/modules/es.typed-array.set":217,"core-js/modules/es.typed-array.slice":218,"core-js/modules/es.typed-array.some":219,"core-js/modules/es.typed-array.sort":220,"core-js/modules/es.typed-array.subarray":221,"core-js/modules/es.typed-array.to-locale-string":222,"core-js/modules/es.typed-array.to-string":223,"core-js/modules/es.typed-array.uint16-array":224,"core-js/modules/es.typed-array.uint32-array":225,"core-js/modules/es.typed-array.uint8-array":226,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230,libtess:239,path:242}],322:[function(e,t,r){"use strict";e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.function.name"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.function.name"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var s=(e=e("../core/main"))&&e.__esModule?e:{default:e};s.default.Shader=function(e,t,r){this._renderer=e,this._vertSrc=t,this._fragSrc=r,this._vertShader=-1,this._fragShader=-1,this._glProgram=0,this._loadedAttributes=!1,this.attributes={},this._loadedUniforms=!1,this.uniforms={},this._bound=!1,this.samplers=[]},s.default.Shader.prototype.init=function(){if(0===this._glProgram){var e=this._renderer.GL;if(this._vertShader=e.createShader(e.VERTEX_SHADER),e.shaderSource(this._vertShader,this._vertSrc),e.compileShader(this._vertShader),!e.getShaderParameter(this._vertShader,e.COMPILE_STATUS))return console.error("Yikes! An error occurred compiling the vertex shader:".concat(e.getShaderInfoLog(this._vertShader))),null;if(this._fragShader=e.createShader(e.FRAGMENT_SHADER),e.shaderSource(this._fragShader,this._fragSrc),e.compileShader(this._fragShader),!e.getShaderParameter(this._fragShader,e.COMPILE_STATUS))return console.error("Darn! An error occurred compiling the fragment shader:".concat(e.getShaderInfoLog(this._fragShader))),null;this._glProgram=e.createProgram(),e.attachShader(this._glProgram,this._vertShader),e.attachShader(this._glProgram,this._fragShader),e.linkProgram(this._glProgram),e.getProgramParameter(this._glProgram,e.LINK_STATUS)||console.error("Snap! Error linking shader program: ".concat(e.getProgramInfoLog(this._glProgram))),this._loadAttributes(),this._loadUniforms()}return this},s.default.Shader.prototype._loadAttributes=function(){if(!this._loadedAttributes){this.attributes={};for(var e=this._renderer.GL,t=e.getProgramParameter(this._glProgram,e.ACTIVE_ATTRIBUTES),r=0;r<t;++r){var o=e.getActiveAttrib(this._glProgram,r),n=o.name,s=e.getAttribLocation(this._glProgram,n),i={};i.name=n,i.location=s,i.index=r,i.type=o.type,i.size=o.size,this.attributes[n]=i}this._loadedAttributes=!0}},s.default.Shader.prototype._loadUniforms=function(){if(!this._loadedUniforms){for(var e=this._renderer.GL,t=e.getProgramParameter(this._glProgram,e.ACTIVE_UNIFORMS),r=0,o=0;o<t;++o){var n=e.getActiveUniform(this._glProgram,o),s={},i=(s.location=e.getUniformLocation(this._glProgram,n.name),s.size=n.size,n.name);1<n.size&&(i=i.substring(0,i.indexOf("[0]"))),s.name=i,s.type=n.type,s._cachedData=void 0,s.type===e.SAMPLER_2D&&(s.samplerIndex=r,r++,this.samplers.push(s)),s.isArray=1<n.size||s.type===e.FLOAT_MAT3||s.type===e.FLOAT_MAT4||s.type===e.FLOAT_VEC2||s.type===e.FLOAT_VEC3||s.type===e.FLOAT_VEC4||s.type===e.INT_VEC2||s.type===e.INT_VEC4||s.type===e.INT_VEC3,this.uniforms[i]=s}this._loadedUniforms=!0}},s.default.Shader.prototype.compile=function(){},s.default.Shader.prototype.bindShader=function(){this.init(),this._bound||(this.useProgram(),this._bound=!0,this._setMatrixUniforms(),this.setUniform("uViewport",this._renderer._viewport))},s.default.Shader.prototype.unbindShader=function(){return this._bound&&(this.unbindTextures(),this._bound=!1),this},s.default.Shader.prototype.bindTextures=function(){var e=this._renderer.GL,t=!0,r=!1,o=void 0;try{for(var n,s=this.samplers[Symbol.iterator]();!(t=(n=s.next()).done);t=!0){var i=n.value,a=i.texture;void 0===a&&(a=this._renderer._getEmptyTexture()),e.activeTexture(e.TEXTURE0+i.samplerIndex),a.bindTexture(),a.update(),e.uniform1i(i.location,i.samplerIndex)}}catch(e){r=!0,o=e}finally{try{t||null==s.return||s.return()}finally{if(r)throw o}}},s.default.Shader.prototype.updateTextures=function(){var e=!0,t=!1,r=void 0;try{for(var o,n=this.samplers[Symbol.iterator]();!(e=(o=n.next()).done);e=!0){var s=o.value.texture;s&&s.update()}}catch(e){t=!0,r=e}finally{try{e||null==n.return||n.return()}finally{if(t)throw r}}},s.default.Shader.prototype.unbindTextures=function(){var e=!0,t=!1,r=void 0;try{for(var o,n=this.samplers[Symbol.iterator]();!(e=(o=n.next()).done);e=!0){var s=o.value;this.setUniform(s.name,this._renderer._getEmptyTexture())}}catch(e){t=!0,r=e}finally{try{e||null==n.return||n.return()}finally{if(t)throw r}}},s.default.Shader.prototype._setMatrixUniforms=function(){var e=this._renderer._curCamera.cameraMatrix,t=this._renderer.uPMatrix,r=this._renderer.uMVMatrix,o=r.copy();o.mult(t),this.isStrokeShader()&&("default"===this._renderer._curCamera.cameraType?this.setUniform("uPerspective",1):this.setUniform("uPerspective",0)),this.setUniform("uViewMatrix",e.mat4),this.setUniform("uProjectionMatrix",t.mat4),this.setUniform("uModelViewMatrix",r.mat4),this.setUniform("uModelViewProjectionMatrix",o.mat4),this.uniforms.uNormalMatrix&&(this._renderer.uNMatrix.inverseTranspose(this._renderer.uMVMatrix),this.setUniform("uNormalMatrix",this._renderer.uNMatrix.mat3))},s.default.Shader.prototype.useProgram=function(){var e=this._renderer.GL;return this._renderer._curShader!==this&&(e.useProgram(this._glProgram),this._renderer._curShader=this),this},s.default.Shader.prototype.setUniform=function(e,t){var r=this.uniforms[e];if(r){var o=this._renderer.GL;if(r.isArray){if(r._cachedData&&this._renderer._arraysEqual(r._cachedData,t))return;r._cachedData=t.slice(0)}else{if(r._cachedData&&r._cachedData===t)return;Array.isArray(t)?r._cachedData=t.slice(0):r._cachedData=t}var n=r.location;switch(this.useProgram(),r.type){case o.BOOL:!0===t?o.uniform1i(n,1):o.uniform1i(n,0);break;case o.INT:1<r.size?t.length&&o.uniform1iv(n,t):o.uniform1i(n,t);break;case o.FLOAT:1<r.size?t.length&&o.uniform1fv(n,t):o.uniform1f(n,t);break;case o.FLOAT_MAT3:o.uniformMatrix3fv(n,!1,t);break;case o.FLOAT_MAT4:o.uniformMatrix4fv(n,!1,t);break;case o.FLOAT_VEC2:1<r.size?t.length&&o.uniform2fv(n,t):o.uniform2f(n,t[0],t[1]);break;case o.FLOAT_VEC3:1<r.size?t.length&&o.uniform3fv(n,t):o.uniform3f(n,t[0],t[1],t[2]);break;case o.FLOAT_VEC4:1<r.size?t.length&&o.uniform4fv(n,t):o.uniform4f(n,t[0],t[1],t[2],t[3]);break;case o.INT_VEC2:1<r.size?t.length&&o.uniform2iv(n,t):o.uniform2i(n,t[0],t[1]);break;case o.INT_VEC3:1<r.size?t.length&&o.uniform3iv(n,t):o.uniform3i(n,t[0],t[1],t[2]);break;case o.INT_VEC4:1<r.size?t.length&&o.uniform4iv(n,t):o.uniform4i(n,t[0],t[1],t[2],t[3]);break;case o.SAMPLER_2D:o.activeTexture(o.TEXTURE0+r.samplerIndex),r.texture=t instanceof s.default.Texture?t:this._renderer.getTexture(t),o.uniform1i(n,r.samplerIndex),r.texture.src.gifProperties&&r.texture.src._animateGif(this._renderer._pInst)}return this}},s.default.Shader.prototype.isLightShader=function(){return void 0!==this.attributes.aNormal||void 0!==this.uniforms.uUseLighting||void 0!==this.uniforms.uAmbientLightCount||void 0!==this.uniforms.uDirectionalLightCount||void 0!==this.uniforms.uPointLightCount||void 0!==this.uniforms.uAmbientColor||void 0!==this.uniforms.uDirectionalDiffuseColors||void 0!==this.uniforms.uDirectionalSpecularColors||void 0!==this.uniforms.uPointLightLocation||void 0!==this.uniforms.uPointLightDiffuseColors||void 0!==this.uniforms.uPointLightSpecularColors||void 0!==this.uniforms.uLightingDirection||void 0!==this.uniforms.uSpecular},s.default.Shader.prototype.isNormalShader=function(){return void 0!==this.attributes.aNormal},s.default.Shader.prototype.isTextureShader=function(){return 0<this.samplers.length},s.default.Shader.prototype.isColorShader=function(){return void 0!==this.attributes.aVertexColor||void 0!==this.uniforms.uMaterialColor},s.default.Shader.prototype.isTexLightShader=function(){return this.isLightShader()&&this.isTextureShader()},s.default.Shader.prototype.isStrokeShader=function(){return void 0!==this.uniforms.uStrokeWeight},s.default.Shader.prototype.enableAttrib=function(e,t,r,o,n,s){var i;return e&&-1!==(e=e.location)&&(i=this._renderer.GL,this._renderer.registerEnabled[e]||(i.enableVertexAttribArray(e),this._renderer.registerEnabled[e]=!0),this._renderer.GL.vertexAttribPointer(e,t,r||i.FLOAT,o||!1,n||0,s||0)),this};e=s.default.Shader;r.default=e},{"../core/main":267,"core-js/modules/es.array.index-of":157,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.slice":162,"core-js/modules/es.function.name":165,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/web.dom-collections.iterator":230}],323:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(s=e("../core/main"))&&s.__esModule?s:{default:s},a=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants"));function l(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,l=function(){return e},e)}n.default.Texture=function(e,t,r){this._renderer=e;e=this._renderer.GL,(r=r||{}).dataType===e.FLOAT&&(e.getExtension("OES_texture_float")||console.log("Oh no, your device doesn't support floating point textures!"),e.getExtension("OES_texture_float_linear")||console.log("Ack! Your device doesn't support linear filtering for floating point textures")),this.src=t,this.glTex=void 0,this.glTarget=e.TEXTURE_2D,this.glFormat=r.format||e.RGBA,this.mipmaps=!1,this.glMinFilter=r.minFilter||e.LINEAR,this.glMagFilter=r.magFilter||e.LINEAR,this.glWrapS=r.wrapS||e.CLAMP_TO_EDGE,this.glWrapT=r.wrapT||e.CLAMP_TO_EDGE,this.glDataType=r.dataType||e.UNSIGNED_BYTE,this.isSrcMediaElement=void 0!==n.default.MediaElement&&t instanceof n.default.MediaElement,this._videoPrevUpdateTime=0,this.isSrcHTMLElement=void 0!==n.default.Element&&t instanceof n.default.Element&&!(t instanceof n.default.Graphics)&&!(t instanceof n.default.Renderer),this.isSrcP5Image=t instanceof n.default.Image,this.isSrcP5Graphics=t instanceof n.default.Graphics,this.isSrcP5Renderer=t instanceof n.default.Renderer,this.isImageData="undefined"!=typeof ImageData&&t instanceof ImageData,r=this._getTextureDataFromSource();return this.width=r.width,this.height=r.height,this.init(r),this},n.default.Texture.prototype._getTextureDataFromSource=function(){var e;return this.isSrcP5Image?e=this.src.canvas:this.isSrcMediaElement||this.isSrcP5Graphics||this.isSrcP5Renderer||this.isSrcHTMLElement?e=this.src.elt:this.isImageData&&(e=this.src),e},n.default.Texture.prototype.init=function(e){var t,r=this._renderer.GL;this.glTex=r.createTexture(),this.glWrapS=this._renderer.textureWrapX,this.glWrapT=this._renderer.textureWrapY,this.setWrapMode(this.glWrapS,this.glWrapT),this.bindTexture(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,this.glMagFilter),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,this.glMinFilter),0===this.width||0===this.height||this.isSrcMediaElement&&!this.src.loadedmetadata?(t=new Uint8Array([1,1,1,1]),r.texImage2D(this.glTarget,0,r.RGBA,1,1,0,this.glFormat,this.glDataType,t)):r.texImage2D(this.glTarget,0,this.glFormat,this.glFormat,this.glDataType,e)},n.default.Texture.prototype.update=function(){var e,t,r,o=this.src;return 0!==o.width&&0!==o.height&&(e=this._getTextureDataFromSource(),t=!1,r=this._renderer.GL,e.width!==this.width||e.height!==this.height?(t=!0,this.width=e.width,this.height=e.height,this.isSrcP5Image?o.setModified(!1):(this.isSrcMediaElement||this.isSrcHTMLElement)&&o.setModified(!0)):this.isSrcP5Image?o.isModified()&&o.setModified(!(t=!0)):this.isSrcMediaElement?o.isModified()?o.setModified(!(t=!0)):o.loadedmetadata&&this._videoPrevUpdateTime!==o.time()&&(this._videoPrevUpdateTime=o.time(),t=!0):this.isImageData?o._dirty&&(t=!(o._dirty=!1)):t=!0,t&&(this.bindTexture(),r.texImage2D(this.glTarget,0,this.glFormat,this.glFormat,this.glDataType,e)),t)},n.default.Texture.prototype.bindTexture=function(){return this._renderer.GL.bindTexture(this.glTarget,this.glTex),this},n.default.Texture.prototype.unbindTexture=function(){this._renderer.GL.bindTexture(this.glTarget,null)},n.default.Texture.prototype.setInterpolation=function(e,t){var r=this._renderer.GL;e===a.NEAREST?this.glMinFilter=r.NEAREST:this.glMinFilter=r.LINEAR,t===a.NEAREST?this.glMagFilter=r.NEAREST:this.glMagFilter=r.LINEAR,this.bindTexture(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,this.glMinFilter),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,this.glMagFilter),this.unbindTexture()},n.default.Texture.prototype.setWrapMode=function(e,t){function r(e){return 0==(e&e-1)}var o=this._renderer.GL,n=this._getTextureDataFromSource(),n=n.naturalWidth&&n.naturalHeight?(s=n.naturalWidth,n.naturalHeight):(s=this.width,this.height),s=r(s),n=r(n);e===a.REPEAT?s&&n?this.glWrapS=o.REPEAT:(console.warn("You tried to set the wrap mode to REPEAT but the texture size is not a power of two. Setting to CLAMP instead"),this.glWrapS=o.CLAMP_TO_EDGE):e===a.MIRROR?s&&n?this.glWrapS=o.MIRRORED_REPEAT:(console.warn("You tried to set the wrap mode to MIRROR but the texture size is not a power of two. Setting to CLAMP instead"),this.glWrapS=o.CLAMP_TO_EDGE):this.glWrapS=o.CLAMP_TO_EDGE,t===a.REPEAT?s&&n?this.glWrapT=o.REPEAT:(console.warn("You tried to set the wrap mode to REPEAT but the texture size is not a power of two. Setting to CLAMP instead"),this.glWrapT=o.CLAMP_TO_EDGE):t===a.MIRROR?s&&n?this.glWrapT=o.MIRRORED_REPEAT:(console.warn("You tried to set the wrap mode to MIRROR but the texture size is not a power of two. Setting to CLAMP instead"),this.glWrapT=o.CLAMP_TO_EDGE):this.glWrapT=o.CLAMP_TO_EDGE,this.bindTexture(),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,this.glWrapS),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,this.glWrapT),this.unbindTexture()};var s=n.default.Texture;r.default=s},{"../core/constants":256,"../core/main":267,"core-js/modules/es.array.iterator":158,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.typed-array.copy-within":197,"core-js/modules/es.typed-array.every":198,"core-js/modules/es.typed-array.fill":199,"core-js/modules/es.typed-array.filter":200,"core-js/modules/es.typed-array.find":202,"core-js/modules/es.typed-array.find-index":201,"core-js/modules/es.typed-array.for-each":205,"core-js/modules/es.typed-array.includes":206,"core-js/modules/es.typed-array.index-of":207,"core-js/modules/es.typed-array.iterator":210,"core-js/modules/es.typed-array.join":211,"core-js/modules/es.typed-array.last-index-of":212,"core-js/modules/es.typed-array.map":213,"core-js/modules/es.typed-array.reduce":215,"core-js/modules/es.typed-array.reduce-right":214,"core-js/modules/es.typed-array.reverse":216,"core-js/modules/es.typed-array.set":217,"core-js/modules/es.typed-array.slice":218,"core-js/modules/es.typed-array.some":219,"core-js/modules/es.typed-array.sort":220,"core-js/modules/es.typed-array.subarray":221,"core-js/modules/es.typed-array.to-locale-string":222,"core-js/modules/es.typed-array.to-string":223,"core-js/modules/es.typed-array.uint8-array":226,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],324:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.sub"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.sub"),e("core-js/modules/web.dom-collections.iterator");var n,B=(n=e("../core/main"))&&n.__esModule?n:{default:n},E=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}e("./p5.Shader"),e("./p5.RendererGL.Retained"),B.default.RendererGL.prototype._applyTextProperties=function(){},B.default.RendererGL.prototype.textWidth=function(e){return this._isOpenType()?this._textFont._textWidth(e,this._textSize):0};function s(e,t){this.width=e,this.height=t,this.infos=[],this.findImage=function(e){var t,r,o=this.width*this.height;if(o<e)throw new Error("font is too complex to render in 3D");for(var n=this.infos.length-1;0<=n;--n){var s=this.infos[n];if(s.index+e<o){r=(t=s).imageData;break}}if(!t){try{r=new ImageData(this.width,this.height)}catch(e){var i=document.getElementsByTagName("canvas")[0],a=!i,l=(i||((i=document.createElement("canvas")).style.display="none",document.body.appendChild(i)),i.getContext("2d"));l&&(r=l.createImageData(this.width,this.height)),a&&document.body.removeChild(i)}this.infos.push(t={index:0,imageData:r})}l=t.index;return t.index+=e,r._dirty=!0,{imageData:r,index:l}}}function G(e,t,r,o,n){var s=e.imageData.data,e=4*e.index++;s[e++]=t,s[e++]=r,s[e++]=o,s[+e]=n}function T(e){this.font=e,this.strokeImageInfos=new s(64,64),this.colDimImageInfos=new s(64,64),this.rowDimImageInfos=new s(64,64),this.colCellImageInfos=new s(64,64),this.rowCellImageInfos=new s(64,64),this.glyphInfos={},this.getGlyphInfo=function(e){var t=this.glyphInfos[e.index];if(!t){var r=e.getBoundingBox(),o=r.x1,n=r.y1,s=r.x2-o,i=r.y2-n,a=e.path.commands;if(0==s||0==i||!a.length)return this.glyphInfos[e.index]={};for(var l,u,c,d,f=[],h=[],p=[],m=8;0<=m;--m)p.push([]);for(m=8;0<=m;--m)h.push([]);var y=!0,g=!1,v=void 0;try{for(var b,j=a[Symbol.iterator]();!(y=(b=j.next()).done);y=!0){var _=b.value,x=(_.x-o)/s,w=(_.y-n)/i;if(!N(l,u,x,w)){switch(_.type){case"M":c=x,d=w;break;case"L":U(l,u,x,w);break;case"Q":var S=(_.x1-o)/s,M=(_.y1-n)/i;A([l,x,S],[u,w,M],{x:l,y:u,cx:S,cy:M});break;case"Z":N(l,u,c,d)?f.push({x:l,y:u}):(U(l,u,c,d),f.push({x:c,y:d}));break;case"C":for(var E=function(e,t,r,o,n,s,i,a){var e=new I(new B.default.Vector(e,t),new B.default.Vector(r,o),new B.default.Vector(n,s),new B.default.Vector(i,a)).splitInflections(),l=[],u=30/V,c=!0,t=!1,r=void 0;try{for(var d,f=e[Symbol.iterator]();!(c=(d=f.next()).done);c=!0){for(var h=d.value,p=[],m=void 0;!(.125<=(m=u/h.quadError()));){var y=Math.pow(m,1/3),g=h.split(y),v=h.split(1-y/(1-y));l.push(g),p.push(h),h=v}m<1&&l.push(h.split(.5)),l.push(h),Array.prototype.push.apply(l,p.reverse())}}catch(e){t=!0,r=e}finally{try{c||null==f.return||f.return()}finally{if(t)throw r}}return l}(l,u,(_.x1-o)/s,(_.y1-n)/i,(_.x2-o)/s,(_.y2-n)/i,x,w),T=0;T<E.length;T++){var C=E[T].toQuadratic();A([C.x,C.x1,C.cx],[C.y,C.y1,C.cy],C)}break;default:throw new Error("unknown command type: ".concat(_.type))}l=x,u=w}}}catch(e){g=!0,v=e}finally{try{y||null==j.return||j.return()}finally{if(g)throw v}}for(var O=f.length,k=this.strokeImageInfos.findImage(O),D=k.index,L=0;L<O;++L){var P=f[L];G(k,R(P.x),R(P.y),R(P.cx),R(P.cy))}(t=this.glyphInfos[e.index]={glyph:e,uGlyphRect:[r.x1,-r.y1,r.x2,-r.y2],strokeImageInfo:k,strokes:f,colInfo:F(p,this.colDimImageInfos,this.colCellImageInfos),rowInfo:F(h,this.rowDimImageInfos,this.rowCellImageInfos)}).uGridOffset=[t.colInfo.dimOffset,t.rowInfo.dimOffset]}return t;function A(e,t,r){var o=f.length;function n(e,t,r){for(var o=e.length;0<o--;){var n=e[o];n<t&&(t=n),r<n&&(r=n)}return{min:t,max:r}}f.push(r);for(var r=n(e,1,0),e=Math.max(Math.floor(9*r.min-.5),0),s=Math.min(Math.ceil(9*r.max+.5),9),i=e;i<s;++i)p[i].push(o);for(var r=n(t,1,0),e=Math.max(Math.floor(9*r.min-.5),0),a=Math.min(Math.ceil(9*r.max+.5),9),l=e;l<a;++l)h[l].push(o)}function R(e){return(e=(r=255)*e)<(t=0)?t:r<e?r:e;var t,r}function I(e,t,r,o){this.p0=e,this.c0=t,this.c1=r,this.p1=o,this.toQuadratic=function(){return{x:this.p0.x,y:this.p0.y,x1:this.p1.x,y1:this.p1.y,cx:(3*(this.c0.x+this.c1.x)-(this.p0.x+this.p1.x))/4,cy:(3*(this.c0.y+this.c1.y)-(this.p0.y+this.p1.y))/4}},this.quadError=function(){return B.default.Vector.sub(B.default.Vector.sub(this.p1,this.p0),B.default.Vector.mult(B.default.Vector.sub(this.c1,this.c0),3)).mag()/2},this.split=function(e){var t=B.default.Vector.lerp(this.p0,this.c0,e),r=B.default.Vector.lerp(this.c0,this.c1,e),o=B.default.Vector.lerp(t,r,e),r=(this.c1=B.default.Vector.lerp(this.c1,this.p1,e),this.c0=B.default.Vector.lerp(r,this.c1,e),B.default.Vector.lerp(o,this.c0,e)),e=new I(this.p0,t,o,r);return this.p0=r,e},this.splitInflections=function(){var e=B.default.Vector.sub(this.c0,this.p0),t=B.default.Vector.sub(B.default.Vector.sub(this.c1,this.c0),e),r=B.default.Vector.sub(B.default.Vector.sub(B.default.Vector.sub(this.p1,this.c1),e),B.default.Vector.mult(t,2)),o=[],n=t.x*r.y-t.y*r.x;return 0!==n&&0<=(e=(r=e.x*r.y-e.y*r.x)*r-4*n*(e.x*t.y-e.y*t.x))&&(n<0&&(n=-n,r=-r,0),e=(-r+(t=Math.sqrt(e)))/(2*n),0<(r=(-r-t)/(2*n))&&r<1&&(o.push(this.split(r)),e=1-(1-e)/(1-r)),0<e&&e<1&&o.push(this.split(e))),o.push(this),o}}function U(e,t,r,o){A([e,r],[t,o],{x:e,y:t,cx:(e+r)/2,cy:(t+o)/2})}function N(e,t,r,o){return Math.abs(r-e)<1e-5&&Math.abs(o-t)<1e-5}function F(e,t,r){for(var o=e.length,n=t.findImage(o),t=n.index,s=0,i=0;i<o;++i)s+=e[i].length;for(var a=r.findImage(s),l=0;l<o;++l){var u=e[l],c=u.length,d=a.index;G(n,d>>7,127&d,c>>7,127&c);for(var f=0;f<c;++f){var h=u[f]+D;G(a,h>>7,127&h,0,0)}}return{cellImageInfo:a,dimOffset:t,dimImageInfo:n}}}}var V=Math.sqrt(3);B.default.RendererGL.prototype._renderText=function(e,t,r,o,n){if(this._textFont&&"string"!=typeof this._textFont){if(!(n<=o)&&this._doFill){if(this._isOpenType()){e.push();var n=this._doStroke,s=this.drawMode,i=(this._doStroke=!1,this.drawMode=E.TEXTURE,this._textFont.font),a=(a=this._textFont._fontInfo)||(this._textFont._fontInfo=new T(i)),r=this._textFont._handleAlignment(this,t,r,o),o=this._textSize/i.unitsPerEm,l=(this.translate(r.x,r.y,0),this.scale(o,o,1),this.GL),r=!this._defaultFontShader,u=this._getFontShader(),c=(u.init(),u.bindShader(),r&&(u.setUniform("uGridImageSize",[64,64]),u.setUniform("uCellsImageSize",[64,64]),u.setUniform("uStrokeImageSize",[64,64]),u.setUniform("uGridSize",[9,9])),this._applyColorBlend(this.curFillColor),this.retainedMode.geometry.glyph),d=(c||((o=this._textGeom=new B.default.Geometry(1,1,function(){for(var e=0;e<=1;e++)for(var t=0;t<=1;t++)this.vertices.push(new B.default.Vector(t,e,0)),this.uvs.push(t,e)})).computeFaces().computeNormals(),c=this.createBuffers("glyph",o)),!0),r=!1,o=void 0;try{for(var f,h=this.retainedMode.buffers.text[Symbol.iterator]();!(d=(f=h.next()).done);d=!0)f.value._prepareBuffer(c,u)}catch(e){r=!0,o=e}finally{try{d||null==h.return||h.return()}finally{if(r)throw o}}this._bindBuffer(c.indexBuffer,l.ELEMENT_ARRAY_BUFFER),u.setUniform("uMaterialColor",this.curFillColor);try{var p=0,m=null,y=i.stringToGlyphs(t),g=!0,v=!1,b=void 0;try{for(var j,_=y[Symbol.iterator]();!(g=(j=_.next()).done);g=!0){var x,w,S=j.value,M=(m&&(p+=i.getKerningValue(m,S)),a.getGlyphInfo(S));M.uGlyphRect&&(x=M.rowInfo,w=M.colInfo,u.setUniform("uSamplerStrokes",M.strokeImageInfo.imageData),u.setUniform("uSamplerRowStrokes",x.cellImageInfo.imageData),u.setUniform("uSamplerRows",x.dimImageInfo.imageData),u.setUniform("uSamplerColStrokes",w.cellImageInfo.imageData),u.setUniform("uSamplerCols",w.dimImageInfo.imageData),u.setUniform("uGridOffset",M.uGridOffset),u.setUniform("uGlyphRect",M.uGlyphRect),u.setUniform("uGlyphOffset",p),u.bindTextures(),l.drawElements(l.TRIANGLES,6,this.GL.UNSIGNED_SHORT,0)),p+=S.advanceWidth,m=S}}catch(e){v=!0,b=e}finally{try{g||null==_.return||_.return()}finally{if(v)throw b}}}finally{u.unbindShader(),this._doStroke=n,this.drawMode=s,e.pop()}}else console.log("WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported");return e}}else console.log("WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.")}},{"../core/constants":256,"../core/main":267,"./p5.RendererGL.Retained":320,"./p5.Shader":322,"core-js/modules/es.array.iterator":158,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.string.iterator":186,"core-js/modules/es.string.split":191,"core-js/modules/es.string.sub":192,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}]},{},[251])(251)}); \ No newline at end of file
diff --git a/vhosts/blog/public/pdf.min.js b/vhosts/blog/public/pdf.min.js
new file mode 100644
index 00000000..e156646b
--- /dev/null
+++ b/vhosts/blog/public/pdf.min.js
@@ -0,0 +1,22 @@
+/**
+ * @licstart The following is the entire license notice for the
+ * JavaScript code in this page
+ *
+ * Copyright 2023 Mozilla Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * @licend The above is the entire license notice for the
+ * JavaScript code in this page
+ */
+!function webpackUniversalModuleDefinition(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("pdfjs-dist/build/pdf",[],e):"object"==typeof exports?exports["pdfjs-dist/build/pdf"]=e():t["pdfjs-dist/build/pdf"]=t.pdfjsLib=e()}(globalThis,(()=>(()=>{"use strict";var __webpack_modules__=[,(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0});e.VerbosityLevel=e.Util=e.UnknownErrorException=e.UnexpectedResponseException=e.UNSUPPORTED_FEATURES=e.TextRenderingMode=e.RenderingIntentFlag=e.PermissionFlag=e.PasswordResponses=e.PasswordException=e.PageActionEventType=e.OPS=e.MissingPDFException=e.LINE_FACTOR=e.LINE_DESCENT_FACTOR=e.InvalidPDFException=e.ImageKind=e.IDENTITY_MATRIX=e.FormatError=e.FeatureTest=e.FONT_IDENTITY_MATRIX=e.DocumentActionEventType=e.CMapCompressionType=e.BaseException=e.BASELINE_FACTOR=e.AnnotationType=e.AnnotationStateModelType=e.AnnotationReviewState=e.AnnotationReplyType=e.AnnotationMode=e.AnnotationMarkedState=e.AnnotationFlag=e.AnnotationFieldFlag=e.AnnotationEditorType=e.AnnotationEditorPrefix=e.AnnotationEditorParamsType=e.AnnotationBorderStyleType=e.AnnotationActionEventType=e.AbortException=void 0;e.assert=function assert(t,e){t||unreachable(e)};e.bytesToString=function bytesToString(t){"object"==typeof t&&null!==t&&void 0!==t.length||unreachable("Invalid argument for bytesToString");const e=t.length,s=8192;if(e<s)return String.fromCharCode.apply(null,t);const n=[];for(let i=0;i<e;i+=s){const a=Math.min(i+s,e),r=t.subarray(i,a);n.push(String.fromCharCode.apply(null,r))}return n.join("")};e.createPromiseCapability=function createPromiseCapability(){const t=Object.create(null);let e=!1;Object.defineProperty(t,"settled",{get:()=>e});t.promise=new Promise((function(s,n){t.resolve=function(t){e=!0;s(t)};t.reject=function(t){e=!0;n(t)}}));return t};e.createValidAbsoluteUrl=function createValidAbsoluteUrl(t,e=null,s=null){if(!t)return null;try{if(s&&"string"==typeof t){if(s.addDefaultProtocol&&t.startsWith("www.")){const e=t.match(/\./g);e&&e.length>=2&&(t=`http://${t}`)}if(s.tryConvertEncoding)try{t=stringToUTF8String(t)}catch(t){}}const n=e?new URL(t,e):new URL(t);if(function _isValidProtocol(t){if(!t)return!1;switch(t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(n))return n}catch(t){}return null};e.getModificationDate=function getModificationDate(t=new Date){return[t.getUTCFullYear().toString(),(t.getUTCMonth()+1).toString().padStart(2,"0"),t.getUTCDate().toString().padStart(2,"0"),t.getUTCHours().toString().padStart(2,"0"),t.getUTCMinutes().toString().padStart(2,"0"),t.getUTCSeconds().toString().padStart(2,"0")].join("")};e.getVerbosityLevel=function getVerbosityLevel(){return n};e.info=function info(t){n>=s.INFOS&&console.log(`Info: ${t}`)};e.isArrayBuffer=function isArrayBuffer(t){return"object"==typeof t&&null!==t&&void 0!==t.byteLength};e.isArrayEqual=function isArrayEqual(t,e){if(t.length!==e.length)return!1;for(let s=0,n=t.length;s<n;s++)if(t[s]!==e[s])return!1;return!0};e.objectFromMap=function objectFromMap(t){const e=Object.create(null);for(const[s,n]of t)e[s]=n;return e};e.objectSize=function objectSize(t){return Object.keys(t).length};e.setVerbosityLevel=function setVerbosityLevel(t){Number.isInteger(t)&&(n=t)};e.shadow=shadow;e.string32=function string32(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t)};e.stringToBytes=stringToBytes;e.stringToPDFString=function stringToPDFString(t){if(t[0]>="ï"){let e;"þ"===t[0]&&"ÿ"===t[1]?e="utf-16be":"ÿ"===t[0]&&"þ"===t[1]?e="utf-16le":"ï"===t[0]&&"»"===t[1]&&"¿"===t[2]&&(e="utf-8");if(e)try{const s=new TextDecoder(e,{fatal:!0}),n=stringToBytes(t);return s.decode(n)}catch(t){warn(`stringToPDFString: "${t}".`)}}const e=[];for(let s=0,n=t.length;s<n;s++){const n=r[t.charCodeAt(s)];e.push(n?String.fromCharCode(n):t.charAt(s))}return e.join("")};e.stringToUTF8String=stringToUTF8String;e.unreachable=unreachable;e.utf8StringToString=function utf8StringToString(t){return unescape(encodeURIComponent(t))};e.warn=warn;e.IDENTITY_MATRIX=[1,0,0,1,0,0];e.FONT_IDENTITY_MATRIX=[.001,0,0,.001,0,0];e.LINE_FACTOR=1.35;e.LINE_DESCENT_FACTOR=.35;e.BASELINE_FACTOR=.25925925925925924;e.RenderingIntentFlag={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};e.AnnotationMode={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};e.AnnotationEditorPrefix="pdfjs_internal_editor_";e.AnnotationEditorType={DISABLE:-1,NONE:0,FREETEXT:3,INK:15};e.AnnotationEditorParamsType={FREETEXT_SIZE:1,FREETEXT_COLOR:2,FREETEXT_OPACITY:3,INK_COLOR:11,INK_THICKNESS:12,INK_OPACITY:13};e.PermissionFlag={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};e.TextRenderingMode={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};e.ImageKind={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};e.AnnotationType={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26};e.AnnotationStateModelType={MARKED:"Marked",REVIEW:"Review"};e.AnnotationMarkedState={MARKED:"Marked",UNMARKED:"Unmarked"};e.AnnotationReviewState={ACCEPTED:"Accepted",REJECTED:"Rejected",CANCELLED:"Cancelled",COMPLETED:"Completed",NONE:"None"};e.AnnotationReplyType={GROUP:"Group",REPLY:"R"};e.AnnotationFlag={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};e.AnnotationFieldFlag={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};e.AnnotationBorderStyleType={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};e.AnnotationActionEventType={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"};e.DocumentActionEventType={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};e.PageActionEventType={O:"PageOpen",C:"PageClose"};const s={ERRORS:0,WARNINGS:1,INFOS:5};e.VerbosityLevel=s;e.CMapCompressionType={NONE:0,BINARY:1};e.OPS={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};e.UNSUPPORTED_FEATURES={forms:"forms",javaScript:"javaScript",signatures:"signatures",smask:"smask",shadingPattern:"shadingPattern",errorTilingPattern:"errorTilingPattern",errorExtGState:"errorExtGState",errorXObject:"errorXObject",errorFontLoadType3:"errorFontLoadType3",errorFontState:"errorFontState",errorFontMissing:"errorFontMissing",errorFontTranslate:"errorFontTranslate",errorColorSpace:"errorColorSpace",errorOperatorList:"errorOperatorList",errorFontToUnicode:"errorFontToUnicode",errorFontLoadNative:"errorFontLoadNative",errorFontBuildPath:"errorFontBuildPath",errorFontGetPath:"errorFontGetPath",errorMarkedContent:"errorMarkedContent",errorContentSubStream:"errorContentSubStream"};e.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let n=s.WARNINGS;function warn(t){n>=s.WARNINGS&&console.log(`Warning: ${t}`)}function unreachable(t){throw new Error(t)}function shadow(t,e,s,n=!1){Object.defineProperty(t,e,{value:s,enumerable:!n,configurable:!0,writable:!1});return s}const i=function BaseExceptionClosure(){function BaseException(t,e){this.constructor===BaseException&&unreachable("Cannot initialize BaseException.");this.message=t;this.name=e}BaseException.prototype=new Error;BaseException.constructor=BaseException;return BaseException}();e.BaseException=i;e.PasswordException=class PasswordException extends i{constructor(t,e){super(t,"PasswordException");this.code=e}};e.UnknownErrorException=class UnknownErrorException extends i{constructor(t,e){super(t,"UnknownErrorException");this.details=e}};e.InvalidPDFException=class InvalidPDFException extends i{constructor(t){super(t,"InvalidPDFException")}};e.MissingPDFException=class MissingPDFException extends i{constructor(t){super(t,"MissingPDFException")}};e.UnexpectedResponseException=class UnexpectedResponseException extends i{constructor(t,e){super(t,"UnexpectedResponseException");this.status=e}};e.FormatError=class FormatError extends i{constructor(t){super(t,"FormatError")}};e.AbortException=class AbortException extends i{constructor(t){super(t,"AbortException")}};function stringToBytes(t){"string"!=typeof t&&unreachable("Invalid argument for stringToBytes");const e=t.length,s=new Uint8Array(e);for(let n=0;n<e;++n)s[n]=255&t.charCodeAt(n);return s}e.FeatureTest=class FeatureTest{static get isLittleEndian(){return shadow(this,"isLittleEndian",function isLittleEndian(){const t=new Uint8Array(4);t[0]=1;return 1===new Uint32Array(t.buffer,0,1)[0]}())}static get isEvalSupported(){return shadow(this,"isEvalSupported",function isEvalSupported(){try{new Function("");return!0}catch(t){return!1}}())}static get isOffscreenCanvasSupported(){return shadow(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}static get platform(){return"undefined"==typeof navigator?shadow(this,"platform",{isWin:!1,isMac:!1}):shadow(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}};const a=[...Array(256).keys()].map((t=>t.toString(16).padStart(2,"0")));class Util{static makeHexColor(t,e,s){return`#${a[t]}${a[e]}${a[s]}`}static scaleMinMax(t,e){let s;if(t[0]){if(t[0]<0){s=e[0];e[0]=e[1];e[1]=s}e[0]*=t[0];e[1]*=t[0];if(t[3]<0){s=e[2];e[2]=e[3];e[3]=s}e[2]*=t[3];e[3]*=t[3]}else{s=e[0];e[0]=e[2];e[2]=s;s=e[1];e[1]=e[3];e[3]=s;if(t[1]<0){s=e[2];e[2]=e[3];e[3]=s}e[2]*=t[1];e[3]*=t[1];if(t[2]<0){s=e[0];e[0]=e[1];e[1]=s}e[0]*=t[2];e[1]*=t[2]}e[0]+=t[4];e[1]+=t[4];e[2]+=t[5];e[3]+=t[5]}static transform(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}static applyTransform(t,e){return[t[0]*e[0]+t[1]*e[2]+e[4],t[0]*e[1]+t[1]*e[3]+e[5]]}static applyInverseTransform(t,e){const s=e[0]*e[3]-e[1]*e[2];return[(t[0]*e[3]-t[1]*e[2]+e[2]*e[5]-e[4]*e[3])/s,(-t[0]*e[1]+t[1]*e[0]+e[4]*e[1]-e[5]*e[0])/s]}static getAxialAlignedBoundingBox(t,e){const s=Util.applyTransform(t,e),n=Util.applyTransform(t.slice(2,4),e),i=Util.applyTransform([t[0],t[3]],e),a=Util.applyTransform([t[2],t[1]],e);return[Math.min(s[0],n[0],i[0],a[0]),Math.min(s[1],n[1],i[1],a[1]),Math.max(s[0],n[0],i[0],a[0]),Math.max(s[1],n[1],i[1],a[1])]}static inverseTransform(t){const e=t[0]*t[3]-t[1]*t[2];return[t[3]/e,-t[1]/e,-t[2]/e,t[0]/e,(t[2]*t[5]-t[4]*t[3])/e,(t[4]*t[1]-t[5]*t[0])/e]}static singularValueDecompose2dScale(t){const e=[t[0],t[2],t[1],t[3]],s=t[0]*e[0]+t[1]*e[2],n=t[0]*e[1]+t[1]*e[3],i=t[2]*e[0]+t[3]*e[2],a=t[2]*e[1]+t[3]*e[3],r=(s+a)/2,o=Math.sqrt((s+a)**2-4*(s*a-i*n))/2,l=r+o||1,c=r-o||1;return[Math.sqrt(l),Math.sqrt(c)]}static normalizeRect(t){const e=t.slice(0);if(t[0]>t[2]){e[0]=t[2];e[2]=t[0]}if(t[1]>t[3]){e[1]=t[3];e[3]=t[1]}return e}static intersect(t,e){const s=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),n=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(s>n)return null;const i=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),a=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3]));return i>a?null:[s,i,n,a]}static bezierBoundingBox(t,e,s,n,i,a,r,o){const l=[],c=[[],[]];let h,d,u,p,g,f,m,b;for(let c=0;c<2;++c){if(0===c){d=6*t-12*s+6*i;h=-3*t+9*s-9*i+3*r;u=3*s-3*t}else{d=6*e-12*n+6*a;h=-3*e+9*n-9*a+3*o;u=3*n-3*e}if(Math.abs(h)<1e-12){if(Math.abs(d)<1e-12)continue;p=-u/d;0<p&&p<1&&l.push(p)}else{m=d*d-4*u*h;b=Math.sqrt(m);if(!(m<0)){g=(-d+b)/(2*h);0<g&&g<1&&l.push(g);f=(-d-b)/(2*h);0<f&&f<1&&l.push(f)}}}let A,_=l.length;const v=_;for(;_--;){p=l[_];A=1-p;c[0][_]=A*A*A*t+3*A*A*p*s+3*A*p*p*i+p*p*p*r;c[1][_]=A*A*A*e+3*A*A*p*n+3*A*p*p*a+p*p*p*o}c[0][v]=t;c[1][v]=e;c[0][v+1]=r;c[1][v+1]=o;c[0].length=c[1].length=v+2;return[Math.min(...c[0]),Math.min(...c[1]),Math.max(...c[0]),Math.max(...c[1])]}}e.Util=Util;const r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function stringToUTF8String(t){return decodeURIComponent(escape(t))}},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{Object.defineProperty(exports,"__esModule",{value:!0});exports.build=exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0;exports.getDocument=getDocument;exports.version=void 0;var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(3),_display_utils=__w_pdfjs_require__(6),_font_loader=__w_pdfjs_require__(9),_canvas=__w_pdfjs_require__(11),_worker_options=__w_pdfjs_require__(14),_is_node=__w_pdfjs_require__(10),_message_handler=__w_pdfjs_require__(15),_metadata=__w_pdfjs_require__(16),_optional_content_config=__w_pdfjs_require__(17),_transport_stream=__w_pdfjs_require__(18),_xfa_text=__w_pdfjs_require__(19);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100;let DefaultCanvasFactory=_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;let DefaultCMapReaderFactory=_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;let DefaultStandardFontDataFactory=_display_utils.DOMStandardFontDataFactory,createPDFNetworkStream;exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory;if(_is_node.isNodeJS){const{NodeCanvasFactory:t,NodeCMapReaderFactory:e,NodeStandardFontDataFactory:s}=__w_pdfjs_require__(20);exports.DefaultCanvasFactory=DefaultCanvasFactory=t;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory=e;exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory=s}if(_is_node.isNodeJS){const{PDFNodeStream:t}=__w_pdfjs_require__(21);createPDFNetworkStream=e=>new t(e)}else{const{PDFNetworkStream:t}=__w_pdfjs_require__(24),{PDFFetchStream:e}=__w_pdfjs_require__(25);createPDFNetworkStream=s=>(0,_display_utils.isValidFetchUrl)(s.url)?new e(s):new t(s)}function getDocument(t){if("string"==typeof t||t instanceof URL)t={url:t};else if((0,_util.isArrayBuffer)(t))t={data:t};else if(t instanceof PDFDataRangeTransport){(0,_display_utils.deprecated)("`PDFDataRangeTransport`-instance, please use a parameter object with `range`-property instead.");t={range:t}}else if("object"!=typeof t)throw new Error("Invalid parameter in getDocument, need either string, URL, TypedArray, or parameter object.");if(!t.url&&!t.data&&!t.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const e=new PDFDocumentLoadingTask,s=t.url?getUrlProp(t.url):null,n=t.data?getDataProp(t.data):null,i=t.httpHeaders||null,a=!0===t.withCredentials,r=t.password??null,o=t.range instanceof PDFDataRangeTransport?t.range:null,l=Number.isInteger(t.rangeChunkSize)&&t.rangeChunkSize>0?t.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE;let c=t.worker instanceof PDFWorker?t.worker:null;const h=t.verbosity,d="string"!=typeof t.docBaseUrl||(0,_display_utils.isDataScheme)(t.docBaseUrl)?null:t.docBaseUrl,u="string"==typeof t.cMapUrl?t.cMapUrl:null,p=!1!==t.cMapPacked,g=t.CMapReaderFactory||DefaultCMapReaderFactory,f="string"==typeof t.standardFontDataUrl?t.standardFontDataUrl:null,m=t.StandardFontDataFactory||DefaultStandardFontDataFactory,b=!0!==t.stopAtErrors,A=Number.isInteger(t.maxImageSize)&&t.maxImageSize>-1?t.maxImageSize:-1,_=!1!==t.isEvalSupported,v="boolean"==typeof t.isOffscreenCanvasSupported?t.isOffscreenCanvasSupported:!_is_node.isNodeJS,y="boolean"==typeof t.disableFontFace?t.disableFontFace:_is_node.isNodeJS,S=!0===t.fontExtraProperties,x=!0===t.enableXfa,E=t.ownerDocument||globalThis.document,C=!0===t.disableRange,P=!0===t.disableStream,T=!0===t.disableAutoFetch,w=!0===t.pdfBug,k=o?o.length:t.length??NaN,R="boolean"==typeof t.useSystemFonts?t.useSystemFonts:!_is_node.isNodeJS&&!y,M="boolean"==typeof t.useWorkerFetch?t.useWorkerFetch:g===_display_utils.DOMCMapReaderFactory&&m===_display_utils.DOMStandardFontDataFactory&&(0,_display_utils.isValidFetchUrl)(u,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(f,document.baseURI);(0,_util.setVerbosityLevel)(h);const F=M?null:{cMapReaderFactory:new g({baseUrl:u,isCompressed:p}),standardFontDataFactory:new m({baseUrl:f})};if(!c){const t={verbosity:h,port:_worker_options.GlobalWorkerOptions.workerPort};c=t.port?PDFWorker.fromPort(t):new PDFWorker(t);e._worker=c}const D=e.docId,I={docId:D,apiVersion:"3.4.120",data:n,password:r,disableAutoFetch:T,rangeChunkSize:l,length:k,docBaseUrl:d,enableXfa:x,evaluatorOptions:{maxImageSize:A,disableFontFace:y,ignoreErrors:b,isEvalSupported:_,isOffscreenCanvasSupported:v,fontExtraProperties:S,useSystemFonts:R,cMapUrl:M?u:null,standardFontDataUrl:M?f:null}},O={ignoreErrors:b,isEvalSupported:_,disableFontFace:y,fontExtraProperties:S,enableXfa:x,ownerDocument:E,disableAutoFetch:T,pdfBug:w,styleElement:null};c.promise.then((function(){if(e.destroyed)throw new Error("Loading aborted");const t=_fetchDocument(c,I),r=new Promise((function(t){let e;o?e=new _transport_stream.PDFDataTransportStream({length:k,initialData:o.initialData,progressiveDone:o.progressiveDone,contentDispositionFilename:o.contentDispositionFilename,disableRange:C,disableStream:P},o):n||(e=createPDFNetworkStream({url:s,length:k,httpHeaders:i,withCredentials:a,rangeChunkSize:l,disableRange:C,disableStream:P}));t(e)}));return Promise.all([t,r]).then((function([t,s]){if(e.destroyed)throw new Error("Loading aborted");const n=new _message_handler.MessageHandler(D,t,c.port),i=new WorkerTransport(n,e,s,O,F);e._transport=i;n.send("Ready",null)}))})).catch(e._capability.reject);return e}async function _fetchDocument(t,e){if(t.destroyed)throw new Error("Worker was destroyed");const s=await t.messageHandler.sendWithPromise("GetDocRequest",e,e.data?[e.data.buffer]:null);if(t.destroyed)throw new Error("Worker was destroyed");return s}function getUrlProp(t){if(t instanceof URL)return t.href;try{return new URL(t,window.location).href}catch(e){if(_is_node.isNodeJS&&"string"==typeof t)return t}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp(t){if(_is_node.isNodeJS&&"undefined"!=typeof Buffer&&t instanceof Buffer){(0,_display_utils.deprecated)("Please provide binary data as `Uint8Array`, rather than `Buffer`.");return new Uint8Array(t)}if(t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength)return t;if("string"==typeof t)return(0,_util.stringToBytes)(t);if("object"==typeof t&&!isNaN(t?.length)||(0,_util.isArrayBuffer)(t))return new Uint8Array(t);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}class PDFDocumentLoadingTask{static#t=0;#e=null;constructor(){this._capability=(0,_util.createPromiseCapability)();this._transport=null;this._worker=null;this.docId="d"+PDFDocumentLoadingTask.#t++;this.destroyed=!1;this.onPassword=null;this.onProgress=null}get onUnsupportedFeature(){return this.#e}set onUnsupportedFeature(t){(0,_display_utils.deprecated)("The PDFDocumentLoadingTask onUnsupportedFeature property will be removed in the future.");this.#e=t}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;await(this._transport?.destroy());this._transport=null;if(this._worker){this._worker.destroy();this._worker=null}}}exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(t,e,s=!1,n=null){this.length=t;this.initialData=e;this.progressiveDone=s;this.contentDispositionFilename=n;this._rangeListeners=[];this._progressListeners=[];this._progressiveReadListeners=[];this._progressiveDoneListeners=[];this._readyCapability=(0,_util.createPromiseCapability)()}addRangeListener(t){this._rangeListeners.push(t)}addProgressListener(t){this._progressListeners.push(t)}addProgressiveReadListener(t){this._progressiveReadListeners.push(t)}addProgressiveDoneListener(t){this._progressiveDoneListeners.push(t)}onDataRange(t,e){for(const s of this._rangeListeners)s(t,e)}onDataProgress(t,e){this._readyCapability.promise.then((()=>{for(const s of this._progressListeners)s(t,e)}))}onDataProgressiveRead(t){this._readyCapability.promise.then((()=>{for(const e of this._progressiveReadListeners)e(t)}))}onDataProgressiveDone(){this._readyCapability.promise.then((()=>{for(const t of this._progressiveDoneListeners)t()}))}transportReady(){this._readyCapability.resolve()}requestDataRange(t,e){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(t,e){this._pdfInfo=t;this._transport=e}get annotationStorage(){return this._transport.annotationStorage}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJavaScript(){return this._transport.getJavaScript()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(t=!1){return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{constructor(t,e,s,n,i=!1){this._pageIndex=t;this._pageInfo=e;this._ownerDocument=n;this._transport=s;this._stats=i?new _display_utils.StatTimer:null;this._pdfBug=i;this.commonObjs=s.commonObjs;this.objs=new PDFObjects;this.cleanupAfterRender=!1;this.pendingCleanup=!1;this._intentStates=new Map;this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:t,rotation:e=this.rotate,offsetX:s=0,offsetY:n=0,dontFlip:i=!1}={}){return new _display_utils.PageViewport({viewBox:this.view,scale:t,rotation:e,offsetX:s,offsetY:n,dontFlip:i})}getAnnotations({intent:t="display"}={}){const e=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,e.renderingIntent)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:t,viewport:e,intent:s="display",annotationMode:n=_util.AnnotationMode.ENABLE,transform:i=null,canvasFactory:a=null,background:r=null,optionalContentConfigPromise:o=null,annotationCanvasMap:l=null,pageColors:c=null,printAnnotationStorage:h=null}){this._stats?.time("Overall");const d=this._transport.getRenderingIntent(s,n,h);this.pendingCleanup=!1;o||(o=this._transport.getOptionalContentConfig());let u=this._intentStates.get(d.cacheKey);if(!u){u=Object.create(null);this._intentStates.set(d.cacheKey,u)}if(u.streamReaderCancelTimeout){clearTimeout(u.streamReaderCancelTimeout);u.streamReaderCancelTimeout=null}const p=a||new DefaultCanvasFactory({ownerDocument:this._ownerDocument}),g=!!(d.renderingIntent&_util.RenderingIntentFlag.PRINT);if(!u.displayReadyCapability){u.displayReadyCapability=(0,_util.createPromiseCapability)();u.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null};this._stats?.time("Page Request");this._pumpOperatorList(d)}const complete=t=>{u.renderTasks.delete(f);(this.cleanupAfterRender||g)&&(this.pendingCleanup=!0);this._tryCleanup();if(t){f.capability.reject(t);this._abortOperatorList({intentState:u,reason:t instanceof Error?t:new Error(t)})}else f.capability.resolve();this._stats?.timeEnd("Rendering");this._stats?.timeEnd("Overall")},f=new InternalRenderTask({callback:complete,params:{canvasContext:t,viewport:e,transform:i,background:r},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:l,operatorList:u.operatorList,pageIndex:this._pageIndex,canvasFactory:p,useRequestAnimationFrame:!g,pdfBug:this._pdfBug,pageColors:c});(u.renderTasks||=new Set).add(f);const m=f.task;Promise.all([u.displayReadyCapability.promise,o]).then((([t,e])=>{if(this.pendingCleanup)complete();else{this._stats?.time("Rendering");f.initializeGraphics({transparency:t,optionalContentConfig:e});f.operatorListChanged()}})).catch(complete);return m}getOperatorList({intent:t="display",annotationMode:e=_util.AnnotationMode.ENABLE,printAnnotationStorage:s=null}={}){const n=this._transport.getRenderingIntent(t,e,s,!0);let i,a=this._intentStates.get(n.cacheKey);if(!a){a=Object.create(null);this._intentStates.set(n.cacheKey,a)}if(!a.opListReadCapability){i=Object.create(null);i.operatorListChanged=function operatorListChanged(){if(a.operatorList.lastChunk){a.opListReadCapability.resolve(a.operatorList);a.renderTasks.delete(i)}};a.opListReadCapability=(0,_util.createPromiseCapability)();(a.renderTasks||=new Set).add(i);a.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null};this._stats?.time("Page Request");this._pumpOperatorList(n)}return a.opListReadCapability.promise}streamTextContent({disableCombineTextItems:t=!1,includeMarkedContent:e=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,combineTextItems:!0!==t,includeMarkedContent:!0===e},{highWaterMark:100,size:t=>t.items.length})}getTextContent(t={}){if(this._transport._htmlForXfa)return this.getXfa().then((t=>_xfa_text.XfaText.textContent(t)));const e=this.streamTextContent(t);return new Promise((function(t,s){const n=e.getReader(),i={items:[],styles:Object.create(null)};!function pump(){n.read().then((function({value:e,done:s}){if(s)t(i);else{Object.assign(i.styles,e.styles);i.items.push(...e.items);pump()}}),s)}()}))}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const e of this._intentStates.values()){this._abortOperatorList({intentState:e,reason:new Error("Page was destroyed."),force:!0});if(!e.opListReadCapability)for(const s of e.renderTasks){t.push(s.completed);s.cancel()}}this.objs.clear();this.pendingCleanup=!1;return Promise.all(t)}cleanup(t=!1){this.pendingCleanup=!0;return this._tryCleanup(t)}_tryCleanup(t=!1){if(!this.pendingCleanup)return!1;for(const{renderTasks:t,operatorList:e}of this._intentStates.values())if(t.size>0||!e.lastChunk)return!1;this._intentStates.clear();this.objs.clear();t&&this._stats&&(this._stats=new _display_utils.StatTimer);this.pendingCleanup=!1;return!0}_startRenderPage(t,e){const s=this._intentStates.get(e);if(s){this._stats?.timeEnd("Page Request");s.displayReadyCapability?.resolve(t)}}_renderPageChunk(t,e){for(let s=0,n=t.length;s<n;s++){e.operatorList.fnArray.push(t.fnArray[s]);e.operatorList.argsArray.push(t.argsArray[s])}e.operatorList.lastChunk=t.lastChunk;e.operatorList.separateAnnots=t.separateAnnots;for(const t of e.renderTasks)t.operatorListChanged();t.lastChunk&&this._tryCleanup()}_pumpOperatorList({renderingIntent:t,cacheKey:e,annotationStorageMap:s}){const n=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:t,cacheKey:e,annotationStorage:s}).getReader(),i=this._intentStates.get(e);i.streamReader=n;const pump=()=>{n.read().then((({value:t,done:e})=>{if(e)i.streamReader=null;else if(!this._transport.destroyed){this._renderPageChunk(t,i);pump()}}),(t=>{i.streamReader=null;if(!this._transport.destroyed){if(i.operatorList){i.operatorList.lastChunk=!0;for(const t of i.renderTasks)t.operatorListChanged();this._tryCleanup()}if(i.displayReadyCapability)i.displayReadyCapability.reject(t);else{if(!i.opListReadCapability)throw t;i.opListReadCapability.reject(t)}}}))};pump()}_abortOperatorList({intentState:t,reason:e,force:s=!1}){if(t.streamReader){if(t.streamReaderCancelTimeout){clearTimeout(t.streamReaderCancelTimeout);t.streamReaderCancelTimeout=null}if(!s){if(t.renderTasks.size>0)return;if(e instanceof _display_utils.RenderingCancelledException){let s=RENDERING_CANCELLED_TIMEOUT;e.extraDelay>0&&e.extraDelay<1e3&&(s+=e.extraDelay);t.streamReaderCancelTimeout=setTimeout((()=>{t.streamReaderCancelTimeout=null;this._abortOperatorList({intentState:t,reason:e,force:!0})}),s);return}}t.streamReader.cancel(new _util.AbortException(e.message)).catch((()=>{}));t.streamReader=null;if(!this._transport.destroyed){for(const[e,s]of this._intentStates)if(s===t){this._intentStates.delete(e);break}this.cleanup()}}}get stats(){return this._stats}}exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{#s=new Set;#n=Promise.resolve();postMessage(t,e){const s={data:structuredClone(t,e)};this.#n.then((()=>{for(const t of this.#s)t.call(this,s)}))}addEventListener(t,e){this.#s.add(e)}removeEventListener(t,e){this.#s.delete(e)}terminate(){this.#s.clear()}}exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};exports.PDFWorkerUtil=PDFWorkerUtil;if(_is_node.isNodeJS&&"function"==typeof require){PDFWorkerUtil.isWorkerDisabled=!0;PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js"}else if("object"==typeof document){const t=document?.currentScript?.src;t&&(PDFWorkerUtil.fallbackWorkerSrc=t.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(t,e){let s;try{s=new URL(t);if(!s.origin||"null"===s.origin)return!1}catch(t){return!1}const n=new URL(e,s);return s.origin===n.origin};PDFWorkerUtil.createCDNWrapper=function(t){const e=`importScripts("${t}");`;return URL.createObjectURL(new Blob([e]))};class PDFWorker{static#i=new WeakMap;constructor({name:t=null,port:e=null,verbosity:s=(0,_util.getVerbosityLevel)()}={}){if(e&&PDFWorker.#i.has(e))throw new Error("Cannot use more than one PDFWorker per port.");this.name=t;this.destroyed=!1;this.verbosity=s;this._readyCapability=(0,_util.createPromiseCapability)();this._port=null;this._webWorker=null;this._messageHandler=null;if(e){PDFWorker.#i.set(e,this);this._initializeFromPort(e)}else this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(t){this._port=t;this._messageHandler=new _message_handler.MessageHandler("main","worker",t);this._messageHandler.on("ready",(function(){}));this._readyCapability.resolve();this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:t}=PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,t)||(t=PDFWorkerUtil.createCDNWrapper(new URL(t,window.location).href));const e=new Worker(t),s=new _message_handler.MessageHandler("main","worker",e),terminateEarly=()=>{e.removeEventListener("error",onWorkerError);s.destroy();e.terminate();this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},onWorkerError=()=>{this._webWorker||terminateEarly()};e.addEventListener("error",onWorkerError);s.on("test",(t=>{e.removeEventListener("error",onWorkerError);if(this.destroyed)terminateEarly();else if(t){this._messageHandler=s;this._port=e;this._webWorker=e;this._readyCapability.resolve();s.send("configure",{verbosity:this.verbosity})}else{this._setupFakeWorker();s.destroy();e.terminate()}}));s.on("ready",(t=>{e.removeEventListener("error",onWorkerError);if(this.destroyed)terminateEarly();else try{sendTest()}catch(t){this._setupFakeWorker()}}));const sendTest=()=>{const t=new Uint8Array;s.send("test",t,[t.buffer])};sendTest();return}catch(t){(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){if(!PDFWorkerUtil.isWorkerDisabled){(0,_util.warn)("Setting up fake worker.");PDFWorkerUtil.isWorkerDisabled=!0}PDFWorker._setupFakeWorkerGlobal.then((t=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const e=new LoopbackPort;this._port=e;const s="fake"+PDFWorkerUtil.fakeWorkerId++,n=new _message_handler.MessageHandler(s+"_worker",s,e);t.setup(n,e);const i=new _message_handler.MessageHandler(s,s+"_worker",e);this._messageHandler=i;this._readyCapability.resolve();i.send("configure",{verbosity:this.verbosity})})).catch((t=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${t.message}".`))}))}destroy(){this.destroyed=!0;if(this._webWorker){this._webWorker.terminate();this._webWorker=null}PDFWorker.#i.delete(this._port);this._port=null;if(this._messageHandler){this._messageHandler.destroy();this._messageHandler=null}}static fromPort(t){if(!t?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return this.#i.has(t.port)?this.#i.get(t.port):new PDFWorker(t)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(null!==PDFWorkerUtil.fallbackWorkerSrc){_is_node.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.');return PDFWorkerUtil.fallbackWorkerSrc}throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch(t){return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_is_node.isNodeJS&&"function"==typeof require){const worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}await(0,_display_utils.loadScript)(this.workerSrc);return window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}}exports.PDFWorker=PDFWorker;class WorkerTransport{#a=new Map;#r=new Map;#o=new Map;constructor(t,e,s,n,i){this.messageHandler=t;this.loadingTask=e;this.commonObjs=new PDFObjects;this.fontLoader=new _font_loader.FontLoader({onUnsupportedFeature:this._onUnsupportedFeature.bind(this),ownerDocument:n.ownerDocument,styleElement:n.styleElement});this._params=n;this.cMapReaderFactory=i?.cMapReaderFactory;this.standardFontDataFactory=i?.standardFontDataFactory;this.destroyed=!1;this.destroyCapability=null;this._passwordCapability=null;this._networkStream=s;this._fullReader=null;this._lastProgress=null;this.downloadInfoCapability=(0,_util.createPromiseCapability)();this.setupMessageHandler()}#l(t,e=null){const s=this.#a.get(t);if(s)return s;const n=this.messageHandler.sendWithPromise(t,e);this.#a.set(t,n);return n}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}getRenderingIntent(t,e=_util.AnnotationMode.ENABLE,s=null,n=!1){let i=_util.RenderingIntentFlag.DISPLAY,a=null;switch(t){case"any":i=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":i=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${t}`)}switch(e){case _util.AnnotationMode.DISABLE:i+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:i+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:i+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE;a=(i&_util.RenderingIntentFlag.PRINT&&s instanceof _annotation_storage.PrintAnnotationStorage?s:this.annotationStorage).serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${e}`)}n&&(i+=_util.RenderingIntentFlag.OPLIST);return{renderingIntent:i,cacheKey:`${i}_${_annotation_storage.AnnotationStorage.getHash(a)}`,annotationStorageMap:a}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0;this.destroyCapability=(0,_util.createPromiseCapability)();this._passwordCapability&&this._passwordCapability.reject(new Error("Worker was destroyed during onPassword callback"));const t=[];for(const e of this.#r.values())t.push(e._destroy());this.#r.clear();this.#o.clear();this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const e=this.messageHandler.sendWithPromise("Terminate",null);t.push(e);Promise.all(t).then((()=>{this.commonObjs.clear();this.fontLoader.clear();this.#a.clear();this._networkStream&&this._networkStream.cancelAllRequests(new _util.AbortException("Worker was terminated."));if(this.messageHandler){this.messageHandler.destroy();this.messageHandler=null}this.destroyCapability.resolve()}),this.destroyCapability.reject);return this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:t,loadingTask:e}=this;t.on("GetReader",((t,e)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available.");this._fullReader=this._networkStream.getFullReader();this._fullReader.onProgress=t=>{this._lastProgress={loaded:t.loaded,total:t.total}};e.onPull=()=>{this._fullReader.read().then((function({value:t,done:s}){if(s)e.close();else{(0,_util.assert)(t instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer.");e.enqueue(new Uint8Array(t),1,[t])}})).catch((t=>{e.error(t)}))};e.onCancel=t=>{this._fullReader.cancel(t);e.ready.catch((t=>{if(!this.destroyed)throw t}))}}));t.on("ReaderHeadersReady",(t=>{const s=(0,_util.createPromiseCapability)(),n=this._fullReader;n.headersReady.then((()=>{if(!n.isStreamingSupported||!n.isRangeSupported){this._lastProgress&&e.onProgress?.(this._lastProgress);n.onProgress=t=>{e.onProgress?.({loaded:t.loaded,total:t.total})}}s.resolve({isStreamingSupported:n.isStreamingSupported,isRangeSupported:n.isRangeSupported,contentLength:n.contentLength})}),s.reject);return s.promise}));t.on("GetRangeReader",((t,e)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const s=this._networkStream.getRangeReader(t.begin,t.end);if(s){e.onPull=()=>{s.read().then((function({value:t,done:s}){if(s)e.close();else{(0,_util.assert)(t instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer.");e.enqueue(new Uint8Array(t),1,[t])}})).catch((t=>{e.error(t)}))};e.onCancel=t=>{s.cancel(t);e.ready.catch((t=>{if(!this.destroyed)throw t}))}}else e.close()}));t.on("GetDoc",(({pdfInfo:t})=>{this._numPages=t.numPages;this._htmlForXfa=t.htmlForXfa;delete t.htmlForXfa;e._capability.resolve(new PDFDocumentProxy(t,this))}));t.on("DocException",(function(t){let s;switch(t.name){case"PasswordException":s=new _util.PasswordException(t.message,t.code);break;case"InvalidPDFException":s=new _util.InvalidPDFException(t.message);break;case"MissingPDFException":s=new _util.MissingPDFException(t.message);break;case"UnexpectedResponseException":s=new _util.UnexpectedResponseException(t.message,t.status);break;case"UnknownErrorException":s=new _util.UnknownErrorException(t.message,t.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}e._capability.reject(s)}));t.on("PasswordRequest",(t=>{this._passwordCapability=(0,_util.createPromiseCapability)();if(e.onPassword){const updatePassword=t=>{t instanceof Error?this._passwordCapability.reject(t):this._passwordCapability.resolve({password:t})};try{e.onPassword(updatePassword,t.code)}catch(t){this._passwordCapability.reject(t)}}else this._passwordCapability.reject(new _util.PasswordException(t.message,t.code));return this._passwordCapability.promise}));t.on("DataLoaded",(t=>{e.onProgress?.({loaded:t.length,total:t.length});this.downloadInfoCapability.resolve(t)}));t.on("StartRenderPage",(t=>{if(this.destroyed)return;this.#r.get(t.pageIndex)._startRenderPage(t.transparency,t.cacheKey)}));t.on("commonobj",(([e,s,n])=>{if(!this.destroyed&&!this.commonObjs.has(e))switch(s){case"Font":const i=this._params;if("error"in n){const t=n.error;(0,_util.warn)(`Error during font loading: ${t}`);this.commonObjs.resolve(e,t);break}let a=null;i.pdfBug&&globalThis.FontInspector?.enabled&&(a={registerFont(t,e){globalThis.FontInspector.fontAdded(t,e)}});const r=new _font_loader.FontFaceObject(n,{isEvalSupported:i.isEvalSupported,disableFontFace:i.disableFontFace,ignoreErrors:i.ignoreErrors,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),fontRegistry:a});this.fontLoader.bind(r).catch((s=>t.sendWithPromise("FontFallback",{id:e}))).finally((()=>{!i.fontExtraProperties&&r.data&&(r.data=null);this.commonObjs.resolve(e,r)}));break;case"FontPath":case"Image":this.commonObjs.resolve(e,n);break;default:throw new Error(`Got unknown common object type ${s}`)}}));t.on("obj",(([t,e,s,n])=>{if(this.destroyed)return;const i=this.#r.get(e);if(!i.objs.has(t))switch(s){case"Image":i.objs.resolve(t,n);const e=8e6;if(n){let t;if(n.bitmap){const{width:e,height:s}=n;t=e*s*4}else t=n.data?.length||0;t>e&&(i.cleanupAfterRender=!0)}break;case"Pattern":i.objs.resolve(t,n);break;default:throw new Error(`Got unknown object type ${s}`)}}));t.on("DocProgress",(t=>{this.destroyed||e.onProgress?.({loaded:t.loaded,total:t.total})}));t.on("UnsupportedFeature",this._onUnsupportedFeature.bind(this));t.on("FetchBuiltInCMap",(t=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(t):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))));t.on("FetchStandardFontData",(t=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(t):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter."))))}_onUnsupportedFeature({featureId:t}){this.destroyed||this.loadingTask.onUnsupportedFeature?.(t)}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:this.annotationStorage.serializable,filename:this._fullReader?.filename??null}).finally((()=>{this.annotationStorage.resetModified()}))}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));const e=t-1,s=this.#o.get(e);if(s)return s;const n=this.messageHandler.sendWithPromise("GetPage",{pageIndex:e}).then((t=>{if(this.destroyed)throw new Error("Transport destroyed");const s=new PDFPageProxy(e,t,this,this._params.ownerDocument,this._params.pdfBug);this.#r.set(e,s);return s}));this.#o.set(e,n);return n}getPageIndex(t){return"object"!=typeof t||null===t||!Number.isInteger(t.num)||t.num<0||!Number.isInteger(t.gen)||t.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen})}getAnnotations(t,e){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:e})}getFieldObjects(){return this.#l("GetFieldObjects")}hasJSActions(){return this.#l("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return"string"!=typeof t?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getJavaScript(){return this.messageHandler.sendWithPromise("GetJavaScript",null)}getDocJSActions(){return this.messageHandler.sendWithPromise("GetDocJSActions",null)}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then((t=>new _optional_content_config.OptionalContentConfig(t)))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",e=this.#a.get(t);if(e)return e;const s=this.messageHandler.sendWithPromise(t,null).then((t=>({info:t[0],metadata:t[1]?new _metadata.Metadata(t[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null})));this.#a.set(t,s);return s}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(t=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const t of this.#r.values()){if(!t.cleanup())throw new Error(`startCleanup: Page ${t.pageNumber} is currently rendering.`)}this.commonObjs.clear();t||this.fontLoader.clear();this.#a.clear()}}get loadingParams(){const{disableAutoFetch:t,enableXfa:e}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:t,enableXfa:e})}}class PDFObjects{#c=Object.create(null);#h(t){const e=this.#c[t];return e||(this.#c[t]={capability:(0,_util.createPromiseCapability)(),data:null})}get(t,e=null){if(e){const s=this.#h(t);s.capability.promise.then((()=>e(s.data)));return null}const s=this.#c[t];if(!s?.capability.settled)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return s.data}has(t){return this.#c[t]?.capability.settled||!1}resolve(t,e=null){const s=this.#h(t);s.data=e;s.capability.resolve()}clear(){for(const t in this.#c){const{data:e}=this.#c[t];e?.bitmap?.close()}this.#c=Object.create(null)}}class RenderTask{#d=null;constructor(t){this.#d=t;this.onContinue=null}get promise(){return this.#d.capability.promise}cancel(t=0){this.#d.cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=this.#d.operatorList;if(!t)return!1;const{annotationCanvasMap:e}=this.#d;return t.form||t.canvas&&e?.size>0}}exports.RenderTask=RenderTask;class InternalRenderTask{static#u=new WeakSet;constructor({callback:t,params:e,objs:s,commonObjs:n,annotationCanvasMap:i,operatorList:a,pageIndex:r,canvasFactory:o,useRequestAnimationFrame:l=!1,pdfBug:c=!1,pageColors:h=null}){this.callback=t;this.params=e;this.objs=s;this.commonObjs=n;this.annotationCanvasMap=i;this.operatorListIdx=null;this.operatorList=a;this._pageIndex=r;this.canvasFactory=o;this._pdfBug=c;this.pageColors=h;this.running=!1;this.graphicsReadyCallback=null;this.graphicsReady=!1;this._useRequestAnimationFrame=!0===l&&"undefined"!=typeof window;this.cancelled=!1;this.capability=(0,_util.createPromiseCapability)();this.task=new RenderTask(this);this._cancelBound=this.cancel.bind(this);this._continueBound=this._continue.bind(this);this._scheduleNextBound=this._scheduleNext.bind(this);this._nextBound=this._next.bind(this);this._canvas=e.canvasContext.canvas}get completed(){return this.capability.promise.catch((function(){}))}initializeGraphics({transparency:t=!1,optionalContentConfig:e}){if(this.cancelled)return;if(this._canvas){if(InternalRenderTask.#u.has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");InternalRenderTask.#u.add(this._canvas)}if(this._pdfBug&&globalThis.StepperManager?.enabled){this.stepper=globalThis.StepperManager.create(this._pageIndex);this.stepper.init(this.operatorList);this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint()}const{canvasContext:s,viewport:n,transform:i,background:a}=this.params;this.gfx=new _canvas.CanvasGraphics(s,this.commonObjs,this.objs,this.canvasFactory,{optionalContentConfig:e},this.annotationCanvasMap,this.pageColors);this.gfx.beginDrawing({transform:i,viewport:n,transparency:t,background:a});this.operatorListIdx=0;this.graphicsReady=!0;this.graphicsReadyCallback?.()}cancel(t=null,e=0){this.running=!1;this.cancelled=!0;this.gfx?.endDrawing();this._canvas&&InternalRenderTask.#u.delete(this._canvas);this.callback(t||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,"canvas",e))}operatorListChanged(){if(this.graphicsReady){this.stepper?.updateOperatorList(this.operatorList);this.running||this._continue()}else this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound)}_continue(){this.running=!0;this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame((()=>{this._nextBound().catch(this._cancelBound)})):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){if(!this.cancelled){this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper);if(this.operatorListIdx===this.operatorList.argsArray.length){this.running=!1;if(this.operatorList.lastChunk){this.gfx.endDrawing();this._canvas&&InternalRenderTask.#u.delete(this._canvas);this.callback()}}}}}const version="3.4.120";exports.version=version;const build="af6414988";exports.build=build},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.PrintAnnotationStorage=e.AnnotationStorage=void 0;var n=s(1),i=s(4),a=s(8);class AnnotationStorage{#p=!1;#g=new Map;constructor(){this.onSetModified=null;this.onResetModified=null;this.onAnnotationEditor=null}getValue(t,e){const s=this.#g.get(t);return void 0===s?e:Object.assign(e,s)}getRawValue(t){return this.#g.get(t)}remove(t){this.#g.delete(t);0===this.#g.size&&this.resetModified();if("function"==typeof this.onAnnotationEditor){for(const t of this.#g.values())if(t instanceof i.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(t,e){const s=this.#g.get(t);let n=!1;if(void 0!==s){for(const[t,i]of Object.entries(e))if(s[t]!==i){n=!0;s[t]=i}}else{n=!0;this.#g.set(t,e)}n&&this.#f();e instanceof i.AnnotationEditor&&"function"==typeof this.onAnnotationEditor&&this.onAnnotationEditor(e.constructor._type)}has(t){return this.#g.has(t)}getAll(){return this.#g.size>0?(0,n.objectFromMap)(this.#g):null}setAll(t){for(const[e,s]of Object.entries(t))this.setValue(e,s)}get size(){return this.#g.size}#f(){if(!this.#p){this.#p=!0;"function"==typeof this.onSetModified&&this.onSetModified()}}resetModified(){if(this.#p){this.#p=!1;"function"==typeof this.onResetModified&&this.onResetModified()}}get print(){return new PrintAnnotationStorage(this)}get serializable(){if(0===this.#g.size)return null;const t=new Map;for(const[e,s]of this.#g){const n=s instanceof i.AnnotationEditor?s.serialize():s;n&&t.set(e,n)}return t}static getHash(t){if(!t)return"";const e=new a.MurmurHash3_64;for(const[s,n]of t)e.update(`${s}:${JSON.stringify(n)}`);return e.hexdigest()}}e.AnnotationStorage=AnnotationStorage;class PrintAnnotationStorage extends AnnotationStorage{#m=null;constructor(t){super();this.#m=structuredClone(t.serializable)}get print(){(0,n.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#m}}e.PrintAnnotationStorage=PrintAnnotationStorage},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.AnnotationEditor=void 0;var n=s(5),i=s(1);class AnnotationEditor{#b=this.focusin.bind(this);#A=this.focusout.bind(this);#_=!1;#v=!1;#y=!1;_uiManager=null;#S=AnnotationEditor._zIndex++;static _colorManager=new n.ColorManager;static _zIndex=1;constructor(t){this.constructor===AnnotationEditor&&(0,i.unreachable)("Cannot initialize AnnotationEditor.");this.parent=t.parent;this.id=t.id;this.width=this.height=null;this.pageIndex=t.parent.pageIndex;this.name=t.name;this.div=null;this._uiManager=t.uiManager;const{rotation:e,rawDims:{pageWidth:s,pageHeight:n,pageX:a,pageY:r}}=this.parent.viewport;this.rotation=e;this.pageDimensions=[s,n];this.pageTranslation=[a,r];const[o,l]=this.parentDimensions;this.x=t.x/o;this.y=t.y/l;this.isAttachedToDOM=!1}static get _defaultLineColor(){return(0,i.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#S}setParent(t){if(null!==t){this.pageIndex=t.pageIndex;this.pageDimensions=t.pageDimensions}this.parent=t}focusin(t){this.#_?this.#_=!1:this.parent.setSelected(this)}focusout(t){if(!this.isAttachedToDOM)return;if(!t.relatedTarget?.closest(`#${this.id}`)){t.preventDefault();this.parent?.isMultipleSelection||this.commitOrRemove()}}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}dragstart(t){const e=this.parent.div.getBoundingClientRect();this.startX=t.clientX-e.x;this.startY=t.clientY-e.y;t.dataTransfer.setData("text/plain",this.id);t.dataTransfer.effectAllowed="move"}setAt(t,e,s,n){const[i,a]=this.parentDimensions;[s,n]=this.screenToPageTranslation(s,n);this.x=(t+s)/i;this.y=(e+n)/a;this.div.style.left=100*this.x+"%";this.div.style.top=100*this.y+"%"}translate(t,e){const[s,n]=this.parentDimensions;[t,e]=this.screenToPageTranslation(t,e);this.x+=t/s;this.y+=e/n;this.div.style.left=100*this.x+"%";this.div.style.top=100*this.y+"%"}screenToPageTranslation(t,e){switch(this.parentRotation){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return this._uiManager.viewParameters.rotation}get parentDimensions(){const{realScale:t}=this._uiManager.viewParameters,[e,s]=this.pageDimensions;return[e*t,s*t]}setDims(t,e){const[s,n]=this.parentDimensions;this.div.style.width=100*t/s+"%";this.div.style.height=100*e/n+"%"}fixDims(){const{style:t}=this.div,{height:e,width:s}=t,n=s.endsWith("%"),i=e.endsWith("%");if(n&&i)return;const[a,r]=this.parentDimensions;n||(t.width=100*parseFloat(s)/a+"%");i||(t.height=100*parseFloat(e)/r+"%")}getInitialTranslation(){return[0,0]}render(){this.div=document.createElement("div");this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360);this.div.className=this.name;this.div.setAttribute("id",this.id);this.div.setAttribute("tabIndex",0);this.setInForeground();this.div.addEventListener("focusin",this.#b);this.div.addEventListener("focusout",this.#A);const[t,e]=this.getInitialTranslation();this.translate(t,e);(0,n.bindEvents)(this,this.div,["dragstart","pointerdown"]);return this.div}pointerdown(t){const{isMac:e}=i.FeatureTest.platform;if(0!==t.button||t.ctrlKey&&e)t.preventDefault();else{t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this);this.#_=!0}}getRect(t,e){const s=this.parentScale,[n,i]=this.pageDimensions,[a,r]=this.pageTranslation,o=t/s,l=e/s,c=this.x*n,h=this.y*i,d=this.width*n,u=this.height*i;switch(this.rotation){case 0:return[c+o+a,i-h-l-u+r,c+o+d+a,i-h-l+r];case 90:return[c+l+a,i-h+o+r,c+l+u+a,i-h+o+d+r];case 180:return[c-o-d+a,i-h+l+r,c-o+a,i-h+l+u+r];case 270:return[c-l-u+a,i-h-o-d+r,c-l+a,i-h-o+r];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,e){const[s,n,i,a]=t,r=i-s,o=a-n;switch(this.rotation){case 0:return[s,e-a,r,o];case 90:return[s,e-n,o,r];case 180:return[i,e-n,r,o];case 270:return[i,e-a,o,r];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){this.#y=!0}disableEditMode(){this.#y=!1}isInEditMode(){return this.#y}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){this.div?.addEventListener("focusin",this.#b)}serialize(){(0,i.unreachable)("An editor must be serializable")}static deserialize(t,e,s){const n=new this.prototype.constructor({parent:e,id:e.getNextId(),uiManager:s});n.rotation=t.rotation;const[i,a]=n.pageDimensions,[r,o,l,c]=n.getRectInCurrentCoords(t.rect,a);n.x=r/i;n.y=o/a;n.width=l/i;n.height=c/a;return n}remove(){this.div.removeEventListener("focusin",this.#b);this.div.removeEventListener("focusout",this.#A);this.isEmpty()||this.commit();this.parent.remove(this)}select(){this.div?.classList.add("selectedEditor")}unselect(){this.div?.classList.remove("selectedEditor")}updateParams(t,e){}disableEditing(){}enableEditing(){}get propertiesToUpdate(){return{}}get contentDiv(){return this.div}get isEditing(){return this.#v}set isEditing(t){this.#v=t;if(t){this.parent.setSelected(this);this.parent.setActiveEditor(this)}else this.parent.setActiveEditor(null)}}e.AnnotationEditor=AnnotationEditor},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.KeyboardManager=e.CommandManager=e.ColorManager=e.AnnotationEditorUIManager=void 0;e.bindEvents=function bindEvents(t,e,s){for(const n of s)e.addEventListener(n,t[n].bind(t))};e.opacityToHex=function opacityToHex(t){return Math.round(Math.min(255,Math.max(1,255*t))).toString(16).padStart(2,"0")};var n=s(1),i=s(6);class IdManager{#x=0;getId(){return`${n.AnnotationEditorPrefix}${this.#x++}`}}class CommandManager{#E=[];#C=!1;#P;#T=-1;constructor(t=128){this.#P=t}add({cmd:t,undo:e,mustExec:s,type:n=NaN,overwriteIfSameType:i=!1,keepUndo:a=!1}){s&&t();if(this.#C)return;const r={cmd:t,undo:e,type:n};if(-1===this.#T){this.#E.length>0&&(this.#E.length=0);this.#T=0;this.#E.push(r);return}if(i&&this.#E[this.#T].type===n){a&&(r.undo=this.#E[this.#T].undo);this.#E[this.#T]=r;return}const o=this.#T+1;if(o===this.#P)this.#E.splice(0,1);else{this.#T=o;o<this.#E.length&&this.#E.splice(o)}this.#E.push(r)}undo(){if(-1!==this.#T){this.#C=!0;this.#E[this.#T].undo();this.#C=!1;this.#T-=1}}redo(){if(this.#T<this.#E.length-1){this.#T+=1;this.#C=!0;this.#E[this.#T].cmd();this.#C=!1}}hasSomethingToUndo(){return-1!==this.#T}hasSomethingToRedo(){return this.#T<this.#E.length-1}destroy(){this.#E=null}}e.CommandManager=CommandManager;class KeyboardManager{constructor(t){this.buffer=[];this.callbacks=new Map;this.allKeys=new Set;const{isMac:e}=n.FeatureTest.platform;for(const[s,n]of t)for(const t of s){const s=t.startsWith("mac+");if(e&&s){this.callbacks.set(t.slice(4),n);this.allKeys.add(t.split("+").at(-1))}else if(!e&&!s){this.callbacks.set(t,n);this.allKeys.add(t.split("+").at(-1))}}}#w(t){t.altKey&&this.buffer.push("alt");t.ctrlKey&&this.buffer.push("ctrl");t.metaKey&&this.buffer.push("meta");t.shiftKey&&this.buffer.push("shift");this.buffer.push(t.key);const e=this.buffer.join("+");this.buffer.length=0;return e}exec(t,e){if(!this.allKeys.has(e.key))return;const s=this.callbacks.get(this.#w(e));if(s){s.bind(t)();e.stopPropagation();e.preventDefault()}}}e.KeyboardManager=KeyboardManager;class ColorManager{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);(0,i.getColorValues)(t);return(0,n.shadow)(this,"_colors",t)}convert(t){const e=(0,i.getRGB)(t);if(!window.matchMedia("(forced-colors: active)").matches)return e;for(const[t,s]of this._colors)if(s.every(((t,s)=>t===e[s])))return ColorManager._colorsMapping.get(t);return e}getHexCode(t){const e=this._colors.get(t);return e?n.Util.makeHexColor(...e):t}}e.ColorManager=ColorManager;class AnnotationEditorUIManager{#k=null;#R=new Map;#M=new Map;#F=null;#D=new CommandManager;#I=0;#O=null;#L=new Set;#N=null;#j=new IdManager;#U=!1;#B=n.AnnotationEditorType.NONE;#q=new Set;#W=this.copy.bind(this);#H=this.cut.bind(this);#G=this.paste.bind(this);#z=this.keydown.bind(this);#V=this.onEditingAction.bind(this);#X=this.onPageChanging.bind(this);#$=this.onScaleChanging.bind(this);#Y=this.onRotationChanging.bind(this);#K={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1};#J=null;static _keyboardManager=new KeyboardManager([[["ctrl+a","mac+meta+a"],AnnotationEditorUIManager.prototype.selectAll],[["ctrl+z","mac+meta+z"],AnnotationEditorUIManager.prototype.undo],[["ctrl+y","ctrl+shift+Z","mac+meta+shift+Z"],AnnotationEditorUIManager.prototype.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete"],AnnotationEditorUIManager.prototype.delete],[["Escape","mac+Escape"],AnnotationEditorUIManager.prototype.unselectAll]]);constructor(t,e,s){this.#J=t;this.#N=e;this.#N._on("editingaction",this.#V);this.#N._on("pagechanging",this.#X);this.#N._on("scalechanging",this.#$);this.#N._on("rotationchanging",this.#Y);this.#F=s;this.viewParameters={realScale:i.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}destroy(){this.#Q();this.#N._off("editingaction",this.#V);this.#N._off("pagechanging",this.#X);this.#N._off("scalechanging",this.#$);this.#N._off("rotationchanging",this.#Y);for(const t of this.#M.values())t.destroy();this.#M.clear();this.#R.clear();this.#L.clear();this.#k=null;this.#q.clear();this.#D.destroy()}onPageChanging({pageNumber:t}){this.#I=t-1}focusMainContainer(){this.#J.focus()}addShouldRescale(t){this.#L.add(t)}removeShouldRescale(t){this.#L.delete(t)}onScaleChanging({scale:t}){this.commitOrRemove();this.viewParameters.realScale=t*i.PixelsPerInch.PDF_TO_CSS_UNITS;for(const t of this.#L)t.onScaleChanging()}onRotationChanging({pagesRotation:t}){this.commitOrRemove();this.viewParameters.rotation=t}addToAnnotationStorage(t){t.isEmpty()||!this.#F||this.#F.has(t.id)||this.#F.setValue(t.id,t)}#Z(){this.#J.addEventListener("keydown",this.#z)}#Q(){this.#J.removeEventListener("keydown",this.#z)}#tt(){document.addEventListener("copy",this.#W);document.addEventListener("cut",this.#H);document.addEventListener("paste",this.#G)}#et(){document.removeEventListener("copy",this.#W);document.removeEventListener("cut",this.#H);document.removeEventListener("paste",this.#G)}copy(t){t.preventDefault();this.#k&&this.#k.commitOrRemove();if(!this.hasSelection)return;const e=[];for(const t of this.#q)t.isEmpty()||e.push(t.serialize());0!==e.length&&t.clipboardData.setData("application/pdfjs",JSON.stringify(e))}cut(t){this.copy(t);this.delete()}paste(t){t.preventDefault();let e=t.clipboardData.getData("application/pdfjs");if(!e)return;try{e=JSON.parse(e)}catch(t){(0,n.warn)(`paste: "${t.message}".`);return}if(!Array.isArray(e))return;this.unselectAll();const s=this.#M.get(this.#I);try{const t=[];for(const n of e){const e=s.deserialize(n);if(!e)return;t.push(e)}const cmd=()=>{for(const e of t)this.#st(e);this.#nt(t)},undo=()=>{for(const e of t)e.remove()};this.addCommands({cmd:cmd,undo:undo,mustExec:!0})}catch(t){(0,n.warn)(`paste: "${t.message}".`)}}keydown(t){this.getActive()?.shouldGetKeyboardEvents()||AnnotationEditorUIManager._keyboardManager.exec(this,t)}onEditingAction(t){["undo","redo","delete","selectAll"].includes(t.name)&&this[t.name]()}#it(t){Object.entries(t).some((([t,e])=>this.#K[t]!==e))&&this.#N.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#K,t)})}#at(t){this.#N.dispatch("annotationeditorparamschanged",{source:this,details:t})}setEditingState(t){if(t){this.#Z();this.#tt();this.#it({isEditing:this.#B!==n.AnnotationEditorType.NONE,isEmpty:this.#rt(),hasSomethingToUndo:this.#D.hasSomethingToUndo(),hasSomethingToRedo:this.#D.hasSomethingToRedo(),hasSelectedEditor:!1})}else{this.#Q();this.#et();this.#it({isEditing:!1})}}registerEditorTypes(t){if(!this.#O){this.#O=t;for(const t of this.#O)this.#at(t.defaultPropertiesToUpdate)}}getId(){return this.#j.getId()}get currentLayer(){return this.#M.get(this.#I)}get currentPageIndex(){return this.#I}addLayer(t){this.#M.set(t.pageIndex,t);this.#U?t.enable():t.disable()}removeLayer(t){this.#M.delete(t.pageIndex)}updateMode(t){this.#B=t;if(t===n.AnnotationEditorType.NONE){this.setEditingState(!1);this.#ot()}else{this.setEditingState(!0);this.#lt();for(const e of this.#M.values())e.updateMode(t)}}updateToolbar(t){t!==this.#B&&this.#N.dispatch("switchannotationeditormode",{source:this,mode:t})}updateParams(t,e){if(this.#O){for(const s of this.#q)s.updateParams(t,e);for(const s of this.#O)s.updateDefaultParams(t,e)}}#lt(){if(!this.#U){this.#U=!0;for(const t of this.#M.values())t.enable()}}#ot(){this.unselectAll();if(this.#U){this.#U=!1;for(const t of this.#M.values())t.disable()}}getEditors(t){const e=[];for(const s of this.#R.values())s.pageIndex===t&&e.push(s);return e}getEditor(t){return this.#R.get(t)}addEditor(t){this.#R.set(t.id,t)}removeEditor(t){this.#R.delete(t.id);this.unselect(t);this.#F?.remove(t.id)}#st(t){const e=this.#M.get(t.pageIndex);e?e.addOrRebuild(t):this.addEditor(t)}setActiveEditor(t){if(this.#k!==t){this.#k=t;t&&this.#at(t.propertiesToUpdate)}}toggleSelected(t){if(this.#q.has(t)){this.#q.delete(t);t.unselect();this.#it({hasSelectedEditor:this.hasSelection})}else{this.#q.add(t);t.select();this.#at(t.propertiesToUpdate);this.#it({hasSelectedEditor:!0})}}setSelected(t){for(const e of this.#q)e!==t&&e.unselect();this.#q.clear();this.#q.add(t);t.select();this.#at(t.propertiesToUpdate);this.#it({hasSelectedEditor:!0})}isSelected(t){return this.#q.has(t)}unselect(t){t.unselect();this.#q.delete(t);this.#it({hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==this.#q.size}undo(){this.#D.undo();this.#it({hasSomethingToUndo:this.#D.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#rt()})}redo(){this.#D.redo();this.#it({hasSomethingToUndo:!0,hasSomethingToRedo:this.#D.hasSomethingToRedo(),isEmpty:this.#rt()})}addCommands(t){this.#D.add(t);this.#it({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#rt()})}#rt(){if(0===this.#R.size)return!0;if(1===this.#R.size)for(const t of this.#R.values())return t.isEmpty();return!1}delete(){this.commitOrRemove();if(!this.hasSelection)return;const t=[...this.#q];this.addCommands({cmd:()=>{for(const e of t)e.remove()},undo:()=>{for(const e of t)this.#st(e)},mustExec:!0})}commitOrRemove(){this.#k?.commitOrRemove()}#nt(t){this.#q.clear();for(const e of t)if(!e.isEmpty()){this.#q.add(e);e.select()}this.#it({hasSelectedEditor:!0})}selectAll(){for(const t of this.#q)t.commit();this.#nt(this.#R.values())}unselectAll(){if(this.#k)this.#k.commitOrRemove();else if(0!==this.#q.size){for(const t of this.#q)t.unselect();this.#q.clear();this.#it({hasSelectedEditor:!1})}}isActive(t){return this.#k===t}getActive(){return this.#k}getMode(){return this.#B}}e.AnnotationEditorUIManager=AnnotationEditorUIManager},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.StatTimer=e.RenderingCancelledException=e.PixelsPerInch=e.PageViewport=e.PDFDateString=e.DOMStandardFontDataFactory=e.DOMSVGFactory=e.DOMCanvasFactory=e.DOMCMapReaderFactory=e.AnnotationPrefix=void 0;e.deprecated=function deprecated(t){console.log("Deprecated API usage: "+t)};e.getColorValues=function getColorValues(t){const e=document.createElement("span");e.style.visibility="hidden";document.body.append(e);for(const s of t.keys()){e.style.color=s;const n=window.getComputedStyle(e).color;t.set(s,getRGB(n))}e.remove()};e.getCurrentTransform=function getCurrentTransform(t){const{a:e,b:s,c:n,d:i,e:a,f:r}=t.getTransform();return[e,s,n,i,a,r]};e.getCurrentTransformInverse=function getCurrentTransformInverse(t){const{a:e,b:s,c:n,d:i,e:a,f:r}=t.getTransform().invertSelf();return[e,s,n,i,a,r]};e.getFilenameFromUrl=function getFilenameFromUrl(t,e=!1){e||([t]=t.split(/[#?]/,1));return t.substring(t.lastIndexOf("/")+1)};e.getPdfFilenameFromUrl=function getPdfFilenameFromUrl(t,e="document.pdf"){if("string"!=typeof t)return e;if(isDataScheme(t)){(0,i.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.');return e}const s=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,n=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(t);let a=s.exec(n[1])||s.exec(n[2])||s.exec(n[3]);if(a){a=a[0];if(a.includes("%"))try{a=s.exec(decodeURIComponent(a))[0]}catch(t){}}return a||e};e.getRGB=getRGB;e.getXfaPageViewport=function getXfaPageViewport(t,{scale:e=1,rotation:s=0}){const{width:n,height:i}=t.attributes.style,a=[0,0,parseInt(n),parseInt(i)];return new PageViewport({viewBox:a,scale:e,rotation:s})};e.isDataScheme=isDataScheme;e.isPdfFile=function isPdfFile(t){return"string"==typeof t&&/\.pdf$/i.test(t)};e.isValidFetchUrl=isValidFetchUrl;e.loadScript=function loadScript(t,e=!1){return new Promise(((s,n)=>{const i=document.createElement("script");i.src=t;i.onload=function(t){e&&i.remove();s(t)};i.onerror=function(){n(new Error(`Cannot load script at: ${i.src}`))};(document.head||document.documentElement).append(i)}))};e.setLayerDimensions=function setLayerDimensions(t,e,s=!1,n=!0){if(e instanceof PageViewport){const{pageWidth:n,pageHeight:i}=e.rawDims,{style:a}=t,r=`calc(var(--scale-factor) * ${n}px)`,o=`calc(var(--scale-factor) * ${i}px)`;if(s&&e.rotation%180!=0){a.width=o;a.height=r}else{a.width=r;a.height=o}}n&&t.setAttribute("data-main-rotation",e.rotation)};var n=s(7),i=s(1);e.AnnotationPrefix="pdfjs_internal_id_";class PixelsPerInch{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}e.PixelsPerInch=PixelsPerInch;class DOMCanvasFactory extends n.BaseCanvasFactory{constructor({ownerDocument:t=globalThis.document}={}){super();this._document=t}_createCanvas(t,e){const s=this._document.createElement("canvas");s.width=t;s.height=e;return s}}e.DOMCanvasFactory=DOMCanvasFactory;async function fetchData(t,e=!1){if(isValidFetchUrl(t,document.baseURI)){const s=await fetch(t);if(!s.ok)throw new Error(s.statusText);return e?new Uint8Array(await s.arrayBuffer()):(0,i.stringToBytes)(await s.text())}return new Promise(((s,n)=>{const a=new XMLHttpRequest;a.open("GET",t,!0);e&&(a.responseType="arraybuffer");a.onreadystatechange=()=>{if(a.readyState===XMLHttpRequest.DONE){if(200===a.status||0===a.status){let t;e&&a.response?t=new Uint8Array(a.response):!e&&a.responseText&&(t=(0,i.stringToBytes)(a.responseText));if(t){s(t);return}}n(new Error(a.statusText))}};a.send(null)}))}class DOMCMapReaderFactory extends n.BaseCMapReaderFactory{_fetchData(t,e){return fetchData(t,this.isCompressed).then((t=>({cMapData:t,compressionType:e})))}}e.DOMCMapReaderFactory=DOMCMapReaderFactory;class DOMStandardFontDataFactory extends n.BaseStandardFontDataFactory{_fetchData(t){return fetchData(t,!0)}}e.DOMStandardFontDataFactory=DOMStandardFontDataFactory;class DOMSVGFactory extends n.BaseSVGFactory{_createSVG(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}}e.DOMSVGFactory=DOMSVGFactory;class PageViewport{constructor({viewBox:t,scale:e,rotation:s,offsetX:n=0,offsetY:i=0,dontFlip:a=!1}){this.viewBox=t;this.scale=e;this.rotation=s;this.offsetX=n;this.offsetY=i;const r=(t[2]+t[0])/2,o=(t[3]+t[1])/2;let l,c,h,d,u,p,g,f;(s%=360)<0&&(s+=360);switch(s){case 180:l=-1;c=0;h=0;d=1;break;case 90:l=0;c=1;h=1;d=0;break;case 270:l=0;c=-1;h=-1;d=0;break;case 0:l=1;c=0;h=0;d=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}if(a){h=-h;d=-d}if(0===l){u=Math.abs(o-t[1])*e+n;p=Math.abs(r-t[0])*e+i;g=(t[3]-t[1])*e;f=(t[2]-t[0])*e}else{u=Math.abs(r-t[0])*e+n;p=Math.abs(o-t[1])*e+i;g=(t[2]-t[0])*e;f=(t[3]-t[1])*e}this.transform=[l*e,c*e,h*e,d*e,u-l*e*r-h*e*o,p-c*e*r-d*e*o];this.width=g;this.height=f}get rawDims(){const{viewBox:t}=this;return(0,i.shadow)(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone({scale:t=this.scale,rotation:e=this.rotation,offsetX:s=this.offsetX,offsetY:n=this.offsetY,dontFlip:i=!1}={}){return new PageViewport({viewBox:this.viewBox.slice(),scale:t,rotation:e,offsetX:s,offsetY:n,dontFlip:i})}convertToViewportPoint(t,e){return i.Util.applyTransform([t,e],this.transform)}convertToViewportRectangle(t){const e=i.Util.applyTransform([t[0],t[1]],this.transform),s=i.Util.applyTransform([t[2],t[3]],this.transform);return[e[0],e[1],s[0],s[1]]}convertToPdfPoint(t,e){return i.Util.applyInverseTransform([t,e],this.transform)}}e.PageViewport=PageViewport;class RenderingCancelledException extends i.BaseException{constructor(t,e,s=0){super(t,"RenderingCancelledException");this.type=e;this.extraDelay=s}}e.RenderingCancelledException=RenderingCancelledException;function isDataScheme(t){const e=t.length;let s=0;for(;s<e&&""===t[s].trim();)s++;return"data:"===t.substring(s,s+5).toLowerCase()}e.StatTimer=class StatTimer{started=Object.create(null);times=[];time(t){t in this.started&&(0,i.warn)(`Timer is already running for ${t}`);this.started[t]=Date.now()}timeEnd(t){t in this.started||(0,i.warn)(`Timer has not been started for ${t}`);this.times.push({name:t,start:this.started[t],end:Date.now()});delete this.started[t]}toString(){const t=[];let e=0;for(const{name:t}of this.times)e=Math.max(t.length,e);for(const{name:s,start:n,end:i}of this.times)t.push(`${s.padEnd(e)} ${i-n}ms\n`);return t.join("")}};function isValidFetchUrl(t,e){try{const{protocol:s}=e?new URL(t,e):new URL(t);return"http:"===s||"https:"===s}catch(t){return!1}}let a;e.PDFDateString=class PDFDateString{static toDateObject(t){if(!t||"string"!=typeof t)return null;a||(a=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const e=a.exec(t);if(!e)return null;const s=parseInt(e[1],10);let n=parseInt(e[2],10);n=n>=1&&n<=12?n-1:0;let i=parseInt(e[3],10);i=i>=1&&i<=31?i:1;let r=parseInt(e[4],10);r=r>=0&&r<=23?r:0;let o=parseInt(e[5],10);o=o>=0&&o<=59?o:0;let l=parseInt(e[6],10);l=l>=0&&l<=59?l:0;const c=e[7]||"Z";let h=parseInt(e[8],10);h=h>=0&&h<=23?h:0;let d=parseInt(e[9],10)||0;d=d>=0&&d<=59?d:0;if("-"===c){r+=h;o+=d}else if("+"===c){r-=h;o-=d}return new Date(Date.UTC(s,n,i,r,o,l))}};function getRGB(t){if(t.startsWith("#")){const e=parseInt(t.slice(1),16);return[(16711680&e)>>16,(65280&e)>>8,255&e]}if(t.startsWith("rgb("))return t.slice(4,-1).split(",").map((t=>parseInt(t)));if(t.startsWith("rgba("))return t.slice(5,-1).split(",").map((t=>parseInt(t))).slice(0,3);(0,i.warn)(`Not a valid color format: "${t}"`);return[0,0,0]}},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.BaseStandardFontDataFactory=e.BaseSVGFactory=e.BaseCanvasFactory=e.BaseCMapReaderFactory=void 0;var n=s(1);class BaseCanvasFactory{constructor(){this.constructor===BaseCanvasFactory&&(0,n.unreachable)("Cannot initialize BaseCanvasFactory.")}create(t,e){if(t<=0||e<=0)throw new Error("Invalid canvas size");const s=this._createCanvas(t,e);return{canvas:s,context:s.getContext("2d")}}reset(t,e,s){if(!t.canvas)throw new Error("Canvas is not specified");if(e<=0||s<=0)throw new Error("Invalid canvas size");t.canvas.width=e;t.canvas.height=s}destroy(t){if(!t.canvas)throw new Error("Canvas is not specified");t.canvas.width=0;t.canvas.height=0;t.canvas=null;t.context=null}_createCanvas(t,e){(0,n.unreachable)("Abstract method `_createCanvas` called.")}}e.BaseCanvasFactory=BaseCanvasFactory;class BaseCMapReaderFactory{constructor({baseUrl:t=null,isCompressed:e=!0}){this.constructor===BaseCMapReaderFactory&&(0,n.unreachable)("Cannot initialize BaseCMapReaderFactory.");this.baseUrl=t;this.isCompressed=e}async fetch({name:t}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!t)throw new Error("CMap name must be specified.");const e=this.baseUrl+t+(this.isCompressed?".bcmap":""),s=this.isCompressed?n.CMapCompressionType.BINARY:n.CMapCompressionType.NONE;return this._fetchData(e,s).catch((t=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${e}`)}))}_fetchData(t,e){(0,n.unreachable)("Abstract method `_fetchData` called.")}}e.BaseCMapReaderFactory=BaseCMapReaderFactory;class BaseStandardFontDataFactory{constructor({baseUrl:t=null}){this.constructor===BaseStandardFontDataFactory&&(0,n.unreachable)("Cannot initialize BaseStandardFontDataFactory.");this.baseUrl=t}async fetch({filename:t}){if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!t)throw new Error("Font filename must be specified.");const e=`${this.baseUrl}${t}`;return this._fetchData(e).catch((t=>{throw new Error(`Unable to load font data at: ${e}`)}))}_fetchData(t){(0,n.unreachable)("Abstract method `_fetchData` called.")}}e.BaseStandardFontDataFactory=BaseStandardFontDataFactory;class BaseSVGFactory{constructor(){this.constructor===BaseSVGFactory&&(0,n.unreachable)("Cannot initialize BaseSVGFactory.")}create(t,e,s=!1){if(t<=0||e<=0)throw new Error("Invalid SVG dimensions");const n=this._createSVG("svg:svg");n.setAttribute("version","1.1");if(!s){n.setAttribute("width",`${t}px`);n.setAttribute("height",`${e}px`)}n.setAttribute("preserveAspectRatio","none");n.setAttribute("viewBox",`0 0 ${t} ${e}`);return n}createElement(t){if("string"!=typeof t)throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){(0,n.unreachable)("Abstract method `_createSVG` called.")}}e.BaseSVGFactory=BaseSVGFactory},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.MurmurHash3_64=void 0;var n=s(1);const i=3285377520,a=4294901760,r=65535;e.MurmurHash3_64=class MurmurHash3_64{constructor(t){this.h1=t?4294967295&t:i;this.h2=t?4294967295&t:i}update(t){let e,s;if("string"==typeof t){e=new Uint8Array(2*t.length);s=0;for(let n=0,i=t.length;n<i;n++){const i=t.charCodeAt(n);if(i<=255)e[s++]=i;else{e[s++]=i>>>8;e[s++]=255&i}}}else{if(!(0,n.isArrayBuffer)(t))throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");e=t.slice();s=e.byteLength}const i=s>>2,o=s-4*i,l=new Uint32Array(e.buffer,0,i);let c=0,h=0,d=this.h1,u=this.h2;const p=3432918353,g=461845907,f=11601,m=13715;for(let t=0;t<i;t++)if(1&t){c=l[t];c=c*p&a|c*f&r;c=c<<15|c>>>17;c=c*g&a|c*m&r;d^=c;d=d<<13|d>>>19;d=5*d+3864292196}else{h=l[t];h=h*p&a|h*f&r;h=h<<15|h>>>17;h=h*g&a|h*m&r;u^=h;u=u<<13|u>>>19;u=5*u+3864292196}c=0;switch(o){case 3:c^=e[4*i+2]<<16;case 2:c^=e[4*i+1]<<8;case 1:c^=e[4*i];c=c*p&a|c*f&r;c=c<<15|c>>>17;c=c*g&a|c*m&r;1&i?d^=c:u^=c}this.h1=d;this.h2=u}hexdigest(){let t=this.h1,e=this.h2;t^=e>>>1;t=3981806797*t&a|36045*t&r;e=4283543511*e&a|(2950163797*(e<<16|t>>>16)&a)>>>16;t^=e>>>1;t=444984403*t&a|60499*t&r;e=3301882366*e&a|(3120437893*(e<<16|t>>>16)&a)>>>16;t^=e>>>1;return(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.FontLoader=e.FontFaceObject=void 0;var n=s(1),i=s(10);e.FontLoader=class FontLoader{constructor({onUnsupportedFeature:t,ownerDocument:e=globalThis.document,styleElement:s=null}){this._onUnsupportedFeature=t;this._document=e;this.nativeFontFaces=[];this.styleElement=null;this.loadingRequests=[];this.loadTestFontId=0}addNativeFontFace(t){this.nativeFontFaces.push(t);this._document.fonts.add(t)}insertRule(t){if(!this.styleElement){this.styleElement=this._document.createElement("style");this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement)}const e=this.styleElement.sheet;e.insertRule(t,e.cssRules.length)}clear(){for(const t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.length=0;if(this.styleElement){this.styleElement.remove();this.styleElement=null}}async bind(t){if(t.attached||t.missingFile)return;t.attached=!0;if(this.isFontLoadingAPISupported){const e=t.createNativeFontFace();if(e){this.addNativeFontFace(e);try{await e.loaded}catch(s){this._onUnsupportedFeature({featureId:n.UNSUPPORTED_FEATURES.errorFontLoadNative});(0,n.warn)(`Failed to load font '${e.family}': '${s}'.`);t.disableFontFace=!0;throw s}}return}const e=t.createFontFaceRule();if(e){this.insertRule(e);if(this.isSyncFontLoadingSupported)return;await new Promise((e=>{const s=this._queueLoadingCallback(e);this._prepareFontLoadEvent(t,s)}))}}get isFontLoadingAPISupported(){const t=!!this._document?.fonts;return(0,n.shadow)(this,"isFontLoadingAPISupported",t)}get isSyncFontLoadingSupported(){let t=!1;(i.isNodeJS||"undefined"!=typeof navigator&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(t=!0);return(0,n.shadow)(this,"isSyncFontLoadingSupported",t)}_queueLoadingCallback(t){const{loadingRequests:e}=this,s={done:!1,complete:function completeRequest(){(0,n.assert)(!s.done,"completeRequest() cannot be called twice.");s.done=!0;for(;e.length>0&&e[0].done;){const t=e.shift();setTimeout(t.callback,0)}},callback:t};e.push(s);return s}get _loadTestFont(){const t=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,n.shadow)(this,"_loadTestFont",t)}_prepareFontLoadEvent(t,e){function int32(t,e){return t.charCodeAt(e)<<24|t.charCodeAt(e+1)<<16|t.charCodeAt(e+2)<<8|255&t.charCodeAt(e+3)}function spliceString(t,e,s,n){return t.substring(0,e)+n+t.substring(e+s)}let s,i;const a=this._document.createElement("canvas");a.width=1;a.height=1;const r=a.getContext("2d");let o=0;const l=`lt${Date.now()}${this.loadTestFontId++}`;let c=this._loadTestFont;c=spliceString(c,976,l.length,l);const h=1482184792;let d=int32(c,16);for(s=0,i=l.length-3;s<i;s+=4)d=d-h+int32(l,s)|0;s<l.length&&(d=d-h+int32(l+"XXX",s)|0);c=spliceString(c,16,4,(0,n.string32)(d));const u=`@font-face {font-family:"${l}";src:${`url(data:font/opentype;base64,${btoa(c)});`}}`;this.insertRule(u);const p=this._document.createElement("div");p.style.visibility="hidden";p.style.width=p.style.height="10px";p.style.position="absolute";p.style.top=p.style.left="0px";for(const e of[t.loadedName,l]){const t=this._document.createElement("span");t.textContent="Hi";t.style.fontFamily=e;p.append(t)}this._document.body.append(p);!function isFontReady(t,e){if(++o>30){(0,n.warn)("Load test font never loaded.");e();return}r.font="30px "+t;r.fillText(".",0,20);r.getImageData(0,0,1,1).data[3]>0?e():setTimeout(isFontReady.bind(null,t,e))}(l,(()=>{p.remove();e.complete()}))}};e.FontFaceObject=class FontFaceObject{constructor(t,{isEvalSupported:e=!0,disableFontFace:s=!1,ignoreErrors:n=!1,onUnsupportedFeature:i,fontRegistry:a=null}){this.compiledGlyphs=Object.create(null);for(const e in t)this[e]=t[e];this.isEvalSupported=!1!==e;this.disableFontFace=!0===s;this.ignoreErrors=!0===n;this._onUnsupportedFeature=i;this.fontRegistry=a}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let t;if(this.cssFontInfo){const e={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(e.style=`oblique ${this.cssFontInfo.italicAngle}deg`);t=new FontFace(this.cssFontInfo.fontFamily,this.data,e)}else t=new FontFace(this.loadedName,this.data,{});this.fontRegistry?.registerFont(this);return t}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const t=(0,n.bytesToString)(this.data),e=`url(data:${this.mimetype};base64,${btoa(t)});`;let s;if(this.cssFontInfo){let t=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(t+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`);s=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${t}src:${e}}`}else s=`@font-face {font-family:"${this.loadedName}";src:${e}}`;this.fontRegistry?.registerFont(this,e);return s}getPathGenerator(t,e){if(void 0!==this.compiledGlyphs[e])return this.compiledGlyphs[e];let s;try{s=t.get(this.loadedName+"_path_"+e)}catch(t){if(!this.ignoreErrors)throw t;this._onUnsupportedFeature({featureId:n.UNSUPPORTED_FEATURES.errorFontGetPath});(0,n.warn)(`getPathGenerator - ignoring character: "${t}".`);return this.compiledGlyphs[e]=function(t,e){}}if(this.isEvalSupported&&n.FeatureTest.isEvalSupported){const t=[];for(const e of s){const s=void 0!==e.args?e.args.join(","):"";t.push("c.",e.cmd,"(",s,");\n")}return this.compiledGlyphs[e]=new Function("c","size",t.join(""))}return this.compiledGlyphs[e]=function(t,e){for(const n of s){"scale"===n.cmd&&(n.args=[e,-e]);t[n.cmd].apply(t,n.args)}}}}},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0});e.isNodeJS=void 0;const s=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type);e.isNodeJS=s},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.CanvasGraphics=void 0;var n=s(1),i=s(6),a=s(12),r=s(13);const o=4096,l=1e3,c=16;class CachedCanvases{constructor(t){this.canvasFactory=t;this.cache=Object.create(null)}getCanvas(t,e,s){let n;if(void 0!==this.cache[t]){n=this.cache[t];this.canvasFactory.reset(n,e,s)}else{n=this.canvasFactory.create(e,s);this.cache[t]=n}return n}delete(t){delete this.cache[t]}clear(){for(const t in this.cache){const e=this.cache[t];this.canvasFactory.destroy(e);delete this.cache[t]}}}function drawImageAtIntegerCoords(t,e,s,n,a,r,o,l,c,h){const[d,u,p,g,f,m]=(0,i.getCurrentTransform)(t);if(0===u&&0===p){const i=o*d+f,b=Math.round(i),A=l*g+m,_=Math.round(A),v=(o+c)*d+f,y=Math.abs(Math.round(v)-b)||1,S=(l+h)*g+m,x=Math.abs(Math.round(S)-_)||1;t.setTransform(Math.sign(d),0,0,Math.sign(g),b,_);t.drawImage(e,s,n,a,r,0,0,y,x);t.setTransform(d,u,p,g,f,m);return[y,x]}if(0===d&&0===g){const i=l*p+f,b=Math.round(i),A=o*u+m,_=Math.round(A),v=(l+h)*p+f,y=Math.abs(Math.round(v)-b)||1,S=(o+c)*u+m,x=Math.abs(Math.round(S)-_)||1;t.setTransform(0,Math.sign(u),Math.sign(p),0,b,_);t.drawImage(e,s,n,a,r,0,0,x,y);t.setTransform(d,u,p,g,f,m);return[x,y]}t.drawImage(e,s,n,a,r,o,l,c,h);return[Math.hypot(d,u)*c,Math.hypot(p,g)*h]}class CanvasExtraState{constructor(t,e){this.alphaIsShape=!1;this.fontSize=0;this.fontSizeScale=1;this.textMatrix=n.IDENTITY_MATRIX;this.textMatrixScale=1;this.fontMatrix=n.FONT_IDENTITY_MATRIX;this.leading=0;this.x=0;this.y=0;this.lineX=0;this.lineY=0;this.charSpacing=0;this.wordSpacing=0;this.textHScale=1;this.textRenderingMode=n.TextRenderingMode.FILL;this.textRise=0;this.fillColor="#000000";this.strokeColor="#000000";this.patternFill=!1;this.fillAlpha=1;this.strokeAlpha=1;this.lineWidth=1;this.activeSMask=null;this.transferMaps=null;this.startNewPathAndClipBox([0,0,t,e])}clone(){const t=Object.create(this);t.clipBox=this.clipBox.slice();return t}setCurrentPoint(t,e){this.x=t;this.y=e}updatePathMinMax(t,e,s){[e,s]=n.Util.applyTransform([e,s],t);this.minX=Math.min(this.minX,e);this.minY=Math.min(this.minY,s);this.maxX=Math.max(this.maxX,e);this.maxY=Math.max(this.maxY,s)}updateRectMinMax(t,e){const s=n.Util.applyTransform(e,t),i=n.Util.applyTransform(e.slice(2),t);this.minX=Math.min(this.minX,s[0],i[0]);this.minY=Math.min(this.minY,s[1],i[1]);this.maxX=Math.max(this.maxX,s[0],i[0]);this.maxY=Math.max(this.maxY,s[1],i[1])}updateScalingPathMinMax(t,e){n.Util.scaleMinMax(t,e);this.minX=Math.min(this.minX,e[0]);this.maxX=Math.max(this.maxX,e[1]);this.minY=Math.min(this.minY,e[2]);this.maxY=Math.max(this.maxY,e[3])}updateCurvePathMinMax(t,e,s,i,a,r,o,l,c,h){const d=n.Util.bezierBoundingBox(e,s,i,a,r,o,l,c);if(h){h[0]=Math.min(h[0],d[0],d[2]);h[1]=Math.max(h[1],d[0],d[2]);h[2]=Math.min(h[2],d[1],d[3]);h[3]=Math.max(h[3],d[1],d[3])}else this.updateRectMinMax(t,d)}getPathBoundingBox(t=a.PathType.FILL,e=null){const s=[this.minX,this.minY,this.maxX,this.maxY];if(t===a.PathType.STROKE){e||(0,n.unreachable)("Stroke bounding box must include transform.");const t=n.Util.singularValueDecompose2dScale(e),i=t[0]*this.lineWidth/2,a=t[1]*this.lineWidth/2;s[0]-=i;s[1]-=a;s[2]+=i;s[3]+=a}return s}updateClipFromPath(){const t=n.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(t){this.clipBox=t;this.minX=1/0;this.minY=1/0;this.maxX=0;this.maxY=0}getClippedPathBoundingBox(t=a.PathType.FILL,e=null){return n.Util.intersect(this.clipBox,this.getPathBoundingBox(t,e))}}function putBinaryImageData(t,e,s=null){if("undefined"!=typeof ImageData&&e instanceof ImageData){t.putImageData(e,0,0);return}const i=e.height,a=e.width,r=i%c,o=(i-r)/c,l=0===r?o:o+1,h=t.createImageData(a,c);let d,u=0;const p=e.data,g=h.data;let f,m,b,A,_,v,y,S;if(s)switch(s.length){case 1:_=s[0];v=s[0];y=s[0];S=s[0];break;case 4:_=s[0];v=s[1];y=s[2];S=s[3]}if(e.kind===n.ImageKind.GRAYSCALE_1BPP){const e=p.byteLength,s=new Uint32Array(g.buffer,0,g.byteLength>>2),i=s.length,A=a+7>>3;let _=4294967295,v=n.FeatureTest.isLittleEndian?4278190080:255;S&&255===S[0]&&0===S[255]&&([_,v]=[v,_]);for(f=0;f<l;f++){b=f<o?c:r;d=0;for(m=0;m<b;m++){const t=e-u;let n=0;const i=t>A?a:8*t-7,r=-8&i;let o=0,l=0;for(;n<r;n+=8){l=p[u++];s[d++]=128&l?_:v;s[d++]=64&l?_:v;s[d++]=32&l?_:v;s[d++]=16&l?_:v;s[d++]=8&l?_:v;s[d++]=4&l?_:v;s[d++]=2&l?_:v;s[d++]=1&l?_:v}for(;n<i;n++){if(0===o){l=p[u++];o=128}s[d++]=l&o?_:v;o>>=1}}for(;d<i;)s[d++]=0;t.putImageData(h,0,f*c)}}else if(e.kind===n.ImageKind.RGBA_32BPP){const e=!!(_||v||y);m=0;A=a*c*4;for(f=0;f<o;f++){g.set(p.subarray(u,u+A));u+=A;if(e)for(let t=0;t<A;t+=4){_&&(g[t+0]=_[g[t+0]]);v&&(g[t+1]=v[g[t+1]]);y&&(g[t+2]=y[g[t+2]])}t.putImageData(h,0,m);m+=c}if(f<l){A=a*r*4;g.set(p.subarray(u,u+A));if(e)for(let t=0;t<A;t+=4){_&&(g[t+0]=_[g[t+0]]);v&&(g[t+1]=v[g[t+1]]);y&&(g[t+2]=y[g[t+2]])}t.putImageData(h,0,m)}}else{if(e.kind!==n.ImageKind.RGB_24BPP)throw new Error(`bad image kind: ${e.kind}`);{const e=!!(_||v||y);b=c;A=a*b;for(f=0;f<l;f++){if(f>=o){b=r;A=a*b}d=0;for(m=A;m--;){g[d++]=p[u++];g[d++]=p[u++];g[d++]=p[u++];g[d++]=255}if(e)for(let t=0;t<d;t+=4){_&&(g[t+0]=_[g[t+0]]);v&&(g[t+1]=v[g[t+1]]);y&&(g[t+2]=y[g[t+2]])}t.putImageData(h,0,f*c)}}}}function putBinaryImageMask(t,e){if(e.bitmap){t.drawImage(e.bitmap,0,0);return}const s=e.height,n=e.width,i=s%c,a=(s-i)/c,o=0===i?a:a+1,l=t.createImageData(n,c);let h=0;const d=e.data,u=l.data;for(let e=0;e<o;e++){const s=e<a?c:i;({srcPos:h}=(0,r.applyMaskImageData)({src:d,srcPos:h,dest:u,width:n,height:s}));t.putImageData(l,0,e*c)}}function copyCtxState(t,e){const s=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font"];for(const n of s)void 0!==t[n]&&(e[n]=t[n]);if(void 0!==t.setLineDash){e.setLineDash(t.getLineDash());e.lineDashOffset=t.lineDashOffset}}function resetCtxToDefault(t,e){t.strokeStyle=t.fillStyle=e||"#000000";t.fillRule="nonzero";t.globalAlpha=1;t.lineWidth=1;t.lineCap="butt";t.lineJoin="miter";t.miterLimit=10;t.globalCompositeOperation="source-over";t.font="10px sans-serif";if(void 0!==t.setLineDash){t.setLineDash([]);t.lineDashOffset=0}}function composeSMaskBackdrop(t,e,s,n){const i=t.length;for(let a=3;a<i;a+=4){const i=t[a];if(0===i){t[a-3]=e;t[a-2]=s;t[a-1]=n}else if(i<255){const r=255-i;t[a-3]=t[a-3]*i+e*r>>8;t[a-2]=t[a-2]*i+s*r>>8;t[a-1]=t[a-1]*i+n*r>>8}}}function composeSMaskAlpha(t,e,s){const n=t.length;for(let i=3;i<n;i+=4){const n=s?s[t[i]]:t[i];e[i]=e[i]*n*.00392156862745098|0}}function composeSMaskLuminosity(t,e,s){const n=t.length;for(let i=3;i<n;i+=4){const n=77*t[i-3]+152*t[i-2]+28*t[i-1];e[i]=s?e[i]*s[n>>8]>>8:e[i]*n>>16}}function composeSMask(t,e,s,n){const i=n[0],a=n[1],r=n[2]-i,o=n[3]-a;if(0!==r&&0!==o){!function genericComposeSMask(t,e,s,n,i,a,r,o,l,c,h){const d=!!a,u=d?a[0]:0,p=d?a[1]:0,g=d?a[2]:0;let f;f="Luminosity"===i?composeSMaskLuminosity:composeSMaskAlpha;const m=Math.min(n,Math.ceil(1048576/s));for(let i=0;i<n;i+=m){const a=Math.min(m,n-i),b=t.getImageData(o-c,i+(l-h),s,a),A=e.getImageData(o,i+l,s,a);d&&composeSMaskBackdrop(b.data,u,p,g);f(b.data,A.data,r);e.putImageData(A,o,i+l)}}(e.context,s,r,o,e.subtype,e.backdrop,e.transferMap,i,a,e.offsetX,e.offsetY);t.save();t.globalAlpha=1;t.globalCompositeOperation="source-over";t.setTransform(1,0,0,1,0,0);t.drawImage(s.canvas,0,0);t.restore()}}function getImageSmoothingEnabled(t,e){const s=n.Util.singularValueDecompose2dScale(t);s[0]=Math.fround(s[0]);s[1]=Math.fround(s[1]);const a=Math.fround((globalThis.devicePixelRatio||1)*i.PixelsPerInch.PDF_TO_CSS_UNITS);return void 0!==e?e:s[0]<=a||s[1]<=a}const h=["butt","round","square"],d=["miter","round","bevel"],u={},p={};class CanvasGraphics{constructor(t,e,s,n,{optionalContentConfig:i,markedContentStack:a=null},r,o){this.ctx=t;this.current=new CanvasExtraState(this.ctx.canvas.width,this.ctx.canvas.height);this.stateStack=[];this.pendingClip=null;this.pendingEOFill=!1;this.res=null;this.xobjs=null;this.commonObjs=e;this.objs=s;this.canvasFactory=n;this.groupStack=[];this.processingType3=null;this.baseTransform=null;this.baseTransformStack=[];this.groupLevel=0;this.smaskStack=[];this.smaskCounter=0;this.tempSMask=null;this.suspendedCtx=null;this.contentVisible=!0;this.markedContentStack=a||[];this.optionalContentConfig=i;this.cachedCanvases=new CachedCanvases(this.canvasFactory);this.cachedPatterns=new Map;this.annotationCanvasMap=r;this.viewportScale=1;this.outputScaleX=1;this.outputScaleY=1;this.backgroundColor=o?.background||null;this.foregroundColor=o?.foreground||null;this._cachedScaleForStroking=null;this._cachedGetSinglePixelWidth=null;this._cachedBitmapsMap=new Map}getObject(t,e=null){return"string"==typeof t?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):e}beginDrawing({transform:t,viewport:e,transparency:s=!1,background:n=null}){const a=this.ctx.canvas.width,r=this.ctx.canvas.height,o=n||"#ffffff";this.ctx.save();if(this.foregroundColor&&this.backgroundColor){this.ctx.fillStyle=this.foregroundColor;const t=this.foregroundColor=this.ctx.fillStyle;this.ctx.fillStyle=this.backgroundColor;const e=this.backgroundColor=this.ctx.fillStyle;let s=!0,n=o;this.ctx.fillStyle=o;n=this.ctx.fillStyle;s="string"==typeof n&&/^#[0-9A-Fa-f]{6}$/.test(n);if("#000000"===t&&"#ffffff"===e||t===e||!s)this.foregroundColor=this.backgroundColor=null;else{const[s,a,r]=(0,i.getRGB)(n),newComp=t=>(t/=255)<=.03928?t/12.92:((t+.055)/1.055)**2.4,o=Math.round(.2126*newComp(s)+.7152*newComp(a)+.0722*newComp(r));this.selectColor=(s,n,i)=>{const a=.2126*newComp(s)+.7152*newComp(n)+.0722*newComp(i);return Math.round(a)===o?e:t}}}this.ctx.fillStyle=this.backgroundColor||o;this.ctx.fillRect(0,0,a,r);this.ctx.restore();if(s){const t=this.cachedCanvases.getCanvas("transparent",a,r);this.compositeCtx=this.ctx;this.transparentCanvas=t.canvas;this.ctx=t.context;this.ctx.save();this.ctx.transform(...(0,i.getCurrentTransform)(this.compositeCtx))}this.ctx.save();resetCtxToDefault(this.ctx,this.foregroundColor);if(t){this.ctx.transform(...t);this.outputScaleX=t[0];this.outputScaleY=t[0]}this.ctx.transform(...e.transform);this.viewportScale=e.scale;this.baseTransform=(0,i.getCurrentTransform)(this.ctx)}executeOperatorList(t,e,s,i){const a=t.argsArray,r=t.fnArray;let o=e||0;const l=a.length;if(l===o)return o;const c=l-o>10&&"function"==typeof s,h=c?Date.now()+15:0;let d=0;const u=this.commonObjs,p=this.objs;let g;for(;;){if(void 0!==i&&o===i.nextBreakPoint){i.breakIt(o,s);return o}g=r[o];if(g!==n.OPS.dependency)this[g].apply(this,a[o]);else for(const t of a[o]){const e=t.startsWith("g_")?u:p;if(!e.has(t)){e.get(t,s);return o}}o++;if(o===l)return o;if(c&&++d>10){if(Date.now()>h){s();return o}d=0}}}#ct(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore();if(this.transparentCanvas){this.ctx=this.compositeCtx;this.ctx.save();this.ctx.setTransform(1,0,0,1,0,0);this.ctx.drawImage(this.transparentCanvas,0,0);this.ctx.restore();this.transparentCanvas=null}}endDrawing(){this.#ct();this.cachedCanvases.clear();this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const e of t.values())"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement&&(e.width=e.height=0);t.clear()}this._cachedBitmapsMap.clear()}_scaleImage(t,e){const s=t.width,n=t.height;let i,a,r=Math.max(Math.hypot(e[0],e[1]),1),o=Math.max(Math.hypot(e[2],e[3]),1),l=s,c=n,h="prescale1";for(;r>2&&l>1||o>2&&c>1;){let e=l,s=c;if(r>2&&l>1){e=Math.ceil(l/2);r/=l/e}if(o>2&&c>1){s=Math.ceil(c/2);o/=c/s}i=this.cachedCanvases.getCanvas(h,e,s);a=i.context;a.clearRect(0,0,e,s);a.drawImage(t,0,0,l,c,0,0,e,s);t=i.canvas;l=e;c=s;h="prescale1"===h?"prescale2":"prescale1"}return{img:t,paintWidth:l,paintHeight:c}}_createMaskCanvas(t){const e=this.ctx,{width:s,height:r}=t,o=this.current.fillColor,l=this.current.patternFill,c=(0,i.getCurrentTransform)(e);let h,d,u,p;if((t.bitmap||t.data)&&t.count>1){const e=t.bitmap||t.data.buffer;d=JSON.stringify(l?c:[c.slice(0,4),o]);h=this._cachedBitmapsMap.get(e);if(!h){h=new Map;this._cachedBitmapsMap.set(e,h)}const s=h.get(d);if(s&&!l){return{canvas:s,offsetX:Math.round(Math.min(c[0],c[2])+c[4]),offsetY:Math.round(Math.min(c[1],c[3])+c[5])}}u=s}if(!u){p=this.cachedCanvases.getCanvas("maskCanvas",s,r);putBinaryImageMask(p.context,t)}let g=n.Util.transform(c,[1/s,0,0,-1/r,0,0]);g=n.Util.transform(g,[1,0,0,1,0,-r]);const f=n.Util.applyTransform([0,0],g),m=n.Util.applyTransform([s,r],g),b=n.Util.normalizeRect([f[0],f[1],m[0],m[1]]),A=Math.round(b[2]-b[0])||1,_=Math.round(b[3]-b[1])||1,v=this.cachedCanvases.getCanvas("fillCanvas",A,_),y=v.context,S=Math.min(f[0],m[0]),x=Math.min(f[1],m[1]);y.translate(-S,-x);y.transform(...g);if(!u){u=this._scaleImage(p.canvas,(0,i.getCurrentTransformInverse)(y));u=u.img;h&&l&&h.set(d,u)}y.imageSmoothingEnabled=getImageSmoothingEnabled((0,i.getCurrentTransform)(y),t.interpolate);drawImageAtIntegerCoords(y,u,0,0,u.width,u.height,0,0,s,r);y.globalCompositeOperation="source-in";const E=n.Util.transform((0,i.getCurrentTransformInverse)(y),[1,0,0,1,-S,-x]);y.fillStyle=l?o.getPattern(e,this,E,a.PathType.FILL):o;y.fillRect(0,0,s,r);if(h&&!l){this.cachedCanvases.delete("fillCanvas");h.set(d,v.canvas)}return{canvas:v.canvas,offsetX:Math.round(S),offsetY:Math.round(x)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking=null);this.current.lineWidth=t;this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=h[t]}setLineJoin(t){this.ctx.lineJoin=d[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,e){const s=this.ctx;if(void 0!==s.setLineDash){s.setLineDash(t);s.lineDashOffset=e}}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[e,s]of t)switch(e){case"LW":this.setLineWidth(s);break;case"LC":this.setLineCap(s);break;case"LJ":this.setLineJoin(s);break;case"ML":this.setMiterLimit(s);break;case"D":this.setDash(s[0],s[1]);break;case"RI":this.setRenderingIntent(s);break;case"FL":this.setFlatness(s);break;case"Font":this.setFont(s[0],s[1]);break;case"CA":this.current.strokeAlpha=s;break;case"ca":this.current.fillAlpha=s;this.ctx.globalAlpha=s;break;case"BM":this.ctx.globalCompositeOperation=s;break;case"SMask":this.current.activeSMask=s?this.tempSMask:null;this.tempSMask=null;this.checkSMaskState();break;case"TR":this.current.transferMaps=s}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const t=this.ctx.canvas.width,e=this.ctx.canvas.height,s="smaskGroupAt"+this.groupLevel,n=this.cachedCanvases.getCanvas(s,t,e);this.suspendedCtx=this.ctx;this.ctx=n.context;const a=this.ctx;a.setTransform(...(0,i.getCurrentTransform)(this.suspendedCtx));copyCtxState(this.suspendedCtx,a);!function mirrorContextOperations(t,e){if(t._removeMirroring)throw new Error("Context is already forwarding operations.");t.__originalSave=t.save;t.__originalRestore=t.restore;t.__originalRotate=t.rotate;t.__originalScale=t.scale;t.__originalTranslate=t.translate;t.__originalTransform=t.transform;t.__originalSetTransform=t.setTransform;t.__originalResetTransform=t.resetTransform;t.__originalClip=t.clip;t.__originalMoveTo=t.moveTo;t.__originalLineTo=t.lineTo;t.__originalBezierCurveTo=t.bezierCurveTo;t.__originalRect=t.rect;t.__originalClosePath=t.closePath;t.__originalBeginPath=t.beginPath;t._removeMirroring=()=>{t.save=t.__originalSave;t.restore=t.__originalRestore;t.rotate=t.__originalRotate;t.scale=t.__originalScale;t.translate=t.__originalTranslate;t.transform=t.__originalTransform;t.setTransform=t.__originalSetTransform;t.resetTransform=t.__originalResetTransform;t.clip=t.__originalClip;t.moveTo=t.__originalMoveTo;t.lineTo=t.__originalLineTo;t.bezierCurveTo=t.__originalBezierCurveTo;t.rect=t.__originalRect;t.closePath=t.__originalClosePath;t.beginPath=t.__originalBeginPath;delete t._removeMirroring};t.save=function ctxSave(){e.save();this.__originalSave()};t.restore=function ctxRestore(){e.restore();this.__originalRestore()};t.translate=function ctxTranslate(t,s){e.translate(t,s);this.__originalTranslate(t,s)};t.scale=function ctxScale(t,s){e.scale(t,s);this.__originalScale(t,s)};t.transform=function ctxTransform(t,s,n,i,a,r){e.transform(t,s,n,i,a,r);this.__originalTransform(t,s,n,i,a,r)};t.setTransform=function ctxSetTransform(t,s,n,i,a,r){e.setTransform(t,s,n,i,a,r);this.__originalSetTransform(t,s,n,i,a,r)};t.resetTransform=function ctxResetTransform(){e.resetTransform();this.__originalResetTransform()};t.rotate=function ctxRotate(t){e.rotate(t);this.__originalRotate(t)};t.clip=function ctxRotate(t){e.clip(t);this.__originalClip(t)};t.moveTo=function(t,s){e.moveTo(t,s);this.__originalMoveTo(t,s)};t.lineTo=function(t,s){e.lineTo(t,s);this.__originalLineTo(t,s)};t.bezierCurveTo=function(t,s,n,i,a,r){e.bezierCurveTo(t,s,n,i,a,r);this.__originalBezierCurveTo(t,s,n,i,a,r)};t.rect=function(t,s,n,i){e.rect(t,s,n,i);this.__originalRect(t,s,n,i)};t.closePath=function(){e.closePath();this.__originalClosePath()};t.beginPath=function(){e.beginPath();this.__originalBeginPath()}}(a,this.suspendedCtx);this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring();copyCtxState(this.ctx,this.suspendedCtx);this.ctx=this.suspendedCtx;this.suspendedCtx=null}compose(t){if(!this.current.activeSMask)return;if(t){t[0]=Math.floor(t[0]);t[1]=Math.floor(t[1]);t[2]=Math.ceil(t[2]);t[3]=Math.ceil(t[3])}else t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const e=this.current.activeSMask;composeSMask(this.suspendedCtx,e,this.ctx,t);this.ctx.save();this.ctx.setTransform(1,0,0,1,0,0);this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height);this.ctx.restore()}save(){if(this.inSMaskMode){copyCtxState(this.ctx,this.suspendedCtx);this.suspendedCtx.save()}else this.ctx.save();const t=this.current;this.stateStack.push(t);this.current=t.clone()}restore(){0===this.stateStack.length&&this.inSMaskMode&&this.endSMaskMode();if(0!==this.stateStack.length){this.current=this.stateStack.pop();if(this.inSMaskMode){this.suspendedCtx.restore();copyCtxState(this.suspendedCtx,this.ctx)}else this.ctx.restore();this.checkSMaskState();this.pendingClip=null;this._cachedScaleForStroking=null;this._cachedGetSinglePixelWidth=null}}transform(t,e,s,n,i,a){this.ctx.transform(t,e,s,n,i,a);this._cachedScaleForStroking=null;this._cachedGetSinglePixelWidth=null}constructPath(t,e,s){const a=this.ctx,r=this.current;let o,l,c=r.x,h=r.y;const d=(0,i.getCurrentTransform)(a),u=0===d[0]&&0===d[3]||0===d[1]&&0===d[2],p=u?s.slice(0):null;for(let s=0,i=0,g=t.length;s<g;s++)switch(0|t[s]){case n.OPS.rectangle:c=e[i++];h=e[i++];const t=e[i++],s=e[i++],g=c+t,f=h+s;a.moveTo(c,h);if(0===t||0===s)a.lineTo(g,f);else{a.lineTo(g,h);a.lineTo(g,f);a.lineTo(c,f)}u||r.updateRectMinMax(d,[c,h,g,f]);a.closePath();break;case n.OPS.moveTo:c=e[i++];h=e[i++];a.moveTo(c,h);u||r.updatePathMinMax(d,c,h);break;case n.OPS.lineTo:c=e[i++];h=e[i++];a.lineTo(c,h);u||r.updatePathMinMax(d,c,h);break;case n.OPS.curveTo:o=c;l=h;c=e[i+4];h=e[i+5];a.bezierCurveTo(e[i],e[i+1],e[i+2],e[i+3],c,h);r.updateCurvePathMinMax(d,o,l,e[i],e[i+1],e[i+2],e[i+3],c,h,p);i+=6;break;case n.OPS.curveTo2:o=c;l=h;a.bezierCurveTo(c,h,e[i],e[i+1],e[i+2],e[i+3]);r.updateCurvePathMinMax(d,o,l,c,h,e[i],e[i+1],e[i+2],e[i+3],p);c=e[i+2];h=e[i+3];i+=4;break;case n.OPS.curveTo3:o=c;l=h;c=e[i+2];h=e[i+3];a.bezierCurveTo(e[i],e[i+1],c,h,c,h);r.updateCurvePathMinMax(d,o,l,e[i],e[i+1],c,h,c,h,p);i+=4;break;case n.OPS.closePath:a.closePath()}u&&r.updateScalingPathMinMax(d,p);r.setCurrentPoint(c,h)}closePath(){this.ctx.closePath()}stroke(t=!0){const e=this.ctx,s=this.current.strokeColor;e.globalAlpha=this.current.strokeAlpha;if(this.contentVisible)if("object"==typeof s&&s?.getPattern){e.save();e.strokeStyle=s.getPattern(e,this,(0,i.getCurrentTransformInverse)(e),a.PathType.STROKE);this.rescaleAndStroke(!1);e.restore()}else this.rescaleAndStroke(!0);t&&this.consumePath(this.current.getClippedPathBoundingBox());e.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath();this.stroke()}fill(t=!0){const e=this.ctx,s=this.current.fillColor;let n=!1;if(this.current.patternFill){e.save();e.fillStyle=s.getPattern(e,this,(0,i.getCurrentTransformInverse)(e),a.PathType.FILL);n=!0}const r=this.current.getClippedPathBoundingBox();if(this.contentVisible&&null!==r)if(this.pendingEOFill){e.fill("evenodd");this.pendingEOFill=!1}else e.fill();n&&e.restore();t&&this.consumePath(r)}eoFill(){this.pendingEOFill=!0;this.fill()}fillStroke(){this.fill(!1);this.stroke(!1);this.consumePath()}eoFillStroke(){this.pendingEOFill=!0;this.fillStroke()}closeFillStroke(){this.closePath();this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0;this.closePath();this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=u}eoClip(){this.pendingClip=p}beginText(){this.current.textMatrix=n.IDENTITY_MATRIX;this.current.textMatrixScale=1;this.current.x=this.current.lineX=0;this.current.y=this.current.lineY=0}endText(){const t=this.pendingTextPaths,e=this.ctx;if(void 0!==t){e.save();e.beginPath();for(const s of t){e.setTransform(...s.transform);e.translate(s.x,s.y);s.addToPath(e,s.fontSize)}e.restore();e.clip();e.beginPath();delete this.pendingTextPaths}else e.beginPath()}setCharSpacing(t){this.current.charSpacing=t}setWordSpacing(t){this.current.wordSpacing=t}setHScale(t){this.current.textHScale=t/100}setLeading(t){this.current.leading=-t}setFont(t,e){const s=this.commonObjs.get(t),i=this.current;if(!s)throw new Error(`Can't find font for ${t}`);i.fontMatrix=s.fontMatrix||n.FONT_IDENTITY_MATRIX;0!==i.fontMatrix[0]&&0!==i.fontMatrix[3]||(0,n.warn)("Invalid font matrix for font "+t);if(e<0){e=-e;i.fontDirection=-1}else i.fontDirection=1;this.current.font=s;this.current.fontSize=e;if(s.isType3Font)return;const a=s.loadedName||"sans-serif";let r="normal";s.black?r="900":s.bold&&(r="bold");const o=s.italic?"italic":"normal",l=`"${a}", ${s.fallbackName}`;let c=e;e<16?c=16:e>100&&(c=100);this.current.fontSizeScale=e/c;this.ctx.font=`${o} ${r} ${c}px ${l}`}setTextRenderingMode(t){this.current.textRenderingMode=t}setTextRise(t){this.current.textRise=t}moveText(t,e){this.current.x=this.current.lineX+=t;this.current.y=this.current.lineY+=e}setLeadingMoveText(t,e){this.setLeading(-e);this.moveText(t,e)}setTextMatrix(t,e,s,n,i,a){this.current.textMatrix=[t,e,s,n,i,a];this.current.textMatrixScale=Math.hypot(t,e);this.current.x=this.current.lineX=0;this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(t,e,s,a){const r=this.ctx,o=this.current,l=o.font,c=o.textRenderingMode,h=o.fontSize/o.fontSizeScale,d=c&n.TextRenderingMode.FILL_STROKE_MASK,u=!!(c&n.TextRenderingMode.ADD_TO_PATH_FLAG),p=o.patternFill&&!l.missingFile;let g;(l.disableFontFace||u||p)&&(g=l.getPathGenerator(this.commonObjs,t));if(l.disableFontFace||p){r.save();r.translate(e,s);r.beginPath();g(r,h);a&&r.setTransform(...a);d!==n.TextRenderingMode.FILL&&d!==n.TextRenderingMode.FILL_STROKE||r.fill();d!==n.TextRenderingMode.STROKE&&d!==n.TextRenderingMode.FILL_STROKE||r.stroke();r.restore()}else{d!==n.TextRenderingMode.FILL&&d!==n.TextRenderingMode.FILL_STROKE||r.fillText(t,e,s);d!==n.TextRenderingMode.STROKE&&d!==n.TextRenderingMode.FILL_STROKE||r.strokeText(t,e,s)}if(u){(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:(0,i.getCurrentTransform)(r),x:e,y:s,fontSize:h,addToPath:g})}}get isFontSubpixelAAEnabled(){const{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1);t.fillText("I",0,10);const e=t.getImageData(0,0,10,10).data;let s=!1;for(let t=3;t<e.length;t+=4)if(e[t]>0&&e[t]<255){s=!0;break}return(0,n.shadow)(this,"isFontSubpixelAAEnabled",s)}showText(t){const e=this.current,s=e.font;if(s.isType3Font)return this.showType3Text(t);const r=e.fontSize;if(0===r)return;const o=this.ctx,l=e.fontSizeScale,c=e.charSpacing,h=e.wordSpacing,d=e.fontDirection,u=e.textHScale*d,p=t.length,g=s.vertical,f=g?1:-1,m=s.defaultVMetrics,b=r*e.fontMatrix[0],A=e.textRenderingMode===n.TextRenderingMode.FILL&&!s.disableFontFace&&!e.patternFill;o.save();o.transform(...e.textMatrix);o.translate(e.x,e.y+e.textRise);d>0?o.scale(u,-1):o.scale(u,1);let _;if(e.patternFill){o.save();const t=e.fillColor.getPattern(o,this,(0,i.getCurrentTransformInverse)(o),a.PathType.FILL);_=(0,i.getCurrentTransform)(o);o.restore();o.fillStyle=t}let v=e.lineWidth;const y=e.textMatrixScale;if(0===y||0===v){const t=e.textRenderingMode&n.TextRenderingMode.FILL_STROKE_MASK;t!==n.TextRenderingMode.STROKE&&t!==n.TextRenderingMode.FILL_STROKE||(v=this.getSinglePixelWidth())}else v/=y;if(1!==l){o.scale(l,l);v/=l}o.lineWidth=v;if(s.isInvalidPDFjsFont){const s=[];let n=0;for(const e of t){s.push(e.unicode);n+=e.width}o.fillText(s.join(""),0,0);e.x+=n*b*u;o.restore();this.compose();return}let S,x=0;for(S=0;S<p;++S){const e=t[S];if("number"==typeof e){x+=f*e*r/1e3;continue}let n=!1;const i=(e.isSpace?h:0)+c,a=e.fontChar,u=e.accent;let p,v,y,E=e.width;if(g){const t=e.vmetric||m,s=-(e.vmetric?t[1]:.5*E)*b,n=t[2]*b;E=t?-t[0]:E;p=s/l;v=(x+n)/l}else{p=x/l;v=0}if(s.remeasure&&E>0){const t=1e3*o.measureText(a).width/r*l;if(E<t&&this.isFontSubpixelAAEnabled){const e=E/t;n=!0;o.save();o.scale(e,1);p/=e}else E!==t&&(p+=(E-t)/2e3*r/l)}if(this.contentVisible&&(e.isInFont||s.missingFile))if(A&&!u)o.fillText(a,p,v);else{this.paintChar(a,p,v,_);if(u){const t=p+r*u.offset.x/l,e=v-r*u.offset.y/l;this.paintChar(u.fontChar,t,e,_)}}y=g?E*b-i*d:E*b+i*d;x+=y;n&&o.restore()}g?e.y-=x:e.x+=x*u;o.restore();this.compose()}showType3Text(t){const e=this.ctx,s=this.current,i=s.font,a=s.fontSize,r=s.fontDirection,o=i.vertical?1:-1,l=s.charSpacing,c=s.wordSpacing,h=s.textHScale*r,d=s.fontMatrix||n.FONT_IDENTITY_MATRIX,u=t.length;let p,g,f,m;if(!(s.textRenderingMode===n.TextRenderingMode.INVISIBLE)&&0!==a){this._cachedScaleForStroking=null;this._cachedGetSinglePixelWidth=null;e.save();e.transform(...s.textMatrix);e.translate(s.x,s.y);e.scale(h,r);for(p=0;p<u;++p){g=t[p];if("number"==typeof g){m=o*g*a/1e3;this.ctx.translate(m,0);s.x+=m*h;continue}const r=(g.isSpace?c:0)+l,u=i.charProcOperatorList[g.operatorListId];if(!u){(0,n.warn)(`Type3 character "${g.operatorListId}" is not available.`);continue}if(this.contentVisible){this.processingType3=g;this.save();e.scale(a,a);e.transform(...d);this.executeOperatorList(u);this.restore()}f=n.Util.applyTransform([g.width,0],d)[0]*a+r;e.translate(f,0);s.x+=f*h}e.restore();this.processingType3=null}}setCharWidth(t,e){}setCharWidthAndBounds(t,e,s,n,i,a){this.ctx.rect(s,n,i-s,a-n);this.ctx.clip();this.endPath()}getColorN_Pattern(t){let e;if("TilingPattern"===t[0]){const s=t[1],n=this.baseTransform||(0,i.getCurrentTransform)(this.ctx),r={createCanvasGraphics:t=>new CanvasGraphics(t,this.commonObjs,this.objs,this.canvasFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};e=new a.TilingPattern(t,s,this.ctx,r,n)}else e=this._getPattern(t[1],t[2]);return e}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments);this.current.patternFill=!0}setStrokeRGBColor(t,e,s){const i=this.selectColor?.(t,e,s)||n.Util.makeHexColor(t,e,s);this.ctx.strokeStyle=i;this.current.strokeColor=i}setFillRGBColor(t,e,s){const i=this.selectColor?.(t,e,s)||n.Util.makeHexColor(t,e,s);this.ctx.fillStyle=i;this.current.fillColor=i;this.current.patternFill=!1}_getPattern(t,e=null){let s;if(this.cachedPatterns.has(t))s=this.cachedPatterns.get(t);else{s=(0,a.getShadingPattern)(this.objs.get(t));this.cachedPatterns.set(t,s)}e&&(s.matrix=e);return s}shadingFill(t){if(!this.contentVisible)return;const e=this.ctx;this.save();const s=this._getPattern(t);e.fillStyle=s.getPattern(e,this,(0,i.getCurrentTransformInverse)(e),a.PathType.SHADING);const r=(0,i.getCurrentTransformInverse)(e);if(r){const t=e.canvas,s=t.width,i=t.height,a=n.Util.applyTransform([0,0],r),o=n.Util.applyTransform([0,i],r),l=n.Util.applyTransform([s,0],r),c=n.Util.applyTransform([s,i],r),h=Math.min(a[0],o[0],l[0],c[0]),d=Math.min(a[1],o[1],l[1],c[1]),u=Math.max(a[0],o[0],l[0],c[0]),p=Math.max(a[1],o[1],l[1],c[1]);this.ctx.fillRect(h,d,u-h,p-d)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox());this.restore()}beginInlineImage(){(0,n.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,n.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(t,e){if(this.contentVisible){this.save();this.baseTransformStack.push(this.baseTransform);Array.isArray(t)&&6===t.length&&this.transform(...t);this.baseTransform=(0,i.getCurrentTransform)(this.ctx);if(e){const t=e[2]-e[0],s=e[3]-e[1];this.ctx.rect(e[0],e[1],t,s);this.current.updateRectMinMax((0,i.getCurrentTransform)(this.ctx),e);this.clip();this.endPath()}}}paintFormXObjectEnd(){if(this.contentVisible){this.restore();this.baseTransform=this.baseTransformStack.pop()}}beginGroup(t){if(!this.contentVisible)return;this.save();if(this.inSMaskMode){this.endSMaskMode();this.current.activeSMask=null}const e=this.ctx;t.isolated||(0,n.info)("TODO: Support non-isolated groups.");t.knockout&&(0,n.warn)("Knockout groups not supported.");const s=(0,i.getCurrentTransform)(e);t.matrix&&e.transform(...t.matrix);if(!t.bbox)throw new Error("Bounding box is required.");let a=n.Util.getAxialAlignedBoundingBox(t.bbox,(0,i.getCurrentTransform)(e));const r=[0,0,e.canvas.width,e.canvas.height];a=n.Util.intersect(a,r)||[0,0,0,0];const l=Math.floor(a[0]),c=Math.floor(a[1]);let h=Math.max(Math.ceil(a[2])-l,1),d=Math.max(Math.ceil(a[3])-c,1),u=1,p=1;if(h>o){u=h/o;h=o}if(d>o){p=d/o;d=o}this.current.startNewPathAndClipBox([0,0,h,d]);let g="groupAt"+this.groupLevel;t.smask&&(g+="_smask_"+this.smaskCounter++%2);const f=this.cachedCanvases.getCanvas(g,h,d),m=f.context;m.scale(1/u,1/p);m.translate(-l,-c);m.transform(...s);if(t.smask)this.smaskStack.push({canvas:f.canvas,context:m,offsetX:l,offsetY:c,scaleX:u,scaleY:p,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null});else{e.setTransform(1,0,0,1,0,0);e.translate(l,c);e.scale(u,p);e.save()}copyCtxState(e,m);this.ctx=m;this.setGState([["BM","source-over"],["ca",1],["CA",1]]);this.groupStack.push(e);this.groupLevel++}endGroup(t){if(!this.contentVisible)return;this.groupLevel--;const e=this.ctx,s=this.groupStack.pop();this.ctx=s;this.ctx.imageSmoothingEnabled=!1;if(t.smask){this.tempSMask=this.smaskStack.pop();this.restore()}else{this.ctx.restore();const t=(0,i.getCurrentTransform)(this.ctx);this.restore();this.ctx.save();this.ctx.setTransform(...t);const s=n.Util.getAxialAlignedBoundingBox([0,0,e.canvas.width,e.canvas.height],t);this.ctx.drawImage(e.canvas,0,0);this.ctx.restore();this.compose(s)}}beginAnnotation(t,e,s,a,r){this.#ct();resetCtxToDefault(this.ctx,this.foregroundColor);this.ctx.save();this.save();this.baseTransform&&this.ctx.setTransform(...this.baseTransform);if(Array.isArray(e)&&4===e.length){const a=e[2]-e[0],o=e[3]-e[1];if(r&&this.annotationCanvasMap){(s=s.slice())[4]-=e[0];s[5]-=e[1];(e=e.slice())[0]=e[1]=0;e[2]=a;e[3]=o;const[r,l]=n.Util.singularValueDecompose2dScale((0,i.getCurrentTransform)(this.ctx)),{viewportScale:c}=this,h=Math.ceil(a*this.outputScaleX*c),d=Math.ceil(o*this.outputScaleY*c);this.annotationCanvas=this.canvasFactory.create(h,d);const{canvas:u,context:p}=this.annotationCanvas;this.annotationCanvasMap.set(t,u);this.annotationCanvas.savedCtx=this.ctx;this.ctx=p;this.ctx.setTransform(r,0,0,-l,0,o*l);resetCtxToDefault(this.ctx,this.foregroundColor)}else{resetCtxToDefault(this.ctx,this.foregroundColor);this.ctx.rect(e[0],e[1],a,o);this.ctx.clip();this.endPath()}}this.current=new CanvasExtraState(this.ctx.canvas.width,this.ctx.canvas.height);this.transform(...s);this.transform(...a)}endAnnotation(){if(this.annotationCanvas){this.ctx=this.annotationCanvas.savedCtx;delete this.annotationCanvas.savedCtx;delete this.annotationCanvas}}paintImageMaskXObject(t){if(!this.contentVisible)return;const e=t.count;(t=this.getObject(t.data,t)).count=e;const s=this.ctx,n=this.processingType3;if(n){void 0===n.compiled&&(n.compiled=function compileType3Glyph(t){const{width:e,height:s}=t;if(e>l||s>l)return null;const n=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),i=e+1;let a,r,o,c=new Uint8Array(i*(s+1));const h=e+7&-8;let d=new Uint8Array(h*s),u=0;for(const e of t.data){let t=128;for(;t>0;){d[u++]=e&t?0:255;t>>=1}}let p=0;u=0;if(0!==d[u]){c[0]=1;++p}for(r=1;r<e;r++){if(d[u]!==d[u+1]){c[r]=d[u]?2:1;++p}u++}if(0!==d[u]){c[r]=2;++p}for(a=1;a<s;a++){u=a*h;o=a*i;if(d[u-h]!==d[u]){c[o]=d[u]?1:8;++p}let t=(d[u]?4:0)+(d[u-h]?8:0);for(r=1;r<e;r++){t=(t>>2)+(d[u+1]?4:0)+(d[u-h+1]?8:0);if(n[t]){c[o+r]=n[t];++p}u++}if(d[u-h]!==d[u]){c[o+r]=d[u]?2:4;++p}if(p>1e3)return null}u=h*(s-1);o=a*i;if(0!==d[u]){c[o]=8;++p}for(r=1;r<e;r++){if(d[u]!==d[u+1]){c[o+r]=d[u]?4:8;++p}u++}if(0!==d[u]){c[o+r]=4;++p}if(p>1e3)return null;const g=new Int32Array([0,i,-1,0,-i,0,0,0,1]),f=new Path2D;for(a=0;p&&a<=s;a++){let t=a*i;const s=t+e;for(;t<s&&!c[t];)t++;if(t===s)continue;f.moveTo(t%i,a);const n=t;let r=c[t];do{const e=g[r];do{t+=e}while(!c[t]);const s=c[t];if(5!==s&&10!==s){r=s;c[t]=0}else{r=s&51*r>>4;c[t]&=r>>2|r<<2}f.lineTo(t%i,t/i|0);c[t]||--p}while(n!==t);--a}d=null;c=null;return function(t){t.save();t.scale(1/e,-1/s);t.translate(0,-s);t.fill(f);t.beginPath();t.restore()}}(t));if(n.compiled){n.compiled(s);return}}const i=this._createMaskCanvas(t),a=i.canvas;s.save();s.setTransform(1,0,0,1,0,0);s.drawImage(a,i.offsetX,i.offsetY);s.restore();this.compose()}paintImageMaskXObjectRepeat(t,e,s=0,a=0,r,o){if(!this.contentVisible)return;t=this.getObject(t.data,t);const l=this.ctx;l.save();const c=(0,i.getCurrentTransform)(l);l.transform(e,s,a,r,0,0);const h=this._createMaskCanvas(t);l.setTransform(1,0,0,1,h.offsetX-c[4],h.offsetY-c[5]);for(let t=0,i=o.length;t<i;t+=2){const i=n.Util.transform(c,[e,s,a,r,o[t],o[t+1]]),[d,u]=n.Util.applyTransform([0,0],i);l.drawImage(h.canvas,d,u)}l.restore();this.compose()}paintImageMaskXObjectGroup(t){if(!this.contentVisible)return;const e=this.ctx,s=this.current.fillColor,n=this.current.patternFill;for(const r of t){const{data:t,width:o,height:l,transform:c}=r,h=this.cachedCanvases.getCanvas("maskCanvas",o,l),d=h.context;d.save();putBinaryImageMask(d,this.getObject(t,r));d.globalCompositeOperation="source-in";d.fillStyle=n?s.getPattern(d,this,(0,i.getCurrentTransformInverse)(e),a.PathType.FILL):s;d.fillRect(0,0,o,l);d.restore();e.save();e.transform(...c);e.scale(1,-1);drawImageAtIntegerCoords(e,h.canvas,0,0,o,l,0,-1,1,1);e.restore()}this.compose()}paintImageXObject(t){if(!this.contentVisible)return;const e=this.getObject(t);e?this.paintInlineImageXObject(e):(0,n.warn)("Dependent image isn't ready yet")}paintImageXObjectRepeat(t,e,s,i){if(!this.contentVisible)return;const a=this.getObject(t);if(!a){(0,n.warn)("Dependent image isn't ready yet");return}const r=a.width,o=a.height,l=[];for(let t=0,n=i.length;t<n;t+=2)l.push({transform:[e,0,0,s,i[t],i[t+1]],x:0,y:0,w:r,h:o});this.paintInlineImageXObjectGroup(a,l)}paintInlineImageXObject(t){if(!this.contentVisible)return;const e=t.width,s=t.height,n=this.ctx;this.save();n.scale(1/e,-1/s);let a;if("function"==typeof HTMLElement&&t instanceof HTMLElement||!t.data)a=t;else{const n=this.cachedCanvases.getCanvas("inlineImage",e,s);putBinaryImageData(n.context,t,this.current.transferMaps);a=n.canvas}const r=this._scaleImage(a,(0,i.getCurrentTransformInverse)(n));n.imageSmoothingEnabled=getImageSmoothingEnabled((0,i.getCurrentTransform)(n),t.interpolate);drawImageAtIntegerCoords(n,r.img,0,0,r.paintWidth,r.paintHeight,0,-s,e,s);this.compose();this.restore()}paintInlineImageXObjectGroup(t,e){if(!this.contentVisible)return;const s=this.ctx,n=t.width,i=t.height,a=this.cachedCanvases.getCanvas("inlineImage",n,i);putBinaryImageData(a.context,t,this.current.transferMaps);for(const t of e){s.save();s.transform(...t.transform);s.scale(1,-1);drawImageAtIntegerCoords(s,a.canvas,t.x,t.y,t.w,t.h,0,-1,1,1);s.restore()}this.compose()}paintSolidColorImageMask(){if(this.contentVisible){this.ctx.fillRect(0,0,1,1);this.compose()}}markPoint(t){}markPointProps(t,e){}beginMarkedContent(t){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,e){"OC"===t?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(e)}):this.markedContentStack.push({visible:!0});this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop();this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(t){const e=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath();this.pendingClip||this.compose(t);const s=this.ctx;if(this.pendingClip){e||(this.pendingClip===p?s.clip("evenodd"):s.clip());this.pendingClip=null}this.current.startNewPathAndClipBox(this.current.clipBox);s.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=(0,i.getCurrentTransform)(this.ctx);if(0===t[1]&&0===t[2])this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{const e=Math.abs(t[0]*t[3]-t[2]*t[1]),s=Math.hypot(t[0],t[2]),n=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(s,n)/e}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(!this._cachedScaleForStroking){const{lineWidth:t}=this.current,e=(0,i.getCurrentTransform)(this.ctx);let s,n;if(0===e[1]&&0===e[2]){const i=Math.abs(e[0]),a=Math.abs(e[3]);if(0===t){s=1/i;n=1/a}else{const e=i*t,r=a*t;s=e<1?1/e:1;n=r<1?1/r:1}}else{const i=Math.abs(e[0]*e[3]-e[2]*e[1]),a=Math.hypot(e[0],e[1]),r=Math.hypot(e[2],e[3]);if(0===t){s=r/i;n=a/i}else{const e=t*i;s=r>e?r/e:1;n=a>e?a/e:1}}this._cachedScaleForStroking=[s,n]}return this._cachedScaleForStroking}rescaleAndStroke(t){const{ctx:e}=this,{lineWidth:s}=this.current,[n,a]=this.getScaleForStroking();e.lineWidth=s||1;if(1===n&&1===a){e.stroke();return}let r,o,l;if(t){r=(0,i.getCurrentTransform)(e);o=e.getLineDash().slice();l=e.lineDashOffset}e.scale(n,a);const c=Math.max(n,a);e.setLineDash(e.getLineDash().map((t=>t/c)));e.lineDashOffset/=c;e.stroke();if(t){e.setTransform(...r);e.setLineDash(o);e.lineDashOffset=l}}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}e.CanvasGraphics=CanvasGraphics;for(const t in n.OPS)void 0!==CanvasGraphics.prototype[t]&&(CanvasGraphics.prototype[n.OPS[t]]=CanvasGraphics.prototype[t])},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.TilingPattern=e.PathType=void 0;e.getShadingPattern=function getShadingPattern(t){switch(t[0]){case"RadialAxial":return new RadialAxialShadingPattern(t);case"Mesh":return new MeshShadingPattern(t);case"Dummy":return new DummyShadingPattern}throw new Error(`Unknown IR type: ${t[0]}`)};var n=s(1),i=s(6);const a={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};e.PathType=a;function applyBoundingBox(t,e){if(!e)return;const s=e[2]-e[0],n=e[3]-e[1],i=new Path2D;i.rect(e[0],e[1],s,n);t.clip(i)}class BaseShadingPattern{constructor(){this.constructor===BaseShadingPattern&&(0,n.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,n.unreachable)("Abstract method `getPattern` called.")}}class RadialAxialShadingPattern extends BaseShadingPattern{constructor(t){super();this._type=t[1];this._bbox=t[2];this._colorStops=t[3];this._p0=t[4];this._p1=t[5];this._r0=t[6];this._r1=t[7];this.matrix=null}_createGradient(t){let e;"axial"===this._type?e=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(e=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const t of this._colorStops)e.addColorStop(t[0],t[1]);return e}getPattern(t,e,s,r){let o;if(r===a.STROKE||r===a.FILL){const a=e.current.getClippedPathBoundingBox(r,(0,i.getCurrentTransform)(t))||[0,0,0,0],l=Math.ceil(a[2]-a[0])||1,c=Math.ceil(a[3]-a[1])||1,h=e.cachedCanvases.getCanvas("pattern",l,c,!0),d=h.context;d.clearRect(0,0,d.canvas.width,d.canvas.height);d.beginPath();d.rect(0,0,d.canvas.width,d.canvas.height);d.translate(-a[0],-a[1]);s=n.Util.transform(s,[1,0,0,1,a[0],a[1]]);d.transform(...e.baseTransform);this.matrix&&d.transform(...this.matrix);applyBoundingBox(d,this._bbox);d.fillStyle=this._createGradient(d);d.fill();o=t.createPattern(h.canvas,"no-repeat");const u=new DOMMatrix(s);o.setTransform(u)}else{applyBoundingBox(t,this._bbox);o=this._createGradient(t)}return o}}function drawTriangle(t,e,s,n,i,a,r,o){const l=e.coords,c=e.colors,h=t.data,d=4*t.width;let u;if(l[s+1]>l[n+1]){u=s;s=n;n=u;u=a;a=r;r=u}if(l[n+1]>l[i+1]){u=n;n=i;i=u;u=r;r=o;o=u}if(l[s+1]>l[n+1]){u=s;s=n;n=u;u=a;a=r;r=u}const p=(l[s]+e.offsetX)*e.scaleX,g=(l[s+1]+e.offsetY)*e.scaleY,f=(l[n]+e.offsetX)*e.scaleX,m=(l[n+1]+e.offsetY)*e.scaleY,b=(l[i]+e.offsetX)*e.scaleX,A=(l[i+1]+e.offsetY)*e.scaleY;if(g>=A)return;const _=c[a],v=c[a+1],y=c[a+2],S=c[r],x=c[r+1],E=c[r+2],C=c[o],P=c[o+1],T=c[o+2],w=Math.round(g),k=Math.round(A);let R,M,F,D,I,O,L,N;for(let t=w;t<=k;t++){if(t<m){let e;e=t<g?0:(g-t)/(g-m);R=p-(p-f)*e;M=_-(_-S)*e;F=v-(v-x)*e;D=y-(y-E)*e}else{let e;e=t>A?1:m===A?0:(m-t)/(m-A);R=f-(f-b)*e;M=S-(S-C)*e;F=x-(x-P)*e;D=E-(E-T)*e}let e;e=t<g?0:t>A?1:(g-t)/(g-A);I=p-(p-b)*e;O=_-(_-C)*e;L=v-(v-P)*e;N=y-(y-T)*e;const s=Math.round(Math.min(R,I)),n=Math.round(Math.max(R,I));let i=d*t+4*s;for(let t=s;t<=n;t++){e=(R-t)/(R-I);e<0?e=0:e>1&&(e=1);h[i++]=M-(M-O)*e|0;h[i++]=F-(F-L)*e|0;h[i++]=D-(D-N)*e|0;h[i++]=255}}}function drawFigure(t,e,s){const n=e.coords,i=e.colors;let a,r;switch(e.type){case"lattice":const o=e.verticesPerRow,l=Math.floor(n.length/o)-1,c=o-1;for(a=0;a<l;a++){let e=a*o;for(let a=0;a<c;a++,e++){drawTriangle(t,s,n[e],n[e+1],n[e+o],i[e],i[e+1],i[e+o]);drawTriangle(t,s,n[e+o+1],n[e+1],n[e+o],i[e+o+1],i[e+1],i[e+o])}}break;case"triangles":for(a=0,r=n.length;a<r;a+=3)drawTriangle(t,s,n[a],n[a+1],n[a+2],i[a],i[a+1],i[a+2]);break;default:throw new Error("illegal figure")}}class MeshShadingPattern extends BaseShadingPattern{constructor(t){super();this._coords=t[2];this._colors=t[3];this._figures=t[4];this._bounds=t[5];this._bbox=t[7];this._background=t[8];this.matrix=null}_createMeshCanvas(t,e,s){const n=Math.floor(this._bounds[0]),i=Math.floor(this._bounds[1]),a=Math.ceil(this._bounds[2])-n,r=Math.ceil(this._bounds[3])-i,o=Math.min(Math.ceil(Math.abs(a*t[0]*1.1)),3e3),l=Math.min(Math.ceil(Math.abs(r*t[1]*1.1)),3e3),c=a/o,h=r/l,d={coords:this._coords,colors:this._colors,offsetX:-n,offsetY:-i,scaleX:1/c,scaleY:1/h},u=o+4,p=l+4,g=s.getCanvas("mesh",u,p,!1),f=g.context,m=f.createImageData(o,l);if(e){const t=m.data;for(let s=0,n=t.length;s<n;s+=4){t[s]=e[0];t[s+1]=e[1];t[s+2]=e[2];t[s+3]=255}}for(const t of this._figures)drawFigure(m,t,d);f.putImageData(m,2,2);return{canvas:g.canvas,offsetX:n-2*c,offsetY:i-2*h,scaleX:c,scaleY:h}}getPattern(t,e,s,r){applyBoundingBox(t,this._bbox);let o;if(r===a.SHADING)o=n.Util.singularValueDecompose2dScale((0,i.getCurrentTransform)(t));else{o=n.Util.singularValueDecompose2dScale(e.baseTransform);if(this.matrix){const t=n.Util.singularValueDecompose2dScale(this.matrix);o=[o[0]*t[0],o[1]*t[1]]}}const l=this._createMeshCanvas(o,r===a.SHADING?null:this._background,e.cachedCanvases);if(r!==a.SHADING){t.setTransform(...e.baseTransform);this.matrix&&t.transform(...this.matrix)}t.translate(l.offsetX,l.offsetY);t.scale(l.scaleX,l.scaleY);return t.createPattern(l.canvas,"no-repeat")}}class DummyShadingPattern extends BaseShadingPattern{getPattern(){return"hotpink"}}const r=1,o=2;class TilingPattern{static get MAX_PATTERN_SIZE(){return(0,n.shadow)(this,"MAX_PATTERN_SIZE",3e3)}constructor(t,e,s,n,i){this.operatorList=t[2];this.matrix=t[3]||[1,0,0,1,0,0];this.bbox=t[4];this.xstep=t[5];this.ystep=t[6];this.paintType=t[7];this.tilingType=t[8];this.color=e;this.ctx=s;this.canvasGraphicsFactory=n;this.baseTransform=i}createPatternCanvas(t){const e=this.operatorList,s=this.bbox,a=this.xstep,r=this.ystep,o=this.paintType,l=this.tilingType,c=this.color,h=this.canvasGraphicsFactory;(0,n.info)("TilingType: "+l);const d=s[0],u=s[1],p=s[2],g=s[3],f=n.Util.singularValueDecompose2dScale(this.matrix),m=n.Util.singularValueDecompose2dScale(this.baseTransform),b=[f[0]*m[0],f[1]*m[1]],A=this.getSizeAndScale(a,this.ctx.canvas.width,b[0]),_=this.getSizeAndScale(r,this.ctx.canvas.height,b[1]),v=t.cachedCanvases.getCanvas("pattern",A.size,_.size,!0),y=v.context,S=h.createCanvasGraphics(y);S.groupLevel=t.groupLevel;this.setFillAndStrokeStyleToContext(S,o,c);let x=d,E=u,C=p,P=g;if(d<0){x=0;C+=Math.abs(d)}if(u<0){E=0;P+=Math.abs(u)}y.translate(-A.scale*x,-_.scale*E);S.transform(A.scale,0,0,_.scale,0,0);y.save();this.clipBbox(S,x,E,C,P);S.baseTransform=(0,i.getCurrentTransform)(S.ctx);S.executeOperatorList(e);S.endDrawing();return{canvas:v.canvas,scaleX:A.scale,scaleY:_.scale,offsetX:x,offsetY:E}}getSizeAndScale(t,e,s){t=Math.abs(t);const n=Math.max(TilingPattern.MAX_PATTERN_SIZE,e);let i=Math.ceil(t*s);i>=n?i=n:s=i/t;return{scale:s,size:i}}clipBbox(t,e,s,n,a){const r=n-e,o=a-s;t.ctx.rect(e,s,r,o);t.current.updateRectMinMax((0,i.getCurrentTransform)(t.ctx),[e,s,n,a]);t.clip();t.endPath()}setFillAndStrokeStyleToContext(t,e,s){const i=t.ctx,a=t.current;switch(e){case r:const t=this.ctx;i.fillStyle=t.fillStyle;i.strokeStyle=t.strokeStyle;a.fillColor=t.fillStyle;a.strokeColor=t.strokeStyle;break;case o:const l=n.Util.makeHexColor(s[0],s[1],s[2]);i.fillStyle=l;i.strokeStyle=l;a.fillColor=l;a.strokeColor=l;break;default:throw new n.FormatError(`Unsupported paint type: ${e}`)}}getPattern(t,e,s,i){let r=s;if(i!==a.SHADING){r=n.Util.transform(r,e.baseTransform);this.matrix&&(r=n.Util.transform(r,this.matrix))}const o=this.createPatternCanvas(e);let l=new DOMMatrix(r);l=l.translate(o.offsetX,o.offsetY);l=l.scale(1/o.scaleX,1/o.scaleY);const c=t.createPattern(o.canvas,"repeat");c.setTransform(l);return c}}e.TilingPattern=TilingPattern},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.applyMaskImageData=function applyMaskImageData({src:t,srcPos:e=0,dest:s,destPos:i=0,width:a,height:r,inverseDecode:o=!1}){const l=n.FeatureTest.isLittleEndian?4278190080:255,[c,h]=o?[0,l]:[l,0],d=a>>3,u=7&a,p=t.length;s=new Uint32Array(s.buffer);for(let n=0;n<r;n++){for(const n=e+d;e<n;e++){const n=e<p?t[e]:255;s[i++]=128&n?h:c;s[i++]=64&n?h:c;s[i++]=32&n?h:c;s[i++]=16&n?h:c;s[i++]=8&n?h:c;s[i++]=4&n?h:c;s[i++]=2&n?h:c;s[i++]=1&n?h:c}if(0===u)continue;const n=e<p?t[e++]:255;for(let t=0;t<u;t++)s[i++]=n&1<<7-t?h:c}return{srcPos:e,destPos:i}};var n=s(1)},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0});e.GlobalWorkerOptions=void 0;const s=Object.create(null);e.GlobalWorkerOptions=s;s.workerPort=null;s.workerSrc=""},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.MessageHandler=void 0;var n=s(1);const i=1,a=2,r=1,o=2,l=3,c=4,h=5,d=6,u=7,p=8;function wrapReason(t){t instanceof Error||"object"==typeof t&&null!==t||(0,n.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.');switch(t.name){case"AbortException":return new n.AbortException(t.message);case"MissingPDFException":return new n.MissingPDFException(t.message);case"PasswordException":return new n.PasswordException(t.message,t.code);case"UnexpectedResponseException":return new n.UnexpectedResponseException(t.message,t.status);case"UnknownErrorException":return new n.UnknownErrorException(t.message,t.details);default:return new n.UnknownErrorException(t.message,t.toString())}}e.MessageHandler=class MessageHandler{constructor(t,e,s){this.sourceName=t;this.targetName=e;this.comObj=s;this.callbackId=1;this.streamId=1;this.streamSinks=Object.create(null);this.streamControllers=Object.create(null);this.callbackCapabilities=Object.create(null);this.actionHandler=Object.create(null);this._onComObjOnMessage=t=>{const e=t.data;if(e.targetName!==this.sourceName)return;if(e.stream){this._processStreamMessage(e);return}if(e.callback){const t=e.callbackId,s=this.callbackCapabilities[t];if(!s)throw new Error(`Cannot resolve callback ${t}`);delete this.callbackCapabilities[t];if(e.callback===i)s.resolve(e.data);else{if(e.callback!==a)throw new Error("Unexpected callback case");s.reject(wrapReason(e.reason))}return}const n=this.actionHandler[e.action];if(!n)throw new Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){const t=this.sourceName,r=e.sourceName;new Promise((function(t){t(n(e.data))})).then((function(n){s.postMessage({sourceName:t,targetName:r,callback:i,callbackId:e.callbackId,data:n})}),(function(n){s.postMessage({sourceName:t,targetName:r,callback:a,callbackId:e.callbackId,reason:wrapReason(n)})}))}else e.streamId?this._createStreamSink(e):n(e.data)};s.addEventListener("message",this._onComObjOnMessage)}on(t,e){const s=this.actionHandler;if(s[t])throw new Error(`There is already an actionName called "${t}"`);s[t]=e}send(t,e,s){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:e},s)}sendWithPromise(t,e,s){const i=this.callbackId++,a=(0,n.createPromiseCapability)();this.callbackCapabilities[i]=a;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:i,data:e},s)}catch(t){a.reject(t)}return a.promise}sendWithStream(t,e,s,i){const a=this.streamId++,o=this.sourceName,l=this.targetName,c=this.comObj;return new ReadableStream({start:s=>{const r=(0,n.createPromiseCapability)();this.streamControllers[a]={controller:s,startCall:r,pullCall:null,cancelCall:null,isClosed:!1};c.postMessage({sourceName:o,targetName:l,action:t,streamId:a,data:e,desiredSize:s.desiredSize},i);return r.promise},pull:t=>{const e=(0,n.createPromiseCapability)();this.streamControllers[a].pullCall=e;c.postMessage({sourceName:o,targetName:l,stream:d,streamId:a,desiredSize:t.desiredSize});return e.promise},cancel:t=>{(0,n.assert)(t instanceof Error,"cancel must have a valid reason");const e=(0,n.createPromiseCapability)();this.streamControllers[a].cancelCall=e;this.streamControllers[a].isClosed=!0;c.postMessage({sourceName:o,targetName:l,stream:r,streamId:a,reason:wrapReason(t)});return e.promise}},s)}_createStreamSink(t){const e=t.streamId,s=this.sourceName,i=t.sourceName,a=this.comObj,r=this,o=this.actionHandler[t.action],d={enqueue(t,r=1,o){if(this.isCancelled)return;const l=this.desiredSize;this.desiredSize-=r;if(l>0&&this.desiredSize<=0){this.sinkCapability=(0,n.createPromiseCapability)();this.ready=this.sinkCapability.promise}a.postMessage({sourceName:s,targetName:i,stream:c,streamId:e,chunk:t},o)},close(){if(!this.isCancelled){this.isCancelled=!0;a.postMessage({sourceName:s,targetName:i,stream:l,streamId:e});delete r.streamSinks[e]}},error(t){(0,n.assert)(t instanceof Error,"error must have a valid reason");if(!this.isCancelled){this.isCancelled=!0;a.postMessage({sourceName:s,targetName:i,stream:h,streamId:e,reason:wrapReason(t)})}},sinkCapability:(0,n.createPromiseCapability)(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};d.sinkCapability.resolve();d.ready=d.sinkCapability.promise;this.streamSinks[e]=d;new Promise((function(e){e(o(t.data,d))})).then((function(){a.postMessage({sourceName:s,targetName:i,stream:p,streamId:e,success:!0})}),(function(t){a.postMessage({sourceName:s,targetName:i,stream:p,streamId:e,reason:wrapReason(t)})}))}_processStreamMessage(t){const e=t.streamId,s=this.sourceName,i=t.sourceName,a=this.comObj,g=this.streamControllers[e],f=this.streamSinks[e];switch(t.stream){case p:t.success?g.startCall.resolve():g.startCall.reject(wrapReason(t.reason));break;case u:t.success?g.pullCall.resolve():g.pullCall.reject(wrapReason(t.reason));break;case d:if(!f){a.postMessage({sourceName:s,targetName:i,stream:u,streamId:e,success:!0});break}f.desiredSize<=0&&t.desiredSize>0&&f.sinkCapability.resolve();f.desiredSize=t.desiredSize;new Promise((function(t){t(f.onPull&&f.onPull())})).then((function(){a.postMessage({sourceName:s,targetName:i,stream:u,streamId:e,success:!0})}),(function(t){a.postMessage({sourceName:s,targetName:i,stream:u,streamId:e,reason:wrapReason(t)})}));break;case c:(0,n.assert)(g,"enqueue should have stream controller");if(g.isClosed)break;g.controller.enqueue(t.chunk);break;case l:(0,n.assert)(g,"close should have stream controller");if(g.isClosed)break;g.isClosed=!0;g.controller.close();this._deleteStreamController(g,e);break;case h:(0,n.assert)(g,"error should have stream controller");g.controller.error(wrapReason(t.reason));this._deleteStreamController(g,e);break;case o:t.success?g.cancelCall.resolve():g.cancelCall.reject(wrapReason(t.reason));this._deleteStreamController(g,e);break;case r:if(!f)break;new Promise((function(e){e(f.onCancel&&f.onCancel(wrapReason(t.reason)))})).then((function(){a.postMessage({sourceName:s,targetName:i,stream:o,streamId:e,success:!0})}),(function(t){a.postMessage({sourceName:s,targetName:i,stream:o,streamId:e,reason:wrapReason(t)})}));f.sinkCapability.reject(wrapReason(t.reason));f.isCancelled=!0;delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}}async _deleteStreamController(t,e){await Promise.allSettled([t.startCall&&t.startCall.promise,t.pullCall&&t.pullCall.promise,t.cancelCall&&t.cancelCall.promise]);delete this.streamControllers[e]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.Metadata=void 0;var n=s(1);e.Metadata=class Metadata{#ht;#dt;constructor({parsedData:t,rawData:e}){this.#ht=t;this.#dt=e}getRaw(){return this.#dt}get(t){return this.#ht.get(t)??null}getAll(){return(0,n.objectFromMap)(this.#ht)}has(t){return this.#ht.has(t)}}},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.OptionalContentConfig=void 0;var n=s(1),i=s(8);const a=Symbol("INTERNAL");class OptionalContentGroup{#ut=!0;constructor(t,e){this.name=t;this.intent=e}get visible(){return this.#ut}_setVisible(t,e){t!==a&&(0,n.unreachable)("Internal method `_setVisible` called.");this.#ut=e}}e.OptionalContentConfig=class OptionalContentConfig{#pt=null;#gt=new Map;#ft=null;#mt=null;constructor(t){this.name=null;this.creator=null;if(null!==t){this.name=t.name;this.creator=t.creator;this.#mt=t.order;for(const e of t.groups)this.#gt.set(e.id,new OptionalContentGroup(e.name,e.intent));if("OFF"===t.baseState)for(const t of this.#gt.values())t._setVisible(a,!1);for(const e of t.on)this.#gt.get(e)._setVisible(a,!0);for(const e of t.off)this.#gt.get(e)._setVisible(a,!1);this.#ft=this.getHash()}}#bt(t){const e=t.length;if(e<2)return!0;const s=t[0];for(let i=1;i<e;i++){const e=t[i];let a;if(Array.isArray(e))a=this.#bt(e);else{if(!this.#gt.has(e)){(0,n.warn)(`Optional content group not found: ${e}`);return!0}a=this.#gt.get(e).visible}switch(s){case"And":if(!a)return!1;break;case"Or":if(a)return!0;break;case"Not":return!a;default:return!0}}return"And"===s}isVisible(t){if(0===this.#gt.size)return!0;if(!t){(0,n.warn)("Optional content group not defined.");return!0}if("OCG"===t.type){if(!this.#gt.has(t.id)){(0,n.warn)(`Optional content group not found: ${t.id}`);return!0}return this.#gt.get(t.id).visible}if("OCMD"===t.type){if(t.expression)return this.#bt(t.expression);if(!t.policy||"AnyOn"===t.policy){for(const e of t.ids){if(!this.#gt.has(e)){(0,n.warn)(`Optional content group not found: ${e}`);return!0}if(this.#gt.get(e).visible)return!0}return!1}if("AllOn"===t.policy){for(const e of t.ids){if(!this.#gt.has(e)){(0,n.warn)(`Optional content group not found: ${e}`);return!0}if(!this.#gt.get(e).visible)return!1}return!0}if("AnyOff"===t.policy){for(const e of t.ids){if(!this.#gt.has(e)){(0,n.warn)(`Optional content group not found: ${e}`);return!0}if(!this.#gt.get(e).visible)return!0}return!1}if("AllOff"===t.policy){for(const e of t.ids){if(!this.#gt.has(e)){(0,n.warn)(`Optional content group not found: ${e}`);return!0}if(this.#gt.get(e).visible)return!1}return!0}(0,n.warn)(`Unknown optional content policy ${t.policy}.`);return!0}(0,n.warn)(`Unknown group type ${t.type}.`);return!0}setVisibility(t,e=!0){if(this.#gt.has(t)){this.#gt.get(t)._setVisible(a,!!e);this.#pt=null}else(0,n.warn)(`Optional content group not found: ${t}`)}get hasInitialVisibility(){return this.getHash()===this.#ft}getOrder(){return this.#gt.size?this.#mt?this.#mt.slice():[...this.#gt.keys()]:null}getGroups(){return this.#gt.size>0?(0,n.objectFromMap)(this.#gt):null}getGroup(t){return this.#gt.get(t)||null}getHash(){if(null!==this.#pt)return this.#pt;const t=new i.MurmurHash3_64;for(const[e,s]of this.#gt)t.update(`${e}:${s.visible}`);return this.#pt=t.hexdigest()}}},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.PDFDataTransportStream=void 0;var n=s(1),i=s(6);e.PDFDataTransportStream=class PDFDataTransportStream{constructor({length:t,initialData:e,progressiveDone:s=!1,contentDispositionFilename:i=null,disableRange:a=!1,disableStream:r=!1},o){(0,n.assert)(o,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');this._queuedChunks=[];this._progressiveDone=s;this._contentDispositionFilename=i;if(e?.length>0){const t=e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength?e.buffer:new Uint8Array(e).buffer;this._queuedChunks.push(t)}this._pdfDataRangeTransport=o;this._isStreamingSupported=!r;this._isRangeSupported=!a;this._contentLength=t;this._fullRequestReader=null;this._rangeReaders=[];this._pdfDataRangeTransport.addRangeListener(((t,e)=>{this._onReceiveData({begin:t,chunk:e})}));this._pdfDataRangeTransport.addProgressListener(((t,e)=>{this._onProgress({loaded:t,total:e})}));this._pdfDataRangeTransport.addProgressiveReadListener((t=>{this._onReceiveData({chunk:t})}));this._pdfDataRangeTransport.addProgressiveDoneListener((()=>{this._onProgressiveDone()}));this._pdfDataRangeTransport.transportReady()}_onReceiveData({begin:t,chunk:e}){const s=e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength?e.buffer:new Uint8Array(e).buffer;if(void 0===t)this._fullRequestReader?this._fullRequestReader._enqueue(s):this._queuedChunks.push(s);else{const e=this._rangeReaders.some((function(e){if(e._begin!==t)return!1;e._enqueue(s);return!0}));(0,n.assert)(e,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(t){void 0===t.total?this._rangeReaders[0]?.onProgress?.({loaded:t.loaded}):this._fullRequestReader?.onProgress?.({loaded:t.loaded,total:t.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone();this._progressiveDone=!0}_removeRangeReader(t){const e=this._rangeReaders.indexOf(t);e>=0&&this._rangeReaders.splice(e,1)}getFullReader(){(0,n.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;this._queuedChunks=null;return new PDFDataTransportStreamReader(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const s=new PDFDataTransportStreamRangeReader(this,t,e);this._pdfDataRangeTransport.requestDataRange(t,e);this._rangeReaders.push(s);return s}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeReaders.slice(0))e.cancel(t);this._pdfDataRangeTransport.abort()}};class PDFDataTransportStreamReader{constructor(t,e,s=!1,n=null){this._stream=t;this._done=s||!1;this._filename=(0,i.isPdfFile)(n)?n:null;this._queuedChunks=e||[];this._loaded=0;for(const t of this._queuedChunks)this._loaded+=t.byteLength;this._requests=[];this._headersReady=Promise.resolve();t._fullRequestReader=this;this.onProgress=null}_enqueue(t){if(!this._done){if(this._requests.length>0){this._requests.shift().resolve({value:t,done:!1})}else this._queuedChunks.push(t);this._loaded+=t.byteLength}}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0){return{value:this._queuedChunks.shift(),done:!1}}if(this._done)return{value:void 0,done:!0};const t=(0,n.createPromiseCapability)();this._requests.push(t);return t.promise}cancel(t){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class PDFDataTransportStreamRangeReader{constructor(t,e,s){this._stream=t;this._begin=e;this._end=s;this._queuedChunk=null;this._requests=[];this._done=!1;this.onProgress=null}_enqueue(t){if(!this._done){if(0===this._requests.length)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0;this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const t=this._queuedChunk;this._queuedChunk=null;return{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=(0,n.createPromiseCapability)();this._requests.push(t);return t.promise}cancel(t){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0;this._stream._removeRangeReader(this)}}},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0});e.XfaText=void 0;class XfaText{static textContent(t){const e=[],s={items:e,styles:Object.create(null)};!function walk(t){if(!t)return;let s=null;const n=t.name;if("#text"===n)s=t.value;else{if(!XfaText.shouldBuildText(n))return;t?.attributes?.textContent?s=t.attributes.textContent:t.value&&(s=t.value)}null!==s&&e.push({str:s});if(t.children)for(const e of t.children)walk(e)}(t);return s}static shouldBuildText(t){return!("textarea"===t||"input"===t||"option"===t||"select"===t)}}e.XfaText=XfaText},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.NodeStandardFontDataFactory=e.NodeCanvasFactory=e.NodeCMapReaderFactory=void 0;var n=s(7);const fetchData=function(t){return new Promise(((e,s)=>{require("fs").readFile(t,((t,n)=>{!t&&n?e(new Uint8Array(n)):s(new Error(t))}))}))};class NodeCanvasFactory extends n.BaseCanvasFactory{_createCanvas(t,e){return require("canvas").createCanvas(t,e)}}e.NodeCanvasFactory=NodeCanvasFactory;class NodeCMapReaderFactory extends n.BaseCMapReaderFactory{_fetchData(t,e){return fetchData(t).then((t=>({cMapData:t,compressionType:e})))}}e.NodeCMapReaderFactory=NodeCMapReaderFactory;class NodeStandardFontDataFactory extends n.BaseStandardFontDataFactory{_fetchData(t){return fetchData(t)}}e.NodeStandardFontDataFactory=NodeStandardFontDataFactory},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.PDFNodeStream=void 0;var n=s(1),i=s(22);const a=require("fs"),r=require("http"),o=require("https"),l=require("url"),c=/^file:\/\/\/[a-zA-Z]:\//;e.PDFNodeStream=class PDFNodeStream{constructor(t){this.source=t;this.url=function parseUrl(t){const e=l.parse(t);if("file:"===e.protocol||e.host)return e;if(/^[a-z]:[/\\]/i.test(t))return l.parse(`file:///${t}`);e.host||(e.protocol="file:");return e}(t.url);this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol;this.isFsUrl="file:"===this.url.protocol;this.httpHeaders=this.isHttp&&t.httpHeaders||{};this._fullRequestReader=null;this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){(0,n.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once.");this._fullRequestReader=this.isFsUrl?new PDFNodeStreamFsFullReader(this):new PDFNodeStreamFullReader(this);return this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const s=this.isFsUrl?new PDFNodeStreamFsRangeReader(this,t,e):new PDFNodeStreamRangeReader(this,t,e);this._rangeRequestReaders.push(s);return s}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}};class BaseFullReader{constructor(t){this._url=t.url;this._done=!1;this._storedError=null;this.onProgress=null;const e=t.source;this._contentLength=e.length;this._loaded=0;this._filename=null;this._disableRange=e.disableRange||!1;this._rangeChunkSize=e.rangeChunkSize;this._rangeChunkSize||this._disableRange||(this._disableRange=!0);this._isStreamingSupported=!e.disableStream;this._isRangeSupported=!e.disableRange;this._readableStream=null;this._readCapability=(0,n.createPromiseCapability)();this._headersCapability=(0,n.createPromiseCapability)()}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;if(this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();if(null===t){this._readCapability=(0,n.createPromiseCapability)();return this.read()}this._loaded+=t.length;this.onProgress?.({loaded:this._loaded,total:this._contentLength});return{value:new Uint8Array(t).buffer,done:!1}}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}_error(t){this._storedError=t;this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t;t.on("readable",(()=>{this._readCapability.resolve()}));t.on("end",(()=>{t.destroy();this._done=!0;this._readCapability.resolve()}));t.on("error",(t=>{this._error(t)}));!this._isStreamingSupported&&this._isRangeSupported&&this._error(new n.AbortException("streaming is disabled"));this._storedError&&this._readableStream.destroy(this._storedError)}}class BaseRangeReader{constructor(t){this._url=t.url;this._done=!1;this._storedError=null;this.onProgress=null;this._loaded=0;this._readableStream=null;this._readCapability=(0,n.createPromiseCapability)();const e=t.source;this._isStreamingSupported=!e.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;if(this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();if(null===t){this._readCapability=(0,n.createPromiseCapability)();return this.read()}this._loaded+=t.length;this.onProgress?.({loaded:this._loaded});return{value:new Uint8Array(t).buffer,done:!1}}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}_error(t){this._storedError=t;this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t;t.on("readable",(()=>{this._readCapability.resolve()}));t.on("end",(()=>{t.destroy();this._done=!0;this._readCapability.resolve()}));t.on("error",(t=>{this._error(t)}));this._storedError&&this._readableStream.destroy(this._storedError)}}function createRequestOptions(t,e){return{protocol:t.protocol,auth:t.auth,host:t.hostname,port:t.port,path:t.path,method:"GET",headers:e}}class PDFNodeStreamFullReader extends BaseFullReader{constructor(t){super(t);const handleResponse=e=>{if(404===e.statusCode){const t=new n.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=t;this._headersCapability.reject(t);return}this._headersCapability.resolve();this._setReadableStream(e);const getResponseHeader=t=>this._readableStream.headers[t.toLowerCase()],{allowRangeRequests:s,suggestedLength:a}=(0,i.validateRangeRequestCapabilities)({getResponseHeader:getResponseHeader,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=s;this._contentLength=a||this._contentLength;this._filename=(0,i.extractFilenameFromHeader)(getResponseHeader)};this._request=null;"http:"===this._url.protocol?this._request=r.request(createRequestOptions(this._url,t.httpHeaders),handleResponse):this._request=o.request(createRequestOptions(this._url,t.httpHeaders),handleResponse);this._request.on("error",(t=>{this._storedError=t;this._headersCapability.reject(t)}));this._request.end()}}class PDFNodeStreamRangeReader extends BaseRangeReader{constructor(t,e,s){super(t);this._httpHeaders={};for(const e in t.httpHeaders){const s=t.httpHeaders[e];void 0!==s&&(this._httpHeaders[e]=s)}this._httpHeaders.Range=`bytes=${e}-${s-1}`;const handleResponse=t=>{if(404!==t.statusCode)this._setReadableStream(t);else{const t=new n.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=t}};this._request=null;"http:"===this._url.protocol?this._request=r.request(createRequestOptions(this._url,this._httpHeaders),handleResponse):this._request=o.request(createRequestOptions(this._url,this._httpHeaders),handleResponse);this._request.on("error",(t=>{this._storedError=t}));this._request.end()}}class PDFNodeStreamFsFullReader extends BaseFullReader{constructor(t){super(t);let e=decodeURIComponent(this._url.path);c.test(this._url.href)&&(e=e.replace(/^\//,""));a.lstat(e,((t,s)=>{if(t){"ENOENT"===t.code&&(t=new n.MissingPDFException(`Missing PDF "${e}".`));this._storedError=t;this._headersCapability.reject(t)}else{this._contentLength=s.size;this._setReadableStream(a.createReadStream(e));this._headersCapability.resolve()}}))}}class PDFNodeStreamFsRangeReader extends BaseRangeReader{constructor(t,e,s){super(t);let n=decodeURIComponent(this._url.path);c.test(this._url.href)&&(n=n.replace(/^\//,""));this._setReadableStream(a.createReadStream(n,{start:e,end:s-1}))}}},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.createResponseStatusError=function createResponseStatusError(t,e){if(404===t||0===t&&e.startsWith("file:"))return new n.MissingPDFException('Missing PDF "'+e+'".');return new n.UnexpectedResponseException(`Unexpected server response (${t}) while retrieving PDF "${e}".`,t)};e.extractFilenameFromHeader=function extractFilenameFromHeader(t){const e=t("Content-Disposition");if(e){let t=(0,i.getFilenameFromContentDispositionHeader)(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch(t){}if((0,a.isPdfFile)(t))return t}return null};e.validateRangeRequestCapabilities=function validateRangeRequestCapabilities({getResponseHeader:t,isHttp:e,rangeChunkSize:s,disableRange:n}){const i={allowRangeRequests:!1,suggestedLength:void 0},a=parseInt(t("Content-Length"),10);if(!Number.isInteger(a))return i;i.suggestedLength=a;if(a<=2*s)return i;if(n||!e)return i;if("bytes"!==t("Accept-Ranges"))return i;if("identity"!==(t("Content-Encoding")||"identity"))return i;i.allowRangeRequests=!0;return i};e.validateResponseStatus=function validateResponseStatus(t){return 200===t||206===t};var n=s(1),i=s(23),a=s(6)},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.getFilenameFromContentDispositionHeader=function getFilenameFromContentDispositionHeader(t){let e=!0,s=toParamRegExp("filename\\*","i").exec(t);if(s){s=s[1];let t=rfc2616unquote(s);t=unescape(t);t=rfc5987decode(t);t=rfc2047decode(t);return fixupEncoding(t)}s=function rfc2231getparam(t){const e=[];let s;const n=toParamRegExp("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(s=n.exec(t));){let[,t,n,i]=s;t=parseInt(t,10);if(t in e){if(0===t)break}else e[t]=[n,i]}const i=[];for(let t=0;t<e.length&&t in e;++t){let[s,n]=e[t];n=rfc2616unquote(n);if(s){n=unescape(n);0===t&&(n=rfc5987decode(n))}i.push(n)}return i.join("")}(t);if(s){return fixupEncoding(rfc2047decode(s))}s=toParamRegExp("filename","i").exec(t);if(s){s=s[1];let t=rfc2616unquote(s);t=rfc2047decode(t);return fixupEncoding(t)}function toParamRegExp(t,e){return new RegExp("(?:^|;)\\s*"+t+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',e)}function textdecode(t,s){if(t){if(!/^[\x00-\xFF]+$/.test(s))return s;try{const i=new TextDecoder(t,{fatal:!0}),a=(0,n.stringToBytes)(s);s=i.decode(a);e=!1}catch(t){}}return s}function fixupEncoding(t){if(e&&/[\x80-\xff]/.test(t)){t=textdecode("utf-8",t);e&&(t=textdecode("iso-8859-1",t))}return t}function rfc2616unquote(t){if(t.startsWith('"')){const e=t.slice(1).split('\\"');for(let t=0;t<e.length;++t){const s=e[t].indexOf('"');if(-1!==s){e[t]=e[t].slice(0,s);e.length=t+1}e[t]=e[t].replace(/\\(.)/g,"$1")}t=e.join('"')}return t}function rfc5987decode(t){const e=t.indexOf("'");if(-1===e)return t;return textdecode(t.slice(0,e),t.slice(e+1).replace(/^[^']*'/,""))}function rfc2047decode(t){return!t.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(t)?t:t.replace(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,(function(t,e,s,n){if("q"===s||"Q"===s)return textdecode(e,n=(n=n.replace(/_/g," ")).replace(/=([0-9a-fA-F]{2})/g,(function(t,e){return String.fromCharCode(parseInt(e,16))})));try{n=atob(n)}catch(t){}return textdecode(e,n)}))}return""};var n=s(1)},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.PDFNetworkStream=void 0;var n=s(1),i=s(22);class NetworkManager{constructor(t,e={}){this.url=t;this.isHttp=/^https?:/i.test(t);this.httpHeaders=this.isHttp&&e.httpHeaders||Object.create(null);this.withCredentials=e.withCredentials||!1;this.getXhr=e.getXhr||function NetworkManager_getXhr(){return new XMLHttpRequest};this.currXhrId=0;this.pendingRequests=Object.create(null)}requestRange(t,e,s){const n={begin:t,end:e};for(const t in s)n[t]=s[t];return this.request(n)}requestFull(t){return this.request(t)}request(t){const e=this.getXhr(),s=this.currXhrId++,n=this.pendingRequests[s]={xhr:e};e.open("GET",this.url);e.withCredentials=this.withCredentials;for(const t in this.httpHeaders){const s=this.httpHeaders[t];void 0!==s&&e.setRequestHeader(t,s)}if(this.isHttp&&"begin"in t&&"end"in t){e.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`);n.expectedStatus=206}else n.expectedStatus=200;e.responseType="arraybuffer";t.onError&&(e.onerror=function(s){t.onError(e.status)});e.onreadystatechange=this.onStateChange.bind(this,s);e.onprogress=this.onProgress.bind(this,s);n.onHeadersReceived=t.onHeadersReceived;n.onDone=t.onDone;n.onError=t.onError;n.onProgress=t.onProgress;e.send(null);return s}onProgress(t,e){const s=this.pendingRequests[t];s&&s.onProgress?.(e)}onStateChange(t,e){const s=this.pendingRequests[t];if(!s)return;const i=s.xhr;if(i.readyState>=2&&s.onHeadersReceived){s.onHeadersReceived();delete s.onHeadersReceived}if(4!==i.readyState)return;if(!(t in this.pendingRequests))return;delete this.pendingRequests[t];if(0===i.status&&this.isHttp){s.onError?.(i.status);return}const a=i.status||200;if(!(200===a&&206===s.expectedStatus)&&a!==s.expectedStatus){s.onError?.(i.status);return}const r=function getArrayBuffer(t){const e=t.response;return"string"!=typeof e?e:(0,n.stringToBytes)(e).buffer}(i);if(206===a){const t=i.getResponseHeader("Content-Range"),e=/bytes (\d+)-(\d+)\/(\d+)/.exec(t);s.onDone({begin:parseInt(e[1],10),chunk:r})}else r?s.onDone({begin:0,chunk:r}):s.onError?.(i.status)}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){const e=this.pendingRequests[t].xhr;delete this.pendingRequests[t];e.abort()}}e.PDFNetworkStream=class PDFNetworkStream{constructor(t){this._source=t;this._manager=new NetworkManager(t.url,{httpHeaders:t.httpHeaders,withCredentials:t.withCredentials});this._rangeChunkSize=t.rangeChunkSize;this._fullRequestReader=null;this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){const e=this._rangeRequestReaders.indexOf(t);e>=0&&this._rangeRequestReaders.splice(e,1)}getFullReader(){(0,n.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once.");this._fullRequestReader=new PDFNetworkStreamFullRequestReader(this._manager,this._source);return this._fullRequestReader}getRangeReader(t,e){const s=new PDFNetworkStreamRangeRequestReader(this._manager,t,e);s.onClosed=this._onRangeRequestReaderClosed.bind(this);this._rangeRequestReaders.push(s);return s}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}};class PDFNetworkStreamFullRequestReader{constructor(t,e){this._manager=t;const s={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=e.url;this._fullRequestId=t.requestFull(s);this._headersReceivedCapability=(0,n.createPromiseCapability)();this._disableRange=e.disableRange||!1;this._contentLength=e.length;this._rangeChunkSize=e.rangeChunkSize;this._rangeChunkSize||this._disableRange||(this._disableRange=!0);this._isStreamingSupported=!1;this._isRangeSupported=!1;this._cachedChunks=[];this._requests=[];this._done=!1;this._storedError=void 0;this._filename=null;this.onProgress=null}_onHeadersReceived(){const t=this._fullRequestId,e=this._manager.getRequestXhr(t),getResponseHeader=t=>e.getResponseHeader(t),{allowRangeRequests:s,suggestedLength:n}=(0,i.validateRangeRequestCapabilities)({getResponseHeader:getResponseHeader,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});s&&(this._isRangeSupported=!0);this._contentLength=n||this._contentLength;this._filename=(0,i.extractFilenameFromHeader)(getResponseHeader);this._isRangeSupported&&this._manager.abortRequest(t);this._headersReceivedCapability.resolve()}_onDone(t){if(t)if(this._requests.length>0){this._requests.shift().resolve({value:t.chunk,done:!1})}else this._cachedChunks.push(t.chunk);this._done=!0;if(!(this._cachedChunks.length>0)){for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){this._storedError=(0,i.createResponseStatusError)(t,this._url);this._headersReceivedCapability.reject(this._storedError);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0;this._cachedChunks.length=0}_onProgress(t){this.onProgress?.({loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0){return{value:this._cachedChunks.shift(),done:!1}}if(this._done)return{value:void 0,done:!0};const t=(0,n.createPromiseCapability)();this._requests.push(t);return t.promise}cancel(t){this._done=!0;this._headersReceivedCapability.reject(t);for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0;this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId);this._fullRequestReader=null}}class PDFNetworkStreamRangeRequestReader{constructor(t,e,s){this._manager=t;const n={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url;this._requestId=t.requestRange(e,s,n);this._requests=[];this._queuedChunk=null;this._done=!1;this._storedError=void 0;this.onProgress=null;this.onClosed=null}_close(){this.onClosed?.(this)}_onDone(t){const e=t.chunk;if(this._requests.length>0){this._requests.shift().resolve({value:e,done:!1})}else this._queuedChunk=e;this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0;this._close()}_onError(t){this._storedError=(0,i.createResponseStatusError)(t,this._url);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0;this._queuedChunk=null}_onProgress(t){this.isStreamingSupported||this.onProgress?.({loaded:t.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){const t=this._queuedChunk;this._queuedChunk=null;return{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=(0,n.createPromiseCapability)();this._requests.push(t);return t.promise}cancel(t){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0;this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId);this._close()}}},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.PDFFetchStream=void 0;var n=s(1),i=s(22);function createFetchOptions(t,e,s){return{method:"GET",headers:t,signal:s.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function createHeaders(t){const e=new Headers;for(const s in t){const n=t[s];void 0!==n&&e.append(s,n)}return e}function getArrayBuffer(t){if(t instanceof Uint8Array)return t.buffer;if(t instanceof ArrayBuffer)return t;(0,n.warn)(`getArrayBuffer - unexpected data format: ${t}`);return new Uint8Array(t).buffer}e.PDFFetchStream=class PDFFetchStream{constructor(t){this.source=t;this.isHttp=/^https?:/i.test(t.url);this.httpHeaders=this.isHttp&&t.httpHeaders||{};this._fullRequestReader=null;this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){(0,n.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once.");this._fullRequestReader=new PDFFetchStreamReader(this);return this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const s=new PDFFetchStreamRangeReader(this,t,e);this._rangeRequestReaders.push(s);return s}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}};class PDFFetchStreamReader{constructor(t){this._stream=t;this._reader=null;this._loaded=0;this._filename=null;const e=t.source;this._withCredentials=e.withCredentials||!1;this._contentLength=e.length;this._headersCapability=(0,n.createPromiseCapability)();this._disableRange=e.disableRange||!1;this._rangeChunkSize=e.rangeChunkSize;this._rangeChunkSize||this._disableRange||(this._disableRange=!0);this._abortController=new AbortController;this._isStreamingSupported=!e.disableStream;this._isRangeSupported=!e.disableRange;this._headers=createHeaders(this._stream.httpHeaders);const s=e.url;fetch(s,createFetchOptions(this._headers,this._withCredentials,this._abortController)).then((t=>{if(!(0,i.validateResponseStatus)(t.status))throw(0,i.createResponseStatusError)(t.status,s);this._reader=t.body.getReader();this._headersCapability.resolve();const getResponseHeader=e=>t.headers.get(e),{allowRangeRequests:e,suggestedLength:a}=(0,i.validateRangeRequestCapabilities)({getResponseHeader:getResponseHeader,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=e;this._contentLength=a||this._contentLength;this._filename=(0,i.extractFilenameFromHeader)(getResponseHeader);!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new n.AbortException("Streaming is disabled."))})).catch(this._headersCapability.reject);this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;const{value:t,done:e}=await this._reader.read();if(e)return{value:t,done:e};this._loaded+=t.byteLength;this.onProgress?.({loaded:this._loaded,total:this._contentLength});return{value:getArrayBuffer(t),done:!1}}cancel(t){this._reader?.cancel(t);this._abortController.abort()}}class PDFFetchStreamRangeReader{constructor(t,e,s){this._stream=t;this._reader=null;this._loaded=0;const a=t.source;this._withCredentials=a.withCredentials||!1;this._readCapability=(0,n.createPromiseCapability)();this._isStreamingSupported=!a.disableStream;this._abortController=new AbortController;this._headers=createHeaders(this._stream.httpHeaders);this._headers.append("Range",`bytes=${e}-${s-1}`);const r=a.url;fetch(r,createFetchOptions(this._headers,this._withCredentials,this._abortController)).then((t=>{if(!(0,i.validateResponseStatus)(t.status))throw(0,i.createResponseStatusError)(t.status,r);this._readCapability.resolve();this._reader=t.body.getReader()})).catch(this._readCapability.reject);this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:t,done:e}=await this._reader.read();if(e)return{value:t,done:e};this._loaded+=t.byteLength;this.onProgress?.({loaded:this._loaded});return{value:getArrayBuffer(t),done:!1}}cancel(t){this._reader?.cancel(t);this._abortController.abort()}}},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.TextLayerRenderTask=void 0;e.renderTextLayer=function renderTextLayer(t){if(!t.textContentSource&&(t.textContent||t.textContentStream)){(0,i.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead.");t.textContentSource=t.textContent||t.textContentStream}const e=new TextLayerRenderTask(t);e._render();return e};e.updateTextLayer=function updateTextLayer({container:t,viewport:e,textDivs:s,textDivProperties:n,isOffscreenCanvasSupported:a,mustRotate:r=!0,mustRescale:o=!0}){r&&(0,i.setLayerDimensions)(t,{rotation:e.rotation});if(o){const t=getCtx(0,a),i={prevFontSize:null,prevFontFamily:null,div:null,scale:e.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:t};for(const t of s){i.properties=n.get(t);i.div=t;layout(i)}}};var n=s(1),i=s(6);const a=1e5,r=30,o=.8,l=new Map;function getCtx(t,e){let s;if(e&&n.FeatureTest.isOffscreenCanvasSupported)s=new OffscreenCanvas(t,t).getContext("2d",{alpha:!1});else{const e=document.createElement("canvas");e.width=e.height=t;s=e.getContext("2d",{alpha:!1})}return s}function appendText(t,e,s){const i=document.createElement("span"),a={angle:0,canvasWidth:0,hasText:""!==e.str,hasEOL:e.hasEOL,fontSize:0};t._textDivs.push(i);const c=n.Util.transform(t._transform,e.transform);let h=Math.atan2(c[1],c[0]);const d=s[e.fontName];d.vertical&&(h+=Math.PI/2);const u=Math.hypot(c[2],c[3]),p=u*function getAscent(t,e){const s=l.get(t);if(s)return s;const n=getCtx(r,e);n.font=`${r}px ${t}`;const i=n.measureText("");let a=i.fontBoundingBoxAscent,c=Math.abs(i.fontBoundingBoxDescent);if(a){const e=a/(a+c);l.set(t,e);n.canvas.width=n.canvas.height=0;return e}n.strokeStyle="red";n.clearRect(0,0,r,r);n.strokeText("g",0,0);let h=n.getImageData(0,0,r,r).data;c=0;for(let t=h.length-1-3;t>=0;t-=4)if(h[t]>0){c=Math.ceil(t/4/r);break}n.clearRect(0,0,r,r);n.strokeText("A",0,r);h=n.getImageData(0,0,r,r).data;a=0;for(let t=0,e=h.length;t<e;t+=4)if(h[t]>0){a=r-Math.floor(t/4/r);break}n.canvas.width=n.canvas.height=0;if(a){const e=a/(a+c);l.set(t,e);return e}l.set(t,o);return o}(d.fontFamily,t._isOffscreenCanvasSupported);let g,f;if(0===h){g=c[4];f=c[5]-p}else{g=c[4]+p*Math.sin(h);f=c[5]-p*Math.cos(h)}const m="calc(var(--scale-factor)*",b=i.style;if(t._container===t._rootContainer){b.left=`${(100*g/t._pageWidth).toFixed(2)}%`;b.top=`${(100*f/t._pageHeight).toFixed(2)}%`}else{b.left=`${m}${g.toFixed(2)}px)`;b.top=`${m}${f.toFixed(2)}px)`}b.fontSize=`${m}${u.toFixed(2)}px)`;b.fontFamily=d.fontFamily;a.fontSize=u;i.setAttribute("role","presentation");i.textContent=e.str;i.dir=e.dir;t._fontInspectorEnabled&&(i.dataset.fontName=e.fontName);0!==h&&(a.angle=h*(180/Math.PI));let A=!1;if(e.str.length>1)A=!0;else if(" "!==e.str&&e.transform[0]!==e.transform[3]){const t=Math.abs(e.transform[0]),s=Math.abs(e.transform[3]);t!==s&&Math.max(t,s)/Math.min(t,s)>1.5&&(A=!0)}A&&(a.canvasWidth=d.vertical?e.height:e.width);t._textDivProperties.set(i,a);t._isReadableStream&&t._layoutText(i)}function layout(t){const{div:e,scale:s,properties:n,ctx:i,prevFontSize:a,prevFontFamily:r}=t,{style:o}=e;let l="";if(0!==n.canvasWidth&&n.hasText){const{fontFamily:c}=o,{canvasWidth:h,fontSize:d}=n;if(a!==d||r!==c){i.font=`${d*s}px ${c}`;t.prevFontSize=d;t.prevFontFamily=c}const{width:u}=i.measureText(e.textContent);u>0&&(l=`scaleX(${h*s/u})`)}0!==n.angle&&(l=`rotate(${n.angle}deg) ${l}`);l.length>0&&(o.transform=l)}class TextLayerRenderTask{constructor({textContentSource:t,container:e,viewport:s,textDivs:a,textDivProperties:r,textContentItemsStr:o,isOffscreenCanvasSupported:l}){this._textContentSource=t;this._isReadableStream=t instanceof ReadableStream;this._container=this._rootContainer=e;this._textDivs=a||[];this._textContentItemsStr=o||[];this._isOffscreenCanvasSupported=l;this._fontInspectorEnabled=!!globalThis.FontInspector?.enabled;this._reader=null;this._textDivProperties=r||new WeakMap;this._canceled=!1;this._capability=(0,n.createPromiseCapability)();this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:s.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:getCtx(0,l)};const{pageWidth:c,pageHeight:h,pageX:d,pageY:u}=s.rawDims;this._transform=[1,0,0,-1,-d,u+h];this._pageWidth=c;this._pageHeight=h;(0,i.setLayerDimensions)(e,s);this._capability.promise.finally((()=>{this._layoutTextParams=null})).catch((()=>{}))}get promise(){return this._capability.promise}cancel(){this._canceled=!0;if(this._reader){this._reader.cancel(new n.AbortException("TextLayer task cancelled.")).catch((()=>{}));this._reader=null}this._capability.reject(new n.AbortException("TextLayer task cancelled."))}_processItems(t,e){for(const s of t)if(void 0!==s.str){this._textContentItemsStr.push(s.str);appendText(this,s,e)}else if("beginMarkedContentProps"===s.type||"beginMarkedContent"===s.type){const t=this._container;this._container=document.createElement("span");this._container.classList.add("markedContent");null!==s.id&&this._container.setAttribute("id",`${s.id}`);t.append(this._container)}else"endMarkedContent"===s.type&&(this._container=this._container.parentNode)}_layoutText(t){const e=this._layoutTextParams.properties=this._textDivProperties.get(t);this._layoutTextParams.div=t;layout(this._layoutTextParams);e.hasText&&this._container.append(t);if(e.hasEOL){const t=document.createElement("br");t.setAttribute("role","presentation");this._container.append(t)}}_render(){const t=(0,n.createPromiseCapability)();let e=Object.create(null);if(this._isReadableStream){const pump=()=>{this._reader.read().then((({value:s,done:n})=>{if(n)t.resolve();else{Object.assign(e,s.styles);this._processItems(s.items,e);pump()}}),t.reject)};this._reader=this._textContentSource.getReader();pump()}else{if(!this._textContentSource)throw new Error('No "textContentSource" parameter specified.');{const{items:e,styles:s}=this._textContentSource;this._processItems(e,s);t.resolve()}}t.promise.then((()=>{e=null;!function render(t){if(t._canceled)return;const e=t._textDivs,s=t._capability;if(e.length>a)s.resolve();else{if(!t._isReadableStream)for(const s of e)t._layoutText(s);s.resolve()}}(this)}),this._capability.reject)}}e.TextLayerRenderTask=TextLayerRenderTask},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.AnnotationEditorLayer=void 0;var n=s(1),i=s(5),a=s(28),r=s(29),o=s(6);class AnnotationEditorLayer{#At;#_t=!1;#vt=this.pointerup.bind(this);#yt=this.pointerdown.bind(this);#St=new Map;#xt=!1;#Et=!1;#Ct;static _initialized=!1;constructor(t){if(!AnnotationEditorLayer._initialized){AnnotationEditorLayer._initialized=!0;a.FreeTextEditor.initialize(t.l10n);r.InkEditor.initialize(t.l10n)}t.uiManager.registerEditorTypes([a.FreeTextEditor,r.InkEditor]);this.#Ct=t.uiManager;this.pageIndex=t.pageIndex;this.div=t.div;this.#At=t.accessibilityManager;this.#Ct.addLayer(this)}get isEmpty(){return 0===this.#St.size}updateToolbar(t){this.#Ct.updateToolbar(t)}updateMode(t=this.#Ct.getMode()){this.#Pt();if(t===n.AnnotationEditorType.INK){this.addInkEditorIfNeeded(!1);this.disableClick()}else this.enableClick();this.#Ct.unselectAll();if(t!==n.AnnotationEditorType.NONE){this.div.classList.toggle("freeTextEditing",t===n.AnnotationEditorType.FREETEXT);this.div.classList.toggle("inkEditing",t===n.AnnotationEditorType.INK);this.div.hidden=!1}}addInkEditorIfNeeded(t){if(!t&&this.#Ct.getMode()!==n.AnnotationEditorType.INK)return;if(!t)for(const t of this.#St.values())if(t.isEmpty()){t.setInBackground();return}this.#Tt({offsetX:0,offsetY:0}).setInBackground()}setEditingState(t){this.#Ct.setEditingState(t)}addCommands(t){this.#Ct.addCommands(t)}enable(){this.div.style.pointerEvents="auto";for(const t of this.#St.values())t.enableEditing()}disable(){this.div.style.pointerEvents="none";for(const t of this.#St.values())t.disableEditing();this.#Pt();this.isEmpty&&(this.div.hidden=!0)}setActiveEditor(t){this.#Ct.getActive()!==t&&this.#Ct.setActiveEditor(t)}enableClick(){this.div.addEventListener("pointerdown",this.#yt);this.div.addEventListener("pointerup",this.#vt)}disableClick(){this.div.removeEventListener("pointerdown",this.#yt);this.div.removeEventListener("pointerup",this.#vt)}attach(t){this.#St.set(t.id,t)}detach(t){this.#St.delete(t.id);this.#At?.removePointerInTextLayer(t.contentDiv)}remove(t){this.#Ct.removeEditor(t);this.detach(t);t.div.style.display="none";setTimeout((()=>{t.div.style.display="";t.div.remove();t.isAttachedToDOM=!1;document.activeElement===document.body&&this.#Ct.focusMainContainer()}),0);this.#Et||this.addInkEditorIfNeeded(!1)}#wt(t){if(t.parent!==this){this.attach(t);t.parent?.detach(t);t.setParent(this);if(t.div&&t.isAttachedToDOM){t.div.remove();this.div.append(t.div)}}}add(t){this.#wt(t);this.#Ct.addEditor(t);this.attach(t);if(!t.isAttachedToDOM){const e=t.render();this.div.append(e);t.isAttachedToDOM=!0}this.moveEditorInDOM(t);t.onceAdded();this.#Ct.addToAnnotationStorage(t)}moveEditorInDOM(t){this.#At?.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addOrRebuild(t){t.needsToBeRebuilt()?t.rebuild():this.add(t)}addANewEditor(t){this.addCommands({cmd:()=>{this.addOrRebuild(t)},undo:()=>{t.remove()},mustExec:!0})}addUndoableEditor(t){this.addCommands({cmd:()=>{this.addOrRebuild(t)},undo:()=>{t.remove()},mustExec:!1})}getNextId(){return this.#Ct.getId()}#kt(t){switch(this.#Ct.getMode()){case n.AnnotationEditorType.FREETEXT:return new a.FreeTextEditor(t);case n.AnnotationEditorType.INK:return new r.InkEditor(t)}return null}deserialize(t){switch(t.annotationType){case n.AnnotationEditorType.FREETEXT:return a.FreeTextEditor.deserialize(t,this,this.#Ct);case n.AnnotationEditorType.INK:return r.InkEditor.deserialize(t,this,this.#Ct)}return null}#Tt(t){const e=this.getNextId(),s=this.#kt({parent:this,id:e,x:t.offsetX,y:t.offsetY,uiManager:this.#Ct});s&&this.add(s);return s}setSelected(t){this.#Ct.setSelected(t)}toggleSelected(t){this.#Ct.toggleSelected(t)}isSelected(t){return this.#Ct.isSelected(t)}unselect(t){this.#Ct.unselect(t)}pointerup(t){const{isMac:e}=n.FeatureTest.platform;if(!(0!==t.button||t.ctrlKey&&e)&&t.target===this.div&&this.#xt){this.#xt=!1;this.#_t?this.#Tt(t):this.#_t=!0}}pointerdown(t){const{isMac:e}=n.FeatureTest.platform;if(0!==t.button||t.ctrlKey&&e)return;if(t.target!==this.div)return;this.#xt=!0;const s=this.#Ct.getActive();this.#_t=!s||s.isEmpty()}drop(t){const e=t.dataTransfer.getData("text/plain"),s=this.#Ct.getEditor(e);if(!s)return;t.preventDefault();t.dataTransfer.dropEffect="move";this.#wt(s);const n=this.div.getBoundingClientRect(),i=t.clientX-n.x,a=t.clientY-n.y;s.translate(i-s.startX,a-s.startY);this.moveEditorInDOM(s);s.div.focus()}dragover(t){t.preventDefault()}destroy(){this.#Ct.getActive()?.parent===this&&this.#Ct.setActiveEditor(null);for(const t of this.#St.values()){this.#At?.removePointerInTextLayer(t.contentDiv);t.setParent(null);t.isAttachedToDOM=!1;t.div.remove()}this.div=null;this.#St.clear();this.#Ct.removeLayer(this)}#Pt(){this.#Et=!0;for(const t of this.#St.values())t.isEmpty()&&t.remove();this.#Et=!1}render({viewport:t}){this.viewport=t;(0,o.setLayerDimensions)(this.div,t);(0,i.bindEvents)(this,this.div,["dragover","drop"]);for(const t of this.#Ct.getEditors(this.pageIndex))this.add(t);this.updateMode()}update({viewport:t}){this.#Ct.commitOrRemove();this.viewport=t;(0,o.setLayerDimensions)(this.div,{rotation:t.rotation});this.updateMode()}get pageDimensions(){const{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}}e.AnnotationEditorLayer=AnnotationEditorLayer},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.FreeTextEditor=void 0;var n=s(1),i=s(5),a=s(4);class FreeTextEditor extends a.AnnotationEditor{#Rt=this.editorDivBlur.bind(this);#Mt=this.editorDivFocus.bind(this);#Ft=this.editorDivInput.bind(this);#Dt=this.editorDivKeydown.bind(this);#It;#Ot="";#Lt=`${this.id}-editor`;#Nt=!1;#jt;static _freeTextDefaultContent="";static _l10nPromise;static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static _keyboardManager=new i.KeyboardManager([[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],FreeTextEditor.prototype.commitOrRemove]]);static _type="freetext";constructor(t){super({...t,name:"freeTextEditor"});this.#It=t.color||FreeTextEditor._defaultColor||a.AnnotationEditor._defaultLineColor;this.#jt=t.fontSize||FreeTextEditor._defaultFontSize}static initialize(t){this._l10nPromise=new Map(["free_text2_default_content","editor_free_text2_aria_label"].map((e=>[e,t.get(e)])));const e=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(e.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,e){switch(t){case n.AnnotationEditorParamsType.FREETEXT_SIZE:FreeTextEditor._defaultFontSize=e;break;case n.AnnotationEditorParamsType.FREETEXT_COLOR:FreeTextEditor._defaultColor=e}}updateParams(t,e){switch(t){case n.AnnotationEditorParamsType.FREETEXT_SIZE:this.#Ut(e);break;case n.AnnotationEditorParamsType.FREETEXT_COLOR:this.#Bt(e)}}static get defaultPropertiesToUpdate(){return[[n.AnnotationEditorParamsType.FREETEXT_SIZE,FreeTextEditor._defaultFontSize],[n.AnnotationEditorParamsType.FREETEXT_COLOR,FreeTextEditor._defaultColor||a.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[n.AnnotationEditorParamsType.FREETEXT_SIZE,this.#jt],[n.AnnotationEditorParamsType.FREETEXT_COLOR,this.#It]]}#Ut(t){const setFontsize=t=>{this.editorDiv.style.fontSize=`calc(${t}px * var(--scale-factor))`;this.translate(0,-(t-this.#jt)*this.parentScale);this.#jt=t;this.#qt()},e=this.#jt;this.addCommands({cmd:()=>{setFontsize(t)},undo:()=>{setFontsize(e)},mustExec:!0,type:n.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#Bt(t){const e=this.#It;this.addCommands({cmd:()=>{this.#It=this.editorDiv.style.color=t},undo:()=>{this.#It=this.editorDiv.style.color=e},mustExec:!0,type:n.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}getInitialTranslation(){const t=this.parentScale;return[-FreeTextEditor._internalPadding*t,-(FreeTextEditor._internalPadding+this.#jt)*t]}rebuild(){super.rebuild();null!==this.div&&(this.isAttachedToDOM||this.parent.add(this))}enableEditMode(){if(!this.isInEditMode()){this.parent.setEditingState(!1);this.parent.updateToolbar(n.AnnotationEditorType.FREETEXT);super.enableEditMode();this.overlayDiv.classList.remove("enabled");this.editorDiv.contentEditable=!0;this.div.draggable=!1;this.div.removeAttribute("aria-activedescendant");this.editorDiv.addEventListener("keydown",this.#Dt);this.editorDiv.addEventListener("focus",this.#Mt);this.editorDiv.addEventListener("blur",this.#Rt);this.editorDiv.addEventListener("input",this.#Ft)}}disableEditMode(){if(this.isInEditMode()){this.parent.setEditingState(!0);super.disableEditMode();this.overlayDiv.classList.add("enabled");this.editorDiv.contentEditable=!1;this.div.setAttribute("aria-activedescendant",this.#Lt);this.div.draggable=!0;this.editorDiv.removeEventListener("keydown",this.#Dt);this.editorDiv.removeEventListener("focus",this.#Mt);this.editorDiv.removeEventListener("blur",this.#Rt);this.editorDiv.removeEventListener("input",this.#Ft);this.div.focus({preventScroll:!0});this.isEditing=!1;this.parent.div.classList.add("freeTextEditing")}}focusin(t){super.focusin(t);t.target!==this.editorDiv&&this.editorDiv.focus()}onceAdded(){if(!this.width){this.enableEditMode();this.editorDiv.focus()}}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1;this.parent.setEditingState(!0);this.parent.div.classList.add("freeTextEditing");super.remove()}#Wt(){const t=this.editorDiv.getElementsByTagName("div");if(0===t.length)return this.editorDiv.innerText;const e=[];for(const s of t)e.push(s.innerText.replace(/\r\n?|\n/,""));return e.join("\n")}#qt(){const[t,e]=this.parentDimensions;let s;if(this.isAttachedToDOM)s=this.div.getBoundingClientRect();else{const{currentLayer:t,div:e}=this,n=e.style.display;e.style.display="hidden";t.div.append(this.div);s=e.getBoundingClientRect();e.remove();e.style.display=n}this.width=s.width/t;this.height=s.height/e}commit(){if(this.isInEditMode()){super.commit();if(!this.#Nt){this.#Nt=!0;this.parent.addUndoableEditor(this)}this.disableEditMode();this.#Ot=this.#Wt().trimEnd();this.#qt()}}shouldGetKeyboardEvents(){return this.isInEditMode()}dblclick(t){this.enableEditMode();this.editorDiv.focus()}keydown(t){if(t.target===this.div&&"Enter"===t.key){this.enableEditMode();this.editorDiv.focus()}}editorDivKeydown(t){FreeTextEditor._keyboardManager.exec(this,t)}editorDivFocus(t){this.isEditing=!0}editorDivBlur(t){this.isEditing=!1}editorDivInput(t){this.parent.div.classList.toggle("freeTextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment");this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox");this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let t,e;if(this.width){t=this.x;e=this.y}super.render();this.editorDiv=document.createElement("div");this.editorDiv.className="internal";this.editorDiv.setAttribute("id",this.#Lt);this.enableEditing();FreeTextEditor._l10nPromise.get("editor_free_text2_aria_label").then((t=>this.editorDiv?.setAttribute("aria-label",t)));FreeTextEditor._l10nPromise.get("free_text2_default_content").then((t=>this.editorDiv?.setAttribute("default-content",t)));this.editorDiv.contentEditable=!0;const{style:s}=this.editorDiv;s.fontSize=`calc(${this.#jt}px * var(--scale-factor))`;s.color=this.#It;this.div.append(this.editorDiv);this.overlayDiv=document.createElement("div");this.overlayDiv.classList.add("overlay","enabled");this.div.append(this.overlayDiv);(0,i.bindEvents)(this,this.div,["dblclick","keydown"]);if(this.width){const[s,n]=this.parentDimensions;this.setAt(t*s,e*n,this.width*s,this.height*n);for(const t of this.#Ot.split("\n")){const e=document.createElement("div");e.append(t?document.createTextNode(t):document.createElement("br"));this.editorDiv.append(e)}this.div.draggable=!0;this.editorDiv.contentEditable=!1}else{this.div.draggable=!1;this.editorDiv.contentEditable=!0}return this.div}get contentDiv(){return this.editorDiv}static deserialize(t,e,s){const i=super.deserialize(t,e,s);i.#jt=t.fontSize;i.#It=n.Util.makeHexColor(...t.color);i.#Ot=t.value;return i}serialize(){if(this.isEmpty())return null;const t=FreeTextEditor._internalPadding*this.parentScale,e=this.getRect(t,t),s=a.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.#It);return{annotationType:n.AnnotationEditorType.FREETEXT,color:s,fontSize:this.#jt,value:this.#Ot,pageIndex:this.pageIndex,rect:e,rotation:this.rotation}}}e.FreeTextEditor=FreeTextEditor},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.InkEditor=void 0;Object.defineProperty(e,"fitCurve",{enumerable:!0,get:function(){return a.fitCurve}});var n=s(1),i=s(4),a=s(30),r=s(5);const o=16;class InkEditor extends i.AnnotationEditor{#Ht=0;#Gt=0;#zt=0;#Vt=this.canvasPointermove.bind(this);#Xt=this.canvasPointerleave.bind(this);#$t=this.canvasPointerup.bind(this);#Yt=this.canvasPointerdown.bind(this);#Kt=!1;#Jt=!1;#Qt=null;#Zt=null;#te=0;#ee=0;#se=null;static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=1;static _l10nPromise;static _type="ink";constructor(t){super({...t,name:"inkEditor"});this.color=t.color||null;this.thickness=t.thickness||null;this.opacity=t.opacity||null;this.paths=[];this.bezierPath2D=[];this.currentPath=[];this.scaleFactor=1;this.translationX=this.translationY=0;this.x=0;this.y=0}static initialize(t){this._l10nPromise=new Map(["editor_ink_canvas_aria_label","editor_ink2_aria_label"].map((e=>[e,t.get(e)])))}static updateDefaultParams(t,e){switch(t){case n.AnnotationEditorParamsType.INK_THICKNESS:InkEditor._defaultThickness=e;break;case n.AnnotationEditorParamsType.INK_COLOR:InkEditor._defaultColor=e;break;case n.AnnotationEditorParamsType.INK_OPACITY:InkEditor._defaultOpacity=e/100}}updateParams(t,e){switch(t){case n.AnnotationEditorParamsType.INK_THICKNESS:this.#ne(e);break;case n.AnnotationEditorParamsType.INK_COLOR:this.#Bt(e);break;case n.AnnotationEditorParamsType.INK_OPACITY:this.#ie(e)}}static get defaultPropertiesToUpdate(){return[[n.AnnotationEditorParamsType.INK_THICKNESS,InkEditor._defaultThickness],[n.AnnotationEditorParamsType.INK_COLOR,InkEditor._defaultColor||i.AnnotationEditor._defaultLineColor],[n.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*InkEditor._defaultOpacity)]]}get propertiesToUpdate(){return[[n.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||InkEditor._defaultThickness],[n.AnnotationEditorParamsType.INK_COLOR,this.color||InkEditor._defaultColor||i.AnnotationEditor._defaultLineColor],[n.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(this.opacity??InkEditor._defaultOpacity))]]}#ne(t){const e=this.thickness;this.addCommands({cmd:()=>{this.thickness=t;this.#ae()},undo:()=>{this.thickness=e;this.#ae()},mustExec:!0,type:n.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}#Bt(t){const e=this.color;this.addCommands({cmd:()=>{this.color=t;this.#re()},undo:()=>{this.color=e;this.#re()},mustExec:!0,type:n.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}#ie(t){t/=100;const e=this.opacity;this.addCommands({cmd:()=>{this.opacity=t;this.#re()},undo:()=>{this.opacity=e;this.#re()},mustExec:!0,type:n.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}rebuild(){super.rebuild();if(null!==this.div){if(!this.canvas){this.#oe();this.#le()}if(!this.isAttachedToDOM){this.parent.add(this);this.#ce()}this.#ae()}}remove(){if(null!==this.canvas){this.isEmpty()||this.commit();this.canvas.width=this.canvas.height=0;this.canvas.remove();this.canvas=null;this.#Zt.disconnect();this.#Zt=null;super.remove()}}setParent(t){!this.parent&&t?this._uiManager.removeShouldRescale(this):this.parent&&null===t&&this._uiManager.addShouldRescale(this);super.setParent(t)}onScaleChanging(){const[t,e]=this.parentDimensions,s=this.width*t,n=this.height*e;this.setDimensions(s,n)}enableEditMode(){if(!this.#Kt&&null!==this.canvas){super.enableEditMode();this.div.draggable=!1;this.canvas.addEventListener("pointerdown",this.#Yt);this.canvas.addEventListener("pointerup",this.#$t)}}disableEditMode(){if(this.isInEditMode()&&null!==this.canvas){super.disableEditMode();this.div.draggable=!this.isEmpty();this.div.classList.remove("editing");this.canvas.removeEventListener("pointerdown",this.#Yt);this.canvas.removeEventListener("pointerup",this.#$t)}}onceAdded(){this.div.draggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}#he(){const{parentRotation:t,parentDimensions:[e,s]}=this;switch(t){case 90:return[0,s,s,e];case 180:return[e,s,e,s];case 270:return[e,0,s,e];default:return[0,0,e,s]}}#de(){const{ctx:t,color:e,opacity:s,thickness:n,parentScale:i,scaleFactor:a}=this;t.lineWidth=n*i/a;t.lineCap="round";t.lineJoin="round";t.miterLimit=10;t.strokeStyle=`${e}${(0,r.opacityToHex)(s)}`}#ue(t,e){this.isEditing=!0;if(!this.#Jt){this.#Jt=!0;this.#ce();this.thickness||=InkEditor._defaultThickness;this.color||=InkEditor._defaultColor||i.AnnotationEditor._defaultLineColor;this.opacity??=InkEditor._defaultOpacity}this.currentPath.push([t,e]);this.#Qt=null;this.#de();this.ctx.beginPath();this.ctx.moveTo(t,e);this.#se=()=>{if(this.#se){if(this.#Qt){if(this.isEmpty()){this.ctx.setTransform(1,0,0,1,0,0);this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height)}else this.#re();this.ctx.lineTo(...this.#Qt);this.#Qt=null;this.ctx.stroke()}window.requestAnimationFrame(this.#se)}};window.requestAnimationFrame(this.#se)}#pe(t,e){const[s,n]=this.currentPath.at(-1);if(t!==s||e!==n){this.currentPath.push([t,e]);this.#Qt=[t,e]}}#ge(t,e){this.ctx.closePath();this.#se=null;t=Math.min(Math.max(t,0),this.canvas.width);e=Math.min(Math.max(e,0),this.canvas.height);const[s,n]=this.currentPath.at(-1);t===s&&e===n||this.currentPath.push([t,e]);let i;if(1!==this.currentPath.length)i=(0,a.fitCurve)(this.currentPath,30,null);else{const s=[t,e];i=[[s,s.slice(),s.slice(),s]]}const r=InkEditor.#fe(i);this.currentPath.length=0;this.addCommands({cmd:()=>{this.paths.push(i);this.bezierPath2D.push(r);this.rebuild()},undo:()=>{this.paths.pop();this.bezierPath2D.pop();if(0===this.paths.length)this.remove();else{if(!this.canvas){this.#oe();this.#le()}this.#ae()}},mustExec:!0})}#re(){if(this.isEmpty()){this.#me();return}this.#de();const{canvas:t,ctx:e}=this;e.setTransform(1,0,0,1,0,0);e.clearRect(0,0,t.width,t.height);this.#me();for(const t of this.bezierPath2D)e.stroke(t)}commit(){if(!this.#Kt){super.commit();this.isEditing=!1;this.disableEditMode();this.setInForeground();this.#Kt=!0;this.div.classList.add("disabled");this.#ae(!0);this.parent.addInkEditorIfNeeded(!0);this.parent.moveEditorInDOM(this);this.div.focus({preventScroll:!0})}}focusin(t){super.focusin(t);this.enableEditMode()}canvasPointerdown(t){if(0===t.button&&this.isInEditMode()&&!this.#Kt){this.setInForeground();"mouse"!==t.type&&this.div.focus();t.stopPropagation();this.canvas.addEventListener("pointerleave",this.#Xt);this.canvas.addEventListener("pointermove",this.#Vt);this.#ue(t.offsetX,t.offsetY)}}canvasPointermove(t){t.stopPropagation();this.#pe(t.offsetX,t.offsetY)}canvasPointerup(t){if(0===t.button&&this.isInEditMode()&&0!==this.currentPath.length){t.stopPropagation();this.#be(t);this.setInBackground()}}canvasPointerleave(t){this.#be(t);this.setInBackground()}#be(t){this.#ge(t.offsetX,t.offsetY);this.canvas.removeEventListener("pointerleave",this.#Xt);this.canvas.removeEventListener("pointermove",this.#Vt);this.addToAnnotationStorage()}#oe(){this.canvas=document.createElement("canvas");this.canvas.width=this.canvas.height=0;this.canvas.className="inkEditorCanvas";InkEditor._l10nPromise.get("editor_ink_canvas_aria_label").then((t=>this.canvas?.setAttribute("aria-label",t)));this.div.append(this.canvas);this.ctx=this.canvas.getContext("2d")}#le(){let t=null;this.#Zt=new ResizeObserver((e=>{const s=e[0].contentRect;if(s.width&&s.height){null!==t&&clearTimeout(t);t=setTimeout((()=>{this.fixDims();t=null}),100);this.setDimensions(s.width,s.height)}}));this.#Zt.observe(this.div)}render(){if(this.div)return this.div;let t,e;if(this.width){t=this.x;e=this.y}super.render();InkEditor._l10nPromise.get("editor_ink2_aria_label").then((t=>this.div?.setAttribute("aria-label",t)));const[s,n,i,a]=this.#he();this.setAt(s,n,0,0);this.setDims(i,a);this.#oe();if(this.width){const[s,n]=this.parentDimensions;this.setAt(t*s,e*n,this.width*s,this.height*n);this.#Jt=!0;this.#ce();this.setDims(this.width*s,this.height*n);this.#re();this.#Ae();this.div.classList.add("disabled")}else{this.div.classList.add("editing");this.enableEditMode()}this.#le();return this.div}#ce(){if(!this.#Jt)return;const[t,e]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*t);this.canvas.height=Math.ceil(this.height*e);this.#me()}setDimensions(t,e){const s=Math.round(t),n=Math.round(e);if(this.#te===s&&this.#ee===n)return;this.#te=s;this.#ee=n;this.canvas.style.visibility="hidden";if(this.#Ht&&Math.abs(this.#Ht-t/e)>.01){e=Math.ceil(t/this.#Ht);this.setDims(t,e)}const[i,a]=this.parentDimensions;this.width=t/i;this.height=e/a;this.#Kt&&this.#_e(t,e);this.#ce();this.#re();this.canvas.style.visibility="visible"}#_e(t,e){const s=this.#ve(),n=(t-s)/this.#zt,i=(e-s)/this.#Gt;this.scaleFactor=Math.min(n,i)}#me(){const t=this.#ve()/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+t,this.translationY*this.scaleFactor+t)}static#fe(t){const e=new Path2D;for(let s=0,n=t.length;s<n;s++){const[n,i,a,r]=t[s];0===s&&e.moveTo(...n);e.bezierCurveTo(i[0],i[1],a[0],a[1],r[0],r[1])}return e}#ye(t,e,s,n){const i=[],a=this.thickness/2;let r,o;for(const l of this.paths){r=[];o=[];for(let i=0,c=l.length;i<c;i++){const[c,h,d,u]=l[i],p=t*(c[0]+e)+a,g=n-t*(c[1]+s)-a,f=t*(h[0]+e)+a,m=n-t*(h[1]+s)-a,b=t*(d[0]+e)+a,A=n-t*(d[1]+s)-a,_=t*(u[0]+e)+a,v=n-t*(u[1]+s)-a;if(0===i){r.push(p,g);o.push(p,g)}r.push(f,m,b,A,_,v);this.#Se(p,g,f,m,b,A,_,v,4,o)}i.push({bezier:r,points:o})}return i}#Se(t,e,s,n,i,a,r,o,l,c){if(this.#xe(t,e,s,n,i,a,r,o))c.push(r,o);else{for(let h=1;h<l-1;h++){const d=h/l,u=1-d;let p=d*t+u*s,g=d*e+u*n,f=d*s+u*i,m=d*n+u*a;p=d*p+u*f;g=d*g+u*m;f=d*f+u*(d*i+u*r);m=d*m+u*(d*a+u*o);p=d*p+u*f;g=d*g+u*m;c.push(p,g)}c.push(r,o)}}#xe(t,e,s,n,i,a,r,o){const l=(3*s-2*t-r)**2,c=(3*n-2*e-o)**2,h=(3*i-t-2*r)**2,d=(3*a-e-2*o)**2;return Math.max(l,h)+Math.max(c,d)<=10}#Ee(){let t=1/0,e=-1/0,s=1/0,i=-1/0;for(const a of this.paths)for(const[r,o,l,c]of a){const a=n.Util.bezierBoundingBox(...r,...o,...l,...c);t=Math.min(t,a[0]);s=Math.min(s,a[1]);e=Math.max(e,a[2]);i=Math.max(i,a[3])}return[t,s,e,i]}#ve(){return this.#Kt?Math.ceil(this.thickness*this.parentScale):0}#ae(t=!1){if(this.isEmpty())return;if(!this.#Kt){this.#re();return}const e=this.#Ee(),s=this.#ve();this.#zt=Math.max(o,e[2]-e[0]);this.#Gt=Math.max(o,e[3]-e[1]);const n=Math.ceil(s+this.#zt*this.scaleFactor),i=Math.ceil(s+this.#Gt*this.scaleFactor),[a,r]=this.parentDimensions;this.width=n/a;this.height=i/r;this.#Ht=n/i;this.#Ae();const l=this.translationX,c=this.translationY;this.translationX=-e[0];this.translationY=-e[1];this.#ce();this.#re();this.#te=n;this.#ee=i;this.setDims(n,i);const h=t?s/this.scaleFactor/2:0;this.translate(l-this.translationX-h,c-this.translationY-h)}#Ae(){const{style:t}=this.div;if(this.#Ht>=1){t.minHeight="16px";t.minWidth=`${Math.round(this.#Ht*o)}px`}else{t.minWidth="16px";t.minHeight=`${Math.round(o/this.#Ht)}px`}}static deserialize(t,e,s){const i=super.deserialize(t,e,s);i.thickness=t.thickness;i.color=n.Util.makeHexColor(...t.color);i.opacity=t.opacity;const[a,r]=i.pageDimensions,l=i.width*a,c=i.height*r,h=i.parentScale,d=t.thickness/2;i.#Ht=l/c;i.#Kt=!0;i.#te=Math.round(l);i.#ee=Math.round(c);for(const{bezier:e}of t.paths){const t=[];i.paths.push(t);let s=h*(e[0]-d),n=h*(c-e[1]-d);for(let i=2,a=e.length;i<a;i+=6){const a=h*(e[i]-d),r=h*(c-e[i+1]-d),o=h*(e[i+2]-d),l=h*(c-e[i+3]-d),u=h*(e[i+4]-d),p=h*(c-e[i+5]-d);t.push([[s,n],[a,r],[o,l],[u,p]]);s=u;n=p}const a=this.#fe(t);i.bezierPath2D.push(a)}const u=i.#Ee();i.#zt=Math.max(o,u[2]-u[0]);i.#Gt=Math.max(o,u[3]-u[1]);i.#_e(l,c);return i}serialize(){if(this.isEmpty())return null;const t=this.getRect(0,0),e=this.rotation%180==0?t[3]-t[1]:t[2]-t[0],s=i.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);return{annotationType:n.AnnotationEditorType.INK,color:s,thickness:this.thickness,opacity:this.opacity,paths:this.#ye(this.scaleFactor/this.parentScale,this.translationX,this.translationY,e),pageIndex:this.pageIndex,rect:t,rotation:this.rotation}}}e.InkEditor=InkEditor},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.fitCurve=void 0;const n=s(31);e.fitCurve=n},t=>{function fitCubic(t,e,s,n,i){var a,r,o,l,c,h,d,u,p,g,f,m,b;if(2===t.length){m=maths.vectorLen(maths.subtract(t[0],t[1]))/3;return[a=[t[0],maths.addArrays(t[0],maths.mulItems(e,m)),maths.addArrays(t[1],maths.mulItems(s,m)),t[1]]]}r=function chordLengthParameterize(t){var e,s,n,i=[];t.forEach(((t,a)=>{e=a?s+maths.vectorLen(maths.subtract(t,n)):0;i.push(e);s=e;n=t}));i=i.map((t=>t/s));return i}(t);[a,l,h]=generateAndReport(t,r,r,e,s,i);if(0===l||l<n)return[a];if(l<n*n){o=r;c=l;d=h;for(b=0;b<20;b++){o=reparameterize(a,t,o);[a,l,h]=generateAndReport(t,r,o,e,s,i);if(l<n)return[a];if(h===d){let t=l/c;if(t>.9999&&t<1.0001)break}c=l;d=h}}f=[];if((u=maths.subtract(t[h-1],t[h+1])).every((t=>0===t))){u=maths.subtract(t[h-1],t[h]);[u[0],u[1]]=[-u[1],u[0]]}p=maths.normalize(u);g=maths.mulItems(p,-1);return f=(f=f.concat(fitCubic(t.slice(0,h+1),e,p,n,i))).concat(fitCubic(t.slice(h),g,s,n,i))}function generateAndReport(t,e,s,n,i,a){var r,o,l;r=function generateBezier(t,e,s,n){var i,a,r,o,l,c,h,d,u,p,g,f,m,b,A,_,v,y=t[0],S=t[t.length-1];i=[y,null,null,S];a=maths.zeros_Xx2x2(e.length);for(m=0,b=e.length;m<b;m++){v=1-(_=e[m]);(r=a[m])[0]=maths.mulItems(s,3*_*(v*v));r[1]=maths.mulItems(n,3*v*(_*_))}o=[[0,0],[0,0]];l=[0,0];for(m=0,b=t.length;m<b;m++){_=e[m];r=a[m];o[0][0]+=maths.dot(r[0],r[0]);o[0][1]+=maths.dot(r[0],r[1]);o[1][0]+=maths.dot(r[0],r[1]);o[1][1]+=maths.dot(r[1],r[1]);A=maths.subtract(t[m],bezier.q([y,y,S,S],_));l[0]+=maths.dot(r[0],A);l[1]+=maths.dot(r[1],A)}c=o[0][0]*o[1][1]-o[1][0]*o[0][1];h=o[0][0]*l[1]-o[1][0]*l[0];d=l[0]*o[1][1]-l[1]*o[0][1];u=0===c?0:d/c;p=0===c?0:h/c;f=maths.vectorLen(maths.subtract(y,S));if(u<(g=1e-6*f)||p<g){i[1]=maths.addArrays(y,maths.mulItems(s,f/3));i[2]=maths.addArrays(S,maths.mulItems(n,f/3))}else{i[1]=maths.addArrays(y,maths.mulItems(s,u));i[2]=maths.addArrays(S,maths.mulItems(n,p))}return i}(t,s,n,i);[o,l]=function computeMaxError(t,e,s){var n,i,a,r,o,l,c,h;i=0;a=Math.floor(t.length/2);const d=mapTtoRelativeDistances(e,10);for(o=0,l=t.length;o<l;o++){c=t[o];h=find_t(e,s[o],d,10);if((n=(r=maths.subtract(bezier.q(e,h),c))[0]*r[0]+r[1]*r[1])>i){i=n;a=o}}return[i,a]}(t,r,e);a&&a({bez:r,points:t,params:e,maxErr:o,maxPoint:l});return[r,o,l]}function reparameterize(t,e,s){return s.map(((s,n)=>newtonRaphsonRootFind(t,e[n],s)))}function newtonRaphsonRootFind(t,e,s){var n=maths.subtract(bezier.q(t,s),e),i=bezier.qprime(t,s),a=maths.mulMatrix(n,i),r=maths.sum(maths.squareItems(i))+2*maths.mulMatrix(n,bezier.qprimeprime(t,s));return 0===r?s:s-a/r}var mapTtoRelativeDistances=function(t,e){for(var s,n=[0],i=t[0],a=0,r=1;r<=e;r++){s=bezier.q(t,r/e);a+=maths.vectorLen(maths.subtract(s,i));n.push(a);i=s}return n=n.map((t=>t/a))};function find_t(t,e,s,n){if(e<0)return 0;if(e>1)return 1;for(var i,a,r,o,l=1;l<=n;l++)if(e<=s[l]){r=(l-1)/n;a=l/n;o=(e-(i=s[l-1]))/(s[l]-i)*(a-r)+r;break}return o}function createTangent(t,e){return maths.normalize(maths.subtract(t,e))}class maths{static zeros_Xx2x2(t){for(var e=[];t--;)e.push([0,0]);return e}static mulItems(t,e){return t.map((t=>t*e))}static mulMatrix(t,e){return t.reduce(((t,s,n)=>t+s*e[n]),0)}static subtract(t,e){return t.map(((t,s)=>t-e[s]))}static addArrays(t,e){return t.map(((t,s)=>t+e[s]))}static addItems(t,e){return t.map((t=>t+e))}static sum(t){return t.reduce(((t,e)=>t+e))}static dot(t,e){return maths.mulMatrix(t,e)}static vectorLen(t){return Math.hypot(...t)}static divItems(t,e){return t.map((t=>t/e))}static squareItems(t){return t.map((t=>t*t))}static normalize(t){return this.divItems(t,this.vectorLen(t))}}class bezier{static q(t,e){var s=1-e,n=maths.mulItems(t[0],s*s*s),i=maths.mulItems(t[1],3*s*s*e),a=maths.mulItems(t[2],3*s*e*e),r=maths.mulItems(t[3],e*e*e);return maths.addArrays(maths.addArrays(n,i),maths.addArrays(a,r))}static qprime(t,e){var s=1-e,n=maths.mulItems(maths.subtract(t[1],t[0]),3*s*s),i=maths.mulItems(maths.subtract(t[2],t[1]),6*s*e),a=maths.mulItems(maths.subtract(t[3],t[2]),3*e*e);return maths.addArrays(maths.addArrays(n,i),a)}static qprimeprime(t,e){return maths.addArrays(maths.mulItems(maths.addArrays(maths.subtract(t[2],maths.mulItems(t[1],2)),t[0]),6*(1-e)),maths.mulItems(maths.addArrays(maths.subtract(t[3],maths.mulItems(t[2],2)),t[1]),6*e))}}t.exports=function fitCurve(t,e,s){if(!Array.isArray(t))throw new TypeError("First argument should be an array");t.forEach((e=>{if(!Array.isArray(e)||e.some((t=>"number"!=typeof t))||e.length!==t[0].length)throw Error("Each point should be an array of numbers. Each point should have the same amount of numbers.")}));if((t=t.filter(((e,s)=>0===s||!e.every(((e,n)=>e===t[s-1][n]))))).length<2)return[];const n=t.length,i=createTangent(t[1],t[0]),a=createTangent(t[n-2],t[n-1]);return fitCubic(t,i,a,e,s)};t.exports.fitCubic=fitCubic;t.exports.createTangent=createTangent},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.AnnotationLayer=void 0;var n=s(1),i=s(6),a=s(3),r=s(33),o=s(34);const l=1e3,c=new WeakSet;function getRectDims(t){return{width:t[2]-t[0],height:t[3]-t[1]}}class AnnotationElementFactory{static create(t){switch(t.data.annotationType){case n.AnnotationType.LINK:return new LinkAnnotationElement(t);case n.AnnotationType.TEXT:return new TextAnnotationElement(t);case n.AnnotationType.WIDGET:switch(t.data.fieldType){case"Tx":return new TextWidgetAnnotationElement(t);case"Btn":return t.data.radioButton?new RadioButtonWidgetAnnotationElement(t):t.data.checkBox?new CheckboxWidgetAnnotationElement(t):new PushButtonWidgetAnnotationElement(t);case"Ch":return new ChoiceWidgetAnnotationElement(t)}return new WidgetAnnotationElement(t);case n.AnnotationType.POPUP:return new PopupAnnotationElement(t);case n.AnnotationType.FREETEXT:return new FreeTextAnnotationElement(t);case n.AnnotationType.LINE:return new LineAnnotationElement(t);case n.AnnotationType.SQUARE:return new SquareAnnotationElement(t);case n.AnnotationType.CIRCLE:return new CircleAnnotationElement(t);case n.AnnotationType.POLYLINE:return new PolylineAnnotationElement(t);case n.AnnotationType.CARET:return new CaretAnnotationElement(t);case n.AnnotationType.INK:return new InkAnnotationElement(t);case n.AnnotationType.POLYGON:return new PolygonAnnotationElement(t);case n.AnnotationType.HIGHLIGHT:return new HighlightAnnotationElement(t);case n.AnnotationType.UNDERLINE:return new UnderlineAnnotationElement(t);case n.AnnotationType.SQUIGGLY:return new SquigglyAnnotationElement(t);case n.AnnotationType.STRIKEOUT:return new StrikeOutAnnotationElement(t);case n.AnnotationType.STAMP:return new StampAnnotationElement(t);case n.AnnotationType.FILEATTACHMENT:return new FileAttachmentAnnotationElement(t);default:return new AnnotationElement(t)}}}class AnnotationElement{constructor(t,{isRenderable:e=!1,ignoreBorder:s=!1,createQuadrilaterals:n=!1}={}){this.isRenderable=e;this.data=t.data;this.layer=t.layer;this.page=t.page;this.viewport=t.viewport;this.linkService=t.linkService;this.downloadManager=t.downloadManager;this.imageResourcesPath=t.imageResourcesPath;this.renderForms=t.renderForms;this.svgFactory=t.svgFactory;this.annotationStorage=t.annotationStorage;this.enableScripting=t.enableScripting;this.hasJSActions=t.hasJSActions;this._fieldObjects=t.fieldObjects;e&&(this.container=this._createContainer(s));n&&(this.quadrilaterals=this._createQuadrilaterals(s))}_createContainer(t=!1){const{data:e,page:s,viewport:i}=this,a=document.createElement("section");a.setAttribute("data-annotation-id",e.id);const{pageWidth:r,pageHeight:o,pageX:l,pageY:c}=i.rawDims,{width:h,height:d}=getRectDims(e.rect),u=n.Util.normalizeRect([e.rect[0],s.view[3]-e.rect[1]+s.view[1],e.rect[2],s.view[3]-e.rect[3]+s.view[1]]);if(!t&&e.borderStyle.width>0){a.style.borderWidth=`${e.borderStyle.width}px`;const t=e.borderStyle.horizontalCornerRadius,s=e.borderStyle.verticalCornerRadius;if(t>0||s>0){const e=`calc(${t}px * var(--scale-factor)) / calc(${s}px * var(--scale-factor))`;a.style.borderRadius=e}else if(this instanceof RadioButtonWidgetAnnotationElement){const t=`calc(${h}px * var(--scale-factor)) / calc(${d}px * var(--scale-factor))`;a.style.borderRadius=t}switch(e.borderStyle.style){case n.AnnotationBorderStyleType.SOLID:a.style.borderStyle="solid";break;case n.AnnotationBorderStyleType.DASHED:a.style.borderStyle="dashed";break;case n.AnnotationBorderStyleType.BEVELED:(0,n.warn)("Unimplemented border style: beveled");break;case n.AnnotationBorderStyleType.INSET:(0,n.warn)("Unimplemented border style: inset");break;case n.AnnotationBorderStyleType.UNDERLINE:a.style.borderBottomStyle="solid"}const i=e.borderColor||null;i?a.style.borderColor=n.Util.makeHexColor(0|i[0],0|i[1],0|i[2]):a.style.borderWidth=0}a.style.left=100*(u[0]-l)/r+"%";a.style.top=100*(u[1]-c)/o+"%";const{rotation:p}=e;if(e.hasOwnCanvas||0===p){a.style.width=100*h/r+"%";a.style.height=100*d/o+"%"}else this.setRotation(p,a);return a}setRotation(t,e=this.container){const{pageWidth:s,pageHeight:n}=this.viewport.rawDims,{width:i,height:a}=getRectDims(this.data.rect);let r,o;if(t%180==0){r=100*i/s;o=100*a/n}else{r=100*a/s;o=100*i/n}e.style.width=`${r}%`;e.style.height=`${o}%`;e.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const setColor=(t,e,s)=>{const n=s.detail[t];s.target.style[e]=r.ColorConverters[`${n[0]}_HTML`](n.slice(1))};return(0,n.shadow)(this,"_commonActions",{display:t=>{const e=t.detail.display%2==1;this.container.style.visibility=e?"hidden":"visible";this.annotationStorage.setValue(this.data.id,{hidden:e,print:0===t.detail.display||3===t.detail.display})},print:t=>{this.annotationStorage.setValue(this.data.id,{print:t.detail.print})},hidden:t=>{this.container.style.visibility=t.detail.hidden?"hidden":"visible";this.annotationStorage.setValue(this.data.id,{hidden:t.detail.hidden})},focus:t=>{setTimeout((()=>t.target.focus({preventScroll:!1})),0)},userName:t=>{t.target.title=t.detail.userName},readonly:t=>{t.detail.readonly?t.target.setAttribute("readonly",""):t.target.removeAttribute("readonly")},required:t=>{this._setRequired(t.target,t.detail.required)},bgColor:t=>{setColor("bgColor","backgroundColor",t)},fillColor:t=>{setColor("fillColor","backgroundColor",t)},fgColor:t=>{setColor("fgColor","color",t)},textColor:t=>{setColor("textColor","color",t)},borderColor:t=>{setColor("borderColor","borderColor",t)},strokeColor:t=>{setColor("strokeColor","borderColor",t)},rotation:t=>{const e=t.detail.rotation;this.setRotation(e);this.annotationStorage.setValue(this.data.id,{rotation:e})}})}_dispatchEventFromSandbox(t,e){const s=this._commonActions;for(const n of Object.keys(e.detail)){(t[n]||s[n])?.(e)}}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const e=this.annotationStorage.getRawValue(this.data.id);if(!e)return;const s=this._commonActions;for(const[n,i]of Object.entries(e)){const a=s[n];if(a){a({detail:{[n]:i},target:t});delete e[n]}}}_createQuadrilaterals(t=!1){if(!this.data.quadPoints)return null;const e=[],s=this.data.rect;for(const s of this.data.quadPoints){this.data.rect=[s[2].x,s[2].y,s[1].x,s[1].y];e.push(this._createContainer(t))}this.data.rect=s;return e}_createPopup(t,e){let s=this.container;if(this.quadrilaterals){t=t||this.quadrilaterals;s=this.quadrilaterals[0]}if(!t){(t=document.createElement("div")).className="popupTriggerArea";s.append(t)}const n=new PopupElement({container:s,trigger:t,color:e.color,titleObj:e.titleObj,modificationDate:e.modificationDate,contentsObj:e.contentsObj,richText:e.richText,hideWrapper:!0}).render();n.style.left="100%";s.append(n)}_renderQuadrilaterals(t){for(const e of this.quadrilaterals)e.className=t;return this.quadrilaterals}render(){(0,n.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(t,e=null){const s=[];if(this._fieldObjects){const i=this._fieldObjects[t];if(i)for(const{page:t,id:a,exportValues:r}of i){if(-1===t)continue;if(a===e)continue;const i="string"==typeof r?r:null,o=document.querySelector(`[data-element-id="${a}"]`);!o||c.has(o)?s.push({id:a,exportValue:i,domElement:o}):(0,n.warn)(`_getElementsByName - element not allowed: ${a}`)}return s}for(const n of document.getElementsByName(t)){const{exportValue:t}=n,i=n.getAttribute("data-element-id");i!==e&&(c.has(n)&&s.push({id:i,exportValue:t,domElement:n}))}return s}}class LinkAnnotationElement extends AnnotationElement{constructor(t,e=null){super(t,{isRenderable:!0,ignoreBorder:!!e?.ignoreBorder,createQuadrilaterals:!0});this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:e}=this,s=document.createElement("a");s.setAttribute("data-element-id",t.id);let n=!1;if(t.url){e.addLinkAttributes(s,t.url,t.newWindow);n=!0}else if(t.action){this._bindNamedAction(s,t.action);n=!0}else if(t.attachment){this._bindAttachment(s,t.attachment);n=!0}else if(t.setOCGState){this.#Ce(s,t.setOCGState);n=!0}else if(t.dest){this._bindLink(s,t.dest);n=!0}else{if(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions){this._bindJSAction(s,t);n=!0}if(t.resetForm){this._bindResetFormAction(s,t.resetForm);n=!0}else if(this.isTooltipOnly&&!n){this._bindLink(s,"");n=!0}}if(this.quadrilaterals)return this._renderQuadrilaterals("linkAnnotation").map(((t,e)=>{const n=0===e?s:s.cloneNode();t.append(n);return t}));this.container.className="linkAnnotation";n&&this.container.append(s);return this.container}#Pe(){this.container.setAttribute("data-internal-link","")}_bindLink(t,e){t.href=this.linkService.getDestinationHash(e);t.onclick=()=>{e&&this.linkService.goToDestination(e);return!1};(e||""===e)&&this.#Pe()}_bindNamedAction(t,e){t.href=this.linkService.getAnchorUrl("");t.onclick=()=>{this.linkService.executeNamedAction(e);return!1};this.#Pe()}_bindAttachment(t,e){t.href=this.linkService.getAnchorUrl("");t.onclick=()=>{this.downloadManager?.openOrDownloadData(this.container,e.content,e.filename);return!1};this.#Pe()}#Ce(t,e){t.href=this.linkService.getAnchorUrl("");t.onclick=()=>{this.linkService.executeSetOCGState(e);return!1};this.#Pe()}_bindJSAction(t,e){t.href=this.linkService.getAnchorUrl("");const s=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const n of Object.keys(e.actions)){const i=s.get(n);i&&(t[i]=()=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e.id,name:n}});return!1})}t.onclick||(t.onclick=()=>!1);this.#Pe()}_bindResetFormAction(t,e){const s=t.onclick;s||(t.href=this.linkService.getAnchorUrl(""));this.#Pe();if(this._fieldObjects)t.onclick=()=>{s?.();const{fields:t,refs:i,include:a}=e,r=[];if(0!==t.length||0!==i.length){const e=new Set(i);for(const s of t){const t=this._fieldObjects[s]||[];for(const{id:s}of t)e.add(s)}for(const t of Object.values(this._fieldObjects))for(const s of t)e.has(s.id)===a&&r.push(s)}else for(const t of Object.values(this._fieldObjects))r.push(...t);const o=this.annotationStorage,l=[];for(const t of r){const{id:e}=t;l.push(e);switch(t.type){case"text":{const s=t.defaultValue||"";o.setValue(e,{value:s});break}case"checkbox":case"radiobutton":{const s=t.defaultValue===t.exportValues;o.setValue(e,{value:s});break}case"combobox":case"listbox":{const s=t.defaultValue||"";o.setValue(e,{value:s});break}default:continue}const s=document.querySelector(`[data-element-id="${e}"]`);s&&(c.has(s)?s.dispatchEvent(new Event("resetform")):(0,n.warn)(`_bindResetFormAction - element not allowed: ${e}`))}this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:l,name:"ResetForm"}});return!1};else{(0,n.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.');s||(t.onclick=()=>!1)}}}class TextAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str)})}render(){this.container.className="textAnnotation";const t=document.createElement("img");t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg";t.alt="[{{type}} Annotation]";t.dataset.l10nId="text_annotation_type";t.dataset.l10nArgs=JSON.stringify({type:this.data.name});this.data.hasPopup||this._createPopup(t,this.data);this.container.append(t);return this.container}}class WidgetAnnotationElement extends AnnotationElement{render(){this.data.alternativeText&&(this.container.title=this.data.alternativeText);return this.container}_getKeyModifier(t){const{isWin:e,isMac:s}=n.FeatureTest.platform;return e&&t.ctrlKey||s&&t.metaKey}_setEventListener(t,e,s,n){e.includes("mouse")?t.addEventListener(e,(t=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:s,value:n(t),shift:t.shiftKey,modifier:this._getKeyModifier(t)}})})):t.addEventListener(e,(t=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:s,value:n(t)}})}))}_setEventListeners(t,e,s){for(const[n,i]of e)("Action"===i||this.data.actions?.[i])&&this._setEventListener(t,n,i,s)}_setBackgroundColor(t){const e=this.data.backgroundColor||null;t.style.backgroundColor=null===e?"transparent":n.Util.makeHexColor(e[0],e[1],e[2])}_setTextStyle(t){const e=["left","center","right"],{fontColor:s}=this.data.defaultAppearanceData,i=this.data.defaultAppearanceData.fontSize||9,a=t.style;let r;const roundToOneDecimal=t=>Math.round(10*t)/10;if(this.data.multiLine){const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2),e=t/(Math.round(t/(n.LINE_FACTOR*i))||1);r=Math.min(i,roundToOneDecimal(e/n.LINE_FACTOR))}else{const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2);r=Math.min(i,roundToOneDecimal(t/n.LINE_FACTOR))}a.fontSize=`calc(${r}px * var(--scale-factor))`;a.color=n.Util.makeHexColor(s[0],s[1],s[2]);null!==this.data.textAlignment&&(a.textAlign=e[this.data.textAlignment])}_setRequired(t,e){e?t.setAttribute("required",!0):t.removeAttribute("required");t.setAttribute("aria-required",e)}}class TextWidgetAnnotationElement extends WidgetAnnotationElement{constructor(t){super(t,{isRenderable:t.renderForms||!t.data.hasAppearance&&!!t.data.fieldValue})}setPropertyOnSiblings(t,e,s,n){const i=this.annotationStorage;for(const a of this._getElementsByName(t.name,t.id)){a.domElement&&(a.domElement[e]=s);i.setValue(a.id,{[n]:s})}}render(){const t=this.annotationStorage,e=this.data.id;this.container.className="textWidgetAnnotation";let s=null;if(this.renderForms){const n=t.getValue(e,{value:this.data.fieldValue});let i=n.formattedValue||n.value||"";const a=t.getValue(e,{charLimit:this.data.maxLen}).charLimit;a&&i.length>a&&(i=i.slice(0,a));const r={userValue:i,formattedValue:null,lastCommittedValue:null,commitKey:1};if(this.data.multiLine){s=document.createElement("textarea");s.textContent=i;this.data.doNotScroll&&(s.style.overflowY="hidden")}else{s=document.createElement("input");s.type="text";s.setAttribute("value",i);this.data.doNotScroll&&(s.style.overflowX="hidden")}c.add(s);s.setAttribute("data-element-id",e);s.disabled=this.data.readOnly;s.name=this.data.fieldName;s.tabIndex=l;this._setRequired(s,this.data.required);a&&(s.maxLength=a);s.addEventListener("input",(n=>{t.setValue(e,{value:n.target.value});this.setPropertyOnSiblings(s,"value",n.target.value,"value")}));s.addEventListener("resetform",(t=>{const e=this.data.defaultFieldValue??"";s.value=r.userValue=e;r.formattedValue=null}));let blurListener=t=>{const{formattedValue:e}=r;null!=e&&(t.target.value=e);t.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){s.addEventListener("focus",(t=>{const{target:e}=t;r.userValue&&(e.value=r.userValue);r.lastCommittedValue=e.value;r.commitKey=1}));s.addEventListener("updatefromsandbox",(s=>{const n={value(s){r.userValue=s.detail.value??"";t.setValue(e,{value:r.userValue.toString()});s.target.value=r.userValue},formattedValue(s){const{formattedValue:n}=s.detail;r.formattedValue=n;null!=n&&s.target!==document.activeElement&&(s.target.value=n);t.setValue(e,{formattedValue:n})},selRange(t){t.target.setSelectionRange(...t.detail.selRange)},charLimit:s=>{const{charLimit:n}=s.detail,{target:i}=s;if(0===n){i.removeAttribute("maxLength");return}i.setAttribute("maxLength",n);let a=r.userValue;if(a&&!(a.length<=n)){a=a.slice(0,n);i.value=r.userValue=a;t.setValue(e,{value:a});this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:a,willCommit:!0,commitKey:1,selStart:i.selectionStart,selEnd:i.selectionEnd}})}}};this._dispatchEventFromSandbox(n,s)}));s.addEventListener("keydown",(t=>{r.commitKey=1;let s=-1;"Escape"===t.key?s=0:"Enter"!==t.key||this.data.multiLine?"Tab"===t.key&&(r.commitKey=3):s=2;if(-1===s)return;const{value:n}=t.target;if(r.lastCommittedValue!==n){r.lastCommittedValue=n;r.userValue=n;this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:n,willCommit:!0,commitKey:s,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}})}}));const n=blurListener;blurListener=null;s.addEventListener("blur",(t=>{if(!t.relatedTarget)return;const{value:s}=t.target;r.userValue=s;r.lastCommittedValue!==s&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:s,willCommit:!0,commitKey:r.commitKey,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}});n(t)}));this.data.actions?.Keystroke&&s.addEventListener("beforeinput",(t=>{r.lastCommittedValue=null;const{data:s,target:n}=t,{value:i,selectionStart:a,selectionEnd:o}=n;let l=a,c=o;switch(t.inputType){case"deleteWordBackward":{const t=i.substring(0,a).match(/\w*[^\w]*$/);t&&(l-=t[0].length);break}case"deleteWordForward":{const t=i.substring(a).match(/^[^\w]*\w*/);t&&(c+=t[0].length);break}case"deleteContentBackward":a===o&&(l-=1);break;case"deleteContentForward":a===o&&(c+=1)}t.preventDefault();this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:i,change:s||"",willCommit:!1,selStart:l,selEnd:c}})}));this._setEventListeners(s,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.value))}blurListener&&s.addEventListener("blur",blurListener);if(this.data.comb){const t=(this.data.rect[2]-this.data.rect[0])/a;s.classList.add("comb");s.style.letterSpacing=`calc(${t}px * var(--scale-factor) - 1ch)`}}else{s=document.createElement("div");s.textContent=this.data.fieldValue;s.style.verticalAlign="middle";s.style.display="table-cell"}this._setTextStyle(s);this._setBackgroundColor(s);this._setDefaultPropertiesFromJS(s);this.container.append(s);return this.container}}class CheckboxWidgetAnnotationElement extends WidgetAnnotationElement{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,e=this.data,s=e.id;let n=t.getValue(s,{value:e.exportValue===e.fieldValue}).value;if("string"==typeof n){n="Off"!==n;t.setValue(s,{value:n})}this.container.className="buttonWidgetAnnotation checkBox";const i=document.createElement("input");c.add(i);i.setAttribute("data-element-id",s);i.disabled=e.readOnly;this._setRequired(i,this.data.required);i.type="checkbox";i.name=e.fieldName;n&&i.setAttribute("checked",!0);i.setAttribute("exportValue",e.exportValue);i.tabIndex=l;i.addEventListener("change",(n=>{const{name:i,checked:a}=n.target;for(const n of this._getElementsByName(i,s)){const s=a&&n.exportValue===e.exportValue;n.domElement&&(n.domElement.checked=s);t.setValue(n.id,{value:s})}t.setValue(s,{value:a})}));i.addEventListener("resetform",(t=>{const s=e.defaultFieldValue||"Off";t.target.checked=s===e.exportValue}));if(this.enableScripting&&this.hasJSActions){i.addEventListener("updatefromsandbox",(e=>{const n={value(e){e.target.checked="Off"!==e.detail.value;t.setValue(s,{value:e.target.checked})}};this._dispatchEventFromSandbox(n,e)}));this._setEventListeners(i,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.checked))}this._setBackgroundColor(i);this._setDefaultPropertiesFromJS(i);this.container.append(i);return this.container}}class RadioButtonWidgetAnnotationElement extends WidgetAnnotationElement{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.className="buttonWidgetAnnotation radioButton";const t=this.annotationStorage,e=this.data,s=e.id;let n=t.getValue(s,{value:e.fieldValue===e.buttonValue}).value;if("string"==typeof n){n=n!==e.buttonValue;t.setValue(s,{value:n})}const i=document.createElement("input");c.add(i);i.setAttribute("data-element-id",s);i.disabled=e.readOnly;this._setRequired(i,this.data.required);i.type="radio";i.name=e.fieldName;n&&i.setAttribute("checked",!0);i.tabIndex=l;i.addEventListener("change",(e=>{const{name:n,checked:i}=e.target;for(const e of this._getElementsByName(n,s))t.setValue(e.id,{value:!1});t.setValue(s,{value:i})}));i.addEventListener("resetform",(t=>{const s=e.defaultFieldValue;t.target.checked=null!=s&&s===e.buttonValue}));if(this.enableScripting&&this.hasJSActions){const n=e.buttonValue;i.addEventListener("updatefromsandbox",(e=>{const i={value:e=>{const i=n===e.detail.value;for(const n of this._getElementsByName(e.target.name)){const e=i&&n.id===s;n.domElement&&(n.domElement.checked=e);t.setValue(n.id,{value:e})}}};this._dispatchEventFromSandbox(i,e)}));this._setEventListeners(i,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.checked))}this._setBackgroundColor(i);this._setDefaultPropertiesFromJS(i);this.container.append(i);return this.container}}class PushButtonWidgetAnnotationElement extends LinkAnnotationElement{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();t.className="buttonWidgetAnnotation pushButton";this.data.alternativeText&&(t.title=this.data.alternativeText);const e=t.lastChild;if(this.enableScripting&&this.hasJSActions&&e){this._setDefaultPropertiesFromJS(e);e.addEventListener("updatefromsandbox",(t=>{this._dispatchEventFromSandbox({},t)}))}return t}}class ChoiceWidgetAnnotationElement extends WidgetAnnotationElement{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.className="choiceWidgetAnnotation";const t=this.annotationStorage,e=this.data.id,s=t.getValue(e,{value:this.data.fieldValue}),n=document.createElement("select");c.add(n);n.setAttribute("data-element-id",e);n.disabled=this.data.readOnly;this._setRequired(n,this.data.required);n.name=this.data.fieldName;n.tabIndex=l;let i=this.data.combo&&this.data.options.length>0;if(!this.data.combo){n.size=this.data.options.length;this.data.multiSelect&&(n.multiple=!0)}n.addEventListener("resetform",(t=>{const e=this.data.defaultFieldValue;for(const t of n.options)t.selected=t.value===e}));for(const t of this.data.options){const e=document.createElement("option");e.textContent=t.displayValue;e.value=t.exportValue;if(s.value.includes(t.exportValue)){e.setAttribute("selected",!0);i=!1}n.append(e)}let a=null;if(i){const t=document.createElement("option");t.value=" ";t.setAttribute("hidden",!0);t.setAttribute("selected",!0);n.prepend(t);a=()=>{t.remove();n.removeEventListener("input",a);a=null};n.addEventListener("input",a)}const getValue=t=>{const e=t?"value":"textContent",{options:s,multiple:i}=n;return i?Array.prototype.filter.call(s,(t=>t.selected)).map((t=>t[e])):-1===s.selectedIndex?null:s[s.selectedIndex][e]};let r=getValue(!1);const getItems=t=>{const e=t.target.options;return Array.prototype.map.call(e,(t=>({displayValue:t.textContent,exportValue:t.value})))};if(this.enableScripting&&this.hasJSActions){n.addEventListener("updatefromsandbox",(s=>{const i={value(s){a?.();const i=s.detail.value,o=new Set(Array.isArray(i)?i:[i]);for(const t of n.options)t.selected=o.has(t.value);t.setValue(e,{value:getValue(!0)});r=getValue(!1)},multipleSelection(t){n.multiple=!0},remove(s){const i=n.options,a=s.detail.remove;i[a].selected=!1;n.remove(a);if(i.length>0){-1===Array.prototype.findIndex.call(i,(t=>t.selected))&&(i[0].selected=!0)}t.setValue(e,{value:getValue(!0),items:getItems(s)});r=getValue(!1)},clear(s){for(;0!==n.length;)n.remove(0);t.setValue(e,{value:null,items:[]});r=getValue(!1)},insert(s){const{index:i,displayValue:a,exportValue:o}=s.detail.insert,l=n.children[i],c=document.createElement("option");c.textContent=a;c.value=o;l?l.before(c):n.append(c);t.setValue(e,{value:getValue(!0),items:getItems(s)});r=getValue(!1)},items(s){const{items:i}=s.detail;for(;0!==n.length;)n.remove(0);for(const t of i){const{displayValue:e,exportValue:s}=t,i=document.createElement("option");i.textContent=e;i.value=s;n.append(i)}n.options.length>0&&(n.options[0].selected=!0);t.setValue(e,{value:getValue(!0),items:getItems(s)});r=getValue(!1)},indices(s){const n=new Set(s.detail.indices);for(const t of s.target.options)t.selected=n.has(t.index);t.setValue(e,{value:getValue(!0)});r=getValue(!1)},editable(t){t.target.disabled=!t.detail.editable}};this._dispatchEventFromSandbox(i,s)}));n.addEventListener("input",(s=>{const n=getValue(!0);t.setValue(e,{value:n});s.preventDefault();this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:r,changeEx:n,willCommit:!1,commitKey:1,keyDown:!1}})}));this._setEventListeners(n,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],(t=>t.target.value))}else n.addEventListener("input",(function(s){t.setValue(e,{value:getValue(!0)})}));this.data.combo&&this._setTextStyle(n);this._setBackgroundColor(n);this._setDefaultPropertiesFromJS(n);this.container.append(n);return this.container}}class PopupAnnotationElement extends AnnotationElement{static IGNORE_TYPES=new Set(["Line","Square","Circle","PolyLine","Polygon","Ink"]);constructor(t){const{data:e}=t;super(t,{isRenderable:!PopupAnnotationElement.IGNORE_TYPES.has(e.parentType)&&!!(e.titleObj?.str||e.contentsObj?.str||e.richText?.str)})}render(){this.container.className="popupAnnotation";const t=this.layer.querySelectorAll(`[data-annotation-id="${this.data.parentId}"]`);if(0===t.length)return this.container;const e=new PopupElement({container:this.container,trigger:Array.from(t),color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText}),s=this.page,i=n.Util.normalizeRect([this.data.parentRect[0],s.view[3]-this.data.parentRect[1]+s.view[1],this.data.parentRect[2],s.view[3]-this.data.parentRect[3]+s.view[1]]),a=i[0]+this.data.parentRect[2]-this.data.parentRect[0],r=i[1],{pageWidth:o,pageHeight:l,pageX:c,pageY:h}=this.viewport.rawDims;this.container.style.left=100*(a-c)/o+"%";this.container.style.top=100*(r-h)/l+"%";this.container.append(e.render());return this.container}}class PopupElement{constructor(t){this.container=t.container;this.trigger=t.trigger;this.color=t.color;this.titleObj=t.titleObj;this.modificationDate=t.modificationDate;this.contentsObj=t.contentsObj;this.richText=t.richText;this.hideWrapper=t.hideWrapper||!1;this.pinned=!1}render(){const t=document.createElement("div");t.className="popupWrapper";this.hideElement=this.hideWrapper?t:this.container;this.hideElement.hidden=!0;const e=document.createElement("div");e.className="popup";const s=this.color;if(s){const t=.7*(255-s[0])+s[0],i=.7*(255-s[1])+s[1],a=.7*(255-s[2])+s[2];e.style.backgroundColor=n.Util.makeHexColor(0|t,0|i,0|a)}const a=document.createElement("h1");a.dir=this.titleObj.dir;a.textContent=this.titleObj.str;e.append(a);const r=i.PDFDateString.toDateObject(this.modificationDate);if(r){const t=document.createElement("span");t.className="popupDate";t.textContent="{{date}}, {{time}}";t.dataset.l10nId="annotation_date_string";t.dataset.l10nArgs=JSON.stringify({date:r.toLocaleDateString(),time:r.toLocaleTimeString()});e.append(t)}if(!this.richText?.str||this.contentsObj?.str&&this.contentsObj.str!==this.richText.str){const t=this._formatContents(this.contentsObj);e.append(t)}else{o.XfaLayer.render({xfaHtml:this.richText.html,intent:"richText",div:e});e.lastChild.className="richText popupContent"}Array.isArray(this.trigger)||(this.trigger=[this.trigger]);for(const t of this.trigger){t.addEventListener("click",this._toggle.bind(this));t.addEventListener("mouseover",this._show.bind(this,!1));t.addEventListener("mouseout",this._hide.bind(this,!1))}e.addEventListener("click",this._hide.bind(this,!0));t.append(e);return t}_formatContents({str:t,dir:e}){const s=document.createElement("p");s.className="popupContent";s.dir=e;const n=t.split(/(?:\r\n?|\n)/);for(let t=0,e=n.length;t<e;++t){const i=n[t];s.append(document.createTextNode(i));t<e-1&&s.append(document.createElement("br"))}return s}_toggle(){this.pinned?this._hide(!0):this._show(!0)}_show(t=!1){t&&(this.pinned=!0);if(this.hideElement.hidden){this.hideElement.hidden=!1;this.container.style.zIndex=parseInt(this.container.style.zIndex)+1e3}}_hide(t=!0){t&&(this.pinned=!1);if(!this.hideElement.hidden&&!this.pinned){this.hideElement.hidden=!0;this.container.style.zIndex=parseInt(this.container.style.zIndex)-1e3}}}class FreeTextAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str),ignoreBorder:!0});this.textContent=t.data.textContent}render(){this.container.className="freeTextAnnotation";if(this.textContent){const t=document.createElement("div");t.className="annotationTextContent";t.setAttribute("role","comment");for(const e of this.textContent){const s=document.createElement("span");s.textContent=e;t.append(s)}this.container.append(t)}this.data.hasPopup||this._createPopup(null,this.data);return this.container}}class LineAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str),ignoreBorder:!0})}render(){this.container.className="lineAnnotation";const t=this.data,{width:e,height:s}=getRectDims(t.rect),n=this.svgFactory.create(e,s,!0),i=this.svgFactory.createElement("svg:line");i.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]);i.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]);i.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]);i.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]);i.setAttribute("stroke-width",t.borderStyle.width||1);i.setAttribute("stroke","transparent");i.setAttribute("fill","transparent");n.append(i);this.container.append(n);this._createPopup(i,t);return this.container}}class SquareAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str),ignoreBorder:!0})}render(){this.container.className="squareAnnotation";const t=this.data,{width:e,height:s}=getRectDims(t.rect),n=this.svgFactory.create(e,s,!0),i=t.borderStyle.width,a=this.svgFactory.createElement("svg:rect");a.setAttribute("x",i/2);a.setAttribute("y",i/2);a.setAttribute("width",e-i);a.setAttribute("height",s-i);a.setAttribute("stroke-width",i||1);a.setAttribute("stroke","transparent");a.setAttribute("fill","transparent");n.append(a);this.container.append(n);this._createPopup(a,t);return this.container}}class CircleAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str),ignoreBorder:!0})}render(){this.container.className="circleAnnotation";const t=this.data,{width:e,height:s}=getRectDims(t.rect),n=this.svgFactory.create(e,s,!0),i=t.borderStyle.width,a=this.svgFactory.createElement("svg:ellipse");a.setAttribute("cx",e/2);a.setAttribute("cy",s/2);a.setAttribute("rx",e/2-i/2);a.setAttribute("ry",s/2-i/2);a.setAttribute("stroke-width",i||1);a.setAttribute("stroke","transparent");a.setAttribute("fill","transparent");n.append(a);this.container.append(n);this._createPopup(a,t);return this.container}}class PolylineAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str),ignoreBorder:!0});this.containerClassName="polylineAnnotation";this.svgElementName="svg:polyline"}render(){this.container.className=this.containerClassName;const t=this.data,{width:e,height:s}=getRectDims(t.rect),n=this.svgFactory.create(e,s,!0);let i=[];for(const e of t.vertices){const s=e.x-t.rect[0],n=t.rect[3]-e.y;i.push(s+","+n)}i=i.join(" ");const a=this.svgFactory.createElement(this.svgElementName);a.setAttribute("points",i);a.setAttribute("stroke-width",t.borderStyle.width||1);a.setAttribute("stroke","transparent");a.setAttribute("fill","transparent");n.append(a);this.container.append(n);this._createPopup(a,t);return this.container}}class PolygonAnnotationElement extends PolylineAnnotationElement{constructor(t){super(t);this.containerClassName="polygonAnnotation";this.svgElementName="svg:polygon"}}class CaretAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str),ignoreBorder:!0})}render(){this.container.className="caretAnnotation";this.data.hasPopup||this._createPopup(null,this.data);return this.container}}class InkAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str),ignoreBorder:!0});this.containerClassName="inkAnnotation";this.svgElementName="svg:polyline"}render(){this.container.className=this.containerClassName;const t=this.data,{width:e,height:s}=getRectDims(t.rect),n=this.svgFactory.create(e,s,!0);for(const e of t.inkLists){let s=[];for(const n of e){const e=n.x-t.rect[0],i=t.rect[3]-n.y;s.push(`${e},${i}`)}s=s.join(" ");const i=this.svgFactory.createElement(this.svgElementName);i.setAttribute("points",s);i.setAttribute("stroke-width",t.borderStyle.width||1);i.setAttribute("stroke","transparent");i.setAttribute("fill","transparent");this._createPopup(i,t);n.append(i)}this.container.append(n);return this.container}}class HighlightAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){this.data.hasPopup||this._createPopup(null,this.data);if(this.quadrilaterals)return this._renderQuadrilaterals("highlightAnnotation");this.container.className="highlightAnnotation";return this.container}}class UnderlineAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){this.data.hasPopup||this._createPopup(null,this.data);if(this.quadrilaterals)return this._renderQuadrilaterals("underlineAnnotation");this.container.className="underlineAnnotation";return this.container}}class SquigglyAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){this.data.hasPopup||this._createPopup(null,this.data);if(this.quadrilaterals)return this._renderQuadrilaterals("squigglyAnnotation");this.container.className="squigglyAnnotation";return this.container}}class StrikeOutAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){this.data.hasPopup||this._createPopup(null,this.data);if(this.quadrilaterals)return this._renderQuadrilaterals("strikeoutAnnotation");this.container.className="strikeoutAnnotation";return this.container}}class StampAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str),ignoreBorder:!0})}render(){this.container.className="stampAnnotation";this.data.hasPopup||this._createPopup(null,this.data);return this.container}}class FileAttachmentAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!0});const{filename:e,content:s}=this.data.file;this.filename=(0,i.getFilenameFromUrl)(e,!0);this.content=s;this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,filename:e,content:s})}render(){this.container.className="fileAttachmentAnnotation";let t;if(this.data.hasAppearance)t=document.createElement("div");else{t=document.createElement("img");t.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(this.data.name)?"paperclip":"pushpin"}.svg`}t.className="popupTriggerArea";t.addEventListener("dblclick",this._download.bind(this));!this.data.hasPopup&&(this.data.titleObj?.str||this.data.contentsObj?.str||this.data.richText)&&this._createPopup(t,this.data);this.container.append(t);return this.container}_download(){this.downloadManager?.openOrDownloadData(this.container,this.content,this.filename)}}class AnnotationLayer{static#Te(t,e,s,n){const a=t.firstChild||t;a.id=`${i.AnnotationPrefix}${e}`;s.append(t);n?.moveElementInDOM(s,t,a,!1)}static render(t){const{annotations:e,div:s,viewport:r,accessibilityManager:o}=t;(0,i.setLayerDimensions)(s,r);const l={data:null,layer:s,page:t.page,viewport:r,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:!1!==t.renderForms,svgFactory:new i.DOMSVGFactory,annotationStorage:t.annotationStorage||new a.AnnotationStorage,enableScripting:!0===t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects};let c=0;for(const t of e){if(t.annotationType!==n.AnnotationType.POPUP){const{width:e,height:s}=getRectDims(t.rect);if(e<=0||s<=0)continue}l.data=t;const e=AnnotationElementFactory.create(l);if(!e.isRenderable)continue;const i=e.render();t.hidden&&(i.style.visibility="hidden");if(Array.isArray(i))for(const e of i){e.style.zIndex=c++;AnnotationLayer.#Te(e,t.id,s,o)}else{i.style.zIndex=c++;e instanceof PopupAnnotationElement?s.prepend(i):AnnotationLayer.#Te(i,t.id,s,o)}}this.#we(s,t.annotationCanvasMap)}static update(t){const{annotationCanvasMap:e,div:s,viewport:n}=t;(0,i.setLayerDimensions)(s,{rotation:n.rotation});this.#we(s,e);s.hidden=!1}static#we(t,e){if(e){for(const[s,n]of e){const e=t.querySelector(`[data-annotation-id="${s}"]`);if(!e)continue;const{firstChild:i}=e;i?"CANVAS"===i.nodeName?i.replaceWith(n):i.before(n):e.append(n)}e.clear()}}}e.AnnotationLayer=AnnotationLayer},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0});e.ColorConverters=void 0;function makeColorComp(t){return Math.floor(255*Math.max(0,Math.min(1,t))).toString(16).padStart(2,"0")}e.ColorConverters=class ColorConverters{static CMYK_G([t,e,s,n]){return["G",1-Math.min(1,.3*t+.59*s+.11*e+n)]}static G_CMYK([t]){return["CMYK",0,0,0,1-t]}static G_RGB([t]){return["RGB",t,t,t]}static G_HTML([t]){const e=makeColorComp(t);return`#${e}${e}${e}`}static RGB_G([t,e,s]){return["G",.3*t+.59*e+.11*s]}static RGB_HTML([t,e,s]){return`#${makeColorComp(t)}${makeColorComp(e)}${makeColorComp(s)}`}static T_HTML(){return"#00000000"}static CMYK_RGB([t,e,s,n]){return["RGB",1-Math.min(1,t+n),1-Math.min(1,s+n),1-Math.min(1,e+n)]}static CMYK_HTML(t){const e=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(e)}static RGB_CMYK([t,e,s]){const n=1-t,i=1-e,a=1-s;return["CMYK",n,i,a,Math.min(n,i,a)]}}},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.XfaLayer=void 0;var n=s(19);e.XfaLayer=class XfaLayer{static setupStorage(t,e,s,n,i){const a=n.getValue(e,{value:null});switch(s.name){case"textarea":null!==a.value&&(t.textContent=a.value);if("print"===i)break;t.addEventListener("input",(t=>{n.setValue(e,{value:t.target.value})}));break;case"input":if("radio"===s.attributes.type||"checkbox"===s.attributes.type){a.value===s.attributes.xfaOn?t.setAttribute("checked",!0):a.value===s.attributes.xfaOff&&t.removeAttribute("checked");if("print"===i)break;t.addEventListener("change",(t=>{n.setValue(e,{value:t.target.checked?t.target.getAttribute("xfaOn"):t.target.getAttribute("xfaOff")})}))}else{null!==a.value&&t.setAttribute("value",a.value);if("print"===i)break;t.addEventListener("input",(t=>{n.setValue(e,{value:t.target.value})}))}break;case"select":if(null!==a.value)for(const t of s.children)t.attributes.value===a.value&&(t.attributes.selected=!0);t.addEventListener("input",(t=>{const s=t.target.options,i=-1===s.selectedIndex?"":s[s.selectedIndex].value;n.setValue(e,{value:i})}))}}static setAttributes({html:t,element:e,storage:s=null,intent:n,linkService:i}){const{attributes:a}=e,r=t instanceof HTMLAnchorElement;"radio"===a.type&&(a.name=`${a.name}-${n}`);for(const[e,s]of Object.entries(a))if(null!=s)switch(e){case"class":s.length&&t.setAttribute(e,s.join(" "));break;case"dataId":break;case"id":t.setAttribute("data-element-id",s);break;case"style":Object.assign(t.style,s);break;case"textContent":t.textContent=s;break;default:(!r||"href"!==e&&"newWindow"!==e)&&t.setAttribute(e,s)}r&&i.addLinkAttributes(t,a.href,a.newWindow);s&&a.dataId&&this.setupStorage(t,a.dataId,e,s)}static render(t){const e=t.annotationStorage,s=t.linkService,i=t.xfaHtml,a=t.intent||"display",r=document.createElement(i.name);i.attributes&&this.setAttributes({html:r,element:i,intent:a,linkService:s});const o=[[i,-1,r]],l=t.div;l.append(r);if(t.viewport){const e=`matrix(${t.viewport.transform.join(",")})`;l.style.transform=e}"richText"!==a&&l.setAttribute("class","xfaLayer xfaFont");const c=[];for(;o.length>0;){const[t,i,r]=o.at(-1);if(i+1===t.children.length){o.pop();continue}const l=t.children[++o.at(-1)[1]];if(null===l)continue;const{name:h}=l;if("#text"===h){const t=document.createTextNode(l.value);c.push(t);r.append(t);continue}let d;d=l?.attributes?.xmlns?document.createElementNS(l.attributes.xmlns,h):document.createElement(h);r.append(d);l.attributes&&this.setAttributes({html:d,element:l,storage:e,intent:a,linkService:s});if(l.children&&l.children.length>0)o.push([l,-1,d]);else if(l.value){const t=document.createTextNode(l.value);n.XfaText.shouldBuildText(h)&&c.push(t);d.append(t)}}for(const t of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))t.setAttribute("readOnly",!0);return{textDivs:c}}static update(t){const e=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=e;t.div.hidden=!1}}},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.SVGGraphics=void 0;var n=s(6),i=s(1),a=s(10);let r=class{constructor(){(0,i.unreachable)("Not implemented: SVGGraphics")}};e.SVGGraphics=r;{const o={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},l="http://www.w3.org/XML/1998/namespace",c="http://www.w3.org/1999/xlink",h=["butt","round","square"],d=["miter","round","bevel"],createObjectURL=function(t,e="",s=!1){if(URL.createObjectURL&&"undefined"!=typeof Blob&&!s)return URL.createObjectURL(new Blob([t],{type:e}));const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let i=`data:${e};base64,`;for(let e=0,s=t.length;e<s;e+=3){const a=255&t[e],r=255&t[e+1],o=255&t[e+2];i+=n[a>>2]+n[(3&a)<<4|r>>4]+n[e+1<s?(15&r)<<2|o>>6:64]+n[e+2<s?63&o:64]}return i},u=function(){const t=new Uint8Array([137,80,78,71,13,10,26,10]),e=12,s=new Int32Array(256);for(let t=0;t<256;t++){let e=t;for(let t=0;t<8;t++)e=1&e?3988292384^e>>1&2147483647:e>>1&2147483647;s[t]=e}function writePngChunk(t,e,n,i){let a=i;const r=e.length;n[a]=r>>24&255;n[a+1]=r>>16&255;n[a+2]=r>>8&255;n[a+3]=255&r;a+=4;n[a]=255&t.charCodeAt(0);n[a+1]=255&t.charCodeAt(1);n[a+2]=255&t.charCodeAt(2);n[a+3]=255&t.charCodeAt(3);a+=4;n.set(e,a);a+=e.length;const o=function crc32(t,e,n){let i=-1;for(let a=e;a<n;a++){const e=255&(i^t[a]);i=i>>>8^s[e]}return-1^i}(n,i+4,a);n[a]=o>>24&255;n[a+1]=o>>16&255;n[a+2]=o>>8&255;n[a+3]=255&o}function deflateSyncUncompressed(t){let e=t.length;const s=65535,n=Math.ceil(e/s),i=new Uint8Array(2+e+5*n+4);let a=0;i[a++]=120;i[a++]=156;let r=0;for(;e>s;){i[a++]=0;i[a++]=255;i[a++]=255;i[a++]=0;i[a++]=0;i.set(t.subarray(r,r+s),a);a+=s;r+=s;e-=s}i[a++]=1;i[a++]=255&e;i[a++]=e>>8&255;i[a++]=255&~e;i[a++]=(65535&~e)>>8&255;i.set(t.subarray(r),a);a+=t.length-r;const o=function adler32(t,e,s){let n=1,i=0;for(let a=e;a<s;++a){n=(n+(255&t[a]))%65521;i=(i+n)%65521}return i<<16|n}(t,0,t.length);i[a++]=o>>24&255;i[a++]=o>>16&255;i[a++]=o>>8&255;i[a++]=255&o;return i}function encode(s,n,r,o){const l=s.width,c=s.height;let h,d,u;const p=s.data;switch(n){case i.ImageKind.GRAYSCALE_1BPP:d=0;h=1;u=l+7>>3;break;case i.ImageKind.RGB_24BPP:d=2;h=8;u=3*l;break;case i.ImageKind.RGBA_32BPP:d=6;h=8;u=4*l;break;default:throw new Error("invalid format")}const g=new Uint8Array((1+u)*c);let f=0,m=0;for(let t=0;t<c;++t){g[f++]=0;g.set(p.subarray(m,m+u),f);m+=u;f+=u}if(n===i.ImageKind.GRAYSCALE_1BPP&&o){f=0;for(let t=0;t<c;t++){f++;for(let t=0;t<u;t++)g[f++]^=255}}const b=new Uint8Array([l>>24&255,l>>16&255,l>>8&255,255&l,c>>24&255,c>>16&255,c>>8&255,255&c,h,d,0,0,0]),A=function deflateSync(t){if(!a.isNodeJS)return deflateSyncUncompressed(t);try{let e;e=parseInt(process.versions.node)>=8?t:Buffer.from(t);const s=require("zlib").deflateSync(e,{level:9});return s instanceof Uint8Array?s:new Uint8Array(s)}catch(t){(0,i.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+t)}return deflateSyncUncompressed(t)}(g),_=t.length+3*e+b.length+A.length,v=new Uint8Array(_);let y=0;v.set(t,y);y+=t.length;writePngChunk("IHDR",b,v,y);y+=e+b.length;writePngChunk("IDATA",A,v,y);y+=e+A.length;writePngChunk("IEND",new Uint8Array(0),v,y);return createObjectURL(v,"image/png",r)}return function convertImgDataToPng(t,e,s){return encode(t,void 0===t.kind?i.ImageKind.GRAYSCALE_1BPP:t.kind,e,s)}}();class SVGExtraState{constructor(){this.fontSizeScale=1;this.fontWeight=o.fontWeight;this.fontSize=0;this.textMatrix=i.IDENTITY_MATRIX;this.fontMatrix=i.FONT_IDENTITY_MATRIX;this.leading=0;this.textRenderingMode=i.TextRenderingMode.FILL;this.textMatrixScale=1;this.x=0;this.y=0;this.lineX=0;this.lineY=0;this.charSpacing=0;this.wordSpacing=0;this.textHScale=1;this.textRise=0;this.fillColor=o.fillColor;this.strokeColor="#000000";this.fillAlpha=1;this.strokeAlpha=1;this.lineWidth=1;this.lineJoin="";this.lineCap="";this.miterLimit=0;this.dashArray=[];this.dashPhase=0;this.dependencies=[];this.activeClipUrl=null;this.clipGroup=null;this.maskId=""}clone(){return Object.create(this)}setCurrentPoint(t,e){this.x=t;this.y=e}}function opListToTree(t){let e=[];const s=[];for(const n of t)if("save"!==n.fn)"restore"===n.fn?e=s.pop():e.push(n);else{e.push({fnId:92,fn:"group",items:[]});s.push(e);e=e.at(-1).items}return e}function pf(t){if(Number.isInteger(t))return t.toString();const e=t.toFixed(10);let s=e.length-1;if("0"!==e[s])return e;do{s--}while("0"===e[s]);return e.substring(0,"."===e[s]?s:s+1)}function pm(t){if(0===t[4]&&0===t[5]){if(0===t[1]&&0===t[2])return 1===t[0]&&1===t[3]?"":`scale(${pf(t[0])} ${pf(t[3])})`;if(t[0]===t[3]&&t[1]===-t[2]){return`rotate(${pf(180*Math.acos(t[0])/Math.PI)})`}}else if(1===t[0]&&0===t[1]&&0===t[2]&&1===t[3])return`translate(${pf(t[4])} ${pf(t[5])})`;return`matrix(${pf(t[0])} ${pf(t[1])} ${pf(t[2])} ${pf(t[3])} ${pf(t[4])} ${pf(t[5])})`}let p=0,g=0,f=0;e.SVGGraphics=r=class{constructor(t,e,s=!1){(0,n.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future.");this.svgFactory=new n.DOMSVGFactory;this.current=new SVGExtraState;this.transformMatrix=i.IDENTITY_MATRIX;this.transformStack=[];this.extraStack=[];this.commonObjs=t;this.objs=e;this.pendingClip=null;this.pendingEOFill=!1;this.embedFonts=!1;this.embeddedFonts=Object.create(null);this.cssStyle=null;this.forceDataSchema=!!s;this._operatorIdMapping=[];for(const t in i.OPS)this._operatorIdMapping[i.OPS[t]]=t}getObject(t,e=null){return"string"==typeof t?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):e}save(){this.transformStack.push(this.transformMatrix);const t=this.current;this.extraStack.push(t);this.current=t.clone()}restore(){this.transformMatrix=this.transformStack.pop();this.current=this.extraStack.pop();this.pendingClip=null;this.tgrp=null}group(t){this.save();this.executeOpTree(t);this.restore()}loadDependencies(t){const e=t.fnArray,s=t.argsArray;for(let t=0,n=e.length;t<n;t++)if(e[t]===i.OPS.dependency)for(const e of s[t]){const t=e.startsWith("g_")?this.commonObjs:this.objs,s=new Promise((s=>{t.get(e,s)}));this.current.dependencies.push(s)}return Promise.all(this.current.dependencies)}transform(t,e,s,n,a,r){const o=[t,e,s,n,a,r];this.transformMatrix=i.Util.transform(this.transformMatrix,o);this.tgrp=null}getSVG(t,e){this.viewport=e;const s=this._initialize(e);return this.loadDependencies(t).then((()=>{this.transformMatrix=i.IDENTITY_MATRIX;this.executeOpTree(this.convertOpList(t));return s}))}convertOpList(t){const e=this._operatorIdMapping,s=t.argsArray,n=t.fnArray,i=[];for(let t=0,a=n.length;t<a;t++){const a=n[t];i.push({fnId:a,fn:e[a],args:s[t]})}return opListToTree(i)}executeOpTree(t){for(const e of t){const t=e.fn,s=e.fnId,n=e.args;switch(0|s){case i.OPS.beginText:this.beginText();break;case i.OPS.dependency:break;case i.OPS.setLeading:this.setLeading(n);break;case i.OPS.setLeadingMoveText:this.setLeadingMoveText(n[0],n[1]);break;case i.OPS.setFont:this.setFont(n);break;case i.OPS.showText:case i.OPS.showSpacedText:this.showText(n[0]);break;case i.OPS.endText:this.endText();break;case i.OPS.moveText:this.moveText(n[0],n[1]);break;case i.OPS.setCharSpacing:this.setCharSpacing(n[0]);break;case i.OPS.setWordSpacing:this.setWordSpacing(n[0]);break;case i.OPS.setHScale:this.setHScale(n[0]);break;case i.OPS.setTextMatrix:this.setTextMatrix(n[0],n[1],n[2],n[3],n[4],n[5]);break;case i.OPS.setTextRise:this.setTextRise(n[0]);break;case i.OPS.setTextRenderingMode:this.setTextRenderingMode(n[0]);break;case i.OPS.setLineWidth:this.setLineWidth(n[0]);break;case i.OPS.setLineJoin:this.setLineJoin(n[0]);break;case i.OPS.setLineCap:this.setLineCap(n[0]);break;case i.OPS.setMiterLimit:this.setMiterLimit(n[0]);break;case i.OPS.setFillRGBColor:this.setFillRGBColor(n[0],n[1],n[2]);break;case i.OPS.setStrokeRGBColor:this.setStrokeRGBColor(n[0],n[1],n[2]);break;case i.OPS.setStrokeColorN:this.setStrokeColorN(n);break;case i.OPS.setFillColorN:this.setFillColorN(n);break;case i.OPS.shadingFill:this.shadingFill(n[0]);break;case i.OPS.setDash:this.setDash(n[0],n[1]);break;case i.OPS.setRenderingIntent:this.setRenderingIntent(n[0]);break;case i.OPS.setFlatness:this.setFlatness(n[0]);break;case i.OPS.setGState:this.setGState(n[0]);break;case i.OPS.fill:this.fill();break;case i.OPS.eoFill:this.eoFill();break;case i.OPS.stroke:this.stroke();break;case i.OPS.fillStroke:this.fillStroke();break;case i.OPS.eoFillStroke:this.eoFillStroke();break;case i.OPS.clip:this.clip("nonzero");break;case i.OPS.eoClip:this.clip("evenodd");break;case i.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case i.OPS.paintImageXObject:this.paintImageXObject(n[0]);break;case i.OPS.paintInlineImageXObject:this.paintInlineImageXObject(n[0]);break;case i.OPS.paintImageMaskXObject:this.paintImageMaskXObject(n[0]);break;case i.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(n[0],n[1]);break;case i.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case i.OPS.closePath:this.closePath();break;case i.OPS.closeStroke:this.closeStroke();break;case i.OPS.closeFillStroke:this.closeFillStroke();break;case i.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case i.OPS.nextLine:this.nextLine();break;case i.OPS.transform:this.transform(n[0],n[1],n[2],n[3],n[4],n[5]);break;case i.OPS.constructPath:this.constructPath(n[0],n[1]);break;case i.OPS.endPath:this.endPath();break;case 92:this.group(e.items);break;default:(0,i.warn)(`Unimplemented operator ${t}`)}}}setWordSpacing(t){this.current.wordSpacing=t}setCharSpacing(t){this.current.charSpacing=t}nextLine(){this.moveText(0,this.current.leading)}setTextMatrix(t,e,s,n,i,a){const r=this.current;r.textMatrix=r.lineMatrix=[t,e,s,n,i,a];r.textMatrixScale=Math.hypot(t,e);r.x=r.lineX=0;r.y=r.lineY=0;r.xcoords=[];r.ycoords=[];r.tspan=this.svgFactory.createElement("svg:tspan");r.tspan.setAttributeNS(null,"font-family",r.fontFamily);r.tspan.setAttributeNS(null,"font-size",`${pf(r.fontSize)}px`);r.tspan.setAttributeNS(null,"y",pf(-r.y));r.txtElement=this.svgFactory.createElement("svg:text");r.txtElement.append(r.tspan)}beginText(){const t=this.current;t.x=t.lineX=0;t.y=t.lineY=0;t.textMatrix=i.IDENTITY_MATRIX;t.lineMatrix=i.IDENTITY_MATRIX;t.textMatrixScale=1;t.tspan=this.svgFactory.createElement("svg:tspan");t.txtElement=this.svgFactory.createElement("svg:text");t.txtgrp=this.svgFactory.createElement("svg:g");t.xcoords=[];t.ycoords=[]}moveText(t,e){const s=this.current;s.x=s.lineX+=t;s.y=s.lineY+=e;s.xcoords=[];s.ycoords=[];s.tspan=this.svgFactory.createElement("svg:tspan");s.tspan.setAttributeNS(null,"font-family",s.fontFamily);s.tspan.setAttributeNS(null,"font-size",`${pf(s.fontSize)}px`);s.tspan.setAttributeNS(null,"y",pf(-s.y))}showText(t){const e=this.current,s=e.font,n=e.fontSize;if(0===n)return;const a=e.fontSizeScale,r=e.charSpacing,c=e.wordSpacing,h=e.fontDirection,d=e.textHScale*h,u=s.vertical,p=u?1:-1,g=s.defaultVMetrics,f=n*e.fontMatrix[0];let m=0;for(const i of t){if(null===i){m+=h*c;continue}if("number"==typeof i){m+=p*i*n/1e3;continue}const t=(i.isSpace?c:0)+r,o=i.fontChar;let l,d,b,A=i.width;if(u){let t;const e=i.vmetric||g;t=i.vmetric?e[1]:.5*A;t=-t*f;const s=e[2]*f;A=e?-e[0]:A;l=t/a;d=(m+s)/a}else{l=m/a;d=0}if(i.isInFont||s.missingFile){e.xcoords.push(e.x+l);u&&e.ycoords.push(-e.y+d);e.tspan.textContent+=o}b=u?A*f-t*h:A*f+t*h;m+=b}e.tspan.setAttributeNS(null,"x",e.xcoords.map(pf).join(" "));u?e.tspan.setAttributeNS(null,"y",e.ycoords.map(pf).join(" ")):e.tspan.setAttributeNS(null,"y",pf(-e.y));u?e.y-=m:e.x+=m*d;e.tspan.setAttributeNS(null,"font-family",e.fontFamily);e.tspan.setAttributeNS(null,"font-size",`${pf(e.fontSize)}px`);e.fontStyle!==o.fontStyle&&e.tspan.setAttributeNS(null,"font-style",e.fontStyle);e.fontWeight!==o.fontWeight&&e.tspan.setAttributeNS(null,"font-weight",e.fontWeight);const b=e.textRenderingMode&i.TextRenderingMode.FILL_STROKE_MASK;if(b===i.TextRenderingMode.FILL||b===i.TextRenderingMode.FILL_STROKE){e.fillColor!==o.fillColor&&e.tspan.setAttributeNS(null,"fill",e.fillColor);e.fillAlpha<1&&e.tspan.setAttributeNS(null,"fill-opacity",e.fillAlpha)}else e.textRenderingMode===i.TextRenderingMode.ADD_TO_PATH?e.tspan.setAttributeNS(null,"fill","transparent"):e.tspan.setAttributeNS(null,"fill","none");if(b===i.TextRenderingMode.STROKE||b===i.TextRenderingMode.FILL_STROKE){const t=1/(e.textMatrixScale||1);this._setStrokeAttributes(e.tspan,t)}let A=e.textMatrix;if(0!==e.textRise){A=A.slice();A[5]+=e.textRise}e.txtElement.setAttributeNS(null,"transform",`${pm(A)} scale(${pf(d)}, -1)`);e.txtElement.setAttributeNS(l,"xml:space","preserve");e.txtElement.append(e.tspan);e.txtgrp.append(e.txtElement);this._ensureTransformGroup().append(e.txtElement)}setLeadingMoveText(t,e){this.setLeading(-e);this.moveText(t,e)}addFontStyle(t){if(!t.data)throw new Error('addFontStyle: No font data available, ensure that the "fontExtraProperties" API parameter is set.');if(!this.cssStyle){this.cssStyle=this.svgFactory.createElement("svg:style");this.cssStyle.setAttributeNS(null,"type","text/css");this.defs.append(this.cssStyle)}const e=createObjectURL(t.data,t.mimetype,this.forceDataSchema);this.cssStyle.textContent+=`@font-face { font-family: "${t.loadedName}"; src: url(${e}); }\n`}setFont(t){const e=this.current,s=this.commonObjs.get(t[0]);let n=t[1];e.font=s;if(this.embedFonts&&!s.missingFile&&!this.embeddedFonts[s.loadedName]){this.addFontStyle(s);this.embeddedFonts[s.loadedName]=s}e.fontMatrix=s.fontMatrix||i.FONT_IDENTITY_MATRIX;let a="normal";s.black?a="900":s.bold&&(a="bold");const r=s.italic?"italic":"normal";if(n<0){n=-n;e.fontDirection=-1}else e.fontDirection=1;e.fontSize=n;e.fontFamily=s.loadedName;e.fontWeight=a;e.fontStyle=r;e.tspan=this.svgFactory.createElement("svg:tspan");e.tspan.setAttributeNS(null,"y",pf(-e.y));e.xcoords=[];e.ycoords=[]}endText(){const t=this.current;if(t.textRenderingMode&i.TextRenderingMode.ADD_TO_PATH_FLAG&&t.txtElement?.hasChildNodes()){t.element=t.txtElement;this.clip("nonzero");this.endPath()}}setLineWidth(t){t>0&&(this.current.lineWidth=t)}setLineCap(t){this.current.lineCap=h[t]}setLineJoin(t){this.current.lineJoin=d[t]}setMiterLimit(t){this.current.miterLimit=t}setStrokeAlpha(t){this.current.strokeAlpha=t}setStrokeRGBColor(t,e,s){this.current.strokeColor=i.Util.makeHexColor(t,e,s)}setFillAlpha(t){this.current.fillAlpha=t}setFillRGBColor(t,e,s){this.current.fillColor=i.Util.makeHexColor(t,e,s);this.current.tspan=this.svgFactory.createElement("svg:tspan");this.current.xcoords=[];this.current.ycoords=[]}setStrokeColorN(t){this.current.strokeColor=this._makeColorN_Pattern(t)}setFillColorN(t){this.current.fillColor=this._makeColorN_Pattern(t)}shadingFill(t){const e=this.viewport.width,s=this.viewport.height,n=i.Util.inverseTransform(this.transformMatrix),a=i.Util.applyTransform([0,0],n),r=i.Util.applyTransform([0,s],n),o=i.Util.applyTransform([e,0],n),l=i.Util.applyTransform([e,s],n),c=Math.min(a[0],r[0],o[0],l[0]),h=Math.min(a[1],r[1],o[1],l[1]),d=Math.max(a[0],r[0],o[0],l[0]),u=Math.max(a[1],r[1],o[1],l[1]),p=this.svgFactory.createElement("svg:rect");p.setAttributeNS(null,"x",c);p.setAttributeNS(null,"y",h);p.setAttributeNS(null,"width",d-c);p.setAttributeNS(null,"height",u-h);p.setAttributeNS(null,"fill",this._makeShadingPattern(t));this.current.fillAlpha<1&&p.setAttributeNS(null,"fill-opacity",this.current.fillAlpha);this._ensureTransformGroup().append(p)}_makeColorN_Pattern(t){return"TilingPattern"===t[0]?this._makeTilingPattern(t):this._makeShadingPattern(t)}_makeTilingPattern(t){const e=t[1],s=t[2],n=t[3]||i.IDENTITY_MATRIX,[a,r,o,l]=t[4],c=t[5],h=t[6],d=t[7],u="shading"+f++,[p,g,m,b]=i.Util.normalizeRect([...i.Util.applyTransform([a,r],n),...i.Util.applyTransform([o,l],n)]),[A,_]=i.Util.singularValueDecompose2dScale(n),v=c*A,y=h*_,S=this.svgFactory.createElement("svg:pattern");S.setAttributeNS(null,"id",u);S.setAttributeNS(null,"patternUnits","userSpaceOnUse");S.setAttributeNS(null,"width",v);S.setAttributeNS(null,"height",y);S.setAttributeNS(null,"x",`${p}`);S.setAttributeNS(null,"y",`${g}`);const x=this.svg,E=this.transformMatrix,C=this.current.fillColor,P=this.current.strokeColor,T=this.svgFactory.create(m-p,b-g);this.svg=T;this.transformMatrix=n;if(2===d){const t=i.Util.makeHexColor(...e);this.current.fillColor=t;this.current.strokeColor=t}this.executeOpTree(this.convertOpList(s));this.svg=x;this.transformMatrix=E;this.current.fillColor=C;this.current.strokeColor=P;S.append(T.childNodes[0]);this.defs.append(S);return`url(#${u})`}_makeShadingPattern(t){"string"==typeof t&&(t=this.objs.get(t));switch(t[0]){case"RadialAxial":const e="shading"+f++,s=t[3];let n;switch(t[1]){case"axial":const s=t[4],i=t[5];n=this.svgFactory.createElement("svg:linearGradient");n.setAttributeNS(null,"id",e);n.setAttributeNS(null,"gradientUnits","userSpaceOnUse");n.setAttributeNS(null,"x1",s[0]);n.setAttributeNS(null,"y1",s[1]);n.setAttributeNS(null,"x2",i[0]);n.setAttributeNS(null,"y2",i[1]);break;case"radial":const a=t[4],r=t[5],o=t[6],l=t[7];n=this.svgFactory.createElement("svg:radialGradient");n.setAttributeNS(null,"id",e);n.setAttributeNS(null,"gradientUnits","userSpaceOnUse");n.setAttributeNS(null,"cx",r[0]);n.setAttributeNS(null,"cy",r[1]);n.setAttributeNS(null,"r",l);n.setAttributeNS(null,"fx",a[0]);n.setAttributeNS(null,"fy",a[1]);n.setAttributeNS(null,"fr",o);break;default:throw new Error(`Unknown RadialAxial type: ${t[1]}`)}for(const t of s){const e=this.svgFactory.createElement("svg:stop");e.setAttributeNS(null,"offset",t[0]);e.setAttributeNS(null,"stop-color",t[1]);n.append(e)}this.defs.append(n);return`url(#${e})`;case"Mesh":(0,i.warn)("Unimplemented pattern Mesh");return null;case"Dummy":return"hotpink";default:throw new Error(`Unknown IR type: ${t[0]}`)}}setDash(t,e){this.current.dashArray=t;this.current.dashPhase=e}constructPath(t,e){const s=this.current;let n=s.x,a=s.y,r=[],o=0;for(const s of t)switch(0|s){case i.OPS.rectangle:n=e[o++];a=e[o++];const t=n+e[o++],s=a+e[o++];r.push("M",pf(n),pf(a),"L",pf(t),pf(a),"L",pf(t),pf(s),"L",pf(n),pf(s),"Z");break;case i.OPS.moveTo:n=e[o++];a=e[o++];r.push("M",pf(n),pf(a));break;case i.OPS.lineTo:n=e[o++];a=e[o++];r.push("L",pf(n),pf(a));break;case i.OPS.curveTo:n=e[o+4];a=e[o+5];r.push("C",pf(e[o]),pf(e[o+1]),pf(e[o+2]),pf(e[o+3]),pf(n),pf(a));o+=6;break;case i.OPS.curveTo2:r.push("C",pf(n),pf(a),pf(e[o]),pf(e[o+1]),pf(e[o+2]),pf(e[o+3]));n=e[o+2];a=e[o+3];o+=4;break;case i.OPS.curveTo3:n=e[o+2];a=e[o+3];r.push("C",pf(e[o]),pf(e[o+1]),pf(n),pf(a),pf(n),pf(a));o+=4;break;case i.OPS.closePath:r.push("Z")}r=r.join(" ");if(s.path&&t.length>0&&t[0]!==i.OPS.rectangle&&t[0]!==i.OPS.moveTo)r=s.path.getAttributeNS(null,"d")+r;else{s.path=this.svgFactory.createElement("svg:path");this._ensureTransformGroup().append(s.path)}s.path.setAttributeNS(null,"d",r);s.path.setAttributeNS(null,"fill","none");s.element=s.path;s.setCurrentPoint(n,a)}endPath(){const t=this.current;t.path=null;if(!this.pendingClip)return;if(!t.element){this.pendingClip=null;return}const e="clippath"+p++,s=this.svgFactory.createElement("svg:clipPath");s.setAttributeNS(null,"id",e);s.setAttributeNS(null,"transform",pm(this.transformMatrix));const n=t.element.cloneNode(!0);"evenodd"===this.pendingClip?n.setAttributeNS(null,"clip-rule","evenodd"):n.setAttributeNS(null,"clip-rule","nonzero");this.pendingClip=null;s.append(n);this.defs.append(s);if(t.activeClipUrl){t.clipGroup=null;for(const t of this.extraStack)t.clipGroup=null;s.setAttributeNS(null,"clip-path",t.activeClipUrl)}t.activeClipUrl=`url(#${e})`;this.tgrp=null}clip(t){this.pendingClip=t}closePath(){const t=this.current;if(t.path){const e=`${t.path.getAttributeNS(null,"d")}Z`;t.path.setAttributeNS(null,"d",e)}}setLeading(t){this.current.leading=-t}setTextRise(t){this.current.textRise=t}setTextRenderingMode(t){this.current.textRenderingMode=t}setHScale(t){this.current.textHScale=t/100}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[e,s]of t)switch(e){case"LW":this.setLineWidth(s);break;case"LC":this.setLineCap(s);break;case"LJ":this.setLineJoin(s);break;case"ML":this.setMiterLimit(s);break;case"D":this.setDash(s[0],s[1]);break;case"RI":this.setRenderingIntent(s);break;case"FL":this.setFlatness(s);break;case"Font":this.setFont(s);break;case"CA":this.setStrokeAlpha(s);break;case"ca":this.setFillAlpha(s);break;default:(0,i.warn)(`Unimplemented graphic state operator ${e}`)}}fill(){const t=this.current;if(t.element){t.element.setAttributeNS(null,"fill",t.fillColor);t.element.setAttributeNS(null,"fill-opacity",t.fillAlpha);this.endPath()}}stroke(){const t=this.current;if(t.element){this._setStrokeAttributes(t.element);t.element.setAttributeNS(null,"fill","none");this.endPath()}}_setStrokeAttributes(t,e=1){const s=this.current;let n=s.dashArray;1!==e&&n.length>0&&(n=n.map((function(t){return e*t})));t.setAttributeNS(null,"stroke",s.strokeColor);t.setAttributeNS(null,"stroke-opacity",s.strokeAlpha);t.setAttributeNS(null,"stroke-miterlimit",pf(s.miterLimit));t.setAttributeNS(null,"stroke-linecap",s.lineCap);t.setAttributeNS(null,"stroke-linejoin",s.lineJoin);t.setAttributeNS(null,"stroke-width",pf(e*s.lineWidth)+"px");t.setAttributeNS(null,"stroke-dasharray",n.map(pf).join(" "));t.setAttributeNS(null,"stroke-dashoffset",pf(e*s.dashPhase)+"px")}eoFill(){this.current.element?.setAttributeNS(null,"fill-rule","evenodd");this.fill()}fillStroke(){this.stroke();this.fill()}eoFillStroke(){this.current.element?.setAttributeNS(null,"fill-rule","evenodd");this.fillStroke()}closeStroke(){this.closePath();this.stroke()}closeFillStroke(){this.closePath();this.fillStroke()}closeEOFillStroke(){this.closePath();this.eoFillStroke()}paintSolidColorImageMask(){const t=this.svgFactory.createElement("svg:rect");t.setAttributeNS(null,"x","0");t.setAttributeNS(null,"y","0");t.setAttributeNS(null,"width","1px");t.setAttributeNS(null,"height","1px");t.setAttributeNS(null,"fill",this.current.fillColor);this._ensureTransformGroup().append(t)}paintImageXObject(t){const e=this.getObject(t);e?this.paintInlineImageXObject(e):(0,i.warn)(`Dependent image with object ID ${t} is not ready yet`)}paintInlineImageXObject(t,e){const s=t.width,n=t.height,i=u(t,this.forceDataSchema,!!e),a=this.svgFactory.createElement("svg:rect");a.setAttributeNS(null,"x","0");a.setAttributeNS(null,"y","0");a.setAttributeNS(null,"width",pf(s));a.setAttributeNS(null,"height",pf(n));this.current.element=a;this.clip("nonzero");const r=this.svgFactory.createElement("svg:image");r.setAttributeNS(c,"xlink:href",i);r.setAttributeNS(null,"x","0");r.setAttributeNS(null,"y",pf(-n));r.setAttributeNS(null,"width",pf(s)+"px");r.setAttributeNS(null,"height",pf(n)+"px");r.setAttributeNS(null,"transform",`scale(${pf(1/s)} ${pf(-1/n)})`);e?e.append(r):this._ensureTransformGroup().append(r)}paintImageMaskXObject(t){const e=this.getObject(t.data,t);if(e.bitmap){(0,i.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");return}const s=this.current,n=e.width,a=e.height,r=s.fillColor;s.maskId="mask"+g++;const o=this.svgFactory.createElement("svg:mask");o.setAttributeNS(null,"id",s.maskId);const l=this.svgFactory.createElement("svg:rect");l.setAttributeNS(null,"x","0");l.setAttributeNS(null,"y","0");l.setAttributeNS(null,"width",pf(n));l.setAttributeNS(null,"height",pf(a));l.setAttributeNS(null,"fill",r);l.setAttributeNS(null,"mask",`url(#${s.maskId})`);this.defs.append(o);this._ensureTransformGroup().append(l);this.paintInlineImageXObject(e,o)}paintFormXObjectBegin(t,e){Array.isArray(t)&&6===t.length&&this.transform(t[0],t[1],t[2],t[3],t[4],t[5]);if(e){const t=e[2]-e[0],s=e[3]-e[1],n=this.svgFactory.createElement("svg:rect");n.setAttributeNS(null,"x",e[0]);n.setAttributeNS(null,"y",e[1]);n.setAttributeNS(null,"width",pf(t));n.setAttributeNS(null,"height",pf(s));this.current.element=n;this.clip("nonzero");this.endPath()}}paintFormXObjectEnd(){}_initialize(t){const e=this.svgFactory.create(t.width,t.height),s=this.svgFactory.createElement("svg:defs");e.append(s);this.defs=s;const n=this.svgFactory.createElement("svg:g");n.setAttributeNS(null,"transform",pm(t.transform));e.append(n);this.svg=n;return e}_ensureClipGroup(){if(!this.current.clipGroup){const t=this.svgFactory.createElement("svg:g");t.setAttributeNS(null,"clip-path",this.current.activeClipUrl);this.svg.append(t);this.current.clipGroup=t}return this.current.clipGroup}_ensureTransformGroup(){if(!this.tgrp){this.tgrp=this.svgFactory.createElement("svg:g");this.tgrp.setAttributeNS(null,"transform",pm(this.transformMatrix));this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)}return this.tgrp}}}}],__webpack_module_cache__={};function __w_pdfjs_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var s=__webpack_module_cache__[t]={exports:{}};__webpack_modules__[t](s,s.exports,__w_pdfjs_require__);return s.exports}var __webpack_exports__={};(()=>{var t=__webpack_exports__;Object.defineProperty(t,"__esModule",{value:!0});Object.defineProperty(t,"AbortException",{enumerable:!0,get:function(){return e.AbortException}});Object.defineProperty(t,"AnnotationEditorLayer",{enumerable:!0,get:function(){return a.AnnotationEditorLayer}});Object.defineProperty(t,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return e.AnnotationEditorParamsType}});Object.defineProperty(t,"AnnotationEditorType",{enumerable:!0,get:function(){return e.AnnotationEditorType}});Object.defineProperty(t,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return r.AnnotationEditorUIManager}});Object.defineProperty(t,"AnnotationLayer",{enumerable:!0,get:function(){return o.AnnotationLayer}});Object.defineProperty(t,"AnnotationMode",{enumerable:!0,get:function(){return e.AnnotationMode}});Object.defineProperty(t,"CMapCompressionType",{enumerable:!0,get:function(){return e.CMapCompressionType}});Object.defineProperty(t,"FeatureTest",{enumerable:!0,get:function(){return e.FeatureTest}});Object.defineProperty(t,"GlobalWorkerOptions",{enumerable:!0,get:function(){return l.GlobalWorkerOptions}});Object.defineProperty(t,"InvalidPDFException",{enumerable:!0,get:function(){return e.InvalidPDFException}});Object.defineProperty(t,"MissingPDFException",{enumerable:!0,get:function(){return e.MissingPDFException}});Object.defineProperty(t,"OPS",{enumerable:!0,get:function(){return e.OPS}});Object.defineProperty(t,"PDFDataRangeTransport",{enumerable:!0,get:function(){return s.PDFDataRangeTransport}});Object.defineProperty(t,"PDFDateString",{enumerable:!0,get:function(){return n.PDFDateString}});Object.defineProperty(t,"PDFWorker",{enumerable:!0,get:function(){return s.PDFWorker}});Object.defineProperty(t,"PasswordResponses",{enumerable:!0,get:function(){return e.PasswordResponses}});Object.defineProperty(t,"PermissionFlag",{enumerable:!0,get:function(){return e.PermissionFlag}});Object.defineProperty(t,"PixelsPerInch",{enumerable:!0,get:function(){return n.PixelsPerInch}});Object.defineProperty(t,"RenderingCancelledException",{enumerable:!0,get:function(){return n.RenderingCancelledException}});Object.defineProperty(t,"SVGGraphics",{enumerable:!0,get:function(){return c.SVGGraphics}});Object.defineProperty(t,"UNSUPPORTED_FEATURES",{enumerable:!0,get:function(){return e.UNSUPPORTED_FEATURES}});Object.defineProperty(t,"UnexpectedResponseException",{enumerable:!0,get:function(){return e.UnexpectedResponseException}});Object.defineProperty(t,"Util",{enumerable:!0,get:function(){return e.Util}});Object.defineProperty(t,"VerbosityLevel",{enumerable:!0,get:function(){return e.VerbosityLevel}});Object.defineProperty(t,"XfaLayer",{enumerable:!0,get:function(){return h.XfaLayer}});Object.defineProperty(t,"build",{enumerable:!0,get:function(){return s.build}});Object.defineProperty(t,"createPromiseCapability",{enumerable:!0,get:function(){return e.createPromiseCapability}});Object.defineProperty(t,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return e.createValidAbsoluteUrl}});Object.defineProperty(t,"getDocument",{enumerable:!0,get:function(){return s.getDocument}});Object.defineProperty(t,"getFilenameFromUrl",{enumerable:!0,get:function(){return n.getFilenameFromUrl}});Object.defineProperty(t,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return n.getPdfFilenameFromUrl}});Object.defineProperty(t,"getXfaPageViewport",{enumerable:!0,get:function(){return n.getXfaPageViewport}});Object.defineProperty(t,"isDataScheme",{enumerable:!0,get:function(){return n.isDataScheme}});Object.defineProperty(t,"isPdfFile",{enumerable:!0,get:function(){return n.isPdfFile}});Object.defineProperty(t,"loadScript",{enumerable:!0,get:function(){return n.loadScript}});Object.defineProperty(t,"renderTextLayer",{enumerable:!0,get:function(){return i.renderTextLayer}});Object.defineProperty(t,"setLayerDimensions",{enumerable:!0,get:function(){return n.setLayerDimensions}});Object.defineProperty(t,"shadow",{enumerable:!0,get:function(){return e.shadow}});Object.defineProperty(t,"updateTextLayer",{enumerable:!0,get:function(){return i.updateTextLayer}});Object.defineProperty(t,"version",{enumerable:!0,get:function(){return s.version}});var e=__w_pdfjs_require__(1),s=__w_pdfjs_require__(2),n=__w_pdfjs_require__(6),i=__w_pdfjs_require__(26),a=__w_pdfjs_require__(27),r=__w_pdfjs_require__(5),o=__w_pdfjs_require__(32),l=__w_pdfjs_require__(14),c=__w_pdfjs_require__(35),h=__w_pdfjs_require__(34)})();return __webpack_exports__})())); \ No newline at end of file
diff --git a/vhosts/blog/public/pdf.worker.min.js b/vhosts/blog/public/pdf.worker.min.js
new file mode 100644
index 00000000..058b9a37
--- /dev/null
+++ b/vhosts/blog/public/pdf.worker.min.js
@@ -0,0 +1,22 @@
+/**
+ * @licstart The following is the entire license notice for the
+ * JavaScript code in this page
+ *
+ * Copyright 2023 Mozilla Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * @licend The above is the entire license notice for the
+ * JavaScript code in this page
+ */
+!function webpackUniversalModuleDefinition(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("pdfjs-dist/build/pdf.worker",[],t):"object"==typeof exports?exports["pdfjs-dist/build/pdf.worker"]=t():e["pdfjs-dist/build/pdf.worker"]=e.pdfjsWorker=t()}(globalThis,(()=>(()=>{"use strict";var e=[,(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.WorkerTask=t.WorkerMessageHandler=void 0;var r=a(2),n=a(3),i=a(4),s=a(6),o=a(69),c=a(63),l=a(100),h=a(101),u=a(102);class WorkerTask{constructor(e){this.name=e;this.terminated=!1;this._capability=(0,r.createPromiseCapability)()}get finished(){return this._capability.promise}finish(){this._capability.resolve()}terminate(){this.terminated=!0}ensureNotTerminated(){if(this.terminated)throw new Error("Worker task was terminated")}}t.WorkerTask=WorkerTask;class WorkerMessageHandler{static setup(e,t){let a=!1;e.on("test",(function(t){if(!a){a=!0;e.send("test",t instanceof Uint8Array)}}));e.on("configure",(function(e){(0,r.setVerbosityLevel)(e.verbosity)}));e.on("GetDocRequest",(function(e){return WorkerMessageHandler.createDocumentHandler(e,t)}))}static createDocumentHandler(e,t){let a,d=!1,f=null;const g=new Set,p=(0,r.getVerbosityLevel)(),{docId:m,apiVersion:b}=e,y="3.4.120";if(b!==y)throw new Error(`The API version "${b}" does not match the Worker version "${y}".`);const w=[];for(const e in[])w.push(e);if(w.length)throw new Error("The `Array.prototype` contains unexpected enumerable properties: "+w.join(", ")+"; thus breaking e.g. `for...in` iteration of `Array`s.");if("undefined"==typeof ReadableStream){const e="The browser/environment lacks native support for critical functionality used by the PDF.js library (e.g. `ReadableStream`); ";if(l.isNodeJS)throw new Error(e+"please use a `legacy`-build instead.");throw new Error(e+"please update to a supported browser.")}const S=m+"_worker";let x=new h.MessageHandler(S,m,t);function ensureNotTerminated(){if(d)throw new Error("Worker was terminated")}function startWorkerTask(e){g.add(e)}function finishWorkerTask(e){e.finish();g.delete(e)}async function loadDocument(e){await a.ensureDoc("checkHeader");await a.ensureDoc("parseStartXRef");await a.ensureDoc("parse",[e]);await a.ensureDoc("checkFirstPage",[e]);await a.ensureDoc("checkLastPage",[e]);const t=await a.ensureDoc("isPureXfa");if(t){const e=new WorkerTask("loadXfaFonts");startWorkerTask(e);await Promise.all([a.loadXfaFonts(x,e).catch((e=>{})).then((()=>finishWorkerTask(e))),a.loadXfaImages()])}const[r,n]=await Promise.all([a.ensureDoc("numPages"),a.ensureDoc("fingerprints")]);return{numPages:r,fingerprints:n,htmlForXfa:t?await a.ensureDoc("htmlForXfa"):null}}function getPdfManager({data:e,password:t,disableAutoFetch:a,rangeChunkSize:i,length:o,docBaseUrl:c,enableXfa:l,evaluatorOptions:h}){const d={source:null,disableAutoFetch:a,docBaseUrl:c,docId:m,enableXfa:l,evaluatorOptions:h,handler:x,length:o,password:t,rangeChunkSize:i},g=(0,r.createPromiseCapability)();let p;if(e){try{d.source=e;p=new s.LocalPdfManager(d);g.resolve(p)}catch(e){g.reject(e)}return g.promise}let b,y=[];try{b=new u.PDFWorkerStream(x)}catch(e){g.reject(e);return g.promise}const w=b.getFullReader();w.headersReady.then((function(){if(w.isRangeSupported){d.source=b;d.length=w.contentLength;d.disableAutoFetch=d.disableAutoFetch||w.isStreamingSupported;p=new s.NetworkPdfManager(d);for(const e of y)p.sendProgressiveData(e);y=[];g.resolve(p);f=null}})).catch((function(e){g.reject(e);f=null}));let S=0;new Promise((function(e,t){const readChunk=function({value:e,done:a}){try{ensureNotTerminated();if(a){p||function(){const e=(0,n.arrayBuffersToBytes)(y);o&&e.length!==o&&(0,r.warn)("reported HTTP length is different from actual");try{d.source=e;p=new s.LocalPdfManager(d);g.resolve(p)}catch(e){g.reject(e)}y=[]}();f=null;return}S+=e.byteLength;w.isStreamingSupported||x.send("DocProgress",{loaded:S,total:Math.max(S,w.contentLength||0)});p?p.sendProgressiveData(e):y.push(e);w.read().then(readChunk,t)}catch(e){t(e)}};w.read().then(readChunk,t)})).catch((function(e){g.reject(e);f=null}));f=function(e){b.cancelAllRequests(e)};return g.promise}x.on("GetPage",(function(e){return a.getPage(e.pageIndex).then((function(e){return Promise.all([a.ensure(e,"rotate"),a.ensure(e,"ref"),a.ensure(e,"userUnit"),a.ensure(e,"view")]).then((function([e,t,a,r]){return{rotate:e,ref:t,userUnit:a,view:r}}))}))}));x.on("GetPageIndex",(function(e){const t=i.Ref.get(e.num,e.gen);return a.ensureCatalog("getPageIndex",[t])}));x.on("GetDestinations",(function(e){return a.ensureCatalog("destinations")}));x.on("GetDestination",(function(e){return a.ensureCatalog("getDestination",[e.id])}));x.on("GetPageLabels",(function(e){return a.ensureCatalog("pageLabels")}));x.on("GetPageLayout",(function(e){return a.ensureCatalog("pageLayout")}));x.on("GetPageMode",(function(e){return a.ensureCatalog("pageMode")}));x.on("GetViewerPreferences",(function(e){return a.ensureCatalog("viewerPreferences")}));x.on("GetOpenAction",(function(e){return a.ensureCatalog("openAction")}));x.on("GetAttachments",(function(e){return a.ensureCatalog("attachments")}));x.on("GetJavaScript",(function(e){return a.ensureCatalog("javaScript")}));x.on("GetDocJSActions",(function(e){return a.ensureCatalog("jsActions")}));x.on("GetPageJSActions",(function({pageIndex:e}){return a.getPage(e).then((function(e){return a.ensure(e,"jsActions")}))}));x.on("GetOutline",(function(e){return a.ensureCatalog("documentOutline")}));x.on("GetOptionalContentConfig",(function(e){return a.ensureCatalog("optionalContentConfig")}));x.on("GetPermissions",(function(e){return a.ensureCatalog("permissions")}));x.on("GetMetadata",(function(e){return Promise.all([a.ensureDoc("documentInfo"),a.ensureCatalog("metadata")])}));x.on("GetMarkInfo",(function(e){return a.ensureCatalog("markInfo")}));x.on("GetData",(function(e){return a.requestLoadedStream().then((function(e){return e.bytes}))}));x.on("GetAnnotations",(function({pageIndex:e,intent:t}){return a.getPage(e).then((function(a){const r=new WorkerTask(`GetAnnotations: page ${e}`);startWorkerTask(r);return a.getAnnotationsData(x,r,t).then((e=>{finishWorkerTask(r);return e}),(e=>{finishWorkerTask(r);throw e}))}))}));x.on("GetFieldObjects",(function(e){return a.ensureDoc("fieldObjects")}));x.on("HasJSActions",(function(e){return a.ensureDoc("hasJSActions")}));x.on("GetCalculationOrderIds",(function(e){return a.ensureDoc("calculationOrderIds")}));x.on("SaveDocument",(function({isPureXfa:e,numPages:t,annotationStorage:s,filename:o}){const l=[a.requestLoadedStream(),a.ensureCatalog("acroForm"),a.ensureCatalog("acroFormRef"),a.ensureDoc("xref"),a.ensureDoc("startXRef")],h=e?null:(0,n.getNewAnnotationsMap)(s);if(h)for(const[e,t]of h)l.push(a.getPage(e).then((a=>{const r=new WorkerTask(`Save (editor): page ${e}`);return a.saveNewAnnotations(x,r,t).finally((function(){finishWorkerTask(r)}))})));if(e)l.push(a.serializeXfaData(s));else for(let e=0;e<t;e++)l.push(a.getPage(e).then((function(t){const a=new WorkerTask(`Save: page ${e}`);return t.save(x,a,s).finally((function(){finishWorkerTask(a)}))})));return Promise.all(l).then((function([t,a,n,s,l,...h]){let u=[],d=null;if(e){d=h[0];if(!d)return t.bytes}else{u=h.flat(2);if(0===u.length)return t.bytes}const f=n&&a instanceof i.Dict&&u.some((e=>e.needAppearances)),g=a instanceof i.Dict&&a.get("XFA")||null;let p=null,m=!1;if(Array.isArray(g)){for(let e=0,t=g.length;e<t;e+=2)if("datasets"===g[e]){p=g[e+1];m=!0}null===p&&(p=s.getNewTemporaryRef())}else g&&(0,r.warn)("Unsupported XFA type.");let b=Object.create(null);if(s.trailer){const e=Object.create(null),t=s.trailer.get("Info")||null;t instanceof i.Dict&&t.forEach(((t,a)=>{"string"==typeof a&&(e[t]=(0,r.stringToPDFString)(a))}));b={rootRef:s.trailer.getRaw("Root")||null,encryptRef:s.trailer.getRaw("Encrypt")||null,newRef:s.getNewTemporaryRef(),infoRef:s.trailer.getRaw("Info")||null,info:e,fileIds:s.trailer.get("ID")||null,startXRef:l,filename:o}}try{return(0,c.incrementalUpdate)({originalData:t.bytes,xrefInfo:b,newRefs:u,xref:s,hasXfa:!!g,xfaDatasetsRef:p,hasXfaDatasetsEntry:m,needAppearances:f,acroFormRef:n,acroForm:a,xfaData:d})}finally{s.resetNewTemporaryRef()}}))}));x.on("GetOperatorList",(function(e,t){const n=e.pageIndex;a.getPage(n).then((function(a){const i=new WorkerTask(`GetOperatorList: page ${n}`);startWorkerTask(i);const s=p>=r.VerbosityLevel.INFOS?Date.now():0;a.getOperatorList({handler:x,sink:t,task:i,intent:e.intent,cacheKey:e.cacheKey,annotationStorage:e.annotationStorage}).then((function(e){finishWorkerTask(i);s&&(0,r.info)(`page=${n+1} - getOperatorList: time=${Date.now()-s}ms, len=${e.length}`);t.close()}),(function(e){finishWorkerTask(i);i.terminated||t.error(e)}))}))}));x.on("GetTextContent",(function(e,t){const n=e.pageIndex;a.getPage(n).then((function(a){const i=new WorkerTask("GetTextContent: page "+n);startWorkerTask(i);const s=p>=r.VerbosityLevel.INFOS?Date.now():0;a.extractTextContent({handler:x,task:i,sink:t,includeMarkedContent:e.includeMarkedContent,combineTextItems:e.combineTextItems}).then((function(){finishWorkerTask(i);s&&(0,r.info)(`page=${n+1} - getTextContent: time=`+(Date.now()-s)+"ms");t.close()}),(function(e){finishWorkerTask(i);i.terminated||t.error(e)}))}))}));x.on("GetStructTree",(function(e){return a.getPage(e.pageIndex).then((function(e){return a.ensure(e,"getStructTree")}))}));x.on("FontFallback",(function(e){return a.fontFallback(e.id,x)}));x.on("Cleanup",(function(e){return a.cleanup(!0)}));x.on("Terminate",(function(e){d=!0;const t=[];if(a){a.terminate(new r.AbortException("Worker was terminated."));const e=a.cleanup();t.push(e);a=null}else(0,o.clearGlobalCaches)();f&&f(new r.AbortException("Worker was terminated."));for(const e of g){t.push(e.finished);e.terminate()}return Promise.all(t).then((function(){x.destroy();x=null}))}));x.on("Ready",(function(t){!function setupDoc(e){function onSuccess(e){ensureNotTerminated();x.send("GetDoc",{pdfInfo:e})}function onFailure(e){ensureNotTerminated();if(e instanceof r.PasswordException){const t=new WorkerTask(`PasswordException: response ${e.code}`);startWorkerTask(t);x.sendWithPromise("PasswordRequest",e).then((function({password:e}){finishWorkerTask(t);a.updatePassword(e);pdfManagerReady()})).catch((function(){finishWorkerTask(t);x.send("DocException",e)}))}else e instanceof r.InvalidPDFException||e instanceof r.MissingPDFException||e instanceof r.UnexpectedResponseException||e instanceof r.UnknownErrorException?x.send("DocException",e):x.send("DocException",new r.UnknownErrorException(e.message,e.toString()))}function pdfManagerReady(){ensureNotTerminated();loadDocument(!1).then(onSuccess,(function(e){ensureNotTerminated();e instanceof n.XRefParseException?a.requestLoadedStream().then((function(){ensureNotTerminated();loadDocument(!0).then(onSuccess,onFailure)})):onFailure(e)}))}ensureNotTerminated();getPdfManager(e).then((function(e){if(d){e.terminate(new r.AbortException("Worker was terminated."));throw new Error("Worker was terminated")}a=e;a.requestLoadedStream(!0).then((e=>{x.send("DataLoaded",{length:e.bytes.byteLength})}))})).then(pdfManagerReady,onFailure)}(e);e=null}));return S}static initializeFromPort(e){const t=new h.MessageHandler("worker","main",e);WorkerMessageHandler.setup(t,e);t.send("ready",null)}}t.WorkerMessageHandler=WorkerMessageHandler;"undefined"==typeof window&&!l.isNodeJS&&"undefined"!=typeof self&&function isMessagePort(e){return"function"==typeof e.postMessage&&"onmessage"in e}(self)&&WorkerMessageHandler.initializeFromPort(self)},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.VerbosityLevel=t.Util=t.UnknownErrorException=t.UnexpectedResponseException=t.UNSUPPORTED_FEATURES=t.TextRenderingMode=t.RenderingIntentFlag=t.PermissionFlag=t.PasswordResponses=t.PasswordException=t.PageActionEventType=t.OPS=t.MissingPDFException=t.LINE_FACTOR=t.LINE_DESCENT_FACTOR=t.InvalidPDFException=t.ImageKind=t.IDENTITY_MATRIX=t.FormatError=t.FeatureTest=t.FONT_IDENTITY_MATRIX=t.DocumentActionEventType=t.CMapCompressionType=t.BaseException=t.BASELINE_FACTOR=t.AnnotationType=t.AnnotationStateModelType=t.AnnotationReviewState=t.AnnotationReplyType=t.AnnotationMode=t.AnnotationMarkedState=t.AnnotationFlag=t.AnnotationFieldFlag=t.AnnotationEditorType=t.AnnotationEditorPrefix=t.AnnotationEditorParamsType=t.AnnotationBorderStyleType=t.AnnotationActionEventType=t.AbortException=void 0;t.assert=function assert(e,t){e||unreachable(t)};t.bytesToString=function bytesToString(e){"object"==typeof e&&null!==e&&void 0!==e.length||unreachable("Invalid argument for bytesToString");const t=e.length,a=8192;if(t<a)return String.fromCharCode.apply(null,e);const r=[];for(let n=0;n<t;n+=a){const i=Math.min(n+a,t),s=e.subarray(n,i);r.push(String.fromCharCode.apply(null,s))}return r.join("")};t.createPromiseCapability=function createPromiseCapability(){const e=Object.create(null);let t=!1;Object.defineProperty(e,"settled",{get:()=>t});e.promise=new Promise((function(a,r){e.resolve=function(e){t=!0;a(e)};e.reject=function(e){t=!0;r(e)}}));return e};t.createValidAbsoluteUrl=function createValidAbsoluteUrl(e,t=null,a=null){if(!e)return null;try{if(a&&"string"==typeof e){if(a.addDefaultProtocol&&e.startsWith("www.")){const t=e.match(/\./g);t&&t.length>=2&&(e=`http://${e}`)}if(a.tryConvertEncoding)try{e=stringToUTF8String(e)}catch(e){}}const r=t?new URL(e,t):new URL(e);if(function _isValidProtocol(e){if(!e)return!1;switch(e.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(r))return r}catch(e){}return null};t.getModificationDate=function getModificationDate(e=new Date){return[e.getUTCFullYear().toString(),(e.getUTCMonth()+1).toString().padStart(2,"0"),e.getUTCDate().toString().padStart(2,"0"),e.getUTCHours().toString().padStart(2,"0"),e.getUTCMinutes().toString().padStart(2,"0"),e.getUTCSeconds().toString().padStart(2,"0")].join("")};t.getVerbosityLevel=function getVerbosityLevel(){return r};t.info=function info(e){r>=a.INFOS&&console.log(`Info: ${e}`)};t.isArrayBuffer=function isArrayBuffer(e){return"object"==typeof e&&null!==e&&void 0!==e.byteLength};t.isArrayEqual=function isArrayEqual(e,t){if(e.length!==t.length)return!1;for(let a=0,r=e.length;a<r;a++)if(e[a]!==t[a])return!1;return!0};t.objectFromMap=function objectFromMap(e){const t=Object.create(null);for(const[a,r]of e)t[a]=r;return t};t.objectSize=function objectSize(e){return Object.keys(e).length};t.setVerbosityLevel=function setVerbosityLevel(e){Number.isInteger(e)&&(r=e)};t.shadow=shadow;t.string32=function string32(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e)};t.stringToBytes=stringToBytes;t.stringToPDFString=function stringToPDFString(e){if(e[0]>="ï"){let t;"þ"===e[0]&&"ÿ"===e[1]?t="utf-16be":"ÿ"===e[0]&&"þ"===e[1]?t="utf-16le":"ï"===e[0]&&"»"===e[1]&&"¿"===e[2]&&(t="utf-8");if(t)try{const a=new TextDecoder(t,{fatal:!0}),r=stringToBytes(e);return a.decode(r)}catch(e){warn(`stringToPDFString: "${e}".`)}}const t=[];for(let a=0,r=e.length;a<r;a++){const r=s[e.charCodeAt(a)];t.push(r?String.fromCharCode(r):e.charAt(a))}return t.join("")};t.stringToUTF8String=stringToUTF8String;t.unreachable=unreachable;t.utf8StringToString=function utf8StringToString(e){return unescape(encodeURIComponent(e))};t.warn=warn;t.IDENTITY_MATRIX=[1,0,0,1,0,0];t.FONT_IDENTITY_MATRIX=[.001,0,0,.001,0,0];t.LINE_FACTOR=1.35;t.LINE_DESCENT_FACTOR=.35;t.BASELINE_FACTOR=.25925925925925924;t.RenderingIntentFlag={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};t.AnnotationMode={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};t.AnnotationEditorPrefix="pdfjs_internal_editor_";t.AnnotationEditorType={DISABLE:-1,NONE:0,FREETEXT:3,INK:15};t.AnnotationEditorParamsType={FREETEXT_SIZE:1,FREETEXT_COLOR:2,FREETEXT_OPACITY:3,INK_COLOR:11,INK_THICKNESS:12,INK_OPACITY:13};t.PermissionFlag={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};t.TextRenderingMode={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};t.ImageKind={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};t.AnnotationType={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26};t.AnnotationStateModelType={MARKED:"Marked",REVIEW:"Review"};t.AnnotationMarkedState={MARKED:"Marked",UNMARKED:"Unmarked"};t.AnnotationReviewState={ACCEPTED:"Accepted",REJECTED:"Rejected",CANCELLED:"Cancelled",COMPLETED:"Completed",NONE:"None"};t.AnnotationReplyType={GROUP:"Group",REPLY:"R"};t.AnnotationFlag={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};t.AnnotationFieldFlag={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};t.AnnotationBorderStyleType={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};t.AnnotationActionEventType={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"};t.DocumentActionEventType={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};t.PageActionEventType={O:"PageOpen",C:"PageClose"};const a={ERRORS:0,WARNINGS:1,INFOS:5};t.VerbosityLevel=a;t.CMapCompressionType={NONE:0,BINARY:1};t.OPS={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};t.UNSUPPORTED_FEATURES={forms:"forms",javaScript:"javaScript",signatures:"signatures",smask:"smask",shadingPattern:"shadingPattern",errorTilingPattern:"errorTilingPattern",errorExtGState:"errorExtGState",errorXObject:"errorXObject",errorFontLoadType3:"errorFontLoadType3",errorFontState:"errorFontState",errorFontMissing:"errorFontMissing",errorFontTranslate:"errorFontTranslate",errorColorSpace:"errorColorSpace",errorOperatorList:"errorOperatorList",errorFontToUnicode:"errorFontToUnicode",errorFontLoadNative:"errorFontLoadNative",errorFontBuildPath:"errorFontBuildPath",errorFontGetPath:"errorFontGetPath",errorMarkedContent:"errorMarkedContent",errorContentSubStream:"errorContentSubStream"};t.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let r=a.WARNINGS;function warn(e){r>=a.WARNINGS&&console.log(`Warning: ${e}`)}function unreachable(e){throw new Error(e)}function shadow(e,t,a,r=!1){Object.defineProperty(e,t,{value:a,enumerable:!r,configurable:!0,writable:!1});return a}const n=function BaseExceptionClosure(){function BaseException(e,t){this.constructor===BaseException&&unreachable("Cannot initialize BaseException.");this.message=e;this.name=t}BaseException.prototype=new Error;BaseException.constructor=BaseException;return BaseException}();t.BaseException=n;t.PasswordException=class PasswordException extends n{constructor(e,t){super(e,"PasswordException");this.code=t}};t.UnknownErrorException=class UnknownErrorException extends n{constructor(e,t){super(e,"UnknownErrorException");this.details=t}};t.InvalidPDFException=class InvalidPDFException extends n{constructor(e){super(e,"InvalidPDFException")}};t.MissingPDFException=class MissingPDFException extends n{constructor(e){super(e,"MissingPDFException")}};t.UnexpectedResponseException=class UnexpectedResponseException extends n{constructor(e,t){super(e,"UnexpectedResponseException");this.status=t}};t.FormatError=class FormatError extends n{constructor(e){super(e,"FormatError")}};t.AbortException=class AbortException extends n{constructor(e){super(e,"AbortException")}};function stringToBytes(e){"string"!=typeof e&&unreachable("Invalid argument for stringToBytes");const t=e.length,a=new Uint8Array(t);for(let r=0;r<t;++r)a[r]=255&e.charCodeAt(r);return a}t.FeatureTest=class FeatureTest{static get isLittleEndian(){return shadow(this,"isLittleEndian",function isLittleEndian(){const e=new Uint8Array(4);e[0]=1;return 1===new Uint32Array(e.buffer,0,1)[0]}())}static get isEvalSupported(){return shadow(this,"isEvalSupported",function isEvalSupported(){try{new Function("");return!0}catch(e){return!1}}())}static get isOffscreenCanvasSupported(){return shadow(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}static get platform(){return"undefined"==typeof navigator?shadow(this,"platform",{isWin:!1,isMac:!1}):shadow(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}};const i=[...Array(256).keys()].map((e=>e.toString(16).padStart(2,"0")));class Util{static makeHexColor(e,t,a){return`#${i[e]}${i[t]}${i[a]}`}static scaleMinMax(e,t){let a;if(e[0]){if(e[0]<0){a=t[0];t[0]=t[1];t[1]=a}t[0]*=e[0];t[1]*=e[0];if(e[3]<0){a=t[2];t[2]=t[3];t[3]=a}t[2]*=e[3];t[3]*=e[3]}else{a=t[0];t[0]=t[2];t[2]=a;a=t[1];t[1]=t[3];t[3]=a;if(e[1]<0){a=t[2];t[2]=t[3];t[3]=a}t[2]*=e[1];t[3]*=e[1];if(e[2]<0){a=t[0];t[0]=t[1];t[1]=a}t[0]*=e[2];t[1]*=e[2]}t[0]+=e[4];t[1]+=e[4];t[2]+=e[5];t[3]+=e[5]}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static applyTransform(e,t){return[e[0]*t[0]+e[1]*t[2]+t[4],e[0]*t[1]+e[1]*t[3]+t[5]]}static applyInverseTransform(e,t){const a=t[0]*t[3]-t[1]*t[2];return[(e[0]*t[3]-e[1]*t[2]+t[2]*t[5]-t[4]*t[3])/a,(-e[0]*t[1]+e[1]*t[0]+t[4]*t[1]-t[5]*t[0])/a]}static getAxialAlignedBoundingBox(e,t){const a=Util.applyTransform(e,t),r=Util.applyTransform(e.slice(2,4),t),n=Util.applyTransform([e[0],e[3]],t),i=Util.applyTransform([e[2],e[1]],t);return[Math.min(a[0],r[0],n[0],i[0]),Math.min(a[1],r[1],n[1],i[1]),Math.max(a[0],r[0],n[0],i[0]),Math.max(a[1],r[1],n[1],i[1])]}static inverseTransform(e){const t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static singularValueDecompose2dScale(e){const t=[e[0],e[2],e[1],e[3]],a=e[0]*t[0]+e[1]*t[2],r=e[0]*t[1]+e[1]*t[3],n=e[2]*t[0]+e[3]*t[2],i=e[2]*t[1]+e[3]*t[3],s=(a+i)/2,o=Math.sqrt((a+i)**2-4*(a*i-n*r))/2,c=s+o||1,l=s-o||1;return[Math.sqrt(c),Math.sqrt(l)]}static normalizeRect(e){const t=e.slice(0);if(e[0]>e[2]){t[0]=e[2];t[2]=e[0]}if(e[1]>e[3]){t[1]=e[3];t[3]=e[1]}return t}static intersect(e,t){const a=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),r=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(a>r)return null;const n=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),i=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return n>i?null:[a,n,r,i]}static bezierBoundingBox(e,t,a,r,n,i,s,o){const c=[],l=[[],[]];let h,u,d,f,g,p,m,b;for(let l=0;l<2;++l){if(0===l){u=6*e-12*a+6*n;h=-3*e+9*a-9*n+3*s;d=3*a-3*e}else{u=6*t-12*r+6*i;h=-3*t+9*r-9*i+3*o;d=3*r-3*t}if(Math.abs(h)<1e-12){if(Math.abs(u)<1e-12)continue;f=-d/u;0<f&&f<1&&c.push(f)}else{m=u*u-4*d*h;b=Math.sqrt(m);if(!(m<0)){g=(-u+b)/(2*h);0<g&&g<1&&c.push(g);p=(-u-b)/(2*h);0<p&&p<1&&c.push(p)}}}let y,w=c.length;const S=w;for(;w--;){f=c[w];y=1-f;l[0][w]=y*y*y*e+3*y*y*f*a+3*y*f*f*n+f*f*f*s;l[1][w]=y*y*y*t+3*y*y*f*r+3*y*f*f*i+f*f*f*o}l[0][S]=e;l[1][S]=t;l[0][S+1]=s;l[1][S+1]=o;l[0].length=l[1].length=S+2;return[Math.min(...l[0]),Math.min(...l[1]),Math.max(...l[0]),Math.max(...l[1])]}}t.Util=Util;const s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function stringToUTF8String(e){return decodeURIComponent(escape(e))}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.XRefParseException=t.XRefEntryException=t.ParserEOFException=t.PDF_VERSION_REGEXP=t.MissingDataException=void 0;t.arrayBuffersToBytes=function arrayBuffersToBytes(e){const t=e.length;if(0===t)return new Uint8Array(0);if(1===t)return new Uint8Array(e[0]);let a=0;for(let r=0;r<t;r++)a+=e[r].byteLength;const r=new Uint8Array(a);let n=0;for(let a=0;a<t;a++){const t=new Uint8Array(e[a]);r.set(t,n);n+=t.byteLength}return r};t.collectActions=function collectActions(e,t,a){const i=Object.create(null),s=getInheritableProperty({dict:t,key:"AA",stopWhenFound:!1});if(s)for(let t=s.length-1;t>=0;t--){const r=s[t];if(r instanceof n.Dict)for(const t of r.getKeys()){const s=a[t];if(!s)continue;const o=[];_collectJS(r.getRaw(t),e,o,new n.RefSet);o.length>0&&(i[s]=o)}}if(t.has("A")){const a=[];_collectJS(t.get("A"),e,a,new n.RefSet);a.length>0&&(i.Action=a)}return(0,r.objectSize)(i)>0?i:null};t.encodeToXmlString=function encodeToXmlString(e){const t=[];let a=0;for(let r=0,n=e.length;r<n;r++){const n=e.codePointAt(r);if(32<=n&&n<=126){const i=o[n];if(i){a<r&&t.push(e.substring(a,r));t.push(i);a=r+1}}else{a<r&&t.push(e.substring(a,r));t.push(`&#x${n.toString(16).toUpperCase()};`);n>55295&&(n<57344||n>65533)&&r++;a=r+1}}if(0===t.length)return e;a<e.length&&t.push(e.substring(a,e.length));return t.join("")};t.escapePDFName=function escapePDFName(e){const t=[];let a=0;for(let r=0,n=e.length;r<n;r++){const n=e.charCodeAt(r);if(n<33||n>126||35===n||40===n||41===n||60===n||62===n||91===n||93===n||123===n||125===n||47===n||37===n){a<r&&t.push(e.substring(a,r));t.push(`#${n.toString(16)}`);a=r+1}}if(0===t.length)return e;a<e.length&&t.push(e.substring(a,e.length));return t.join("")};t.escapeString=function escapeString(e){return e.replace(/([()\\\n\r])/g,(e=>"\n"===e?"\\n":"\r"===e?"\\r":`\\${e}`))};t.getArrayLookupTableFactory=function getArrayLookupTableFactory(e){let t;return function(){if(e){let a=e();e=null;t=Object.create(null);for(let e=0,r=a.length;e<r;e+=2)t[a[e]]=a[e+1];a=null}return t}};t.getInheritableProperty=getInheritableProperty;t.getLookupTableFactory=function getLookupTableFactory(e){let t;return function(){if(e){t=Object.create(null);e(t);e=null}return t}};t.getNewAnnotationsMap=function getNewAnnotationsMap(e){if(!e)return null;const t=new Map;for(const[a,n]of e){if(!a.startsWith(r.AnnotationEditorPrefix))continue;let e=t.get(n.pageIndex);if(!e){e=[];t.set(n.pageIndex,e)}e.push(n)}return t.size>0?t:null};t.getRotationMatrix=function getRotationMatrix(e,t,a){switch(e){case 90:return[0,1,-1,0,t,0];case 180:return[-1,0,0,-1,t,a];case 270:return[0,-1,1,0,0,a];default:throw new Error("Invalid rotation")}};t.isAscii=function isAscii(e){return/^[\x00-\x7F]*$/.test(e)};t.isWhiteSpace=function isWhiteSpace(e){return 32===e||9===e||13===e||10===e};t.log2=function log2(e){if(e<=0)return 0;return Math.ceil(Math.log2(e))};t.numberToString=function numberToString(e){if(Number.isInteger(e))return e.toString();const t=Math.round(100*e);if(t%100==0)return(t/100).toString();if(t%10==0)return e.toFixed(1);return e.toFixed(2)};t.parseXFAPath=function parseXFAPath(e){const t=/(.+)\[(\d+)\]$/;return e.split(".").map((e=>{const a=e.match(t);return a?{name:a[1],pos:parseInt(a[2],10)}:{name:e,pos:0}}))};t.readInt8=function readInt8(e,t){return e[t]<<24>>24};t.readUint16=function readUint16(e,t){return e[t]<<8|e[t+1]};t.readUint32=function readUint32(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0};t.recoverJsURL=function recoverJsURL(e){const t=new RegExp("^\\s*("+["app.launchURL","window.open","xfa.host.gotoURL"].join("|").split(".").join("\\.")+")\\((?:'|\")([^'\"]*)(?:'|\")(?:,\\s*(\\w+)\\)|\\))","i").exec(e);if(t&&t[2]){const e=t[2];let a=!1;"true"===t[3]&&"app.launchURL"===t[1]&&(a=!0);return{url:e,newWindow:a}}return null};t.stringToUTF16HexString=function stringToUTF16HexString(e){const t=[];for(let a=0,r=e.length;a<r;a++){const r=e.charCodeAt(a);t.push((r>>8&255).toString(16).padStart(2,"0"),(255&r).toString(16).padStart(2,"0"))}return t.join("")};t.stringToUTF16String=function stringToUTF16String(e,t=!1){const a=[];t&&a.push("þÿ");for(let t=0,r=e.length;t<r;t++){const r=e.charCodeAt(t);a.push(String.fromCharCode(r>>8&255),String.fromCharCode(255&r))}return a.join("")};t.toRomanNumerals=function toRomanNumerals(e,t=!1){(0,r.assert)(Number.isInteger(e)&&e>0,"The number should be a positive integer.");const a=[];let n;for(;e>=1e3;){e-=1e3;a.push("M")}n=e/100|0;e%=100;a.push(s[n]);n=e/10|0;e%=10;a.push(s[10+n]);a.push(s[20+e]);const i=a.join("");return t?i.toLowerCase():i};t.validateCSSFont=function validateCSSFont(e){const t=new Set(["100","200","300","400","500","600","700","800","900","1000","normal","bold","bolder","lighter"]),{fontFamily:a,fontWeight:n,italicAngle:i}=e;if(/^".*"$/.test(a)){if(/[^\\]"/.test(a.slice(1,a.length-1))){(0,r.warn)(`XFA - FontFamily contains some unescaped ": ${a}.`);return!1}}else if(/^'.*'$/.test(a)){if(/[^\\]'/.test(a.slice(1,a.length-1))){(0,r.warn)(`XFA - FontFamily contains some unescaped ': ${a}.`);return!1}}else for(const e of a.split(/[ \t]+/))if(/^(\d|(-(\d|-)))/.test(e)||!/^[\w-\\]+$/.test(e)){(0,r.warn)(`XFA - FontFamily contains some invalid <custom-ident>: ${a}.`);return!1}const s=n?n.toString():"";e.fontWeight=t.has(s)?s:"400";const o=parseFloat(i);e.italicAngle=isNaN(o)||o<-90||o>90?"14":i.toString();return!0};var r=a(2),n=a(4),i=a(5);t.PDF_VERSION_REGEXP=/^[1-9]\.\d$/;class MissingDataException extends r.BaseException{constructor(e,t){super(`Missing data [${e}, ${t})`,"MissingDataException");this.begin=e;this.end=t}}t.MissingDataException=MissingDataException;class ParserEOFException extends r.BaseException{constructor(e){super(e,"ParserEOFException")}}t.ParserEOFException=ParserEOFException;class XRefEntryException extends r.BaseException{constructor(e){super(e,"XRefEntryException")}}t.XRefEntryException=XRefEntryException;class XRefParseException extends r.BaseException{constructor(e){super(e,"XRefParseException")}}t.XRefParseException=XRefParseException;function getInheritableProperty({dict:e,key:t,getArray:a=!1,stopWhenFound:r=!0}){let i;const s=new n.RefSet;for(;e instanceof n.Dict&&(!e.objId||!s.has(e.objId));){e.objId&&s.put(e.objId);const n=a?e.getArray(t):e.get(t);if(void 0!==n){if(r)return n;i||(i=[]);i.push(n)}e=e.get("Parent")}return i}const s=["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM","","X","XX","XXX","XL","L","LX","LXX","LXXX","XC","","I","II","III","IV","V","VI","VII","VIII","IX"];function _collectJS(e,t,a,s){if(!e)return;let o=null;if(e instanceof n.Ref){if(s.has(e))return;o=e;s.put(o);e=t.fetch(e)}if(Array.isArray(e))for(const r of e)_collectJS(r,t,a,s);else if(e instanceof n.Dict){if((0,n.isName)(e.get("S"),"JavaScript")){const t=e.get("JS");let n;t instanceof i.BaseStream?n=t.getString():"string"==typeof t&&(n=t);n=n&&(0,r.stringToPDFString)(n).replace(/\u0000/g,"");n&&a.push(n)}_collectJS(e.getRaw("Next"),t,a,s)}o&&s.remove(o)}const o={60:"&lt;",62:"&gt;",38:"&amp;",34:"&quot;",39:"&apos;"}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.RefSetCache=t.RefSet=t.Ref=t.Name=t.EOF=t.Dict=t.Cmd=t.CIRCULAR_REF=void 0;t.clearPrimitiveCaches=function clearPrimitiveCaches(){o._clearCache();s._clearCache();l._clearCache()};t.isCmd=function isCmd(e,t){return e instanceof o&&(void 0===t||e.cmd===t)};t.isDict=function isDict(e,t){return e instanceof Dict&&(void 0===t||isName(e.get("Type"),t))};t.isName=isName;t.isRefsEqual=function isRefsEqual(e,t){return e.num===t.num&&e.gen===t.gen};var r=a(2);const n=Symbol("CIRCULAR_REF");t.CIRCULAR_REF=n;const i=Symbol("EOF");t.EOF=i;const s=function NameClosure(){let e=Object.create(null);class Name{constructor(e){this.name=e}static get(t){return e[t]||(e[t]=new Name(t))}static _clearCache(){e=Object.create(null)}}return Name}();t.Name=s;const o=function CmdClosure(){let e=Object.create(null);class Cmd{constructor(e){this.cmd=e}static get(t){return e[t]||(e[t]=new Cmd(t))}static _clearCache(){e=Object.create(null)}}return Cmd}();t.Cmd=o;const c=function nonSerializableClosure(){return c};class Dict{constructor(e=null){this._map=Object.create(null);this.xref=e;this.objId=null;this.suppressEncryption=!1;this.__nonSerializable__=c}assignXref(e){this.xref=e}get size(){return Object.keys(this._map).length}get(e,t,a){let r=this._map[e];if(void 0===r&&void 0!==t){r=this._map[t];void 0===r&&void 0!==a&&(r=this._map[a])}return r instanceof l&&this.xref?this.xref.fetch(r,this.suppressEncryption):r}async getAsync(e,t,a){let r=this._map[e];if(void 0===r&&void 0!==t){r=this._map[t];void 0===r&&void 0!==a&&(r=this._map[a])}return r instanceof l&&this.xref?this.xref.fetchAsync(r,this.suppressEncryption):r}getArray(e,t,a){let r=this._map[e];if(void 0===r&&void 0!==t){r=this._map[t];void 0===r&&void 0!==a&&(r=this._map[a])}r instanceof l&&this.xref&&(r=this.xref.fetch(r,this.suppressEncryption));if(Array.isArray(r)){r=r.slice();for(let e=0,t=r.length;e<t;e++)r[e]instanceof l&&this.xref&&(r[e]=this.xref.fetch(r[e],this.suppressEncryption))}return r}getRaw(e){return this._map[e]}getKeys(){return Object.keys(this._map)}getRawValues(){return Object.values(this._map)}set(e,t){this._map[e]=t}has(e){return void 0!==this._map[e]}forEach(e){for(const t in this._map)e(t,this.get(t))}static get empty(){const e=new Dict(null);e.set=(e,t)=>{(0,r.unreachable)("Should not call `set` on the empty dictionary.")};return(0,r.shadow)(this,"empty",e)}static merge({xref:e,dictArray:t,mergeSubDicts:a=!1}){const r=new Dict(e),n=new Map;for(const e of t)if(e instanceof Dict)for(const[t,r]of Object.entries(e._map)){let e=n.get(t);if(void 0===e){e=[];n.set(t,e)}else if(!(a&&r instanceof Dict))continue;e.push(r)}for(const[t,a]of n){if(1===a.length||!(a[0]instanceof Dict)){r._map[t]=a[0];continue}const n=new Dict(e);for(const e of a)for(const[t,a]of Object.entries(e._map))void 0===n._map[t]&&(n._map[t]=a);n.size>0&&(r._map[t]=n)}n.clear();return r.size>0?r:Dict.empty}}t.Dict=Dict;const l=function RefClosure(){let e=Object.create(null);class Ref{constructor(e,t){this.num=e;this.gen=t}toString(){return 0===this.gen?`${this.num}R`:`${this.num}R${this.gen}`}static get(t,a){const r=0===a?`${t}R`:`${t}R${a}`;return e[r]||(e[r]=new Ref(t,a))}static _clearCache(){e=Object.create(null)}}return Ref}();t.Ref=l;class RefSet{constructor(e=null){this._set=new Set(e&&e._set)}has(e){return this._set.has(e.toString())}put(e){this._set.add(e.toString())}remove(e){this._set.delete(e.toString())}[Symbol.iterator](){return this._set.values()}clear(){this._set.clear()}}t.RefSet=RefSet;class RefSetCache{constructor(){this._map=new Map}get size(){return this._map.size}get(e){return this._map.get(e.toString())}has(e){return this._map.has(e.toString())}put(e,t){this._map.set(e.toString(),t)}putAlias(e,t){this._map.set(e.toString(),this.get(t))}[Symbol.iterator](){return this._map.values()}clear(){this._map.clear()}}t.RefSetCache=RefSetCache;function isName(e,t){return e instanceof s&&(void 0===t||e.name===t)}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.BaseStream=void 0;var r=a(2);class BaseStream{constructor(){this.constructor===BaseStream&&(0,r.unreachable)("Cannot initialize BaseStream.")}get length(){(0,r.unreachable)("Abstract getter `length` accessed")}get isEmpty(){(0,r.unreachable)("Abstract getter `isEmpty` accessed")}get isDataLoaded(){return(0,r.shadow)(this,"isDataLoaded",!0)}getByte(){(0,r.unreachable)("Abstract method `getByte` called")}getBytes(e){(0,r.unreachable)("Abstract method `getBytes` called")}peekByte(){const e=this.getByte();-1!==e&&this.pos--;return e}peekBytes(e){const t=this.getBytes(e);this.pos-=t.length;return t}getUint16(){const e=this.getByte(),t=this.getByte();return-1===e||-1===t?-1:(e<<8)+t}getInt32(){return(this.getByte()<<24)+(this.getByte()<<16)+(this.getByte()<<8)+this.getByte()}getByteRange(e,t){(0,r.unreachable)("Abstract method `getByteRange` called")}getString(e){return(0,r.bytesToString)(this.getBytes(e))}skip(e){this.pos+=e||1}reset(){(0,r.unreachable)("Abstract method `reset` called")}moveStart(){(0,r.unreachable)("Abstract method `moveStart` called")}makeSubStream(e,t,a=null){(0,r.unreachable)("Abstract method `makeSubStream` called")}getBaseStreams(){return null}}t.BaseStream=BaseStream},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.NetworkPdfManager=t.LocalPdfManager=void 0;var r=a(2),n=a(7),i=a(3),s=a(9),o=a(8);class BasePdfManager{constructor(e){this.constructor===BasePdfManager&&(0,r.unreachable)("Cannot initialize BasePdfManager.");this._docBaseUrl=function parseDocBaseUrl(e){if(e){const t=(0,r.createValidAbsoluteUrl)(e);if(t)return t.href;(0,r.warn)(`Invalid absolute docBaseUrl: "${e}".`)}return null}(e.docBaseUrl);this._docId=e.docId;this._password=e.password;this.enableXfa=e.enableXfa;this.evaluatorOptions=e.evaluatorOptions}get docId(){return this._docId}get password(){return this._password}get docBaseUrl(){const e=this.pdfDocument.catalog;return(0,r.shadow)(this,"docBaseUrl",e.baseUrl||this._docBaseUrl)}ensureDoc(e,t){return this.ensure(this.pdfDocument,e,t)}ensureXRef(e,t){return this.ensure(this.pdfDocument.xref,e,t)}ensureCatalog(e,t){return this.ensure(this.pdfDocument.catalog,e,t)}getPage(e){return this.pdfDocument.getPage(e)}fontFallback(e,t){return this.pdfDocument.fontFallback(e,t)}loadXfaFonts(e,t){return this.pdfDocument.loadXfaFonts(e,t)}loadXfaImages(){return this.pdfDocument.loadXfaImages()}serializeXfaData(e){return this.pdfDocument.serializeXfaData(e)}cleanup(e=!1){return this.pdfDocument.cleanup(e)}async ensure(e,t,a){(0,r.unreachable)("Abstract method `ensure` called")}requestRange(e,t){(0,r.unreachable)("Abstract method `requestRange` called")}requestLoadedStream(e=!1){(0,r.unreachable)("Abstract method `requestLoadedStream` called")}sendProgressiveData(e){(0,r.unreachable)("Abstract method `sendProgressiveData` called")}updatePassword(e){this._password=e}terminate(e){(0,r.unreachable)("Abstract method `terminate` called")}}t.LocalPdfManager=class LocalPdfManager extends BasePdfManager{constructor(e){super(e);const t=new o.Stream(e.source);this.pdfDocument=new s.PDFDocument(this,t);this._loadedStreamPromise=Promise.resolve(t)}async ensure(e,t,a){const r=e[t];return"function"==typeof r?r.apply(e,a):r}requestRange(e,t){return Promise.resolve()}requestLoadedStream(e=!1){return this._loadedStreamPromise}terminate(e){}};t.NetworkPdfManager=class NetworkPdfManager extends BasePdfManager{constructor(e){super(e);this.streamManager=new n.ChunkedStreamManager(e.source,{msgHandler:e.handler,length:e.length,disableAutoFetch:e.disableAutoFetch,rangeChunkSize:e.rangeChunkSize});this.pdfDocument=new s.PDFDocument(this,this.streamManager.getStream())}async ensure(e,t,a){try{const r=e[t];return"function"==typeof r?r.apply(e,a):r}catch(r){if(!(r instanceof i.MissingDataException))throw r;await this.requestRange(r.begin,r.end);return this.ensure(e,t,a)}}requestRange(e,t){return this.streamManager.requestRange(e,t)}requestLoadedStream(e=!1){return this.streamManager.requestAllChunks(e)}sendProgressiveData(e){this.streamManager.onReceiveData({chunk:e})}terminate(e){this.streamManager.abort(e)}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.ChunkedStreamManager=t.ChunkedStream=void 0;var r=a(3),n=a(2),i=a(8);class ChunkedStream extends i.Stream{constructor(e,t,a){super(new Uint8Array(e),0,e,null);this.chunkSize=t;this._loadedChunks=new Set;this.numChunks=Math.ceil(e/t);this.manager=a;this.progressiveDataLength=0;this.lastSuccessfulEnsureByteChunk=-1}getMissingChunks(){const e=[];for(let t=0,a=this.numChunks;t<a;++t)this._loadedChunks.has(t)||e.push(t);return e}get numChunksLoaded(){return this._loadedChunks.size}get isDataLoaded(){return this.numChunksLoaded===this.numChunks}onReceiveData(e,t){const a=this.chunkSize;if(e%a!=0)throw new Error(`Bad begin offset: ${e}`);const r=e+t.byteLength;if(r%a!=0&&r!==this.bytes.length)throw new Error(`Bad end offset: ${r}`);this.bytes.set(new Uint8Array(t),e);const n=Math.floor(e/a),i=Math.floor((r-1)/a)+1;for(let e=n;e<i;++e)this._loadedChunks.add(e)}onReceiveProgressiveData(e){let t=this.progressiveDataLength;const a=Math.floor(t/this.chunkSize);this.bytes.set(new Uint8Array(e),t);t+=e.byteLength;this.progressiveDataLength=t;const r=t>=this.end?this.numChunks:Math.floor(t/this.chunkSize);for(let e=a;e<r;++e)this._loadedChunks.add(e)}ensureByte(e){if(e<this.progressiveDataLength)return;const t=Math.floor(e/this.chunkSize);if(!(t>this.numChunks)&&t!==this.lastSuccessfulEnsureByteChunk){if(!this._loadedChunks.has(t))throw new r.MissingDataException(e,e+1);this.lastSuccessfulEnsureByteChunk=t}}ensureRange(e,t){if(e>=t)return;if(t<=this.progressiveDataLength)return;const a=Math.floor(e/this.chunkSize);if(a>this.numChunks)return;const n=Math.min(Math.floor((t-1)/this.chunkSize)+1,this.numChunks);for(let i=a;i<n;++i)if(!this._loadedChunks.has(i))throw new r.MissingDataException(e,t)}nextEmptyChunk(e){const t=this.numChunks;for(let a=0;a<t;++a){const r=(e+a)%t;if(!this._loadedChunks.has(r))return r}return null}hasChunk(e){return this._loadedChunks.has(e)}getByte(){const e=this.pos;if(e>=this.end)return-1;e>=this.progressiveDataLength&&this.ensureByte(e);return this.bytes[this.pos++]}getBytes(e){const t=this.bytes,a=this.pos,r=this.end;if(!e){r>this.progressiveDataLength&&this.ensureRange(a,r);return t.subarray(a,r)}let n=a+e;n>r&&(n=r);n>this.progressiveDataLength&&this.ensureRange(a,n);this.pos=n;return t.subarray(a,n)}getByteRange(e,t){e<0&&(e=0);t>this.end&&(t=this.end);t>this.progressiveDataLength&&this.ensureRange(e,t);return this.bytes.subarray(e,t)}makeSubStream(e,t,a=null){t?e+t>this.progressiveDataLength&&this.ensureRange(e,e+t):e>=this.progressiveDataLength&&this.ensureByte(e);function ChunkedStreamSubstream(){}ChunkedStreamSubstream.prototype=Object.create(this);ChunkedStreamSubstream.prototype.getMissingChunks=function(){const e=this.chunkSize,t=Math.floor(this.start/e),a=Math.floor((this.end-1)/e)+1,r=[];for(let e=t;e<a;++e)this._loadedChunks.has(e)||r.push(e);return r};Object.defineProperty(ChunkedStreamSubstream.prototype,"isDataLoaded",{get(){return this.numChunksLoaded===this.numChunks||0===this.getMissingChunks().length},configurable:!0});const r=new ChunkedStreamSubstream;r.pos=r.start=e;r.end=e+t||this.end;r.dict=a;return r}getBaseStreams(){return[this]}}t.ChunkedStream=ChunkedStream;t.ChunkedStreamManager=class ChunkedStreamManager{constructor(e,t){this.length=t.length;this.chunkSize=t.rangeChunkSize;this.stream=new ChunkedStream(this.length,this.chunkSize,this);this.pdfNetworkStream=e;this.disableAutoFetch=t.disableAutoFetch;this.msgHandler=t.msgHandler;this.currRequestId=0;this._chunksNeededByRequest=new Map;this._requestsByChunk=new Map;this._promisesByRequest=new Map;this.progressiveDataLength=0;this.aborted=!1;this._loadedStreamCapability=(0,n.createPromiseCapability)()}sendRequest(e,t){const a=this.pdfNetworkStream.getRangeReader(e,t);a.isStreamingSupported||(a.onProgress=this.onProgress.bind(this));let n=[],i=0;return new Promise(((e,t)=>{const readChunk=({value:s,done:o})=>{try{if(o){const t=(0,r.arrayBuffersToBytes)(n);n=null;e(t);return}i+=s.byteLength;a.isStreamingSupported&&this.onProgress({loaded:i});n.push(s);a.read().then(readChunk,t)}catch(e){t(e)}};a.read().then(readChunk,t)})).then((t=>{this.aborted||this.onReceiveData({chunk:t,begin:e})}))}requestAllChunks(e=!1){if(!e){const e=this.stream.getMissingChunks();this._requestChunks(e)}return this._loadedStreamCapability.promise}_requestChunks(e){const t=this.currRequestId++,a=new Set;this._chunksNeededByRequest.set(t,a);for(const t of e)this.stream.hasChunk(t)||a.add(t);if(0===a.size)return Promise.resolve();const r=(0,n.createPromiseCapability)();this._promisesByRequest.set(t,r);const i=[];for(const e of a){let a=this._requestsByChunk.get(e);if(!a){a=[];this._requestsByChunk.set(e,a);i.push(e)}a.push(t)}if(i.length>0){const e=this.groupChunks(i);for(const t of e){const e=t.beginChunk*this.chunkSize,a=Math.min(t.endChunk*this.chunkSize,this.length);this.sendRequest(e,a).catch(r.reject)}}return r.promise.catch((e=>{if(!this.aborted)throw e}))}getStream(){return this.stream}requestRange(e,t){t=Math.min(t,this.length);const a=this.getBeginChunk(e),r=this.getEndChunk(t),n=[];for(let e=a;e<r;++e)n.push(e);return this._requestChunks(n)}requestRanges(e=[]){const t=[];for(const a of e){const e=this.getBeginChunk(a.begin),r=this.getEndChunk(a.end);for(let a=e;a<r;++a)t.includes(a)||t.push(a)}t.sort((function(e,t){return e-t}));return this._requestChunks(t)}groupChunks(e){const t=[];let a=-1,r=-1;for(let n=0,i=e.length;n<i;++n){const i=e[n];a<0&&(a=i);if(r>=0&&r+1!==i){t.push({beginChunk:a,endChunk:r+1});a=i}n+1===e.length&&t.push({beginChunk:a,endChunk:i+1});r=i}return t}onProgress(e){this.msgHandler.send("DocProgress",{loaded:this.stream.numChunksLoaded*this.chunkSize+e.loaded,total:this.length})}onReceiveData(e){const t=e.chunk,a=void 0===e.begin,r=a?this.progressiveDataLength:e.begin,n=r+t.byteLength,i=Math.floor(r/this.chunkSize),s=n<this.length?Math.floor(n/this.chunkSize):Math.ceil(n/this.chunkSize);if(a){this.stream.onReceiveProgressiveData(t);this.progressiveDataLength=n}else this.stream.onReceiveData(r,t);this.stream.isDataLoaded&&this._loadedStreamCapability.resolve(this.stream);const o=[];for(let e=i;e<s;++e){const t=this._requestsByChunk.get(e);if(t){this._requestsByChunk.delete(e);for(const a of t){const t=this._chunksNeededByRequest.get(a);t.has(e)&&t.delete(e);t.size>0||o.push(a)}}}if(!this.disableAutoFetch&&0===this._requestsByChunk.size){let e;if(1===this.stream.numChunksLoaded){const t=this.stream.numChunks-1;this.stream.hasChunk(t)||(e=t)}else e=this.stream.nextEmptyChunk(s);Number.isInteger(e)&&this._requestChunks([e])}for(const e of o){const t=this._promisesByRequest.get(e);this._promisesByRequest.delete(e);t.resolve()}this.msgHandler.send("DocProgress",{loaded:this.stream.numChunksLoaded*this.chunkSize,total:this.length})}onError(e){this._loadedStreamCapability.reject(e)}getBeginChunk(e){return Math.floor(e/this.chunkSize)}getEndChunk(e){return Math.floor((e-1)/this.chunkSize)+1}abort(e){this.aborted=!0;this.pdfNetworkStream&&this.pdfNetworkStream.cancelAllRequests(e);for(const t of this._promisesByRequest.values())t.reject(e)}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.StringStream=t.Stream=t.NullStream=void 0;var r=a(5),n=a(2);class Stream extends r.BaseStream{constructor(e,t,a,r){super();this.bytes=e instanceof Uint8Array?e:new Uint8Array(e);this.start=t||0;this.pos=this.start;this.end=t+a||this.bytes.length;this.dict=r}get length(){return this.end-this.start}get isEmpty(){return 0===this.length}getByte(){return this.pos>=this.end?-1:this.bytes[this.pos++]}getBytes(e){const t=this.bytes,a=this.pos,r=this.end;if(!e)return t.subarray(a,r);let n=a+e;n>r&&(n=r);this.pos=n;return t.subarray(a,n)}getByteRange(e,t){e<0&&(e=0);t>this.end&&(t=this.end);return this.bytes.subarray(e,t)}reset(){this.pos=this.start}moveStart(){this.start=this.pos}makeSubStream(e,t,a=null){return new Stream(this.bytes.buffer,e,t,a)}}t.Stream=Stream;t.StringStream=class StringStream extends Stream{constructor(e){super((0,n.stringToBytes)(e))}};t.NullStream=class NullStream extends Stream{constructor(){super(new Uint8Array(0))}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.Page=t.PDFDocument=void 0;var r=a(10),n=a(2),i=a(3),s=a(4),o=a(49),c=a(5),l=a(65),h=a(67),u=a(69),d=a(98),f=a(15),g=a(8),p=a(73),m=a(60),b=a(13),y=a(17),w=a(72),S=a(63),x=a(74),C=a(99);const k=[0,0,612,792];class Page{constructor({pdfManager:e,xref:t,pageIndex:a,pageDict:r,ref:n,globalIdFactory:i,fontCache:s,builtInCMapCache:o,standardFontDataCache:c,globalImageCache:l,nonBlendModesSet:h,xfaFactory:u}){this.pdfManager=e;this.pageIndex=a;this.pageDict=r;this.xref=t;this.ref=n;this.fontCache=s;this.builtInCMapCache=o;this.standardFontDataCache=c;this.globalImageCache=l;this.nonBlendModesSet=h;this.evaluatorOptions=e.evaluatorOptions;this.resourcesPromise=null;this.xfaFactory=u;const d={obj:0};this._localIdFactory=class extends i{static createObjId(){return`p${a}_${++d.obj}`}static getPageObjId(){return`page${n.toString()}`}}}_getInheritableProperty(e,t=!1){const a=(0,i.getInheritableProperty)({dict:this.pageDict,key:e,getArray:t,stopWhenFound:!1});return Array.isArray(a)?1!==a.length&&a[0]instanceof s.Dict?s.Dict.merge({xref:this.xref,dictArray:a}):a[0]:a}get content(){return this.pageDict.getArray("Contents")}get resources(){const e=this._getInheritableProperty("Resources");return(0,n.shadow)(this,"resources",e instanceof s.Dict?e:s.Dict.empty)}_getBoundingBox(e){if(this.xfaData)return this.xfaData.bbox;let t=this._getInheritableProperty(e,!0);if(Array.isArray(t)&&4===t.length){t=n.Util.normalizeRect(t);if(t[2]-t[0]>0&&t[3]-t[1]>0)return t;(0,n.warn)(`Empty, or invalid, /${e} entry.`)}return null}get mediaBox(){return(0,n.shadow)(this,"mediaBox",this._getBoundingBox("MediaBox")||k)}get cropBox(){return(0,n.shadow)(this,"cropBox",this._getBoundingBox("CropBox")||this.mediaBox)}get userUnit(){let e=this.pageDict.get("UserUnit");("number"!=typeof e||e<=0)&&(e=1);return(0,n.shadow)(this,"userUnit",e)}get view(){const{cropBox:e,mediaBox:t}=this;if(e!==t&&!(0,n.isArrayEqual)(e,t)){const a=n.Util.intersect(e,t);if(a&&a[2]-a[0]>0&&a[3]-a[1]>0)return(0,n.shadow)(this,"view",a);(0,n.warn)("Empty /CropBox and /MediaBox intersection.")}return(0,n.shadow)(this,"view",t)}get rotate(){let e=this._getInheritableProperty("Rotate")||0;e%90!=0?e=0:e>=360?e%=360:e<0&&(e=(e%360+360)%360);return(0,n.shadow)(this,"rotate",e)}_onSubStreamError(e,t,a){if(!this.evaluatorOptions.ignoreErrors)throw t;e.send("UnsupportedFeature",{featureId:n.UNSUPPORTED_FEATURES.errorContentSubStream});(0,n.warn)(`getContentStream - ignoring sub-stream (${a}): "${t}".`)}getContentStream(e){return this.pdfManager.ensure(this,"content").then((t=>t instanceof c.BaseStream?t:Array.isArray(t)?new y.StreamsSequenceStream(t,this._onSubStreamError.bind(this,e)):new g.NullStream))}get xfaData(){return(0,n.shadow)(this,"xfaData",this.xfaFactory?{bbox:this.xfaFactory.getBoundingBox(this.pageIndex)}:null)}async saveNewAnnotations(e,t,a){if(this.xfaFactory)throw new Error("XFA: Cannot save new annotations.");const n=new b.PartialEvaluator({xref:this.xref,handler:e,pageIndex:this.pageIndex,idFactory:this._localIdFactory,fontCache:this.fontCache,builtInCMapCache:this.builtInCMapCache,standardFontDataCache:this.standardFontDataCache,globalImageCache:this.globalImageCache,options:this.evaluatorOptions}),i=this.pageDict,s=this.annotations.slice(),o=await r.AnnotationFactory.saveNewAnnotations(n,t,a);for(const{ref:e}of o.annotations)s.push(e);const c=i.get("Annots");i.set("Annots",s);const l=[];let h=null;this.xref.encrypt&&(h=this.xref.encrypt.createCipherTransform(this.ref.num,this.ref.gen));(0,S.writeObject)(this.ref,i,l,h);c&&i.set("Annots",c);const u=o.dependencies;u.push({ref:this.ref,data:l.join("")},...o.annotations);return u}save(e,t,a){const r=new b.PartialEvaluator({xref:this.xref,handler:e,pageIndex:this.pageIndex,idFactory:this._localIdFactory,fontCache:this.fontCache,builtInCMapCache:this.builtInCMapCache,standardFontDataCache:this.standardFontDataCache,globalImageCache:this.globalImageCache,options:this.evaluatorOptions});return this._parsedAnnotations.then((function(e){const i=[];for(const s of e)s.mustBePrinted(a)&&i.push(s.save(r,t,a).catch((function(e){(0,n.warn)(`save - ignoring annotation data during "${t.name}" task: "${e}".`);return null})));return Promise.all(i).then((function(e){return e.filter((e=>!!e))}))}))}loadResources(e){this.resourcesPromise||(this.resourcesPromise=this.pdfManager.ensure(this,"resources"));return this.resourcesPromise.then((()=>new p.ObjectLoader(this.resources,e,this.xref).load()))}getOperatorList({handler:e,sink:t,task:a,intent:s,cacheKey:o,annotationStorage:c=null}){const l=this.getContentStream(e),h=this.loadResources(["ColorSpace","ExtGState","Font","Pattern","Properties","Shading","XObject"]),u=new b.PartialEvaluator({xref:this.xref,handler:e,pageIndex:this.pageIndex,idFactory:this._localIdFactory,fontCache:this.fontCache,builtInCMapCache:this.builtInCMapCache,standardFontDataCache:this.standardFontDataCache,globalImageCache:this.globalImageCache,options:this.evaluatorOptions}),d=this.xfaFactory?null:(0,i.getNewAnnotationsMap)(c);let f=Promise.resolve(null);if(d){const e=d.get(this.pageIndex);e&&(f=r.AnnotationFactory.printNewAnnotations(u,a,e))}const g=Promise.all([l,h]).then((([r])=>{const n=new m.OperatorList(s,t);e.send("StartRenderPage",{transparency:u.hasBlendModes(this.resources,this.nonBlendModesSet),pageIndex:this.pageIndex,cacheKey:o});return u.getOperatorList({stream:r,task:a,resources:this.resources,operatorList:n}).then((function(){return n}))}));return Promise.all([g,this._parsedAnnotations,f]).then((function([e,t,r]){r&&(t=t.concat(r));if(0===t.length||s&n.RenderingIntentFlag.ANNOTATIONS_DISABLE){e.flush(!0);return{length:e.totalLength}}const i=!!(s&n.RenderingIntentFlag.ANNOTATIONS_FORMS),o=!!(s&n.RenderingIntentFlag.ANY),l=!!(s&n.RenderingIntentFlag.DISPLAY),h=!!(s&n.RenderingIntentFlag.PRINT),d=[];for(const e of t)(o||l&&e.mustBeViewed(c)||h&&e.mustBePrinted(c))&&d.push(e.getOperatorList(u,a,s,i,c).catch((function(e){(0,n.warn)(`getOperatorList - ignoring annotation data during "${a.name}" task: "${e}".`);return{opList:null,separateForm:!1,separateCanvas:!1}})));return Promise.all(d).then((function(t){let a=!1,r=!1;for(const{opList:n,separateForm:i,separateCanvas:s}of t){e.addOpList(n);i&&(a=i);s&&(r=s)}e.flush(!0,{form:a,canvas:r});return{length:e.totalLength}}))}))}extractTextContent({handler:e,task:t,includeMarkedContent:a,sink:r,combineTextItems:n}){const i=this.getContentStream(e),s=this.loadResources(["ExtGState","Font","Properties","XObject"]);return Promise.all([i,s]).then((([i])=>new b.PartialEvaluator({xref:this.xref,handler:e,pageIndex:this.pageIndex,idFactory:this._localIdFactory,fontCache:this.fontCache,builtInCMapCache:this.builtInCMapCache,standardFontDataCache:this.standardFontDataCache,globalImageCache:this.globalImageCache,options:this.evaluatorOptions}).getTextContent({stream:i,task:t,resources:this.resources,includeMarkedContent:a,combineTextItems:n,sink:r,viewBox:this.view})))}async getStructTree(){const e=await this.pdfManager.ensureCatalog("structTreeRoot");if(!e)return null;return(await this.pdfManager.ensure(this,"_parseStructTree",[e])).serializable}_parseStructTree(e){const t=new w.StructTreePage(e,this.pageDict);t.parse();return t}async getAnnotationsData(e,t,a){const r=await this._parsedAnnotations;if(0===r.length)return[];const i=[],s=[];let o;const c=!!(a&n.RenderingIntentFlag.ANY),l=!!(a&n.RenderingIntentFlag.DISPLAY),h=!!(a&n.RenderingIntentFlag.PRINT);for(const a of r){const r=c||l&&a.viewable;(r||h&&a.printable)&&s.push(a.data);if(a.hasTextContent&&r){o||(o=new b.PartialEvaluator({xref:this.xref,handler:e,pageIndex:this.pageIndex,idFactory:this._localIdFactory,fontCache:this.fontCache,builtInCMapCache:this.builtInCMapCache,standardFontDataCache:this.standardFontDataCache,globalImageCache:this.globalImageCache,options:this.evaluatorOptions}));i.push(a.extractTextContent(o,t,this.view).catch((function(e){(0,n.warn)(`getAnnotationsData - ignoring textContent during "${t.name}" task: "${e}".`)})))}}await Promise.all(i);return s}get annotations(){const e=this._getInheritableProperty("Annots");return(0,n.shadow)(this,"annotations",Array.isArray(e)?e:[])}get _parsedAnnotations(){const e=this.pdfManager.ensure(this,"annotations").then((()=>{const e=[];for(const t of this.annotations)e.push(r.AnnotationFactory.create(this.xref,t,this.pdfManager,this._localIdFactory,!1).catch((function(e){(0,n.warn)(`_parsedAnnotations: "${e}".`);return null})));return Promise.all(e).then((function(e){if(0===e.length)return e;const t=[];let a;for(const n of e)if(n)if(n instanceof r.PopupAnnotation){a||(a=[]);a.push(n)}else t.push(n);a&&t.push(...a);return t}))}));return(0,n.shadow)(this,"_parsedAnnotations",e)}get jsActions(){const e=(0,i.collectActions)(this.xref,this.pageDict,n.PageActionEventType);return(0,n.shadow)(this,"jsActions",e)}}t.Page=Page;const v=new Uint8Array([37,80,68,70,45]),F=new Uint8Array([115,116,97,114,116,120,114,101,102]),O=new Uint8Array([101,110,100,111,98,106]),T="\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";function find(e,t,a=1024,r=!1){const n=t.length,i=e.peekBytes(a),s=i.length-n;if(s<=0)return!1;if(r){const a=n-1;let r=i.length-1;for(;r>=a;){let s=0;for(;s<n&&i[r-s]===t[a-s];)s++;if(s>=n){e.pos+=r-a;return!0}r--}}else{let a=0;for(;a<=s;){let r=0;for(;r<n&&i[a+r]===t[r];)r++;if(r>=n){e.pos+=a;return!0}a++}}return!1}t.PDFDocument=class PDFDocument{constructor(e,t){if(t.length<=0)throw new n.InvalidPDFException("The PDF file is empty, i.e. its size is zero bytes.");this.pdfManager=e;this.stream=t;this.xref=new C.XRef(t,e);this._pagePromises=new Map;this._version=null;const a={font:0};this._globalIdFactory=class{static getDocId(){return`g_${e.docId}`}static createFontId(){return"f"+ ++a.font}static createObjId(){(0,n.unreachable)("Abstract method `createObjId` called.")}static getPageObjId(){(0,n.unreachable)("Abstract method `getPageObjId` called.")}}}parse(e){this.xref.parse(e);this.catalog=new h.Catalog(this.pdfManager,this.xref)}get linearization(){let e=null;try{e=f.Linearization.create(this.stream)}catch(e){if(e instanceof i.MissingDataException)throw e;(0,n.info)(e)}return(0,n.shadow)(this,"linearization",e)}get startXRef(){const e=this.stream;let t=0;if(this.linearization){e.reset();find(e,O)&&(t=e.pos+6-e.start)}else{const a=1024,r=F.length;let n=!1,s=e.end;for(;!n&&s>0;){s-=a-r;s<0&&(s=0);e.pos=s;n=find(e,F,a,!0)}if(n){e.skip(9);let a;do{a=e.getByte()}while((0,i.isWhiteSpace)(a));let r="";for(;a>=32&&a<=57;){r+=String.fromCharCode(a);a=e.getByte()}t=parseInt(r,10);isNaN(t)&&(t=0)}}return(0,n.shadow)(this,"startXRef",t)}checkHeader(){const e=this.stream;e.reset();if(!find(e,v))return;e.moveStart();e.skip(v.length);let t,a="";for(;(t=e.getByte())>32&&a.length<7;)a+=String.fromCharCode(t);i.PDF_VERSION_REGEXP.test(a)?this._version=a:(0,n.warn)(`Invalid PDF header version: ${a}`)}parseStartXRef(){this.xref.setStartXRef(this.startXRef)}get numPages(){let e=0;e=this.catalog.hasActualNumPages?this.catalog.numPages:this.xfaFactory?this.xfaFactory.getNumPages():this.linearization?this.linearization.numPages:this.catalog.numPages;return(0,n.shadow)(this,"numPages",e)}_hasOnlyDocumentSignatures(e,t=0){return!!Array.isArray(e)&&e.every((e=>{if(!((e=this.xref.fetchIfRef(e))instanceof s.Dict))return!1;if(e.has("Kids")){if(++t>10){(0,n.warn)("_hasOnlyDocumentSignatures: maximum recursion depth reached");return!1}return this._hasOnlyDocumentSignatures(e.get("Kids"),t)}const a=(0,s.isName)(e.get("FT"),"Sig"),r=e.get("Rect"),i=Array.isArray(r)&&r.every((e=>0===e));return a&&i}))}get _xfaStreams(){const e=this.catalog.acroForm;if(!e)return null;const t=e.get("XFA"),a={"xdp:xdp":"",template:"",datasets:"",config:"",connectionSet:"",localeSet:"",stylesheet:"","/xdp:xdp":""};if(t instanceof c.BaseStream&&!t.isEmpty){a["xdp:xdp"]=t;return a}if(!Array.isArray(t)||0===t.length)return null;for(let e=0,r=t.length;e<r;e+=2){let n;n=0===e?"xdp:xdp":e===r-2?"/xdp:xdp":t[e];if(!a.hasOwnProperty(n))continue;const i=this.xref.fetchIfRef(t[e+1]);i instanceof c.BaseStream&&!i.isEmpty&&(a[n]=i)}return a}get xfaDatasets(){const e=this._xfaStreams;if(!e)return(0,n.shadow)(this,"xfaDatasets",null);for(const t of["datasets","xdp:xdp"]){const a=e[t];if(a)try{const e={[t]:(0,n.stringToUTF8String)(a.getString())};return(0,n.shadow)(this,"xfaDatasets",new d.DatasetReader(e))}catch(e){(0,n.warn)("XFA - Invalid utf-8 string.");break}}return(0,n.shadow)(this,"xfaDatasets",null)}get xfaData(){const e=this._xfaStreams;if(!e)return null;const t=Object.create(null);for(const[a,r]of Object.entries(e))if(r)try{t[a]=(0,n.stringToUTF8String)(r.getString())}catch(e){(0,n.warn)("XFA - Invalid utf-8 string.");return null}return t}get xfaFactory(){let e;this.pdfManager.enableXfa&&this.catalog.needsRendering&&this.formInfo.hasXfa&&!this.formInfo.hasAcroForm&&(e=this.xfaData);return(0,n.shadow)(this,"xfaFactory",e?new x.XFAFactory(e):null)}get isPureXfa(){return!!this.xfaFactory&&this.xfaFactory.isValid()}get htmlForXfa(){return this.xfaFactory?this.xfaFactory.getPages():null}async loadXfaImages(){const e=await this.pdfManager.ensureCatalog("xfaImages");if(!e)return;const t=e.getKeys(),a=new p.ObjectLoader(e,t,this.xref);await a.load();const r=new Map;for(const a of t){const t=e.get(a);t instanceof c.BaseStream&&r.set(a,t.getBytes())}this.xfaFactory.setImages(r)}async loadXfaFonts(e,t){const a=await this.pdfManager.ensureCatalog("acroForm");if(!a)return;const r=await a.getAsync("DR");if(!(r instanceof s.Dict))return;const c=new p.ObjectLoader(r,["Font"],this.xref);await c.load();const l=r.get("Font");if(!(l instanceof s.Dict))return;const h=Object.assign(Object.create(null),this.pdfManager.evaluatorOptions);h.useSystemFonts=!1;const u=new b.PartialEvaluator({xref:this.xref,handler:e,pageIndex:-1,idFactory:this._globalIdFactory,fontCache:this.catalog.fontCache,builtInCMapCache:this.catalog.builtInCMapCache,standardFontDataCache:this.catalog.standardFontDataCache,options:h}),d=new m.OperatorList,f=[],g={get font(){return f.at(-1)},set font(e){f.push(e)},clone(){return this}},y=new Map;l.forEach(((e,t)=>{y.set(e,t)}));const w=[];for(const[e,a]of y){const o=a.get("FontDescriptor");if(!(o instanceof s.Dict))continue;let c=o.get("FontFamily");c=c.replace(/[ ]+(\d)/g,"$1");const l={fontFamily:c,fontWeight:o.get("FontWeight"),italicAngle:-o.get("ItalicAngle")};(0,i.validateCSSFont)(l)&&w.push(u.handleSetFont(r,[s.Name.get(e),1],null,d,t,g,null,l).catch((function(e){(0,n.warn)(`loadXfaFonts: "${e}".`);return null})))}await Promise.all(w);const S=this.xfaFactory.setFonts(f);if(!S)return;h.ignoreErrors=!0;w.length=0;f.length=0;const x=new Set;for(const e of S)(0,o.getXfaFontName)(`${e}-Regular`)||x.add(e);x.size&&S.push("PdfJS-Fallback");for(const e of S)if(!x.has(e))for(const a of[{name:"Regular",fontWeight:400,italicAngle:0},{name:"Bold",fontWeight:700,italicAngle:0},{name:"Italic",fontWeight:400,italicAngle:12},{name:"BoldItalic",fontWeight:700,italicAngle:12}]){const i=`${e}-${a.name}`,c=(0,o.getXfaFontDict)(i);w.push(u.handleSetFont(r,[s.Name.get(i),1],null,d,t,g,c,{fontFamily:e,fontWeight:a.fontWeight,italicAngle:a.italicAngle}).catch((function(e){(0,n.warn)(`loadXfaFonts: "${e}".`);return null})))}await Promise.all(w);this.xfaFactory.appendFonts(f,x)}async serializeXfaData(e){return this.xfaFactory?this.xfaFactory.serializeData(e):null}get version(){return this.catalog.version||this._version}get formInfo(){const e={hasFields:!1,hasAcroForm:!1,hasXfa:!1,hasSignatures:!1},t=this.catalog.acroForm;if(!t)return(0,n.shadow)(this,"formInfo",e);try{const a=t.get("Fields"),r=Array.isArray(a)&&a.length>0;e.hasFields=r;const n=t.get("XFA");e.hasXfa=Array.isArray(n)&&n.length>0||n instanceof c.BaseStream&&!n.isEmpty;const i=!!(1&t.get("SigFlags")),s=i&&this._hasOnlyDocumentSignatures(a);e.hasAcroForm=r&&!s;e.hasSignatures=i}catch(e){if(e instanceof i.MissingDataException)throw e;(0,n.warn)(`Cannot fetch form information: "${e}".`)}return(0,n.shadow)(this,"formInfo",e)}get documentInfo(){const e={PDFFormatVersion:this.version,Language:this.catalog.lang,EncryptFilterName:this.xref.encrypt?this.xref.encrypt.filterName:null,IsLinearized:!!this.linearization,IsAcroFormPresent:this.formInfo.hasAcroForm,IsXFAPresent:this.formInfo.hasXfa,IsCollectionPresent:!!this.catalog.collection,IsSignaturesPresent:this.formInfo.hasSignatures};let t;try{t=this.xref.trailer.get("Info")}catch(e){if(e instanceof i.MissingDataException)throw e;(0,n.info)("The document information dictionary is invalid.")}if(!(t instanceof s.Dict))return(0,n.shadow)(this,"documentInfo",e);for(const a of t.getKeys()){const r=t.get(a);switch(a){case"Title":case"Author":case"Subject":case"Keywords":case"Creator":case"Producer":case"CreationDate":case"ModDate":if("string"==typeof r){e[a]=(0,n.stringToPDFString)(r);continue}break;case"Trapped":if(r instanceof s.Name){e[a]=r;continue}break;default:let t;switch(typeof r){case"string":t=(0,n.stringToPDFString)(r);break;case"number":case"boolean":t=r;break;default:r instanceof s.Name&&(t=r)}if(void 0===t){(0,n.warn)(`Bad value, for custom key "${a}", in Info: ${r}.`);continue}e.Custom||(e.Custom=Object.create(null));e.Custom[a]=t;continue}(0,n.warn)(`Bad value, for key "${a}", in Info: ${r}.`)}return(0,n.shadow)(this,"documentInfo",e)}get fingerprints(){function validate(e){return"string"==typeof e&&e.length>0&&e!==T}function hexString(e){const t=[];for(const a of e){const e=a.toString(16);t.push(e.padStart(2,"0"))}return t.join("")}const e=this.xref.trailer.get("ID");let t,a;if(Array.isArray(e)&&validate(e[0])){t=(0,n.stringToBytes)(e[0]);e[1]!==e[0]&&validate(e[1])&&(a=(0,n.stringToBytes)(e[1]))}else t=(0,l.calculateMD5)(this.stream.getByteRange(0,1024),0,1024);return(0,n.shadow)(this,"fingerprints",[hexString(t),a?hexString(a):null])}async _getLinearizationPage(e){const{catalog:t,linearization:a,xref:r}=this,i=s.Ref.get(a.objectNumberFirst,0);try{const e=await r.fetchAsync(i);if(e instanceof s.Dict){let a=e.getRaw("Type");a instanceof s.Ref&&(a=await r.fetchAsync(a));if((0,s.isName)(a,"Page")||!e.has("Type")&&!e.has("Kids")){t.pageKidsCountCache.has(i)||t.pageKidsCountCache.put(i,1);t.pageIndexCache.has(i)||t.pageIndexCache.put(i,0);return[e,i]}}throw new n.FormatError("The Linearization dictionary doesn't point to a valid Page dictionary.")}catch(a){(0,n.warn)(`_getLinearizationPage: "${a.message}".`);return t.getPageDict(e)}}getPage(e){const t=this._pagePromises.get(e);if(t)return t;const{catalog:a,linearization:r,xfaFactory:n}=this;let i;i=n?Promise.resolve([s.Dict.empty,null]):r&&r.pageFirst===e?this._getLinearizationPage(e):a.getPageDict(e);i=i.then((([t,r])=>new Page({pdfManager:this.pdfManager,xref:this.xref,pageIndex:e,pageDict:t,ref:r,globalIdFactory:this._globalIdFactory,fontCache:a.fontCache,builtInCMapCache:a.builtInCMapCache,standardFontDataCache:a.standardFontDataCache,globalImageCache:a.globalImageCache,nonBlendModesSet:a.nonBlendModesSet,xfaFactory:n})));this._pagePromises.set(e,i);return i}async checkFirstPage(e=!1){if(!e)try{await this.getPage(0)}catch(e){if(e instanceof i.XRefEntryException){this._pagePromises.delete(0);await this.cleanup();throw new i.XRefParseException}}}async checkLastPage(e=!1){const{catalog:t,pdfManager:a}=this;t.setActualNumPages();let r;try{await Promise.all([a.ensureDoc("xfaFactory"),a.ensureDoc("linearization"),a.ensureCatalog("numPages")]);if(this.xfaFactory)return;r=this.linearization?this.linearization.numPages:t.numPages;if(!Number.isInteger(r))throw new n.FormatError("Page count is not an integer.");if(r<=1)return;await this.getPage(r-1)}catch(s){this._pagePromises.delete(r-1);await this.cleanup();if(s instanceof i.XRefEntryException&&!e)throw new i.XRefParseException;(0,n.warn)(`checkLastPage - invalid /Pages tree /Count: ${r}.`);let o;try{o=await t.getAllPageDicts(e)}catch(a){if(a instanceof i.XRefEntryException&&!e)throw new i.XRefParseException;t.setActualNumPages(1);return}for(const[e,[r,n]]of o){let i;if(r instanceof Error){i=Promise.reject(r);i.catch((()=>{}))}else i=Promise.resolve(new Page({pdfManager:a,xref:this.xref,pageIndex:e,pageDict:r,ref:n,globalIdFactory:this._globalIdFactory,fontCache:t.fontCache,builtInCMapCache:t.builtInCMapCache,standardFontDataCache:t.standardFontDataCache,globalImageCache:t.globalImageCache,nonBlendModesSet:t.nonBlendModesSet,xfaFactory:null}));this._pagePromises.set(e,i)}t.setActualNumPages(o.size)}}fontFallback(e,t){return this.catalog.fontFallback(e,t)}async cleanup(e=!1){return this.catalog?this.catalog.cleanup(e):(0,u.clearGlobalCaches)()}_collectFieldObjects(e,t,a){const i=this.xref.fetchIfRef(t);if(i.has("T")){const t=(0,n.stringToPDFString)(i.get("T"));e=""===e?t:`${e}.${t}`}a.has(e)||a.set(e,[]);a.get(e).push(r.AnnotationFactory.create(this.xref,t,this.pdfManager,this._localIdFactory,!0).then((e=>e&&e.getFieldObject())).catch((function(e){(0,n.warn)(`_collectFieldObjects: "${e}".`);return null})));if(i.has("Kids")){const t=i.get("Kids");for(const r of t)this._collectFieldObjects(e,r,a)}}get fieldObjects(){if(!this.formInfo.hasFields)return(0,n.shadow)(this,"fieldObjects",Promise.resolve(null));const e=Object.create(null),t=new Map;for(const e of this.catalog.acroForm.get("Fields"))this._collectFieldObjects("",e,t);const a=[];for(const[r,n]of t)a.push(Promise.all(n).then((t=>{(t=t.filter((e=>!!e))).length>0&&(e[r]=t)})));return(0,n.shadow)(this,"fieldObjects",Promise.all(a).then((()=>e)))}get hasJSActions(){const e=this.pdfManager.ensureDoc("_parseHasJSActions");return(0,n.shadow)(this,"hasJSActions",e)}async _parseHasJSActions(){const[e,t]=await Promise.all([this.pdfManager.ensureCatalog("jsActions"),this.pdfManager.ensureDoc("fieldObjects")]);return!!e||!!t&&Object.values(t).some((e=>e.some((e=>null!==e.actions))))}get calculationOrderIds(){const e=this.catalog.acroForm;if(!e||!e.has("CO"))return(0,n.shadow)(this,"calculationOrderIds",null);const t=e.get("CO");if(!Array.isArray(t)||0===t.length)return(0,n.shadow)(this,"calculationOrderIds",null);const a=[];for(const e of t)e instanceof s.Ref&&a.push(e.toString());return 0===a.length?(0,n.shadow)(this,"calculationOrderIds",null):(0,n.shadow)(this,"calculationOrderIds",a)}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.PopupAnnotation=t.MarkupAnnotation=t.AnnotationFactory=t.AnnotationBorderStyle=t.Annotation=void 0;t.getQuadPoints=getQuadPoints;var r=a(2),n=a(3),i=a(11),s=a(4),o=a(63),c=a(5),l=a(58),h=a(67),u=a(12),d=a(70),f=a(73),g=a(60),p=a(8),m=a(74);t.AnnotationFactory=class AnnotationFactory{static create(e,t,a,r,n){return Promise.all([a.ensureCatalog("acroForm"),a.ensureCatalog("baseUrl"),a.ensureCatalog("attachments"),a.ensureDoc("xfaDatasets"),n?this._getPageIndex(e,t,a):-1]).then((([i,s,o,c,l])=>a.ensure(this,"_create",[e,t,a,r,i,o,c,n,l])))}static _create(e,t,a,i,o,c=null,l,h,u=-1){const d=e.fetchIfRef(t);if(!(d instanceof s.Dict))return;const f=t instanceof s.Ref?t.toString():`annot_${i.createObjId()}`;let g=d.get("Subtype");g=g instanceof s.Name?g.name:null;const p=o instanceof s.Dict?o:s.Dict.empty,m={xref:e,ref:t,dict:d,subtype:g,id:f,pdfManager:a,acroForm:p,attachments:c,xfaDatasets:l,collectFields:h,needAppearances:!h&&!0===p.get("NeedAppearances"),pageIndex:u,isOffscreenCanvasSupported:r.FeatureTest.isOffscreenCanvasSupported&&a.evaluatorOptions.isOffscreenCanvasSupported};switch(g){case"Link":return new LinkAnnotation(m);case"Text":return new TextAnnotation(m);case"Widget":let e=(0,n.getInheritableProperty)({dict:d,key:"FT"});e=e instanceof s.Name?e.name:null;switch(e){case"Tx":return new TextWidgetAnnotation(m);case"Btn":return new ButtonWidgetAnnotation(m);case"Ch":return new ChoiceWidgetAnnotation(m);case"Sig":return new SignatureWidgetAnnotation(m)}(0,r.warn)(`Unimplemented widget field type "${e}", falling back to base field type.`);return new WidgetAnnotation(m);case"Popup":return new PopupAnnotation(m);case"FreeText":return new FreeTextAnnotation(m);case"Line":return new LineAnnotation(m);case"Square":return new SquareAnnotation(m);case"Circle":return new CircleAnnotation(m);case"PolyLine":return new PolylineAnnotation(m);case"Polygon":return new PolygonAnnotation(m);case"Caret":return new CaretAnnotation(m);case"Ink":return new InkAnnotation(m);case"Highlight":return new HighlightAnnotation(m);case"Underline":return new UnderlineAnnotation(m);case"Squiggly":return new SquigglyAnnotation(m);case"StrikeOut":return new StrikeOutAnnotation(m);case"Stamp":return new StampAnnotation(m);case"FileAttachment":return new FileAttachmentAnnotation(m);default:h||(g?(0,r.warn)(`Unimplemented annotation type "${g}", falling back to base annotation.`):(0,r.warn)("Annotation is missing the required /Subtype."));return new Annotation(m)}}static async _getPageIndex(e,t,a){try{const r=await e.fetchIfRefAsync(t);if(!(r instanceof s.Dict))return-1;const n=r.getRaw("P");if(!(n instanceof s.Ref))return-1;return await a.ensureCatalog("getPageIndex",[n])}catch(e){(0,r.warn)(`_getPageIndex: "${e}".`);return-1}}static async saveNewAnnotations(e,t,a){const n=e.xref;let i;const c=[],l=[];for(const h of a)switch(h.annotationType){case r.AnnotationEditorType.FREETEXT:if(!i){const e=new s.Dict(n);e.set("BaseFont",s.Name.get("Helvetica"));e.set("Type",s.Name.get("Font"));e.set("Subtype",s.Name.get("Type1"));e.set("Encoding",s.Name.get("WinAnsiEncoding"));const t=[];i=n.getNewTemporaryRef();(0,o.writeObject)(i,e,t,null);c.push({ref:i,data:t.join("")})}l.push(FreeTextAnnotation.createNewAnnotation(n,h,c,{evaluator:e,task:t,baseFontRef:i}));break;case r.AnnotationEditorType.INK:l.push(InkAnnotation.createNewAnnotation(n,h,c))}return{annotations:await Promise.all(l),dependencies:c}}static async printNewAnnotations(e,t,a){if(!a)return null;const n=e.xref,i=[],s=r.FeatureTest.isOffscreenCanvasSupported&&e.options.isOffscreenCanvasSupported;for(const o of a)switch(o.annotationType){case r.AnnotationEditorType.FREETEXT:i.push(FreeTextAnnotation.createNewPrintAnnotation(n,o,{evaluator:e,task:t,isOffscreenCanvasSupported:s}));break;case r.AnnotationEditorType.INK:i.push(InkAnnotation.createNewPrintAnnotation(n,o,{isOffscreenCanvasSupported:s}))}return Promise.all(i)}};function getRgbColor(e,t=new Uint8ClampedArray(3)){if(!Array.isArray(e))return t;const a=t||new Uint8ClampedArray(3);switch(e.length){case 0:return null;case 1:u.ColorSpace.singletons.gray.getRgbItem(e,0,a,0);return a;case 3:u.ColorSpace.singletons.rgb.getRgbItem(e,0,a,0);return a;case 4:u.ColorSpace.singletons.cmyk.getRgbItem(e,0,a,0);return a;default:return t}}function getPdfColorArray(e){return Array.from(e,(e=>e/255))}function getQuadPoints(e,t){const a=e.getArray("QuadPoints");if(!Array.isArray(a)||0===a.length||a.length%8>0)return null;const r=[];for(let e=0,n=a.length/8;e<n;e++){let n=1/0,i=-1/0,s=1/0,o=-1/0;for(let t=8*e,r=8*e+8;t<r;t+=2){const e=a[t],r=a[t+1];n=Math.min(e,n);i=Math.max(e,i);s=Math.min(r,s);o=Math.max(r,o)}if(null!==t&&(n<t[0]||i>t[2]||s<t[1]||o>t[3]))return null;r.push([{x:n,y:o},{x:i,y:o},{x:n,y:s},{x:i,y:s}])}return r}function getTransformMatrix(e,t,a){const[n,i,s,o]=r.Util.getAxialAlignedBoundingBox(t,a);if(n===s||i===o)return[1,0,0,1,e[0],e[1]];const c=(e[2]-e[0])/(s-n),l=(e[3]-e[1])/(o-i);return[c,0,0,l,e[0]-n*c,e[1]-i*l]}class Annotation{constructor(e){const{dict:t,xref:a}=e;this.setTitle(t.get("T"));this.setContents(t.get("Contents"));this.setModificationDate(t.get("M"));this.setFlags(t.get("F"));this.setRectangle(t.getArray("Rect"));this.setColor(t.getArray("C"));this.setBorderStyle(t);this.setAppearance(t);this.setOptionalContent(t);const i=t.get("MK");this.setBorderAndBackgroundColors(i);this.setRotation(i);this._streams=[];this.appearance&&this._streams.push(this.appearance);this.data={annotationFlags:this.flags,borderStyle:this.borderStyle,color:this.color,backgroundColor:this.backgroundColor,borderColor:this.borderColor,rotation:this.rotation,contentsObj:this._contents,hasAppearance:!!this.appearance,id:e.id,modificationDate:this.modificationDate,rect:this.rectangle,subtype:e.subtype,hasOwnCanvas:!1};if(e.collectFields){const i=t.get("Kids");if(Array.isArray(i)){const e=[];for(const t of i)t instanceof s.Ref&&e.push(t.toString());0!==e.length&&(this.data.kidIds=e)}this.data.actions=(0,n.collectActions)(a,t,r.AnnotationActionEventType);this.data.fieldName=this._constructFieldName(t);this.data.pageIndex=e.pageIndex}this._isOffscreenCanvasSupported=e.isOffscreenCanvasSupported;this._fallbackFontDict=null;this._needAppearances=!1}_hasFlag(e,t){return!!(e&t)}_isViewable(e){return!this._hasFlag(e,r.AnnotationFlag.INVISIBLE)&&!this._hasFlag(e,r.AnnotationFlag.NOVIEW)}_isPrintable(e){return this._hasFlag(e,r.AnnotationFlag.PRINT)&&!this._hasFlag(e,r.AnnotationFlag.INVISIBLE)}mustBeViewed(e){const t=e&&e.get(this.data.id);return t&&void 0!==t.hidden?!t.hidden:this.viewable&&!this._hasFlag(this.flags,r.AnnotationFlag.HIDDEN)}mustBePrinted(e){const t=e&&e.get(this.data.id);return t&&void 0!==t.print?t.print:this.printable}get viewable(){return null!==this.data.quadPoints&&(0===this.flags||this._isViewable(this.flags))}get printable(){return null!==this.data.quadPoints&&(0!==this.flags&&this._isPrintable(this.flags))}_parseStringHelper(e){const t="string"==typeof e?(0,r.stringToPDFString)(e):"";return{str:t,dir:t&&"rtl"===(0,l.bidi)(t).dir?"rtl":"ltr"}}setDefaultAppearance(e){const t=(0,n.getInheritableProperty)({dict:e.dict,key:"DA"})||e.acroForm.get("DA");this._defaultAppearance="string"==typeof t?t:"";this.data.defaultAppearanceData=(0,i.parseDefaultAppearance)(this._defaultAppearance)}setTitle(e){this._title=this._parseStringHelper(e)}setContents(e){this._contents=this._parseStringHelper(e)}setModificationDate(e){this.modificationDate="string"==typeof e?e:null}setFlags(e){this.flags=Number.isInteger(e)&&e>0?e:0}hasFlag(e){return this._hasFlag(this.flags,e)}setRectangle(e){Array.isArray(e)&&4===e.length?this.rectangle=r.Util.normalizeRect(e):this.rectangle=[0,0,0,0]}setColor(e){this.color=getRgbColor(e)}setLineEndings(e){this.lineEndings=["None","None"];if(Array.isArray(e)&&2===e.length)for(let t=0;t<2;t++){const a=e[t];if(a instanceof s.Name)switch(a.name){case"None":continue;case"Square":case"Circle":case"Diamond":case"OpenArrow":case"ClosedArrow":case"Butt":case"ROpenArrow":case"RClosedArrow":case"Slash":this.lineEndings[t]=a.name;continue}(0,r.warn)(`Ignoring invalid lineEnding: ${a}`)}}setRotation(e){this.rotation=0;if(e instanceof s.Dict){let t=e.get("R")||0;if(Number.isInteger(t)&&0!==t){t%=360;t<0&&(t+=360);t%90==0&&(this.rotation=t)}}}setBorderAndBackgroundColors(e){if(e instanceof s.Dict){this.borderColor=getRgbColor(e.getArray("BC"),null);this.backgroundColor=getRgbColor(e.getArray("BG"),null)}else this.borderColor=this.backgroundColor=null}setBorderStyle(e){this.borderStyle=new AnnotationBorderStyle;if(e instanceof s.Dict)if(e.has("BS")){const t=e.get("BS"),a=t.get("Type");if(!a||(0,s.isName)(a,"Border")){this.borderStyle.setWidth(t.get("W"),this.rectangle);this.borderStyle.setStyle(t.get("S"));this.borderStyle.setDashArray(t.getArray("D"))}}else if(e.has("Border")){const t=e.getArray("Border");if(Array.isArray(t)&&t.length>=3){this.borderStyle.setHorizontalCornerRadius(t[0]);this.borderStyle.setVerticalCornerRadius(t[1]);this.borderStyle.setWidth(t[2],this.rectangle);4===t.length&&this.borderStyle.setDashArray(t[3],!0)}}else this.borderStyle.setWidth(0)}setAppearance(e){this.appearance=null;const t=e.get("AP");if(!(t instanceof s.Dict))return;const a=t.get("N");if(a instanceof c.BaseStream){this.appearance=a;return}if(!(a instanceof s.Dict))return;const r=e.get("AS");if(!(r instanceof s.Name&&a.has(r.name)))return;const n=a.get(r.name);n instanceof c.BaseStream&&(this.appearance=n)}setOptionalContent(e){this.oc=null;const t=e.get("OC");t instanceof s.Name?(0,r.warn)("setOptionalContent: Support for /Name-entry is not implemented."):t instanceof s.Dict&&(this.oc=t)}loadResources(e,t){return t.dict.getAsync("Resources").then((t=>{if(!t)return;return new f.ObjectLoader(t,e,t.xref).load().then((function(){return t}))}))}async getOperatorList(e,t,a,n,i){const o=this.data;let c=this.appearance;const l=!!(this.data.hasOwnCanvas&&a&r.RenderingIntentFlag.DISPLAY);if(!c){if(!l)return{opList:new g.OperatorList,separateForm:!1,separateCanvas:!1};c=new p.StringStream("");c.dict=new s.Dict}const h=c.dict,u=await this.loadResources(["ExtGState","ColorSpace","Pattern","Shading","XObject","Font"],c),d=h.getArray("BBox")||[0,0,1,1],f=h.getArray("Matrix")||[1,0,0,1,0,0],m=getTransformMatrix(o.rect,d,f),b=new g.OperatorList;let y;this.oc&&(y=await e.parseMarkedContentProps(this.oc,null));void 0!==y&&b.addOp(r.OPS.beginMarkedContentProps,["OC",y]);b.addOp(r.OPS.beginAnnotation,[o.id,o.rect,m,f,l]);await e.getOperatorList({stream:c,task:t,resources:u,operatorList:b,fallbackFontDict:this._fallbackFontDict});b.addOp(r.OPS.endAnnotation,[]);void 0!==y&&b.addOp(r.OPS.endMarkedContent,[]);this.reset();return{opList:b,separateForm:!1,separateCanvas:l}}async save(e,t,a){return null}get hasTextContent(){return!1}async extractTextContent(e,t,a){if(!this.appearance)return;const r=await this.loadResources(["ExtGState","Font","Properties","XObject"],this.appearance),n=[],i=[],s={desiredSize:Math.Infinity,ready:!0,enqueue(e,t){for(const t of e.items){i.push(t.str);if(t.hasEOL){n.push(i.join(""));i.length=0}}}};await e.getTextContent({stream:this.appearance,task:t,resources:r,includeMarkedContent:!0,combineTextItems:!0,sink:s,viewBox:a});this.reset();i.length&&n.push(i.join(""));n.length>0&&(this.data.textContent=n)}getFieldObject(){return this.data.kidIds?{id:this.data.id,actions:this.data.actions,name:this.data.fieldName,strokeColor:this.data.borderColor,fillColor:this.data.backgroundColor,type:"",kidIds:this.data.kidIds,page:this.data.pageIndex,rotation:this.rotation}:null}reset(){for(const e of this._streams)e.reset()}_constructFieldName(e){if(!e.has("T")&&!e.has("Parent")){(0,r.warn)("Unknown field name, falling back to empty field name.");return""}if(!e.has("Parent"))return(0,r.stringToPDFString)(e.get("T"));const t=[];e.has("T")&&t.unshift((0,r.stringToPDFString)(e.get("T")));let a=e;const n=new s.RefSet;e.objId&&n.put(e.objId);for(;a.has("Parent");){a=a.get("Parent");if(!(a instanceof s.Dict)||a.objId&&n.has(a.objId))break;a.objId&&n.put(a.objId);if(a.has("T")){const e=(0,r.stringToPDFString)(a.get("T"));e.startsWith("#")||t.unshift(e)}}return t.join(".")}}t.Annotation=Annotation;class AnnotationBorderStyle{constructor(){this.width=1;this.style=r.AnnotationBorderStyleType.SOLID;this.dashArray=[3];this.horizontalCornerRadius=0;this.verticalCornerRadius=0}setWidth(e,t=[0,0,0,0]){if(e instanceof s.Name)this.width=0;else if("number"==typeof e){if(e>0){const a=(t[2]-t[0])/2,n=(t[3]-t[1])/2;if(a>0&&n>0&&(e>a||e>n)){(0,r.warn)(`AnnotationBorderStyle.setWidth - ignoring width: ${e}`);e=1}}this.width=e}}setStyle(e){if(e instanceof s.Name)switch(e.name){case"S":this.style=r.AnnotationBorderStyleType.SOLID;break;case"D":this.style=r.AnnotationBorderStyleType.DASHED;break;case"B":this.style=r.AnnotationBorderStyleType.BEVELED;break;case"I":this.style=r.AnnotationBorderStyleType.INSET;break;case"U":this.style=r.AnnotationBorderStyleType.UNDERLINE}}setDashArray(e,t=!1){if(Array.isArray(e)&&e.length>0){let a=!0,r=!0;for(const t of e){if(!(+t>=0)){a=!1;break}t>0&&(r=!1)}if(a&&!r){this.dashArray=e;t&&this.setStyle(s.Name.get("D"))}else this.width=0}else e&&(this.width=0)}setHorizontalCornerRadius(e){Number.isInteger(e)&&(this.horizontalCornerRadius=e)}setVerticalCornerRadius(e){Number.isInteger(e)&&(this.verticalCornerRadius=e)}}t.AnnotationBorderStyle=AnnotationBorderStyle;class MarkupAnnotation extends Annotation{constructor(e){super(e);const{dict:t}=e;if(t.has("IRT")){const e=t.getRaw("IRT");this.data.inReplyTo=e instanceof s.Ref?e.toString():null;const a=t.get("RT");this.data.replyType=a instanceof s.Name?a.name:r.AnnotationReplyType.REPLY}if(this.data.replyType===r.AnnotationReplyType.GROUP){const e=t.get("IRT");this.setTitle(e.get("T"));this.data.titleObj=this._title;this.setContents(e.get("Contents"));this.data.contentsObj=this._contents;if(e.has("CreationDate")){this.setCreationDate(e.get("CreationDate"));this.data.creationDate=this.creationDate}else this.data.creationDate=null;if(e.has("M")){this.setModificationDate(e.get("M"));this.data.modificationDate=this.modificationDate}else this.data.modificationDate=null;this.data.hasPopup=e.has("Popup");if(e.has("C")){this.setColor(e.getArray("C"));this.data.color=this.color}else this.data.color=null}else{this.data.titleObj=this._title;this.setCreationDate(t.get("CreationDate"));this.data.creationDate=this.creationDate;this.data.hasPopup=t.has("Popup");t.has("C")||(this.data.color=null)}t.has("RC")&&(this.data.richText=m.XFAFactory.getRichTextAsHtml(t.get("RC")))}setCreationDate(e){this.creationDate="string"==typeof e?e:null}_setDefaultAppearance({xref:e,extra:t,strokeColor:a,fillColor:r,blendMode:n,strokeAlpha:i,fillAlpha:o,pointsCallback:c}){let l=Number.MAX_VALUE,h=Number.MAX_VALUE,u=Number.MIN_VALUE,d=Number.MIN_VALUE;const f=["q"];t&&f.push(t);a&&f.push(`${a[0]} ${a[1]} ${a[2]} RG`);r&&f.push(`${r[0]} ${r[1]} ${r[2]} rg`);let g=this.data.quadPoints;g||(g=[[{x:this.rectangle[0],y:this.rectangle[3]},{x:this.rectangle[2],y:this.rectangle[3]},{x:this.rectangle[0],y:this.rectangle[1]},{x:this.rectangle[2],y:this.rectangle[1]}]]);for(const e of g){const[t,a,r,n]=c(f,e);l=Math.min(l,t);u=Math.max(u,a);h=Math.min(h,r);d=Math.max(d,n)}f.push("Q");const m=new s.Dict(e),b=new s.Dict(e);b.set("Subtype",s.Name.get("Form"));const y=new p.StringStream(f.join(" "));y.dict=b;m.set("Fm0",y);const w=new s.Dict(e);n&&w.set("BM",s.Name.get(n));"number"==typeof i&&w.set("CA",i);"number"==typeof o&&w.set("ca",o);const S=new s.Dict(e);S.set("GS0",w);const x=new s.Dict(e);x.set("ExtGState",S);x.set("XObject",m);const C=new s.Dict(e);C.set("Resources",x);const k=this.data.rect=[l,h,u,d];C.set("BBox",k);this.appearance=new p.StringStream("/GS0 gs /Fm0 Do");this.appearance.dict=C;this._streams.push(this.appearance,y)}static async createNewAnnotation(e,t,a,r){const n=e.getNewTemporaryRef(),i=await this.createNewAppearanceStream(t,e,r),s=[];let c;if(i){const r=e.getNewTemporaryRef();c=this.createNewDict(t,e,{apRef:r});const n=e.encrypt?e.encrypt.createCipherTransform(r.num,r.gen):null;(0,o.writeObject)(r,i,s,n);a.push({ref:r,data:s.join("")})}else c=this.createNewDict(t,e,{});s.length=0;const l=e.encrypt?e.encrypt.createCipherTransform(n.num,n.gen):null;(0,o.writeObject)(n,c,s,l);return{ref:n,data:s.join("")}}static async createNewPrintAnnotation(e,t,a){const r=await this.createNewAppearanceStream(t,e,a),n=this.createNewDict(t,e,{ap:r});return new this.prototype.constructor({dict:n,xref:e,isOffscreenCanvasSupported:a.isOffscreenCanvasSupported})}}t.MarkupAnnotation=MarkupAnnotation;class WidgetAnnotation extends Annotation{constructor(e){super(e);const{dict:t,xref:a}=e,i=this.data;this.ref=e.ref;this._needAppearances=e.needAppearances;i.annotationType=r.AnnotationType.WIDGET;void 0===i.fieldName&&(i.fieldName=this._constructFieldName(t));void 0===i.actions&&(i.actions=(0,n.collectActions)(a,t,r.AnnotationActionEventType));let o=(0,n.getInheritableProperty)({dict:t,key:"V",getArray:!0});i.fieldValue=this._decodeFormValue(o);const c=(0,n.getInheritableProperty)({dict:t,key:"DV",getArray:!0});i.defaultFieldValue=this._decodeFormValue(c);if(void 0===o&&e.xfaDatasets){const t=this._title.str;if(t){this._hasValueFromXFA=!0;i.fieldValue=o=e.xfaDatasets.getValue(t)}}void 0===o&&null!==i.defaultFieldValue&&(i.fieldValue=i.defaultFieldValue);i.alternativeText=(0,r.stringToPDFString)(t.get("TU")||"");this.setDefaultAppearance(e);i.hasAppearance=this._needAppearances&&void 0!==i.fieldValue&&null!==i.fieldValue||i.hasAppearance;const l=(0,n.getInheritableProperty)({dict:t,key:"FT"});i.fieldType=l instanceof s.Name?l.name:null;const h=(0,n.getInheritableProperty)({dict:t,key:"DR"}),u=e.acroForm.get("DR"),d=this.appearance&&this.appearance.dict.get("Resources");this._fieldResources={localResources:h,acroFormResources:u,appearanceResources:d,mergedResources:s.Dict.merge({xref:a,dictArray:[h,d,u],mergeSubDicts:!0})};i.fieldFlags=(0,n.getInheritableProperty)({dict:t,key:"Ff"});(!Number.isInteger(i.fieldFlags)||i.fieldFlags<0)&&(i.fieldFlags=0);i.readOnly=this.hasFieldFlag(r.AnnotationFieldFlag.READONLY);i.required=this.hasFieldFlag(r.AnnotationFieldFlag.REQUIRED);i.hidden=this._hasFlag(i.annotationFlags,r.AnnotationFlag.HIDDEN)}_decodeFormValue(e){return Array.isArray(e)?e.filter((e=>"string"==typeof e)).map((e=>(0,r.stringToPDFString)(e))):e instanceof s.Name?(0,r.stringToPDFString)(e.name):"string"==typeof e?(0,r.stringToPDFString)(e):null}hasFieldFlag(e){return!!(this.data.fieldFlags&e)}getRotationMatrix(e){const t=e?e.get(this.data.id):void 0;let a=t&&t.rotation;void 0===a&&(a=this.rotation);if(0===a)return r.IDENTITY_MATRIX;const i=this.data.rect[2]-this.data.rect[0],s=this.data.rect[3]-this.data.rect[1];return(0,n.getRotationMatrix)(a,i,s)}getBorderAndBackgroundAppearances(e){const t=e?e.get(this.data.id):void 0;let a=t&&t.rotation;void 0===a&&(a=this.rotation);if(!this.backgroundColor&&!this.borderColor)return"";const r=this.data.rect[2]-this.data.rect[0],n=this.data.rect[3]-this.data.rect[1],s=0===a||180===a?`0 0 ${r} ${n} re`:`0 0 ${n} ${r} re`;let o="";this.backgroundColor&&(o=`${(0,i.getPdfColor)(this.backgroundColor,!0)} ${s} f `);if(this.borderColor){o+=`${this.borderStyle.width||1} w ${(0,i.getPdfColor)(this.borderColor,!1)} ${s} S `}return o}async getOperatorList(e,t,a,n,i){if(n&&!(this instanceof SignatureWidgetAnnotation))return{opList:new g.OperatorList,separateForm:!0,separateCanvas:!1};if(!this._hasText)return super.getOperatorList(e,t,a,n,i);const s=await this._getAppearance(e,t,a,i);if(this.appearance&&null===s)return super.getOperatorList(e,t,a,n,i);const o=new g.OperatorList;if(!this._defaultAppearance||null===s)return{opList:o,separateForm:!1,separateCanvas:!1};const c=[0,0,this.data.rect[2]-this.data.rect[0],this.data.rect[3]-this.data.rect[1]],l=getTransformMatrix(this.data.rect,c,[1,0,0,1,0,0]);let h;this.oc&&(h=await e.parseMarkedContentProps(this.oc,null));void 0!==h&&o.addOp(r.OPS.beginMarkedContentProps,["OC",h]);o.addOp(r.OPS.beginAnnotation,[this.data.id,this.data.rect,l,this.getRotationMatrix(i),!1]);const u=new p.StringStream(s);await e.getOperatorList({stream:u,task:t,resources:this._fieldResources.mergedResources,operatorList:o});o.addOp(r.OPS.endAnnotation,[]);void 0!==h&&o.addOp(r.OPS.endMarkedContent,[]);return{opList:o,separateForm:!1,separateCanvas:!1}}_getMKDict(e){const t=new s.Dict(null);e&&t.set("R",e);this.borderColor&&t.set("BC",getPdfColorArray(this.borderColor));this.backgroundColor&&t.set("BG",getPdfColorArray(this.backgroundColor));return t.size>0?t:null}amendSavedDict(e,t){}async save(e,t,a){const i=a?a.get(this.data.id):void 0;let c=i&&i.value,l=i&&i.rotation;if(c===this.data.fieldValue||void 0===c){if(!this._hasValueFromXFA&&void 0===l)return null;c=c||this.data.fieldValue}if(void 0===l&&!this._hasValueFromXFA&&Array.isArray(c)&&Array.isArray(this.data.fieldValue)&&c.length===this.data.fieldValue.length&&c.every(((e,t)=>e===this.data.fieldValue[t])))return null;void 0===l&&(l=this.rotation);let h=null;if(!this._needAppearances){h=await this._getAppearance(e,t,r.RenderingIntentFlag.SAVE,a);if(null===h)return null}let u=!1;if(h&&h.needAppearances){u=!0;h=null}const{xref:d}=e,f=d.fetchIfRef(this.ref);if(!(f instanceof s.Dict))return null;const g=new s.Dict(d);for(const e of f.getKeys())"AP"!==e&&g.set(e,f.getRaw(e));const m={path:this.data.fieldName,value:c},encoder=e=>(0,n.isAscii)(e)?e:(0,n.stringToUTF16String)(e,!0);g.set("V",Array.isArray(c)?c.map(encoder):encoder(c));this.amendSavedDict(a,g);const b=this._getMKDict(l);b&&g.set("MK",b);const y=d.encrypt,w=y?y.createCipherTransform(this.ref.num,this.ref.gen):null,S=[],x=[{ref:this.ref,data:"",xfa:m,needAppearances:u}];if(null!==h){const e=d.getNewTemporaryRef(),t=new s.Dict(d);g.set("AP",t);t.set("N",e);let n=null;y&&(n=y.createCipherTransform(e.num,e.gen));const i=this._getSaveFieldResources(d),c=new p.StringStream(h),l=c.dict=new s.Dict(d);l.set("Subtype",s.Name.get("Form"));l.set("Resources",i);l.set("BBox",[0,0,this.data.rect[2]-this.data.rect[0],this.data.rect[3]-this.data.rect[1]]);const u=this.getRotationMatrix(a);u!==r.IDENTITY_MATRIX&&l.set("Matrix",u);(0,o.writeObject)(e,c,S,n);x.push({ref:e,data:S.join(""),xfa:null,needAppearances:!1});S.length=0}g.set("M",`D:${(0,r.getModificationDate)()}`);(0,o.writeObject)(this.ref,g,S,w);x[0].data=S.join("");return x}async _getAppearance(e,t,a,s){if(this.hasFieldFlag(r.AnnotationFieldFlag.PASSWORD))return null;const o=s?s.get(this.data.id):void 0;let c,l;if(o){c=o.formattedValue||o.value;l=o.rotation}if(void 0===l&&void 0===c&&!this._needAppearances&&(!this._hasValueFromXFA||this.appearance))return null;const h=this.getBorderAndBackgroundAppearances(s);if(void 0===c){c=this.data.fieldValue;if(!c)return`/Tx BMC q ${h}Q EMC`}Array.isArray(c)&&1===c.length&&(c=c[0]);(0,r.assert)("string"==typeof c,"Expected `value` to be a string.");c=c.trim();if(this.data.combo){const e=this.data.options.find((({exportValue:e})=>c===e));c=e&&e.displayValue||c}if(""===c)return`/Tx BMC q ${h}Q EMC`;void 0===l&&(l=this.rotation);let u,d=-1;if(this.data.multiLine){u=c.split(/\r\n?|\n/).map((e=>e.normalize("NFC")));d=u.length}else u=[c.replace(/\r\n?|\n/,"").normalize("NFC")];let f=this.data.rect[3]-this.data.rect[1],g=this.data.rect[2]-this.data.rect[0];90!==l&&270!==l||([g,f]=[f,g]);this._defaultAppearance||(this.data.defaultAppearanceData=(0,i.parseDefaultAppearance)(this._defaultAppearance="/Helvetica 0 Tf 0 g"));let p,m,b,y=await WidgetAnnotation._getFontData(e,t,this.data.defaultAppearanceData,this._fieldResources.mergedResources);const w=[];let S=!1;for(const e of u){const t=y.encodeString(e);t.length>1&&(S=!0);w.push(t.join(""))}if(S&&a&r.RenderingIntentFlag.SAVE)return{needAppearances:!0};if(S&&this._isOffscreenCanvasSupported){const a=this.data.comb?"monospace":"sans-serif",r=new i.FakeUnicodeFont(e.xref,a),s=r.createFontResources(u.join("")),o=s.getRaw("Font");if(this._fieldResources.mergedResources.has("Font")){const e=this._fieldResources.mergedResources.get("Font");for(const t of o.getKeys())e.set(t,o.getRaw(t))}else this._fieldResources.mergedResources.set("Font",o);const l=r.fontName.name;y=await WidgetAnnotation._getFontData(e,t,{fontName:l,fontSize:0},s);for(let e=0,t=w.length;e<t;e++)w[e]=(0,n.stringToUTF16String)(u[e]);const h=Object.assign(Object.create(null),this.data.defaultAppearanceData);this.data.defaultAppearanceData.fontSize=0;this.data.defaultAppearanceData.fontName=l;[p,m,b]=this._computeFontSize(f-2,g-4,c,y,d);this.data.defaultAppearanceData=h}else{this._isOffscreenCanvasSupported||(0,r.warn)("_getAppearance: OffscreenCanvas is not supported, annotation may not render correctly.");[p,m,b]=this._computeFontSize(f-2,g-4,c,y,d)}let x=y.descent;x=isNaN(x)?r.BASELINE_FACTOR*b:Math.max(r.BASELINE_FACTOR*b,Math.abs(x)*m);const C=Math.min(Math.floor((f-m)/2),1),k=this.data.textAlignment;if(this.data.multiLine)return this._getMultilineAppearance(p,w,y,m,g,f,k,2,C,x,b,s);if(this.data.comb)return this._getCombAppearance(p,y,w[0],m,g,f,2,C,x,b,s);const v=C+x;if(0===k||k>2)return`/Tx BMC q ${h}BT `+p+` 1 0 0 1 ${(0,n.numberToString)(2)} ${(0,n.numberToString)(v)} Tm (${(0,n.escapeString)(w[0])}) Tj ET Q EMC`;return`/Tx BMC q ${h}BT `+p+` 1 0 0 1 0 0 Tm ${this._renderText(w[0],y,m,g,k,{shift:0},2,v)} ET Q EMC`}static async _getFontData(e,t,a,r){const n=new g.OperatorList,i={font:null,clone(){return this}},{fontName:o,fontSize:c}=a;await e.handleSetFont(r,[o&&s.Name.get(o),c],null,n,t,i,null);return i.font}_getTextWidth(e,t){return t.charsToGlyphs(e).reduce(((e,t)=>e+t.width),0)/1e3}_computeFontSize(e,t,a,n,s){let{fontSize:o}=this.data.defaultAppearanceData,c=(o||12)*r.LINE_FACTOR,l=Math.round(e/c);if(!o){const roundWithTwoDigits=e=>Math.floor(100*e)/100;if(-1===s){const i=this._getTextWidth(a,n);o=roundWithTwoDigits(Math.min(e/r.LINE_FACTOR,i>t?t/i:1/0));l=1}else{const i=a.split(/\r\n?|\n/),h=[];for(const e of i){const t=n.encodeString(e).join(""),a=n.charsToGlyphs(t),r=n.getCharPositions(t);h.push({line:t,glyphs:a,positions:r})}const isTooBig=a=>{let r=0;for(const i of h){r+=this._splitLine(null,n,a,t,i).length*a;if(r>e)return!0}return!1};l=Math.max(l,s);for(;;){c=e/l;o=roundWithTwoDigits(c/r.LINE_FACTOR);if(!isTooBig(o))break;l++}}const{fontName:h,fontColor:u}=this.data.defaultAppearanceData;this._defaultAppearance=(0,i.createDefaultAppearance)({fontSize:o,fontName:h,fontColor:u})}return[this._defaultAppearance,o,e/l]}_renderText(e,t,a,r,i,s,o,c){let l;if(1===i){l=(r-this._getTextWidth(e,t)*a)/2}else if(2===i){l=r-this._getTextWidth(e,t)*a-o}else l=o;const h=(0,n.numberToString)(l-s.shift);s.shift=l;return`${h} ${c=(0,n.numberToString)(c)} Td (${(0,n.escapeString)(e)}) Tj`}_getSaveFieldResources(e){const{localResources:t,appearanceResources:a,acroFormResources:r}=this._fieldResources,n=this.data.defaultAppearanceData&&this.data.defaultAppearanceData.fontName;if(!n)return t||s.Dict.empty;for(const e of[t,a])if(e instanceof s.Dict){const t=e.get("Font");if(t instanceof s.Dict&&t.has(n))return e}if(r instanceof s.Dict){const a=r.get("Font");if(a instanceof s.Dict&&a.has(n)){const r=new s.Dict(e);r.set(n,a.getRaw(n));const i=new s.Dict(e);i.set("Font",r);return s.Dict.merge({xref:e,dictArray:[i,t],mergeSubDicts:!0})}}return t||s.Dict.empty}getFieldObject(){return null}}class TextWidgetAnnotation extends WidgetAnnotation{constructor(e){super(e);this._hasText=!0;const t=e.dict;"string"!=typeof this.data.fieldValue&&(this.data.fieldValue="");let a=(0,n.getInheritableProperty)({dict:t,key:"Q"});(!Number.isInteger(a)||a<0||a>2)&&(a=null);this.data.textAlignment=a;let i=(0,n.getInheritableProperty)({dict:t,key:"MaxLen"});(!Number.isInteger(i)||i<0)&&(i=0);this.data.maxLen=i;this.data.multiLine=this.hasFieldFlag(r.AnnotationFieldFlag.MULTILINE);this.data.comb=this.hasFieldFlag(r.AnnotationFieldFlag.COMB)&&!this.hasFieldFlag(r.AnnotationFieldFlag.MULTILINE)&&!this.hasFieldFlag(r.AnnotationFieldFlag.PASSWORD)&&!this.hasFieldFlag(r.AnnotationFieldFlag.FILESELECT)&&0!==this.data.maxLen;this.data.doNotScroll=this.hasFieldFlag(r.AnnotationFieldFlag.DONOTSCROLL)}_getCombAppearance(e,t,a,r,i,s,o,c,l,h,u){const d=i/this.data.maxLen,f=this.getBorderAndBackgroundAppearances(u),g=[],p=t.getCharPositions(a);for(const[e,t]of p)g.push(`(${(0,n.escapeString)(a.substring(e,t))}) Tj`);const m=g.join(` ${(0,n.numberToString)(d)} 0 Td `);return`/Tx BMC q ${f}BT `+e+` 1 0 0 1 ${(0,n.numberToString)(o)} ${(0,n.numberToString)(c+l)} Tm ${m} ET Q EMC`}_getMultilineAppearance(e,t,a,r,i,s,o,c,l,h,u,d){const f=[],g=i-2*c,p={shift:0};for(let e=0,n=t.length;e<n;e++){const n=t[e],s=this._splitLine(n,a,r,g);for(let t=0,n=s.length;t<n;t++){const n=s[t],d=0===e&&0===t?-l-(u-h):-u;f.push(this._renderText(n,a,r,i,o,p,c,d))}}const m=this.getBorderAndBackgroundAppearances(d),b=f.join("\n");return`/Tx BMC q ${m}BT `+e+` 1 0 0 1 0 ${(0,n.numberToString)(s)} Tm ${b} ET Q EMC`}_splitLine(e,t,a,r,n={}){e=n.line||e;const i=n.glyphs||t.charsToGlyphs(e);if(i.length<=1)return[e];const s=n.positions||t.getCharPositions(e),o=a/1e3,c=[];let l=-1,h=-1,u=-1,d=0,f=0;for(let t=0,a=i.length;t<a;t++){const[a,n]=s[t],g=i[t],p=g.width*o;if(" "===g.unicode)if(f+p>r){c.push(e.substring(d,a));d=a;f=p;l=-1;u=-1}else{f+=p;l=a;h=n;u=t}else if(f+p>r)if(-1!==l){c.push(e.substring(d,h));d=h;t=u+1;l=-1;f=0}else{c.push(e.substring(d,a));d=a;f=p}else f+=p}d<e.length&&c.push(e.substring(d,e.length));return c}getFieldObject(){return{id:this.data.id,value:this.data.fieldValue,defaultValue:this.data.defaultFieldValue||"",multiline:this.data.multiLine,password:this.hasFieldFlag(r.AnnotationFieldFlag.PASSWORD),charLimit:this.data.maxLen,comb:this.data.comb,editable:!this.data.readOnly,hidden:this.data.hidden,name:this.data.fieldName,rect:this.data.rect,actions:this.data.actions,page:this.data.pageIndex,strokeColor:this.data.borderColor,fillColor:this.data.backgroundColor,rotation:this.rotation,type:"text"}}}class ButtonWidgetAnnotation extends WidgetAnnotation{constructor(e){super(e);this.checkedAppearance=null;this.uncheckedAppearance=null;this.data.checkBox=!this.hasFieldFlag(r.AnnotationFieldFlag.RADIO)&&!this.hasFieldFlag(r.AnnotationFieldFlag.PUSHBUTTON);this.data.radioButton=this.hasFieldFlag(r.AnnotationFieldFlag.RADIO)&&!this.hasFieldFlag(r.AnnotationFieldFlag.PUSHBUTTON);this.data.pushButton=this.hasFieldFlag(r.AnnotationFieldFlag.PUSHBUTTON);this.data.isTooltipOnly=!1;if(this.data.checkBox)this._processCheckBox(e);else if(this.data.radioButton)this._processRadioButton(e);else if(this.data.pushButton){this.data.hasOwnCanvas=!0;this._processPushButton(e)}else(0,r.warn)("Invalid field flags for button widget annotation")}async getOperatorList(e,t,a,n,i){if(this.data.pushButton)return super.getOperatorList(e,t,a,!1,i);let s=null,o=null;if(i){const e=i.get(this.data.id);s=e?e.value:null;o=e?e.rotation:null}if(null===s&&this.appearance)return super.getOperatorList(e,t,a,n,i);null==s&&(s=this.data.checkBox?this.data.fieldValue===this.data.exportValue:this.data.fieldValue===this.data.buttonValue);const c=s?this.checkedAppearance:this.uncheckedAppearance;if(c){const s=this.appearance,l=c.dict.getArray("Matrix")||r.IDENTITY_MATRIX;o&&c.dict.set("Matrix",this.getRotationMatrix(i));this.appearance=c;const h=super.getOperatorList(e,t,a,n,i);this.appearance=s;c.dict.set("Matrix",l);return h}return{opList:new g.OperatorList,separateForm:!1,separateCanvas:!1}}async save(e,t,a){return this.data.checkBox?this._saveCheckbox(e,t,a):this.data.radioButton?this._saveRadioButton(e,t,a):null}async _saveCheckbox(e,t,a){if(!a)return null;const n=a.get(this.data.id);let i=n&&n.rotation,c=n&&n.value;if(void 0===i){if(void 0===c)return null;if(this.data.fieldValue===this.data.exportValue===c)return null}const l=e.xref.fetchIfRef(this.ref);if(!(l instanceof s.Dict))return null;void 0===i&&(i=this.rotation);void 0===c&&(c=this.data.fieldValue===this.data.exportValue);const h={path:this.data.fieldName,value:c?this.data.exportValue:""},u=s.Name.get(c?this.data.exportValue:"Off");l.set("V",u);l.set("AS",u);l.set("M",`D:${(0,r.getModificationDate)()}`);const d=this._getMKDict(i);d&&l.set("MK",d);const f=e.xref.encrypt;let g=null;f&&(g=f.createCipherTransform(this.ref.num,this.ref.gen));const p=[`${this.ref.num} ${this.ref.gen} obj\n`];(0,o.writeDict)(l,p,g);p.push("\nendobj\n");return[{ref:this.ref,data:p.join(""),xfa:h}]}async _saveRadioButton(e,t,a){if(!a)return null;const n=a.get(this.data.id);let i=n&&n.rotation,c=n&&n.value;if(void 0===i){if(void 0===c)return null;if(this.data.fieldValue===this.data.buttonValue===c)return null}const l=e.xref.fetchIfRef(this.ref);if(!(l instanceof s.Dict))return null;void 0===c&&(c=this.data.fieldValue===this.data.buttonValue);void 0===i&&(i=this.rotation);const h={path:this.data.fieldName,value:c?this.data.buttonValue:""},u=s.Name.get(c?this.data.buttonValue:"Off");let d=null;const f=e.xref.encrypt;if(c)if(this.parent instanceof s.Ref){const t=e.xref.fetch(this.parent);let a=null;f&&(a=f.createCipherTransform(this.parent.num,this.parent.gen));t.set("V",u);d=[`${this.parent.num} ${this.parent.gen} obj\n`];(0,o.writeDict)(t,d,a);d.push("\nendobj\n")}else this.parent instanceof s.Dict&&this.parent.set("V",u);l.set("AS",u);l.set("M",`D:${(0,r.getModificationDate)()}`);const g=this._getMKDict(i);g&&l.set("MK",g);let p=null;f&&(p=f.createCipherTransform(this.ref.num,this.ref.gen));const m=[`${this.ref.num} ${this.ref.gen} obj\n`];(0,o.writeDict)(l,m,p);m.push("\nendobj\n");const b=[{ref:this.ref,data:m.join(""),xfa:h}];null!==d&&b.push({ref:this.parent,data:d.join(""),xfa:null});return b}_getDefaultCheckedAppearance(e,t){const a=this.data.rect[2]-this.data.rect[0],i=this.data.rect[3]-this.data.rect[1],o=[0,0,a,i],c=.8*Math.min(a,i);let l,h;if("check"===t){l={width:.755*c,height:.705*c};h="3"}else if("disc"===t){l={width:.791*c,height:.705*c};h="l"}else(0,r.unreachable)(`_getDefaultCheckedAppearance - unsupported type: ${t}`);const u=`q BT /PdfJsZaDb ${c} Tf 0 g ${(0,n.numberToString)((a-l.width)/2)} ${(0,n.numberToString)((i-l.height)/2)} Td (${h}) Tj ET Q`,d=new s.Dict(e.xref);d.set("FormType",1);d.set("Subtype",s.Name.get("Form"));d.set("Type",s.Name.get("XObject"));d.set("BBox",o);d.set("Matrix",[1,0,0,1,0,0]);d.set("Length",u.length);const f=new s.Dict(e.xref),g=new s.Dict(e.xref);g.set("PdfJsZaDb",this.fallbackFontDict);f.set("Font",g);d.set("Resources",f);this.checkedAppearance=new p.StringStream(u);this.checkedAppearance.dict=d;this._streams.push(this.checkedAppearance)}_processCheckBox(e){const t=e.dict.get("AP");if(!(t instanceof s.Dict))return;const a=t.get("N");if(!(a instanceof s.Dict))return;const r=this._decodeFormValue(e.dict.get("AS"));"string"==typeof r&&(this.data.fieldValue=r);const n=null!==this.data.fieldValue&&"Off"!==this.data.fieldValue?this.data.fieldValue:"Yes",i=a.getKeys();if(0===i.length)i.push("Off",n);else if(1===i.length)"Off"===i[0]?i.push(n):i.unshift("Off");else if(i.includes(n)){i.length=0;i.push("Off",n)}else{const e=i.find((e=>"Off"!==e));i.length=0;i.push("Off",e)}i.includes(this.data.fieldValue)||(this.data.fieldValue="Off");this.data.exportValue=i[1];const o=a.get(this.data.exportValue);this.checkedAppearance=o instanceof c.BaseStream?o:null;const l=a.get("Off");this.uncheckedAppearance=l instanceof c.BaseStream?l:null;this.checkedAppearance?this._streams.push(this.checkedAppearance):this._getDefaultCheckedAppearance(e,"check");this.uncheckedAppearance&&this._streams.push(this.uncheckedAppearance);this._fallbackFontDict=this.fallbackFontDict}_processRadioButton(e){this.data.fieldValue=this.data.buttonValue=null;const t=e.dict.get("Parent");if(t instanceof s.Dict){this.parent=e.dict.getRaw("Parent");const a=t.get("V");a instanceof s.Name&&(this.data.fieldValue=this._decodeFormValue(a))}const a=e.dict.get("AP");if(!(a instanceof s.Dict))return;const r=a.get("N");if(!(r instanceof s.Dict))return;for(const e of r.getKeys())if("Off"!==e){this.data.buttonValue=this._decodeFormValue(e);break}const n=r.get(this.data.buttonValue);this.checkedAppearance=n instanceof c.BaseStream?n:null;const i=r.get("Off");this.uncheckedAppearance=i instanceof c.BaseStream?i:null;this.checkedAppearance?this._streams.push(this.checkedAppearance):this._getDefaultCheckedAppearance(e,"disc");this.uncheckedAppearance&&this._streams.push(this.uncheckedAppearance);this._fallbackFontDict=this.fallbackFontDict}_processPushButton(e){if(e.dict.has("A")||e.dict.has("AA")||this.data.alternativeText){this.data.isTooltipOnly=!e.dict.has("A")&&!e.dict.has("AA");h.Catalog.parseDestDictionary({destDict:e.dict,resultObj:this.data,docBaseUrl:e.pdfManager.docBaseUrl,docAttachments:e.attachments})}else(0,r.warn)("Push buttons without action dictionaries are not supported")}getFieldObject(){let e,t="button";if(this.data.checkBox){t="checkbox";e=this.data.exportValue}else if(this.data.radioButton){t="radiobutton";e=this.data.buttonValue}return{id:this.data.id,value:this.data.fieldValue||"Off",defaultValue:this.data.defaultFieldValue,exportValues:e,editable:!this.data.readOnly,name:this.data.fieldName,rect:this.data.rect,hidden:this.data.hidden,actions:this.data.actions,page:this.data.pageIndex,strokeColor:this.data.borderColor,fillColor:this.data.backgroundColor,rotation:this.rotation,type:t}}get fallbackFontDict(){const e=new s.Dict;e.set("BaseFont",s.Name.get("ZapfDingbats"));e.set("Type",s.Name.get("FallbackType"));e.set("Subtype",s.Name.get("FallbackType"));e.set("Encoding",s.Name.get("ZapfDingbatsEncoding"));return(0,r.shadow)(this,"fallbackFontDict",e)}}class ChoiceWidgetAnnotation extends WidgetAnnotation{constructor(e){super(e);const{dict:t,xref:a}=e;this.indices=t.getArray("I");this.hasIndices=Array.isArray(this.indices)&&this.indices.length>0;this.data.options=[];const i=(0,n.getInheritableProperty)({dict:t,key:"Opt"});if(Array.isArray(i))for(let e=0,t=i.length;e<t;e++){const t=a.fetchIfRef(i[e]),r=Array.isArray(t);this.data.options[e]={exportValue:this._decodeFormValue(r?a.fetchIfRef(t[0]):t),displayValue:this._decodeFormValue(r?a.fetchIfRef(t[1]):t)}}if(this.hasIndices){this.data.fieldValue=[];const e=this.data.options.length;for(const t of this.indices)Number.isInteger(t)&&t>=0&&t<e&&this.data.fieldValue.push(this.data.options[t].exportValue)}else"string"==typeof this.data.fieldValue?this.data.fieldValue=[this.data.fieldValue]:this.data.fieldValue||(this.data.fieldValue=[]);this.data.combo=this.hasFieldFlag(r.AnnotationFieldFlag.COMBO);this.data.multiSelect=this.hasFieldFlag(r.AnnotationFieldFlag.MULTISELECT);this._hasText=!0}getFieldObject(){const e=this.data.combo?"combobox":"listbox",t=this.data.fieldValue.length>0?this.data.fieldValue[0]:null;return{id:this.data.id,value:t,defaultValue:this.data.defaultFieldValue,editable:!this.data.readOnly,name:this.data.fieldName,rect:this.data.rect,numItems:this.data.fieldValue.length,multipleSelection:this.data.multiSelect,hidden:this.data.hidden,actions:this.data.actions,items:this.data.options,page:this.data.pageIndex,strokeColor:this.data.borderColor,fillColor:this.data.backgroundColor,rotation:this.rotation,type:e}}amendSavedDict(e,t){if(!this.hasIndices)return;const a=e?e.get(this.data.id):void 0;let r=a&&a.value;Array.isArray(r)||(r=[r]);const n=[],{options:i}=this.data;for(let e=0,t=0,a=i.length;e<a;e++)if(i[e].exportValue===r[t]){n.push(e);t+=1}t.set("I",n)}async _getAppearance(e,t,a,n){if(this.data.combo)return super._getAppearance(e,t,a,n);let s,o;const c=n?n.get(this.data.id):void 0;if(c){o=c.rotation;s=c.value}if(void 0===o&&void 0===s&&!this._needAppearances)return null;void 0===s?s=this.data.fieldValue:Array.isArray(s)||(s=[s]);let l=this.data.rect[3]-this.data.rect[1],h=this.data.rect[2]-this.data.rect[0];90!==o&&270!==o||([h,l]=[l,h]);const u=this.data.options.length,d=[];for(let e=0;e<u;e++){const{exportValue:t}=this.data.options[e];s.includes(t)&&d.push(e)}this._defaultAppearance||(this.data.defaultAppearanceData=(0,i.parseDefaultAppearance)(this._defaultAppearance="/Helvetica 0 Tf 0 g"));const f=await WidgetAnnotation._getFontData(e,t,this.data.defaultAppearanceData,this._fieldResources.mergedResources);let g,{fontSize:p}=this.data.defaultAppearanceData;if(p)g=this._defaultAppearance;else{const e=(l-1)/u;let t,a=-1;for(const{displayValue:e}of this.data.options){const r=this._getTextWidth(e,f);if(r>a){a=r;t=e}}[g,p]=this._computeFontSize(e,h-4,t,f,-1)}const m=p*r.LINE_FACTOR,b=(m-p)/2,y=Math.floor(l/m);let w;if(1===d.length){const e=d[0];w=e-e%y}else w=d.length?d[0]:0;const S=Math.min(w+y+1,u),x=["/Tx BMC q",`1 1 ${h} ${l} re W n`];if(d.length){x.push("0.600006 0.756866 0.854904 rg");for(const e of d)w<=e&&e<S&&x.push(`1 ${l-(e-w+1)*m} ${h} ${m} re f`)}x.push("BT",g,`1 0 0 1 0 ${l} Tm`);const C={shift:0};for(let e=w;e<S;e++){const{displayValue:t}=this.data.options[e],a=e===w?b:0;x.push(this._renderText(t,f,p,h,0,C,2,-m+a))}x.push("ET Q EMC");return x.join("\n")}}class SignatureWidgetAnnotation extends WidgetAnnotation{constructor(e){super(e);this.data.fieldValue=null}getFieldObject(){return{id:this.data.id,value:null,page:this.data.pageIndex,type:"signature"}}}class TextAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t}=e;this.data.annotationType=r.AnnotationType.TEXT;if(this.data.hasAppearance)this.data.name="NoIcon";else{this.data.rect[1]=this.data.rect[3]-22;this.data.rect[2]=this.data.rect[0]+22;this.data.name=t.has("Name")?t.get("Name").name:"Note"}if(t.has("State")){this.data.state=t.get("State")||null;this.data.stateModel=t.get("StateModel")||null}else{this.data.state=null;this.data.stateModel=null}}}class LinkAnnotation extends Annotation{constructor(e){super(e);this.data.annotationType=r.AnnotationType.LINK;const t=getQuadPoints(e.dict,this.rectangle);t&&(this.data.quadPoints=t);this.data.borderColor=this.data.borderColor||this.data.color;h.Catalog.parseDestDictionary({destDict:e.dict,resultObj:this.data,docBaseUrl:e.pdfManager.docBaseUrl,docAttachments:e.attachments})}}class PopupAnnotation extends Annotation{constructor(e){super(e);const{dict:t}=e;this.data.annotationType=r.AnnotationType.POPUP;let a=t.get("Parent");if(!a){(0,r.warn)("Popup annotation has a missing or invalid parent annotation.");return}const n=a.get("Subtype");this.data.parentType=n instanceof s.Name?n.name:null;const i=t.getRaw("Parent");this.data.parentId=i instanceof s.Ref?i.toString():null;const o=a.getArray("Rect");Array.isArray(o)&&4===o.length?this.data.parentRect=r.Util.normalizeRect(o):this.data.parentRect=[0,0,0,0];const c=a.get("RT");(0,s.isName)(c,r.AnnotationReplyType.GROUP)&&(a=a.get("IRT"));if(a.has("M")){this.setModificationDate(a.get("M"));this.data.modificationDate=this.modificationDate}else this.data.modificationDate=null;if(a.has("C")){this.setColor(a.getArray("C"));this.data.color=this.color}else this.data.color=null;if(!this.viewable){const e=a.get("F");this._isViewable(e)&&this.setFlags(e)}this.setTitle(a.get("T"));this.data.titleObj=this._title;this.setContents(a.get("Contents"));this.data.contentsObj=this._contents;a.has("RC")&&(this.data.richText=m.XFAFactory.getRichTextAsHtml(a.get("RC")))}}t.PopupAnnotation=PopupAnnotation;class FreeTextAnnotation extends MarkupAnnotation{constructor(e){super(e);const{xref:t}=e;this.data.annotationType=r.AnnotationType.FREETEXT;this.setDefaultAppearance(e);if(!this.appearance&&this._isOffscreenCanvasSupported){const a=e.dict.get("CA"),r=new i.FakeUnicodeFont(t,"sans-serif"),n=this.data.defaultAppearanceData;this.appearance=r.createAppearance(this._contents.str,this.rectangle,this.rotation,n.fontSize||10,n.fontColor,a);this._streams.push(this.appearance,i.FakeUnicodeFont.toUnicodeStream)}else this._isOffscreenCanvasSupported||(0,r.warn)("FreeTextAnnotation: OffscreenCanvas is not supported, annotation may not render correctly.")}get hasTextContent(){return!!this.appearance}static createNewDict(e,t,{apRef:a,ap:o}){const{color:c,fontSize:l,rect:h,rotation:u,user:d,value:f}=e,g=new s.Dict(t);g.set("Type",s.Name.get("Annot"));g.set("Subtype",s.Name.get("FreeText"));g.set("CreationDate",`D:${(0,r.getModificationDate)()}`);g.set("Rect",h);const p=`/Helv ${l} Tf ${(0,i.getPdfColor)(c,!0)}`;g.set("DA",p);g.set("Contents",(0,n.isAscii)(f)?f:(0,n.stringToUTF16String)(f,!0));g.set("F",4);g.set("Border",[0,0,0]);g.set("Rotate",u);d&&g.set("T",(0,n.isAscii)(d)?d:(0,n.stringToUTF16String)(d,!0));if(a||o){const e=new s.Dict(t);g.set("AP",e);a?e.set("N",a):e.set("N",o)}return g}static async createNewAppearanceStream(e,t,a){const{baseFontRef:o,evaluator:c,task:l}=a,{color:h,fontSize:u,rect:d,rotation:f,value:g}=e,m=new s.Dict(t),b=new s.Dict(t);if(o)b.set("Helv",o);else{const e=new s.Dict(t);e.set("BaseFont",s.Name.get("Helvetica"));e.set("Type",s.Name.get("Font"));e.set("Subtype",s.Name.get("Type1"));e.set("Encoding",s.Name.get("WinAnsiEncoding"));b.set("Helv",e)}m.set("Font",b);const y=await WidgetAnnotation._getFontData(c,l,{fontName:"Helvetica",fontSize:u},m),[w,S,x,C]=d;let k=x-w,v=C-S;f%180!=0&&([k,v]=[v,k]);const F=g.split("\n"),O=u/1e3;let T=-1/0;const M=[];for(let e of F){const t=y.encodeString(e);if(t.length>1)return null;e=t.join("");M.push(e);let a=0;const r=y.charsToGlyphs(e);for(const e of r)a+=e.width*O;T=Math.max(T,a)}let E=1;T>k&&(E=k/T);let D=1;const N=r.LINE_FACTOR*u,R=r.LINE_DESCENT_FACTOR*u,L=N*F.length;L>v&&(D=v/L);const j=u*Math.min(E,D),$=["q",`0 0 ${(0,n.numberToString)(k)} ${(0,n.numberToString)(v)} re W n`,"BT",`1 0 0 1 0 ${(0,n.numberToString)(v+R)} Tm 0 Tc ${(0,i.getPdfColor)(h,!0)}`,`/Helv ${(0,n.numberToString)(j)} Tf`],_=(0,n.numberToString)(N);for(const e of M)$.push(`0 -${_} Td (${(0,n.escapeString)(e)}) Tj`);$.push("ET","Q");const U=$.join("\n"),X=new s.Dict(t);X.set("FormType",1);X.set("Subtype",s.Name.get("Form"));X.set("Type",s.Name.get("XObject"));X.set("BBox",[0,0,k,v]);X.set("Resources",m);if(f){const e=(0,n.getRotationMatrix)(f,k,v);X.set("Matrix",e)}const H=new p.StringStream(U);H.dict=X;return H}}class LineAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:a}=e;this.data.annotationType=r.AnnotationType.LINE;const n=t.getArray("L");this.data.lineCoordinates=r.Util.normalizeRect(n);this.setLineEndings(t.getArray("LE"));this.data.lineEndings=this.lineEndings;if(!this.appearance){const e=this.color?getPdfColorArray(this.color):[0,0,0],i=t.get("CA"),s=getRgbColor(t.getArray("IC"),null),o=s?getPdfColorArray(s):null,c=o?i:null,l=this.borderStyle.width||1,h=2*l,u=[this.data.lineCoordinates[0]-h,this.data.lineCoordinates[1]-h,this.data.lineCoordinates[2]+h,this.data.lineCoordinates[3]+h];r.Util.intersect(this.rectangle,u)||(this.rectangle=u);this._setDefaultAppearance({xref:a,extra:`${l} w`,strokeColor:e,fillColor:o,strokeAlpha:i,fillAlpha:c,pointsCallback:(e,t)=>{e.push(`${n[0]} ${n[1]} m`,`${n[2]} ${n[3]} l`,"S");return[t[0].x-l,t[1].x+l,t[3].y-l,t[1].y+l]}})}}}class SquareAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:a}=e;this.data.annotationType=r.AnnotationType.SQUARE;if(!this.appearance){const e=this.color?getPdfColorArray(this.color):[0,0,0],r=t.get("CA"),n=getRgbColor(t.getArray("IC"),null),i=n?getPdfColorArray(n):null,s=i?r:null;if(0===this.borderStyle.width&&!i)return;this._setDefaultAppearance({xref:a,extra:`${this.borderStyle.width} w`,strokeColor:e,fillColor:i,strokeAlpha:r,fillAlpha:s,pointsCallback:(e,t)=>{const a=t[2].x+this.borderStyle.width/2,r=t[2].y+this.borderStyle.width/2,n=t[3].x-t[2].x-this.borderStyle.width,s=t[1].y-t[3].y-this.borderStyle.width;e.push(`${a} ${r} ${n} ${s} re`);i?e.push("B"):e.push("S");return[t[0].x,t[1].x,t[3].y,t[1].y]}})}}}class CircleAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:a}=e;this.data.annotationType=r.AnnotationType.CIRCLE;if(!this.appearance){const e=this.color?getPdfColorArray(this.color):[0,0,0],r=t.get("CA"),n=getRgbColor(t.getArray("IC"),null),i=n?getPdfColorArray(n):null,s=i?r:null;if(0===this.borderStyle.width&&!i)return;const o=4/3*Math.tan(Math.PI/8);this._setDefaultAppearance({xref:a,extra:`${this.borderStyle.width} w`,strokeColor:e,fillColor:i,strokeAlpha:r,fillAlpha:s,pointsCallback:(e,t)=>{const a=t[0].x+this.borderStyle.width/2,r=t[0].y-this.borderStyle.width/2,n=t[3].x-this.borderStyle.width/2,s=t[3].y+this.borderStyle.width/2,c=a+(n-a)/2,l=r+(s-r)/2,h=(n-a)/2*o,u=(s-r)/2*o;e.push(`${c} ${s} m`,`${c+h} ${s} ${n} ${l+u} ${n} ${l} c`,`${n} ${l-u} ${c+h} ${r} ${c} ${r} c`,`${c-h} ${r} ${a} ${l-u} ${a} ${l} c`,`${a} ${l+u} ${c-h} ${s} ${c} ${s} c`,"h");i?e.push("B"):e.push("S");return[t[0].x,t[1].x,t[3].y,t[1].y]}})}}}class PolylineAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:a}=e;this.data.annotationType=r.AnnotationType.POLYLINE;this.data.vertices=[];if(!(this instanceof PolygonAnnotation)){this.setLineEndings(t.getArray("LE"));this.data.lineEndings=this.lineEndings}const n=t.getArray("Vertices");if(Array.isArray(n)){for(let e=0,t=n.length;e<t;e+=2)this.data.vertices.push({x:n[e],y:n[e+1]});if(!this.appearance){const e=this.color?getPdfColorArray(this.color):[0,0,0],n=t.get("CA"),i=this.borderStyle.width||1,s=2*i,o=[1/0,1/0,-1/0,-1/0];for(const e of this.data.vertices){o[0]=Math.min(o[0],e.x-s);o[1]=Math.min(o[1],e.y-s);o[2]=Math.max(o[2],e.x+s);o[3]=Math.max(o[3],e.y+s)}r.Util.intersect(this.rectangle,o)||(this.rectangle=o);this._setDefaultAppearance({xref:a,extra:`${i} w`,strokeColor:e,strokeAlpha:n,pointsCallback:(e,t)=>{const a=this.data.vertices;for(let t=0,r=a.length;t<r;t++)e.push(`${a[t].x} ${a[t].y} ${0===t?"m":"l"}`);e.push("S");return[t[0].x,t[1].x,t[3].y,t[1].y]}})}}}}class PolygonAnnotation extends PolylineAnnotation{constructor(e){super(e);this.data.annotationType=r.AnnotationType.POLYGON}}class CaretAnnotation extends MarkupAnnotation{constructor(e){super(e);this.data.annotationType=r.AnnotationType.CARET}}class InkAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:a}=e;this.data.annotationType=r.AnnotationType.INK;this.data.inkLists=[];const n=t.getArray("InkList");if(Array.isArray(n)){for(let e=0,t=n.length;e<t;++e){this.data.inkLists.push([]);for(let t=0,r=n[e].length;t<r;t+=2)this.data.inkLists[e].push({x:a.fetchIfRef(n[e][t]),y:a.fetchIfRef(n[e][t+1])})}if(!this.appearance){const e=this.color?getPdfColorArray(this.color):[0,0,0],n=t.get("CA"),i=this.borderStyle.width||1,s=2*i,o=[1/0,1/0,-1/0,-1/0];for(const e of this.data.inkLists)for(const t of e){o[0]=Math.min(o[0],t.x-s);o[1]=Math.min(o[1],t.y-s);o[2]=Math.max(o[2],t.x+s);o[3]=Math.max(o[3],t.y+s)}r.Util.intersect(this.rectangle,o)||(this.rectangle=o);this._setDefaultAppearance({xref:a,extra:`${i} w`,strokeColor:e,strokeAlpha:n,pointsCallback:(e,t)=>{for(const t of this.data.inkLists){for(let a=0,r=t.length;a<r;a++)e.push(`${t[a].x} ${t[a].y} ${0===a?"m":"l"}`);e.push("S")}return[t[0].x,t[1].x,t[3].y,t[1].y]}})}}}static createNewDict(e,t,{apRef:a,ap:n}){const{paths:i,rect:o,rotation:c}=e,l=new s.Dict(t);l.set("Type",s.Name.get("Annot"));l.set("Subtype",s.Name.get("Ink"));l.set("CreationDate",`D:${(0,r.getModificationDate)()}`);l.set("Rect",o);l.set("InkList",i.map((e=>e.points)));l.set("F",4);l.set("Border",[0,0,0]);l.set("Rotate",c);const h=new s.Dict(t);l.set("AP",h);a?h.set("N",a):h.set("N",n);return l}static async createNewAppearanceStream(e,t,a){const{color:r,rect:o,rotation:c,paths:l,thickness:h,opacity:u}=e,[d,f,g,m]=o;let b=g-d,y=m-f;c%180!=0&&([b,y]=[y,b]);const w=[`${h} w 1 J 1 j`,`${(0,i.getPdfColor)(r,!1)}`];1!==u&&w.push("/R0 gs");const S=[];for(const{bezier:e}of l){S.length=0;S.push(`${(0,n.numberToString)(e[0])} ${(0,n.numberToString)(e[1])} m`);for(let t=2,a=e.length;t<a;t+=6){const a=e.slice(t,t+6).map(n.numberToString).join(" ");S.push(`${a} c`)}S.push("S");w.push(S.join("\n"))}const x=w.join("\n"),C=new s.Dict(t);C.set("FormType",1);C.set("Subtype",s.Name.get("Form"));C.set("Type",s.Name.get("XObject"));C.set("BBox",[0,0,b,y]);C.set("Length",x.length);if(c){const e=(0,n.getRotationMatrix)(c,b,y);C.set("Matrix",e)}if(1!==u){const e=new s.Dict(t),a=new s.Dict(t),r=new s.Dict(t);r.set("CA",u);r.set("Type",s.Name.get("ExtGState"));a.set("R0",r);e.set("ExtGState",a);C.set("Resources",e)}const k=new p.StringStream(x);k.dict=C;return k}}class HighlightAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:a}=e;this.data.annotationType=r.AnnotationType.HIGHLIGHT;if(this.data.quadPoints=getQuadPoints(t,null)){const e=this.appearance&&this.appearance.dict.get("Resources");if(!this.appearance||!e||!e.has("ExtGState")){this.appearance&&(0,r.warn)("HighlightAnnotation - ignoring built-in appearance stream.");const e=this.color?getPdfColorArray(this.color):[1,1,0],n=t.get("CA");this._setDefaultAppearance({xref:a,fillColor:e,blendMode:"Multiply",fillAlpha:n,pointsCallback:(e,t)=>{e.push(`${t[0].x} ${t[0].y} m`,`${t[1].x} ${t[1].y} l`,`${t[3].x} ${t[3].y} l`,`${t[2].x} ${t[2].y} l`,"f");return[t[0].x,t[1].x,t[3].y,t[1].y]}})}}else this.data.hasPopup=!1}}class UnderlineAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:a}=e;this.data.annotationType=r.AnnotationType.UNDERLINE;if(this.data.quadPoints=getQuadPoints(t,null)){if(!this.appearance){const e=this.color?getPdfColorArray(this.color):[0,0,0],r=t.get("CA");this._setDefaultAppearance({xref:a,extra:"[] 0 d 1 w",strokeColor:e,strokeAlpha:r,pointsCallback:(e,t)=>{e.push(`${t[2].x} ${t[2].y} m`,`${t[3].x} ${t[3].y} l`,"S");return[t[0].x,t[1].x,t[3].y,t[1].y]}})}}else this.data.hasPopup=!1}}class SquigglyAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:a}=e;this.data.annotationType=r.AnnotationType.SQUIGGLY;if(this.data.quadPoints=getQuadPoints(t,null)){if(!this.appearance){const e=this.color?getPdfColorArray(this.color):[0,0,0],r=t.get("CA");this._setDefaultAppearance({xref:a,extra:"[] 0 d 1 w",strokeColor:e,strokeAlpha:r,pointsCallback:(e,t)=>{const a=(t[0].y-t[2].y)/6;let r=a,n=t[2].x;const i=t[2].y,s=t[3].x;e.push(`${n} ${i+r} m`);do{n+=2;r=0===r?a:0;e.push(`${n} ${i+r} l`)}while(n<s);e.push("S");return[t[2].x,s,i-2*a,i+2*a]}})}}else this.data.hasPopup=!1}}class StrikeOutAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:a}=e;this.data.annotationType=r.AnnotationType.STRIKEOUT;if(this.data.quadPoints=getQuadPoints(t,null)){if(!this.appearance){const e=this.color?getPdfColorArray(this.color):[0,0,0],r=t.get("CA");this._setDefaultAppearance({xref:a,extra:"[] 0 d 1 w",strokeColor:e,strokeAlpha:r,pointsCallback:(e,t)=>{e.push((t[0].x+t[2].x)/2+" "+(t[0].y+t[2].y)/2+" m",(t[1].x+t[3].x)/2+" "+(t[1].y+t[3].y)/2+" l","S");return[t[0].x,t[1].x,t[3].y,t[1].y]}})}}else this.data.hasPopup=!1}}class StampAnnotation extends MarkupAnnotation{constructor(e){super(e);this.data.annotationType=r.AnnotationType.STAMP}}class FileAttachmentAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:a}=e,n=new d.FileSpec(t.get("FS"),a);this.data.annotationType=r.AnnotationType.FILEATTACHMENT;this.data.file=n.serializable;const i=t.get("Name");this.data.name=i instanceof s.Name?(0,r.stringToPDFString)(i.name):"PushPin"}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.FakeUnicodeFont=void 0;t.createDefaultAppearance=function createDefaultAppearance({fontSize:e,fontName:t,fontColor:a}){return`/${(0,n.escapePDFName)(t)} ${e} Tf ${getPdfColor(a,!0)}`};t.getPdfColor=getPdfColor;t.parseDefaultAppearance=function parseDefaultAppearance(e){return new DefaultAppearanceEvaluator(e).parse()};var r=a(4),n=a(3),i=a(2),s=a(12),o=a(13),c=a(8);class DefaultAppearanceEvaluator extends o.EvaluatorPreprocessor{constructor(e){super(new c.StringStream(e))}parse(){const e={fn:0,args:[]},t={fontSize:0,fontName:"",fontColor:new Uint8ClampedArray(3)};try{for(;;){e.args.length=0;if(!this.read(e))break;if(0!==this.savedStatesDepth)continue;const{fn:a,args:n}=e;switch(0|a){case i.OPS.setFont:const[e,a]=n;e instanceof r.Name&&(t.fontName=e.name);"number"==typeof a&&a>0&&(t.fontSize=a);break;case i.OPS.setFillRGBColor:s.ColorSpace.singletons.rgb.getRgbItem(n,0,t.fontColor,0);break;case i.OPS.setFillGray:s.ColorSpace.singletons.gray.getRgbItem(n,0,t.fontColor,0);break;case i.OPS.setFillColorSpace:s.ColorSpace.singletons.cmyk.getRgbItem(n,0,t.fontColor,0)}}}catch(e){(0,i.warn)(`parseDefaultAppearance - ignoring errors: "${e}".`)}return t}}function getPdfColor(e,t){if(e[0]===e[1]&&e[1]===e[2]){const a=e[0]/255;return`${(0,n.numberToString)(a)} ${t?"g":"G"}`}return Array.from(e,(e=>(0,n.numberToString)(e/255))).join(" ")+" "+(t?"rg":"RG")}class FakeUnicodeFont{constructor(e,t){this.xref=e;this.widths=null;this.firstChar=1/0;this.lastChar=-1/0;this.fontFamily=t;const a=new OffscreenCanvas(1,1);this.ctxMeasure=a.getContext("2d");FakeUnicodeFont._fontNameId||(FakeUnicodeFont._fontNameId=1);this.fontName=r.Name.get(`InvalidPDFjsFont_${t}_${FakeUnicodeFont._fontNameId++}`)}get toUnicodeRef(){if(!FakeUnicodeFont._toUnicodeRef){const e="/CIDInit /ProcSet findresource begin\n12 dict begin\nbegincmap\n/CIDSystemInfo\n<< /Registry (Adobe)\n/Ordering (UCS) /Supplement 0 >> def\n/CMapName /Adobe-Identity-UCS def\n/CMapType 2 def\n1 begincodespacerange\n<0000> <FFFF>\nendcodespacerange\n1 beginbfrange\n<0000> <FFFF> <0000>\nendbfrange\nendcmap CMapName currentdict /CMap defineresource pop end end",t=FakeUnicodeFont.toUnicodeStream=new c.StringStream(e),a=new r.Dict(this.xref);t.dict=a;a.set("Length",e.length);FakeUnicodeFont._toUnicodeRef=this.xref.getNewPersistentRef(t)}return FakeUnicodeFont._toUnicodeRef}get fontDescriptorRef(){if(!FakeUnicodeFont._fontDescriptorRef){const e=new r.Dict(this.xref);e.set("Type",r.Name.get("FontDescriptor"));e.set("FontName",this.fontName);e.set("FontFamily","MyriadPro Regular");e.set("FontBBox",[0,0,0,0]);e.set("FontStretch",r.Name.get("Normal"));e.set("FontWeight",400);e.set("ItalicAngle",0);FakeUnicodeFont._fontDescriptorRef=this.xref.getNewPersistentRef(e)}return FakeUnicodeFont._fontDescriptorRef}get descendantFontRef(){const e=new r.Dict(this.xref);e.set("BaseFont",this.fontName);e.set("Type",r.Name.get("Font"));e.set("Subtype",r.Name.get("CIDFontType0"));e.set("CIDToGIDMap",r.Name.get("Identity"));e.set("FirstChar",this.firstChar);e.set("LastChar",this.lastChar);e.set("FontDescriptor",this.fontDescriptorRef);e.set("DW",1e3);const t=[],a=[...this.widths.entries()].sort();let n=null,i=null;for(const[e,r]of a)if(n)if(e===n+i.length)i.push(r);else{t.push(n,i);n=e;i=[r]}else{n=e;i=[r]}n&&t.push(n,i);e.set("W",t);const s=new r.Dict(this.xref);s.set("Ordering","Identity");s.set("Registry","Adobe");s.set("Supplement",0);e.set("CIDSystemInfo",s);return this.xref.getNewPersistentRef(e)}get baseFontRef(){const e=new r.Dict(this.xref);e.set("BaseFont",this.fontName);e.set("Type",r.Name.get("Font"));e.set("Subtype",r.Name.get("Type0"));e.set("Encoding",r.Name.get("Identity-H"));e.set("DescendantFonts",[this.descendantFontRef]);e.set("ToUnicode",this.toUnicodeRef);return this.xref.getNewPersistentRef(e)}get resources(){const e=new r.Dict(this.xref),t=new r.Dict(this.xref);t.set(this.fontName.name,this.baseFontRef);e.set("Font",t);return e}_createContext(){this.widths=new Map;this.ctxMeasure.font=`1000px ${this.fontFamily}`;return this.ctxMeasure}createFontResources(e){const t=this._createContext();for(const a of e.split(/\r\n?|\n/))for(const e of a.split("")){const a=e.charCodeAt(0);if(this.widths.has(a))continue;const r=t.measureText(e),n=Math.ceil(r.width);this.widths.set(a,n);this.firstChar=Math.min(a,this.firstChar);this.lastChar=Math.max(a,this.lastChar)}return this.resources}createAppearance(e,t,a,s,o,l){const h=this._createContext(),u=[];let d=-1/0;for(const t of e.split(/\r\n?|\n/)){u.push(t);const e=h.measureText(t).width;d=Math.max(d,e);for(const e of t.split("")){const t=e.charCodeAt(0);let a=this.widths.get(t);if(void 0===a){const r=h.measureText(e);a=Math.ceil(r.width);this.widths.set(t,a);this.firstChar=Math.min(t,this.firstChar);this.lastChar=Math.max(t,this.lastChar)}}}d*=s/1e3;const[f,g,p,m]=t;let b=p-f,y=m-g;a%180!=0&&([b,y]=[y,b]);let w=1;d>b&&(w=b/d);let S=1;const x=i.LINE_FACTOR*s,C=i.LINE_DESCENT_FACTOR*s,k=x*u.length;k>y&&(S=y/k);const v=s*Math.min(w,S),F=["q",`0 0 ${(0,n.numberToString)(b)} ${(0,n.numberToString)(y)} re W n`,"BT",`1 0 0 1 0 ${(0,n.numberToString)(y+C)} Tm 0 Tc ${getPdfColor(o,!0)}`,`/${this.fontName.name} ${(0,n.numberToString)(v)} Tf`],{resources:O}=this;if(1!==(l="number"==typeof l&&l>=0&&l<=1?l:1)){F.push("/R0 gs");const e=new r.Dict(this.xref),t=new r.Dict(this.xref);t.set("ca",l);t.set("CA",l);t.set("Type",r.Name.get("ExtGState"));e.set("R0",t);O.set("ExtGState",e)}const T=(0,n.numberToString)(x);for(const e of u)F.push(`0 -${T} Td <${(0,n.stringToUTF16HexString)(e)}> Tj`);F.push("ET","Q");const M=F.join("\n"),E=new r.Dict(this.xref);E.set("Subtype",r.Name.get("Form"));E.set("Type",r.Name.get("XObject"));E.set("BBox",[0,0,b,y]);E.set("Length",M.length);E.set("Resources",O);if(a){const e=(0,n.getRotationMatrix)(a,b,y);E.set("Matrix",e)}const D=new c.StringStream(M);D.dict=E;return D}}t.FakeUnicodeFont=FakeUnicodeFont},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.ColorSpace=void 0;var r=a(2),n=a(4),i=a(5),s=a(3);class ColorSpace{constructor(e,t){this.constructor===ColorSpace&&(0,r.unreachable)("Cannot initialize ColorSpace.");this.name=e;this.numComps=t}getRgb(e,t){const a=new Uint8ClampedArray(3);this.getRgbItem(e,t,a,0);return a}getRgbItem(e,t,a,n){(0,r.unreachable)("Should not call ColorSpace.getRgbItem")}getRgbBuffer(e,t,a,n,i,s,o){(0,r.unreachable)("Should not call ColorSpace.getRgbBuffer")}getOutputLength(e,t){(0,r.unreachable)("Should not call ColorSpace.getOutputLength")}isPassthrough(e){return!1}isDefaultDecode(e,t){return ColorSpace.isDefaultDecode(e,this.numComps)}fillRgb(e,t,a,r,n,i,s,o,c){const l=t*a;let h=null;const u=1<<s,d=a!==n||t!==r;if(this.isPassthrough(s))h=o;else if(1===this.numComps&&l>u&&"DeviceGray"!==this.name&&"DeviceRGB"!==this.name){const t=s<=8?new Uint8Array(u):new Uint16Array(u);for(let e=0;e<u;e++)t[e]=e;const a=new Uint8ClampedArray(3*u);this.getRgbBuffer(t,0,u,a,0,s,0);if(d){h=new Uint8Array(3*l);let e=0;for(let t=0;t<l;++t){const r=3*o[t];h[e++]=a[r];h[e++]=a[r+1];h[e++]=a[r+2]}}else{let t=0;for(let r=0;r<l;++r){const n=3*o[r];e[t++]=a[n];e[t++]=a[n+1];e[t++]=a[n+2];t+=c}}}else if(d){h=new Uint8ClampedArray(3*l);this.getRgbBuffer(o,0,l,h,0,s,0)}else this.getRgbBuffer(o,0,r*i,e,0,s,c);if(h)if(d)!function resizeRgbImage(e,t,a,r,n,i,s){s=1!==s?0:s;const o=a/n,c=r/i;let l,h=0;const u=new Uint16Array(n),d=3*a;for(let e=0;e<n;e++)u[e]=3*Math.floor(e*o);for(let a=0;a<i;a++){const r=Math.floor(a*c)*d;for(let a=0;a<n;a++){l=r+u[a];t[h++]=e[l++];t[h++]=e[l++];t[h++]=e[l++];h+=s}}}(h,e,t,a,r,n,c);else{let t=0,a=0;for(let n=0,s=r*i;n<s;n++){e[t++]=h[a++];e[t++]=h[a++];e[t++]=h[a++];t+=c}}}get usesZeroToOneRange(){return(0,r.shadow)(this,"usesZeroToOneRange",!0)}static _cache(e,t,a,r){if(!a)throw new Error('ColorSpace._cache - expected "localColorSpaceCache" argument.');if(!r)throw new Error('ColorSpace._cache - expected "parsedColorSpace" argument.');let i,s;if(e instanceof n.Ref){s=e;e=t.fetch(e)}e instanceof n.Name&&(i=e.name);(i||s)&&a.set(i,s,r)}static getCached(e,t,a){if(!a)throw new Error('ColorSpace.getCached - expected "localColorSpaceCache" argument.');if(e instanceof n.Ref){const r=a.getByRef(e);if(r)return r;try{e=t.fetch(e)}catch(e){if(e instanceof s.MissingDataException)throw e}}if(e instanceof n.Name){const t=a.getByName(e.name);if(t)return t}return null}static async parseAsync({cs:e,xref:t,resources:a=null,pdfFunctionFactory:r,localColorSpaceCache:n}){const i=this._parse(e,t,a,r);this._cache(e,t,n,i);return i}static parse({cs:e,xref:t,resources:a=null,pdfFunctionFactory:r,localColorSpaceCache:n}){const i=this.getCached(e,t,n);if(i)return i;const s=this._parse(e,t,a,r);this._cache(e,t,n,s);return s}static _parse(e,t,a=null,i){if((e=t.fetchIfRef(e))instanceof n.Name)switch(e.name){case"G":case"DeviceGray":return this.singletons.gray;case"RGB":case"DeviceRGB":return this.singletons.rgb;case"CMYK":case"DeviceCMYK":return this.singletons.cmyk;case"Pattern":return new PatternCS(null);default:if(a instanceof n.Dict){const r=a.get("ColorSpace");if(r instanceof n.Dict){const s=r.get(e.name);if(s){if(s instanceof n.Name)return this._parse(s,t,a,i);e=s;break}}}throw new r.FormatError(`Unrecognized ColorSpace: ${e.name}`)}if(Array.isArray(e)){const n=t.fetchIfRef(e[0]).name;let s,o,u,d,f,g;switch(n){case"G":case"DeviceGray":return this.singletons.gray;case"RGB":case"DeviceRGB":return this.singletons.rgb;case"CMYK":case"DeviceCMYK":return this.singletons.cmyk;case"CalGray":s=t.fetchIfRef(e[1]);d=s.getArray("WhitePoint");f=s.getArray("BlackPoint");g=s.get("Gamma");return new c(d,f,g);case"CalRGB":s=t.fetchIfRef(e[1]);d=s.getArray("WhitePoint");f=s.getArray("BlackPoint");g=s.getArray("Gamma");const p=s.getArray("Matrix");return new l(d,f,g,p);case"ICCBased":const m=t.fetchIfRef(e[1]).dict;o=m.get("N");const b=m.get("Alternate");if(b){const e=this._parse(b,t,a,i);if(e.numComps===o)return e;(0,r.warn)("ICCBased color space: Ignoring incorrect /Alternate entry.")}if(1===o)return this.singletons.gray;if(3===o)return this.singletons.rgb;if(4===o)return this.singletons.cmyk;break;case"Pattern":u=e[1]||null;u&&(u=this._parse(u,t,a,i));return new PatternCS(u);case"I":case"Indexed":u=this._parse(e[1],t,a,i);const y=t.fetchIfRef(e[2])+1,w=t.fetchIfRef(e[3]);return new IndexedCS(u,y,w);case"Separation":case"DeviceN":const S=t.fetchIfRef(e[1]);o=Array.isArray(S)?S.length:1;u=this._parse(e[2],t,a,i);const x=i.create(e[3]);return new AlternateCS(o,u,x);case"Lab":s=t.fetchIfRef(e[1]);d=s.getArray("WhitePoint");f=s.getArray("BlackPoint");const C=s.getArray("Range");return new h(d,f,C);default:throw new r.FormatError(`Unimplemented ColorSpace object: ${n}`)}}throw new r.FormatError(`Unrecognized ColorSpace object: ${e}`)}static isDefaultDecode(e,t){if(!Array.isArray(e))return!0;if(2*t!==e.length){(0,r.warn)("The decode map is not the correct length");return!0}for(let t=0,a=e.length;t<a;t+=2)if(0!==e[t]||1!==e[t+1])return!1;return!0}static get singletons(){return(0,r.shadow)(this,"singletons",{get gray(){return(0,r.shadow)(this,"gray",new DeviceGrayCS)},get rgb(){return(0,r.shadow)(this,"rgb",new DeviceRgbCS)},get cmyk(){return(0,r.shadow)(this,"cmyk",new o)}})}}t.ColorSpace=ColorSpace;class AlternateCS extends ColorSpace{constructor(e,t,a){super("Alternate",e);this.base=t;this.tintFn=a;this.tmpBuf=new Float32Array(t.numComps)}getRgbItem(e,t,a,r){const n=this.tmpBuf;this.tintFn(e,t,n,0);this.base.getRgbItem(n,0,a,r)}getRgbBuffer(e,t,a,r,n,i,s){const o=this.tintFn,c=this.base,l=1/((1<<i)-1),h=c.numComps,u=c.usesZeroToOneRange,d=(c.isPassthrough(8)||!u)&&0===s;let f=d?n:0;const g=d?r:new Uint8ClampedArray(h*a),p=this.numComps,m=new Float32Array(p),b=new Float32Array(h);let y,w;for(y=0;y<a;y++){for(w=0;w<p;w++)m[w]=e[t++]*l;o(m,0,b,0);if(u)for(w=0;w<h;w++)g[f++]=255*b[w];else{c.getRgbItem(b,0,g,f);f+=h}}d||c.getRgbBuffer(g,0,a,r,n,8,s)}getOutputLength(e,t){return this.base.getOutputLength(e*this.base.numComps/this.numComps,t)}}class PatternCS extends ColorSpace{constructor(e){super("Pattern",null);this.base=e}isDefaultDecode(e,t){(0,r.unreachable)("Should not call PatternCS.isDefaultDecode")}}class IndexedCS extends ColorSpace{constructor(e,t,a){super("Indexed",1);this.base=e;this.highVal=t;const n=e.numComps*t;this.lookup=new Uint8Array(n);if(a instanceof i.BaseStream){const e=a.getBytes(n);this.lookup.set(e)}else{if("string"!=typeof a)throw new r.FormatError(`IndexedCS - unrecognized lookup table: ${a}`);for(let e=0;e<n;++e)this.lookup[e]=255&a.charCodeAt(e)}}getRgbItem(e,t,a,r){const n=this.base.numComps,i=e[t]*n;this.base.getRgbBuffer(this.lookup,i,1,a,r,8,0)}getRgbBuffer(e,t,a,r,n,i,s){const o=this.base,c=o.numComps,l=o.getOutputLength(c,s),h=this.lookup;for(let i=0;i<a;++i){const a=e[t++]*c;o.getRgbBuffer(h,a,1,r,n,8,s);n+=l}}getOutputLength(e,t){return this.base.getOutputLength(e*this.base.numComps,t)}isDefaultDecode(e,t){if(!Array.isArray(e))return!0;if(2!==e.length){(0,r.warn)("Decode map length is not correct");return!0}if(!Number.isInteger(t)||t<1){(0,r.warn)("Bits per component is not correct");return!0}return 0===e[0]&&e[1]===(1<<t)-1}}class DeviceGrayCS extends ColorSpace{constructor(){super("DeviceGray",1)}getRgbItem(e,t,a,r){const n=255*e[t];a[r]=a[r+1]=a[r+2]=n}getRgbBuffer(e,t,a,r,n,i,s){const o=255/((1<<i)-1);let c=t,l=n;for(let t=0;t<a;++t){const t=o*e[c++];r[l++]=t;r[l++]=t;r[l++]=t;l+=s}}getOutputLength(e,t){return e*(3+t)}}class DeviceRgbCS extends ColorSpace{constructor(){super("DeviceRGB",3)}getRgbItem(e,t,a,r){a[r]=255*e[t];a[r+1]=255*e[t+1];a[r+2]=255*e[t+2]}getRgbBuffer(e,t,a,r,n,i,s){if(8===i&&0===s){r.set(e.subarray(t,t+3*a),n);return}const o=255/((1<<i)-1);let c=t,l=n;for(let t=0;t<a;++t){r[l++]=o*e[c++];r[l++]=o*e[c++];r[l++]=o*e[c++];l+=s}}getOutputLength(e,t){return e*(3+t)/3|0}isPassthrough(e){return 8===e}}const o=function DeviceCmykCSClosure(){function convertToRgb(e,t,a,r,n){const i=e[t]*a,s=e[t+1]*a,o=e[t+2]*a,c=e[t+3]*a;r[n]=255+i*(-4.387332384609988*i+54.48615194189176*s+18.82290502165302*o+212.25662451639585*c-285.2331026137004)+s*(1.7149763477362134*s-5.6096736904047315*o+-17.873870861415444*c-5.497006427196366)+o*(-2.5217340131683033*o-21.248923337353073*c+17.5119270841813)+c*(-21.86122147463605*c-189.48180835922747);r[n+1]=255+i*(8.841041422036149*i+60.118027045597366*s+6.871425592049007*o+31.159100130055922*c-79.2970844816548)+s*(-15.310361306967817*s+17.575251261109482*o+131.35250912493976*c-190.9453302588951)+o*(4.444339102852739*o+9.8632861493405*c-24.86741582555878)+c*(-20.737325471181034*c-187.80453709719578);r[n+2]=255+i*(.8842522430003296*i+8.078677503112928*s+30.89978309703729*o-.23883238689178934*c-14.183576799673286)+s*(10.49593273432072*s+63.02378494754052*o+50.606957656360734*c-112.23884253719248)+o*(.03296041114873217*o+115.60384449646641*c-193.58209356861505)+c*(-22.33816807309886*c-180.12613974708367)}return class DeviceCmykCS extends ColorSpace{constructor(){super("DeviceCMYK",4)}getRgbItem(e,t,a,r){convertToRgb(e,t,1,a,r)}getRgbBuffer(e,t,a,r,n,i,s){const o=1/((1<<i)-1);for(let i=0;i<a;i++){convertToRgb(e,t,o,r,n);t+=4;n+=3+s}}getOutputLength(e,t){return e/4*(3+t)|0}}}(),c=function CalGrayCSClosure(){function convertToRgb(e,t,a,r,n,i){const s=(t[a]*i)**e.G,o=e.YW*s,c=Math.max(295.8*o**.3333333333333333-40.8,0);r[n]=c;r[n+1]=c;r[n+2]=c}return class CalGrayCS extends ColorSpace{constructor(e,t,a){super("CalGray",1);if(!e)throw new r.FormatError("WhitePoint missing - required for color space CalGray");t=t||[0,0,0];a=a||1;this.XW=e[0];this.YW=e[1];this.ZW=e[2];this.XB=t[0];this.YB=t[1];this.ZB=t[2];this.G=a;if(this.XW<0||this.ZW<0||1!==this.YW)throw new r.FormatError(`Invalid WhitePoint components for ${this.name}, no fallback available`);if(this.XB<0||this.YB<0||this.ZB<0){(0,r.info)(`Invalid BlackPoint for ${this.name}, falling back to default.`);this.XB=this.YB=this.ZB=0}0===this.XB&&0===this.YB&&0===this.ZB||(0,r.warn)(`${this.name}, BlackPoint: XB: ${this.XB}, YB: ${this.YB}, ZB: ${this.ZB}, only default values are supported.`);if(this.G<1){(0,r.info)(`Invalid Gamma: ${this.G} for ${this.name}, falling back to default.`);this.G=1}}getRgbItem(e,t,a,r){convertToRgb(this,e,t,a,r,1)}getRgbBuffer(e,t,a,r,n,i,s){const o=1/((1<<i)-1);for(let i=0;i<a;++i){convertToRgb(this,e,t,r,n,o);t+=1;n+=3+s}}getOutputLength(e,t){return e*(3+t)}}}(),l=function CalRGBCSClosure(){const e=new Float32Array([.8951,.2664,-.1614,-.7502,1.7135,.0367,.0389,-.0685,1.0296]),t=new Float32Array([.9869929,-.1470543,.1599627,.4323053,.5183603,.0492912,-.0085287,.0400428,.9684867]),a=new Float32Array([3.2404542,-1.5371385,-.4985314,-.969266,1.8760108,.041556,.0556434,-.2040259,1.0572252]),n=new Float32Array([1,1,1]),i=new Float32Array(3),s=new Float32Array(3),o=new Float32Array(3),c=(24/116)**3/8;function matrixProduct(e,t,a){a[0]=e[0]*t[0]+e[1]*t[1]+e[2]*t[2];a[1]=e[3]*t[0]+e[4]*t[1]+e[5]*t[2];a[2]=e[6]*t[0]+e[7]*t[1]+e[8]*t[2]}function sRGBTransferFunction(e){return e<=.0031308?adjustToRange(0,1,12.92*e):e>=.99554525?1:adjustToRange(0,1,1.055*e**(1/2.4)-.055)}function adjustToRange(e,t,a){return Math.max(e,Math.min(t,a))}function decodeL(e){return e<0?-decodeL(-e):e>8?((e+16)/116)**3:e*c}function convertToRgb(r,c,l,h,u,d){const f=adjustToRange(0,1,c[l]*d),g=adjustToRange(0,1,c[l+1]*d),p=adjustToRange(0,1,c[l+2]*d),m=1===f?1:f**r.GR,b=1===g?1:g**r.GG,y=1===p?1:p**r.GB,w=r.MXA*m+r.MXB*b+r.MXC*y,S=r.MYA*m+r.MYB*b+r.MYC*y,x=r.MZA*m+r.MZB*b+r.MZC*y,C=s;C[0]=w;C[1]=S;C[2]=x;const k=o;!function normalizeWhitePointToFlat(a,r,n){if(1===a[0]&&1===a[2]){n[0]=r[0];n[1]=r[1];n[2]=r[2];return}const s=n;matrixProduct(e,r,s);const o=i;!function convertToFlat(e,t,a){a[0]=1*t[0]/e[0];a[1]=1*t[1]/e[1];a[2]=1*t[2]/e[2]}(a,s,o);matrixProduct(t,o,n)}(r.whitePoint,C,k);const v=s;!function compensateBlackPoint(e,t,a){if(0===e[0]&&0===e[1]&&0===e[2]){a[0]=t[0];a[1]=t[1];a[2]=t[2];return}const r=decodeL(0),n=(1-r)/(1-decodeL(e[0])),i=1-n,s=(1-r)/(1-decodeL(e[1])),o=1-s,c=(1-r)/(1-decodeL(e[2])),l=1-c;a[0]=t[0]*n+i;a[1]=t[1]*s+o;a[2]=t[2]*c+l}(r.blackPoint,k,v);const F=o;!function normalizeWhitePointToD65(a,r,n){const s=n;matrixProduct(e,r,s);const o=i;!function convertToD65(e,t,a){a[0]=.95047*t[0]/e[0];a[1]=1*t[1]/e[1];a[2]=1.08883*t[2]/e[2]}(a,s,o);matrixProduct(t,o,n)}(n,v,F);const O=s;matrixProduct(a,F,O);h[u]=255*sRGBTransferFunction(O[0]);h[u+1]=255*sRGBTransferFunction(O[1]);h[u+2]=255*sRGBTransferFunction(O[2])}return class CalRGBCS extends ColorSpace{constructor(e,t,a,n){super("CalRGB",3);if(!e)throw new r.FormatError("WhitePoint missing - required for color space CalRGB");t=t||new Float32Array(3);a=a||new Float32Array([1,1,1]);n=n||new Float32Array([1,0,0,0,1,0,0,0,1]);const i=e[0],s=e[1],o=e[2];this.whitePoint=e;const c=t[0],l=t[1],h=t[2];this.blackPoint=t;this.GR=a[0];this.GG=a[1];this.GB=a[2];this.MXA=n[0];this.MYA=n[1];this.MZA=n[2];this.MXB=n[3];this.MYB=n[4];this.MZB=n[5];this.MXC=n[6];this.MYC=n[7];this.MZC=n[8];if(i<0||o<0||1!==s)throw new r.FormatError(`Invalid WhitePoint components for ${this.name}, no fallback available`);if(c<0||l<0||h<0){(0,r.info)(`Invalid BlackPoint for ${this.name} [${c}, ${l}, ${h}], falling back to default.`);this.blackPoint=new Float32Array(3)}if(this.GR<0||this.GG<0||this.GB<0){(0,r.info)(`Invalid Gamma [${this.GR}, ${this.GG}, ${this.GB}] for ${this.name}, falling back to default.`);this.GR=this.GG=this.GB=1}}getRgbItem(e,t,a,r){convertToRgb(this,e,t,a,r,1)}getRgbBuffer(e,t,a,r,n,i,s){const o=1/((1<<i)-1);for(let i=0;i<a;++i){convertToRgb(this,e,t,r,n,o);t+=3;n+=3+s}}getOutputLength(e,t){return e*(3+t)/3|0}}}(),h=function LabCSClosure(){function fn_g(e){let t;t=e>=6/29?e**3:108/841*(e-4/29);return t}function decode(e,t,a,r){return a+e*(r-a)/t}function convertToRgb(e,t,a,r,n,i){let s=t[a],o=t[a+1],c=t[a+2];if(!1!==r){s=decode(s,r,0,100);o=decode(o,r,e.amin,e.amax);c=decode(c,r,e.bmin,e.bmax)}o>e.amax?o=e.amax:o<e.amin&&(o=e.amin);c>e.bmax?c=e.bmax:c<e.bmin&&(c=e.bmin);const l=(s+16)/116,h=l+o/500,u=l-c/200,d=e.XW*fn_g(h),f=e.YW*fn_g(l),g=e.ZW*fn_g(u);let p,m,b;if(e.ZW<1){p=3.1339*d+-1.617*f+-.4906*g;m=-.9785*d+1.916*f+.0333*g;b=.072*d+-.229*f+1.4057*g}else{p=3.2406*d+-1.5372*f+-.4986*g;m=-.9689*d+1.8758*f+.0415*g;b=.0557*d+-.204*f+1.057*g}n[i]=255*Math.sqrt(p);n[i+1]=255*Math.sqrt(m);n[i+2]=255*Math.sqrt(b)}return class LabCS extends ColorSpace{constructor(e,t,a){super("Lab",3);if(!e)throw new r.FormatError("WhitePoint missing - required for color space Lab");t=t||[0,0,0];a=a||[-100,100,-100,100];this.XW=e[0];this.YW=e[1];this.ZW=e[2];this.amin=a[0];this.amax=a[1];this.bmin=a[2];this.bmax=a[3];this.XB=t[0];this.YB=t[1];this.ZB=t[2];if(this.XW<0||this.ZW<0||1!==this.YW)throw new r.FormatError("Invalid WhitePoint components, no fallback available");if(this.XB<0||this.YB<0||this.ZB<0){(0,r.info)("Invalid BlackPoint, falling back to default");this.XB=this.YB=this.ZB=0}if(this.amin>this.amax||this.bmin>this.bmax){(0,r.info)("Invalid Range, falling back to defaults");this.amin=-100;this.amax=100;this.bmin=-100;this.bmax=100}}getRgbItem(e,t,a,r){convertToRgb(this,e,t,!1,a,r)}getRgbBuffer(e,t,a,r,n,i,s){const o=(1<<i)-1;for(let i=0;i<a;i++){convertToRgb(this,e,t,o,r,n);t+=3;n+=3+s}}getOutputLength(e,t){return e*(3+t)/3|0}isDefaultDecode(e,t){return!0}get usesZeroToOneRange(){return(0,r.shadow)(this,"usesZeroToOneRange",!1)}}}()},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.PartialEvaluator=t.EvaluatorPreprocessor=void 0;var r=a(2),n=a(14),i=a(4),s=a(32),o=a(35),c=a(39),l=a(48),h=a(49),u=a(40),d=a(55),f=a(15),g=a(57),p=a(8),m=a(5),b=a(58),y=a(12),w=a(17),S=a(36),x=a(37),C=a(3),k=a(43),v=a(38),F=a(59),O=a(60),T=a(61);const M=Object.freeze({maxImageSize:-1,disableFontFace:!1,ignoreErrors:!1,isEvalSupported:!0,isOffscreenCanvasSupported:!0,fontExtraProperties:!1,useSystemFonts:!0,cMapUrl:null,standardFontDataUrl:null}),E=1,D=2,N=10,R=Promise.resolve();function normalizeBlendMode(e,t=!1){if(Array.isArray(e)){for(const t of e){const e=normalizeBlendMode(t,!0);if(e)return e}(0,r.warn)(`Unsupported blend mode Array: ${e}`);return"source-over"}if(!(e instanceof i.Name))return t?null:"source-over";switch(e.name){case"Normal":case"Compatible":return"source-over";case"Multiply":return"multiply";case"Screen":return"screen";case"Overlay":return"overlay";case"Darken":return"darken";case"Lighten":return"lighten";case"ColorDodge":return"color-dodge";case"ColorBurn":return"color-burn";case"HardLight":return"hard-light";case"SoftLight":return"soft-light";case"Difference":return"difference";case"Exclusion":return"exclusion";case"Hue":return"hue";case"Saturation":return"saturation";case"Color":return"color";case"Luminosity":return"luminosity"}if(t)return null;(0,r.warn)(`Unsupported blend mode: ${e.name}`);return"source-over"}function incrementCachedImageMaskCount(e){e.fn===r.OPS.paintImageMaskXObject&&e.args[0]&&e.args[0].count>0&&e.args[0].count++}class TimeSlotManager{static get TIME_SLOT_DURATION_MS(){return(0,r.shadow)(this,"TIME_SLOT_DURATION_MS",20)}static get CHECK_TIME_EVERY(){return(0,r.shadow)(this,"CHECK_TIME_EVERY",100)}constructor(){this.reset()}check(){if(++this.checked<TimeSlotManager.CHECK_TIME_EVERY)return!1;this.checked=0;return this.endTime<=Date.now()}reset(){this.endTime=Date.now()+TimeSlotManager.TIME_SLOT_DURATION_MS;this.checked=0}}class PartialEvaluator{constructor({xref:e,handler:t,pageIndex:a,idFactory:r,fontCache:n,builtInCMapCache:i,standardFontDataCache:s,globalImageCache:o,options:c=null}){this.xref=e;this.handler=t;this.pageIndex=a;this.idFactory=r;this.fontCache=n;this.builtInCMapCache=i;this.standardFontDataCache=s;this.globalImageCache=o;this.options=c||M;this.parsingType3Font=!1;this._fetchBuiltInCMapBound=this.fetchBuiltInCMap.bind(this)}get _pdfFunctionFactory(){const e=new d.PDFFunctionFactory({xref:this.xref,isEvalSupported:this.options.isEvalSupported});return(0,r.shadow)(this,"_pdfFunctionFactory",e)}clone(e=null){const t=Object.create(this);t.options=Object.assign(Object.create(null),this.options,e);return t}hasBlendModes(e,t){if(!(e instanceof i.Dict))return!1;if(e.objId&&t.has(e.objId))return!1;const a=new i.RefSet(t);e.objId&&a.put(e.objId);const n=[e],s=this.xref;for(;n.length;){const e=n.shift(),t=e.get("ExtGState");if(t instanceof i.Dict)for(let e of t.getRawValues()){if(e instanceof i.Ref){if(a.has(e))continue;try{e=s.fetch(e)}catch(t){a.put(e);(0,r.info)(`hasBlendModes - ignoring ExtGState: "${t}".`);continue}}if(!(e instanceof i.Dict))continue;e.objId&&a.put(e.objId);const t=e.get("BM");if(t instanceof i.Name){if("Normal"!==t.name)return!0}else if(void 0!==t&&Array.isArray(t))for(const e of t)if(e instanceof i.Name&&"Normal"!==e.name)return!0}const o=e.get("XObject");if(o instanceof i.Dict)for(let e of o.getRawValues()){if(e instanceof i.Ref){if(a.has(e))continue;try{e=s.fetch(e)}catch(t){a.put(e);(0,r.info)(`hasBlendModes - ignoring XObject: "${t}".`);continue}}if(!(e instanceof m.BaseStream))continue;e.dict.objId&&a.put(e.dict.objId);const t=e.dict.get("Resources");if(t instanceof i.Dict&&(!t.objId||!a.has(t.objId))){n.push(t);t.objId&&a.put(t.objId)}}}for(const e of a)t.put(e);return!1}async fetchBuiltInCMap(e){const t=this.builtInCMapCache.get(e);if(t)return t;let a;if(null!==this.options.cMapUrl){const t=`${this.options.cMapUrl}${e}.bcmap`,n=await fetch(t);if(!n.ok)throw new Error(`fetchBuiltInCMap: failed to fetch file "${t}" with "${n.statusText}".`);a={cMapData:new Uint8Array(await n.arrayBuffer()),compressionType:r.CMapCompressionType.BINARY}}else a=await this.handler.sendWithPromise("FetchBuiltInCMap",{name:e});a.compressionType!==r.CMapCompressionType.NONE&&this.builtInCMapCache.set(e,a);return a}async fetchStandardFontData(e){const t=this.standardFontDataCache.get(e);if(t)return new p.Stream(t);if(this.options.useSystemFonts&&"Symbol"!==e&&"ZapfDingbats"!==e)return null;const a=(0,c.getFontNameToFileMap)()[e];let n;if(null!==this.options.standardFontDataUrl){const e=`${this.options.standardFontDataUrl}${a}`,t=await fetch(e);t.ok?n=await t.arrayBuffer():(0,r.warn)(`fetchStandardFontData: failed to fetch file "${e}" with "${t.statusText}".`)}else try{n=await this.handler.sendWithPromise("FetchStandardFontData",{filename:a})}catch(e){(0,r.warn)(`fetchStandardFontData: failed to fetch file "${a}" with "${e}".`)}if(!n)return null;this.standardFontDataCache.set(e,n);return new p.Stream(n)}async buildFormXObject(e,t,a,n,s,o,c){const l=t.dict,h=l.getArray("Matrix");let u,d,f=l.getArray("BBox");f=Array.isArray(f)&&4===f.length?r.Util.normalizeRect(f):null;l.has("OC")&&(u=await this.parseMarkedContentProps(l.get("OC"),e));void 0!==u&&n.addOp(r.OPS.beginMarkedContentProps,["OC",u]);const g=l.get("Group");if(g){d={matrix:h,bbox:f,smask:a,isolated:!1,knockout:!1};const t=g.get("S");let s=null;if((0,i.isName)(t,"Transparency")){d.isolated=g.get("I")||!1;d.knockout=g.get("K")||!1;if(g.has("CS")){const t=g.getRaw("CS"),a=y.ColorSpace.getCached(t,this.xref,c);s=a||await this.parseColorSpace({cs:t,resources:e,localColorSpaceCache:c})}}if(a&&a.backdrop){s=s||y.ColorSpace.singletons.rgb;a.backdrop=s.getRgb(a.backdrop,0)}n.addOp(r.OPS.beginGroup,[d])}const p=g?[h,null]:[h,f];n.addOp(r.OPS.paintFormXObjectBegin,p);return this.getOperatorList({stream:t,task:s,resources:l.get("Resources")||e,operatorList:n,initialState:o}).then((function(){n.addOp(r.OPS.paintFormXObjectEnd,[]);g&&n.addOp(r.OPS.endGroup,[d]);void 0!==u&&n.addOp(r.OPS.endMarkedContent,[])}))}_sendImgData(e,t,a=!1){const r=t?[t.bitmap||t.data.buffer]:null;return this.parsingType3Font||a?this.handler.send("commonobj",[e,"Image",t],r):this.handler.send("obj",[e,this.pageIndex,"Image",t],r)}async buildPaintImageXObject({resources:e,image:t,isInline:a=!1,operatorList:n,cacheKey:i,localImageCache:s,localColorSpaceCache:o}){const c=t.dict,l=c.objId,h=c.get("W","Width"),u=c.get("H","Height");if(!h||"number"!=typeof h||!u||"number"!=typeof u){(0,r.warn)("Image dimensions are missing, or not numbers.");return}const d=this.options.maxImageSize;if(-1!==d&&h*u>d){const e="Image exceeded maximum allowed size and was removed.";if(this.options.ignoreErrors){(0,r.warn)(e);return}throw new Error(e)}let f;c.has("OC")&&(f=await this.parseMarkedContentProps(c.get("OC"),e));let g,p;if(c.get("IM","ImageMask")||!1){const e=c.get("I","Interpolate"),a=h+7>>3,o=t.getBytes(a*u),d=c.getArray("D","Decode");if(this.parsingType3Font){g=T.PDFImage.createRawMask({imgArray:o,width:h,height:u,imageIsFromDecodeStream:t instanceof w.DecodeStream,inverseDecode:!!d&&d[0]>0,interpolate:e});g.cached=!!i;p=[g];n.addImageOps(r.OPS.paintImageMaskXObject,p,f);i&&s.set(i,l,{fn:r.OPS.paintImageMaskXObject,args:p,optionalContent:f});return}g=T.PDFImage.createMask({imgArray:o,width:h,height:u,imageIsFromDecodeStream:t instanceof w.DecodeStream,inverseDecode:!!d&&d[0]>0,interpolate:e,isOffscreenCanvasSupported:this.options.isOffscreenCanvasSupported});if(g.isSingleOpaquePixel){n.addImageOps(r.OPS.paintSolidColorImageMask,[],f);i&&s.set(i,l,{fn:r.OPS.paintSolidColorImageMask,args:[],optionalContent:f});return}const m=`mask_${this.idFactory.createObjId()}`;n.addDependency(m);this._sendImgData(m,g);p=[{data:m,width:g.width,height:g.height,interpolate:g.interpolate,count:1}];n.addImageOps(r.OPS.paintImageMaskXObject,p,f);i&&s.set(i,l,{fn:r.OPS.paintImageMaskXObject,args:p,optionalContent:f});return}const m=c.get("SM","SMask")||!1,b=c.get("Mask")||!1;if(a&&!m&&!b&&h+u<200){const i=new T.PDFImage({xref:this.xref,res:e,image:t,isInline:a,pdfFunctionFactory:this._pdfFunctionFactory,localColorSpaceCache:o});g=i.createImageData(!0);n.addImageOps(r.OPS.paintInlineImageXObject,[g],f);return}let y=`img_${this.idFactory.createObjId()}`,S=!1;if(this.parsingType3Font)y=`${this.idFactory.getDocId()}_type3_${y}`;else if(l){S=this.globalImageCache.shouldCache(l,this.pageIndex);S&&(y=`${this.idFactory.getDocId()}_${y}`)}n.addDependency(y);p=[y,h,u];T.PDFImage.buildImage({xref:this.xref,res:e,image:t,isInline:a,pdfFunctionFactory:this._pdfFunctionFactory,localColorSpaceCache:o}).then((e=>{g=e.createImageData(!1);i&&l&&S&&this.globalImageCache.addByteSize(l,g.data.length);return this._sendImgData(y,g,S)})).catch((e=>{(0,r.warn)(`Unable to decode image "${y}": "${e}".`);return this._sendImgData(y,null,S)}));n.addImageOps(r.OPS.paintImageXObject,p,f);if(i){s.set(i,l,{fn:r.OPS.paintImageXObject,args:p,optionalContent:f});if(l){(0,r.assert)(!a,"Cannot cache an inline image globally.");this.globalImageCache.addPageIndex(l,this.pageIndex);S&&this.globalImageCache.setData(l,{objId:y,fn:r.OPS.paintImageXObject,args:p,optionalContent:f,byteSize:0})}}}handleSMask(e,t,a,r,n,i){const s=e.get("G"),o={subtype:e.get("S").name,backdrop:e.get("BC")},c=e.get("TR");if((0,d.isPDFFunction)(c)){const e=this._pdfFunctionFactory.create(c),t=new Uint8Array(256),a=new Float32Array(1);for(let r=0;r<256;r++){a[0]=r/255;e(a,0,a,0);t[r]=255*a[0]|0}o.transferMap=t}return this.buildFormXObject(t,s,o,a,r,n.state.clone(),i)}handleTransferFunction(e){let t;if(Array.isArray(e))t=e;else{if(!(0,d.isPDFFunction)(e))return null;t=[e]}const a=[];let r=0,n=0;for(const e of t){const t=this.xref.fetchIfRef(e);r++;if((0,i.isName)(t,"Identity")){a.push(null);continue}if(!(0,d.isPDFFunction)(t))return null;const s=this._pdfFunctionFactory.create(t),o=new Uint8Array(256),c=new Float32Array(1);for(let e=0;e<256;e++){c[0]=e/255;s(c,0,c,0);o[e]=255*c[0]|0}a.push(o);n++}return 1!==r&&4!==r||0===n?null:a}handleTilingType(e,t,a,n,s,o,c,h){const u=new O.OperatorList,d=i.Dict.merge({xref:this.xref,dictArray:[s.get("Resources"),a]});return this.getOperatorList({stream:n,task:c,resources:d,operatorList:u}).then((function(){const a=u.getIR(),r=(0,l.getTilingPatternIR)(a,s,t);o.addDependencies(u.dependencies);o.addOp(e,r);s.objId&&h.set(null,s.objId,{operatorListIR:a,dict:s})})).catch((e=>{if(!(e instanceof r.AbortException)){if(!this.options.ignoreErrors)throw e;this.handler.send("UnsupportedFeature",{featureId:r.UNSUPPORTED_FEATURES.errorTilingPattern});(0,r.warn)(`handleTilingType - ignoring pattern: "${e}".`)}}))}handleSetFont(e,t,a,n,o,c,l=null,h=null){const u=t&&t[0]instanceof i.Name?t[0].name:null;return this.loadFont(u,a,e,l,h).then((t=>t.font.isType3Font?t.loadType3Data(this,e,o).then((function(){n.addDependencies(t.type3Dependencies);return t})).catch((e=>{this.handler.send("UnsupportedFeature",{featureId:r.UNSUPPORTED_FEATURES.errorFontLoadType3});return new TranslatedFont({loadedName:"g_font_error",font:new s.ErrorFont(`Type3 font load error: ${e}`),dict:t.font,evaluatorOptions:this.options})})):t)).then((e=>{c.font=e.font;e.send(this.handler);return e.loadedName}))}handleText(e,t){const a=t.font,n=a.charsToGlyphs(e);if(a.data){(!!(t.textRenderingMode&r.TextRenderingMode.ADD_TO_PATH_FLAG)||"Pattern"===t.fillColorSpace.name||a.disableFontFace||this.options.disableFontFace)&&PartialEvaluator.buildFontPaths(a,n,this.handler,this.options)}return n}ensureStateFont(e){if(e.font)return;const t=new r.FormatError("Missing setFont (Tf) operator before text rendering operator.");if(!this.options.ignoreErrors)throw t;this.handler.send("UnsupportedFeature",{featureId:r.UNSUPPORTED_FEATURES.errorFontState});(0,r.warn)(`ensureStateFont: "${t}".`)}async setGState({resources:e,gState:t,operatorList:a,cacheKey:n,task:s,stateManager:o,localGStateCache:c,localColorSpaceCache:l}){const h=t.objId;let u=!0;const d=[];let f=Promise.resolve();for(const n of t.getKeys()){const c=t.get(n);switch(n){case"Type":break;case"LW":case"LC":case"LJ":case"ML":case"D":case"RI":case"FL":case"CA":case"ca":d.push([n,c]);break;case"Font":u=!1;f=f.then((()=>this.handleSetFont(e,null,c[0],a,s,o.state).then((function(e){a.addDependency(e);d.push([n,[e,c[1]]])}))));break;case"BM":d.push([n,normalizeBlendMode(c)]);break;case"SMask":if((0,i.isName)(c,"None")){d.push([n,!1]);break}if(c instanceof i.Dict){u=!1;f=f.then((()=>this.handleSMask(c,e,a,s,o,l)));d.push([n,!0])}else(0,r.warn)("Unsupported SMask type");break;case"TR":const t=this.handleTransferFunction(c);d.push([n,t]);break;case"OP":case"op":case"OPM":case"BG":case"BG2":case"UCR":case"UCR2":case"TR2":case"HT":case"SM":case"SA":case"AIS":case"TK":(0,r.info)("graphic state operator "+n);break;default:(0,r.info)("Unknown graphic state operator "+n)}}return f.then((function(){d.length>0&&a.addOp(r.OPS.setGState,[d]);u&&c.set(n,h,d)}))}loadFont(e,t,a,n=null,o=null){const errorFont=async()=>new TranslatedFont({loadedName:"g_font_error",font:new s.ErrorFont(`Font "${e}" is not available.`),dict:t,evaluatorOptions:this.options}),c=this.xref;let l;if(t)t instanceof i.Ref&&(l=t);else{const t=a.get("Font");t&&(l=t.getRaw(e))}if(!l){const a=`Font "${e||t&&t.toString()}" is not available`;if(!this.options.ignoreErrors&&!this.parsingType3Font){(0,r.warn)(`${a}.`);return errorFont()}this.handler.send("UnsupportedFeature",{featureId:r.UNSUPPORTED_FEATURES.errorFontMissing});(0,r.warn)(`${a} -- attempting to fallback to a default font.`);l=n||PartialEvaluator.fallbackFontDict}if(this.parsingType3Font&&this.type3FontRefs.has(l))return errorFont();if(this.fontCache.has(l))return this.fontCache.get(l);if(!((t=c.fetchIfRef(l))instanceof i.Dict))return errorFont();if(t.cacheKey&&this.fontCache.has(t.cacheKey))return this.fontCache.get(t.cacheKey);const h=(0,r.createPromiseCapability)();let u;try{u=this.preEvaluateFont(t);u.cssFontInfo=o}catch(e){(0,r.warn)(`loadFont - preEvaluateFont failed: "${e}".`);return errorFont()}const{descriptor:d,hash:f}=u,g=l instanceof i.Ref;let p;g&&(p=`f${l.toString()}`);if(f&&d instanceof i.Dict){d.fontAliases||(d.fontAliases=Object.create(null));const e=d.fontAliases;if(e[f]){const t=e[f].aliasRef;if(g&&t&&this.fontCache.has(t)){this.fontCache.putAlias(l,t);return this.fontCache.get(l)}}else e[f]={fontID:this.idFactory.createFontId()};g&&(e[f].aliasRef=l);p=e[f].fontID}if(g)this.fontCache.put(l,h.promise);else{p||(p=this.idFactory.createFontId());t.cacheKey=`cacheKey_${p}`;this.fontCache.put(t.cacheKey,h.promise)}(0,r.assert)(p&&p.startsWith("f"),'The "fontID" must be (correctly) defined.');t.loadedName=`${this.idFactory.getDocId()}_${p}`;this.translateFont(u).then((e=>{h.resolve(new TranslatedFont({loadedName:t.loadedName,font:e,dict:t,evaluatorOptions:this.options}))})).catch((e=>{this.handler.send("UnsupportedFeature",{featureId:r.UNSUPPORTED_FEATURES.errorFontTranslate});(0,r.warn)(`loadFont - translateFont failed: "${e}".`);h.resolve(new TranslatedFont({loadedName:t.loadedName,font:new s.ErrorFont(e instanceof Error?e.message:e),dict:t,evaluatorOptions:this.options}))}));return h.promise}buildPath(e,t,a,n=!1){const i=e.length-1;a||(a=[]);if(i<0||e.fnArray[i]!==r.OPS.constructPath){if(n){(0,r.warn)(`Encountered path operator "${t}" inside of a text object.`);e.addOp(r.OPS.save,null)}let i;switch(t){case r.OPS.rectangle:const e=a[0]+a[2],t=a[1]+a[3];i=[Math.min(a[0],e),Math.max(a[0],e),Math.min(a[1],t),Math.max(a[1],t)];break;case r.OPS.moveTo:case r.OPS.lineTo:i=[a[0],a[0],a[1],a[1]];break;default:i=[1/0,-1/0,1/0,-1/0]}e.addOp(r.OPS.constructPath,[[t],a,i]);n&&e.addOp(r.OPS.restore,null)}else{const n=e.argsArray[i];n[0].push(t);n[1].push(...a);const s=n[2];switch(t){case r.OPS.rectangle:const e=a[0]+a[2],t=a[1]+a[3];s[0]=Math.min(s[0],a[0],e);s[1]=Math.max(s[1],a[0],e);s[2]=Math.min(s[2],a[1],t);s[3]=Math.max(s[3],a[1],t);break;case r.OPS.moveTo:case r.OPS.lineTo:s[0]=Math.min(s[0],a[0]);s[1]=Math.max(s[1],a[0]);s[2]=Math.min(s[2],a[1]);s[3]=Math.max(s[3],a[1])}}}parseColorSpace({cs:e,resources:t,localColorSpaceCache:a}){return y.ColorSpace.parseAsync({cs:e,xref:this.xref,resources:t,pdfFunctionFactory:this._pdfFunctionFactory,localColorSpaceCache:a}).catch((e=>{if(e instanceof r.AbortException)return null;if(this.options.ignoreErrors){this.handler.send("UnsupportedFeature",{featureId:r.UNSUPPORTED_FEATURES.errorColorSpace});(0,r.warn)(`parseColorSpace - ignoring ColorSpace: "${e}".`);return null}throw e}))}parseShading({shading:e,resources:t,localColorSpaceCache:a,localShadingPatternCache:r}){let n=r.get(e);if(!n){const i=l.Pattern.parseShading(e,this.xref,t,this.handler,this._pdfFunctionFactory,a).getIR();n=`pattern_${this.idFactory.createObjId()}`;r.set(e,n);this.handler.send("obj",[n,this.pageIndex,"Pattern",i])}return n}handleColorN(e,t,a,n,s,o,c,h,u,d){const f=a.pop();if(f instanceof i.Name){const g=s.getRaw(f.name),p=g instanceof i.Ref&&u.getByRef(g);if(p)try{const r=n.base?n.base.getRgb(a,0):null,i=(0,l.getTilingPatternIR)(p.operatorListIR,p.dict,r);e.addOp(t,i);return}catch(e){}const b=this.xref.fetchIfRef(g);if(b){const i=b instanceof m.BaseStream?b.dict:b,s=i.get("PatternType");if(s===E){const r=n.base?n.base.getRgb(a,0):null;return this.handleTilingType(t,r,o,b,i,e,c,u)}if(s===D){const a=i.get("Shading"),r=i.getArray("Matrix"),n=this.parseShading({shading:a,resources:o,localColorSpaceCache:h,localShadingPatternCache:d});e.addOp(t,["Shading",n,r]);return}throw new r.FormatError(`Unknown PatternType: ${s}`)}}throw new r.FormatError(`Unknown PatternName: ${f}`)}_parseVisibilityExpression(e,t,a){if(++t>10){(0,r.warn)("Visibility expression is too deeply nested");return}const n=e.length,s=this.xref.fetchIfRef(e[0]);if(!(n<2)&&s instanceof i.Name){switch(s.name){case"And":case"Or":case"Not":a.push(s.name);break;default:(0,r.warn)(`Invalid operator ${s.name} in visibility expression`);return}for(let r=1;r<n;r++){const n=e[r],s=this.xref.fetchIfRef(n);if(Array.isArray(s)){const e=[];a.push(e);this._parseVisibilityExpression(s,t,e)}else n instanceof i.Ref&&a.push(n.toString())}}else(0,r.warn)("Invalid visibility expression")}async parseMarkedContentProps(e,t){let a;if(e instanceof i.Name){a=t.get("Properties").get(e.name)}else{if(!(e instanceof i.Dict))throw new r.FormatError("Optional content properties malformed.");a=e}const n=a.get("Type").name;if("OCG"===n)return{type:n,id:a.objId};if("OCMD"===n){const e=a.get("VE");if(Array.isArray(e)){const t=[];this._parseVisibilityExpression(e,0,t);if(t.length>0)return{type:"OCMD",expression:t}}const t=a.get("OCGs");if(Array.isArray(t)||t instanceof i.Dict){const e=[];if(Array.isArray(t))for(const a of t)e.push(a.toString());else e.push(t.objId);return{type:n,ids:e,policy:a.get("P")instanceof i.Name?a.get("P").name:null,expression:null}}if(t instanceof i.Ref)return{type:n,id:t.toString()}}return null}getOperatorList({stream:e,task:t,resources:a,operatorList:n,initialState:s=null,fallbackFontDict:o=null}){a=a||i.Dict.empty;s=s||new EvalState;if(!n)throw new Error('getOperatorList: missing "operatorList" parameter');const c=this,l=this.xref;let h=!1;const u=new g.LocalImageCache,d=new g.LocalColorSpaceCache,f=new g.LocalGStateCache,p=new g.LocalTilingPatternCache,b=new Map,w=a.get("XObject")||i.Dict.empty,S=a.get("Pattern")||i.Dict.empty,x=new StateManager(s),C=new EvaluatorPreprocessor(e,l,x),k=new TimeSlotManager;function closePendingRestoreOPS(e){for(let e=0,t=C.savedStatesDepth;e<t;e++)n.addOp(r.OPS.restore,[])}return new Promise((function promiseBody(e,s){const next=function(t){Promise.all([t,n.ready]).then((function(){try{promiseBody(e,s)}catch(e){s(e)}}),s)};t.ensureNotTerminated();k.reset();const g={};let v,F,O,T,M,E;for(;!(v=k.check());){g.args=null;if(!C.read(g))break;let e=g.args,s=g.fn;switch(0|s){case r.OPS.paintXObject:E=e[0]instanceof i.Name;M=e[0].name;if(E){const t=u.getByName(M);if(t){n.addImageOps(t.fn,t.args,t.optionalContent);incrementCachedImageMaskCount(t);e=null;continue}}next(new Promise((function(e,s){if(!E)throw new r.FormatError("XObject must be referred to by name.");let o=w.getRaw(M);if(o instanceof i.Ref){const t=u.getByRef(o);if(t){n.addImageOps(t.fn,t.args,t.optionalContent);incrementCachedImageMaskCount(t);e();return}const a=c.globalImageCache.getData(o,c.pageIndex);if(a){n.addDependency(a.objId);n.addImageOps(a.fn,a.args,a.optionalContent);e();return}o=l.fetch(o)}if(!(o instanceof m.BaseStream))throw new r.FormatError("XObject should be a stream");const h=o.dict.get("Subtype");if(!(h instanceof i.Name))throw new r.FormatError("XObject should have a Name subtype");if("Form"!==h.name)if("Image"!==h.name){if("PS"!==h.name)throw new r.FormatError(`Unhandled XObject subtype ${h.name}`);(0,r.info)("Ignored XObject subtype PS");e()}else c.buildPaintImageXObject({resources:a,image:o,operatorList:n,cacheKey:M,localImageCache:u,localColorSpaceCache:d}).then(e,s);else{x.save();c.buildFormXObject(a,o,null,n,t,x.state.clone(),d).then((function(){x.restore();e()}),s)}})).catch((function(e){if(!(e instanceof r.AbortException)){if(!c.options.ignoreErrors)throw e;c.handler.send("UnsupportedFeature",{featureId:r.UNSUPPORTED_FEATURES.errorXObject});(0,r.warn)(`getOperatorList - ignoring XObject: "${e}".`)}})));return;case r.OPS.setFont:var D=e[1];next(c.handleSetFont(a,e,null,n,t,x.state,o).then((function(e){n.addDependency(e);n.addOp(r.OPS.setFont,[e,D])})));return;case r.OPS.beginText:h=!0;break;case r.OPS.endText:h=!1;break;case r.OPS.endInlineImage:var N=e[0].cacheKey;if(N){const t=u.getByName(N);if(t){n.addImageOps(t.fn,t.args,t.optionalContent);incrementCachedImageMaskCount(t);e=null;continue}}next(c.buildPaintImageXObject({resources:a,image:e[0],isInline:!0,operatorList:n,cacheKey:N,localImageCache:u,localColorSpaceCache:d}));return;case r.OPS.showText:if(!x.state.font){c.ensureStateFont(x.state);continue}e[0]=c.handleText(e[0],x.state);break;case r.OPS.showSpacedText:if(!x.state.font){c.ensureStateFont(x.state);continue}var L=[],j=x.state;for(const t of e[0])"string"==typeof t?L.push(...c.handleText(t,j)):"number"==typeof t&&L.push(t);e[0]=L;s=r.OPS.showText;break;case r.OPS.nextLineShowText:if(!x.state.font){c.ensureStateFont(x.state);continue}n.addOp(r.OPS.nextLine);e[0]=c.handleText(e[0],x.state);s=r.OPS.showText;break;case r.OPS.nextLineSetSpacingShowText:if(!x.state.font){c.ensureStateFont(x.state);continue}n.addOp(r.OPS.nextLine);n.addOp(r.OPS.setWordSpacing,[e.shift()]);n.addOp(r.OPS.setCharSpacing,[e.shift()]);e[0]=c.handleText(e[0],x.state);s=r.OPS.showText;break;case r.OPS.setTextRenderingMode:x.state.textRenderingMode=e[0];break;case r.OPS.setFillColorSpace:{const t=y.ColorSpace.getCached(e[0],l,d);if(t){x.state.fillColorSpace=t;continue}next(c.parseColorSpace({cs:e[0],resources:a,localColorSpaceCache:d}).then((function(e){e&&(x.state.fillColorSpace=e)})));return}case r.OPS.setStrokeColorSpace:{const t=y.ColorSpace.getCached(e[0],l,d);if(t){x.state.strokeColorSpace=t;continue}next(c.parseColorSpace({cs:e[0],resources:a,localColorSpaceCache:d}).then((function(e){e&&(x.state.strokeColorSpace=e)})));return}case r.OPS.setFillColor:T=x.state.fillColorSpace;e=T.getRgb(e,0);s=r.OPS.setFillRGBColor;break;case r.OPS.setStrokeColor:T=x.state.strokeColorSpace;e=T.getRgb(e,0);s=r.OPS.setStrokeRGBColor;break;case r.OPS.setFillGray:x.state.fillColorSpace=y.ColorSpace.singletons.gray;e=y.ColorSpace.singletons.gray.getRgb(e,0);s=r.OPS.setFillRGBColor;break;case r.OPS.setStrokeGray:x.state.strokeColorSpace=y.ColorSpace.singletons.gray;e=y.ColorSpace.singletons.gray.getRgb(e,0);s=r.OPS.setStrokeRGBColor;break;case r.OPS.setFillCMYKColor:x.state.fillColorSpace=y.ColorSpace.singletons.cmyk;e=y.ColorSpace.singletons.cmyk.getRgb(e,0);s=r.OPS.setFillRGBColor;break;case r.OPS.setStrokeCMYKColor:x.state.strokeColorSpace=y.ColorSpace.singletons.cmyk;e=y.ColorSpace.singletons.cmyk.getRgb(e,0);s=r.OPS.setStrokeRGBColor;break;case r.OPS.setFillRGBColor:x.state.fillColorSpace=y.ColorSpace.singletons.rgb;e=y.ColorSpace.singletons.rgb.getRgb(e,0);break;case r.OPS.setStrokeRGBColor:x.state.strokeColorSpace=y.ColorSpace.singletons.rgb;e=y.ColorSpace.singletons.rgb.getRgb(e,0);break;case r.OPS.setFillColorN:T=x.state.fillColorSpace;if("Pattern"===T.name){next(c.handleColorN(n,r.OPS.setFillColorN,e,T,S,a,t,d,p,b));return}e=T.getRgb(e,0);s=r.OPS.setFillRGBColor;break;case r.OPS.setStrokeColorN:T=x.state.strokeColorSpace;if("Pattern"===T.name){next(c.handleColorN(n,r.OPS.setStrokeColorN,e,T,S,a,t,d,p,b));return}e=T.getRgb(e,0);s=r.OPS.setStrokeRGBColor;break;case r.OPS.shadingFill:var $=a.get("Shading");if(!$)throw new r.FormatError("No shading resource found");var _=$.get(e[0].name);if(!_)throw new r.FormatError("No shading object found");e=[c.parseShading({shading:_,resources:a,localColorSpaceCache:d,localShadingPatternCache:b})];s=r.OPS.shadingFill;break;case r.OPS.setGState:E=e[0]instanceof i.Name;M=e[0].name;if(E){const t=f.getByName(M);if(t){t.length>0&&n.addOp(r.OPS.setGState,[t]);e=null;continue}}next(new Promise((function(e,s){if(!E)throw new r.FormatError("GState must be referred to by name.");const o=a.get("ExtGState");if(!(o instanceof i.Dict))throw new r.FormatError("ExtGState should be a dictionary.");const l=o.get(M);if(!(l instanceof i.Dict))throw new r.FormatError("GState should be a dictionary.");c.setGState({resources:a,gState:l,operatorList:n,cacheKey:M,task:t,stateManager:x,localGStateCache:f,localColorSpaceCache:d}).then(e,s)})).catch((function(e){if(!(e instanceof r.AbortException)){if(!c.options.ignoreErrors)throw e;c.handler.send("UnsupportedFeature",{featureId:r.UNSUPPORTED_FEATURES.errorExtGState});(0,r.warn)(`getOperatorList - ignoring ExtGState: "${e}".`)}})));return;case r.OPS.moveTo:case r.OPS.lineTo:case r.OPS.curveTo:case r.OPS.curveTo2:case r.OPS.curveTo3:case r.OPS.closePath:case r.OPS.rectangle:c.buildPath(n,s,e,h);continue;case r.OPS.markPoint:case r.OPS.markPointProps:case r.OPS.beginCompat:case r.OPS.endCompat:continue;case r.OPS.beginMarkedContentProps:if(!(e[0]instanceof i.Name)){(0,r.warn)(`Expected name for beginMarkedContentProps arg0=${e[0]}`);continue}if("OC"===e[0].name){next(c.parseMarkedContentProps(e[1],a).then((e=>{n.addOp(r.OPS.beginMarkedContentProps,["OC",e])})).catch((e=>{if(!(e instanceof r.AbortException)){if(!c.options.ignoreErrors)throw e;c.handler.send("UnsupportedFeature",{featureId:r.UNSUPPORTED_FEATURES.errorMarkedContent});(0,r.warn)(`getOperatorList - ignoring beginMarkedContentProps: "${e}".`)}})));return}e=[e[0].name,e[1]instanceof i.Dict?e[1].get("MCID"):null];break;case r.OPS.beginMarkedContent:case r.OPS.endMarkedContent:default:if(null!==e){for(F=0,O=e.length;F<O&&!(e[F]instanceof i.Dict);F++);if(F<O){(0,r.warn)("getOperatorList - ignoring operator: "+s);continue}}}n.addOp(s,e)}if(v)next(R);else{closePendingRestoreOPS();e()}})).catch((e=>{if(!(e instanceof r.AbortException)){if(!this.options.ignoreErrors)throw e;this.handler.send("UnsupportedFeature",{featureId:r.UNSUPPORTED_FEATURES.errorOperatorList});(0,r.warn)(`getOperatorList - ignoring errors during "${t.name}" task: "${e}".`);closePendingRestoreOPS()}}))}getTextContent({stream:e,task:t,resources:a,stateManager:n=null,combineTextItems:s=!1,includeMarkedContent:o=!1,sink:c,seenStyles:l=new Set,viewBox:h,markedContentData:u=null}){a=a||i.Dict.empty;n=n||new StateManager(new TextState);o&&(u=u||{level:0});const d={items:[],styles:Object.create(null)},f={initialized:!1,str:[],totalWidth:0,totalHeight:0,width:0,height:0,vertical:!1,prevTransform:null,textAdvanceScale:0,spaceInFlowMin:0,spaceInFlowMax:0,trackingSpaceMin:1/0,negativeSpaceMax:-1/0,notASpace:-1/0,transform:null,fontName:null,hasEOL:!1},p=[" "," "];let y=0;function saveLastChar(e){const t=(y+1)%2,a=" "!==p[y]&&" "===p[t];p[y]=e;y=t;return a}function resetLastChars(){p[0]=p[1]=" ";y=0}const w=.1,S=.03,x=-.2,C=.1,k=.6,v=this,F=this.xref,O=[];let T=null;const M=new g.LocalImageCache,E=new g.LocalGStateCache,D=new EvaluatorPreprocessor(e,F,n);let L;function getCurrentTextTransform(){const e=L.font,t=[L.fontSize*L.textHScale,0,0,L.fontSize,0,L.textRise];if(e.isType3Font&&(L.fontSize<=1||e.isCharBBox)&&!(0,r.isArrayEqual)(L.fontMatrix,r.FONT_IDENTITY_MATRIX)){const a=e.bbox[3]-e.bbox[1];a>0&&(t[3]*=a*L.fontMatrix[3])}return r.Util.transform(L.ctm,r.Util.transform(L.textMatrix,t))}function ensureTextContentItem(){if(f.initialized)return f;const{font:e,loadedName:t}=L;if(!l.has(t)){l.add(t);d.styles[t]={fontFamily:e.fallbackName,ascent:e.ascent,descent:e.descent,vertical:e.vertical}}f.fontName=t;const a=f.transform=getCurrentTextTransform();if(e.vertical){f.width=f.totalWidth=Math.hypot(a[0],a[1]);f.height=f.totalHeight=0;f.vertical=!0}else{f.width=f.totalWidth=0;f.height=f.totalHeight=Math.hypot(a[2],a[3]);f.vertical=!1}const r=Math.hypot(L.textLineMatrix[0],L.textLineMatrix[1]),n=Math.hypot(L.ctm[0],L.ctm[1]);f.textAdvanceScale=n*r;f.trackingSpaceMin=L.fontSize*w;f.notASpace=L.fontSize*S;f.negativeSpaceMax=L.fontSize*x;f.spaceInFlowMin=L.fontSize*C;f.spaceInFlowMax=L.fontSize*k;f.hasEOL=!1;f.initialized=!0;return f}function updateAdvanceScale(){if(!f.initialized)return;const e=Math.hypot(L.textLineMatrix[0],L.textLineMatrix[1]),t=Math.hypot(L.ctm[0],L.ctm[1])*e;if(t!==f.textAdvanceScale){if(f.vertical){f.totalHeight+=f.height*f.textAdvanceScale;f.height=0}else{f.totalWidth+=f.width*f.textAdvanceScale;f.width=0}f.textAdvanceScale=t}}function handleSetFont(e,n){return v.loadFont(e,n,a).then((function(e){return e.font.isType3Font?e.loadType3Data(v,a,t).catch((function(){})).then((function(){return e})):e})).then((function(e){L.loadedName=e.loadedName;L.font=e.font;L.fontMatrix=e.font.fontMatrix||r.FONT_IDENTITY_MATRIX}))}function applyInverseRotation(e,t,a){const r=Math.hypot(a[0],a[1]);return[(a[0]*e+a[1]*t)/r,(a[2]*e+a[3]*t)/r]}function compareWithLastPosition(){const e=getCurrentTextTransform();let t=e[4],a=e[5];const r=t-h[0],n=a-h[1];if(r<0||r>h[2]||n<0||n>h[3])return!1;if(!s||!L.font||!f.prevTransform)return!0;let i=f.prevTransform[4],o=f.prevTransform[5];if(i===t&&o===a)return!0;let c=-1;e[0]&&0===e[1]&&0===e[2]?c=e[0]>0?0:180:e[1]&&0===e[0]&&0===e[3]&&(c=e[1]>0?90:270);switch(c){case 0:break;case 90:[t,a]=[a,t];[i,o]=[o,i];break;case 180:[t,a,i,o]=[-t,-a,-i,-o];break;case 270:[t,a]=[-a,-t];[i,o]=[-o,-i];break;default:[t,a]=applyInverseRotation(t,a,e);[i,o]=applyInverseRotation(i,o,f.prevTransform)}if(L.font.vertical){const e=(o-a)/f.textAdvanceScale,r=t-i,n=Math.sign(f.height);if(e<n*f.negativeSpaceMax){if(Math.abs(r)>.5*f.width){appendEOL();return!0}resetLastChars();flushTextContentItem();return!0}if(Math.abs(r)>f.width){appendEOL();return!0}e<=n*f.notASpace&&resetLastChars();if(e<=n*f.trackingSpaceMin)f.height+=e;else if(!addFakeSpaces(e,f.prevTransform,n))if(0===f.str.length){resetLastChars();d.items.push({str:" ",dir:"ltr",width:0,height:Math.abs(e),transform:f.prevTransform,fontName:f.fontName,hasEOL:!1})}else f.height+=e;return!0}const l=(t-i)/f.textAdvanceScale,u=a-o,g=Math.sign(f.width);if(l<g*f.negativeSpaceMax){if(Math.abs(u)>.5*f.height){appendEOL();return!0}resetLastChars();flushTextContentItem();return!0}if(Math.abs(u)>f.height){appendEOL();return!0}l<=g*f.notASpace&&resetLastChars();if(l<=g*f.trackingSpaceMin)f.width+=l;else if(!addFakeSpaces(l,f.prevTransform,g))if(0===f.str.length){resetLastChars();d.items.push({str:" ",dir:"ltr",width:Math.abs(l),height:0,transform:f.prevTransform,fontName:f.fontName,hasEOL:!1})}else f.width+=l;return!0}function buildTextContentItem({chars:e,extraSpacing:t}){const a=L.font;if(!e){const e=L.charSpacing+t;e&&(a.vertical?L.translateTextMatrix(0,-e):L.translateTextMatrix(e*L.textHScale,0));return}const r=a.charsToGlyphs(e),n=L.fontMatrix[0]*L.fontSize;for(let e=0,i=r.length;e<i;e++){const s=r[e],{category:o}=s;if(o.isInvisibleFormatMark)continue;let c=L.charSpacing+(e+1===i?t:0),l=s.width;a.vertical&&(l=s.vmetric?s.vmetric[0]:-l);let h=l*n;if(o.isWhitespace){if(a.vertical){c+=-h+L.wordSpacing;L.translateTextMatrix(0,-c)}else{c+=h+L.wordSpacing;L.translateTextMatrix(c*L.textHScale,0)}saveLastChar(" ");continue}if(!o.isZeroWidthDiacritic&&!compareWithLastPosition())continue;const u=ensureTextContentItem();o.isZeroWidthDiacritic&&(h=0);if(a.vertical){L.translateTextMatrix(0,h);h=Math.abs(h);u.height+=h}else{h*=L.textHScale;L.translateTextMatrix(h,0);u.width+=h}h&&(u.prevTransform=getCurrentTextTransform());const d=s.normalizedUnicode;saveLastChar(d)&&u.str.push(" ");u.str.push(d);c&&(a.vertical?L.translateTextMatrix(0,-c):L.translateTextMatrix(c*L.textHScale,0))}}function appendEOL(){resetLastChars();if(f.initialized){f.hasEOL=!0;flushTextContentItem()}else d.items.push({str:"",dir:"ltr",width:0,height:0,transform:getCurrentTextTransform(),fontName:L.loadedName,hasEOL:!0})}function addFakeSpaces(e,t,a){if(a*f.spaceInFlowMin<=e&&e<=a*f.spaceInFlowMax){if(f.initialized){resetLastChars();f.str.push(" ")}return!1}const r=f.fontName;let n=0;if(f.vertical){n=e;e=0}flushTextContentItem();resetLastChars();d.items.push({str:" ",dir:"ltr",width:Math.abs(e),height:Math.abs(n),transform:t||getCurrentTextTransform(),fontName:r,hasEOL:!1});return!0}function flushTextContentItem(){if(f.initialized&&f.str){f.vertical?f.totalHeight+=f.height*f.textAdvanceScale:f.totalWidth+=f.width*f.textAdvanceScale;d.items.push(function runBidiTransform(e){const t=e.str.join(""),a=(0,b.bidi)(t,-1,e.vertical);return{str:a.str,dir:a.dir,width:Math.abs(e.totalWidth),height:Math.abs(e.totalHeight),transform:e.transform,fontName:e.fontName,hasEOL:e.hasEOL}}(f));f.initialized=!1;f.str.length=0}}function enqueueChunk(e=!1){const t=d.items.length;if(0!==t&&!(e&&t<N)){c.enqueue(d,t);d.items=[];d.styles=Object.create(null)}}const j=new TimeSlotManager;return new Promise((function promiseBody(e,f){const next=function(t){enqueueChunk(!0);Promise.all([t,c.ready]).then((function(){try{promiseBody(e,f)}catch(e){f(e)}}),f)};t.ensureNotTerminated();j.reset();const g={};let p,b=[];for(;!(p=j.check());){b.length=0;g.args=b;if(!D.read(g))break;L=n.state;const e=g.fn;b=g.args;switch(0|e){case r.OPS.setFont:var y=b[0].name,w=b[1];if(L.font&&y===L.fontName&&w===L.fontSize)break;flushTextContentItem();L.fontName=y;L.fontSize=w;next(handleSetFont(y,null));return;case r.OPS.setTextRise:L.textRise=b[0];break;case r.OPS.setHScale:L.textHScale=b[0]/100;break;case r.OPS.setLeading:L.leading=b[0];break;case r.OPS.moveText:L.translateTextLineMatrix(b[0],b[1]);L.textMatrix=L.textLineMatrix.slice();break;case r.OPS.setLeadingMoveText:L.leading=-b[1];L.translateTextLineMatrix(b[0],b[1]);L.textMatrix=L.textLineMatrix.slice();break;case r.OPS.nextLine:L.carriageReturn();break;case r.OPS.setTextMatrix:L.setTextMatrix(b[0],b[1],b[2],b[3],b[4],b[5]);L.setTextLineMatrix(b[0],b[1],b[2],b[3],b[4],b[5]);updateAdvanceScale();break;case r.OPS.setCharSpacing:L.charSpacing=b[0];break;case r.OPS.setWordSpacing:L.wordSpacing=b[0];break;case r.OPS.beginText:L.textMatrix=r.IDENTITY_MATRIX.slice();L.textLineMatrix=r.IDENTITY_MATRIX.slice();break;case r.OPS.showSpacedText:if(!n.state.font){v.ensureStateFont(n.state);continue}const e=(L.font.vertical?1:-1)*L.fontSize/1e3,f=b[0];for(let t=0,a=f.length;t<a-1;t++){const a=f[t];if("string"==typeof a)O.push(a);else if("number"==typeof a&&0!==a){const t=O.join("");O.length=0;buildTextContentItem({chars:t,extraSpacing:a*e})}}const g=f.at(-1);"string"==typeof g&&O.push(g);if(O.length>0){const e=O.join("");O.length=0;buildTextContentItem({chars:e,extraSpacing:0})}break;case r.OPS.showText:if(!n.state.font){v.ensureStateFont(n.state);continue}buildTextContentItem({chars:b[0],extraSpacing:0});break;case r.OPS.nextLineShowText:if(!n.state.font){v.ensureStateFont(n.state);continue}L.carriageReturn();buildTextContentItem({chars:b[0],extraSpacing:0});break;case r.OPS.nextLineSetSpacingShowText:if(!n.state.font){v.ensureStateFont(n.state);continue}L.wordSpacing=b[0];L.charSpacing=b[1];L.carriageReturn();buildTextContentItem({chars:b[2],extraSpacing:0});break;case r.OPS.paintXObject:flushTextContentItem();T||(T=a.get("XObject")||i.Dict.empty);var S=b[0]instanceof i.Name,x=b[0].name;if(S&&M.getByName(x))break;next(new Promise((function(e,d){if(!S)throw new r.FormatError("XObject must be referred to by name.");let f=T.getRaw(x);if(f instanceof i.Ref){if(M.getByRef(f)){e();return}if(v.globalImageCache.getData(f,v.pageIndex)){e();return}f=F.fetch(f)}if(!(f instanceof m.BaseStream))throw new r.FormatError("XObject should be a stream");const g=f.dict.get("Subtype");if(!(g instanceof i.Name))throw new r.FormatError("XObject should have a Name subtype");if("Form"!==g.name){M.set(x,f.dict.objId,!0);e();return}const p=n.state.clone(),b=new StateManager(p),y=f.dict.getArray("Matrix");Array.isArray(y)&&6===y.length&&b.transform(y);enqueueChunk();const w={enqueueInvoked:!1,enqueue(e,t){this.enqueueInvoked=!0;c.enqueue(e,t)},get desiredSize(){return c.desiredSize},get ready(){return c.ready}};v.getTextContent({stream:f,task:t,resources:f.dict.get("Resources")||a,stateManager:b,combineTextItems:s,includeMarkedContent:o,sink:w,seenStyles:l,viewBox:h,markedContentData:u}).then((function(){w.enqueueInvoked||M.set(x,f.dict.objId,!0);e()}),d)})).catch((function(e){if(!(e instanceof r.AbortException)){if(!v.options.ignoreErrors)throw e;(0,r.warn)(`getTextContent - ignoring XObject: "${e}".`)}})));return;case r.OPS.setGState:S=b[0]instanceof i.Name;x=b[0].name;if(S&&E.getByName(x))break;next(new Promise((function(e,t){if(!S)throw new r.FormatError("GState must be referred to by name.");const n=a.get("ExtGState");if(!(n instanceof i.Dict))throw new r.FormatError("ExtGState should be a dictionary.");const s=n.get(x);if(!(s instanceof i.Dict))throw new r.FormatError("GState should be a dictionary.");const o=s.get("Font");if(o){flushTextContentItem();L.fontName=null;L.fontSize=o[1];handleSetFont(null,o[0]).then(e,t)}else{E.set(x,s.objId,!0);e()}})).catch((function(e){if(!(e instanceof r.AbortException)){if(!v.options.ignoreErrors)throw e;(0,r.warn)(`getTextContent - ignoring ExtGState: "${e}".`)}})));return;case r.OPS.beginMarkedContent:flushTextContentItem();if(o){u.level++;d.items.push({type:"beginMarkedContent",tag:b[0]instanceof i.Name?b[0].name:null})}break;case r.OPS.beginMarkedContentProps:flushTextContentItem();if(o){u.level++;let e=null;b[1]instanceof i.Dict&&(e=b[1].get("MCID"));d.items.push({type:"beginMarkedContentProps",id:Number.isInteger(e)?`${v.idFactory.getPageObjId()}_mcid${e}`:null,tag:b[0]instanceof i.Name?b[0].name:null})}break;case r.OPS.endMarkedContent:flushTextContentItem();if(o){if(0===u.level)break;u.level--;d.items.push({type:"endMarkedContent"})}}if(d.items.length>=c.desiredSize){p=!0;break}}if(p)next(R);else{flushTextContentItem();enqueueChunk();e()}})).catch((e=>{if(!(e instanceof r.AbortException)){if(!this.options.ignoreErrors)throw e;(0,r.warn)(`getTextContent - ignoring errors during "${t.name}" task: "${e}".`);flushTextContentItem();enqueueChunk()}}))}extractDataStructures(e,t,a){const n=this.xref;let s;const c=this.readToUnicode(a.toUnicode||e.get("ToUnicode")||t.get("ToUnicode"));if(a.composite){const t=e.get("CIDSystemInfo");t instanceof i.Dict&&(a.cidSystemInfo={registry:(0,r.stringToPDFString)(t.get("Registry")),ordering:(0,r.stringToPDFString)(t.get("Ordering")),supplement:t.get("Supplement")});try{const t=e.get("CIDToGIDMap");t instanceof m.BaseStream&&(s=t.getBytes())}catch(e){if(!this.options.ignoreErrors)throw e;(0,r.warn)(`extractDataStructures - ignoring CIDToGIDMap data: "${e}".`)}}const l=[];let h,u=null;if(e.has("Encoding")){h=e.get("Encoding");if(h instanceof i.Dict){u=h.get("BaseEncoding");u=u instanceof i.Name?u.name:null;if(h.has("Differences")){const e=h.get("Differences");let t=0;for(const a of e){const e=n.fetchIfRef(a);if("number"==typeof e)t=e;else{if(!(e instanceof i.Name))throw new r.FormatError(`Invalid entry in 'Differences' array: ${e}`);l[t++]=e.name}}}}else if(h instanceof i.Name)u=h.name;else{const e="Encoding is not a Name nor a Dict";if(!this.options.ignoreErrors)throw new r.FormatError(e);(0,r.warn)(e)}"MacRomanEncoding"!==u&&"MacExpertEncoding"!==u&&"WinAnsiEncoding"!==u&&(u=null)}if(u)a.defaultEncoding=(0,o.getEncoding)(u);else{const e=!!(a.flags&S.FontFlags.Symbolic),t=!!(a.flags&S.FontFlags.Nonsymbolic);h=o.StandardEncoding;"TrueType"!==a.type||t||(h=o.WinAnsiEncoding);if(e){h=o.MacRomanEncoding;a.file&&!a.isInternalFont||(/Symbol/i.test(a.name)?h=o.SymbolSetEncoding:/Dingbats|Wingdings/i.test(a.name)&&(h=o.ZapfDingbatsEncoding))}a.defaultEncoding=h}a.differences=l;a.baseEncodingName=u;a.hasEncoding=!!u||l.length>0;a.dict=e;return c.then((e=>{a.toUnicode=e;return this.buildToUnicode(a)})).then((e=>{a.toUnicode=e;s&&(a.cidToGidMap=this.readCidToGidMap(s,e));return a}))}_simpleFontToUnicode(e,t=!1){(0,r.assert)(!e.composite,"Must be a simple font.");const a=[],n=e.defaultEncoding.slice(),i=e.baseEncodingName,s=e.differences;for(const e in s){const t=s[e];".notdef"!==t&&(n[e]=t)}const c=(0,x.getGlyphsUnicode)();for(const r in n){let s=n[r];if(""===s)continue;let l=c[s];if(void 0!==l){a[r]=String.fromCharCode(l);continue}let h=0;switch(s[0]){case"G":3===s.length&&(h=parseInt(s.substring(1),16));break;case"g":5===s.length&&(h=parseInt(s.substring(1),16));break;case"C":case"c":if(s.length>=3&&s.length<=4){const a=s.substring(1);if(t){h=parseInt(a,16);break}h=+a;if(Number.isNaN(h)&&Number.isInteger(parseInt(a,16)))return this._simpleFontToUnicode(e,!0)}break;case"u":l=(0,v.getUnicodeForGlyph)(s,c);-1!==l&&(h=l)}if(h>0&&h<=1114111&&Number.isInteger(h)){if(i&&h===+r){const e=(0,o.getEncoding)(i);if(e&&(s=e[r])){a[r]=String.fromCharCode(c[s]);continue}}a[r]=String.fromCodePoint(h)}}return a}async buildToUnicode(e){e.hasIncludedToUnicodeMap=!!e.toUnicode&&e.toUnicode.length>0;if(e.hasIncludedToUnicodeMap){!e.composite&&e.hasEncoding&&(e.fallbackToUnicode=this._simpleFontToUnicode(e));return e.toUnicode}if(!e.composite)return new u.ToUnicodeMap(this._simpleFontToUnicode(e));if(e.composite&&(e.cMap.builtInCMap&&!(e.cMap instanceof n.IdentityCMap)||"Adobe"===e.cidSystemInfo.registry&&("GB1"===e.cidSystemInfo.ordering||"CNS1"===e.cidSystemInfo.ordering||"Japan1"===e.cidSystemInfo.ordering||"Korea1"===e.cidSystemInfo.ordering))){const{registry:t,ordering:a}=e.cidSystemInfo,s=i.Name.get(`${t}-${a}-UCS2`),o=await n.CMapFactory.create({encoding:s,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null}),c=[];e.cMap.forEach((function(e,t){if(t>65535)throw new r.FormatError("Max size of CID is 65,535");const a=o.lookup(t);a&&(c[e]=String.fromCharCode((a.charCodeAt(0)<<8)+a.charCodeAt(1)))}));return new u.ToUnicodeMap(c)}return new u.IdentityToUnicodeMap(e.firstChar,e.lastChar)}readToUnicode(e){return e?e instanceof i.Name?n.CMapFactory.create({encoding:e,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null}).then((function(e){return e instanceof n.IdentityCMap?new u.IdentityToUnicodeMap(0,65535):new u.ToUnicodeMap(e.getMap())})):e instanceof m.BaseStream?n.CMapFactory.create({encoding:e,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null}).then((function(e){if(e instanceof n.IdentityCMap)return new u.IdentityToUnicodeMap(0,65535);const t=new Array(e.length);e.forEach((function(e,a){if("number"==typeof a){t[e]=String.fromCodePoint(a);return}const r=[];for(let e=0;e<a.length;e+=2){const t=a.charCodeAt(e)<<8|a.charCodeAt(e+1);if(55296!=(63488&t)){r.push(t);continue}e+=2;const n=a.charCodeAt(e)<<8|a.charCodeAt(e+1);r.push(((1023&t)<<10)+(1023&n)+65536)}t[e]=String.fromCodePoint(...r)}));return new u.ToUnicodeMap(t)}),(e=>{if(e instanceof r.AbortException)return null;if(this.options.ignoreErrors){this.handler.send("UnsupportedFeature",{featureId:r.UNSUPPORTED_FEATURES.errorFontToUnicode});(0,r.warn)(`readToUnicode - ignoring ToUnicode data: "${e}".`);return null}throw e})):Promise.resolve(null):Promise.resolve(null)}readCidToGidMap(e,t){const a=[];for(let r=0,n=e.length;r<n;r++){const n=e[r++]<<8|e[r],i=r>>1;(0!==n||t.has(i))&&(a[i]=n)}return a}extractWidths(e,t,a){const r=this.xref;let n=[],s=0;const o=[];let c,l,h,u,d,f,g,p;if(a.composite){s=e.has("DW")?e.get("DW"):1e3;p=e.get("W");if(p)for(l=0,h=p.length;l<h;l++){f=r.fetchIfRef(p[l++]);g=r.fetchIfRef(p[l]);if(Array.isArray(g))for(u=0,d=g.length;u<d;u++)n[f++]=r.fetchIfRef(g[u]);else{const e=r.fetchIfRef(p[++l]);for(u=f;u<=g;u++)n[u]=e}}if(a.vertical){let t=e.getArray("DW2")||[880,-1e3];c=[t[1],.5*s,t[0]];t=e.get("W2");if(t)for(l=0,h=t.length;l<h;l++){f=r.fetchIfRef(t[l++]);g=r.fetchIfRef(t[l]);if(Array.isArray(g))for(u=0,d=g.length;u<d;u++)o[f++]=[r.fetchIfRef(g[u++]),r.fetchIfRef(g[u++]),r.fetchIfRef(g[u])];else{const e=[r.fetchIfRef(t[++l]),r.fetchIfRef(t[++l]),r.fetchIfRef(t[++l])];for(u=f;u<=g;u++)o[u]=e}}}}else{const o=a.firstChar;p=e.get("Widths");if(p){u=o;for(l=0,h=p.length;l<h;l++)n[u++]=r.fetchIfRef(p[l]);s=parseFloat(t.get("MissingWidth"))||0}else{const t=e.get("BaseFont");if(t instanceof i.Name){const e=this.getBaseFontMetrics(t.name);n=this.buildCharCodeToWidth(e.widths,a);s=e.defaultWidth}}}let m=!0,b=s;for(const e in n){const t=n[e];if(t)if(b){if(b!==t){m=!1;break}}else b=t}m&&(a.flags|=S.FontFlags.FixedPitch);a.defaultWidth=s;a.widths=n;a.defaultVMetrics=c;a.vmetrics=o}isSerifFont(e){const t=e.split("-")[0];return t in(0,c.getSerifFonts)()||/serif/gi.test(t)}getBaseFontMetrics(e){let t=0,a=Object.create(null),r=!1;let n=(0,c.getStdFontMap)()[e]||e;const i=(0,k.getMetrics)();n in i||(n=this.isSerifFont(e)?"Times-Roman":"Helvetica");const s=i[n];if("number"==typeof s){t=s;r=!0}else a=s();return{defaultWidth:t,monospace:r,widths:a}}buildCharCodeToWidth(e,t){const a=Object.create(null),r=t.differences,n=t.defaultEncoding;for(let t=0;t<256;t++)t in r&&e[r[t]]?a[t]=e[r[t]]:t in n&&e[n[t]]&&(a[t]=e[n[t]]);return a}preEvaluateFont(e){const t=e;let a=e.get("Subtype");if(!(a instanceof i.Name))throw new r.FormatError("invalid font Subtype");let n,s,o=!1;if("Type0"===a.name){const t=e.get("DescendantFonts");if(!t)throw new r.FormatError("Descendant fonts are not specified");if(!((e=Array.isArray(t)?this.xref.fetchIfRef(t[0]):t)instanceof i.Dict))throw new r.FormatError("Descendant font is not a dictionary.");a=e.get("Subtype");if(!(a instanceof i.Name))throw new r.FormatError("invalid font Subtype");o=!0}const c=e.get("FirstChar")||0,l=e.get("LastChar")||(o?65535:255),h=e.get("FontDescriptor");if(h){n=new F.MurmurHash3_64;const a=t.getRaw("Encoding");if(a instanceof i.Name)n.update(a.name);else if(a instanceof i.Ref)n.update(a.toString());else if(a instanceof i.Dict)for(const e of a.getRawValues())if(e instanceof i.Name)n.update(e.name);else if(e instanceof i.Ref)n.update(e.toString());else if(Array.isArray(e)){const t=e.length,a=new Array(t);for(let r=0;r<t;r++){const t=e[r];t instanceof i.Name?a[r]=t.name:("number"==typeof t||t instanceof i.Ref)&&(a[r]=t.toString())}n.update(a.join())}n.update(`${c}-${l}`);s=e.get("ToUnicode")||t.get("ToUnicode");if(s instanceof m.BaseStream){const e=s.str||s,t=e.buffer?new Uint8Array(e.buffer.buffer,0,e.bufferLength):new Uint8Array(e.bytes.buffer,e.start,e.end-e.start);n.update(t)}else s instanceof i.Name&&n.update(s.name);const r=e.get("Widths")||t.get("Widths");if(Array.isArray(r)){const e=[];for(const t of r)("number"==typeof t||t instanceof i.Ref)&&e.push(t.toString());n.update(e.join())}if(o){n.update("compositeFont");const a=e.get("W")||t.get("W");if(Array.isArray(a)){const e=[];for(const t of a)if("number"==typeof t||t instanceof i.Ref)e.push(t.toString());else if(Array.isArray(t)){const a=[];for(const e of t)("number"==typeof e||e instanceof i.Ref)&&a.push(e.toString());e.push(`[${a.join()}]`)}n.update(e.join())}const r=e.getRaw("CIDToGIDMap")||t.getRaw("CIDToGIDMap");r instanceof i.Name?n.update(r.name):r instanceof i.Ref?n.update(r.toString()):r instanceof m.BaseStream&&n.update(r.peekBytes())}}return{descriptor:h,dict:e,baseDict:t,composite:o,type:a.name,firstChar:c,lastChar:l,toUnicode:s,hash:n?n.hexdigest():""}}async translateFont({descriptor:e,dict:t,baseDict:a,composite:o,type:l,firstChar:u,lastChar:d,toUnicode:f,cssFontInfo:g}){const m="Type3"===l;let b;if(!e){if(!m){let e=t.get("BaseFont");if(!(e instanceof i.Name))throw new r.FormatError("Base font is not specified");e=e.name.replace(/[,_]/g,"-");const n=this.getBaseFontMetrics(e),o=e.split("-")[0],h=(this.isSerifFont(o)?S.FontFlags.Serif:0)|(n.monospace?S.FontFlags.FixedPitch:0)|((0,c.getSymbolsFonts)()[o]?S.FontFlags.Symbolic:S.FontFlags.Nonsymbolic);b={type:l,name:e,loadedName:a.loadedName,widths:n.widths,defaultWidth:n.defaultWidth,isSimulatedFlags:!0,flags:h,firstChar:u,lastChar:d,toUnicode:f,xHeight:0,capHeight:0,italicAngle:0,isType3Font:m};const g=t.get("Widths"),p=(0,c.getStandardFontName)(e);let y=null;if(p){b.isStandardFont=!0;y=await this.fetchStandardFontData(p);b.isInternalFont=!!y}return this.extractDataStructures(t,t,b).then((t=>{if(g){const e=[];let a=u;for(const t of g)e[a++]=this.xref.fetchIfRef(t);t.widths=e}else t.widths=this.buildCharCodeToWidth(n.widths,t);return new s.Font(e,y,t)}))}(e=new i.Dict(null)).set("FontName",i.Name.get(l));e.set("FontBBox",t.getArray("FontBBox")||[0,0,0,0])}let y,w,x,C,k,v=e.get("FontName"),F=t.get("BaseFont");"string"==typeof v&&(v=i.Name.get(v));"string"==typeof F&&(F=i.Name.get(F));if(!m){const e=v&&v.name,t=F&&F.name;if(e!==t){(0,r.info)(`The FontDescriptor's FontName is "${e}" but should be the same as the Font's BaseFont "${t}".`);e&&t&&t.startsWith(e)&&(v=F)}}v=v||F;if(!(v instanceof i.Name))throw new r.FormatError("invalid font name");try{y=e.get("FontFile","FontFile2","FontFile3")}catch(e){if(!this.options.ignoreErrors)throw e;(0,r.warn)(`translateFont - fetching "${v.name}" font file: "${e}".`);y=new p.NullStream}let O=!1,T=!1,M=null;if(y){if(y.dict){const e=y.dict.get("Subtype");e instanceof i.Name&&(w=e.name);x=y.dict.get("Length1");C=y.dict.get("Length2");k=y.dict.get("Length3")}}else if(g){const e=(0,h.getXfaFontName)(v.name);if(e){g.fontFamily=`${g.fontFamily}-PdfJS-XFA`;g.metrics=e.metrics||null;M=e.factors||null;y=await this.fetchStandardFontData(e.name);T=!!y;a=t=(0,h.getXfaFontDict)(v.name);o=!0}}else if(!m){const e=(0,c.getStandardFontName)(v.name);if(e){O=!0;y=await this.fetchStandardFontData(e);T=!!y}}b={type:l,name:v.name,subtype:w,file:y,length1:x,length2:C,length3:k,isStandardFont:O,isInternalFont:T,loadedName:a.loadedName,composite:o,fixedPitch:!1,fontMatrix:t.getArray("FontMatrix")||r.FONT_IDENTITY_MATRIX,firstChar:u,lastChar:d,toUnicode:f,bbox:e.getArray("FontBBox")||t.getArray("FontBBox"),ascent:e.get("Ascent"),descent:e.get("Descent"),xHeight:e.get("XHeight")||0,capHeight:e.get("CapHeight")||0,flags:e.get("Flags"),italicAngle:e.get("ItalicAngle")||0,isType3Font:m,cssFontInfo:g,scaleFactors:M};if(o){const e=a.get("Encoding");e instanceof i.Name&&(b.cidEncoding=e.name);const t=await n.CMapFactory.create({encoding:e,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null});b.cMap=t;b.vertical=b.cMap.vertical}return this.extractDataStructures(t,a,b).then((a=>{this.extractWidths(t,e,a);return new s.Font(v.name,y,a)}))}static buildFontPaths(e,t,a,n){function buildPath(t){const i=`${e.loadedName}_path_${t}`;try{if(e.renderer.hasBuiltPath(t))return;a.send("commonobj",[i,"FontPath",e.renderer.getPathJs(t)])}catch(e){if(n.ignoreErrors){a.send("UnsupportedFeature",{featureId:r.UNSUPPORTED_FEATURES.errorFontBuildPath});(0,r.warn)(`buildFontPaths - ignoring ${i} glyph: "${e}".`);return}throw e}}for(const e of t){buildPath(e.fontChar);const t=e.accent;t&&t.fontChar&&buildPath(t.fontChar)}}static get fallbackFontDict(){const e=new i.Dict;e.set("BaseFont",i.Name.get("PDFJS-FallbackFont"));e.set("Type",i.Name.get("FallbackType"));e.set("Subtype",i.Name.get("FallbackType"));e.set("Encoding",i.Name.get("WinAnsiEncoding"));return(0,r.shadow)(this,"fallbackFontDict",e)}}t.PartialEvaluator=PartialEvaluator;class TranslatedFont{constructor({loadedName:e,font:t,dict:a,evaluatorOptions:r}){this.loadedName=e;this.font=t;this.dict=a;this._evaluatorOptions=r||M;this.type3Loaded=null;this.type3Dependencies=t.isType3Font?new Set:null;this.sent=!1}send(e){if(!this.sent){this.sent=!0;e.send("commonobj",[this.loadedName,"Font",this.font.exportData(this._evaluatorOptions.fontExtraProperties)])}}fallback(e){if(this.font.data){this.font.disableFontFace=!0;PartialEvaluator.buildFontPaths(this.font,this.font.glyphCacheValues,e,this._evaluatorOptions)}}loadType3Data(e,t,a){if(this.type3Loaded)return this.type3Loaded;if(!this.font.isType3Font)throw new Error("Must be a Type3 font.");const n=e.clone({ignoreErrors:!1});n.parsingType3Font=!0;const s=new i.RefSet(e.type3FontRefs);this.dict.objId&&!s.has(this.dict.objId)&&s.put(this.dict.objId);n.type3FontRefs=s;const o=this.font,c=this.type3Dependencies;let l=Promise.resolve();const h=this.dict.get("CharProcs"),u=this.dict.get("Resources")||t,d=Object.create(null),f=r.Util.normalizeRect(o.bbox||[0,0,0,0]),g=f[2]-f[0],p=f[3]-f[1],m=Math.hypot(g,p);for(const e of h.getKeys())l=l.then((()=>{const t=h.get(e),i=new O.OperatorList;return n.getOperatorList({stream:t,task:a,resources:u,operatorList:i}).then((()=>{i.fnArray[0]===r.OPS.setCharWidthAndBounds&&this._removeType3ColorOperators(i,m);d[e]=i.getIR();for(const e of i.dependencies)c.add(e)})).catch((function(t){(0,r.warn)(`Type3 font resource "${e}" is not available.`);const a=new O.OperatorList;d[e]=a.getIR()}))}));this.type3Loaded=l.then((()=>{o.charProcOperatorList=d;if(this._bbox){o.isCharBBox=!0;o.bbox=this._bbox}}));return this.type3Loaded}_removeType3ColorOperators(e,t=NaN){const a=r.Util.normalizeRect(e.argsArray[0].slice(2)),n=a[2]-a[0],i=a[3]-a[1],s=Math.hypot(n,i);if(0===n||0===i){e.fnArray.splice(0,1);e.argsArray.splice(0,1)}else if(0===t||Math.round(s/t)>=10){this._bbox||(this._bbox=[1/0,1/0,-1/0,-1/0]);this._bbox[0]=Math.min(this._bbox[0],a[0]);this._bbox[1]=Math.min(this._bbox[1],a[1]);this._bbox[2]=Math.max(this._bbox[2],a[2]);this._bbox[3]=Math.max(this._bbox[3],a[3])}let o=0,c=e.length;for(;o<c;){switch(e.fnArray[o]){case r.OPS.setCharWidthAndBounds:break;case r.OPS.setStrokeColorSpace:case r.OPS.setFillColorSpace:case r.OPS.setStrokeColor:case r.OPS.setStrokeColorN:case r.OPS.setFillColor:case r.OPS.setFillColorN:case r.OPS.setStrokeGray:case r.OPS.setFillGray:case r.OPS.setStrokeRGBColor:case r.OPS.setFillRGBColor:case r.OPS.setStrokeCMYKColor:case r.OPS.setFillCMYKColor:case r.OPS.shadingFill:case r.OPS.setRenderingIntent:e.fnArray.splice(o,1);e.argsArray.splice(o,1);c--;continue;case r.OPS.setGState:const[t]=e.argsArray[o];let a=0,n=t.length;for(;a<n;){const[e]=t[a];switch(e){case"TR":case"TR2":case"HT":case"BG":case"BG2":case"UCR":case"UCR2":t.splice(a,1);n--;continue}a++}}o++}}}class StateManager{constructor(e=new EvalState){this.state=e;this.stateStack=[]}save(){const e=this.state;this.stateStack.push(this.state);this.state=e.clone()}restore(){const e=this.stateStack.pop();e&&(this.state=e)}transform(e){this.state.ctm=r.Util.transform(this.state.ctm,e)}}class TextState{constructor(){this.ctm=new Float32Array(r.IDENTITY_MATRIX);this.fontName=null;this.fontSize=0;this.loadedName=null;this.font=null;this.fontMatrix=r.FONT_IDENTITY_MATRIX;this.textMatrix=r.IDENTITY_MATRIX.slice();this.textLineMatrix=r.IDENTITY_MATRIX.slice();this.charSpacing=0;this.wordSpacing=0;this.leading=0;this.textHScale=1;this.textRise=0}setTextMatrix(e,t,a,r,n,i){const s=this.textMatrix;s[0]=e;s[1]=t;s[2]=a;s[3]=r;s[4]=n;s[5]=i}setTextLineMatrix(e,t,a,r,n,i){const s=this.textLineMatrix;s[0]=e;s[1]=t;s[2]=a;s[3]=r;s[4]=n;s[5]=i}translateTextMatrix(e,t){const a=this.textMatrix;a[4]=a[0]*e+a[2]*t+a[4];a[5]=a[1]*e+a[3]*t+a[5]}translateTextLineMatrix(e,t){const a=this.textLineMatrix;a[4]=a[0]*e+a[2]*t+a[4];a[5]=a[1]*e+a[3]*t+a[5]}carriageReturn(){this.translateTextLineMatrix(0,-this.leading);this.textMatrix=this.textLineMatrix.slice()}clone(){const e=Object.create(this);e.textMatrix=this.textMatrix.slice();e.textLineMatrix=this.textLineMatrix.slice();e.fontMatrix=this.fontMatrix.slice();return e}}class EvalState{constructor(){this.ctm=new Float32Array(r.IDENTITY_MATRIX);this.font=null;this.textRenderingMode=r.TextRenderingMode.FILL;this.fillColorSpace=y.ColorSpace.singletons.gray;this.strokeColorSpace=y.ColorSpace.singletons.gray}clone(){return Object.create(this)}}class EvaluatorPreprocessor{static get opMap(){const e=(0,C.getLookupTableFactory)((function(e){e.w={id:r.OPS.setLineWidth,numArgs:1,variableArgs:!1};e.J={id:r.OPS.setLineCap,numArgs:1,variableArgs:!1};e.j={id:r.OPS.setLineJoin,numArgs:1,variableArgs:!1};e.M={id:r.OPS.setMiterLimit,numArgs:1,variableArgs:!1};e.d={id:r.OPS.setDash,numArgs:2,variableArgs:!1};e.ri={id:r.OPS.setRenderingIntent,numArgs:1,variableArgs:!1};e.i={id:r.OPS.setFlatness,numArgs:1,variableArgs:!1};e.gs={id:r.OPS.setGState,numArgs:1,variableArgs:!1};e.q={id:r.OPS.save,numArgs:0,variableArgs:!1};e.Q={id:r.OPS.restore,numArgs:0,variableArgs:!1};e.cm={id:r.OPS.transform,numArgs:6,variableArgs:!1};e.m={id:r.OPS.moveTo,numArgs:2,variableArgs:!1};e.l={id:r.OPS.lineTo,numArgs:2,variableArgs:!1};e.c={id:r.OPS.curveTo,numArgs:6,variableArgs:!1};e.v={id:r.OPS.curveTo2,numArgs:4,variableArgs:!1};e.y={id:r.OPS.curveTo3,numArgs:4,variableArgs:!1};e.h={id:r.OPS.closePath,numArgs:0,variableArgs:!1};e.re={id:r.OPS.rectangle,numArgs:4,variableArgs:!1};e.S={id:r.OPS.stroke,numArgs:0,variableArgs:!1};e.s={id:r.OPS.closeStroke,numArgs:0,variableArgs:!1};e.f={id:r.OPS.fill,numArgs:0,variableArgs:!1};e.F={id:r.OPS.fill,numArgs:0,variableArgs:!1};e["f*"]={id:r.OPS.eoFill,numArgs:0,variableArgs:!1};e.B={id:r.OPS.fillStroke,numArgs:0,variableArgs:!1};e["B*"]={id:r.OPS.eoFillStroke,numArgs:0,variableArgs:!1};e.b={id:r.OPS.closeFillStroke,numArgs:0,variableArgs:!1};e["b*"]={id:r.OPS.closeEOFillStroke,numArgs:0,variableArgs:!1};e.n={id:r.OPS.endPath,numArgs:0,variableArgs:!1};e.W={id:r.OPS.clip,numArgs:0,variableArgs:!1};e["W*"]={id:r.OPS.eoClip,numArgs:0,variableArgs:!1};e.BT={id:r.OPS.beginText,numArgs:0,variableArgs:!1};e.ET={id:r.OPS.endText,numArgs:0,variableArgs:!1};e.Tc={id:r.OPS.setCharSpacing,numArgs:1,variableArgs:!1};e.Tw={id:r.OPS.setWordSpacing,numArgs:1,variableArgs:!1};e.Tz={id:r.OPS.setHScale,numArgs:1,variableArgs:!1};e.TL={id:r.OPS.setLeading,numArgs:1,variableArgs:!1};e.Tf={id:r.OPS.setFont,numArgs:2,variableArgs:!1};e.Tr={id:r.OPS.setTextRenderingMode,numArgs:1,variableArgs:!1};e.Ts={id:r.OPS.setTextRise,numArgs:1,variableArgs:!1};e.Td={id:r.OPS.moveText,numArgs:2,variableArgs:!1};e.TD={id:r.OPS.setLeadingMoveText,numArgs:2,variableArgs:!1};e.Tm={id:r.OPS.setTextMatrix,numArgs:6,variableArgs:!1};e["T*"]={id:r.OPS.nextLine,numArgs:0,variableArgs:!1};e.Tj={id:r.OPS.showText,numArgs:1,variableArgs:!1};e.TJ={id:r.OPS.showSpacedText,numArgs:1,variableArgs:!1};e["'"]={id:r.OPS.nextLineShowText,numArgs:1,variableArgs:!1};e['"']={id:r.OPS.nextLineSetSpacingShowText,numArgs:3,variableArgs:!1};e.d0={id:r.OPS.setCharWidth,numArgs:2,variableArgs:!1};e.d1={id:r.OPS.setCharWidthAndBounds,numArgs:6,variableArgs:!1};e.CS={id:r.OPS.setStrokeColorSpace,numArgs:1,variableArgs:!1};e.cs={id:r.OPS.setFillColorSpace,numArgs:1,variableArgs:!1};e.SC={id:r.OPS.setStrokeColor,numArgs:4,variableArgs:!0};e.SCN={id:r.OPS.setStrokeColorN,numArgs:33,variableArgs:!0};e.sc={id:r.OPS.setFillColor,numArgs:4,variableArgs:!0};e.scn={id:r.OPS.setFillColorN,numArgs:33,variableArgs:!0};e.G={id:r.OPS.setStrokeGray,numArgs:1,variableArgs:!1};e.g={id:r.OPS.setFillGray,numArgs:1,variableArgs:!1};e.RG={id:r.OPS.setStrokeRGBColor,numArgs:3,variableArgs:!1};e.rg={id:r.OPS.setFillRGBColor,numArgs:3,variableArgs:!1};e.K={id:r.OPS.setStrokeCMYKColor,numArgs:4,variableArgs:!1};e.k={id:r.OPS.setFillCMYKColor,numArgs:4,variableArgs:!1};e.sh={id:r.OPS.shadingFill,numArgs:1,variableArgs:!1};e.BI={id:r.OPS.beginInlineImage,numArgs:0,variableArgs:!1};e.ID={id:r.OPS.beginImageData,numArgs:0,variableArgs:!1};e.EI={id:r.OPS.endInlineImage,numArgs:1,variableArgs:!1};e.Do={id:r.OPS.paintXObject,numArgs:1,variableArgs:!1};e.MP={id:r.OPS.markPoint,numArgs:1,variableArgs:!1};e.DP={id:r.OPS.markPointProps,numArgs:2,variableArgs:!1};e.BMC={id:r.OPS.beginMarkedContent,numArgs:1,variableArgs:!1};e.BDC={id:r.OPS.beginMarkedContentProps,numArgs:2,variableArgs:!1};e.EMC={id:r.OPS.endMarkedContent,numArgs:0,variableArgs:!1};e.BX={id:r.OPS.beginCompat,numArgs:0,variableArgs:!1};e.EX={id:r.OPS.endCompat,numArgs:0,variableArgs:!1};e.BM=null;e.BD=null;e.true=null;e.fa=null;e.fal=null;e.fals=null;e.false=null;e.nu=null;e.nul=null;e.null=null}));return(0,r.shadow)(this,"opMap",e())}static get MAX_INVALID_PATH_OPS(){return(0,r.shadow)(this,"MAX_INVALID_PATH_OPS",10)}constructor(e,t,a=new StateManager){this.parser=new f.Parser({lexer:new f.Lexer(e,EvaluatorPreprocessor.opMap),xref:t});this.stateManager=a;this.nonProcessedArgs=[];this._isPathOp=!1;this._numInvalidPathOPS=0}get savedStatesDepth(){return this.stateManager.stateStack.length}read(e){let t=e.args;for(;;){const a=this.parser.getObj();if(a instanceof i.Cmd){const n=a.cmd,i=EvaluatorPreprocessor.opMap[n];if(!i){(0,r.warn)(`Unknown command "${n}".`);continue}const s=i.id,o=i.numArgs;let c=null!==t?t.length:0;this._isPathOp||(this._numInvalidPathOPS=0);this._isPathOp=s>=r.OPS.moveTo&&s<=r.OPS.endPath;if(i.variableArgs)c>o&&(0,r.info)(`Command ${n}: expected [0, ${o}] args, but received ${c} args.`);else{if(c!==o){const e=this.nonProcessedArgs;for(;c>o;){e.push(t.shift());c--}for(;c<o&&0!==e.length;){null===t&&(t=[]);t.unshift(e.pop());c++}}if(c<o){const e=`command ${n}: expected ${o} args, but received ${c} args.`;if(this._isPathOp&&++this._numInvalidPathOPS>EvaluatorPreprocessor.MAX_INVALID_PATH_OPS)throw new r.FormatError(`Invalid ${e}`);(0,r.warn)(`Skipping ${e}`);null!==t&&(t.length=0);continue}}this.preprocessCommand(s,t);e.fn=s;e.args=t;return!0}if(a===i.EOF)return!1;if(null!==a){null===t&&(t=[]);t.push(a);if(t.length>33)throw new r.FormatError("Too many arguments")}}}preprocessCommand(e,t){switch(0|e){case r.OPS.save:this.stateManager.save();break;case r.OPS.restore:this.stateManager.restore();break;case r.OPS.transform:this.stateManager.transform(t)}}}t.EvaluatorPreprocessor=EvaluatorPreprocessor},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.IdentityCMap=t.CMapFactory=t.CMap=void 0;var r=a(2),n=a(4),i=a(5),s=a(15),o=a(3),c=a(8);const l=["Adobe-GB1-UCS2","Adobe-CNS1-UCS2","Adobe-Japan1-UCS2","Adobe-Korea1-UCS2","78-EUC-H","78-EUC-V","78-H","78-RKSJ-H","78-RKSJ-V","78-V","78ms-RKSJ-H","78ms-RKSJ-V","83pv-RKSJ-H","90ms-RKSJ-H","90ms-RKSJ-V","90msp-RKSJ-H","90msp-RKSJ-V","90pv-RKSJ-H","90pv-RKSJ-V","Add-H","Add-RKSJ-H","Add-RKSJ-V","Add-V","Adobe-CNS1-0","Adobe-CNS1-1","Adobe-CNS1-2","Adobe-CNS1-3","Adobe-CNS1-4","Adobe-CNS1-5","Adobe-CNS1-6","Adobe-GB1-0","Adobe-GB1-1","Adobe-GB1-2","Adobe-GB1-3","Adobe-GB1-4","Adobe-GB1-5","Adobe-Japan1-0","Adobe-Japan1-1","Adobe-Japan1-2","Adobe-Japan1-3","Adobe-Japan1-4","Adobe-Japan1-5","Adobe-Japan1-6","Adobe-Korea1-0","Adobe-Korea1-1","Adobe-Korea1-2","B5-H","B5-V","B5pc-H","B5pc-V","CNS-EUC-H","CNS-EUC-V","CNS1-H","CNS1-V","CNS2-H","CNS2-V","ETHK-B5-H","ETHK-B5-V","ETen-B5-H","ETen-B5-V","ETenms-B5-H","ETenms-B5-V","EUC-H","EUC-V","Ext-H","Ext-RKSJ-H","Ext-RKSJ-V","Ext-V","GB-EUC-H","GB-EUC-V","GB-H","GB-V","GBK-EUC-H","GBK-EUC-V","GBK2K-H","GBK2K-V","GBKp-EUC-H","GBKp-EUC-V","GBT-EUC-H","GBT-EUC-V","GBT-H","GBT-V","GBTpc-EUC-H","GBTpc-EUC-V","GBpc-EUC-H","GBpc-EUC-V","H","HKdla-B5-H","HKdla-B5-V","HKdlb-B5-H","HKdlb-B5-V","HKgccs-B5-H","HKgccs-B5-V","HKm314-B5-H","HKm314-B5-V","HKm471-B5-H","HKm471-B5-V","HKscs-B5-H","HKscs-B5-V","Hankaku","Hiragana","KSC-EUC-H","KSC-EUC-V","KSC-H","KSC-Johab-H","KSC-Johab-V","KSC-V","KSCms-UHC-H","KSCms-UHC-HW-H","KSCms-UHC-HW-V","KSCms-UHC-V","KSCpc-EUC-H","KSCpc-EUC-V","Katakana","NWP-H","NWP-V","RKSJ-H","RKSJ-V","Roman","UniCNS-UCS2-H","UniCNS-UCS2-V","UniCNS-UTF16-H","UniCNS-UTF16-V","UniCNS-UTF32-H","UniCNS-UTF32-V","UniCNS-UTF8-H","UniCNS-UTF8-V","UniGB-UCS2-H","UniGB-UCS2-V","UniGB-UTF16-H","UniGB-UTF16-V","UniGB-UTF32-H","UniGB-UTF32-V","UniGB-UTF8-H","UniGB-UTF8-V","UniJIS-UCS2-H","UniJIS-UCS2-HW-H","UniJIS-UCS2-HW-V","UniJIS-UCS2-V","UniJIS-UTF16-H","UniJIS-UTF16-V","UniJIS-UTF32-H","UniJIS-UTF32-V","UniJIS-UTF8-H","UniJIS-UTF8-V","UniJIS2004-UTF16-H","UniJIS2004-UTF16-V","UniJIS2004-UTF32-H","UniJIS2004-UTF32-V","UniJIS2004-UTF8-H","UniJIS2004-UTF8-V","UniJISPro-UCS2-HW-V","UniJISPro-UCS2-V","UniJISPro-UTF8-V","UniJISX0213-UTF32-H","UniJISX0213-UTF32-V","UniJISX02132004-UTF32-H","UniJISX02132004-UTF32-V","UniKS-UCS2-H","UniKS-UCS2-V","UniKS-UTF16-H","UniKS-UTF16-V","UniKS-UTF32-H","UniKS-UTF32-V","UniKS-UTF8-H","UniKS-UTF8-V","V","WP-Symbol"],h=2**24-1;class CMap{constructor(e=!1){this.codespaceRanges=[[],[],[],[]];this.numCodespaceRanges=0;this._map=[];this.name="";this.vertical=!1;this.useCMap=null;this.builtInCMap=e}addCodespaceRange(e,t,a){this.codespaceRanges[e-1].push(t,a);this.numCodespaceRanges++}mapCidRange(e,t,a){if(t-e>h)throw new Error("mapCidRange - ignoring data above MAX_MAP_RANGE.");for(;e<=t;)this._map[e++]=a++}mapBfRange(e,t,a){if(t-e>h)throw new Error("mapBfRange - ignoring data above MAX_MAP_RANGE.");const r=a.length-1;for(;e<=t;){this._map[e++]=a;const t=a.charCodeAt(r)+1;t>255?a=a.substring(0,r-1)+String.fromCharCode(a.charCodeAt(r-1)+1)+"\0":a=a.substring(0,r)+String.fromCharCode(t)}}mapBfRangeToArray(e,t,a){if(t-e>h)throw new Error("mapBfRangeToArray - ignoring data above MAX_MAP_RANGE.");const r=a.length;let n=0;for(;e<=t&&n<r;){this._map[e]=a[n++];++e}}mapOne(e,t){this._map[e]=t}lookup(e){return this._map[e]}contains(e){return void 0!==this._map[e]}forEach(e){const t=this._map,a=t.length;if(a<=65536)for(let r=0;r<a;r++)void 0!==t[r]&&e(r,t[r]);else for(const a in t)e(a,t[a])}charCodeOf(e){const t=this._map;if(t.length<=65536)return t.indexOf(e);for(const a in t)if(t[a]===e)return 0|a;return-1}getMap(){return this._map}readCharCode(e,t,a){let r=0;const n=this.codespaceRanges;for(let i=0,s=n.length;i<s;i++){r=(r<<8|e.charCodeAt(t+i))>>>0;const s=n[i];for(let e=0,t=s.length;e<t;){const t=s[e++],n=s[e++];if(r>=t&&r<=n){a.charcode=r;a.length=i+1;return}}}a.charcode=0;a.length=1}getCharCodeLength(e){const t=this.codespaceRanges;for(let a=0,r=t.length;a<r;a++){const r=t[a];for(let t=0,n=r.length;t<n;){const n=r[t++],i=r[t++];if(e>=n&&e<=i)return a+1}}return 1}get length(){return this._map.length}get isIdentityCMap(){if("Identity-H"!==this.name&&"Identity-V"!==this.name)return!1;if(65536!==this._map.length)return!1;for(let e=0;e<65536;e++)if(this._map[e]!==e)return!1;return!0}}t.CMap=CMap;class IdentityCMap extends CMap{constructor(e,t){super();this.vertical=e;this.addCodespaceRange(t,0,65535)}mapCidRange(e,t,a){(0,r.unreachable)("should not call mapCidRange")}mapBfRange(e,t,a){(0,r.unreachable)("should not call mapBfRange")}mapBfRangeToArray(e,t,a){(0,r.unreachable)("should not call mapBfRangeToArray")}mapOne(e,t){(0,r.unreachable)("should not call mapCidOne")}lookup(e){return Number.isInteger(e)&&e<=65535?e:void 0}contains(e){return Number.isInteger(e)&&e<=65535}forEach(e){for(let t=0;t<=65535;t++)e(t,t)}charCodeOf(e){return Number.isInteger(e)&&e<=65535?e:-1}getMap(){const e=new Array(65536);for(let t=0;t<=65535;t++)e[t]=t;return e}get length(){return 65536}get isIdentityCMap(){(0,r.unreachable)("should not access .isIdentityCMap")}}t.IdentityCMap=IdentityCMap;const u=function BinaryCMapReaderClosure(){function hexToInt(e,t){let a=0;for(let r=0;r<=t;r++)a=a<<8|e[r];return a>>>0}function hexToStr(e,t){return 1===t?String.fromCharCode(e[0],e[1]):3===t?String.fromCharCode(e[0],e[1],e[2],e[3]):String.fromCharCode.apply(null,e.subarray(0,t+1))}function addHex(e,t,a){let r=0;for(let n=a;n>=0;n--){r+=e[n]+t[n];e[n]=255&r;r>>=8}}function incHex(e,t){let a=1;for(let r=t;r>=0&&a>0;r--){a+=e[r];e[r]=255&a;a>>=8}}const e=16;class BinaryCMapStream{constructor(e){this.buffer=e;this.pos=0;this.end=e.length;this.tmpBuf=new Uint8Array(19)}readByte(){return this.pos>=this.end?-1:this.buffer[this.pos++]}readNumber(){let e,t=0;do{const a=this.readByte();if(a<0)throw new r.FormatError("unexpected EOF in bcmap");e=!(128&a);t=t<<7|127&a}while(!e);return t}readSigned(){const e=this.readNumber();return 1&e?~(e>>>1):e>>>1}readHex(e,t){e.set(this.buffer.subarray(this.pos,this.pos+t+1));this.pos+=t+1}readHexNumber(e,t){let a;const n=this.tmpBuf;let i=0;do{const e=this.readByte();if(e<0)throw new r.FormatError("unexpected EOF in bcmap");a=!(128&e);n[i++]=127&e}while(!a);let s=t,o=0,c=0;for(;s>=0;){for(;c<8&&n.length>0;){o|=n[--i]<<c;c+=7}e[s]=255&o;s--;o>>=8;c-=8}}readHexSigned(e,t){this.readHexNumber(e,t);const a=1&e[t]?255:0;let r=0;for(let n=0;n<=t;n++){r=(1&r)<<8|e[n];e[n]=r>>1^a}}readString(){const e=this.readNumber();let t="";for(let a=0;a<e;a++)t+=String.fromCharCode(this.readNumber());return t}}return class BinaryCMapReader{async process(t,a,r){const n=new BinaryCMapStream(t),i=n.readByte();a.vertical=!!(1&i);let s=null;const o=new Uint8Array(e),c=new Uint8Array(e),l=new Uint8Array(e),h=new Uint8Array(e),u=new Uint8Array(e);let d,f;for(;(f=n.readByte())>=0;){const t=f>>5;if(7===t){switch(31&f){case 0:n.readString();break;case 1:s=n.readString()}continue}const r=!!(16&f),i=15&f;if(i+1>e)throw new Error("BinaryCMapReader.process: Invalid dataSize.");const g=1,p=n.readNumber();switch(t){case 0:n.readHex(o,i);n.readHexNumber(c,i);addHex(c,o,i);a.addCodespaceRange(i+1,hexToInt(o,i),hexToInt(c,i));for(let e=1;e<p;e++){incHex(c,i);n.readHexNumber(o,i);addHex(o,c,i);n.readHexNumber(c,i);addHex(c,o,i);a.addCodespaceRange(i+1,hexToInt(o,i),hexToInt(c,i))}break;case 1:n.readHex(o,i);n.readHexNumber(c,i);addHex(c,o,i);n.readNumber();for(let e=1;e<p;e++){incHex(c,i);n.readHexNumber(o,i);addHex(o,c,i);n.readHexNumber(c,i);addHex(c,o,i);n.readNumber()}break;case 2:n.readHex(l,i);d=n.readNumber();a.mapOne(hexToInt(l,i),d);for(let e=1;e<p;e++){incHex(l,i);if(!r){n.readHexNumber(u,i);addHex(l,u,i)}d=n.readSigned()+(d+1);a.mapOne(hexToInt(l,i),d)}break;case 3:n.readHex(o,i);n.readHexNumber(c,i);addHex(c,o,i);d=n.readNumber();a.mapCidRange(hexToInt(o,i),hexToInt(c,i),d);for(let e=1;e<p;e++){incHex(c,i);if(r)o.set(c);else{n.readHexNumber(o,i);addHex(o,c,i)}n.readHexNumber(c,i);addHex(c,o,i);d=n.readNumber();a.mapCidRange(hexToInt(o,i),hexToInt(c,i),d)}break;case 4:n.readHex(l,g);n.readHex(h,i);a.mapOne(hexToInt(l,g),hexToStr(h,i));for(let e=1;e<p;e++){incHex(l,g);if(!r){n.readHexNumber(u,g);addHex(l,u,g)}incHex(h,i);n.readHexSigned(u,i);addHex(h,u,i);a.mapOne(hexToInt(l,g),hexToStr(h,i))}break;case 5:n.readHex(o,g);n.readHexNumber(c,g);addHex(c,o,g);n.readHex(h,i);a.mapBfRange(hexToInt(o,g),hexToInt(c,g),hexToStr(h,i));for(let e=1;e<p;e++){incHex(c,g);if(r)o.set(c);else{n.readHexNumber(o,g);addHex(o,c,g)}n.readHexNumber(c,g);addHex(c,o,g);n.readHex(h,i);a.mapBfRange(hexToInt(o,g),hexToInt(c,g),hexToStr(h,i))}break;default:throw new Error(`BinaryCMapReader.process - unknown type: ${t}`)}}return s?r(s):a}}}(),d=function CMapFactoryClosure(){function strToInt(e){let t=0;for(let a=0;a<e.length;a++)t=t<<8|e.charCodeAt(a);return t>>>0}function expectString(e){if("string"!=typeof e)throw new r.FormatError("Malformed CMap: expected string.")}function expectInt(e){if(!Number.isInteger(e))throw new r.FormatError("Malformed CMap: expected int.")}function parseBfChar(e,t){for(;;){let a=t.getObj();if(a===n.EOF)break;if((0,n.isCmd)(a,"endbfchar"))return;expectString(a);const r=strToInt(a);a=t.getObj();expectString(a);const i=a;e.mapOne(r,i)}}function parseBfRange(e,t){for(;;){let a=t.getObj();if(a===n.EOF)break;if((0,n.isCmd)(a,"endbfrange"))return;expectString(a);const r=strToInt(a);a=t.getObj();expectString(a);const i=strToInt(a);a=t.getObj();if(Number.isInteger(a)||"string"==typeof a){const t=Number.isInteger(a)?String.fromCharCode(a):a;e.mapBfRange(r,i,t)}else{if(!(0,n.isCmd)(a,"["))break;{a=t.getObj();const s=[];for(;!(0,n.isCmd)(a,"]")&&a!==n.EOF;){s.push(a);a=t.getObj()}e.mapBfRangeToArray(r,i,s)}}}throw new r.FormatError("Invalid bf range.")}function parseCidChar(e,t){for(;;){let a=t.getObj();if(a===n.EOF)break;if((0,n.isCmd)(a,"endcidchar"))return;expectString(a);const r=strToInt(a);a=t.getObj();expectInt(a);const i=a;e.mapOne(r,i)}}function parseCidRange(e,t){for(;;){let a=t.getObj();if(a===n.EOF)break;if((0,n.isCmd)(a,"endcidrange"))return;expectString(a);const r=strToInt(a);a=t.getObj();expectString(a);const i=strToInt(a);a=t.getObj();expectInt(a);const s=a;e.mapCidRange(r,i,s)}}function parseCodespaceRange(e,t){for(;;){let a=t.getObj();if(a===n.EOF)break;if((0,n.isCmd)(a,"endcodespacerange"))return;if("string"!=typeof a)break;const r=strToInt(a);a=t.getObj();if("string"!=typeof a)break;const i=strToInt(a);e.addCodespaceRange(a.length,r,i)}throw new r.FormatError("Invalid codespace range.")}function parseWMode(e,t){const a=t.getObj();Number.isInteger(a)&&(e.vertical=!!a)}function parseCMapName(e,t){const a=t.getObj();a instanceof n.Name&&(e.name=a.name)}async function parseCMap(e,t,a,i){let s,c;e:for(;;)try{const a=t.getObj();if(a===n.EOF)break;if(a instanceof n.Name){"WMode"===a.name?parseWMode(e,t):"CMapName"===a.name&&parseCMapName(e,t);s=a}else if(a instanceof n.Cmd)switch(a.cmd){case"endcmap":break e;case"usecmap":s instanceof n.Name&&(c=s.name);break;case"begincodespacerange":parseCodespaceRange(e,t);break;case"beginbfchar":parseBfChar(e,t);break;case"begincidchar":parseCidChar(e,t);break;case"beginbfrange":parseBfRange(e,t);break;case"begincidrange":parseCidRange(e,t)}}catch(e){if(e instanceof o.MissingDataException)throw e;(0,r.warn)("Invalid cMap data: "+e);continue}!i&&c&&(i=c);return i?extendCMap(e,a,i):e}async function extendCMap(e,t,a){e.useCMap=await createBuiltInCMap(a,t);if(0===e.numCodespaceRanges){const t=e.useCMap.codespaceRanges;for(let a=0;a<t.length;a++)e.codespaceRanges[a]=t[a].slice();e.numCodespaceRanges=e.useCMap.numCodespaceRanges}e.useCMap.forEach((function(t,a){e.contains(t)||e.mapOne(t,e.useCMap.lookup(t))}));return e}async function createBuiltInCMap(e,t){if("Identity-H"===e)return new IdentityCMap(!1,2);if("Identity-V"===e)return new IdentityCMap(!0,2);if(!l.includes(e))throw new Error("Unknown CMap name: "+e);if(!t)throw new Error("Built-in CMap parameters are not provided.");const{cMapData:a,compressionType:n}=await t(e),i=new CMap(!0);if(n===r.CMapCompressionType.BINARY)return(new u).process(a,i,(e=>extendCMap(i,t,e)));if(n===r.CMapCompressionType.NONE){const e=new s.Lexer(new c.Stream(a));return parseCMap(i,e,t,null)}throw new Error(`Invalid CMap "compressionType" value: ${n}`)}return{async create(e){const t=e.encoding,a=e.fetchBuiltInCMap,r=e.useCMap;if(t instanceof n.Name)return createBuiltInCMap(t.name,a);if(t instanceof i.BaseStream){const e=await parseCMap(new CMap,new s.Lexer(t),a,r);return e.isIdentityCMap?createBuiltInCMap(e.name,a):e}throw new Error("Encoding required.")}}}();t.CMapFactory=d},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.Parser=t.Linearization=t.Lexer=void 0;var r=a(2),n=a(4),i=a(3),s=a(16),o=a(18),c=a(19),l=a(21),h=a(22),u=a(25),d=a(27),f=a(29),g=a(8),p=a(30),m=a(31);class Parser{constructor({lexer:e,xref:t,allowStreams:a=!1,recoveryMode:r=!1}){this.lexer=e;this.xref=t;this.allowStreams=a;this.recoveryMode=r;this.imageCache=Object.create(null);this._imageId=0;this.refill()}refill(){this.buf1=this.lexer.getObj();this.buf2=this.lexer.getObj()}shift(){if(this.buf2 instanceof n.Cmd&&"ID"===this.buf2.cmd){this.buf1=this.buf2;this.buf2=null}else{this.buf1=this.buf2;this.buf2=this.lexer.getObj()}}tryShift(){try{this.shift();return!0}catch(e){if(e instanceof i.MissingDataException)throw e;return!1}}getObj(e=null){const t=this.buf1;this.shift();if(t instanceof n.Cmd)switch(t.cmd){case"BI":return this.makeInlineImage(e);case"[":const a=[];for(;!(0,n.isCmd)(this.buf1,"]")&&this.buf1!==n.EOF;)a.push(this.getObj(e));if(this.buf1===n.EOF){if(this.recoveryMode)return a;throw new i.ParserEOFException("End of file inside array.")}this.shift();return a;case"<<":const s=new n.Dict(this.xref);for(;!(0,n.isCmd)(this.buf1,">>")&&this.buf1!==n.EOF;){if(!(this.buf1 instanceof n.Name)){(0,r.info)("Malformed dictionary: key must be a name object");this.shift();continue}const t=this.buf1.name;this.shift();if(this.buf1===n.EOF)break;s.set(t,this.getObj(e))}if(this.buf1===n.EOF){if(this.recoveryMode)return s;throw new i.ParserEOFException("End of file inside dictionary.")}if((0,n.isCmd)(this.buf2,"stream"))return this.allowStreams?this.makeStream(s,e):s;this.shift();return s;default:return t}if(Number.isInteger(t)){if(Number.isInteger(this.buf1)&&(0,n.isCmd)(this.buf2,"R")){const e=n.Ref.get(t,this.buf1);this.shift();this.shift();return e}return t}return"string"==typeof t&&e?e.decryptString(t):t}findDefaultInlineStreamEnd(e){const t=this.lexer,a=e.pos;let s,o,c=0;for(;-1!==(s=e.getByte());)if(0===c)c=69===s?1:0;else if(1===c)c=73===s?2:0;else if(32===s||10===s||13===s){o=e.pos;const a=e.peekBytes(10);for(let e=0,t=a.length;e<t;e++){s=a[e];if((0!==s||0===a[e+1])&&(10!==s&&13!==s&&(s<32||s>127))){c=0;break}}if(2!==c)continue;if(t.knownCommands){const e=t.peekObj();e instanceof n.Cmd&&!t.knownCommands[e.cmd]&&(c=0)}else(0,r.warn)("findDefaultInlineStreamEnd - `lexer.knownCommands` is undefined.");if(2===c)break}else c=0;if(-1===s){(0,r.warn)("findDefaultInlineStreamEnd: Reached the end of the stream without finding a valid EI marker");if(o){(0,r.warn)('... trying to recover by using the last "EI" occurrence.');e.skip(-(e.pos-o))}}let l=4;e.skip(-l);s=e.peekByte();e.skip(l);(0,i.isWhiteSpace)(s)||l--;return e.pos-l-a}findDCTDecodeInlineStreamEnd(e){const t=e.pos;let a,n,i=!1;for(;-1!==(a=e.getByte());)if(255===a){switch(e.getByte()){case 0:break;case 255:e.skip(-1);break;case 217:i=!0;break;case 192:case 193:case 194:case 195:case 197:case 198:case 199:case 201:case 202:case 203:case 205:case 206:case 207:case 196:case 204:case 218:case 219:case 220:case 221:case 222:case 223:case 224:case 225:case 226:case 227:case 228:case 229:case 230:case 231:case 232:case 233:case 234:case 235:case 236:case 237:case 238:case 239:case 254:n=e.getUint16();n>2?e.skip(n-2):e.skip(-2)}if(i)break}const s=e.pos-t;if(-1===a){(0,r.warn)("Inline DCTDecode image stream: EOI marker not found, searching for /EI/ instead.");e.skip(-s);return this.findDefaultInlineStreamEnd(e)}this.inlineStreamSkipEI(e);return s}findASCII85DecodeInlineStreamEnd(e){const t=e.pos;let a;for(;-1!==(a=e.getByte());)if(126===a){const t=e.pos;a=e.peekByte();for(;(0,i.isWhiteSpace)(a);){e.skip();a=e.peekByte()}if(62===a){e.skip();break}if(e.pos>t){const t=e.peekBytes(2);if(69===t[0]&&73===t[1])break}}const n=e.pos-t;if(-1===a){(0,r.warn)("Inline ASCII85Decode image stream: EOD marker not found, searching for /EI/ instead.");e.skip(-n);return this.findDefaultInlineStreamEnd(e)}this.inlineStreamSkipEI(e);return n}findASCIIHexDecodeInlineStreamEnd(e){const t=e.pos;let a;for(;-1!==(a=e.getByte())&&62!==a;);const n=e.pos-t;if(-1===a){(0,r.warn)("Inline ASCIIHexDecode image stream: EOD marker not found, searching for /EI/ instead.");e.skip(-n);return this.findDefaultInlineStreamEnd(e)}this.inlineStreamSkipEI(e);return n}inlineStreamSkipEI(e){let t,a=0;for(;-1!==(t=e.getByte());)if(0===a)a=69===t?1:0;else if(1===a)a=73===t?2:0;else if(2===a)break}makeInlineImage(e){const t=this.lexer,a=t.stream,i=Object.create(null);let s;for(;!(0,n.isCmd)(this.buf1,"ID")&&this.buf1!==n.EOF;){if(!(this.buf1 instanceof n.Name))throw new r.FormatError("Dictionary key must be a name object");const t=this.buf1.name;this.shift();if(this.buf1===n.EOF)break;i[t]=this.getObj(e)}-1!==t.beginInlineImagePos&&(s=a.pos-t.beginInlineImagePos);const o=this.xref.fetchIfRef(i.F||i.Filter);let c;if(o instanceof n.Name)c=o.name;else if(Array.isArray(o)){const e=this.xref.fetchIfRef(o[0]);e instanceof n.Name&&(c=e.name)}const l=a.pos;let h,u;switch(c){case"DCT":case"DCTDecode":h=this.findDCTDecodeInlineStreamEnd(a);break;case"A85":case"ASCII85Decode":h=this.findASCII85DecodeInlineStreamEnd(a);break;case"AHx":case"ASCIIHexDecode":h=this.findASCIIHexDecodeInlineStreamEnd(a);break;default:h=this.findDefaultInlineStreamEnd(a)}if(h<1e3&&s>0){const e=a.pos;a.pos=t.beginInlineImagePos;u=function getInlineImageCacheKey(e){const t=[],a=e.length;let r=0;for(;r<a-1;)t.push(e[r++]<<8|e[r++]);r<a&&t.push(e[r]);return a+"_"+String.fromCharCode.apply(null,t)}(a.getBytes(s+h));a.pos=e;const r=this.imageCache[u];if(void 0!==r){this.buf2=n.Cmd.get("EI");this.shift();r.reset();return r}}const d=new n.Dict(this.xref);for(const e in i)d.set(e,i[e]);let f=a.makeSubStream(l,h,d);e&&(f=e.createStream(f,h));f=this.filter(f,d,h);f.dict=d;if(void 0!==u){f.cacheKey="inline_img_"+ ++this._imageId;this.imageCache[u]=f}this.buf2=n.Cmd.get("EI");this.shift();return f}_findStreamLength(e,t){const{stream:a}=this.lexer;a.pos=e;const r=t.length;for(;a.pos<a.end;){const n=a.peekBytes(2048),i=n.length-r;if(i<=0)break;let s=0;for(;s<i;){let i=0;for(;i<r&&n[s+i]===t[i];)i++;if(i>=r){a.pos+=s;return a.pos-e}s++}a.pos+=i}return-1}makeStream(e,t){const a=this.lexer;let s=a.stream;a.skipToNextLine();const o=s.pos-1;let c=e.get("Length");if(!Number.isInteger(c)){(0,r.info)(`Bad length "${c&&c.toString()}" in stream.`);c=0}s.pos=o+c;a.nextChar();if(this.tryShift()&&(0,n.isCmd)(this.buf2,"endstream"))this.shift();else{const e=new Uint8Array([101,110,100,115,116,114,101,97,109]);let t=this._findStreamLength(o,e);if(t<0){const a=1;for(let n=1;n<=a;n++){const a=e.length-n,c=e.slice(0,a),l=this._findStreamLength(o,c);if(l>=0){const e=s.peekBytes(a+1)[a];if(!(0,i.isWhiteSpace)(e))break;(0,r.info)(`Found "${(0,r.bytesToString)(c)}" when searching for endstream command.`);t=l;break}}if(t<0)throw new r.FormatError("Missing endstream command.")}c=t;a.nextChar();this.shift();this.shift()}this.shift();s=s.makeSubStream(o,c,e);t&&(s=t.createStream(s,c));s=this.filter(s,e,c);s.dict=e;return s}filter(e,t,a){let i=t.get("F","Filter"),s=t.get("DP","DecodeParms");if(i instanceof n.Name){Array.isArray(s)&&(0,r.warn)("/DecodeParms should not be an Array, when /Filter is a Name.");return this.makeFilter(e,i.name,a,s)}let o=a;if(Array.isArray(i)){const t=i,a=s;for(let c=0,l=t.length;c<l;++c){i=this.xref.fetchIfRef(t[c]);if(!(i instanceof n.Name))throw new r.FormatError(`Bad filter name "${i}"`);s=null;Array.isArray(a)&&c in a&&(s=this.xref.fetchIfRef(a[c]));e=this.makeFilter(e,i.name,o,s);o=null}}return e}makeFilter(e,t,a,n){if(0===a){(0,r.warn)(`Empty "${t}" stream.`);return new g.NullStream}try{switch(t){case"Fl":case"FlateDecode":return n?new p.PredictorStream(new l.FlateStream(e,a),a,n):new l.FlateStream(e,a);case"LZW":case"LZWDecode":let t=1;if(n){n.has("EarlyChange")&&(t=n.get("EarlyChange"));return new p.PredictorStream(new f.LZWStream(e,a,t),a,n)}return new f.LZWStream(e,a,t);case"DCT":case"DCTDecode":return new u.JpegStream(e,a,n);case"JPX":case"JPXDecode":return new d.JpxStream(e,a,n);case"A85":case"ASCII85Decode":return new s.Ascii85Stream(e,a);case"AHx":case"ASCIIHexDecode":return new o.AsciiHexStream(e,a);case"CCF":case"CCITTFaxDecode":return new c.CCITTFaxStream(e,a,n);case"RL":case"RunLengthDecode":return new m.RunLengthStream(e,a);case"JBIG2Decode":return new h.Jbig2Stream(e,a,n)}(0,r.warn)(`Filter "${t}" is not supported.`);return e}catch(e){if(e instanceof i.MissingDataException)throw e;(0,r.warn)(`Invalid stream: "${e}"`);return new g.NullStream}}}t.Parser=Parser;const b=[1,0,0,0,0,0,0,0,0,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,2,0,0,2,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];function toHexDigit(e){return e>=48&&e<=57?15&e:e>=65&&e<=70||e>=97&&e<=102?9+(15&e):-1}class Lexer{constructor(e,t=null){this.stream=e;this.nextChar();this.strBuf=[];this.knownCommands=t;this._hexStringNumWarn=0;this.beginInlineImagePos=-1}nextChar(){return this.currentChar=this.stream.getByte()}peekChar(){return this.stream.peekByte()}getNumber(){let e=this.currentChar,t=!1,a=0,n=0;if(45===e){n=-1;e=this.nextChar();45===e&&(e=this.nextChar())}else if(43===e){n=1;e=this.nextChar()}if(10===e||13===e)do{e=this.nextChar()}while(10===e||13===e);if(46===e){a=10;e=this.nextChar()}if(e<48||e>57){const t=`Invalid number: ${String.fromCharCode(e)} (charCode ${e})`;if((0,i.isWhiteSpace)(e)||-1===e){(0,r.info)(`Lexer.getNumber - "${t}".`);return 0}throw new r.FormatError(t)}n=n||1;let s=e-48,o=0,c=1;for(;(e=this.nextChar())>=0;)if(e>=48&&e<=57){const r=e-48;if(t)o=10*o+r;else{0!==a&&(a*=10);s=10*s+r}}else if(46===e){if(0!==a)break;a=1}else if(45===e)(0,r.warn)("Badly formatted number: minus sign in the middle");else{if(69!==e&&101!==e)break;e=this.peekChar();if(43===e||45===e){c=45===e?-1:1;this.nextChar()}else if(e<48||e>57)break;t=!0}0!==a&&(s/=a);t&&(s*=10**(c*o));return n*s}getString(){let e=1,t=!1;const a=this.strBuf;a.length=0;let n=this.nextChar();for(;;){let i=!1;switch(0|n){case-1:(0,r.warn)("Unterminated string");t=!0;break;case 40:++e;a.push("(");break;case 41:if(0==--e){this.nextChar();t=!0}else a.push(")");break;case 92:n=this.nextChar();switch(n){case-1:(0,r.warn)("Unterminated string");t=!0;break;case 110:a.push("\n");break;case 114:a.push("\r");break;case 116:a.push("\t");break;case 98:a.push("\b");break;case 102:a.push("\f");break;case 92:case 40:case 41:a.push(String.fromCharCode(n));break;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:let e=15&n;n=this.nextChar();i=!0;if(n>=48&&n<=55){e=(e<<3)+(15&n);n=this.nextChar();if(n>=48&&n<=55){i=!1;e=(e<<3)+(15&n)}}a.push(String.fromCharCode(e));break;case 13:10===this.peekChar()&&this.nextChar();break;case 10:break;default:a.push(String.fromCharCode(n))}break;default:a.push(String.fromCharCode(n))}if(t)break;i||(n=this.nextChar())}return a.join("")}getName(){let e,t;const a=this.strBuf;a.length=0;for(;(e=this.nextChar())>=0&&!b[e];)if(35===e){e=this.nextChar();if(b[e]){(0,r.warn)("Lexer_getName: NUMBER SIGN (#) should be followed by a hexadecimal number.");a.push("#");break}const n=toHexDigit(e);if(-1!==n){t=e;e=this.nextChar();const i=toHexDigit(e);if(-1===i){(0,r.warn)(`Lexer_getName: Illegal digit (${String.fromCharCode(e)}) in hexadecimal number.`);a.push("#",String.fromCharCode(t));if(b[e])break;a.push(String.fromCharCode(e));continue}a.push(String.fromCharCode(n<<4|i))}else a.push("#",String.fromCharCode(e))}else a.push(String.fromCharCode(e));a.length>127&&(0,r.warn)(`Name token is longer than allowed by the spec: ${a.length}`);return n.Name.get(a.join(""))}_hexStringWarn(e){5!=this._hexStringNumWarn++?this._hexStringNumWarn>5||(0,r.warn)(`getHexString - ignoring invalid character: ${e}`):(0,r.warn)("getHexString - ignoring additional invalid characters.")}getHexString(){const e=this.strBuf;e.length=0;let t,a,n=this.currentChar,i=!0;this._hexStringNumWarn=0;for(;;){if(n<0){(0,r.warn)("Unterminated hex string");break}if(62===n){this.nextChar();break}if(1!==b[n]){if(i){t=toHexDigit(n);if(-1===t){this._hexStringWarn(n);n=this.nextChar();continue}}else{a=toHexDigit(n);if(-1===a){this._hexStringWarn(n);n=this.nextChar();continue}e.push(String.fromCharCode(t<<4|a))}i=!i;n=this.nextChar()}else n=this.nextChar()}return e.join("")}getObj(){let e=!1,t=this.currentChar;for(;;){if(t<0)return n.EOF;if(e)10!==t&&13!==t||(e=!1);else if(37===t)e=!0;else if(1!==b[t])break;t=this.nextChar()}switch(0|t){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 43:case 45:case 46:return this.getNumber();case 40:return this.getString();case 47:return this.getName();case 91:this.nextChar();return n.Cmd.get("[");case 93:this.nextChar();return n.Cmd.get("]");case 60:t=this.nextChar();if(60===t){this.nextChar();return n.Cmd.get("<<")}return this.getHexString();case 62:t=this.nextChar();if(62===t){this.nextChar();return n.Cmd.get(">>")}return n.Cmd.get(">");case 123:this.nextChar();return n.Cmd.get("{");case 125:this.nextChar();return n.Cmd.get("}");case 41:this.nextChar();throw new r.FormatError(`Illegal character: ${t}`)}let a=String.fromCharCode(t);if(t<32||t>127){const e=this.peekChar();if(e>=32&&e<=127){this.nextChar();return n.Cmd.get(a)}}const i=this.knownCommands;let s=i&&void 0!==i[a];for(;(t=this.nextChar())>=0&&!b[t];){const e=a+String.fromCharCode(t);if(s&&void 0===i[e])break;if(128===a.length)throw new r.FormatError(`Command token too long: ${a.length}`);a=e;s=i&&void 0!==i[a]}if("true"===a)return!0;if("false"===a)return!1;if("null"===a)return null;"BI"===a&&(this.beginInlineImagePos=this.stream.pos);return n.Cmd.get(a)}peekObj(){const e=this.stream.pos,t=this.currentChar,a=this.beginInlineImagePos;let n;try{n=this.getObj()}catch(e){if(e instanceof i.MissingDataException)throw e;(0,r.warn)(`peekObj: ${e}`)}this.stream.pos=e;this.currentChar=t;this.beginInlineImagePos=a;return n}skipToNextLine(){let e=this.currentChar;for(;e>=0;){if(13===e){e=this.nextChar();10===e&&this.nextChar();break}if(10===e){this.nextChar();break}e=this.nextChar()}}}t.Lexer=Lexer;t.Linearization=class Linearization{static create(e){function getInt(e,t,a=!1){const r=e.get(t);if(Number.isInteger(r)&&(a?r>=0:r>0))return r;throw new Error(`The "${t}" parameter in the linearization dictionary is invalid.`)}const t=new Parser({lexer:new Lexer(e),xref:null}),a=t.getObj(),r=t.getObj(),i=t.getObj(),s=t.getObj();let o,c;if(!(Number.isInteger(a)&&Number.isInteger(r)&&(0,n.isCmd)(i,"obj")&&s instanceof n.Dict&&"number"==typeof(o=s.get("Linearized"))&&o>0))return null;if((c=getInt(s,"L"))!==e.length)throw new Error('The "L" parameter in the linearization dictionary does not equal the stream length.');return{length:c,hints:function getHints(e){const t=e.get("H");let a;if(Array.isArray(t)&&(2===(a=t.length)||4===a)){for(let e=0;e<a;e++){const a=t[e];if(!(Number.isInteger(a)&&a>0))throw new Error(`Hint (${e}) in the linearization dictionary is invalid.`)}return t}throw new Error("Hint array in the linearization dictionary is invalid.")}(s),objectNumberFirst:getInt(s,"O"),endFirst:getInt(s,"E"),numPages:getInt(s,"N"),mainXRefEntriesOffset:getInt(s,"T"),pageFirst:s.has("P")?getInt(s,"P",!0):0}}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.Ascii85Stream=void 0;var r=a(17),n=a(3);class Ascii85Stream extends r.DecodeStream{constructor(e,t){t&&(t*=.8);super(t);this.str=e;this.dict=e.dict;this.input=new Uint8Array(5)}readBlock(){const e=this.str;let t=e.getByte();for(;(0,n.isWhiteSpace)(t);)t=e.getByte();if(-1===t||126===t){this.eof=!0;return}const a=this.bufferLength;let r,i;if(122===t){r=this.ensureBuffer(a+4);for(i=0;i<4;++i)r[a+i]=0;this.bufferLength+=4}else{const s=this.input;s[0]=t;for(i=1;i<5;++i){t=e.getByte();for(;(0,n.isWhiteSpace)(t);)t=e.getByte();s[i]=t;if(-1===t||126===t)break}r=this.ensureBuffer(a+i-1);this.bufferLength+=i-1;if(i<5){for(;i<5;++i)s[i]=117;this.eof=!0}let o=0;for(i=0;i<5;++i)o=85*o+(s[i]-33);for(i=3;i>=0;--i){r[a+i]=255&o;o>>=8}}}}t.Ascii85Stream=Ascii85Stream},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.StreamsSequenceStream=t.DecodeStream=void 0;var r=a(5),n=a(8);const i=new Uint8Array(0);class DecodeStream extends r.BaseStream{constructor(e){super();this._rawMinBufferLength=e||0;this.pos=0;this.bufferLength=0;this.eof=!1;this.buffer=i;this.minBufferLength=512;if(e)for(;this.minBufferLength<e;)this.minBufferLength*=2}get isEmpty(){for(;!this.eof&&0===this.bufferLength;)this.readBlock();return 0===this.bufferLength}ensureBuffer(e){const t=this.buffer;if(e<=t.byteLength)return t;let a=this.minBufferLength;for(;a<e;)a*=2;const r=new Uint8Array(a);r.set(t);return this.buffer=r}getByte(){const e=this.pos;for(;this.bufferLength<=e;){if(this.eof)return-1;this.readBlock()}return this.buffer[this.pos++]}getBytes(e){const t=this.pos;let a;if(e){this.ensureBuffer(t+e);a=t+e;for(;!this.eof&&this.bufferLength<a;)this.readBlock();const r=this.bufferLength;a>r&&(a=r)}else{for(;!this.eof;)this.readBlock();a=this.bufferLength}this.pos=a;return this.buffer.subarray(t,a)}reset(){this.pos=0}makeSubStream(e,t,a=null){if(void 0===t)for(;!this.eof;)this.readBlock();else{const a=e+t;for(;this.bufferLength<=a&&!this.eof;)this.readBlock()}return new n.Stream(this.buffer,e,t,a)}getBaseStreams(){return this.str?this.str.getBaseStreams():null}}t.DecodeStream=DecodeStream;t.StreamsSequenceStream=class StreamsSequenceStream extends DecodeStream{constructor(e,t=null){let a=0;for(const t of e)a+=t instanceof DecodeStream?t._rawMinBufferLength:t.length;super(a);this.streams=e;this._onError=t}readBlock(){const e=this.streams;if(0===e.length){this.eof=!0;return}const t=e.shift();let a;try{a=t.getBytes()}catch(e){if(this._onError){this._onError(e,t.dict&&t.dict.objId);return}throw e}const r=this.bufferLength,n=r+a.length;this.ensureBuffer(n).set(a,r);this.bufferLength=n}getBaseStreams(){const e=[];for(const t of this.streams){const a=t.getBaseStreams();a&&e.push(...a)}return e.length>0?e:null}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.AsciiHexStream=void 0;var r=a(17);class AsciiHexStream extends r.DecodeStream{constructor(e,t){t&&(t*=.5);super(t);this.str=e;this.dict=e.dict;this.firstDigit=-1}readBlock(){const e=this.str.getBytes(8e3);if(!e.length){this.eof=!0;return}const t=e.length+1>>1,a=this.ensureBuffer(this.bufferLength+t);let r=this.bufferLength,n=this.firstDigit;for(const t of e){let e;if(t>=48&&t<=57)e=15&t;else{if(!(t>=65&&t<=70||t>=97&&t<=102)){if(62===t){this.eof=!0;break}continue}e=9+(15&t)}if(n<0)n=e;else{a[r++]=n<<4|e;n=-1}}if(n>=0&&this.eof){a[r++]=n<<4;n=-1}this.firstDigit=n;this.bufferLength=r}}t.AsciiHexStream=AsciiHexStream},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.CCITTFaxStream=void 0;var r=a(20),n=a(17),i=a(4);class CCITTFaxStream extends n.DecodeStream{constructor(e,t,a){super(t);this.str=e;this.dict=e.dict;a instanceof i.Dict||(a=i.Dict.empty);const n={next:()=>e.getByte()};this.ccittFaxDecoder=new r.CCITTFaxDecoder(n,{K:a.get("K"),EndOfLine:a.get("EndOfLine"),EncodedByteAlign:a.get("EncodedByteAlign"),Columns:a.get("Columns"),Rows:a.get("Rows"),EndOfBlock:a.get("EndOfBlock"),BlackIs1:a.get("BlackIs1")})}readBlock(){for(;!this.eof;){const e=this.ccittFaxDecoder.readNextChar();if(-1===e){this.eof=!0;return}this.ensureBuffer(this.bufferLength+1);this.buffer[this.bufferLength++]=e}}}t.CCITTFaxStream=CCITTFaxStream},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.CCITTFaxDecoder=void 0;var r=a(2);const n=-1,i=[[-1,-1],[-1,-1],[7,8],[7,7],[6,6],[6,6],[6,5],[6,5],[4,0],[4,0],[4,0],[4,0],[4,0],[4,0],[4,0],[4,0],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2]],s=[[-1,-1],[12,-2],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[11,1792],[11,1792],[12,1984],[12,2048],[12,2112],[12,2176],[12,2240],[12,2304],[11,1856],[11,1856],[11,1920],[11,1920],[12,2368],[12,2432],[12,2496],[12,2560]],o=[[-1,-1],[-1,-1],[-1,-1],[-1,-1],[8,29],[8,29],[8,30],[8,30],[8,45],[8,45],[8,46],[8,46],[7,22],[7,22],[7,22],[7,22],[7,23],[7,23],[7,23],[7,23],[8,47],[8,47],[8,48],[8,48],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[7,20],[7,20],[7,20],[7,20],[8,33],[8,33],[8,34],[8,34],[8,35],[8,35],[8,36],[8,36],[8,37],[8,37],[8,38],[8,38],[7,19],[7,19],[7,19],[7,19],[8,31],[8,31],[8,32],[8,32],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[8,53],[8,53],[8,54],[8,54],[7,26],[7,26],[7,26],[7,26],[8,39],[8,39],[8,40],[8,40],[8,41],[8,41],[8,42],[8,42],[8,43],[8,43],[8,44],[8,44],[7,21],[7,21],[7,21],[7,21],[7,28],[7,28],[7,28],[7,28],[8,61],[8,61],[8,62],[8,62],[8,63],[8,63],[8,0],[8,0],[8,320],[8,320],[8,384],[8,384],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[7,27],[7,27],[7,27],[7,27],[8,59],[8,59],[8,60],[8,60],[9,1472],[9,1536],[9,1600],[9,1728],[7,18],[7,18],[7,18],[7,18],[7,24],[7,24],[7,24],[7,24],[8,49],[8,49],[8,50],[8,50],[8,51],[8,51],[8,52],[8,52],[7,25],[7,25],[7,25],[7,25],[8,55],[8,55],[8,56],[8,56],[8,57],[8,57],[8,58],[8,58],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[8,448],[8,448],[8,512],[8,512],[9,704],[9,768],[8,640],[8,640],[8,576],[8,576],[9,832],[9,896],[9,960],[9,1024],[9,1088],[9,1152],[9,1216],[9,1280],[9,1344],[9,1408],[7,256],[7,256],[7,256],[7,256],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7]],c=[[-1,-1],[-1,-1],[12,-2],[12,-2],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[11,1792],[11,1792],[11,1792],[11,1792],[12,1984],[12,1984],[12,2048],[12,2048],[12,2112],[12,2112],[12,2176],[12,2176],[12,2240],[12,2240],[12,2304],[12,2304],[11,1856],[11,1856],[11,1856],[11,1856],[11,1920],[11,1920],[11,1920],[11,1920],[12,2368],[12,2368],[12,2432],[12,2432],[12,2496],[12,2496],[12,2560],[12,2560],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[12,52],[12,52],[13,640],[13,704],[13,768],[13,832],[12,55],[12,55],[12,56],[12,56],[13,1280],[13,1344],[13,1408],[13,1472],[12,59],[12,59],[12,60],[12,60],[13,1536],[13,1600],[11,24],[11,24],[11,24],[11,24],[11,25],[11,25],[11,25],[11,25],[13,1664],[13,1728],[12,320],[12,320],[12,384],[12,384],[12,448],[12,448],[13,512],[13,576],[12,53],[12,53],[12,54],[12,54],[13,896],[13,960],[13,1024],[13,1088],[13,1152],[13,1216],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64]],l=[[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[11,23],[11,23],[12,50],[12,51],[12,44],[12,45],[12,46],[12,47],[12,57],[12,58],[12,61],[12,256],[10,16],[10,16],[10,16],[10,16],[10,17],[10,17],[10,17],[10,17],[12,48],[12,49],[12,62],[12,63],[12,30],[12,31],[12,32],[12,33],[12,40],[12,41],[11,22],[11,22],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[12,128],[12,192],[12,26],[12,27],[12,28],[12,29],[11,19],[11,19],[11,20],[11,20],[12,34],[12,35],[12,36],[12,37],[12,38],[12,39],[11,21],[11,21],[12,42],[12,43],[10,0],[10,0],[10,0],[10,0],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12]],h=[[-1,-1],[-1,-1],[-1,-1],[-1,-1],[6,9],[6,8],[5,7],[5,7],[4,6],[4,6],[4,6],[4,6],[4,5],[4,5],[4,5],[4,5],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2]];t.CCITTFaxDecoder=class CCITTFaxDecoder{constructor(e,t={}){if(!e||"function"!=typeof e.next)throw new Error('CCITTFaxDecoder - invalid "source" parameter.');this.source=e;this.eof=!1;this.encoding=t.K||0;this.eoline=t.EndOfLine||!1;this.byteAlign=t.EncodedByteAlign||!1;this.columns=t.Columns||1728;this.rows=t.Rows||0;let a,r=t.EndOfBlock;null==r&&(r=!0);this.eoblock=r;this.black=t.BlackIs1||!1;this.codingLine=new Uint32Array(this.columns+1);this.refLine=new Uint32Array(this.columns+2);this.codingLine[0]=this.columns;this.codingPos=0;this.row=0;this.nextLine2D=this.encoding<0;this.inputBits=0;this.inputBuf=0;this.outputBits=0;this.rowsDone=!1;for(;0===(a=this._lookBits(12));)this._eatBits(1);1===a&&this._eatBits(12);if(this.encoding>0){this.nextLine2D=!this._lookBits(1);this._eatBits(1)}}readNextChar(){if(this.eof)return-1;const e=this.refLine,t=this.codingLine,a=this.columns;let i,s,o,c,l;if(0===this.outputBits){this.rowsDone&&(this.eof=!0);if(this.eof)return-1;this.err=!1;let o,l,h;if(this.nextLine2D){for(c=0;t[c]<a;++c)e[c]=t[c];e[c++]=a;e[c]=a;t[0]=0;this.codingPos=0;i=0;s=0;for(;t[this.codingPos]<a;){o=this._getTwoDimCode();switch(o){case 0:this._addPixels(e[i+1],s);e[i+1]<a&&(i+=2);break;case 1:o=l=0;if(s){do{o+=h=this._getBlackCode()}while(h>=64);do{l+=h=this._getWhiteCode()}while(h>=64)}else{do{o+=h=this._getWhiteCode()}while(h>=64);do{l+=h=this._getBlackCode()}while(h>=64)}this._addPixels(t[this.codingPos]+o,s);t[this.codingPos]<a&&this._addPixels(t[this.codingPos]+l,1^s);for(;e[i]<=t[this.codingPos]&&e[i]<a;)i+=2;break;case 7:this._addPixels(e[i]+3,s);s^=1;if(t[this.codingPos]<a){++i;for(;e[i]<=t[this.codingPos]&&e[i]<a;)i+=2}break;case 5:this._addPixels(e[i]+2,s);s^=1;if(t[this.codingPos]<a){++i;for(;e[i]<=t[this.codingPos]&&e[i]<a;)i+=2}break;case 3:this._addPixels(e[i]+1,s);s^=1;if(t[this.codingPos]<a){++i;for(;e[i]<=t[this.codingPos]&&e[i]<a;)i+=2}break;case 2:this._addPixels(e[i],s);s^=1;if(t[this.codingPos]<a){++i;for(;e[i]<=t[this.codingPos]&&e[i]<a;)i+=2}break;case 8:this._addPixelsNeg(e[i]-3,s);s^=1;if(t[this.codingPos]<a){i>0?--i:++i;for(;e[i]<=t[this.codingPos]&&e[i]<a;)i+=2}break;case 6:this._addPixelsNeg(e[i]-2,s);s^=1;if(t[this.codingPos]<a){i>0?--i:++i;for(;e[i]<=t[this.codingPos]&&e[i]<a;)i+=2}break;case 4:this._addPixelsNeg(e[i]-1,s);s^=1;if(t[this.codingPos]<a){i>0?--i:++i;for(;e[i]<=t[this.codingPos]&&e[i]<a;)i+=2}break;case n:this._addPixels(a,0);this.eof=!0;break;default:(0,r.info)("bad 2d code");this._addPixels(a,0);this.err=!0}}}else{t[0]=0;this.codingPos=0;s=0;for(;t[this.codingPos]<a;){o=0;if(s)do{o+=h=this._getBlackCode()}while(h>=64);else do{o+=h=this._getWhiteCode()}while(h>=64);this._addPixels(t[this.codingPos]+o,s);s^=1}}let u=!1;this.byteAlign&&(this.inputBits&=-8);if(this.eoblock||this.row!==this.rows-1){o=this._lookBits(12);if(this.eoline)for(;o!==n&&1!==o;){this._eatBits(1);o=this._lookBits(12)}else for(;0===o;){this._eatBits(1);o=this._lookBits(12)}if(1===o){this._eatBits(12);u=!0}else o===n&&(this.eof=!0)}else this.rowsDone=!0;if(!this.eof&&this.encoding>0&&!this.rowsDone){this.nextLine2D=!this._lookBits(1);this._eatBits(1)}if(this.eoblock&&u&&this.byteAlign){o=this._lookBits(12);if(1===o){this._eatBits(12);if(this.encoding>0){this._lookBits(1);this._eatBits(1)}if(this.encoding>=0)for(c=0;c<4;++c){o=this._lookBits(12);1!==o&&(0,r.info)("bad rtc code: "+o);this._eatBits(12);if(this.encoding>0){this._lookBits(1);this._eatBits(1)}}this.eof=!0}}else if(this.err&&this.eoline){for(;;){o=this._lookBits(13);if(o===n){this.eof=!0;return-1}if(o>>1==1)break;this._eatBits(1)}this._eatBits(12);if(this.encoding>0){this._eatBits(1);this.nextLine2D=!(1&o)}}t[0]>0?this.outputBits=t[this.codingPos=0]:this.outputBits=t[this.codingPos=1];this.row++}if(this.outputBits>=8){l=1&this.codingPos?0:255;this.outputBits-=8;if(0===this.outputBits&&t[this.codingPos]<a){this.codingPos++;this.outputBits=t[this.codingPos]-t[this.codingPos-1]}}else{o=8;l=0;do{if("number"!=typeof this.outputBits)throw new r.FormatError('Invalid /CCITTFaxDecode data, "outputBits" must be a number.');if(this.outputBits>o){l<<=o;1&this.codingPos||(l|=255>>8-o);this.outputBits-=o;o=0}else{l<<=this.outputBits;1&this.codingPos||(l|=255>>8-this.outputBits);o-=this.outputBits;this.outputBits=0;if(t[this.codingPos]<a){this.codingPos++;this.outputBits=t[this.codingPos]-t[this.codingPos-1]}else if(o>0){l<<=o;o=0}}}while(o)}this.black&&(l^=255);return l}_addPixels(e,t){const a=this.codingLine;let n=this.codingPos;if(e>a[n]){if(e>this.columns){(0,r.info)("row is wrong length");this.err=!0;e=this.columns}1&n^t&&++n;a[n]=e}this.codingPos=n}_addPixelsNeg(e,t){const a=this.codingLine;let n=this.codingPos;if(e>a[n]){if(e>this.columns){(0,r.info)("row is wrong length");this.err=!0;e=this.columns}1&n^t&&++n;a[n]=e}else if(e<a[n]){if(e<0){(0,r.info)("invalid code");this.err=!0;e=0}for(;n>0&&e<a[n-1];)--n;a[n]=e}this.codingPos=n}_findTableCode(e,t,a,r){const i=r||0;for(let r=e;r<=t;++r){let e=this._lookBits(r);if(e===n)return[!0,1,!1];r<t&&(e<<=t-r);if(!i||e>=i){const t=a[e-i];if(t[0]===r){this._eatBits(r);return[!0,t[1],!0]}}}return[!1,0,!1]}_getTwoDimCode(){let e,t=0;if(this.eoblock){t=this._lookBits(7);e=i[t];if(e&&e[0]>0){this._eatBits(e[0]);return e[1]}}else{const e=this._findTableCode(1,7,i);if(e[0]&&e[2])return e[1]}(0,r.info)("Bad two dim code");return n}_getWhiteCode(){let e,t=0;if(this.eoblock){t=this._lookBits(12);if(t===n)return 1;e=t>>5==0?s[t]:o[t>>3];if(e[0]>0){this._eatBits(e[0]);return e[1]}}else{let e=this._findTableCode(1,9,o);if(e[0])return e[1];e=this._findTableCode(11,12,s);if(e[0])return e[1]}(0,r.info)("bad white code");this._eatBits(1);return 1}_getBlackCode(){let e,t;if(this.eoblock){e=this._lookBits(13);if(e===n)return 1;t=e>>7==0?c[e]:e>>9==0&&e>>7!=0?l[(e>>1)-64]:h[e>>7];if(t[0]>0){this._eatBits(t[0]);return t[1]}}else{let e=this._findTableCode(2,6,h);if(e[0])return e[1];e=this._findTableCode(7,12,l,64);if(e[0])return e[1];e=this._findTableCode(10,13,c);if(e[0])return e[1]}(0,r.info)("bad black code");this._eatBits(1);return 1}_lookBits(e){let t;for(;this.inputBits<e;){if(-1===(t=this.source.next()))return 0===this.inputBits?n:this.inputBuf<<e-this.inputBits&65535>>16-e;this.inputBuf=this.inputBuf<<8|t;this.inputBits+=8}return this.inputBuf>>this.inputBits-e&65535>>16-e}_eatBits(e){(this.inputBits-=e)<0&&(this.inputBits=0)}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.FlateStream=void 0;var r=a(17),n=a(2);const i=new Int32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=new Int32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),o=new Int32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),c=[new Int32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],l=[new Int32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5];class FlateStream extends r.DecodeStream{constructor(e,t){super(t);this.str=e;this.dict=e.dict;const a=e.getByte(),r=e.getByte();if(-1===a||-1===r)throw new n.FormatError(`Invalid header in flate stream: ${a}, ${r}`);if(8!=(15&a))throw new n.FormatError(`Unknown compression method in flate stream: ${a}, ${r}`);if(((a<<8)+r)%31!=0)throw new n.FormatError(`Bad FCHECK in flate stream: ${a}, ${r}`);if(32&r)throw new n.FormatError(`FDICT bit set in flate stream: ${a}, ${r}`);this.codeSize=0;this.codeBuf=0}getBits(e){const t=this.str;let a,r=this.codeSize,i=this.codeBuf;for(;r<e;){if(-1===(a=t.getByte()))throw new n.FormatError("Bad encoding in flate stream");i|=a<<r;r+=8}a=i&(1<<e)-1;this.codeBuf=i>>e;this.codeSize=r-=e;return a}getCode(e){const t=this.str,a=e[0],r=e[1];let i,s=this.codeSize,o=this.codeBuf;for(;s<r&&-1!==(i=t.getByte());){o|=i<<s;s+=8}const c=a[o&(1<<r)-1],l=c>>16,h=65535&c;if(l<1||s<l)throw new n.FormatError("Bad encoding in flate stream");this.codeBuf=o>>l;this.codeSize=s-l;return h}generateHuffmanTable(e){const t=e.length;let a,r=0;for(a=0;a<t;++a)e[a]>r&&(r=e[a]);const n=1<<r,i=new Int32Array(n);for(let s=1,o=0,c=2;s<=r;++s,o<<=1,c<<=1)for(let r=0;r<t;++r)if(e[r]===s){let e=0,t=o;for(a=0;a<s;++a){e=e<<1|1&t;t>>=1}for(a=e;a<n;a+=c)i[a]=s<<16|r;++o}return[i,r]}readBlock(){let e,t;const a=this.str;let r,h,u=this.getBits(3);1&u&&(this.eof=!0);u>>=1;if(0===u){let t;if(-1===(t=a.getByte()))throw new n.FormatError("Bad block header in flate stream");let r=t;if(-1===(t=a.getByte()))throw new n.FormatError("Bad block header in flate stream");r|=t<<8;if(-1===(t=a.getByte()))throw new n.FormatError("Bad block header in flate stream");let i=t;if(-1===(t=a.getByte()))throw new n.FormatError("Bad block header in flate stream");i|=t<<8;if(i!==(65535&~r)&&(0!==r||0!==i))throw new n.FormatError("Bad uncompressed block length in flate stream");this.codeBuf=0;this.codeSize=0;const s=this.bufferLength,o=s+r;e=this.ensureBuffer(o);this.bufferLength=o;if(0===r)-1===a.peekByte()&&(this.eof=!0);else{const t=a.getBytes(r);e.set(t,s);t.length<r&&(this.eof=!0)}return}if(1===u){r=c;h=l}else{if(2!==u)throw new n.FormatError("Unknown block type in flate stream");{const e=this.getBits(5)+257,a=this.getBits(5)+1,n=this.getBits(4)+4,s=new Uint8Array(i.length);let o;for(o=0;o<n;++o)s[i[o]]=this.getBits(3);const c=this.generateHuffmanTable(s);t=0;o=0;const l=e+a,u=new Uint8Array(l);let d,f,g;for(;o<l;){const e=this.getCode(c);if(16===e){d=2;f=3;g=t}else if(17===e){d=3;f=3;g=t=0}else{if(18!==e){u[o++]=t=e;continue}d=7;f=11;g=t=0}let a=this.getBits(d)+f;for(;a-- >0;)u[o++]=g}r=this.generateHuffmanTable(u.subarray(0,e));h=this.generateHuffmanTable(u.subarray(e,l))}}e=this.buffer;let d=e?e.length:0,f=this.bufferLength;for(;;){let a=this.getCode(r);if(a<256){if(f+1>=d){e=this.ensureBuffer(f+1);d=e.length}e[f++]=a;continue}if(256===a){this.bufferLength=f;return}a-=257;a=s[a];let n=a>>16;n>0&&(n=this.getBits(n));t=(65535&a)+n;a=this.getCode(h);a=o[a];n=a>>16;n>0&&(n=this.getBits(n));const i=(65535&a)+n;if(f+t>=d){e=this.ensureBuffer(f+t);d=e.length}for(let a=0;a<t;++a,++f)e[f]=e[f-i]}}}t.FlateStream=FlateStream},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.Jbig2Stream=void 0;var r=a(5),n=a(17),i=a(4),s=a(23),o=a(2);class Jbig2Stream extends n.DecodeStream{constructor(e,t,a){super(t);this.stream=e;this.dict=e.dict;this.maybeLength=t;this.params=a}get bytes(){return(0,o.shadow)(this,"bytes",this.stream.getBytes(this.maybeLength))}ensureBuffer(e){}readBlock(){if(this.eof)return;const e=new s.Jbig2Image,t=[];if(this.params instanceof i.Dict){const e=this.params.get("JBIG2Globals");if(e instanceof r.BaseStream){const a=e.getBytes();t.push({data:a,start:0,end:a.length})}}t.push({data:this.bytes,start:0,end:this.bytes.length});const a=e.parseChunks(t),n=a.length;for(let e=0;e<n;e++)a[e]^=255;this.buffer=a;this.bufferLength=n;this.eof=!0}}t.Jbig2Stream=Jbig2Stream},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.Jbig2Image=void 0;var r=a(2),n=a(3),i=a(24),s=a(20);class Jbig2Error extends r.BaseException{constructor(e){super(`JBIG2 error: ${e}`,"Jbig2Error")}}class ContextCache{getContexts(e){return e in this?this[e]:this[e]=new Int8Array(65536)}}class DecodingContext{constructor(e,t,a){this.data=e;this.start=t;this.end=a}get decoder(){const e=new i.ArithmeticDecoder(this.data,this.start,this.end);return(0,r.shadow)(this,"decoder",e)}get contextCache(){const e=new ContextCache;return(0,r.shadow)(this,"contextCache",e)}}const o=2**31-1,c=-(2**31);function decodeInteger(e,t,a){const r=e.getContexts(t);let n=1;function readBits(e){let t=0;for(let i=0;i<e;i++){const e=a.readBit(r,n);n=n<256?n<<1|e:511&(n<<1|e)|256;t=t<<1|e}return t>>>0}const i=readBits(1),s=readBits(1)?readBits(1)?readBits(1)?readBits(1)?readBits(1)?readBits(32)+4436:readBits(12)+340:readBits(8)+84:readBits(6)+20:readBits(4)+4:readBits(2);let l;0===i?l=s:s>0&&(l=-s);return l>=c&&l<=o?l:null}function decodeIAID(e,t,a){const r=e.getContexts("IAID");let n=1;for(let e=0;e<a;e++){n=n<<1|t.readBit(r,n)}return a<31?n&(1<<a)-1:2147483647&n}const l=["SymbolDictionary",null,null,null,"IntermediateTextRegion",null,"ImmediateTextRegion","ImmediateLosslessTextRegion",null,null,null,null,null,null,null,null,"PatternDictionary",null,null,null,"IntermediateHalftoneRegion",null,"ImmediateHalftoneRegion","ImmediateLosslessHalftoneRegion",null,null,null,null,null,null,null,null,null,null,null,null,"IntermediateGenericRegion",null,"ImmediateGenericRegion","ImmediateLosslessGenericRegion","IntermediateGenericRefinementRegion",null,"ImmediateGenericRefinementRegion","ImmediateLosslessGenericRefinementRegion",null,null,null,null,"PageInformation","EndOfPage","EndOfStripe","EndOfFile","Profiles","Tables",null,null,null,null,null,null,null,null,"Extension"],h=[[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:2,y:-1},{x:-4,y:0},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}],[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:2,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:2,y:-1},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}],[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-2,y:0},{x:-1,y:0}],[{x:-3,y:-1},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-4,y:0},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}]],u=[{coding:[{x:0,y:-1},{x:1,y:-1},{x:-1,y:0}],reference:[{x:0,y:-1},{x:1,y:-1},{x:-1,y:0},{x:0,y:0},{x:1,y:0},{x:-1,y:1},{x:0,y:1},{x:1,y:1}]},{coding:[{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-1,y:0}],reference:[{x:0,y:-1},{x:-1,y:0},{x:0,y:0},{x:1,y:0},{x:0,y:1},{x:1,y:1}]}],d=[39717,1941,229,405],f=[32,8];function decodeBitmap(e,t,a,r,n,i,s,o){if(e){return decodeMMRBitmap(new Reader(o.data,o.start,o.end),t,a,!1)}if(0===r&&!i&&!n&&4===s.length&&3===s[0].x&&-1===s[0].y&&-3===s[1].x&&-1===s[1].y&&2===s[2].x&&-2===s[2].y&&-2===s[3].x&&-2===s[3].y)return function decodeBitmapTemplate0(e,t,a){const r=a.decoder,n=a.contextCache.getContexts("GB"),i=[];let s,o,c,l,h,u,d;for(o=0;o<t;o++){h=i[o]=new Uint8Array(e);u=o<1?h:i[o-1];d=o<2?h:i[o-2];s=d[0]<<13|d[1]<<12|d[2]<<11|u[0]<<7|u[1]<<6|u[2]<<5|u[3]<<4;for(c=0;c<e;c++){h[c]=l=r.readBit(n,s);s=(31735&s)<<1|(c+3<e?d[c+3]<<11:0)|(c+4<e?u[c+4]<<4:0)|l}}return i}(t,a,o);const c=!!i,l=h[r].concat(s);l.sort((function(e,t){return e.y-t.y||e.x-t.x}));const u=l.length,f=new Int8Array(u),g=new Int8Array(u),p=[];let m,b,y=0,w=0,S=0,x=0;for(b=0;b<u;b++){f[b]=l[b].x;g[b]=l[b].y;w=Math.min(w,l[b].x);S=Math.max(S,l[b].x);x=Math.min(x,l[b].y);b<u-1&&l[b].y===l[b+1].y&&l[b].x===l[b+1].x-1?y|=1<<u-1-b:p.push(b)}const C=p.length,k=new Int8Array(C),v=new Int8Array(C),F=new Uint16Array(C);for(m=0;m<C;m++){b=p[m];k[m]=l[b].x;v[m]=l[b].y;F[m]=1<<u-1-b}const O=-w,T=-x,M=t-S,E=d[r];let D=new Uint8Array(t);const N=[],R=o.decoder,L=o.contextCache.getContexts("GB");let j,$,_,U,X,H=0,q=0;for(let e=0;e<a;e++){if(n){H^=R.readBit(L,E);if(H){N.push(D);continue}}D=new Uint8Array(D);N.push(D);for(j=0;j<t;j++){if(c&&i[e][j]){D[j]=0;continue}if(j>=O&&j<M&&e>=T){q=q<<1&y;for(b=0;b<C;b++){$=e+v[b];_=j+k[b];U=N[$][_];if(U){U=F[b];q|=U}}}else{q=0;X=u-1;for(b=0;b<u;b++,X--){_=j+f[b];if(_>=0&&_<t){$=e+g[b];if($>=0){U=N[$][_];U&&(q|=U<<X)}}}}const a=R.readBit(L,q);D[j]=a}}return N}function decodeRefinement(e,t,a,r,n,i,s,o,c){let l=u[a].coding;0===a&&(l=l.concat([o[0]]));const h=l.length,d=new Int32Array(h),g=new Int32Array(h);let p;for(p=0;p<h;p++){d[p]=l[p].x;g[p]=l[p].y}let m=u[a].reference;0===a&&(m=m.concat([o[1]]));const b=m.length,y=new Int32Array(b),w=new Int32Array(b);for(p=0;p<b;p++){y[p]=m[p].x;w[p]=m[p].y}const S=r[0].length,x=r.length,C=f[a],k=[],v=c.decoder,F=c.contextCache.getContexts("GR");let O=0;for(let a=0;a<t;a++){if(s){O^=v.readBit(F,C);if(O)throw new Jbig2Error("prediction is not supported")}const t=new Uint8Array(e);k.push(t);for(let s=0;s<e;s++){let o,c,l=0;for(p=0;p<h;p++){o=a+g[p];c=s+d[p];o<0||c<0||c>=e?l<<=1:l=l<<1|k[o][c]}for(p=0;p<b;p++){o=a+w[p]-i;c=s+y[p]-n;o<0||o>=x||c<0||c>=S?l<<=1:l=l<<1|r[o][c]}const u=v.readBit(F,l);t[s]=u}}return k}function decodeTextRegion(e,t,a,r,n,i,s,o,c,l,h,u,d,f,g,p,m,b,y){if(e&&t)throw new Jbig2Error("refinement with Huffman is not supported");const w=[];let S,x;for(S=0;S<r;S++){x=new Uint8Array(a);if(n)for(let e=0;e<a;e++)x[e]=n;w.push(x)}const C=m.decoder,k=m.contextCache;let v=e?-f.tableDeltaT.decode(y):-decodeInteger(k,"IADT",C),F=0;S=0;for(;S<i;){v+=e?f.tableDeltaT.decode(y):decodeInteger(k,"IADT",C);F+=e?f.tableFirstS.decode(y):decodeInteger(k,"IAFS",C);let r=F;for(;;){let n=0;s>1&&(n=e?y.readBits(b):decodeInteger(k,"IAIT",C));const i=s*v+n,F=e?f.symbolIDTable.decode(y):decodeIAID(k,C,c),O=t&&(e?y.readBit():decodeInteger(k,"IARI",C));let T=o[F],M=T[0].length,E=T.length;if(O){const e=decodeInteger(k,"IARDW",C),t=decodeInteger(k,"IARDH",C);M+=e;E+=t;T=decodeRefinement(M,E,g,T,(e>>1)+decodeInteger(k,"IARDX",C),(t>>1)+decodeInteger(k,"IARDY",C),!1,p,m)}const D=i-(1&u?0:E-1),N=r-(2&u?M-1:0);let R,L,j;if(l){for(R=0;R<E;R++){x=w[N+R];if(!x)continue;j=T[R];const e=Math.min(a-D,M);switch(d){case 0:for(L=0;L<e;L++)x[D+L]|=j[L];break;case 2:for(L=0;L<e;L++)x[D+L]^=j[L];break;default:throw new Jbig2Error(`operator ${d} is not supported`)}}r+=E-1}else{for(L=0;L<E;L++){x=w[D+L];if(x){j=T[L];switch(d){case 0:for(R=0;R<M;R++)x[N+R]|=j[R];break;case 2:for(R=0;R<M;R++)x[N+R]^=j[R];break;default:throw new Jbig2Error(`operator ${d} is not supported`)}}}r+=M-1}S++;const $=e?f.tableDeltaS.decode(y):decodeInteger(k,"IADS",C);if(null===$)break;r+=$+h}}return w}function readSegmentHeader(e,t){const a={};a.number=(0,n.readUint32)(e,t);const r=e[t+4],i=63&r;if(!l[i])throw new Jbig2Error("invalid segment type: "+i);a.type=i;a.typeName=l[i];a.deferredNonRetain=!!(128&r);const s=!!(64&r),o=e[t+5];let c=o>>5&7;const h=[31&o];let u=t+6;if(7===o){c=536870911&(0,n.readUint32)(e,u-1);u+=3;let t=c+7>>3;h[0]=e[u++];for(;--t>0;)h.push(e[u++])}else if(5===o||6===o)throw new Jbig2Error("invalid referred-to flags");a.retainBits=h;let d=4;a.number<=256?d=1:a.number<=65536&&(d=2);const f=[];let p,m;for(p=0;p<c;p++){let t;t=1===d?e[u]:2===d?(0,n.readUint16)(e,u):(0,n.readUint32)(e,u);f.push(t);u+=d}a.referredTo=f;if(s){a.pageAssociation=(0,n.readUint32)(e,u);u+=4}else a.pageAssociation=e[u++];a.length=(0,n.readUint32)(e,u);u+=4;if(4294967295===a.length){if(38!==i)throw new Jbig2Error("invalid unknown segment length");{const t=readRegionSegmentInformation(e,u),r=!!(1&e[u+g]),n=6,i=new Uint8Array(n);if(!r){i[0]=255;i[1]=172}i[2]=t.height>>>24&255;i[3]=t.height>>16&255;i[4]=t.height>>8&255;i[5]=255&t.height;for(p=u,m=e.length;p<m;p++){let t=0;for(;t<n&&i[t]===e[p+t];)t++;if(t===n){a.length=p+n;break}}if(4294967295===a.length)throw new Jbig2Error("segment end was not found")}}a.headerEnd=u;return a}function readSegments(e,t,a,r){const n=[];let i=a;for(;i<r;){const a=readSegmentHeader(t,i);i=a.headerEnd;const r={header:a,data:t};if(!e.randomAccess){r.start=i;i+=a.length;r.end=i}n.push(r);if(51===a.type)break}if(e.randomAccess)for(let e=0,t=n.length;e<t;e++){n[e].start=i;i+=n[e].header.length;n[e].end=i}return n}function readRegionSegmentInformation(e,t){return{width:(0,n.readUint32)(e,t),height:(0,n.readUint32)(e,t+4),x:(0,n.readUint32)(e,t+8),y:(0,n.readUint32)(e,t+12),combinationOperator:7&e[t+16]}}const g=17;function processSegment(e,t){const a=e.header,r=e.data,i=e.end;let s,o,c,l,h=e.start;switch(a.type){case 0:const e={},t=(0,n.readUint16)(r,h);e.huffman=!!(1&t);e.refinement=!!(2&t);e.huffmanDHSelector=t>>2&3;e.huffmanDWSelector=t>>4&3;e.bitmapSizeSelector=t>>6&1;e.aggregationInstancesSelector=t>>7&1;e.bitmapCodingContextUsed=!!(256&t);e.bitmapCodingContextRetained=!!(512&t);e.template=t>>10&3;e.refinementTemplate=t>>12&1;h+=2;if(!e.huffman){l=0===e.template?4:1;o=[];for(c=0;c<l;c++){o.push({x:(0,n.readInt8)(r,h),y:(0,n.readInt8)(r,h+1)});h+=2}e.at=o}if(e.refinement&&!e.refinementTemplate){o=[];for(c=0;c<2;c++){o.push({x:(0,n.readInt8)(r,h),y:(0,n.readInt8)(r,h+1)});h+=2}e.refinementAt=o}e.numberOfExportedSymbols=(0,n.readUint32)(r,h);h+=4;e.numberOfNewSymbols=(0,n.readUint32)(r,h);h+=4;s=[e,a.number,a.referredTo,r,h,i];break;case 6:case 7:const u={};u.info=readRegionSegmentInformation(r,h);h+=g;const d=(0,n.readUint16)(r,h);h+=2;u.huffman=!!(1&d);u.refinement=!!(2&d);u.logStripSize=d>>2&3;u.stripSize=1<<u.logStripSize;u.referenceCorner=d>>4&3;u.transposed=!!(64&d);u.combinationOperator=d>>7&3;u.defaultPixelValue=d>>9&1;u.dsOffset=d<<17>>27;u.refinementTemplate=d>>15&1;if(u.huffman){const e=(0,n.readUint16)(r,h);h+=2;u.huffmanFS=3&e;u.huffmanDS=e>>2&3;u.huffmanDT=e>>4&3;u.huffmanRefinementDW=e>>6&3;u.huffmanRefinementDH=e>>8&3;u.huffmanRefinementDX=e>>10&3;u.huffmanRefinementDY=e>>12&3;u.huffmanRefinementSizeSelector=!!(16384&e)}if(u.refinement&&!u.refinementTemplate){o=[];for(c=0;c<2;c++){o.push({x:(0,n.readInt8)(r,h),y:(0,n.readInt8)(r,h+1)});h+=2}u.refinementAt=o}u.numberOfSymbolInstances=(0,n.readUint32)(r,h);h+=4;s=[u,a.referredTo,r,h,i];break;case 16:const f={},p=r[h++];f.mmr=!!(1&p);f.template=p>>1&3;f.patternWidth=r[h++];f.patternHeight=r[h++];f.maxPatternIndex=(0,n.readUint32)(r,h);h+=4;s=[f,a.number,r,h,i];break;case 22:case 23:const m={};m.info=readRegionSegmentInformation(r,h);h+=g;const b=r[h++];m.mmr=!!(1&b);m.template=b>>1&3;m.enableSkip=!!(8&b);m.combinationOperator=b>>4&7;m.defaultPixelValue=b>>7&1;m.gridWidth=(0,n.readUint32)(r,h);h+=4;m.gridHeight=(0,n.readUint32)(r,h);h+=4;m.gridOffsetX=4294967295&(0,n.readUint32)(r,h);h+=4;m.gridOffsetY=4294967295&(0,n.readUint32)(r,h);h+=4;m.gridVectorX=(0,n.readUint16)(r,h);h+=2;m.gridVectorY=(0,n.readUint16)(r,h);h+=2;s=[m,a.referredTo,r,h,i];break;case 38:case 39:const y={};y.info=readRegionSegmentInformation(r,h);h+=g;const w=r[h++];y.mmr=!!(1&w);y.template=w>>1&3;y.prediction=!!(8&w);if(!y.mmr){l=0===y.template?4:1;o=[];for(c=0;c<l;c++){o.push({x:(0,n.readInt8)(r,h),y:(0,n.readInt8)(r,h+1)});h+=2}y.at=o}s=[y,r,h,i];break;case 48:const S={width:(0,n.readUint32)(r,h),height:(0,n.readUint32)(r,h+4),resolutionX:(0,n.readUint32)(r,h+8),resolutionY:(0,n.readUint32)(r,h+12)};4294967295===S.height&&delete S.height;const x=r[h+16];(0,n.readUint16)(r,h+17);S.lossless=!!(1&x);S.refinement=!!(2&x);S.defaultPixelValue=x>>2&1;S.combinationOperator=x>>3&3;S.requiresBuffer=!!(32&x);S.combinationOperatorOverride=!!(64&x);s=[S];break;case 49:case 50:case 51:case 62:break;case 53:s=[a.number,r,h,i];break;default:throw new Jbig2Error(`segment type ${a.typeName}(${a.type}) is not implemented`)}const u="on"+a.typeName;u in t&&t[u].apply(t,s)}function processSegments(e,t){for(let a=0,r=e.length;a<r;a++)processSegment(e[a],t)}class SimpleSegmentVisitor{onPageInformation(e){this.currentPageInfo=e;const t=e.width+7>>3,a=new Uint8ClampedArray(t*e.height);e.defaultPixelValue&&a.fill(255);this.buffer=a}drawBitmap(e,t){const a=this.currentPageInfo,r=e.width,n=e.height,i=a.width+7>>3,s=a.combinationOperatorOverride?e.combinationOperator:a.combinationOperator,o=this.buffer,c=128>>(7&e.x);let l,h,u,d,f=e.y*i+(e.x>>3);switch(s){case 0:for(l=0;l<n;l++){u=c;d=f;for(h=0;h<r;h++){t[l][h]&&(o[d]|=u);u>>=1;if(!u){u=128;d++}}f+=i}break;case 2:for(l=0;l<n;l++){u=c;d=f;for(h=0;h<r;h++){t[l][h]&&(o[d]^=u);u>>=1;if(!u){u=128;d++}}f+=i}break;default:throw new Jbig2Error(`operator ${s} is not supported`)}}onImmediateGenericRegion(e,t,a,r){const n=e.info,i=new DecodingContext(t,a,r),s=decodeBitmap(e.mmr,n.width,n.height,e.template,e.prediction,null,e.at,i);this.drawBitmap(n,s)}onImmediateLosslessGenericRegion(){this.onImmediateGenericRegion(...arguments)}onSymbolDictionary(e,t,a,r,i,s){let o,c;if(e.huffman){o=function getSymbolDictionaryHuffmanTables(e,t,a){let r,n,i,s,o=0;switch(e.huffmanDHSelector){case 0:case 1:r=getStandardTable(e.huffmanDHSelector+4);break;case 3:r=getCustomHuffmanTable(o,t,a);o++;break;default:throw new Jbig2Error("invalid Huffman DH selector")}switch(e.huffmanDWSelector){case 0:case 1:n=getStandardTable(e.huffmanDWSelector+2);break;case 3:n=getCustomHuffmanTable(o,t,a);o++;break;default:throw new Jbig2Error("invalid Huffman DW selector")}if(e.bitmapSizeSelector){i=getCustomHuffmanTable(o,t,a);o++}else i=getStandardTable(1);s=e.aggregationInstancesSelector?getCustomHuffmanTable(o,t,a):getStandardTable(1);return{tableDeltaHeight:r,tableDeltaWidth:n,tableBitmapSize:i,tableAggregateInstances:s}}(e,a,this.customTables);c=new Reader(r,i,s)}let l=this.symbols;l||(this.symbols=l={});const h=[];for(const e of a){const t=l[e];t&&h.push(...t)}const u=new DecodingContext(r,i,s);l[t]=function decodeSymbolDictionary(e,t,a,r,i,s,o,c,l,h,u,d){if(e&&t)throw new Jbig2Error("symbol refinement with Huffman is not supported");const f=[];let g=0,p=(0,n.log2)(a.length+r);const m=u.decoder,b=u.contextCache;let y,w;if(e){y=getStandardTable(1);w=[];p=Math.max(p,1)}for(;f.length<r;){g+=e?s.tableDeltaHeight.decode(d):decodeInteger(b,"IADH",m);let r=0,n=0;const i=e?w.length:0;for(;;){const i=e?s.tableDeltaWidth.decode(d):decodeInteger(b,"IADW",m);if(null===i)break;r+=i;n+=r;let y;if(t){const n=decodeInteger(b,"IAAI",m);if(n>1)y=decodeTextRegion(e,t,r,g,0,n,1,a.concat(f),p,0,0,1,0,s,l,h,u,0,d);else{const e=decodeIAID(b,m,p),t=decodeInteger(b,"IARDX",m),n=decodeInteger(b,"IARDY",m);y=decodeRefinement(r,g,l,e<a.length?a[e]:f[e-a.length],t,n,!1,h,u)}f.push(y)}else if(e)w.push(r);else{y=decodeBitmap(!1,r,g,o,!1,null,c,u);f.push(y)}}if(e&&!t){const e=s.tableBitmapSize.decode(d);d.byteAlign();let t;if(0===e)t=readUncompressedBitmap(d,n,g);else{const a=d.end,r=d.position+e;d.end=r;t=decodeMMRBitmap(d,n,g,!1);d.end=a;d.position=r}const a=w.length;if(i===a-1)f.push(t);else{let e,r,n,s,o,c=0;for(e=i;e<a;e++){s=w[e];n=c+s;o=[];for(r=0;r<g;r++)o.push(t[r].subarray(c,n));f.push(o);c=n}}}}const S=[],x=[];let C,k,v=!1;const F=a.length+r;for(;x.length<F;){let t=e?y.decode(d):decodeInteger(b,"IAEX",m);for(;t--;)x.push(v);v=!v}for(C=0,k=a.length;C<k;C++)x[C]&&S.push(a[C]);for(let e=0;e<r;C++,e++)x[C]&&S.push(f[e]);return S}(e.huffman,e.refinement,h,e.numberOfNewSymbols,e.numberOfExportedSymbols,o,e.template,e.at,e.refinementTemplate,e.refinementAt,u,c)}onImmediateTextRegion(e,t,a,r,i){const s=e.info;let o,c;const l=this.symbols,h=[];for(const e of t){const t=l[e];t&&h.push(...t)}const u=(0,n.log2)(h.length);if(e.huffman){c=new Reader(a,r,i);o=function getTextRegionHuffmanTables(e,t,a,r,n){const i=[];for(let e=0;e<=34;e++){const t=n.readBits(4);i.push(new HuffmanLine([e,t,0,0]))}const s=new HuffmanTable(i,!1);i.length=0;for(let e=0;e<r;){const t=s.decode(n);if(t>=32){let a,r,s;switch(t){case 32:if(0===e)throw new Jbig2Error("no previous value in symbol ID table");r=n.readBits(2)+3;a=i[e-1].prefixLength;break;case 33:r=n.readBits(3)+3;a=0;break;case 34:r=n.readBits(7)+11;a=0;break;default:throw new Jbig2Error("invalid code length in symbol ID table")}for(s=0;s<r;s++){i.push(new HuffmanLine([e,a,0,0]));e++}}else{i.push(new HuffmanLine([e,t,0,0]));e++}}n.byteAlign();const o=new HuffmanTable(i,!1);let c,l,h,u=0;switch(e.huffmanFS){case 0:case 1:c=getStandardTable(e.huffmanFS+6);break;case 3:c=getCustomHuffmanTable(u,t,a);u++;break;default:throw new Jbig2Error("invalid Huffman FS selector")}switch(e.huffmanDS){case 0:case 1:case 2:l=getStandardTable(e.huffmanDS+8);break;case 3:l=getCustomHuffmanTable(u,t,a);u++;break;default:throw new Jbig2Error("invalid Huffman DS selector")}switch(e.huffmanDT){case 0:case 1:case 2:h=getStandardTable(e.huffmanDT+11);break;case 3:h=getCustomHuffmanTable(u,t,a);u++;break;default:throw new Jbig2Error("invalid Huffman DT selector")}if(e.refinement)throw new Jbig2Error("refinement with Huffman is not supported");return{symbolIDTable:o,tableFirstS:c,tableDeltaS:l,tableDeltaT:h}}(e,t,this.customTables,h.length,c)}const d=new DecodingContext(a,r,i),f=decodeTextRegion(e.huffman,e.refinement,s.width,s.height,e.defaultPixelValue,e.numberOfSymbolInstances,e.stripSize,h,u,e.transposed,e.dsOffset,e.referenceCorner,e.combinationOperator,o,e.refinementTemplate,e.refinementAt,d,e.logStripSize,c);this.drawBitmap(s,f)}onImmediateLosslessTextRegion(){this.onImmediateTextRegion(...arguments)}onPatternDictionary(e,t,a,r,n){let i=this.patterns;i||(this.patterns=i={});const s=new DecodingContext(a,r,n);i[t]=function decodePatternDictionary(e,t,a,r,n,i){const s=[];if(!e){s.push({x:-t,y:0});0===n&&s.push({x:-3,y:-1},{x:2,y:-2},{x:-2,y:-2})}const o=decodeBitmap(e,(r+1)*t,a,n,!1,null,s,i),c=[];for(let e=0;e<=r;e++){const r=[],n=t*e,i=n+t;for(let e=0;e<a;e++)r.push(o[e].subarray(n,i));c.push(r)}return c}(e.mmr,e.patternWidth,e.patternHeight,e.maxPatternIndex,e.template,s)}onImmediateHalftoneRegion(e,t,a,r,i){const s=this.patterns[t[0]],o=e.info,c=new DecodingContext(a,r,i),l=function decodeHalftoneRegion(e,t,a,r,i,s,o,c,l,h,u,d,f,g,p){if(o)throw new Jbig2Error("skip is not supported");if(0!==c)throw new Jbig2Error(`operator "${c}" is not supported in halftone region`);const m=[];let b,y,w;for(b=0;b<i;b++){w=new Uint8Array(r);if(s)for(y=0;y<r;y++)w[y]=s;m.push(w)}const S=t.length,x=t[0],C=x[0].length,k=x.length,v=(0,n.log2)(S),F=[];if(!e){F.push({x:a<=1?3:2,y:-1});0===a&&F.push({x:-3,y:-1},{x:2,y:-2},{x:-2,y:-2})}const O=[];let T,M,E,D,N,R,L,j,$,_,U;e&&(T=new Reader(p.data,p.start,p.end));for(b=v-1;b>=0;b--){M=e?decodeMMRBitmap(T,l,h,!0):decodeBitmap(!1,l,h,a,!1,null,F,p);O[b]=M}for(E=0;E<h;E++)for(D=0;D<l;D++){N=0;R=0;for(y=v-1;y>=0;y--){N^=O[y][E][D];R|=N<<y}L=t[R];j=u+E*g+D*f>>8;$=d+E*f-D*g>>8;if(j>=0&&j+C<=r&&$>=0&&$+k<=i)for(b=0;b<k;b++){U=m[$+b];_=L[b];for(y=0;y<C;y++)U[j+y]|=_[y]}else{let e,t;for(b=0;b<k;b++){t=$+b;if(!(t<0||t>=i)){U=m[t];_=L[b];for(y=0;y<C;y++){e=j+y;e>=0&&e<r&&(U[e]|=_[y])}}}}}return m}(e.mmr,s,e.template,o.width,o.height,e.defaultPixelValue,e.enableSkip,e.combinationOperator,e.gridWidth,e.gridHeight,e.gridOffsetX,e.gridOffsetY,e.gridVectorX,e.gridVectorY,c);this.drawBitmap(o,l)}onImmediateLosslessHalftoneRegion(){this.onImmediateHalftoneRegion(...arguments)}onTables(e,t,a,r){let i=this.customTables;i||(this.customTables=i={});i[e]=function decodeTablesSegment(e,t,a){const r=e[t],i=4294967295&(0,n.readUint32)(e,t+1),s=4294967295&(0,n.readUint32)(e,t+5),o=new Reader(e,t+9,a),c=1+(r>>1&7),l=1+(r>>4&7),h=[];let u,d,f=i;do{u=o.readBits(c);d=o.readBits(l);h.push(new HuffmanLine([f,u,d,0]));f+=1<<d}while(f<s);u=o.readBits(c);h.push(new HuffmanLine([i-1,u,32,0,"lower"]));u=o.readBits(c);h.push(new HuffmanLine([s,u,32,0]));if(1&r){u=o.readBits(c);h.push(new HuffmanLine([u,0]))}return new HuffmanTable(h,!1)}(t,a,r)}}class HuffmanLine{constructor(e){if(2===e.length){this.isOOB=!0;this.rangeLow=0;this.prefixLength=e[0];this.rangeLength=0;this.prefixCode=e[1];this.isLowerRange=!1}else{this.isOOB=!1;this.rangeLow=e[0];this.prefixLength=e[1];this.rangeLength=e[2];this.prefixCode=e[3];this.isLowerRange="lower"===e[4]}}}class HuffmanTreeNode{constructor(e){this.children=[];if(e){this.isLeaf=!0;this.rangeLength=e.rangeLength;this.rangeLow=e.rangeLow;this.isLowerRange=e.isLowerRange;this.isOOB=e.isOOB}else this.isLeaf=!1}buildTree(e,t){const a=e.prefixCode>>t&1;if(t<=0)this.children[a]=new HuffmanTreeNode(e);else{let r=this.children[a];r||(this.children[a]=r=new HuffmanTreeNode(null));r.buildTree(e,t-1)}}decodeNode(e){if(this.isLeaf){if(this.isOOB)return null;const t=e.readBits(this.rangeLength);return this.rangeLow+(this.isLowerRange?-t:t)}const t=this.children[e.readBit()];if(!t)throw new Jbig2Error("invalid Huffman data");return t.decodeNode(e)}}class HuffmanTable{constructor(e,t){t||this.assignPrefixCodes(e);this.rootNode=new HuffmanTreeNode(null);for(let t=0,a=e.length;t<a;t++){const a=e[t];a.prefixLength>0&&this.rootNode.buildTree(a,a.prefixLength-1)}}decode(e){return this.rootNode.decodeNode(e)}assignPrefixCodes(e){const t=e.length;let a=0;for(let r=0;r<t;r++)a=Math.max(a,e[r].prefixLength);const r=new Uint32Array(a+1);for(let a=0;a<t;a++)r[e[a].prefixLength]++;let n,i,s,o=1,c=0;r[0]=0;for(;o<=a;){c=c+r[o-1]<<1;n=c;i=0;for(;i<t;){s=e[i];if(s.prefixLength===o){s.prefixCode=n;n++}i++}o++}}}const p={};function getStandardTable(e){let t,a=p[e];if(a)return a;switch(e){case 1:t=[[0,1,4,0],[16,2,8,2],[272,3,16,6],[65808,3,32,7]];break;case 2:t=[[0,1,0,0],[1,2,0,2],[2,3,0,6],[3,4,3,14],[11,5,6,30],[75,6,32,62],[6,63]];break;case 3:t=[[-256,8,8,254],[0,1,0,0],[1,2,0,2],[2,3,0,6],[3,4,3,14],[11,5,6,30],[-257,8,32,255,"lower"],[75,7,32,126],[6,62]];break;case 4:t=[[1,1,0,0],[2,2,0,2],[3,3,0,6],[4,4,3,14],[12,5,6,30],[76,5,32,31]];break;case 5:t=[[-255,7,8,126],[1,1,0,0],[2,2,0,2],[3,3,0,6],[4,4,3,14],[12,5,6,30],[-256,7,32,127,"lower"],[76,6,32,62]];break;case 6:t=[[-2048,5,10,28],[-1024,4,9,8],[-512,4,8,9],[-256,4,7,10],[-128,5,6,29],[-64,5,5,30],[-32,4,5,11],[0,2,7,0],[128,3,7,2],[256,3,8,3],[512,4,9,12],[1024,4,10,13],[-2049,6,32,62,"lower"],[2048,6,32,63]];break;case 7:t=[[-1024,4,9,8],[-512,3,8,0],[-256,4,7,9],[-128,5,6,26],[-64,5,5,27],[-32,4,5,10],[0,4,5,11],[32,5,5,28],[64,5,6,29],[128,4,7,12],[256,3,8,1],[512,3,9,2],[1024,3,10,3],[-1025,5,32,30,"lower"],[2048,5,32,31]];break;case 8:t=[[-15,8,3,252],[-7,9,1,508],[-5,8,1,253],[-3,9,0,509],[-2,7,0,124],[-1,4,0,10],[0,2,1,0],[2,5,0,26],[3,6,0,58],[4,3,4,4],[20,6,1,59],[22,4,4,11],[38,4,5,12],[70,5,6,27],[134,5,7,28],[262,6,7,60],[390,7,8,125],[646,6,10,61],[-16,9,32,510,"lower"],[1670,9,32,511],[2,1]];break;case 9:t=[[-31,8,4,252],[-15,9,2,508],[-11,8,2,253],[-7,9,1,509],[-5,7,1,124],[-3,4,1,10],[-1,3,1,2],[1,3,1,3],[3,5,1,26],[5,6,1,58],[7,3,5,4],[39,6,2,59],[43,4,5,11],[75,4,6,12],[139,5,7,27],[267,5,8,28],[523,6,8,60],[779,7,9,125],[1291,6,11,61],[-32,9,32,510,"lower"],[3339,9,32,511],[2,0]];break;case 10:t=[[-21,7,4,122],[-5,8,0,252],[-4,7,0,123],[-3,5,0,24],[-2,2,2,0],[2,5,0,25],[3,6,0,54],[4,7,0,124],[5,8,0,253],[6,2,6,1],[70,5,5,26],[102,6,5,55],[134,6,6,56],[198,6,7,57],[326,6,8,58],[582,6,9,59],[1094,6,10,60],[2118,7,11,125],[-22,8,32,254,"lower"],[4166,8,32,255],[2,2]];break;case 11:t=[[1,1,0,0],[2,2,1,2],[4,4,0,12],[5,4,1,13],[7,5,1,28],[9,5,2,29],[13,6,2,60],[17,7,2,122],[21,7,3,123],[29,7,4,124],[45,7,5,125],[77,7,6,126],[141,7,32,127]];break;case 12:t=[[1,1,0,0],[2,2,0,2],[3,3,1,6],[5,5,0,28],[6,5,1,29],[8,6,1,60],[10,7,0,122],[11,7,1,123],[13,7,2,124],[17,7,3,125],[25,7,4,126],[41,8,5,254],[73,8,32,255]];break;case 13:t=[[1,1,0,0],[2,3,0,4],[3,4,0,12],[4,5,0,28],[5,4,1,13],[7,3,3,5],[15,6,1,58],[17,6,2,59],[21,6,3,60],[29,6,4,61],[45,6,5,62],[77,7,6,126],[141,7,32,127]];break;case 14:t=[[-2,3,0,4],[-1,3,0,5],[0,1,0,0],[1,3,0,6],[2,3,0,7]];break;case 15:t=[[-24,7,4,124],[-8,6,2,60],[-4,5,1,28],[-2,4,0,12],[-1,3,0,4],[0,1,0,0],[1,3,0,5],[2,4,0,13],[3,5,1,29],[5,6,2,61],[9,7,4,125],[-25,7,32,126,"lower"],[25,7,32,127]];break;default:throw new Jbig2Error(`standard table B.${e} does not exist`)}for(let e=0,a=t.length;e<a;e++)t[e]=new HuffmanLine(t[e]);a=new HuffmanTable(t,!0);p[e]=a;return a}class Reader{constructor(e,t,a){this.data=e;this.start=t;this.end=a;this.position=t;this.shift=-1;this.currentByte=0}readBit(){if(this.shift<0){if(this.position>=this.end)throw new Jbig2Error("end of data while reading bit");this.currentByte=this.data[this.position++];this.shift=7}const e=this.currentByte>>this.shift&1;this.shift--;return e}readBits(e){let t,a=0;for(t=e-1;t>=0;t--)a|=this.readBit()<<t;return a}byteAlign(){this.shift=-1}next(){return this.position>=this.end?-1:this.data[this.position++]}}function getCustomHuffmanTable(e,t,a){let r=0;for(let n=0,i=t.length;n<i;n++){const i=a[t[n]];if(i){if(e===r)return i;r++}}throw new Jbig2Error("can't find custom Huffman table")}function readUncompressedBitmap(e,t,a){const r=[];for(let n=0;n<a;n++){const a=new Uint8Array(t);r.push(a);for(let r=0;r<t;r++)a[r]=e.readBit();e.byteAlign()}return r}function decodeMMRBitmap(e,t,a,r){const n={K:-1,Columns:t,Rows:a,BlackIs1:!0,EndOfBlock:r},i=new s.CCITTFaxDecoder(e,n),o=[];let c,l=!1;for(let e=0;e<a;e++){const e=new Uint8Array(t);o.push(e);let a=-1;for(let r=0;r<t;r++){if(a<0){c=i.readNextChar();if(-1===c){c=0;l=!0}a=7}e[r]=c>>a&1;a--}}if(r&&!l){const e=5;for(let t=0;t<e&&-1!==i.readNextChar();t++);}return o}t.Jbig2Image=class Jbig2Image{parseChunks(e){return function parseJbig2Chunks(e){const t=new SimpleSegmentVisitor;for(let a=0,r=e.length;a<r;a++){const r=e[a];processSegments(readSegments({},r.data,r.start,r.end),t)}return t.buffer}(e)}parse(e){throw new Error("Not implemented: Jbig2Image.parse")}}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.ArithmeticDecoder=void 0;const a=[{qe:22017,nmps:1,nlps:1,switchFlag:1},{qe:13313,nmps:2,nlps:6,switchFlag:0},{qe:6145,nmps:3,nlps:9,switchFlag:0},{qe:2753,nmps:4,nlps:12,switchFlag:0},{qe:1313,nmps:5,nlps:29,switchFlag:0},{qe:545,nmps:38,nlps:33,switchFlag:0},{qe:22017,nmps:7,nlps:6,switchFlag:1},{qe:21505,nmps:8,nlps:14,switchFlag:0},{qe:18433,nmps:9,nlps:14,switchFlag:0},{qe:14337,nmps:10,nlps:14,switchFlag:0},{qe:12289,nmps:11,nlps:17,switchFlag:0},{qe:9217,nmps:12,nlps:18,switchFlag:0},{qe:7169,nmps:13,nlps:20,switchFlag:0},{qe:5633,nmps:29,nlps:21,switchFlag:0},{qe:22017,nmps:15,nlps:14,switchFlag:1},{qe:21505,nmps:16,nlps:14,switchFlag:0},{qe:20737,nmps:17,nlps:15,switchFlag:0},{qe:18433,nmps:18,nlps:16,switchFlag:0},{qe:14337,nmps:19,nlps:17,switchFlag:0},{qe:13313,nmps:20,nlps:18,switchFlag:0},{qe:12289,nmps:21,nlps:19,switchFlag:0},{qe:10241,nmps:22,nlps:19,switchFlag:0},{qe:9217,nmps:23,nlps:20,switchFlag:0},{qe:8705,nmps:24,nlps:21,switchFlag:0},{qe:7169,nmps:25,nlps:22,switchFlag:0},{qe:6145,nmps:26,nlps:23,switchFlag:0},{qe:5633,nmps:27,nlps:24,switchFlag:0},{qe:5121,nmps:28,nlps:25,switchFlag:0},{qe:4609,nmps:29,nlps:26,switchFlag:0},{qe:4353,nmps:30,nlps:27,switchFlag:0},{qe:2753,nmps:31,nlps:28,switchFlag:0},{qe:2497,nmps:32,nlps:29,switchFlag:0},{qe:2209,nmps:33,nlps:30,switchFlag:0},{qe:1313,nmps:34,nlps:31,switchFlag:0},{qe:1089,nmps:35,nlps:32,switchFlag:0},{qe:673,nmps:36,nlps:33,switchFlag:0},{qe:545,nmps:37,nlps:34,switchFlag:0},{qe:321,nmps:38,nlps:35,switchFlag:0},{qe:273,nmps:39,nlps:36,switchFlag:0},{qe:133,nmps:40,nlps:37,switchFlag:0},{qe:73,nmps:41,nlps:38,switchFlag:0},{qe:37,nmps:42,nlps:39,switchFlag:0},{qe:21,nmps:43,nlps:40,switchFlag:0},{qe:9,nmps:44,nlps:41,switchFlag:0},{qe:5,nmps:45,nlps:42,switchFlag:0},{qe:1,nmps:45,nlps:43,switchFlag:0},{qe:22017,nmps:46,nlps:46,switchFlag:0}];t.ArithmeticDecoder=class ArithmeticDecoder{constructor(e,t,a){this.data=e;this.bp=t;this.dataEnd=a;this.chigh=e[t];this.clow=0;this.byteIn();this.chigh=this.chigh<<7&65535|this.clow>>9&127;this.clow=this.clow<<7&65535;this.ct-=7;this.a=32768}byteIn(){const e=this.data;let t=this.bp;if(255===e[t])if(e[t+1]>143){this.clow+=65280;this.ct=8}else{t++;this.clow+=e[t]<<9;this.ct=7;this.bp=t}else{t++;this.clow+=t<this.dataEnd?e[t]<<8:65280;this.ct=8;this.bp=t}if(this.clow>65535){this.chigh+=this.clow>>16;this.clow&=65535}}readBit(e,t){let r=e[t]>>1,n=1&e[t];const i=a[r],s=i.qe;let o,c=this.a-s;if(this.chigh<s)if(c<s){c=s;o=n;r=i.nmps}else{c=s;o=1^n;1===i.switchFlag&&(n=o);r=i.nlps}else{this.chigh-=s;if(0!=(32768&c)){this.a=c;return n}if(c<s){o=1^n;1===i.switchFlag&&(n=o);r=i.nlps}else{o=n;r=i.nmps}}do{0===this.ct&&this.byteIn();c<<=1;this.chigh=this.chigh<<1&65535|this.clow>>15&1;this.clow=this.clow<<1&65535;this.ct--}while(0==(32768&c));this.a=c;e[t]=r<<1|n;return o}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.JpegStream=void 0;var r=a(17),n=a(4),i=a(26),s=a(2);class JpegStream extends r.DecodeStream{constructor(e,t,a){let r;for(;-1!==(r=e.getByte());)if(255===r){e.skip(-1);break}super(t);this.stream=e;this.dict=e.dict;this.maybeLength=t;this.params=a}get bytes(){return(0,s.shadow)(this,"bytes",this.stream.getBytes(this.maybeLength))}ensureBuffer(e){}readBlock(){if(this.eof)return;const e={decodeTransform:void 0,colorTransform:void 0},t=this.dict.getArray("D","Decode");if(this.forceRGB&&Array.isArray(t)){const a=this.dict.get("BPC","BitsPerComponent")||8,r=t.length,n=new Int32Array(r);let i=!1;const s=(1<<a)-1;for(let e=0;e<r;e+=2){n[e]=256*(t[e+1]-t[e])|0;n[e+1]=t[e]*s|0;256===n[e]&&0===n[e+1]||(i=!0)}i&&(e.decodeTransform=n)}if(this.params instanceof n.Dict){const t=this.params.get("ColorTransform");Number.isInteger(t)&&(e.colorTransform=t)}const a=new i.JpegImage(e);a.parse(this.bytes);const r=a.getData({width:this.drawWidth,height:this.drawHeight,forceRGB:this.forceRGB,isSourcePDF:!0});this.buffer=r;this.bufferLength=r.length;this.eof=!0}}t.JpegStream=JpegStream},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.JpegImage=void 0;var r=a(2),n=a(3);class JpegError extends r.BaseException{constructor(e){super(`JPEG error: ${e}`,"JpegError")}}class DNLMarkerError extends r.BaseException{constructor(e,t){super(e,"DNLMarkerError");this.scanLines=t}}class EOIMarkerError extends r.BaseException{constructor(e){super(e,"EOIMarkerError")}}const i=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),s=4017,o=799,c=3406,l=2276,h=1567,u=3784,d=5793,f=2896;function buildHuffmanTable(e,t){let a,r,n=0,i=16;for(;i>0&&!e[i-1];)i--;const s=[{children:[],index:0}];let o,c=s[0];for(a=0;a<i;a++){for(r=0;r<e[a];r++){c=s.pop();c.children[c.index]=t[n];for(;c.index>0;)c=s.pop();c.index++;s.push(c);for(;s.length<=a;){s.push(o={children:[],index:0});c.children[c.index]=o.children;c=o}n++}if(a+1<i){s.push(o={children:[],index:0});c.children[c.index]=o.children;c=o}}return s[0].children}function getBlockBufferOffset(e,t,a){return 64*((e.blocksPerLine+1)*t+a)}function decodeScan(e,t,a,s,o,c,l,h,u,d=!1){const f=a.mcusPerLine,g=a.progressive,p=t;let m=0,b=0;function readBit(){if(b>0){b--;return m>>b&1}m=e[t++];if(255===m){const r=e[t++];if(r){if(220===r&&d){t+=2;const r=(0,n.readUint16)(e,t);t+=2;if(r>0&&r!==a.scanLines)throw new DNLMarkerError("Found DNL marker (0xFFDC) while parsing scan data",r)}else if(217===r){if(d){const e=x*(8===a.precision?8:0);if(e>0&&Math.round(a.scanLines/e)>=5)throw new DNLMarkerError("Found EOI marker (0xFFD9) while parsing scan data, possibly caused by incorrect `scanLines` parameter",e)}throw new EOIMarkerError("Found EOI marker (0xFFD9) while parsing scan data")}throw new JpegError(`unexpected marker ${(m<<8|r).toString(16)}`)}}b=7;return m>>>7}function decodeHuffman(e){let t=e;for(;;){t=t[readBit()];switch(typeof t){case"number":return t;case"object":continue}throw new JpegError("invalid huffman sequence")}}function receive(e){let t=0;for(;e>0;){t=t<<1|readBit();e--}return t}function receiveAndExtend(e){if(1===e)return 1===readBit()?1:-1;const t=receive(e);return t>=1<<e-1?t:t+(-1<<e)+1}let y=0;let w,S=0;let x=0;function decodeMcu(e,t,a,r,n){const i=a%f;x=(a/f|0)*e.v+r;const s=i*e.h+n;t(e,getBlockBufferOffset(e,x,s))}function decodeBlock(e,t,a){x=a/e.blocksPerLine|0;const r=a%e.blocksPerLine;t(e,getBlockBufferOffset(e,x,r))}const C=s.length;let k,v,F,O,T,M;M=g?0===c?0===h?function decodeDCFirst(e,t){const a=decodeHuffman(e.huffmanTableDC),r=0===a?0:receiveAndExtend(a)<<u;e.blockData[t]=e.pred+=r}:function decodeDCSuccessive(e,t){e.blockData[t]|=readBit()<<u}:0===h?function decodeACFirst(e,t){if(y>0){y--;return}let a=c;const r=l;for(;a<=r;){const r=decodeHuffman(e.huffmanTableAC),n=15&r,s=r>>4;if(0===n){if(s<15){y=receive(s)+(1<<s)-1;break}a+=16;continue}a+=s;const o=i[a];e.blockData[t+o]=receiveAndExtend(n)*(1<<u);a++}}:function decodeACSuccessive(e,t){let a=c;const r=l;let n,s,o=0;for(;a<=r;){const r=t+i[a],c=e.blockData[r]<0?-1:1;switch(S){case 0:s=decodeHuffman(e.huffmanTableAC);n=15&s;o=s>>4;if(0===n)if(o<15){y=receive(o)+(1<<o);S=4}else{o=16;S=1}else{if(1!==n)throw new JpegError("invalid ACn encoding");w=receiveAndExtend(n);S=o?2:3}continue;case 1:case 2:if(e.blockData[r])e.blockData[r]+=c*(readBit()<<u);else{o--;0===o&&(S=2===S?3:0)}break;case 3:if(e.blockData[r])e.blockData[r]+=c*(readBit()<<u);else{e.blockData[r]=w<<u;S=0}break;case 4:e.blockData[r]&&(e.blockData[r]+=c*(readBit()<<u))}a++}if(4===S){y--;0===y&&(S=0)}}:function decodeBaseline(e,t){const a=decodeHuffman(e.huffmanTableDC),r=0===a?0:receiveAndExtend(a);e.blockData[t]=e.pred+=r;let n=1;for(;n<64;){const a=decodeHuffman(e.huffmanTableAC),r=15&a,s=a>>4;if(0===r){if(s<15)break;n+=16;continue}n+=s;const o=i[n];e.blockData[t+o]=receiveAndExtend(r);n++}};let E,D,N,R,L=0;D=1===C?s[0].blocksPerLine*s[0].blocksPerColumn:f*a.mcusPerColumn;for(;L<=D;){const a=o?Math.min(D-L,o):D;if(a>0){for(v=0;v<C;v++)s[v].pred=0;y=0;if(1===C){k=s[0];for(T=0;T<a;T++){decodeBlock(k,M,L);L++}}else for(T=0;T<a;T++){for(v=0;v<C;v++){k=s[v];N=k.h;R=k.v;for(F=0;F<R;F++)for(O=0;O<N;O++)decodeMcu(k,M,L,F,O)}L++}}b=0;E=findNextFileMarker(e,t);if(!E)break;if(E.invalid){const e=a>0?"unexpected":"excessive";(0,r.warn)(`decodeScan - ${e} MCU data, current marker is: ${E.invalid}`);t=E.offset}if(!(E.marker>=65488&&E.marker<=65495))break;t+=2}return t-p}function quantizeAndInverse(e,t,a){const r=e.quantizationTable,n=e.blockData;let i,g,p,m,b,y,w,S,x,C,k,v,F,O,T,M,E;if(!r)throw new JpegError("missing required Quantization Table.");for(let e=0;e<64;e+=8){x=n[t+e];C=n[t+e+1];k=n[t+e+2];v=n[t+e+3];F=n[t+e+4];O=n[t+e+5];T=n[t+e+6];M=n[t+e+7];x*=r[e];if(0!=(C|k|v|F|O|T|M)){C*=r[e+1];k*=r[e+2];v*=r[e+3];F*=r[e+4];O*=r[e+5];T*=r[e+6];M*=r[e+7];i=d*x+128>>8;g=d*F+128>>8;p=k;m=T;b=f*(C-M)+128>>8;S=f*(C+M)+128>>8;y=v<<4;w=O<<4;i=i+g+1>>1;g=i-g;E=p*u+m*h+128>>8;p=p*h-m*u+128>>8;m=E;b=b+w+1>>1;w=b-w;S=S+y+1>>1;y=S-y;i=i+m+1>>1;m=i-m;g=g+p+1>>1;p=g-p;E=b*l+S*c+2048>>12;b=b*c-S*l+2048>>12;S=E;E=y*o+w*s+2048>>12;y=y*s-w*o+2048>>12;w=E;a[e]=i+S;a[e+7]=i-S;a[e+1]=g+w;a[e+6]=g-w;a[e+2]=p+y;a[e+5]=p-y;a[e+3]=m+b;a[e+4]=m-b}else{E=d*x+512>>10;a[e]=E;a[e+1]=E;a[e+2]=E;a[e+3]=E;a[e+4]=E;a[e+5]=E;a[e+6]=E;a[e+7]=E}}for(let e=0;e<8;++e){x=a[e];C=a[e+8];k=a[e+16];v=a[e+24];F=a[e+32];O=a[e+40];T=a[e+48];M=a[e+56];if(0!=(C|k|v|F|O|T|M)){i=d*x+2048>>12;g=d*F+2048>>12;p=k;m=T;b=f*(C-M)+2048>>12;S=f*(C+M)+2048>>12;y=v;w=O;i=4112+(i+g+1>>1);g=i-g;E=p*u+m*h+2048>>12;p=p*h-m*u+2048>>12;m=E;b=b+w+1>>1;w=b-w;S=S+y+1>>1;y=S-y;i=i+m+1>>1;m=i-m;g=g+p+1>>1;p=g-p;E=b*l+S*c+2048>>12;b=b*c-S*l+2048>>12;S=E;E=y*o+w*s+2048>>12;y=y*s-w*o+2048>>12;w=E;x=i+S;M=i-S;C=g+w;T=g-w;k=p+y;O=p-y;v=m+b;F=m-b;x<16?x=0:x>=4080?x=255:x>>=4;C<16?C=0:C>=4080?C=255:C>>=4;k<16?k=0:k>=4080?k=255:k>>=4;v<16?v=0:v>=4080?v=255:v>>=4;F<16?F=0:F>=4080?F=255:F>>=4;O<16?O=0:O>=4080?O=255:O>>=4;T<16?T=0:T>=4080?T=255:T>>=4;M<16?M=0:M>=4080?M=255:M>>=4;n[t+e]=x;n[t+e+8]=C;n[t+e+16]=k;n[t+e+24]=v;n[t+e+32]=F;n[t+e+40]=O;n[t+e+48]=T;n[t+e+56]=M}else{E=d*x+8192>>14;E=E<-2040?0:E>=2024?255:E+2056>>4;n[t+e]=E;n[t+e+8]=E;n[t+e+16]=E;n[t+e+24]=E;n[t+e+32]=E;n[t+e+40]=E;n[t+e+48]=E;n[t+e+56]=E}}}function buildComponentData(e,t){const a=t.blocksPerLine,r=t.blocksPerColumn,n=new Int16Array(64);for(let e=0;e<r;e++)for(let r=0;r<a;r++){quantizeAndInverse(t,getBlockBufferOffset(t,e,r),n)}return t.blockData}function findNextFileMarker(e,t,a=t){const r=e.length-1;let i=a<t?a:t;if(t>=r)return null;const s=(0,n.readUint16)(e,t);if(s>=65472&&s<=65534)return{invalid:null,marker:s,offset:t};let o=(0,n.readUint16)(e,i);for(;!(o>=65472&&o<=65534);){if(++i>=r)return null;o=(0,n.readUint16)(e,i)}return{invalid:s.toString(16),marker:o,offset:i}}t.JpegImage=class JpegImage{constructor({decodeTransform:e=null,colorTransform:t=-1}={}){this._decodeTransform=e;this._colorTransform=t}parse(e,{dnlScanLines:t=null}={}){function readDataBlock(){const t=(0,n.readUint16)(e,o);o+=2;let a=o+t-2;const i=findNextFileMarker(e,a,o);if(i&&i.invalid){(0,r.warn)("readDataBlock - incorrect length, current marker is: "+i.invalid);a=i.offset}const s=e.subarray(o,a);o+=s.length;return s}function prepareComponents(e){const t=Math.ceil(e.samplesPerLine/8/e.maxH),a=Math.ceil(e.scanLines/8/e.maxV);for(const r of e.components){const n=Math.ceil(Math.ceil(e.samplesPerLine/8)*r.h/e.maxH),i=Math.ceil(Math.ceil(e.scanLines/8)*r.v/e.maxV),s=t*r.h,o=64*(a*r.v)*(s+1);r.blockData=new Int16Array(o);r.blocksPerLine=n;r.blocksPerColumn=i}e.mcusPerLine=t;e.mcusPerColumn=a}let a,s,o=0,c=null,l=null,h=0;const u=[],d=[],f=[];let g=(0,n.readUint16)(e,o);o+=2;if(65496!==g)throw new JpegError("SOI not found");g=(0,n.readUint16)(e,o);o+=2;e:for(;65497!==g;){let p,m,b;switch(g){case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:const y=readDataBlock();65504===g&&74===y[0]&&70===y[1]&&73===y[2]&&70===y[3]&&0===y[4]&&(c={version:{major:y[5],minor:y[6]},densityUnits:y[7],xDensity:y[8]<<8|y[9],yDensity:y[10]<<8|y[11],thumbWidth:y[12],thumbHeight:y[13],thumbData:y.subarray(14,14+3*y[12]*y[13])});65518===g&&65===y[0]&&100===y[1]&&111===y[2]&&98===y[3]&&101===y[4]&&(l={version:y[5]<<8|y[6],flags0:y[7]<<8|y[8],flags1:y[9]<<8|y[10],transformCode:y[11]});break;case 65499:const w=(0,n.readUint16)(e,o);o+=2;const S=w+o-2;let x;for(;o<S;){const t=e[o++],a=new Uint16Array(64);if(t>>4==0)for(m=0;m<64;m++){x=i[m];a[x]=e[o++]}else{if(t>>4!=1)throw new JpegError("DQT - invalid table spec");for(m=0;m<64;m++){x=i[m];a[x]=(0,n.readUint16)(e,o);o+=2}}u[15&t]=a}break;case 65472:case 65473:case 65474:if(a)throw new JpegError("Only single frame JPEGs supported");o+=2;a={};a.extended=65473===g;a.progressive=65474===g;a.precision=e[o++];const C=(0,n.readUint16)(e,o);o+=2;a.scanLines=t||C;a.samplesPerLine=(0,n.readUint16)(e,o);o+=2;a.components=[];a.componentIds={};const k=e[o++];let v=0,F=0;for(p=0;p<k;p++){const t=e[o],r=e[o+1]>>4,n=15&e[o+1];v<r&&(v=r);F<n&&(F=n);const i=e[o+2];b=a.components.push({h:r,v:n,quantizationId:i,quantizationTable:null});a.componentIds[t]=b-1;o+=3}a.maxH=v;a.maxV=F;prepareComponents(a);break;case 65476:const O=(0,n.readUint16)(e,o);o+=2;for(p=2;p<O;){const t=e[o++],a=new Uint8Array(16);let r=0;for(m=0;m<16;m++,o++)r+=a[m]=e[o];const n=new Uint8Array(r);for(m=0;m<r;m++,o++)n[m]=e[o];p+=17+r;(t>>4==0?f:d)[15&t]=buildHuffmanTable(a,n)}break;case 65501:o+=2;s=(0,n.readUint16)(e,o);o+=2;break;case 65498:const T=1==++h&&!t;o+=2;const M=e[o++],E=[];for(p=0;p<M;p++){const t=e[o++],r=a.componentIds[t],n=a.components[r];n.index=t;const i=e[o++];n.huffmanTableDC=f[i>>4];n.huffmanTableAC=d[15&i];E.push(n)}const D=e[o++],N=e[o++],R=e[o++];try{const t=decodeScan(e,o,a,E,s,D,N,R>>4,15&R,T);o+=t}catch(t){if(t instanceof DNLMarkerError){(0,r.warn)(`${t.message} -- attempting to re-parse the JPEG image.`);return this.parse(e,{dnlScanLines:t.scanLines})}if(t instanceof EOIMarkerError){(0,r.warn)(`${t.message} -- ignoring the rest of the image data.`);break e}throw t}break;case 65500:o+=4;break;case 65535:255!==e[o]&&o--;break;default:const L=findNextFileMarker(e,o-2,o-3);if(L&&L.invalid){(0,r.warn)("JpegImage.parse - unexpected data, current marker is: "+L.invalid);o=L.offset;break}if(!L||o>=e.length-1){(0,r.warn)("JpegImage.parse - reached the end of the image data without finding an EOI marker (0xFFD9).");break e}throw new JpegError("JpegImage.parse - unknown marker: "+g.toString(16))}g=(0,n.readUint16)(e,o);o+=2}this.width=a.samplesPerLine;this.height=a.scanLines;this.jfif=c;this.adobe=l;this.components=[];for(const e of a.components){const t=u[e.quantizationId];t&&(e.quantizationTable=t);this.components.push({index:e.index,output:buildComponentData(0,e),scaleX:e.h/a.maxH,scaleY:e.v/a.maxV,blocksPerLine:e.blocksPerLine,blocksPerColumn:e.blocksPerColumn})}this.numComponents=this.components.length}_getLinearizedBlockData(e,t,a=!1){const r=this.width/e,n=this.height/t;let i,s,o,c,l,h,u,d,f,g,p,m=0;const b=this.components.length,y=e*t*b,w=new Uint8ClampedArray(y),S=new Uint32Array(e),x=4294967288;let C;for(u=0;u<b;u++){i=this.components[u];s=i.scaleX*r;o=i.scaleY*n;m=u;p=i.output;c=i.blocksPerLine+1<<3;if(s!==C){for(l=0;l<e;l++){d=0|l*s;S[l]=(d&x)<<3|7&d}C=s}for(h=0;h<t;h++){d=0|h*o;g=c*(d&x)|(7&d)<<3;for(l=0;l<e;l++){w[m]=p[g+S[l]];m+=b}}}let k=this._decodeTransform;a||4!==b||k||(k=new Int32Array([-256,255,-256,255,-256,255,-256,255]));if(k)for(u=0;u<y;)for(d=0,f=0;d<b;d++,u++,f+=2)w[u]=(w[u]*k[f]>>8)+k[f+1];return w}get _isColorConversionNeeded(){return this.adobe?!!this.adobe.transformCode:3===this.numComponents?0!==this._colorTransform&&(82!==this.components[0].index||71!==this.components[1].index||66!==this.components[2].index):1===this._colorTransform}_convertYccToRgb(e){let t,a,r;for(let n=0,i=e.length;n<i;n+=3){t=e[n];a=e[n+1];r=e[n+2];e[n]=t-179.456+1.402*r;e[n+1]=t+135.459-.344*a-.714*r;e[n+2]=t-226.816+1.772*a}return e}_convertYcckToRgb(e){let t,a,r,n,i=0;for(let s=0,o=e.length;s<o;s+=4){t=e[s];a=e[s+1];r=e[s+2];n=e[s+3];e[i++]=a*(-660635669420364e-19*a+.000437130475926232*r-54080610064599e-18*t+.00048449797120281*n-.154362151871126)-122.67195406894+r*(-.000957964378445773*r+.000817076911346625*t-.00477271405408747*n+1.53380253221734)+t*(.000961250184130688*t-.00266257332283933*n+.48357088451265)+n*(-.000336197177618394*n+.484791561490776);e[i++]=107.268039397724+a*(219927104525741e-19*a-.000640992018297945*r+.000659397001245577*t+.000426105652938837*n-.176491792462875)+r*(-.000778269941513683*r+.00130872261408275*t+.000770482631801132*n-.151051492775562)+t*(.00126935368114843*t-.00265090189010898*n+.25802910206845)+n*(-.000318913117588328*n-.213742400323665);e[i++]=a*(-.000570115196973677*a-263409051004589e-19*r+.0020741088115012*t-.00288260236853442*n+.814272968359295)-20.810012546947+r*(-153496057440975e-19*r-.000132689043961446*t+.000560833691242812*n-.195152027534049)+t*(.00174418132927582*t-.00255243321439347*n+.116935020465145)+n*(-.000343531996510555*n+.24165260232407)}return e.subarray(0,i)}_convertYcckToCmyk(e){let t,a,r;for(let n=0,i=e.length;n<i;n+=4){t=e[n];a=e[n+1];r=e[n+2];e[n]=434.456-t-1.402*r;e[n+1]=119.541-t+.344*a+.714*r;e[n+2]=481.816-t-1.772*a}return e}_convertCmykToRgb(e){let t,a,r,n,i=0;for(let s=0,o=e.length;s<o;s+=4){t=e[s];a=e[s+1];r=e[s+2];n=e[s+3];e[i++]=255+t*(-6747147073602441e-20*t+.0008379262121013727*a+.0002894718188643294*r+.003264231057537806*n-1.1185611867203937)+a*(26374107616089405e-21*a-8626949158638572e-20*r-.0002748769067499491*n-.02155688794978967)+r*(-3878099212869363e-20*r-.0003267808279485286*n+.0686742238595345)-n*(.0003361971776183937*n+.7430659151342254);e[i++]=255+t*(.00013596372813588848*t+.000924537132573585*a+.00010567359618683593*r+.0004791864687436512*n-.3109689587515875)+a*(-.00023545346108370344*a+.0002702845253534714*r+.0020200308977307156*n-.7488052167015494)+r*(6834815998235662e-20*r+.00015168452363460973*n-.09751927774728933)-n*(.0003189131175883281*n+.7364883807733168);e[i++]=255+t*(13598650411385307e-21*t+.00012423956175490851*a+.0004751985097583589*r-36729317476630422e-22*n-.05562186980264034)+a*(.00016141380598724676*a+.0009692239130725186*r+.0007782692450036253*n-.44015232367526463)+r*(5.068882914068769e-7*r+.0017778369011375071*n-.7591454649749609)-n*(.0003435319965105553*n+.7063770186160144)}return e.subarray(0,i)}getData({width:e,height:t,forceRGB:a=!1,isSourcePDF:r=!1}){if(this.numComponents>4)throw new JpegError("Unsupported color mode");const n=this._getLinearizedBlockData(e,t,r);if(1===this.numComponents&&a){const e=new Uint8ClampedArray(3*n.length);let t=0;for(const a of n){e[t++]=a;e[t++]=a;e[t++]=a}return e}if(3===this.numComponents&&this._isColorConversionNeeded)return this._convertYccToRgb(n);if(4===this.numComponents){if(this._isColorConversionNeeded)return a?this._convertYcckToRgb(n):this._convertYcckToCmyk(n);if(a)return this._convertCmykToRgb(n)}return n}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.JpxStream=void 0;var r=a(17),n=a(28),i=a(2);class JpxStream extends r.DecodeStream{constructor(e,t,a){super(t);this.stream=e;this.dict=e.dict;this.maybeLength=t;this.params=a}get bytes(){return(0,i.shadow)(this,"bytes",this.stream.getBytes(this.maybeLength))}ensureBuffer(e){}readBlock(){if(this.eof)return;const e=new n.JpxImage;e.parse(this.bytes);const t=e.width,a=e.height,r=e.componentsCount,i=e.tiles.length;if(1===i)this.buffer=e.tiles[0].items;else{const n=new Uint8ClampedArray(t*a*r);for(let a=0;a<i;a++){const i=e.tiles[a],s=i.width,o=i.height,c=i.left,l=i.top,h=i.items;let u=0,d=(t*l+c)*r;const f=t*r,g=s*r;for(let e=0;e<o;e++){const e=h.subarray(u,u+g);n.set(e,d);u+=g;d+=f}}this.buffer=n}this.bufferLength=this.buffer.length;this.eof=!0}}t.JpxStream=JpxStream},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.JpxImage=void 0;var r=a(2),n=a(3),i=a(24);class JpxError extends r.BaseException{constructor(e){super(`JPX error: ${e}`,"JpxError")}}const s={LL:0,LH:1,HL:1,HH:2};t.JpxImage=class JpxImage{constructor(){this.failOnCorruptedImage=!1}parse(e){if(65359===(0,n.readUint16)(e,0)){this.parseCodestream(e,0,e.length);return}const t=e.length;let a=0;for(;a<t;){let i=8,s=(0,n.readUint32)(e,a);const o=(0,n.readUint32)(e,a+4);a+=i;if(1===s){s=4294967296*(0,n.readUint32)(e,a)+(0,n.readUint32)(e,a+4);a+=8;i+=8}0===s&&(s=t-a+i);if(s<i)throw new JpxError("Invalid box field size");const c=s-i;let l=!0;switch(o){case 1785737832:l=!1;break;case 1668246642:const t=e[a];if(1===t){const t=(0,n.readUint32)(e,a+3);switch(t){case 16:case 17:case 18:break;default:(0,r.warn)("Unknown colorspace "+t)}}else 2===t&&(0,r.info)("ICC profile not supported");break;case 1785737827:this.parseCodestream(e,a,a+c);break;case 1783636e3:218793738!==(0,n.readUint32)(e,a)&&(0,r.warn)("Invalid JP2 signature");break;case 1783634458:case 1718909296:case 1920099697:case 1919251232:case 1768449138:break;default:const i=String.fromCharCode(o>>24&255,o>>16&255,o>>8&255,255&o);(0,r.warn)(`Unsupported header type ${o} (${i}).`)}l&&(a+=c)}}parseImageProperties(e){let t=e.getByte();for(;t>=0;){const a=t;t=e.getByte();if(65361===(a<<8|t)){e.skip(4);const t=e.getInt32()>>>0,a=e.getInt32()>>>0,r=e.getInt32()>>>0,n=e.getInt32()>>>0;e.skip(16);const i=e.getUint16();this.width=t-r;this.height=a-n;this.componentsCount=i;this.bitsPerComponent=8;return}}throw new JpxError("No size marker found in JPX stream")}parseCodestream(e,t,a){const i={};let s=!1;try{let o=t;for(;o+1<a;){const t=(0,n.readUint16)(e,o);o+=2;let a,c,l,h,u,d,f=0;switch(t){case 65359:i.mainHeader=!0;break;case 65497:break;case 65361:f=(0,n.readUint16)(e,o);const g={};g.Xsiz=(0,n.readUint32)(e,o+4);g.Ysiz=(0,n.readUint32)(e,o+8);g.XOsiz=(0,n.readUint32)(e,o+12);g.YOsiz=(0,n.readUint32)(e,o+16);g.XTsiz=(0,n.readUint32)(e,o+20);g.YTsiz=(0,n.readUint32)(e,o+24);g.XTOsiz=(0,n.readUint32)(e,o+28);g.YTOsiz=(0,n.readUint32)(e,o+32);const p=(0,n.readUint16)(e,o+36);g.Csiz=p;const m=[];a=o+38;for(let t=0;t<p;t++){const t={precision:1+(127&e[a]),isSigned:!!(128&e[a]),XRsiz:e[a+1],YRsiz:e[a+2]};a+=3;calculateComponentDimensions(t,g);m.push(t)}i.SIZ=g;i.components=m;calculateTileGrids(i,m);i.QCC=[];i.COC=[];break;case 65372:f=(0,n.readUint16)(e,o);const b={};a=o+2;c=e[a++];switch(31&c){case 0:h=8;u=!0;break;case 1:h=16;u=!1;break;case 2:h=16;u=!0;break;default:throw new Error("Invalid SQcd value "+c)}b.noQuantization=8===h;b.scalarExpounded=u;b.guardBits=c>>5;l=[];for(;a<f+o;){const t={};if(8===h){t.epsilon=e[a++]>>3;t.mu=0}else{t.epsilon=e[a]>>3;t.mu=(7&e[a])<<8|e[a+1];a+=2}l.push(t)}b.SPqcds=l;if(i.mainHeader)i.QCD=b;else{i.currentTile.QCD=b;i.currentTile.QCC=[]}break;case 65373:f=(0,n.readUint16)(e,o);const y={};a=o+2;let w;if(i.SIZ.Csiz<257)w=e[a++];else{w=(0,n.readUint16)(e,a);a+=2}c=e[a++];switch(31&c){case 0:h=8;u=!0;break;case 1:h=16;u=!1;break;case 2:h=16;u=!0;break;default:throw new Error("Invalid SQcd value "+c)}y.noQuantization=8===h;y.scalarExpounded=u;y.guardBits=c>>5;l=[];for(;a<f+o;){const t={};if(8===h){t.epsilon=e[a++]>>3;t.mu=0}else{t.epsilon=e[a]>>3;t.mu=(7&e[a])<<8|e[a+1];a+=2}l.push(t)}y.SPqcds=l;i.mainHeader?i.QCC[w]=y:i.currentTile.QCC[w]=y;break;case 65362:f=(0,n.readUint16)(e,o);const S={};a=o+2;const x=e[a++];S.entropyCoderWithCustomPrecincts=!!(1&x);S.sopMarkerUsed=!!(2&x);S.ephMarkerUsed=!!(4&x);S.progressionOrder=e[a++];S.layersCount=(0,n.readUint16)(e,a);a+=2;S.multipleComponentTransform=e[a++];S.decompositionLevelsCount=e[a++];S.xcb=2+(15&e[a++]);S.ycb=2+(15&e[a++]);const C=e[a++];S.selectiveArithmeticCodingBypass=!!(1&C);S.resetContextProbabilities=!!(2&C);S.terminationOnEachCodingPass=!!(4&C);S.verticallyStripe=!!(8&C);S.predictableTermination=!!(16&C);S.segmentationSymbolUsed=!!(32&C);S.reversibleTransformation=e[a++];if(S.entropyCoderWithCustomPrecincts){const t=[];for(;a<f+o;){const r=e[a++];t.push({PPx:15&r,PPy:r>>4})}S.precinctsSizes=t}const k=[];S.selectiveArithmeticCodingBypass&&k.push("selectiveArithmeticCodingBypass");S.terminationOnEachCodingPass&&k.push("terminationOnEachCodingPass");S.verticallyStripe&&k.push("verticallyStripe");S.predictableTermination&&k.push("predictableTermination");if(k.length>0){s=!0;(0,r.warn)(`JPX: Unsupported COD options (${k.join(", ")}).`)}if(i.mainHeader)i.COD=S;else{i.currentTile.COD=S;i.currentTile.COC=[]}break;case 65424:f=(0,n.readUint16)(e,o);d={};d.index=(0,n.readUint16)(e,o+2);d.length=(0,n.readUint32)(e,o+4);d.dataEnd=d.length+o-2;d.partIndex=e[o+8];d.partsCount=e[o+9];i.mainHeader=!1;if(0===d.partIndex){d.COD=i.COD;d.COC=i.COC.slice(0);d.QCD=i.QCD;d.QCC=i.QCC.slice(0)}i.currentTile=d;break;case 65427:d=i.currentTile;if(0===d.partIndex){initializeTile(i,d.index);buildPackets(i)}f=d.dataEnd-o;parseTilePackets(i,e,o,f);break;case 65363:(0,r.warn)("JPX: Codestream code 0xFF53 (COC) is not implemented.");case 65365:case 65367:case 65368:case 65380:f=(0,n.readUint16)(e,o);break;default:throw new Error("Unknown codestream code: "+t.toString(16))}o+=f}}catch(e){if(s||this.failOnCorruptedImage)throw new JpxError(e.message);(0,r.warn)(`JPX: Trying to recover from: "${e.message}".`)}this.tiles=function transformComponents(e){const t=e.SIZ,a=e.components,r=t.Csiz,n=[];for(let t=0,i=e.tiles.length;t<i;t++){const i=e.tiles[t],s=[];for(let t=0;t<r;t++)s[t]=transformTile(e,i,t);const o=s[0],c=new Uint8ClampedArray(o.items.length*r),l={left:o.left,top:o.top,width:o.width,height:o.height,items:c};let h,u,d,f,g,p,m,b=0;if(i.codingStyleDefaultParameters.multipleComponentTransform){const e=4===r,t=s[0].items,n=s[1].items,o=s[2].items,l=e?s[3].items:null;h=a[0].precision-8;u=.5+(128<<h);const y=i.components[0],w=r-3;f=t.length;if(y.codingStyleParameters.reversibleTransformation)for(d=0;d<f;d++,b+=w){g=t[d]+u;p=n[d];m=o[d];const e=g-(m+p>>2);c[b++]=e+m>>h;c[b++]=e>>h;c[b++]=e+p>>h}else for(d=0;d<f;d++,b+=w){g=t[d]+u;p=n[d];m=o[d];c[b++]=g+1.402*m>>h;c[b++]=g-.34413*p-.71414*m>>h;c[b++]=g+1.772*p>>h}if(e)for(d=0,b=3;d<f;d++,b+=4)c[b]=l[d]+u>>h}else for(let e=0;e<r;e++){const t=s[e].items;h=a[e].precision-8;u=.5+(128<<h);for(b=e,d=0,f=t.length;d<f;d++){c[b]=t[d]+u>>h;b+=r}}n.push(l)}return n}(i);this.width=i.SIZ.Xsiz-i.SIZ.XOsiz;this.height=i.SIZ.Ysiz-i.SIZ.YOsiz;this.componentsCount=i.SIZ.Csiz}};function calculateComponentDimensions(e,t){e.x0=Math.ceil(t.XOsiz/e.XRsiz);e.x1=Math.ceil(t.Xsiz/e.XRsiz);e.y0=Math.ceil(t.YOsiz/e.YRsiz);e.y1=Math.ceil(t.Ysiz/e.YRsiz);e.width=e.x1-e.x0;e.height=e.y1-e.y0}function calculateTileGrids(e,t){const a=e.SIZ,r=[];let n;const i=Math.ceil((a.Xsiz-a.XTOsiz)/a.XTsiz),s=Math.ceil((a.Ysiz-a.YTOsiz)/a.YTsiz);for(let e=0;e<s;e++)for(let t=0;t<i;t++){n={};n.tx0=Math.max(a.XTOsiz+t*a.XTsiz,a.XOsiz);n.ty0=Math.max(a.YTOsiz+e*a.YTsiz,a.YOsiz);n.tx1=Math.min(a.XTOsiz+(t+1)*a.XTsiz,a.Xsiz);n.ty1=Math.min(a.YTOsiz+(e+1)*a.YTsiz,a.Ysiz);n.width=n.tx1-n.tx0;n.height=n.ty1-n.ty0;n.components=[];r.push(n)}e.tiles=r;for(let e=0,i=a.Csiz;e<i;e++){const a=t[e];for(let t=0,i=r.length;t<i;t++){const i={};n=r[t];i.tcx0=Math.ceil(n.tx0/a.XRsiz);i.tcy0=Math.ceil(n.ty0/a.YRsiz);i.tcx1=Math.ceil(n.tx1/a.XRsiz);i.tcy1=Math.ceil(n.ty1/a.YRsiz);i.width=i.tcx1-i.tcx0;i.height=i.tcy1-i.tcy0;n.components[e]=i}}}function getBlocksDimensions(e,t,a){const r=t.codingStyleParameters,n={};if(r.entropyCoderWithCustomPrecincts){n.PPx=r.precinctsSizes[a].PPx;n.PPy=r.precinctsSizes[a].PPy}else{n.PPx=15;n.PPy=15}n.xcb_=a>0?Math.min(r.xcb,n.PPx-1):Math.min(r.xcb,n.PPx);n.ycb_=a>0?Math.min(r.ycb,n.PPy-1):Math.min(r.ycb,n.PPy);return n}function buildPrecincts(e,t,a){const r=1<<a.PPx,n=1<<a.PPy,i=0===t.resLevel,s=1<<a.PPx+(i?0:-1),o=1<<a.PPy+(i?0:-1),c=t.trx1>t.trx0?Math.ceil(t.trx1/r)-Math.floor(t.trx0/r):0,l=t.try1>t.try0?Math.ceil(t.try1/n)-Math.floor(t.try0/n):0,h=c*l;t.precinctParameters={precinctWidth:r,precinctHeight:n,numprecinctswide:c,numprecinctshigh:l,numprecincts:h,precinctWidthInSubband:s,precinctHeightInSubband:o}}function buildCodeblocks(e,t,a){const r=a.xcb_,n=a.ycb_,i=1<<r,s=1<<n,o=t.tbx0>>r,c=t.tby0>>n,l=t.tbx1+i-1>>r,h=t.tby1+s-1>>n,u=t.resolution.precinctParameters,d=[],f=[];let g,p,m,b;for(p=c;p<h;p++)for(g=o;g<l;g++){m={cbx:g,cby:p,tbx0:i*g,tby0:s*p,tbx1:i*(g+1),tby1:s*(p+1)};m.tbx0_=Math.max(t.tbx0,m.tbx0);m.tby0_=Math.max(t.tby0,m.tby0);m.tbx1_=Math.min(t.tbx1,m.tbx1);m.tby1_=Math.min(t.tby1,m.tby1);b=Math.floor((m.tbx0_-t.tbx0)/u.precinctWidthInSubband)+Math.floor((m.tby0_-t.tby0)/u.precinctHeightInSubband)*u.numprecinctswide;m.precinctNumber=b;m.subbandType=t.type;m.Lblock=3;if(m.tbx1_<=m.tbx0_||m.tby1_<=m.tby0_)continue;d.push(m);let e=f[b];if(void 0!==e){g<e.cbxMin?e.cbxMin=g:g>e.cbxMax&&(e.cbxMax=g);p<e.cbyMin?e.cbxMin=p:p>e.cbyMax&&(e.cbyMax=p)}else f[b]=e={cbxMin:g,cbyMin:p,cbxMax:g,cbyMax:p};m.precinct=e}t.codeblockParameters={codeblockWidth:r,codeblockHeight:n,numcodeblockwide:l-o+1,numcodeblockhigh:h-c+1};t.codeblocks=d;t.precincts=f}function createPacket(e,t,a){const r=[],n=e.subbands;for(let e=0,a=n.length;e<a;e++){const a=n[e].codeblocks;for(let e=0,n=a.length;e<n;e++){const n=a[e];n.precinctNumber===t&&r.push(n)}}return{layerNumber:a,codeblocks:r}}function LayerResolutionComponentPositionIterator(e){const t=e.SIZ,a=e.currentTile.index,r=e.tiles[a],n=r.codingStyleDefaultParameters.layersCount,i=t.Csiz;let s=0;for(let e=0;e<i;e++)s=Math.max(s,r.components[e].codingStyleParameters.decompositionLevelsCount);let o=0,c=0,l=0,h=0;this.nextPacket=function JpxImage_nextPacket(){for(;o<n;o++){for(;c<=s;c++){for(;l<i;l++){const e=r.components[l];if(c>e.codingStyleParameters.decompositionLevelsCount)continue;const t=e.resolutions[c],a=t.precinctParameters.numprecincts;for(;h<a;){const e=createPacket(t,h,o);h++;return e}h=0}l=0}c=0}throw new JpxError("Out of packets")}}function ResolutionLayerComponentPositionIterator(e){const t=e.SIZ,a=e.currentTile.index,r=e.tiles[a],n=r.codingStyleDefaultParameters.layersCount,i=t.Csiz;let s=0;for(let e=0;e<i;e++)s=Math.max(s,r.components[e].codingStyleParameters.decompositionLevelsCount);let o=0,c=0,l=0,h=0;this.nextPacket=function JpxImage_nextPacket(){for(;o<=s;o++){for(;c<n;c++){for(;l<i;l++){const e=r.components[l];if(o>e.codingStyleParameters.decompositionLevelsCount)continue;const t=e.resolutions[o],a=t.precinctParameters.numprecincts;for(;h<a;){const e=createPacket(t,h,c);h++;return e}h=0}l=0}c=0}throw new JpxError("Out of packets")}}function ResolutionPositionComponentLayerIterator(e){const t=e.SIZ,a=e.currentTile.index,r=e.tiles[a],n=r.codingStyleDefaultParameters.layersCount,i=t.Csiz;let s,o,c,l,h=0;for(c=0;c<i;c++){const e=r.components[c];h=Math.max(h,e.codingStyleParameters.decompositionLevelsCount)}const u=new Int32Array(h+1);for(o=0;o<=h;++o){let e=0;for(c=0;c<i;++c){const t=r.components[c].resolutions;o<t.length&&(e=Math.max(e,t[o].precinctParameters.numprecincts))}u[o]=e}s=0;o=0;c=0;l=0;this.nextPacket=function JpxImage_nextPacket(){for(;o<=h;o++){for(;l<u[o];l++){for(;c<i;c++){const e=r.components[c];if(o>e.codingStyleParameters.decompositionLevelsCount)continue;const t=e.resolutions[o],a=t.precinctParameters.numprecincts;if(!(l>=a)){for(;s<n;){const e=createPacket(t,l,s);s++;return e}s=0}}c=0}l=0}throw new JpxError("Out of packets")}}function PositionComponentResolutionLayerIterator(e){const t=e.SIZ,a=e.currentTile.index,r=e.tiles[a],n=r.codingStyleDefaultParameters.layersCount,i=t.Csiz,s=getPrecinctSizesInImageScale(r),o=s;let c=0,l=0,h=0,u=0,d=0;this.nextPacket=function JpxImage_nextPacket(){for(;d<o.maxNumHigh;d++){for(;u<o.maxNumWide;u++){for(;h<i;h++){const e=r.components[h],t=e.codingStyleParameters.decompositionLevelsCount;for(;l<=t;l++){const t=e.resolutions[l],a=s.components[h].resolutions[l],r=getPrecinctIndexIfExist(u,d,a,o,t);if(null!==r){for(;c<n;){const e=createPacket(t,r,c);c++;return e}c=0}}l=0}h=0}u=0}throw new JpxError("Out of packets")}}function ComponentPositionResolutionLayerIterator(e){const t=e.SIZ,a=e.currentTile.index,r=e.tiles[a],n=r.codingStyleDefaultParameters.layersCount,i=t.Csiz,s=getPrecinctSizesInImageScale(r);let o=0,c=0,l=0,h=0,u=0;this.nextPacket=function JpxImage_nextPacket(){for(;l<i;++l){const e=r.components[l],t=s.components[l],a=e.codingStyleParameters.decompositionLevelsCount;for(;u<t.maxNumHigh;u++){for(;h<t.maxNumWide;h++){for(;c<=a;c++){const a=e.resolutions[c],r=t.resolutions[c],i=getPrecinctIndexIfExist(h,u,r,t,a);if(null!==i){for(;o<n;){const e=createPacket(a,i,o);o++;return e}o=0}}c=0}h=0}u=0}throw new JpxError("Out of packets")}}function getPrecinctIndexIfExist(e,t,a,r,n){const i=e*r.minWidth,s=t*r.minHeight;if(i%a.width!=0||s%a.height!=0)return null;const o=s/a.width*n.precinctParameters.numprecinctswide;return i/a.height+o}function getPrecinctSizesInImageScale(e){const t=e.components.length;let a=Number.MAX_VALUE,r=Number.MAX_VALUE,n=0,i=0;const s=new Array(t);for(let o=0;o<t;o++){const t=e.components[o],c=t.codingStyleParameters.decompositionLevelsCount,l=new Array(c+1);let h=Number.MAX_VALUE,u=Number.MAX_VALUE,d=0,f=0,g=1;for(let e=c;e>=0;--e){const a=t.resolutions[e],r=g*a.precinctParameters.precinctWidth,n=g*a.precinctParameters.precinctHeight;h=Math.min(h,r);u=Math.min(u,n);d=Math.max(d,a.precinctParameters.numprecinctswide);f=Math.max(f,a.precinctParameters.numprecinctshigh);l[e]={width:r,height:n};g<<=1}a=Math.min(a,h);r=Math.min(r,u);n=Math.max(n,d);i=Math.max(i,f);s[o]={resolutions:l,minWidth:h,minHeight:u,maxNumWide:d,maxNumHigh:f}}return{components:s,minWidth:a,minHeight:r,maxNumWide:n,maxNumHigh:i}}function buildPackets(e){const t=e.SIZ,a=e.currentTile.index,r=e.tiles[a],n=t.Csiz;for(let e=0;e<n;e++){const t=r.components[e],a=t.codingStyleParameters.decompositionLevelsCount,n=[],i=[];for(let e=0;e<=a;e++){const r=getBlocksDimensions(0,t,e),s={},o=1<<a-e;s.trx0=Math.ceil(t.tcx0/o);s.try0=Math.ceil(t.tcy0/o);s.trx1=Math.ceil(t.tcx1/o);s.try1=Math.ceil(t.tcy1/o);s.resLevel=e;buildPrecincts(0,s,r);n.push(s);let c;if(0===e){c={};c.type="LL";c.tbx0=Math.ceil(t.tcx0/o);c.tby0=Math.ceil(t.tcy0/o);c.tbx1=Math.ceil(t.tcx1/o);c.tby1=Math.ceil(t.tcy1/o);c.resolution=s;buildCodeblocks(0,c,r);i.push(c);s.subbands=[c]}else{const n=1<<a-e+1,o=[];c={};c.type="HL";c.tbx0=Math.ceil(t.tcx0/n-.5);c.tby0=Math.ceil(t.tcy0/n);c.tbx1=Math.ceil(t.tcx1/n-.5);c.tby1=Math.ceil(t.tcy1/n);c.resolution=s;buildCodeblocks(0,c,r);i.push(c);o.push(c);c={};c.type="LH";c.tbx0=Math.ceil(t.tcx0/n);c.tby0=Math.ceil(t.tcy0/n-.5);c.tbx1=Math.ceil(t.tcx1/n);c.tby1=Math.ceil(t.tcy1/n-.5);c.resolution=s;buildCodeblocks(0,c,r);i.push(c);o.push(c);c={};c.type="HH";c.tbx0=Math.ceil(t.tcx0/n-.5);c.tby0=Math.ceil(t.tcy0/n-.5);c.tbx1=Math.ceil(t.tcx1/n-.5);c.tby1=Math.ceil(t.tcy1/n-.5);c.resolution=s;buildCodeblocks(0,c,r);i.push(c);o.push(c);s.subbands=o}}t.resolutions=n;t.subbands=i}const i=r.codingStyleDefaultParameters.progressionOrder;switch(i){case 0:r.packetsIterator=new LayerResolutionComponentPositionIterator(e);break;case 1:r.packetsIterator=new ResolutionLayerComponentPositionIterator(e);break;case 2:r.packetsIterator=new ResolutionPositionComponentLayerIterator(e);break;case 3:r.packetsIterator=new PositionComponentResolutionLayerIterator(e);break;case 4:r.packetsIterator=new ComponentPositionResolutionLayerIterator(e);break;default:throw new JpxError(`Unsupported progression order ${i}`)}}function parseTilePackets(e,t,a,r){let i,s=0,o=0,c=!1;function readBits(e){for(;o<e;){const e=t[a+s];s++;if(c){i=i<<7|e;o+=7;c=!1}else{i=i<<8|e;o+=8}255===e&&(c=!0)}o-=e;return i>>>o&(1<<e)-1}function skipMarkerIfEqual(e){if(255===t[a+s-1]&&t[a+s]===e){skipBytes(1);return!0}if(255===t[a+s]&&t[a+s+1]===e){skipBytes(2);return!0}return!1}function skipBytes(e){s+=e}function alignToByte(){o=0;if(c){s++;c=!1}}function readCodingpasses(){if(0===readBits(1))return 1;if(0===readBits(1))return 2;let e=readBits(2);if(e<3)return e+3;e=readBits(5);if(e<31)return e+6;e=readBits(7);return e+37}const l=e.currentTile.index,h=e.tiles[l],u=e.COD.sopMarkerUsed,d=e.COD.ephMarkerUsed,f=h.packetsIterator;for(;s<r;){alignToByte();u&&skipMarkerIfEqual(145)&&skipBytes(4);const e=f.nextPacket();if(!readBits(1))continue;const r=e.layerNumber,i=[];let o;for(let t=0,a=e.codeblocks.length;t<a;t++){o=e.codeblocks[t];let a=o.precinct;const s=o.cbx-a.cbxMin,c=o.cby-a.cbyMin;let l,h,u=!1,d=!1;if(void 0!==o.included)u=!!readBits(1);else{a=o.precinct;let e;if(void 0!==a.inclusionTree)e=a.inclusionTree;else{const t=a.cbxMax-a.cbxMin+1,n=a.cbyMax-a.cbyMin+1;e=new InclusionTree(t,n,r);h=new TagTree(t,n);a.inclusionTree=e;a.zeroBitPlanesTree=h;for(let e=0;e<r;e++)if(0!==readBits(1))throw new JpxError("Invalid tag tree")}if(e.reset(s,c,r))for(;;){if(!readBits(1)){e.incrementValue(r);break}l=!e.nextLevel();if(l){o.included=!0;u=d=!0;break}}}if(!u)continue;if(d){h=a.zeroBitPlanesTree;h.reset(s,c);for(;;)if(readBits(1)){l=!h.nextLevel();if(l)break}else h.incrementValue();o.zeroBitPlanes=h.value}const f=readCodingpasses();for(;readBits(1);)o.Lblock++;const g=(0,n.log2)(f),p=readBits((f<1<<g?g-1:g)+o.Lblock);i.push({codeblock:o,codingpasses:f,dataLength:p})}alignToByte();d&&skipMarkerIfEqual(146);for(;i.length>0;){const e=i.shift();o=e.codeblock;void 0===o.data&&(o.data=[]);o.data.push({data:t,start:a+s,end:a+s+e.dataLength,codingpasses:e.codingpasses});s+=e.dataLength}}return s}function copyCoefficients(e,t,a,r,n,s,c,l,h){const u=r.tbx0,d=r.tby0,f=r.tbx1-r.tbx0,g=r.codeblocks,p="H"===r.type.charAt(0)?1:0,m="H"===r.type.charAt(1)?t:0;for(let a=0,b=g.length;a<b;++a){const b=g[a],y=b.tbx1_-b.tbx0_,w=b.tby1_-b.tby0_;if(0===y||0===w)continue;if(void 0===b.data)continue;const S=new o(y,w,b.subbandType,b.zeroBitPlanes,s);let x=2;const C=b.data;let k,v,F,O=0,T=0;for(k=0,v=C.length;k<v;k++){F=C[k];O+=F.end-F.start;T+=F.codingpasses}const M=new Uint8Array(O);let E=0;for(k=0,v=C.length;k<v;k++){F=C[k];const e=F.data.subarray(F.start,F.end);M.set(e,E);E+=e.length}const D=new i.ArithmeticDecoder(M,0,O);S.setDecoder(D);for(k=0;k<T;k++){switch(x){case 0:S.runSignificancePropagationPass();break;case 1:S.runMagnitudeRefinementPass();break;case 2:S.runCleanupPass();l&&S.checkSegmentationSymbol()}h&&S.reset();x=(x+1)%3}let N=b.tbx0_-u+(b.tby0_-d)*f;const R=S.coefficentsSign,L=S.coefficentsMagnitude,j=S.bitsDecoded,$=c?0:.5;let _,U,X;E=0;const H="LL"!==r.type;for(k=0;k<w;k++){const a=2*(N/f|0)*(t-f)+p+m;for(_=0;_<y;_++){U=L[E];if(0!==U){U=(U+$)*n;0!==R[E]&&(U=-U);X=j[E];const t=H?a+(N<<1):N;e[t]=c&&X>=s?U:U*(1<<s-X)}N++;E++}N+=f-y}}}function transformTile(e,t,a){const r=t.components[a],n=r.codingStyleParameters,i=r.quantizationParameters,o=n.decompositionLevelsCount,c=i.SPqcds,l=i.scalarExpounded,h=i.guardBits,u=n.segmentationSymbolUsed,d=n.resetContextProbabilities,f=e.components[a].precision,g=n.reversibleTransformation,p=g?new ReversibleTransform:new IrreversibleTransform,m=[];let b=0;for(let e=0;e<=o;e++){const t=r.resolutions[e],a=t.trx1-t.trx0,n=t.try1-t.try0,i=new Float32Array(a*n);for(let r=0,n=t.subbands.length;r<n;r++){let n,o;if(l){n=c[b].mu;o=c[b].epsilon;b++}else{n=c[0].mu;o=c[0].epsilon+(e>0?1-e:0)}const p=t.subbands[r],m=s[p.type];copyCoefficients(i,a,0,p,g?1:2**(f+m-o)*(1+n/2048),h+o-1,g,u,d)}m.push({width:a,height:n,items:i})}const y=p.calculate(m,r.tcx0,r.tcy0);return{left:r.tcx0,top:r.tcy0,width:y.width,height:y.height,items:y.items}}function initializeTile(e,t){const a=e.SIZ.Csiz,r=e.tiles[t];for(let t=0;t<a;t++){const a=r.components[t],n=void 0!==e.currentTile.QCC[t]?e.currentTile.QCC[t]:e.currentTile.QCD;a.quantizationParameters=n;const i=void 0!==e.currentTile.COC[t]?e.currentTile.COC[t]:e.currentTile.COD;a.codingStyleParameters=i}r.codingStyleDefaultParameters=e.currentTile.COD}class TagTree{constructor(e,t){const a=(0,n.log2)(Math.max(e,t))+1;this.levels=[];for(let r=0;r<a;r++){const a={width:e,height:t,items:[]};this.levels.push(a);e=Math.ceil(e/2);t=Math.ceil(t/2)}}reset(e,t){let a,r=0,n=0;for(;r<this.levels.length;){a=this.levels[r];const i=e+t*a.width;if(void 0!==a.items[i]){n=a.items[i];break}a.index=i;e>>=1;t>>=1;r++}r--;a=this.levels[r];a.items[a.index]=n;this.currentLevel=r;delete this.value}incrementValue(){const e=this.levels[this.currentLevel];e.items[e.index]++}nextLevel(){let e=this.currentLevel,t=this.levels[e];const a=t.items[t.index];e--;if(e<0){this.value=a;return!1}this.currentLevel=e;t=this.levels[e];t.items[t.index]=a;return!0}}class InclusionTree{constructor(e,t,a){const r=(0,n.log2)(Math.max(e,t))+1;this.levels=[];for(let n=0;n<r;n++){const r=new Uint8Array(e*t);for(let e=0,t=r.length;e<t;e++)r[e]=a;const n={width:e,height:t,items:r};this.levels.push(n);e=Math.ceil(e/2);t=Math.ceil(t/2)}}reset(e,t,a){let r=0;for(;r<this.levels.length;){const n=this.levels[r],i=e+t*n.width;n.index=i;const s=n.items[i];if(255===s)break;if(s>a){this.currentLevel=r;this.propagateValues();return!1}e>>=1;t>>=1;r++}this.currentLevel=r-1;return!0}incrementValue(e){const t=this.levels[this.currentLevel];t.items[t.index]=e+1;this.propagateValues()}propagateValues(){let e=this.currentLevel,t=this.levels[e];const a=t.items[t.index];for(;--e>=0;){t=this.levels[e];t.items[t.index]=a}}nextLevel(){let e=this.currentLevel,t=this.levels[e];const a=t.items[t.index];t.items[t.index]=255;e--;if(e<0)return!1;this.currentLevel=e;t=this.levels[e];t.items[t.index]=a;return!0}}const o=function BitModelClosure(){const e=17,t=new Uint8Array([0,5,8,0,3,7,8,0,4,7,8,0,0,0,0,0,1,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8]),a=new Uint8Array([0,3,4,0,5,7,7,0,8,8,8,0,0,0,0,0,1,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8]),r=new Uint8Array([0,1,2,0,1,2,2,0,2,2,2,0,0,0,0,0,3,4,5,0,4,5,5,0,5,5,5,0,0,0,0,0,6,7,7,0,7,7,7,0,7,7,7,0,0,0,0,0,8,8,8,0,8,8,8,0,8,8,8,0,0,0,0,0,8,8,8,0,8,8,8,0,8,8,8]);return class BitModel{constructor(e,n,i,s,o){this.width=e;this.height=n;let c;c="HH"===i?r:"HL"===i?a:t;this.contextLabelTable=c;const l=e*n;this.neighborsSignificance=new Uint8Array(l);this.coefficentsSign=new Uint8Array(l);let h;h=o>14?new Uint32Array(l):o>6?new Uint16Array(l):new Uint8Array(l);this.coefficentsMagnitude=h;this.processingFlags=new Uint8Array(l);const u=new Uint8Array(l);if(0!==s)for(let e=0;e<l;e++)u[e]=s;this.bitsDecoded=u;this.reset()}setDecoder(e){this.decoder=e}reset(){this.contexts=new Int8Array(19);this.contexts[0]=8;this.contexts[17]=92;this.contexts[18]=6}setNeighborsSignificance(e,t,a){const r=this.neighborsSignificance,n=this.width,i=this.height,s=t>0,o=t+1<n;let c;if(e>0){c=a-n;s&&(r[c-1]+=16);o&&(r[c+1]+=16);r[c]+=4}if(e+1<i){c=a+n;s&&(r[c-1]+=16);o&&(r[c+1]+=16);r[c]+=4}s&&(r[a-1]+=1);o&&(r[a+1]+=1);r[a]|=128}runSignificancePropagationPass(){const e=this.decoder,t=this.width,a=this.height,r=this.coefficentsMagnitude,n=this.coefficentsSign,i=this.neighborsSignificance,s=this.processingFlags,o=this.contexts,c=this.contextLabelTable,l=this.bitsDecoded;for(let h=0;h<a;h+=4)for(let u=0;u<t;u++){let d=h*t+u;for(let f=0;f<4;f++,d+=t){const t=h+f;if(t>=a)break;s[d]&=-2;if(r[d]||!i[d])continue;const g=c[i[d]];if(e.readBit(o,g)){const e=this.decodeSignBit(t,u,d);n[d]=e;r[d]=1;this.setNeighborsSignificance(t,u,d);s[d]|=2}l[d]++;s[d]|=1}}}decodeSignBit(e,t,a){const r=this.width,n=this.height,i=this.coefficentsMagnitude,s=this.coefficentsSign;let o,c,l,h,u,d;h=t>0&&0!==i[a-1];if(t+1<r&&0!==i[a+1]){l=s[a+1];if(h){c=s[a-1];o=1-l-c}else o=1-l-l}else if(h){c=s[a-1];o=1-c-c}else o=0;const f=3*o;h=e>0&&0!==i[a-r];if(e+1<n&&0!==i[a+r]){l=s[a+r];if(h){c=s[a-r];o=1-l-c+f}else o=1-l-l+f}else if(h){c=s[a-r];o=1-c-c+f}else o=f;if(o>=0){u=9+o;d=this.decoder.readBit(this.contexts,u)}else{u=9-o;d=1^this.decoder.readBit(this.contexts,u)}return d}runMagnitudeRefinementPass(){const e=this.decoder,t=this.width,a=this.height,r=this.coefficentsMagnitude,n=this.neighborsSignificance,i=this.contexts,s=this.bitsDecoded,o=this.processingFlags,c=t*a,l=4*t;for(let a,h=0;h<c;h=a){a=Math.min(c,h+l);for(let c=0;c<t;c++)for(let l=h+c;l<a;l+=t){if(!r[l]||0!=(1&o[l]))continue;let t=16;if(0!=(2&o[l])){o[l]^=2;t=0===(127&n[l])?15:14}const a=e.readBit(i,t);r[l]=r[l]<<1|a;s[l]++;o[l]|=1}}}runCleanupPass(){const t=this.decoder,a=this.width,r=this.height,n=this.neighborsSignificance,i=this.coefficentsMagnitude,s=this.coefficentsSign,o=this.contexts,c=this.contextLabelTable,l=this.bitsDecoded,h=this.processingFlags,u=a,d=2*a,f=3*a;let g;for(let p=0;p<r;p=g){g=Math.min(p+4,r);const m=p*a,b=p+3<r;for(let r=0;r<a;r++){const y=m+r;let w,S=0,x=y,C=p;if(b&&0===h[y]&&0===h[y+u]&&0===h[y+d]&&0===h[y+f]&&0===n[y]&&0===n[y+u]&&0===n[y+d]&&0===n[y+f]){if(!t.readBit(o,18)){l[y]++;l[y+u]++;l[y+d]++;l[y+f]++;continue}S=t.readBit(o,e)<<1|t.readBit(o,e);if(0!==S){C=p+S;x+=S*a}w=this.decodeSignBit(C,r,x);s[x]=w;i[x]=1;this.setNeighborsSignificance(C,r,x);h[x]|=2;x=y;for(let e=p;e<=C;e++,x+=a)l[x]++;S++}for(C=p+S;C<g;C++,x+=a){if(i[x]||0!=(1&h[x]))continue;const e=c[n[x]];if(1===t.readBit(o,e)){w=this.decodeSignBit(C,r,x);s[x]=w;i[x]=1;this.setNeighborsSignificance(C,r,x);h[x]|=2}l[x]++}}}}checkSegmentationSymbol(){const t=this.decoder,a=this.contexts;if(10!==(t.readBit(a,e)<<3|t.readBit(a,e)<<2|t.readBit(a,e)<<1|t.readBit(a,e)))throw new JpxError("Invalid segmentation symbol")}}}();class Transform{constructor(){this.constructor===Transform&&(0,r.unreachable)("Cannot initialize Transform.")}calculate(e,t,a){let r=e[0];for(let n=1,i=e.length;n<i;n++)r=this.iterate(r,e[n],t,a);return r}extend(e,t,a){let r=t-1,n=t+1,i=t+a-2,s=t+a;e[r--]=e[n++];e[s++]=e[i--];e[r--]=e[n++];e[s++]=e[i--];e[r--]=e[n++];e[s++]=e[i--];e[r]=e[n];e[s]=e[i]}filter(e,t,a){(0,r.unreachable)("Abstract method `filter` called")}iterate(e,t,a,r){const n=e.width,i=e.height;let s=e.items;const o=t.width,c=t.height,l=t.items;let h,u,d,f,g,p;for(d=0,h=0;h<i;h++){f=2*h*o;for(u=0;u<n;u++,d++,f+=2)l[f]=s[d]}s=e.items=null;const m=new Float32Array(o+8);if(1===o){if(0!=(1&a))for(p=0,d=0;p<c;p++,d+=o)l[d]*=.5}else for(p=0,d=0;p<c;p++,d+=o){m.set(l.subarray(d,d+o),4);this.extend(m,4,o);this.filter(m,4,o);l.set(m.subarray(4,4+o),d)}let b=16;const y=[];for(h=0;h<b;h++)y.push(new Float32Array(c+8));let w,S=0;e=4+c;if(1===c){if(0!=(1&r))for(g=0;g<o;g++)l[g]*=.5}else for(g=0;g<o;g++){if(0===S){b=Math.min(o-g,b);for(d=g,f=4;f<e;d+=o,f++)for(w=0;w<b;w++)y[w][f]=l[d+w];S=b}S--;const t=y[S];this.extend(t,4,c);this.filter(t,4,c);if(0===S){d=g-b+1;for(f=4;f<e;d+=o,f++)for(w=0;w<b;w++)l[d+w]=y[w][f]}}return{width:o,height:c,items:l}}}class IrreversibleTransform extends Transform{filter(e,t,a){const r=a>>1;let n,i,s,o;const c=-1.586134342059924,l=-.052980118572961,h=.882911075530934,u=.443506852043971,d=1.230174104914001;n=(t|=0)-3;for(i=r+4;i--;n+=2)e[n]*=.8128930661159609;n=t-2;s=u*e[n-1];for(i=r+3;i--;n+=2){o=u*e[n+1];e[n]=d*e[n]-s-o;if(!i--)break;n+=2;s=u*e[n+1];e[n]=d*e[n]-s-o}n=t-1;s=h*e[n-1];for(i=r+2;i--;n+=2){o=h*e[n+1];e[n]-=s+o;if(!i--)break;n+=2;s=h*e[n+1];e[n]-=s+o}n=t;s=l*e[n-1];for(i=r+1;i--;n+=2){o=l*e[n+1];e[n]-=s+o;if(!i--)break;n+=2;s=l*e[n+1];e[n]-=s+o}if(0!==r){n=t+1;s=c*e[n-1];for(i=r;i--;n+=2){o=c*e[n+1];e[n]-=s+o;if(!i--)break;n+=2;s=c*e[n+1];e[n]-=s+o}}}}class ReversibleTransform extends Transform{filter(e,t,a){const r=a>>1;let n,i;for(n=t|=0,i=r+1;i--;n+=2)e[n]-=e[n-1]+e[n+1]+2>>2;for(n=t+1,i=r;i--;n+=2)e[n]+=e[n-1]+e[n+1]>>1}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.LZWStream=void 0;var r=a(17);class LZWStream extends r.DecodeStream{constructor(e,t,a){super(t);this.str=e;this.dict=e.dict;this.cachedData=0;this.bitsCached=0;const r=4096,n={earlyChange:a,codeLength:9,nextCode:258,dictionaryValues:new Uint8Array(r),dictionaryLengths:new Uint16Array(r),dictionaryPrevCodes:new Uint16Array(r),currentSequence:new Uint8Array(r),currentSequenceLength:0};for(let e=0;e<256;++e){n.dictionaryValues[e]=e;n.dictionaryLengths[e]=1}this.lzwState=n}readBits(e){let t=this.bitsCached,a=this.cachedData;for(;t<e;){const e=this.str.getByte();if(-1===e){this.eof=!0;return null}a=a<<8|e;t+=8}this.bitsCached=t-=e;this.cachedData=a;this.lastCode=null;return a>>>t&(1<<e)-1}readBlock(){let e,t,a,r=1024;const n=this.lzwState;if(!n)return;const i=n.earlyChange;let s=n.nextCode;const o=n.dictionaryValues,c=n.dictionaryLengths,l=n.dictionaryPrevCodes;let h=n.codeLength,u=n.prevCode;const d=n.currentSequence;let f=n.currentSequenceLength,g=0,p=this.bufferLength,m=this.ensureBuffer(this.bufferLength+r);for(e=0;e<512;e++){const e=this.readBits(h),n=f>0;if(e<256){d[0]=e;f=1}else{if(!(e>=258)){if(256===e){h=9;s=258;f=0;continue}this.eof=!0;delete this.lzwState;break}if(e<s){f=c[e];for(t=f-1,a=e;t>=0;t--){d[t]=o[a];a=l[a]}}else d[f++]=d[0]}if(n){l[s]=u;c[s]=c[u]+1;o[s]=d[0];s++;h=s+i&s+i-1?h:0|Math.min(Math.log(s+i)/.6931471805599453+1,12)}u=e;g+=f;if(r<g){do{r+=512}while(r<g);m=this.ensureBuffer(this.bufferLength+r)}for(t=0;t<f;t++)m[p++]=d[t]}n.nextCode=s;n.codeLength=h;n.prevCode=u;n.currentSequenceLength=f;this.bufferLength=p}}t.LZWStream=LZWStream},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.PredictorStream=void 0;var r=a(17),n=a(4),i=a(2);class PredictorStream extends r.DecodeStream{constructor(e,t,a){super(t);if(!(a instanceof n.Dict))return e;const r=this.predictor=a.get("Predictor")||1;if(r<=1)return e;if(2!==r&&(r<10||r>15))throw new i.FormatError(`Unsupported predictor: ${r}`);this.readBlock=2===r?this.readBlockTiff:this.readBlockPng;this.str=e;this.dict=e.dict;const s=this.colors=a.get("Colors")||1,o=this.bits=a.get("BPC","BitsPerComponent")||8,c=this.columns=a.get("Columns")||1;this.pixBytes=s*o+7>>3;this.rowBytes=c*s*o+7>>3;return this}readBlockTiff(){const e=this.rowBytes,t=this.bufferLength,a=this.ensureBuffer(t+e),r=this.bits,n=this.colors,i=this.str.getBytes(e);this.eof=!i.length;if(this.eof)return;let s,o=0,c=0,l=0,h=0,u=t;if(1===r&&1===n)for(s=0;s<e;++s){let e=i[s]^o;e^=e>>1;e^=e>>2;e^=e>>4;o=(1&e)<<7;a[u++]=e}else if(8===r){for(s=0;s<n;++s)a[u++]=i[s];for(;s<e;++s){a[u]=a[u-n]+i[s];u++}}else if(16===r){const t=2*n;for(s=0;s<t;++s)a[u++]=i[s];for(;s<e;s+=2){const e=((255&i[s])<<8)+(255&i[s+1])+((255&a[u-t])<<8)+(255&a[u-t+1]);a[u++]=e>>8&255;a[u++]=255&e}}else{const e=new Uint8Array(n+1),u=(1<<r)-1;let d=0,f=t;const g=this.columns;for(s=0;s<g;++s)for(let t=0;t<n;++t){if(l<r){o=o<<8|255&i[d++];l+=8}e[t]=e[t]+(o>>l-r)&u;l-=r;c=c<<r|e[t];h+=r;if(h>=8){a[f++]=c>>h-8&255;h-=8}}h>0&&(a[f++]=(c<<8-h)+(o&(1<<8-h)-1))}this.bufferLength+=e}readBlockPng(){const e=this.rowBytes,t=this.pixBytes,a=this.str.getByte(),r=this.str.getBytes(e);this.eof=!r.length;if(this.eof)return;const n=this.bufferLength,s=this.ensureBuffer(n+e);let o=s.subarray(n-e,n);0===o.length&&(o=new Uint8Array(e));let c,l,h,u=n;switch(a){case 0:for(c=0;c<e;++c)s[u++]=r[c];break;case 1:for(c=0;c<t;++c)s[u++]=r[c];for(;c<e;++c){s[u]=s[u-t]+r[c]&255;u++}break;case 2:for(c=0;c<e;++c)s[u++]=o[c]+r[c]&255;break;case 3:for(c=0;c<t;++c)s[u++]=(o[c]>>1)+r[c];for(;c<e;++c){s[u]=(o[c]+s[u-t]>>1)+r[c]&255;u++}break;case 4:for(c=0;c<t;++c){l=o[c];h=r[c];s[u++]=l+h}for(;c<e;++c){l=o[c];const e=o[c-t],a=s[u-t],n=a+l-e;let i=n-a;i<0&&(i=-i);let d=n-l;d<0&&(d=-d);let f=n-e;f<0&&(f=-f);h=r[c];s[u++]=i<=d&&i<=f?a+h:d<=f?l+h:e+h}break;default:throw new i.FormatError(`Unsupported predictor: ${a}`)}this.bufferLength+=e}}t.PredictorStream=PredictorStream},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.RunLengthStream=void 0;var r=a(17);class RunLengthStream extends r.DecodeStream{constructor(e,t){super(t);this.str=e;this.dict=e.dict}readBlock(){const e=this.str.getBytes(2);if(!e||e.length<2||128===e[0]){this.eof=!0;return}let t,a=this.bufferLength,r=e[0];if(r<128){t=this.ensureBuffer(a+r+1);t[a++]=e[1];if(r>0){const e=this.str.getBytes(r);t.set(e,a);a+=r}}else{r=257-r;const n=e[1];t=this.ensureBuffer(a+r+1);for(let e=0;e<r;e++)t[a++]=n}this.bufferLength=a}}t.RunLengthStream=RunLengthStream},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.Font=t.ErrorFont=void 0;var r=a(2),n=a(33),i=a(36),s=a(38),o=a(37),c=a(35),l=a(39),h=a(40),u=a(41),d=a(42),f=a(43),g=a(44),p=a(14),m=a(45),b=a(3),y=a(8),w=a(46);const S=[[57344,63743],[1048576,1114109]],x=1e3,C=["ascent","bbox","black","bold","charProcOperatorList","composite","cssFontInfo","data","defaultVMetrics","defaultWidth","descent","fallbackName","fontMatrix","isInvalidPDFjsFont","isType3Font","italic","loadedName","mimetype","missingFile","name","remeasure","subtype","type","vertical"],k=["cMap","defaultEncoding","differences","isMonospace","isSerifFont","isSymbolicFont","seacMap","toFontChar","toUnicode","vmetrics","widths"];function adjustWidths(e){if(!e.fontMatrix)return;if(e.fontMatrix[0]===r.FONT_IDENTITY_MATRIX[0])return;const t=.001/e.fontMatrix[0],a=e.widths;for(const e in a)a[e]*=t;e.defaultWidth*=t}function amendFallbackToUnicode(e){if(!e.fallbackToUnicode)return;if(e.toUnicode instanceof h.IdentityToUnicodeMap)return;const t=[];for(const a in e.fallbackToUnicode)e.toUnicode.has(a)||(t[a]=e.fallbackToUnicode[a]);t.length>0&&e.toUnicode.amend(t)}class Glyph{constructor(e,t,a,r,n,i,s,o,c){this.originalCharCode=e;this.fontChar=t;this.unicode=a;this.accent=r;this.width=n;this.vmetric=i;this.operatorListId=s;this.isSpace=o;this.isInFont=c}get category(){return(0,r.shadow)(this,"category",(0,s.getCharUnicodeCategory)(this.unicode),!0)}get normalizedUnicode(){return(0,r.shadow)(this,"normalizedUnicode",(0,s.reverseIfRtl)(Glyph._NormalizedUnicodes[this.unicode]||this.unicode),!0)}static get _NormalizedUnicodes(){return(0,r.shadow)(this,"_NormalizedUnicodes",(0,s.getNormalizedUnicodes)())}}function int16(e,t){return(e<<8)+t}function writeSignedInt16(e,t,a){e[t+1]=a;e[t]=a>>>8}function signedInt16(e,t){const a=(e<<8)+t;return 32768&a?a-65536:a}function string16(e){return String.fromCharCode(e>>8&255,255&e)}function safeString16(e){e>32767?e=32767:e<-32768&&(e=-32768);return String.fromCharCode(e>>8&255,255&e)}function isTrueTypeCollectionFile(e){const t=e.peekBytes(4);return"ttcf"===(0,r.bytesToString)(t)}function getFontFileType(e,{type:t,subtype:a,composite:n}){let i,s;if(function isTrueTypeFile(e){const t=e.peekBytes(4);return 65536===(0,b.readUint32)(t,0)||"true"===(0,r.bytesToString)(t)}(e)||isTrueTypeCollectionFile(e))i=n?"CIDFontType2":"TrueType";else if(function isOpenTypeFile(e){const t=e.peekBytes(4);return"OTTO"===(0,r.bytesToString)(t)}(e))i=n?"CIDFontType2":"OpenType";else if(function isType1File(e){const t=e.peekBytes(2);return 37===t[0]&&33===t[1]||128===t[0]&&1===t[1]}(e))i=n?"CIDFontType0":"MMType1"===t?"MMType1":"Type1";else if(function isCFFFile(e){const t=e.peekBytes(4);return t[0]>=1&&t[3]>=1&&t[3]<=4}(e))if(n){i="CIDFontType0";s="CIDFontType0C"}else{i="MMType1"===t?"MMType1":"Type1";s="Type1C"}else{(0,r.warn)("getFontFileType: Unable to detect correct font file Type/Subtype.");i=t;s=a}return[i,s]}function applyStandardFontGlyphMap(e,t){for(const a in t)e[+a]=t[a]}function buildToFontChar(e,t,a){const r=[];let n;for(let a=0,i=e.length;a<i;a++){n=(0,s.getUnicodeForGlyph)(e[a],t);-1!==n&&(r[a]=n)}for(const e in a){n=(0,s.getUnicodeForGlyph)(a[e],t);-1!==n&&(r[+e]=n)}return r}function isMacNameRecord(e){return 1===e.platform&&0===e.encoding&&0===e.language}function isWinNameRecord(e){return 3===e.platform&&1===e.encoding&&1033===e.language}function convertCidString(e,t,a=!1){switch(t.length){case 1:return t.charCodeAt(0);case 2:return t.charCodeAt(0)<<8|t.charCodeAt(1)}const n=`Unsupported CID string (charCode ${e}): "${t}".`;if(a)throw new r.FormatError(n);(0,r.warn)(n);return t}function adjustMapping(e,t,a,n){const i=Object.create(null),s=new Map,o=[],c=new Set;let l=0;const h=S[l][0];let u=h,d=S[l][1];for(let f in e){f|=0;let g=e[f];if(!t(g))continue;if(u>d){l++;if(l>=S.length){(0,r.warn)("Ran out of space in font private use area.");break}u=S[l][0];d=S[l][1]}const p=u++;0===g&&(g=a);let m=n.get(f);"string"==typeof m&&(m=m.codePointAt(0));if(m&&m<h&&!c.has(g)){s.set(m,g);c.add(g)}i[p]=g;o[f]=p}return{toFontChar:o,charCodeToGlyphId:i,toUnicodeExtraMap:s,nextAvailableFontCharCode:u}}function createCmapTable(e,t,a){const n=function getRanges(e,t,a){const r=[];for(const t in e)e[t]>=a||r.push({fontCharCode:0|t,glyphId:e[t]});if(t)for(const[e,n]of t)n>=a||r.push({fontCharCode:e,glyphId:n});0===r.length&&r.push({fontCharCode:0,glyphId:0});r.sort((function fontGetRangesSort(e,t){return e.fontCharCode-t.fontCharCode}));const n=[],i=r.length;for(let e=0;e<i;){const t=r[e].fontCharCode,a=[r[e].glyphId];++e;let s=t;for(;e<i&&s+1===r[e].fontCharCode;){a.push(r[e].glyphId);++s;++e;if(65535===s)break}n.push([t,s,a])}return n}(e,t,a),i=n.at(-1)[1]>65535?2:1;let s,o,c,l,h="\0\0"+string16(i)+"\0\0"+(0,r.string32)(4+8*i);for(s=n.length-1;s>=0&&!(n[s][0]<=65535);--s);const u=s+1;n[s][0]<65535&&65535===n[s][1]&&(n[s][1]=65534);const d=n[s][1]<65535?1:0,f=u+d,g=m.OpenTypeFileBuilder.getSearchParams(f,2);let p,b,y,w,S="",x="",C="",k="",v="",F=0;for(s=0,o=u;s<o;s++){p=n[s];b=p[0];y=p[1];S+=string16(b);x+=string16(y);w=p[2];let e=!0;for(c=1,l=w.length;c<l;++c)if(w[c]!==w[c-1]+1){e=!1;break}if(e){C+=string16(w[0]-b&65535);k+=string16(0)}else{const e=2*(f-s)+2*F;F+=y-b+1;C+=string16(0);k+=string16(e);for(c=0,l=w.length;c<l;++c)v+=string16(w[c])}}if(d>0){x+="ÿÿ";S+="ÿÿ";C+="\0";k+="\0\0"}const O="\0\0"+string16(2*f)+string16(g.range)+string16(g.entry)+string16(g.rangeShift)+x+"\0\0"+S+C+k+v;let T="",M="";if(i>1){h+="\0\0\n"+(0,r.string32)(4+8*i+4+O.length);T="";for(s=0,o=n.length;s<o;s++){p=n[s];b=p[0];w=p[2];let e=w[0];for(c=1,l=w.length;c<l;++c)if(w[c]!==w[c-1]+1){y=p[0]+c-1;T+=(0,r.string32)(b)+(0,r.string32)(y)+(0,r.string32)(e);b=y+1;e=w[c]}T+=(0,r.string32)(b)+(0,r.string32)(p[1])+(0,r.string32)(e)}M="\0\f\0\0"+(0,r.string32)(T.length+16)+"\0\0\0\0"+(0,r.string32)(T.length/12)}return h+"\0"+string16(O.length+4)+O+M+T}function createOS2Table(e,t,a){a=a||{unitsPerEm:0,yMax:0,yMin:0,ascent:0,descent:0};let n=0,i=0,o=0,c=0,l=null,h=0;if(t){for(let e in t){e|=0;(l>e||!l)&&(l=e);h<e&&(h=e);const t=(0,s.getUnicodeRangeFor)(e);if(t<32)n|=1<<t;else if(t<64)i|=1<<t-32;else if(t<96)o|=1<<t-64;else{if(!(t<123))throw new r.FormatError("Unicode ranges Bits > 123 are reserved for internal usage");c|=1<<t-96}}h>65535&&(h=65535)}else{l=0;h=255}const u=e.bbox||[0,0,0,0],d=a.unitsPerEm||1/(e.fontMatrix||r.FONT_IDENTITY_MATRIX)[0],f=e.ascentScaled?1:d/x,g=a.ascent||Math.round(f*(e.ascent||u[3]));let p=a.descent||Math.round(f*(e.descent||u[1]));p>0&&e.descent>0&&u[1]<0&&(p=-p);const m=a.yMax||g,b=-a.yMin||-p;return"\0$ô\0\0\0Š»\0\0\0ŒŠ»\0\0ß\x001\0\0\0\0"+String.fromCharCode(e.fixedPitch?9:0)+"\0\0\0\0\0\0"+(0,r.string32)(n)+(0,r.string32)(i)+(0,r.string32)(o)+(0,r.string32)(c)+"*21*"+string16(e.italicAngle?1:0)+string16(l||e.firstChar)+string16(h||e.lastChar)+string16(g)+string16(p)+"\0d"+string16(m)+string16(b)+"\0\0\0\0\0\0\0\0"+string16(e.xHeight)+string16(e.capHeight)+string16(0)+string16(l||e.firstChar)+"\0"}function createPostTable(e){const t=Math.floor(65536*e.italicAngle);return"\0\0\0"+(0,r.string32)(t)+"\0\0\0\0"+(0,r.string32)(e.fixedPitch?1:0)+"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}function createPostscriptName(e){return e.replace(/[^\x21-\x7E]|[[\](){}<>/%]/g,"").slice(0,63)}function createNameTable(e,t){t||(t=[[],[]]);const a=[t[0][0]||"Original licence",t[0][1]||e,t[0][2]||"Unknown",t[0][3]||"uniqueID",t[0][4]||e,t[0][5]||"Version 0.11",t[0][6]||createPostscriptName(e),t[0][7]||"Unknown",t[0][8]||"Unknown",t[0][9]||"Unknown"],r=[];let n,i,s,o,c;for(n=0,i=a.length;n<i;n++){c=t[1][n]||a[n];const e=[];for(s=0,o=c.length;s<o;s++)e.push(string16(c.charCodeAt(s)));r.push(e.join(""))}const l=[a,r],h=["\0","\0"],u=["\0\0","\0"],d=["\0\0","\t"],f=a.length*h.length;let g="\0\0"+string16(f)+string16(12*f+6),p=0;for(n=0,i=h.length;n<i;n++){const e=l[n];for(s=0,o=e.length;s<o;s++){c=e[s];g+=h[n]+u[n]+d[n]+string16(s)+string16(c.length)+string16(p);p+=c.length}}g+=a.join("")+r.join("");return g}t.Font=class Font{constructor(e,t,a){this.name=e;this.psName=null;this.mimetype=null;this.disableFontFace=!1;this.loadedName=a.loadedName;this.isType3Font=a.isType3Font;this.missingFile=!1;this.cssFontInfo=a.cssFontInfo;this._charsCache=Object.create(null);this._glyphCache=Object.create(null);let n=!!(a.flags&i.FontFlags.Serif);if(!n&&!a.isSimulatedFlags){const t=e.replace(/[,_]/g,"-").split("-")[0],a=(0,l.getSerifFonts)();for(const e of t.split("+"))if(a[e]){n=!0;break}}this.isSerifFont=n;this.isSymbolicFont=!!(a.flags&i.FontFlags.Symbolic);this.isMonospace=!!(a.flags&i.FontFlags.FixedPitch);let{type:s,subtype:o}=a;this.type=s;this.subtype=o;const c=e.match(/^InvalidPDFjsFont_(.*)_\d+$/);this.isInvalidPDFjsFont=!!c;this.isInvalidPDFjsFont?this.fallbackName=c[1]:this.isMonospace?this.fallbackName="monospace":this.isSerifFont?this.fallbackName="serif":this.fallbackName="sans-serif";this.differences=a.differences;this.widths=a.widths;this.defaultWidth=a.defaultWidth;this.composite=a.composite;this.cMap=a.cMap;this.capHeight=a.capHeight/x;this.ascent=a.ascent/x;this.descent=a.descent/x;this.lineHeight=this.ascent-this.descent;this.fontMatrix=a.fontMatrix;this.bbox=a.bbox;this.defaultEncoding=a.defaultEncoding;this.toUnicode=a.toUnicode;this.toFontChar=[];if("Type3"===a.type){for(let e=0;e<256;e++)this.toFontChar[e]=this.differences[e]||a.defaultEncoding[e];return}this.cidEncoding=a.cidEncoding||"";this.vertical=!!a.vertical;if(this.vertical){this.vmetrics=a.vmetrics;this.defaultVMetrics=a.defaultVMetrics}if(!t||t.isEmpty){t&&(0,r.warn)('Font file is empty in "'+e+'" ('+this.loadedName+")");this.fallbackToSystemFont(a);return}[s,o]=getFontFileType(t,a);s===this.type&&o===this.subtype||(0,r.info)(`Inconsistent font file Type/SubType, expected: ${this.type}/${this.subtype} but found: ${s}/${o}.`);let h;try{switch(s){case"MMType1":(0,r.info)("MMType1 font ("+e+"), falling back to Type1.");case"Type1":case"CIDFontType0":this.mimetype="font/opentype";const n="Type1C"===o||"CIDFontType0C"===o?new u.CFFFont(t,a):new w.Type1Font(e,t,a);adjustWidths(a);h=this.convert(e,n,a);break;case"OpenType":case"TrueType":case"CIDFontType2":this.mimetype="font/opentype";h=this.checkAndRepair(e,t,a);if(this.isOpenType){adjustWidths(a);s="OpenType"}break;default:throw new r.FormatError(`Font ${s} is not supported`)}}catch(e){(0,r.warn)(e);this.fallbackToSystemFont(a);return}amendFallbackToUnicode(a);this.data=h;this.type=s;this.subtype=o;this.fontMatrix=a.fontMatrix;this.widths=a.widths;this.defaultWidth=a.defaultWidth;this.toUnicode=a.toUnicode;this.seacMap=a.seacMap}get renderer(){const e=d.FontRendererFactory.create(this,i.SEAC_ANALYSIS_ENABLED);return(0,r.shadow)(this,"renderer",e)}exportData(e=!1){const t=e?[...C,...k]:C,a=Object.create(null);let r,n;for(r of t){n=this[r];void 0!==n&&(a[r]=n)}return a}fallbackToSystemFont(e){this.missingFile=!0;const{name:t,type:a}=this;let n=(0,i.normalizeFontName)(t);const u=(0,l.getStdFontMap)(),d=(0,l.getNonStdFontMap)(),g=!!u[n],p=!(!d[n]||!u[d[n]]);n=u[n]||d[n]||n;const m=(0,f.getFontBasicMetrics)()[n];if(m){isNaN(this.ascent)&&(this.ascent=m.ascent/x);isNaN(this.descent)&&(this.descent=m.descent/x);isNaN(this.capHeight)&&(this.capHeight=m.capHeight/x)}this.bold=/bold/gi.test(n);this.italic=/oblique|italic/gi.test(n);this.black=/Black/g.test(t);const b=/Narrow/g.test(t);this.remeasure=(!g||b)&&Object.keys(this.widths).length>0;if((g||p)&&"CIDFontType2"===a&&this.cidEncoding.startsWith("Identity-")){const a=e.cidToGidMap,r=[];applyStandardFontGlyphMap(r,(0,l.getGlyphMapForStandardFonts)());/Arial-?Black/i.test(t)?applyStandardFontGlyphMap(r,(0,l.getSupplementalGlyphMapForArialBlack)()):/Calibri/i.test(t)&&applyStandardFontGlyphMap(r,(0,l.getSupplementalGlyphMapForCalibri)());if(a){for(const e in r){const t=r[e];void 0!==a[t]&&(r[+e]=a[t])}a.length!==this.toUnicode.length&&e.hasIncludedToUnicodeMap&&this.toUnicode instanceof h.IdentityToUnicodeMap&&this.toUnicode.forEach((function(e,t){const n=r[e];void 0===a[n]&&(r[+e]=t)}))}this.toUnicode instanceof h.IdentityToUnicodeMap||this.toUnicode.forEach((function(e,t){r[+e]=t}));this.toFontChar=r;this.toUnicode=new h.ToUnicodeMap(r)}else if(/Symbol/i.test(n))this.toFontChar=buildToFontChar(c.SymbolSetEncoding,(0,o.getGlyphsUnicode)(),this.differences);else if(/Dingbats/i.test(n)){/Wingdings/i.test(t)&&(0,r.warn)("Non-embedded Wingdings font, falling back to ZapfDingbats.");this.toFontChar=buildToFontChar(c.ZapfDingbatsEncoding,(0,o.getDingbatsGlyphsUnicode)(),this.differences)}else if(g){const e=buildToFontChar(this.defaultEncoding,(0,o.getGlyphsUnicode)(),this.differences);"CIDFontType2"!==a||this.cidEncoding.startsWith("Identity-")||this.toUnicode instanceof h.IdentityToUnicodeMap||this.toUnicode.forEach((function(t,a){e[+t]=a}));this.toFontChar=e}else{const e=(0,o.getGlyphsUnicode)(),a=[];this.toUnicode.forEach(((t,r)=>{if(!this.composite){const a=this.differences[t]||this.defaultEncoding[t],n=(0,s.getUnicodeForGlyph)(a,e);-1!==n&&(r=n)}a[+t]=r}));this.composite&&this.toUnicode instanceof h.IdentityToUnicodeMap&&/Tahoma|Verdana/i.test(t)&&applyStandardFontGlyphMap(a,(0,l.getGlyphMapForStandardFonts)());this.toFontChar=a}amendFallbackToUnicode(e);this.loadedName=n.split("-")[0]}checkAndRepair(e,t,a){const s=["OS/2","cmap","head","hhea","hmtx","maxp","name","post","loca","glyf","fpgm","prep","cvt ","CFF "];function readTables(e,t){const a=Object.create(null);a["OS/2"]=null;a.cmap=null;a.head=null;a.hhea=null;a.hmtx=null;a.maxp=null;a.name=null;a.post=null;for(let r=0;r<t;r++){const t=readTableEntry(e);s.includes(t.tag)&&(0!==t.length&&(a[t.tag]=t))}return a}function readTableEntry(e){const t=e.getString(4),a=e.getInt32()>>>0,r=e.getInt32()>>>0,n=e.getInt32()>>>0,i=e.pos;e.pos=e.start||0;e.skip(r);const s=e.getBytes(n);e.pos=i;if("head"===t){s[8]=s[9]=s[10]=s[11]=0;s[17]|=32}return{tag:t,checksum:a,length:n,offset:r,data:s}}function readOpenTypeHeader(e){return{version:e.getString(4),numTables:e.getUint16(),searchRange:e.getUint16(),entrySelector:e.getUint16(),rangeShift:e.getUint16()}}function sanitizeGlyph(e,t,a,r,n,i){const s={length:0,sizeOfInstructions:0};if(a-t<=12)return s;const o=e.subarray(t,a);let c=signedInt16(o[0],o[1]);if(c<0){c=-1;writeSignedInt16(o,0,c);r.set(o,n);s.length=o.length;return s}let l,h=10,u=0;for(l=0;l<c;l++){u=(o[h]<<8|o[h+1])+1;h+=2}const d=h,f=o[h]<<8|o[h+1];s.sizeOfInstructions=f;h+=2+f;const g=h;let p=0;for(l=0;l<u;l++){const e=o[h++];192&e&&(o[h-1]=63&e);let t=2;2&e?t=1:16&e&&(t=0);let a=2;4&e?a=1:32&e&&(a=0);const r=t+a;p+=r;if(8&e){const e=o[h++];l+=e;p+=e*r}}if(0===p)return s;let m=h+p;if(m>o.length)return s;if(!i&&f>0){r.set(o.subarray(0,d),n);r.set([0,0],n+d);r.set(o.subarray(g,m),n+d+2);m-=f;o.length-m>3&&(m=m+3&-4);s.length=m;return s}if(o.length-m>3){m=m+3&-4;r.set(o.subarray(0,m),n);s.length=m;return s}r.set(o,n);s.length=o.length;return s}function readNameTable(e){const a=(t.start||0)+e.offset;t.pos=a;const r=[[],[]],n=[],i=e.length,s=a+i;if(0!==t.getUint16()||i<6)return[r,n];const o=t.getUint16(),c=t.getUint16();let l,h;for(l=0;l<o&&t.pos+12<=s;l++){const e={platform:t.getUint16(),encoding:t.getUint16(),language:t.getUint16(),name:t.getUint16(),length:t.getUint16(),offset:t.getUint16()};(isMacNameRecord(e)||isWinNameRecord(e))&&n.push(e)}for(l=0,h=n.length;l<h;l++){const e=n[l];if(e.length<=0)continue;const i=a+c+e.offset;if(i+e.length>s)continue;t.pos=i;const o=e.name;if(e.encoding){let a="";for(let r=0,n=e.length;r<n;r+=2)a+=String.fromCharCode(t.getUint16());r[1][o]=a}else r[0][o]=t.getString(e.length)}return[r,n]}const l=[0,0,0,0,0,0,0,0,-2,-2,-2,-2,0,0,-2,-5,-1,-1,-1,-1,-1,-1,-1,-1,0,0,-1,0,-1,-1,-1,-1,1,-1,-999,0,1,0,-1,-2,0,-1,-2,-1,-1,0,-1,-1,0,0,-999,-999,-1,-1,-1,-1,-2,-999,-2,-2,-999,0,-2,-2,0,0,-2,0,-2,0,0,0,-2,-1,-1,1,1,0,0,-1,-1,-1,-1,-1,-1,-1,0,0,-1,0,-1,-1,0,-999,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,0,0,0,0,0,-2,-999,-999,-999,-999,-999,-1,-1,-2,-2,0,0,0,0,-1,-1,-999,-2,-2,0,0,-1,-2,-2,0,0,0,-1,-1,-1,-2];function sanitizeTTProgram(e,t){let a,n,i,s,o,c=e.data,h=0,u=0,d=0;const f=[],g=[],p=[];let m=t.tooComplexToFollowFunctions,b=!1,y=0,w=0;for(let e=c.length;h<e;){const e=c[h++];if(64===e){n=c[h++];if(b||w)h+=n;else for(a=0;a<n;a++)f.push(c[h++])}else if(65===e){n=c[h++];if(b||w)h+=2*n;else for(a=0;a<n;a++){i=c[h++];f.push(i<<8|c[h++])}}else if(176==(248&e)){n=e-176+1;if(b||w)h+=n;else for(a=0;a<n;a++)f.push(c[h++])}else if(184==(248&e)){n=e-184+1;if(b||w)h+=2*n;else for(a=0;a<n;a++){i=c[h++];f.push(i<<8|c[h++])}}else if(43!==e||m)if(44!==e||m){if(45===e)if(b){b=!1;u=h}else{o=g.pop();if(!o){(0,r.warn)("TT: ENDF bad stack");t.hintsValid=!1;return}s=p.pop();c=o.data;h=o.i;t.functionsStackDeltas[s]=f.length-o.stackTop}else if(137===e){if(b||w){(0,r.warn)("TT: nested IDEFs not allowed");m=!0}b=!0;d=h}else if(88===e)++y;else if(27===e)w=y;else if(89===e){w===y&&(w=0);--y}else if(28===e&&!b&&!w){const e=f.at(-1);e>0&&(h+=e-1)}}else{if(b||w){(0,r.warn)("TT: nested FDEFs not allowed");m=!0}b=!0;d=h;s=f.pop();t.functionsDefined[s]={data:c,i:h}}else if(!b&&!w){s=f.at(-1);if(isNaN(s))(0,r.info)("TT: CALL empty stack (or invalid entry).");else{t.functionsUsed[s]=!0;if(s in t.functionsStackDeltas){const e=f.length+t.functionsStackDeltas[s];if(e<0){(0,r.warn)("TT: CALL invalid functions stack delta.");t.hintsValid=!1;return}f.length=e}else if(s in t.functionsDefined&&!p.includes(s)){g.push({data:c,i:h,stackTop:f.length-1});p.push(s);o=t.functionsDefined[s];if(!o){(0,r.warn)("TT: CALL non-existent function");t.hintsValid=!1;return}c=o.data;h=o.i}}}if(!b&&!w){let t=0;e<=142?t=l[e]:e>=192&&e<=223?t=-1:e>=224&&(t=-2);if(e>=113&&e<=117){n=f.pop();isNaN(n)||(t=2*-n)}for(;t<0&&f.length>0;){f.pop();t++}for(;t>0;){f.push(NaN);t--}}}t.tooComplexToFollowFunctions=m;const S=[c];h>c.length&&S.push(new Uint8Array(h-c.length));if(d>u){(0,r.warn)("TT: complementing a missing function tail");S.push(new Uint8Array([34,45]))}!function foldTTTable(e,t){if(t.length>1){let a,r,n=0;for(a=0,r=t.length;a<r;a++)n+=t[a].length;n=n+3&-4;const i=new Uint8Array(n);let s=0;for(a=0,r=t.length;a<r;a++){i.set(t[a],s);s+=t[a].length}e.data=i;e.length=n}}(e,S)}let d,f,b,w;if(isTrueTypeCollectionFile(t=new y.Stream(new Uint8Array(t.getBytes())))){const e=function readTrueTypeCollectionData(e,t){const{numFonts:a,offsetTable:n}=function readTrueTypeCollectionHeader(e){const t=e.getString(4);(0,r.assert)("ttcf"===t,"Must be a TrueType Collection font.");const a=e.getUint16(),n=e.getUint16(),i=e.getInt32()>>>0,s=[];for(let t=0;t<i;t++)s.push(e.getInt32()>>>0);const o={ttcTag:t,majorVersion:a,minorVersion:n,numFonts:i,offsetTable:s};switch(a){case 1:return o;case 2:o.dsigTag=e.getInt32()>>>0;o.dsigLength=e.getInt32()>>>0;o.dsigOffset=e.getInt32()>>>0;return o}throw new r.FormatError(`Invalid TrueType Collection majorVersion: ${a}.`)}(e),i=t.split("+");let s;for(let o=0;o<a;o++){e.pos=(e.start||0)+n[o];const a=readOpenTypeHeader(e),c=readTables(e,a.numTables);if(!c.name)throw new r.FormatError('TrueType Collection font must contain a "name" table.');const[l]=readNameTable(c.name);for(let e=0,r=l.length;e<r;e++)for(let r=0,n=l[e].length;r<n;r++){const n=l[e][r]&&l[e][r].replace(/\s/g,"");if(n){if(n===t)return{header:a,tables:c};if(!(i.length<2))for(const e of i)n===e&&(s={name:e,header:a,tables:c})}}}if(s){(0,r.warn)(`TrueType Collection does not contain "${t}" font, falling back to "${s.name}" font instead.`);return{header:s.header,tables:s.tables}}throw new r.FormatError(`TrueType Collection does not contain "${t}" font.`)}(t,this.name);d=e.header;f=e.tables}else{d=readOpenTypeHeader(t);f=readTables(t,d.numTables)}const S=!f["CFF "];if(S){if(!f.loca)throw new r.FormatError('Required "loca" table is not found');if(!f.glyf){(0,r.warn)('Required "glyf" table is not found -- trying to recover.');f.glyf={tag:"glyf",data:new Uint8Array(0)}}this.isOpenType=!1}else{const t=a.composite&&((a.cidToGidMap||[]).length>0||!(a.cMap instanceof p.IdentityCMap));if("OTTO"===d.version&&!t||!f.head||!f.hhea||!f.maxp||!f.post){w=new y.Stream(f["CFF "].data);b=new u.CFFFont(w,a);adjustWidths(a);return this.convert(e,b,a)}delete f.glyf;delete f.loca;delete f.fpgm;delete f.prep;delete f["cvt "];this.isOpenType=!0}if(!f.maxp)throw new r.FormatError('Required "maxp" table is not found');t.pos=(t.start||0)+f.maxp.offset;const x=t.getInt32(),C=t.getUint16();if(a.scaleFactors&&a.scaleFactors.length===C&&S){const{scaleFactors:e}=a,t=int16(f.head.data[50],f.head.data[51]),r=new g.GlyfTable({glyfTable:f.glyf.data,isGlyphLocationsLong:t,locaTable:f.loca.data,numGlyphs:C});r.scale(e);const{glyf:n,loca:i,isLocationLong:s}=r.write();f.glyf.data=n;f.loca.data=i;if(s!==!!t){f.head.data[50]=0;f.head.data[51]=s?1:0}const o=f.hmtx.data;for(let t=0;t<C;t++){const a=4*t,r=Math.round(e[t]*int16(o[a],o[a+1]));o[a]=r>>8&255;o[a+1]=255&r;writeSignedInt16(o,a+2,Math.round(e[t]*signedInt16(o[a+2],o[a+3])))}}let k=C+1,v=!0;if(k>65535){v=!1;k=C;(0,r.warn)("Not enough space in glyfs to duplicate first glyph.")}let F=0,O=0;if(x>=65536&&f.maxp.length>=22){t.pos+=8;if(t.getUint16()>2){f.maxp.data[14]=0;f.maxp.data[15]=2}t.pos+=4;F=t.getUint16();t.pos+=4;O=t.getUint16()}f.maxp.data[4]=k>>8;f.maxp.data[5]=255&k;const T=function sanitizeTTPrograms(e,t,a,n){const i={functionsDefined:[],functionsUsed:[],functionsStackDeltas:[],tooComplexToFollowFunctions:!1,hintsValid:!0};e&&sanitizeTTProgram(e,i);t&&sanitizeTTProgram(t,i);e&&function checkInvalidFunctions(e,t){if(!e.tooComplexToFollowFunctions)if(e.functionsDefined.length>t){(0,r.warn)("TT: more functions defined than expected");e.hintsValid=!1}else for(let a=0,n=e.functionsUsed.length;a<n;a++){if(a>t){(0,r.warn)("TT: invalid function id: "+a);e.hintsValid=!1;return}if(e.functionsUsed[a]&&!e.functionsDefined[a]){(0,r.warn)("TT: undefined function: "+a);e.hintsValid=!1;return}}}(i,n);if(a&&1&a.length){const e=new Uint8Array(a.length+1);e.set(a.data);a.data=e}return i.hintsValid}(f.fpgm,f.prep,f["cvt "],F);if(!T){delete f.fpgm;delete f.prep;delete f["cvt "]}!function sanitizeMetrics(e,t,a,n,i,s){if(!t){a&&(a.data=null);return}e.pos=(e.start||0)+t.offset;e.pos+=4;e.pos+=2;e.pos+=2;e.pos+=2;e.pos+=2;e.pos+=2;e.pos+=2;e.pos+=2;e.pos+=2;e.pos+=2;const o=e.getUint16();e.pos+=8;e.pos+=2;let c=e.getUint16();if(0!==o){if(!(2&int16(n.data[44],n.data[45]))){t.data[22]=0;t.data[23]=0}}if(c>i){(0,r.info)(`The numOfMetrics (${c}) should not be greater than the numGlyphs (${i}).`);c=i;t.data[34]=(65280&c)>>8;t.data[35]=255&c}const l=i-c-(a.length-4*c>>1);if(l>0){const e=new Uint8Array(a.length+2*l);e.set(a.data);if(s){e[a.length]=a.data[2];e[a.length+1]=a.data[3]}a.data=e}}(t,f.hhea,f.hmtx,f.head,k,v);if(!f.head)throw new r.FormatError('Required "head" table is not found');!function sanitizeHead(e,t,a){const n=e.data,i=function int32(e,t,a,r){return(e<<24)+(t<<16)+(a<<8)+r}(n[0],n[1],n[2],n[3]);if(i>>16!=1){(0,r.info)("Attempting to fix invalid version in head table: "+i);n[0]=0;n[1]=1;n[2]=0;n[3]=0}const s=int16(n[50],n[51]);if(s<0||s>1){(0,r.info)("Attempting to fix invalid indexToLocFormat in head table: "+s);const e=t+1;if(a===e<<1){n[50]=0;n[51]=0}else{if(a!==e<<2)throw new r.FormatError("Could not fix indexToLocFormat: "+s);n[50]=0;n[51]=1}}}(f.head,C,S?f.loca.length:0);let M=Object.create(null);if(S){const e=int16(f.head.data[50],f.head.data[51]),t=function sanitizeGlyphLocations(e,t,a,r,n,i,s){let o,c,l;if(r){o=4;c=function fontItemDecodeLong(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]};l=function fontItemEncodeLong(e,t,a){e[t]=a>>>24&255;e[t+1]=a>>16&255;e[t+2]=a>>8&255;e[t+3]=255&a}}else{o=2;c=function fontItemDecode(e,t){return e[t]<<9|e[t+1]<<1};l=function fontItemEncode(e,t,a){e[t]=a>>9&255;e[t+1]=a>>1&255}}const h=i?a+1:a,u=o*(1+h),d=new Uint8Array(u);d.set(e.data.subarray(0,u));e.data=d;const f=t.data,g=f.length,p=new Uint8Array(g);let m,b;const y=[];for(m=0,b=0;m<a+1;m++,b+=o){let e=c(d,b);e>g&&(e=g);y.push({index:m,offset:e,endOffset:0})}y.sort(((e,t)=>e.offset-t.offset));for(m=0;m<a;m++)y[m].endOffset=y[m+1].offset;y.sort(((e,t)=>e.index-t.index));for(m=0;m<a;m++){const{offset:e,endOffset:t}=y[m];if(0!==e||0!==t)break;const a=y[m+1].offset;if(0!==a){y[m].endOffset=a;break}}const w=Object.create(null);let S=0;l(d,0,S);for(m=0,b=o;m<a;m++,b+=o){const e=sanitizeGlyph(f,y[m].offset,y[m].endOffset,p,S,n),t=e.length;0===t&&(w[m]=!0);e.sizeOfInstructions>s&&(s=e.sizeOfInstructions);S+=t;l(d,b,S)}if(0===S){const e=new Uint8Array([0,1,0,0,0,0,0,0,0,0,0,0,0,0,49,0]);for(m=0,b=o;m<h;m++,b+=o)l(d,b,e.length);t.data=e}else if(i){const a=c(d,o);if(p.length>a+S)t.data=p.subarray(0,a+S);else{t.data=new Uint8Array(a+S);t.data.set(p.subarray(0,S))}t.data.set(p.subarray(0,a),S);l(e.data,d.length-o,S+a)}else t.data=p.subarray(0,S);return{missingGlyphs:w,maxSizeOfInstructions:s}}(f.loca,f.glyf,C,e,T,v,O);M=t.missingGlyphs;if(x>=65536&&f.maxp.length>=22){f.maxp.data[26]=t.maxSizeOfInstructions>>8;f.maxp.data[27]=255&t.maxSizeOfInstructions}}if(!f.hhea)throw new r.FormatError('Required "hhea" table is not found');if(0===f.hhea.data[10]&&0===f.hhea.data[11]){f.hhea.data[10]=255;f.hhea.data[11]=255}const E={unitsPerEm:int16(f.head.data[18],f.head.data[19]),yMax:int16(f.head.data[42],f.head.data[43]),yMin:signedInt16(f.head.data[38],f.head.data[39]),ascent:signedInt16(f.hhea.data[4],f.hhea.data[5]),descent:signedInt16(f.hhea.data[6],f.hhea.data[7]),lineGap:signedInt16(f.hhea.data[8],f.hhea.data[9])};this.ascent=E.ascent/E.unitsPerEm;this.descent=E.descent/E.unitsPerEm;this.lineGap=E.lineGap/E.unitsPerEm;if(this.cssFontInfo&&this.cssFontInfo.lineHeight){this.lineHeight=this.cssFontInfo.metrics.lineHeight;this.lineGap=this.cssFontInfo.metrics.lineGap}else this.lineHeight=this.ascent-this.descent+this.lineGap;f.post&&function readPostScriptTable(e,a,n){const s=(t.start||0)+e.offset;t.pos=s;const o=s+e.length,c=t.getInt32();t.skip(28);let l,h,u=!0;switch(c){case 65536:l=i.MacStandardGlyphOrdering;break;case 131072:const e=t.getUint16();if(e!==n){u=!1;break}const s=[];for(h=0;h<e;++h){const e=t.getUint16();if(e>=32768){u=!1;break}s.push(e)}if(!u)break;const d=[],f=[];for(;t.pos<o;){const e=t.getByte();f.length=e;for(h=0;h<e;++h)f[h]=String.fromCharCode(t.getByte());d.push(f.join(""))}l=[];for(h=0;h<e;++h){const e=s[h];e<258?l.push(i.MacStandardGlyphOrdering[e]):l.push(d[e-258])}break;case 196608:break;default:(0,r.warn)("Unknown/unsupported post table version "+c);u=!1;a.defaultEncoding&&(l=a.defaultEncoding)}a.glyphNames=l;return u}(f.post,a,C);f.post={tag:"post",data:createPostTable(a)};const D=[];function hasGlyph(e){return!M[e]}if(a.composite){const e=a.cidToGidMap||[],t=0===e.length;a.cMap.forEach((function(a,n){"string"==typeof n&&(n=convertCidString(a,n,!0));if(n>65535)throw new r.FormatError("Max size of CID is 65,535");let i=-1;t?i=n:void 0!==e[n]&&(i=e[n]);i>=0&&i<C&&hasGlyph(i)&&(D[a]=i)}))}else{const e=function readCmapTable(e,t,a,n){if(!e){(0,r.warn)("No cmap table available.");return{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1}}let i,s=(t.start||0)+e.offset;t.pos=s;t.skip(2);const o=t.getUint16();let c,l=!1;for(let e=0;e<o;e++){const r=t.getUint16(),i=t.getUint16(),s=t.getInt32()>>>0;let h=!1;if(!c||c.platformId!==r||c.encodingId!==i){if(0!==r||0!==i&&1!==i&&3!==i)if(1===r&&0===i)h=!0;else if(3!==r||1!==i||!n&&c){if(a&&3===r&&0===i){h=!0;let a=!0;if(e<o-1){const e=t.peekBytes(2);int16(e[0],e[1])<r&&(a=!1)}a&&(l=!0)}}else{h=!0;a||(l=!0)}else h=!0;h&&(c={platformId:r,encodingId:i,offset:s});if(l)break}}c&&(t.pos=s+c.offset);if(!c||-1===t.peekByte()){(0,r.warn)("Could not find a preferred cmap table.");return{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1}}const h=t.getUint16();let u=!1;const d=[];let f,g;if(0===h){t.skip(4);for(f=0;f<256;f++){const e=t.getByte();e&&d.push({charCode:f,glyphId:e})}u=!0}else if(2===h){t.skip(4);const e=[];let a=0;for(let r=0;r<256;r++){const r=t.getUint16()>>3;e.push(r);a=Math.max(r,a)}const r=[];for(let e=0;e<=a;e++)r.push({firstCode:t.getUint16(),entryCount:t.getUint16(),idDelta:signedInt16(t.getByte(),t.getByte()),idRangePos:t.pos+t.getUint16()});for(let a=0;a<256;a++)if(0===e[a]){t.pos=r[0].idRangePos+2*a;g=t.getUint16();d.push({charCode:a,glyphId:g})}else{const n=r[e[a]];for(f=0;f<n.entryCount;f++){const e=(a<<8)+f+n.firstCode;t.pos=n.idRangePos+2*f;g=t.getUint16();0!==g&&(g=(g+n.idDelta)%65536);d.push({charCode:e,glyphId:g})}}}else if(4===h){t.skip(4);const e=t.getUint16()>>1;t.skip(6);const a=[];let r;for(r=0;r<e;r++)a.push({end:t.getUint16()});t.skip(2);for(r=0;r<e;r++)a[r].start=t.getUint16();for(r=0;r<e;r++)a[r].delta=t.getUint16();let n,o=0;for(r=0;r<e;r++){i=a[r];const s=t.getUint16();if(s){n=(s>>1)-(e-r);i.offsetIndex=n;o=Math.max(o,n+i.end-i.start+1)}else i.offsetIndex=-1}const c=[];for(f=0;f<o;f++)c.push(t.getUint16());for(r=0;r<e;r++){i=a[r];s=i.start;const e=i.end,t=i.delta;n=i.offsetIndex;for(f=s;f<=e;f++)if(65535!==f){g=n<0?f:c[n+f-s];g=g+t&65535;d.push({charCode:f,glyphId:g})}}}else if(6===h){t.skip(4);const e=t.getUint16(),a=t.getUint16();for(f=0;f<a;f++){g=t.getUint16();const a=e+f;d.push({charCode:a,glyphId:g})}}else{if(12!==h){(0,r.warn)("cmap table has unsupported format: "+h);return{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1}}{t.skip(10);const e=t.getInt32()>>>0;for(f=0;f<e;f++){const e=t.getInt32()>>>0,a=t.getInt32()>>>0;let r=t.getInt32()>>>0;for(let t=e;t<=a;t++)d.push({charCode:t,glyphId:r++})}}}d.sort((function(e,t){return e.charCode-t.charCode}));for(let e=1;e<d.length;e++)if(d[e-1].charCode===d[e].charCode){d.splice(e,1);e--}return{platformId:c.platformId,encodingId:c.encodingId,mappings:d,hasShortCmap:u}}(f.cmap,t,this.isSymbolicFont,a.hasEncoding),n=e.platformId,s=e.encodingId,l=e.mappings;let u=[],d=!1;!a.hasEncoding||"MacRomanEncoding"!==a.baseEncodingName&&"WinAnsiEncoding"!==a.baseEncodingName||(u=(0,c.getEncoding)(a.baseEncodingName));if(a.hasEncoding&&!this.isSymbolicFont&&(3===n&&1===s||1===n&&0===s)){const e=(0,o.getGlyphsUnicode)();for(let t=0;t<256;t++){let r;r=void 0!==this.differences[t]?this.differences[t]:u.length&&""!==u[t]?u[t]:c.StandardEncoding[t];if(!r)continue;const o=(0,i.recoverGlyphName)(r,e);let d;3===n&&1===s?d=e[o]:1===n&&0===s&&(d=c.MacRomanEncoding.indexOf(o));if(void 0===d){if(!a.glyphNames&&a.hasIncludedToUnicodeMap&&!(this.toUnicode instanceof h.IdentityToUnicodeMap)){const e=this.toUnicode.get(t);e&&(d=e.codePointAt(0))}if(void 0===d)continue}for(const e of l)if(e.charCode===d){D[t]=e.glyphId;break}}}else if(0===n){for(const e of l)D[e.charCode]=e.glyphId;d=!0}else for(const e of l){let t=e.charCode;3===n&&t>=61440&&t<=61695&&(t&=255);D[t]=e.glyphId}if(a.glyphNames&&(u.length||this.differences.length))for(let e=0;e<256;++e){if(!d&&void 0!==D[e])continue;const t=this.differences[e]||u[e];if(!t)continue;const r=a.glyphNames.indexOf(t);r>0&&hasGlyph(r)&&(D[e]=r)}}0===D.length&&(D[0]=0);let N=k-1;v||(N=0);if(!a.cssFontInfo){const e=adjustMapping(D,hasGlyph,N,this.toUnicode);this.toFontChar=e.toFontChar;f.cmap={tag:"cmap",data:createCmapTable(e.charCodeToGlyphId,e.toUnicodeExtraMap,k)};f["OS/2"]&&function validateOS2Table(e,t){t.pos=(t.start||0)+e.offset;const a=t.getUint16();t.skip(60);const r=t.getUint16();if(a<4&&768&r)return!1;if(t.getUint16()>t.getUint16())return!1;t.skip(6);if(0===t.getUint16())return!1;e.data[8]=e.data[9]=0;return!0}(f["OS/2"],t)||(f["OS/2"]={tag:"OS/2",data:createOS2Table(a,e.charCodeToGlyphId,E)})}if(!S)try{w=new y.Stream(f["CFF "].data);b=new n.CFFParser(w,a,i.SEAC_ANALYSIS_ENABLED).parse();b.duplicateFirstGlyph();const e=new n.CFFCompiler(b);f["CFF "].data=e.compile()}catch(e){(0,r.warn)("Failed to compile font "+a.loadedName)}if(f.name){const[t,r]=readNameTable(f.name);f.name.data=createNameTable(e,t);this.psName=t[0][6]||null;a.composite||function adjustTrueTypeToUnicode(e,t,a){if(e.isInternalFont)return;if(e.hasIncludedToUnicodeMap)return;if(e.hasEncoding)return;if(e.toUnicode instanceof h.IdentityToUnicodeMap)return;if(!t)return;if(0===a.length)return;if(e.defaultEncoding===c.WinAnsiEncoding)return;for(const e of a)if(!isWinNameRecord(e))return;const r=c.WinAnsiEncoding,n=[],i=(0,o.getGlyphsUnicode)();for(const e in r){const t=r[e];if(""===t)continue;const a=i[t];void 0!==a&&(n[e]=String.fromCharCode(a))}n.length>0&&e.toUnicode.amend(n)}(a,this.isSymbolicFont,r)}else f.name={tag:"name",data:createNameTable(this.name)};const R=new m.OpenTypeFileBuilder(d.version);for(const e in f)R.addTable(e,f[e].data);return R.toArray()}convert(e,t,a){a.fixedPitch=!1;a.builtInEncoding&&function adjustType1ToUnicode(e,t){if(e.isInternalFont)return;if(e.hasIncludedToUnicodeMap)return;if(t===e.defaultEncoding)return;if(e.toUnicode instanceof h.IdentityToUnicodeMap)return;const a=[],r=(0,o.getGlyphsUnicode)();for(const n in t){if(e.hasEncoding&&(e.baseEncodingName||void 0!==e.differences[n]))continue;const i=t[n],o=(0,s.getUnicodeForGlyph)(i,r);-1!==o&&(a[n]=String.fromCharCode(o))}a.length>0&&e.toUnicode.amend(a)}(a,a.builtInEncoding);let n=1;t instanceof u.CFFFont&&(n=t.numGlyphs-1);const l=t.getGlyphMapping(a);let d=null,f=l,g=null;if(!a.cssFontInfo){d=adjustMapping(l,t.hasGlyphId.bind(t),n,this.toUnicode);this.toFontChar=d.toFontChar;f=d.charCodeToGlyphId;g=d.toUnicodeExtraMap}const p=t.numGlyphs;function getCharCodes(e,t){let a=null;for(const r in e)if(t===e[r]){a||(a=[]);a.push(0|r)}return a}function createCharCode(e,t){for(const a in e)if(t===e[a])return 0|a;d.charCodeToGlyphId[d.nextAvailableFontCharCode]=t;return d.nextAvailableFontCharCode++}const b=t.seacs;if(d&&i.SEAC_ANALYSIS_ENABLED&&b&&b.length){const e=a.fontMatrix||r.FONT_IDENTITY_MATRIX,n=t.getCharset(),i=Object.create(null);for(let t in b){t|=0;const a=b[t],r=c.StandardEncoding[a[2]],s=c.StandardEncoding[a[3]],o=n.indexOf(r),h=n.indexOf(s);if(o<0||h<0)continue;const u={x:a[0]*e[0]+a[1]*e[2]+e[4],y:a[0]*e[1]+a[1]*e[3]+e[5]},f=getCharCodes(l,t);if(f)for(const e of f){const t=d.charCodeToGlyphId,a=createCharCode(t,o),r=createCharCode(t,h);i[e]={baseFontCharCode:a,accentFontCharCode:r,accentOffset:u}}}a.seacMap=i}const y=1/(a.fontMatrix||r.FONT_IDENTITY_MATRIX)[0],w=new m.OpenTypeFileBuilder("OTTO");w.addTable("CFF ",t.data);w.addTable("OS/2",createOS2Table(a,f));w.addTable("cmap",createCmapTable(f,g,p));w.addTable("head","\0\0\0\0\0\0\0\0\0\0_<õ\0\0"+safeString16(y)+"\0\0\0\0ž\v~'\0\0\0\0ž\v~'\0\0"+safeString16(a.descent)+"ÿ"+safeString16(a.ascent)+string16(a.italicAngle?2:0)+"\0\0\0\0\0\0\0");w.addTable("hhea","\0\0\0"+safeString16(a.ascent)+safeString16(a.descent)+"\0\0ÿÿ\0\0\0\0\0\0"+safeString16(a.capHeight)+safeString16(Math.tan(a.italicAngle)*a.xHeight)+"\0\0\0\0\0\0\0\0\0\0\0\0"+string16(p));w.addTable("hmtx",function fontFieldsHmtx(){const e=t.charstrings,a=t.cff?t.cff.widths:null;let r="\0\0\0\0";for(let t=1,n=p;t<n;t++){let n=0;if(e){const a=e[t-1];n="width"in a?a.width:0}else a&&(n=Math.ceil(a[t]||0));r+=string16(n)+string16(0)}return r}());w.addTable("maxp","\0\0P\0"+string16(p));w.addTable("name",createNameTable(e));w.addTable("post",createPostTable(a));return w.toArray()}get spaceWidth(){const e=["space","minus","one","i","I"];let t;for(const a of e){if(a in this.widths){t=this.widths[a];break}const e=(0,o.getGlyphsUnicode)()[a];let r=0;if(this.composite&&this.cMap.contains(e)){r=this.cMap.lookup(e);"string"==typeof r&&(r=convertCidString(e,r))}!r&&this.toUnicode&&(r=this.toUnicode.charCodeOf(e));r<=0&&(r=e);t=this.widths[r];if(t)break}t=t||this.defaultWidth;return(0,r.shadow)(this,"spaceWidth",t)}_charToGlyph(e,t=!1){let a,n,i,o=this._glyphCache[e];if(o&&o.isSpace===t)return o;let c=e;if(this.cMap&&this.cMap.contains(e)){c=this.cMap.lookup(e);"string"==typeof c&&(c=convertCidString(e,c))}n=this.widths[c];"number"!=typeof n&&(n=this.defaultWidth);const l=this.vmetrics&&this.vmetrics[c];let h=this.toUnicode.get(e)||e;"number"==typeof h&&(h=String.fromCharCode(h));let u=void 0!==this.toFontChar[e];a=this.toFontChar[e]||e;if(this.missingFile){const t=this.differences[e]||this.defaultEncoding[e];".notdef"!==t&&""!==t||"Type1"!==this.type||(a=32);a=(0,s.mapSpecialUnicodeValues)(a)}this.isType3Font&&(i=a);let d=null;if(this.seacMap&&this.seacMap[e]){u=!0;const t=this.seacMap[e];a=t.baseFontCharCode;d={fontChar:String.fromCodePoint(t.accentFontCharCode),offset:t.accentOffset}}let f="";"number"==typeof a&&(a<=1114111?f=String.fromCodePoint(a):(0,r.warn)(`charToGlyph - invalid fontCharCode: ${a}`));o=new Glyph(e,f,h,d,n,l,i,t,u);return this._glyphCache[e]=o}charsToGlyphs(e){let t=this._charsCache[e];if(t)return t;t=[];if(this.cMap){const a=Object.create(null),r=e.length;let n=0;for(;n<r;){this.cMap.readCharCode(e,n,a);const{charcode:r,length:i}=a;n+=i;const s=this._charToGlyph(r,1===i&&32===e.charCodeAt(n-1));t.push(s)}}else for(let a=0,r=e.length;a<r;++a){const r=e.charCodeAt(a),n=this._charToGlyph(r,32===r);t.push(n)}return this._charsCache[e]=t}getCharPositions(e){const t=[];if(this.cMap){const a=Object.create(null);let r=0;for(;r<e.length;){this.cMap.readCharCode(e,r,a);const n=a.length;t.push([r,r+n]);r+=n}}else for(let a=0,r=e.length;a<r;++a)t.push([a,a+1]);return t}get glyphCacheValues(){return Object.values(this._glyphCache)}encodeString(e){const t=[],a=[],hasCurrentBufErrors=()=>t.length%2==1,r=this.toUnicode instanceof h.IdentityToUnicodeMap?e=>this.toUnicode.charCodeOf(e):e=>this.toUnicode.charCodeOf(String.fromCodePoint(e));for(let n=0,i=e.length;n<i;n++){const i=e.codePointAt(n);i>55295&&(i<57344||i>65533)&&n++;if(this.toUnicode){const e=r(i);if(-1!==e){if(hasCurrentBufErrors()){t.push(a.join(""));a.length=0}for(let t=(this.cMap?this.cMap.getCharCodeLength(e):1)-1;t>=0;t--)a.push(String.fromCharCode(e>>8*t&255));continue}}if(!hasCurrentBufErrors()){t.push(a.join(""));a.length=0}a.push(String.fromCodePoint(i))}t.push(a.join(""));return t}};t.ErrorFont=class ErrorFont{constructor(e){this.error=e;this.loadedName="g_font_error";this.missingFile=!0}charsToGlyphs(){return[]}encodeString(e){return[e]}exportData(e=!1){return{error:this.error}}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.CFFTopDict=t.CFFStrings=t.CFFStandardStrings=t.CFFPrivateDict=t.CFFParser=t.CFFIndex=t.CFFHeader=t.CFFFDSelect=t.CFFCompiler=t.CFFCharset=t.CFF=void 0;var r=a(2),n=a(34),i=a(35);const s=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall","001.000","001.001","001.002","001.003","Black","Bold","Book","Light","Medium","Regular","Roman","Semibold"];t.CFFStandardStrings=s;const o=391,c=[null,{id:"hstem",min:2,stackClearing:!0,stem:!0},null,{id:"vstem",min:2,stackClearing:!0,stem:!0},{id:"vmoveto",min:1,stackClearing:!0},{id:"rlineto",min:2,resetStack:!0},{id:"hlineto",min:1,resetStack:!0},{id:"vlineto",min:1,resetStack:!0},{id:"rrcurveto",min:6,resetStack:!0},null,{id:"callsubr",min:1,undefStack:!0},{id:"return",min:0,undefStack:!0},null,null,{id:"endchar",min:0,stackClearing:!0},null,null,null,{id:"hstemhm",min:2,stackClearing:!0,stem:!0},{id:"hintmask",min:0,stackClearing:!0},{id:"cntrmask",min:0,stackClearing:!0},{id:"rmoveto",min:2,stackClearing:!0},{id:"hmoveto",min:1,stackClearing:!0},{id:"vstemhm",min:2,stackClearing:!0,stem:!0},{id:"rcurveline",min:8,resetStack:!0},{id:"rlinecurve",min:8,resetStack:!0},{id:"vvcurveto",min:4,resetStack:!0},{id:"hhcurveto",min:4,resetStack:!0},null,{id:"callgsubr",min:1,undefStack:!0},{id:"vhcurveto",min:4,resetStack:!0},{id:"hvcurveto",min:4,resetStack:!0}],l=[null,null,null,{id:"and",min:2,stackDelta:-1},{id:"or",min:2,stackDelta:-1},{id:"not",min:1,stackDelta:0},null,null,null,{id:"abs",min:1,stackDelta:0},{id:"add",min:2,stackDelta:-1,stackFn(e,t){e[t-2]=e[t-2]+e[t-1]}},{id:"sub",min:2,stackDelta:-1,stackFn(e,t){e[t-2]=e[t-2]-e[t-1]}},{id:"div",min:2,stackDelta:-1,stackFn(e,t){e[t-2]=e[t-2]/e[t-1]}},null,{id:"neg",min:1,stackDelta:0,stackFn(e,t){e[t-1]=-e[t-1]}},{id:"eq",min:2,stackDelta:-1},null,null,{id:"drop",min:1,stackDelta:-1},null,{id:"put",min:2,stackDelta:-2},{id:"get",min:1,stackDelta:0},{id:"ifelse",min:4,stackDelta:-3},{id:"random",min:0,stackDelta:1},{id:"mul",min:2,stackDelta:-1,stackFn(e,t){e[t-2]=e[t-2]*e[t-1]}},null,{id:"sqrt",min:1,stackDelta:0},{id:"dup",min:1,stackDelta:1},{id:"exch",min:2,stackDelta:0},{id:"index",min:2,stackDelta:0},{id:"roll",min:3,stackDelta:-2},null,null,null,{id:"hflex",min:7,resetStack:!0},{id:"flex",min:13,resetStack:!0},{id:"hflex1",min:9,resetStack:!0},{id:"flex1",min:11,resetStack:!0}];t.CFFParser=class CFFParser{constructor(e,t,a){this.bytes=e.getBytes();this.properties=t;this.seacAnalysisEnabled=!!a}parse(){const e=this.properties,t=new CFF;this.cff=t;const a=this.parseHeader(),r=this.parseIndex(a.endPos),n=this.parseIndex(r.endPos),i=this.parseIndex(n.endPos),s=this.parseIndex(i.endPos),o=this.parseDict(n.obj.get(0)),c=this.createDict(CFFTopDict,o,t.strings);t.header=a.obj;t.names=this.parseNameIndex(r.obj);t.strings=this.parseStringIndex(i.obj);t.topDict=c;t.globalSubrIndex=s.obj;this.parsePrivateDict(t.topDict);t.isCIDFont=c.hasName("ROS");const l=c.getByName("CharStrings"),h=this.parseIndex(l).obj,u=c.getByName("FontMatrix");u&&(e.fontMatrix=u);const d=c.getByName("FontBBox");if(d){e.ascent=Math.max(d[3],d[1]);e.descent=Math.min(d[1],d[3]);e.ascentScaled=!0}let f,g;if(t.isCIDFont){const e=this.parseIndex(c.getByName("FDArray")).obj;for(let a=0,r=e.count;a<r;++a){const r=e.get(a),n=this.createDict(CFFTopDict,this.parseDict(r),t.strings);this.parsePrivateDict(n);t.fdArray.push(n)}g=null;f=this.parseCharsets(c.getByName("charset"),h.count,t.strings,!0);t.fdSelect=this.parseFDSelect(c.getByName("FDSelect"),h.count)}else{f=this.parseCharsets(c.getByName("charset"),h.count,t.strings,!1);g=this.parseEncoding(c.getByName("Encoding"),e,t.strings,f.charset)}t.charset=f;t.encoding=g;const p=this.parseCharStrings({charStrings:h,localSubrIndex:c.privateDict.subrsIndex,globalSubrIndex:s.obj,fdSelect:t.fdSelect,fdArray:t.fdArray,privateDict:c.privateDict});t.charStrings=p.charStrings;t.seacs=p.seacs;t.widths=p.widths;return t}parseHeader(){let e=this.bytes;const t=e.length;let a=0;for(;a<t&&1!==e[a];)++a;if(a>=t)throw new r.FormatError("Invalid CFF header");if(0!==a){(0,r.info)("cff data is shifted");e=e.subarray(a);this.bytes=e}const n=e[0],i=e[1],s=e[2],o=e[3];return{obj:new CFFHeader(n,i,s,o),endPos:s}}parseDict(e){let t=0;function parseOperand(){let a=e[t++];if(30===a)return function parseFloatOperand(){let a="";const r=15,n=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"],i=e.length;for(;t<i;){const i=e[t++],s=i>>4,o=15&i;if(s===r)break;a+=n[s];if(o===r)break;a+=n[o]}return parseFloat(a)}();if(28===a){a=e[t++];a=(a<<24|e[t++]<<16)>>16;return a}if(29===a){a=e[t++];a=a<<8|e[t++];a=a<<8|e[t++];a=a<<8|e[t++];return a}if(a>=32&&a<=246)return a-139;if(a>=247&&a<=250)return 256*(a-247)+e[t++]+108;if(a>=251&&a<=254)return-256*(a-251)-e[t++]-108;(0,r.warn)('CFFParser_parseDict: "'+a+'" is a reserved command.');return NaN}let a=[];const n=[];t=0;const i=e.length;for(;t<i;){let r=e[t];if(r<=21){12===r&&(r=r<<8|e[++t]);n.push([r,a]);a=[];++t}else a.push(parseOperand())}return n}parseIndex(e){const t=new CFFIndex,a=this.bytes,r=a[e++]<<8|a[e++],n=[];let i,s,o=e;if(0!==r){const t=a[e++],c=e+(r+1)*t-1;for(i=0,s=r+1;i<s;++i){let r=0;for(let n=0;n<t;++n){r<<=8;r+=a[e++]}n.push(c+r)}o=n[r]}for(i=0,s=n.length-1;i<s;++i){const e=n[i],r=n[i+1];t.add(a.subarray(e,r))}return{obj:t,endPos:o}}parseNameIndex(e){const t=[];for(let a=0,n=e.count;a<n;++a){const n=e.get(a);t.push((0,r.bytesToString)(n))}return t}parseStringIndex(e){const t=new CFFStrings;for(let a=0,n=e.count;a<n;++a){const n=e.get(a);t.add((0,r.bytesToString)(n))}return t}createDict(e,t,a){const r=new e(a);for(const[e,a]of t)r.setByKey(e,a);return r}parseCharString(e,t,a,n){if(!t||e.callDepth>10)return!1;let i=e.stackSize;const s=e.stack;let o=t.length;for(let h=0;h<o;){const u=t[h++];let d=null;if(12===u){const e=t[h++];if(0===e){t[h-2]=139;t[h-1]=22;i=0}else d=l[e]}else if(28===u){s[i]=(t[h]<<24|t[h+1]<<16)>>16;h+=2;i++}else if(14===u){if(i>=4){i-=4;if(this.seacAnalysisEnabled){e.seac=s.slice(i,i+4);return!1}}d=c[u]}else if(u>=32&&u<=246){s[i]=u-139;i++}else if(u>=247&&u<=254){s[i]=u<251?(u-247<<8)+t[h]+108:-(u-251<<8)-t[h]-108;h++;i++}else if(255===u){s[i]=(t[h]<<24|t[h+1]<<16|t[h+2]<<8|t[h+3])/65536;h+=4;i++}else if(19===u||20===u){e.hints+=i>>1;h+=e.hints+7>>3;i%=2;d=c[u]}else{if(10===u||29===u){let t;t=10===u?a:n;if(!t){d=c[u];(0,r.warn)("Missing subrsIndex for "+d.id);return!1}let o=32768;t.count<1240?o=107:t.count<33900&&(o=1131);const l=s[--i]+o;if(l<0||l>=t.count||isNaN(l)){d=c[u];(0,r.warn)("Out of bounds subrIndex for "+d.id);return!1}e.stackSize=i;e.callDepth++;if(!this.parseCharString(e,t.get(l),a,n))return!1;e.callDepth--;i=e.stackSize;continue}if(11===u){e.stackSize=i;return!0}if(0===u&&h===t.length){t[h-1]=14;d=c[14]}else{if(9===u){t.copyWithin(h-1,h,-1);h-=1;o-=1;continue}d=c[u]}}if(d){if(d.stem){e.hints+=i>>1;if(3===u||23===u)e.hasVStems=!0;else if(e.hasVStems&&(1===u||18===u)){(0,r.warn)("CFF stem hints are in wrong order");t[h-1]=1===u?3:23}}if("min"in d&&!e.undefStack&&i<d.min){(0,r.warn)("Not enough parameters for "+d.id+"; actual: "+i+", expected: "+d.min);if(0===i){t[h-1]=14;return!0}return!1}if(e.firstStackClearing&&d.stackClearing){e.firstStackClearing=!1;i-=d.min;i>=2&&d.stem?i%=2:i>1&&(0,r.warn)("Found too many parameters for stack-clearing command");i>0&&(e.width=s[i-1])}if("stackDelta"in d){"stackFn"in d&&d.stackFn(s,i);i+=d.stackDelta}else if(d.stackClearing)i=0;else if(d.resetStack){i=0;e.undefStack=!1}else if(d.undefStack){i=0;e.undefStack=!0;e.firstStackClearing=!1}}}o<t.length&&t.fill(14,o);e.stackSize=i;return!0}parseCharStrings({charStrings:e,localSubrIndex:t,globalSubrIndex:a,fdSelect:n,fdArray:i,privateDict:s}){const o=[],c=[],l=e.count;for(let h=0;h<l;h++){const l=e.get(h),u={callDepth:0,stackSize:0,stack:[],undefStack:!0,hints:0,firstStackClearing:!0,seac:null,width:null,hasVStems:!1};let d=!0,f=null,g=s;if(n&&i.length){const e=n.getFDIndex(h);if(-1===e){(0,r.warn)("Glyph index is not in fd select.");d=!1}if(e>=i.length){(0,r.warn)("Invalid fd index for glyph index.");d=!1}if(d){g=i[e].privateDict;f=g.subrsIndex}}else t&&(f=t);d&&(d=this.parseCharString(u,l,f,a));if(null!==u.width){const e=g.getByName("nominalWidthX");c[h]=e+u.width}else{const e=g.getByName("defaultWidthX");c[h]=e}null!==u.seac&&(o[h]=u.seac);d||e.set(h,new Uint8Array([14]))}return{charStrings:e,seacs:o,widths:c}}emptyPrivateDictionary(e){const t=this.createDict(CFFPrivateDict,[],e.strings);e.setByKey(18,[0,0]);e.privateDict=t}parsePrivateDict(e){if(!e.hasName("Private")){this.emptyPrivateDictionary(e);return}const t=e.getByName("Private");if(!Array.isArray(t)||2!==t.length){e.removeByName("Private");return}const a=t[0],r=t[1];if(0===a||r>=this.bytes.length){this.emptyPrivateDictionary(e);return}const n=r+a,i=this.bytes.subarray(r,n),s=this.parseDict(i),o=this.createDict(CFFPrivateDict,s,e.strings);e.privateDict=o;0===o.getByName("ExpansionFactor")&&o.setByName("ExpansionFactor",.06);if(!o.getByName("Subrs"))return;const c=o.getByName("Subrs"),l=r+c;if(0===c||l>=this.bytes.length){this.emptyPrivateDictionary(e);return}const h=this.parseIndex(l);o.subrsIndex=h.obj}parseCharsets(e,t,a,i){if(0===e)return new CFFCharset(!0,d.ISO_ADOBE,n.ISOAdobeCharset);if(1===e)return new CFFCharset(!0,d.EXPERT,n.ExpertCharset);if(2===e)return new CFFCharset(!0,d.EXPERT_SUBSET,n.ExpertSubsetCharset);const s=this.bytes,o=e,c=s[e++],l=[i?0:".notdef"];let h,u,f;t-=1;switch(c){case 0:for(f=0;f<t;f++){h=s[e++]<<8|s[e++];l.push(i?h:a.get(h))}break;case 1:for(;l.length<=t;){h=s[e++]<<8|s[e++];u=s[e++];for(f=0;f<=u;f++)l.push(i?h++:a.get(h++))}break;case 2:for(;l.length<=t;){h=s[e++]<<8|s[e++];u=s[e++]<<8|s[e++];for(f=0;f<=u;f++)l.push(i?h++:a.get(h++))}break;default:throw new r.FormatError("Unknown charset format")}const g=e,p=s.subarray(o,g);return new CFFCharset(!1,c,l,p)}parseEncoding(e,t,a,n){const s=Object.create(null),o=this.bytes;let c,l,h,u=!1,d=null;if(0===e||1===e){u=!0;c=e;const t=e?i.ExpertEncoding:i.StandardEncoding;for(l=0,h=n.length;l<h;l++){const e=t.indexOf(n[l]);-1!==e&&(s[e]=l)}}else{const t=e;c=o[e++];switch(127&c){case 0:const t=o[e++];for(l=1;l<=t;l++)s[o[e++]]=l;break;case 1:const a=o[e++];let n=1;for(l=0;l<a;l++){const t=o[e++],a=o[e++];for(let e=t;e<=t+a;e++)s[e]=n++}break;default:throw new r.FormatError(`Unknown encoding format: ${c} in CFF`)}const i=e;if(128&c){o[t]&=127;!function readSupplement(){const t=o[e++];for(l=0;l<t;l++){const t=o[e++],r=(o[e++]<<8)+(255&o[e++]);s[t]=n.indexOf(a.get(r))}}()}d=o.subarray(t,i)}c&=127;return new CFFEncoding(u,c,s,d)}parseFDSelect(e,t){const a=this.bytes,n=a[e++],i=[];let s;switch(n){case 0:for(s=0;s<t;++s){const t=a[e++];i.push(t)}break;case 3:const o=a[e++]<<8|a[e++];for(s=0;s<o;++s){let t=a[e++]<<8|a[e++];if(0===s&&0!==t){(0,r.warn)("parseFDSelect: The first range must have a first GID of 0 -- trying to recover.");t=0}const n=a[e++],o=a[e]<<8|a[e+1];for(let e=t;e<o;++e)i.push(n)}e+=2;break;default:throw new r.FormatError(`parseFDSelect: Unknown format "${n}".`)}if(i.length!==t)throw new r.FormatError("parseFDSelect: Invalid font data.");return new CFFFDSelect(n,i)}};class CFF{constructor(){this.header=null;this.names=[];this.topDict=null;this.strings=new CFFStrings;this.globalSubrIndex=null;this.encoding=null;this.charset=null;this.charStrings=null;this.fdArray=[];this.fdSelect=null;this.isCIDFont=!1}duplicateFirstGlyph(){if(this.charStrings.count>=65535){(0,r.warn)("Not enough space in charstrings to duplicate first glyph.");return}const e=this.charStrings.get(0);this.charStrings.add(e);this.isCIDFont&&this.fdSelect.fdSelect.push(this.fdSelect.fdSelect[0])}hasGlyphId(e){if(e<0||e>=this.charStrings.count)return!1;return this.charStrings.get(e).length>0}}t.CFF=CFF;class CFFHeader{constructor(e,t,a,r){this.major=e;this.minor=t;this.hdrSize=a;this.offSize=r}}t.CFFHeader=CFFHeader;class CFFStrings{constructor(){this.strings=[]}get(e){return e>=0&&e<=390?s[e]:e-o<=this.strings.length?this.strings[e-o]:s[0]}getSID(e){let t=s.indexOf(e);if(-1!==t)return t;t=this.strings.indexOf(e);return-1!==t?t+o:-1}add(e){this.strings.push(e)}get count(){return this.strings.length}}t.CFFStrings=CFFStrings;class CFFIndex{constructor(){this.objects=[];this.length=0}add(e){this.length+=e.length;this.objects.push(e)}set(e,t){this.length+=t.length-this.objects[e].length;this.objects[e]=t}get(e){return this.objects[e]}get count(){return this.objects.length}}t.CFFIndex=CFFIndex;class CFFDict{constructor(e,t){this.keyToNameMap=e.keyToNameMap;this.nameToKeyMap=e.nameToKeyMap;this.defaults=e.defaults;this.types=e.types;this.opcodes=e.opcodes;this.order=e.order;this.strings=t;this.values=Object.create(null)}setByKey(e,t){if(!(e in this.keyToNameMap))return!1;if(0===t.length)return!0;for(const a of t)if(isNaN(a)){(0,r.warn)(`Invalid CFFDict value: "${t}" for key "${e}".`);return!0}const a=this.types[e];"num"!==a&&"sid"!==a&&"offset"!==a||(t=t[0]);this.values[e]=t;return!0}setByName(e,t){if(!(e in this.nameToKeyMap))throw new r.FormatError(`Invalid dictionary name "${e}"`);this.values[this.nameToKeyMap[e]]=t}hasName(e){return this.nameToKeyMap[e]in this.values}getByName(e){if(!(e in this.nameToKeyMap))throw new r.FormatError(`Invalid dictionary name ${e}"`);const t=this.nameToKeyMap[e];return t in this.values?this.values[t]:this.defaults[t]}removeByName(e){delete this.values[this.nameToKeyMap[e]]}static createTables(e){const t={keyToNameMap:{},nameToKeyMap:{},defaults:{},types:{},opcodes:{},order:[]};for(const a of e){const e=Array.isArray(a[0])?(a[0][0]<<8)+a[0][1]:a[0];t.keyToNameMap[e]=a[1];t.nameToKeyMap[a[1]]=e;t.types[e]=a[2];t.defaults[e]=a[3];t.opcodes[e]=Array.isArray(a[0])?a[0]:[a[0]];t.order.push(e)}return t}}const h=[[[12,30],"ROS",["sid","sid","num"],null],[[12,20],"SyntheticBase","num",null],[0,"version","sid",null],[1,"Notice","sid",null],[[12,0],"Copyright","sid",null],[2,"FullName","sid",null],[3,"FamilyName","sid",null],[4,"Weight","sid",null],[[12,1],"isFixedPitch","num",0],[[12,2],"ItalicAngle","num",0],[[12,3],"UnderlinePosition","num",-100],[[12,4],"UnderlineThickness","num",50],[[12,5],"PaintType","num",0],[[12,6],"CharstringType","num",2],[[12,7],"FontMatrix",["num","num","num","num","num","num"],[.001,0,0,.001,0,0]],[13,"UniqueID","num",null],[5,"FontBBox",["num","num","num","num"],[0,0,0,0]],[[12,8],"StrokeWidth","num",0],[14,"XUID","array",null],[15,"charset","offset",0],[16,"Encoding","offset",0],[17,"CharStrings","offset",0],[18,"Private",["offset","offset"],null],[[12,21],"PostScript","sid",null],[[12,22],"BaseFontName","sid",null],[[12,23],"BaseFontBlend","delta",null],[[12,31],"CIDFontVersion","num",0],[[12,32],"CIDFontRevision","num",0],[[12,33],"CIDFontType","num",0],[[12,34],"CIDCount","num",8720],[[12,35],"UIDBase","num",null],[[12,37],"FDSelect","offset",null],[[12,36],"FDArray","offset",null],[[12,38],"FontName","sid",null]];class CFFTopDict extends CFFDict{static get tables(){return(0,r.shadow)(this,"tables",this.createTables(h))}constructor(e){super(CFFTopDict.tables,e);this.privateDict=null}}t.CFFTopDict=CFFTopDict;const u=[[6,"BlueValues","delta",null],[7,"OtherBlues","delta",null],[8,"FamilyBlues","delta",null],[9,"FamilyOtherBlues","delta",null],[[12,9],"BlueScale","num",.039625],[[12,10],"BlueShift","num",7],[[12,11],"BlueFuzz","num",1],[10,"StdHW","num",null],[11,"StdVW","num",null],[[12,12],"StemSnapH","delta",null],[[12,13],"StemSnapV","delta",null],[[12,14],"ForceBold","num",0],[[12,17],"LanguageGroup","num",0],[[12,18],"ExpansionFactor","num",.06],[[12,19],"initialRandomSeed","num",0],[20,"defaultWidthX","num",0],[21,"nominalWidthX","num",0],[19,"Subrs","offset",null]];class CFFPrivateDict extends CFFDict{static get tables(){return(0,r.shadow)(this,"tables",this.createTables(u))}constructor(e){super(CFFPrivateDict.tables,e);this.subrsIndex=null}}t.CFFPrivateDict=CFFPrivateDict;const d={ISO_ADOBE:0,EXPERT:1,EXPERT_SUBSET:2};class CFFCharset{constructor(e,t,a,r){this.predefined=e;this.format=t;this.charset=a;this.raw=r}}t.CFFCharset=CFFCharset;class CFFEncoding{constructor(e,t,a,r){this.predefined=e;this.format=t;this.encoding=a;this.raw=r}}class CFFFDSelect{constructor(e,t){this.format=e;this.fdSelect=t}getFDIndex(e){return e<0||e>=this.fdSelect.length?-1:this.fdSelect[e]}}t.CFFFDSelect=CFFFDSelect;class CFFOffsetTracker{constructor(){this.offsets=Object.create(null)}isTracking(e){return e in this.offsets}track(e,t){if(e in this.offsets)throw new r.FormatError(`Already tracking location of ${e}`);this.offsets[e]=t}offset(e){for(const t in this.offsets)this.offsets[t]+=e}setEntryLocation(e,t,a){if(!(e in this.offsets))throw new r.FormatError(`Not tracking location of ${e}`);const n=a.data,i=this.offsets[e];for(let e=0,a=t.length;e<a;++e){const a=5*e+i,s=a+1,o=a+2,c=a+3,l=a+4;if(29!==n[a]||0!==n[s]||0!==n[o]||0!==n[c]||0!==n[l])throw new r.FormatError("writing to an offset that is not empty");const h=t[e];n[a]=29;n[s]=h>>24&255;n[o]=h>>16&255;n[c]=h>>8&255;n[l]=255&h}}}class CFFCompiler{constructor(e){this.cff=e}compile(){const e=this.cff,t={data:[],length:0,add(e){this.data=this.data.concat(e);this.length=this.data.length}},a=this.compileHeader(e.header);t.add(a);const n=this.compileNameIndex(e.names);t.add(n);if(e.isCIDFont&&e.topDict.hasName("FontMatrix")){const t=e.topDict.getByName("FontMatrix");e.topDict.removeByName("FontMatrix");for(const a of e.fdArray){let e=t.slice(0);a.hasName("FontMatrix")&&(e=r.Util.transform(e,a.getByName("FontMatrix")));a.setByName("FontMatrix",e)}}const i=e.topDict.getByName("XUID");i&&i.length>16&&e.topDict.removeByName("XUID");e.topDict.setByName("charset",0);let s=this.compileTopDicts([e.topDict],t.length,e.isCIDFont);t.add(s.output);const o=s.trackers[0],c=this.compileStringIndex(e.strings.strings);t.add(c);const l=this.compileIndex(e.globalSubrIndex);t.add(l);if(e.encoding&&e.topDict.hasName("Encoding"))if(e.encoding.predefined)o.setEntryLocation("Encoding",[e.encoding.format],t);else{const a=this.compileEncoding(e.encoding);o.setEntryLocation("Encoding",[t.length],t);t.add(a)}const h=this.compileCharset(e.charset,e.charStrings.count,e.strings,e.isCIDFont);o.setEntryLocation("charset",[t.length],t);t.add(h);const u=this.compileCharStrings(e.charStrings);o.setEntryLocation("CharStrings",[t.length],t);t.add(u);if(e.isCIDFont){o.setEntryLocation("FDSelect",[t.length],t);const a=this.compileFDSelect(e.fdSelect);t.add(a);s=this.compileTopDicts(e.fdArray,t.length,!0);o.setEntryLocation("FDArray",[t.length],t);t.add(s.output);const r=s.trackers;this.compilePrivateDicts(e.fdArray,r,t)}this.compilePrivateDicts([e.topDict],[o],t);t.add([0]);return t.data}encodeNumber(e){return Number.isInteger(e)?this.encodeInteger(e):this.encodeFloat(e)}static get EncodeFloatRegExp(){return(0,r.shadow)(this,"EncodeFloatRegExp",/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/)}encodeFloat(e){let t=e.toString();const a=CFFCompiler.EncodeFloatRegExp.exec(t);if(a){const r=parseFloat("1e"+((a[2]?+a[2]:0)+a[1].length));t=(Math.round(e*r)/r).toString()}let r,n,i="";for(r=0,n=t.length;r<n;++r){const e=t[r];i+="e"===e?"-"===t[++r]?"c":"b":"."===e?"a":"-"===e?"e":e}i+=1&i.length?"f":"ff";const s=[30];for(r=0,n=i.length;r<n;r+=2)s.push(parseInt(i.substring(r,r+2),16));return s}encodeInteger(e){let t;t=e>=-107&&e<=107?[e+139]:e>=108&&e<=1131?[247+((e-=108)>>8),255&e]:e>=-1131&&e<=-108?[251+((e=-e-108)>>8),255&e]:e>=-32768&&e<=32767?[28,e>>8&255,255&e]:[29,e>>24&255,e>>16&255,e>>8&255,255&e];return t}compileHeader(e){return[e.major,e.minor,4,e.offSize]}compileNameIndex(e){const t=new CFFIndex;for(const a of e){const e=Math.min(a.length,127);let n=new Array(e);for(let t=0;t<e;t++){let e=a[t];(e<"!"||e>"~"||"["===e||"]"===e||"("===e||")"===e||"{"===e||"}"===e||"<"===e||">"===e||"/"===e||"%"===e)&&(e="_");n[t]=e}n=n.join("");""===n&&(n="Bad_Font_Name");t.add((0,r.stringToBytes)(n))}return this.compileIndex(t)}compileTopDicts(e,t,a){const r=[];let n=new CFFIndex;for(const i of e){if(a){i.removeByName("CIDFontVersion");i.removeByName("CIDFontRevision");i.removeByName("CIDFontType");i.removeByName("CIDCount");i.removeByName("UIDBase")}const e=new CFFOffsetTracker,s=this.compileDict(i,e);r.push(e);n.add(s);e.offset(t)}n=this.compileIndex(n,r);return{trackers:r,output:n}}compilePrivateDicts(e,t,a){for(let n=0,i=e.length;n<i;++n){const i=e[n],s=i.privateDict;if(!s||!i.hasName("Private"))throw new r.FormatError("There must be a private dictionary.");const o=new CFFOffsetTracker,c=this.compileDict(s,o);let l=a.length;o.offset(l);c.length||(l=0);t[n].setEntryLocation("Private",[c.length,l],a);a.add(c);if(s.subrsIndex&&s.hasName("Subrs")){const e=this.compileIndex(s.subrsIndex);o.setEntryLocation("Subrs",[c.length],a);a.add(e)}}}compileDict(e,t){const a=[];for(const n of e.order){if(!(n in e.values))continue;let i=e.values[n],s=e.types[n];Array.isArray(s)||(s=[s]);Array.isArray(i)||(i=[i]);if(0!==i.length){for(let o=0,c=s.length;o<c;++o){const c=s[o],l=i[o];switch(c){case"num":case"sid":a.push(...this.encodeNumber(l));break;case"offset":const s=e.keyToNameMap[n];t.isTracking(s)||t.track(s,a.length);a.push(29,0,0,0,0);break;case"array":case"delta":a.push(...this.encodeNumber(l));for(let e=1,t=i.length;e<t;++e)a.push(...this.encodeNumber(i[e]));break;default:throw new r.FormatError(`Unknown data type of ${c}`)}}a.push(...e.opcodes[n])}}return a}compileStringIndex(e){const t=new CFFIndex;for(const a of e)t.add((0,r.stringToBytes)(a));return this.compileIndex(t)}compileGlobalSubrIndex(){const e=this.cff.globalSubrIndex;this.out.writeByteArray(this.compileIndex(e))}compileCharStrings(e){const t=new CFFIndex;for(let a=0;a<e.count;a++){const r=e.get(a);0!==r.length?t.add(r):t.add(new Uint8Array([139,14]))}return this.compileIndex(t)}compileCharset(e,t,a,n){let i;const s=t-1;if(n)i=new Uint8Array([2,0,0,s>>8&255,255&s]);else{i=new Uint8Array(1+2*s);i[0]=0;let t=0;const n=e.charset.length;let o=!1;for(let s=1;s<i.length;s+=2){let c=0;if(t<n){const n=e.charset[t++];c=a.getSID(n);if(-1===c){c=0;if(!o){o=!0;(0,r.warn)(`Couldn't find ${n} in CFF strings`)}}}i[s]=c>>8&255;i[s+1]=255&c}}return this.compileTypedArray(i)}compileEncoding(e){return this.compileTypedArray(e.raw)}compileFDSelect(e){const t=e.format;let a,r;switch(t){case 0:a=new Uint8Array(1+e.fdSelect.length);a[0]=t;for(r=0;r<e.fdSelect.length;r++)a[r+1]=e.fdSelect[r];break;case 3:const n=0;let i=e.fdSelect[0];const s=[t,0,0,n>>8&255,255&n,i];for(r=1;r<e.fdSelect.length;r++){const t=e.fdSelect[r];if(t!==i){s.push(r>>8&255,255&r,t);i=t}}const o=(s.length-3)/3;s[1]=o>>8&255;s[2]=255&o;s.push(r>>8&255,255&r);a=new Uint8Array(s)}return this.compileTypedArray(a)}compileTypedArray(e){const t=[];for(let a=0,r=e.length;a<r;++a)t[a]=e[a];return t}compileIndex(e,t=[]){const a=e.objects,r=a.length;if(0===r)return[0,0];const n=[r>>8&255,255&r];let i,s,o=1;for(i=0;i<r;++i)o+=a[i].length;s=o<256?1:o<65536?2:o<16777216?3:4;n.push(s);let c=1;for(i=0;i<r+1;i++){1===s?n.push(255&c):2===s?n.push(c>>8&255,255&c):3===s?n.push(c>>16&255,c>>8&255,255&c):n.push(c>>>24&255,c>>16&255,c>>8&255,255&c);a[i]&&(c+=a[i].length)}for(i=0;i<r;i++){t[i]&&t[i].offset(n.length);n.push(...a[i])}return n}}t.CFFCompiler=CFFCompiler},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.ISOAdobeCharset=t.ExpertSubsetCharset=t.ExpertCharset=void 0;t.ISOAdobeCharset=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron"];t.ExpertCharset=[".notdef","space","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"];t.ExpertSubsetCharset=[".notdef","space","dollaroldstyle","dollarsuperior","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","hyphensuperior","colonmonetary","onefitted","rupiah","centoldstyle","figuredash","hypheninferior","onequarter","onehalf","threequarters","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior"]},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.ZapfDingbatsEncoding=t.WinAnsiEncoding=t.SymbolSetEncoding=t.StandardEncoding=t.MacRomanEncoding=t.ExpertEncoding=void 0;t.getEncoding=function getEncoding(e){switch(e){case"WinAnsiEncoding":return s;case"StandardEncoding":return i;case"MacRomanEncoding":return n;case"SymbolSetEncoding":return o;case"ZapfDingbatsEncoding":return c;case"ExpertEncoding":return a;case"MacExpertEncoding":return r;default:return null}};const a=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","","asuperior","bsuperior","centsuperior","dsuperior","esuperior","","","","isuperior","","","lsuperior","msuperior","nsuperior","osuperior","","","rsuperior","ssuperior","tsuperior","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdownsmall","centoldstyle","Lslashsmall","","","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","","Dotaccentsmall","","","Macronsmall","","","figuredash","hypheninferior","","","Ogoneksmall","Ringsmall","Cedillasmall","","","","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"];t.ExpertEncoding=a;const r=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","centoldstyle","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","","threequartersemdash","","questionsmall","","","","","Ethsmall","","","onequarter","onehalf","threequarters","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","","","","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hypheninferior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","asuperior","centsuperior","","","","","Aacutesmall","Agravesmall","Acircumflexsmall","Adieresissmall","Atildesmall","Aringsmall","Ccedillasmall","Eacutesmall","Egravesmall","Ecircumflexsmall","Edieresissmall","Iacutesmall","Igravesmall","Icircumflexsmall","Idieresissmall","Ntildesmall","Oacutesmall","Ogravesmall","Ocircumflexsmall","Odieresissmall","Otildesmall","Uacutesmall","Ugravesmall","Ucircumflexsmall","Udieresissmall","","eightsuperior","fourinferior","threeinferior","sixinferior","eightinferior","seveninferior","Scaronsmall","","centinferior","twoinferior","","Dieresissmall","","Caronsmall","osuperior","fiveinferior","","commainferior","periodinferior","Yacutesmall","","dollarinferior","","","Thornsmall","","nineinferior","zeroinferior","Zcaronsmall","AEsmall","Oslashsmall","questiondownsmall","oneinferior","Lslashsmall","","","","","","","Cedillasmall","","","","","","OEsmall","figuredash","hyphensuperior","","","","","exclamdownsmall","","Ydieresissmall","","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","ninesuperior","zerosuperior","","esuperior","rsuperior","tsuperior","","","isuperior","ssuperior","dsuperior","","","","","","lsuperior","Ogoneksmall","Brevesmall","Macronsmall","bsuperior","nsuperior","msuperior","commasuperior","periodsuperior","Dotaccentsmall","Ringsmall","","","",""],n=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","space","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron"];t.MacRomanEncoding=n;const i=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","","endash","dagger","daggerdbl","periodcentered","","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","","questiondown","","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","","ring","cedilla","","hungarumlaut","ogonek","caron","emdash","","","","","","","","","","","","","","","","","AE","","ordfeminine","","","","","Lslash","Oslash","OE","ordmasculine","","","","","","ae","","","","dotlessi","","","lslash","oslash","oe","germandbls","","","",""];t.StandardEncoding=i;const s=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","bullet","Euro","bullet","quotesinglbase","florin","quotedblbase","ellipsis","dagger","daggerdbl","circumflex","perthousand","Scaron","guilsinglleft","OE","bullet","Zcaron","bullet","bullet","quoteleft","quoteright","quotedblleft","quotedblright","bullet","endash","emdash","tilde","trademark","scaron","guilsinglright","oe","bullet","zcaron","Ydieresis","space","exclamdown","cent","sterling","currency","yen","brokenbar","section","dieresis","copyright","ordfeminine","guillemotleft","logicalnot","hyphen","registered","macron","degree","plusminus","twosuperior","threesuperior","acute","mu","paragraph","periodcentered","cedilla","onesuperior","ordmasculine","guillemotright","onequarter","onehalf","threequarters","questiondown","Agrave","Aacute","Acircumflex","Atilde","Adieresis","Aring","AE","Ccedilla","Egrave","Eacute","Ecircumflex","Edieresis","Igrave","Iacute","Icircumflex","Idieresis","Eth","Ntilde","Ograve","Oacute","Ocircumflex","Otilde","Odieresis","multiply","Oslash","Ugrave","Uacute","Ucircumflex","Udieresis","Yacute","Thorn","germandbls","agrave","aacute","acircumflex","atilde","adieresis","aring","ae","ccedilla","egrave","eacute","ecircumflex","edieresis","igrave","iacute","icircumflex","idieresis","eth","ntilde","ograve","oacute","ocircumflex","otilde","odieresis","divide","oslash","ugrave","uacute","ucircumflex","udieresis","yacute","thorn","ydieresis"];t.WinAnsiEncoding=s;const o=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","universal","numbersign","existential","percent","ampersand","suchthat","parenleft","parenright","asteriskmath","plus","comma","minus","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","congruent","Alpha","Beta","Chi","Delta","Epsilon","Phi","Gamma","Eta","Iota","theta1","Kappa","Lambda","Mu","Nu","Omicron","Pi","Theta","Rho","Sigma","Tau","Upsilon","sigma1","Omega","Xi","Psi","Zeta","bracketleft","therefore","bracketright","perpendicular","underscore","radicalex","alpha","beta","chi","delta","epsilon","phi","gamma","eta","iota","phi1","kappa","lambda","mu","nu","omicron","pi","theta","rho","sigma","tau","upsilon","omega1","omega","xi","psi","zeta","braceleft","bar","braceright","similar","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Euro","Upsilon1","minute","lessequal","fraction","infinity","florin","club","diamond","heart","spade","arrowboth","arrowleft","arrowup","arrowright","arrowdown","degree","plusminus","second","greaterequal","multiply","proportional","partialdiff","bullet","divide","notequal","equivalence","approxequal","ellipsis","arrowvertex","arrowhorizex","carriagereturn","aleph","Ifraktur","Rfraktur","weierstrass","circlemultiply","circleplus","emptyset","intersection","union","propersuperset","reflexsuperset","notsubset","propersubset","reflexsubset","element","notelement","angle","gradient","registerserif","copyrightserif","trademarkserif","product","radical","dotmath","logicalnot","logicaland","logicalor","arrowdblboth","arrowdblleft","arrowdblup","arrowdblright","arrowdbldown","lozenge","angleleft","registersans","copyrightsans","trademarksans","summation","parenlefttp","parenleftex","parenleftbt","bracketlefttp","bracketleftex","bracketleftbt","bracelefttp","braceleftmid","braceleftbt","braceex","","angleright","integral","integraltp","integralex","integralbt","parenrighttp","parenrightex","parenrightbt","bracketrighttp","bracketrightex","bracketrightbt","bracerighttp","bracerightmid","bracerightbt",""];t.SymbolSetEncoding=o;const c=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","a1","a2","a202","a3","a4","a5","a119","a118","a117","a11","a12","a13","a14","a15","a16","a105","a17","a18","a19","a20","a21","a22","a23","a24","a25","a26","a27","a28","a6","a7","a8","a9","a10","a29","a30","a31","a32","a33","a34","a35","a36","a37","a38","a39","a40","a41","a42","a43","a44","a45","a46","a47","a48","a49","a50","a51","a52","a53","a54","a55","a56","a57","a58","a59","a60","a61","a62","a63","a64","a65","a66","a67","a68","a69","a70","a71","a72","a73","a74","a203","a75","a204","a76","a77","a78","a79","a81","a82","a83","a84","a97","a98","a99","a100","","a89","a90","a93","a94","a91","a92","a205","a85","a206","a86","a87","a88","a95","a96","","","","","","","","","","","","","","","","","","","","a101","a102","a103","a104","a106","a107","a108","a112","a111","a110","a109","a120","a121","a122","a123","a124","a125","a126","a127","a128","a129","a130","a131","a132","a133","a134","a135","a136","a137","a138","a139","a140","a141","a142","a143","a144","a145","a146","a147","a148","a149","a150","a151","a152","a153","a154","a155","a156","a157","a158","a159","a160","a161","a163","a164","a196","a165","a192","a166","a167","a168","a169","a170","a171","a172","a173","a162","a174","a175","a176","a177","a178","a179","a193","a180","a199","a181","a200","a182","","a201","a183","a184","a197","a185","a194","a198","a186","a195","a187","a188","a189","a190","a191",""];t.ZapfDingbatsEncoding=c},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.SEAC_ANALYSIS_ENABLED=t.MacStandardGlyphOrdering=t.FontFlags=void 0;t.normalizeFontName=function normalizeFontName(e){return e.replace(/[,_]/g,"-").replace(/\s/g,"")};t.recoverGlyphName=recoverGlyphName;t.type1FontGlyphMapping=function type1FontGlyphMapping(e,t,a){const i=Object.create(null);let s,c,l;const h=!!(e.flags&o.Symbolic);if(e.isInternalFont){l=t;for(c=0;c<l.length;c++){s=a.indexOf(l[c]);i[c]=s>=0?s:0}}else if(e.baseEncodingName){l=(0,r.getEncoding)(e.baseEncodingName);for(c=0;c<l.length;c++){s=a.indexOf(l[c]);i[c]=s>=0?s:0}}else if(h)for(c in t)i[c]=t[c];else{l=r.StandardEncoding;for(c=0;c<l.length;c++){s=a.indexOf(l[c]);i[c]=s>=0?s:0}}const u=e.differences;let d;if(u)for(c in u){const e=u[c];s=a.indexOf(e);if(-1===s){d||(d=(0,n.getGlyphsUnicode)());const t=recoverGlyphName(e,d);t!==e&&(s=a.indexOf(t))}i[c]=s>=0?s:0}return i};var r=a(35),n=a(37),i=a(38),s=a(2);t.SEAC_ANALYSIS_ENABLED=!0;const o={FixedPitch:1,Serif:2,Symbolic:4,Script:8,Nonsymbolic:32,Italic:64,AllCap:65536,SmallCap:131072,ForceBold:262144};t.FontFlags=o;t.MacStandardGlyphOrdering=[".notdef",".null","nonmarkingreturn","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","nonbreakingspace","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron","Lslash","lslash","Scaron","scaron","Zcaron","zcaron","brokenbar","Eth","eth","Yacute","yacute","Thorn","thorn","minus","multiply","onesuperior","twosuperior","threesuperior","onehalf","onequarter","threequarters","franc","Gbreve","gbreve","Idotaccent","Scedilla","scedilla","Cacute","cacute","Ccaron","ccaron","dcroat"];function recoverGlyphName(e,t){if(void 0!==t[e])return e;const a=(0,i.getUnicodeForGlyph)(e,t);if(-1!==a)for(const e in t)if(t[e]===a)return e;(0,s.info)("Unable to recover a standard glyph name for: "+e);return e}},(e,t,a)=>{a.r(t);a.d(t,{getDingbatsGlyphsUnicode:()=>i,getGlyphsUnicode:()=>n});var r=a(3);const n=(0,r.getArrayLookupTableFactory)((function(){return["A",65,"AE",198,"AEacute",508,"AEmacron",482,"AEsmall",63462,"Aacute",193,"Aacutesmall",63457,"Abreve",258,"Abreveacute",7854,"Abrevecyrillic",1232,"Abrevedotbelow",7862,"Abrevegrave",7856,"Abrevehookabove",7858,"Abrevetilde",7860,"Acaron",461,"Acircle",9398,"Acircumflex",194,"Acircumflexacute",7844,"Acircumflexdotbelow",7852,"Acircumflexgrave",7846,"Acircumflexhookabove",7848,"Acircumflexsmall",63458,"Acircumflextilde",7850,"Acute",63177,"Acutesmall",63412,"Acyrillic",1040,"Adblgrave",512,"Adieresis",196,"Adieresiscyrillic",1234,"Adieresismacron",478,"Adieresissmall",63460,"Adotbelow",7840,"Adotmacron",480,"Agrave",192,"Agravesmall",63456,"Ahookabove",7842,"Aiecyrillic",1236,"Ainvertedbreve",514,"Alpha",913,"Alphatonos",902,"Amacron",256,"Amonospace",65313,"Aogonek",260,"Aring",197,"Aringacute",506,"Aringbelow",7680,"Aringsmall",63461,"Asmall",63329,"Atilde",195,"Atildesmall",63459,"Aybarmenian",1329,"B",66,"Bcircle",9399,"Bdotaccent",7682,"Bdotbelow",7684,"Becyrillic",1041,"Benarmenian",1330,"Beta",914,"Bhook",385,"Blinebelow",7686,"Bmonospace",65314,"Brevesmall",63220,"Bsmall",63330,"Btopbar",386,"C",67,"Caarmenian",1342,"Cacute",262,"Caron",63178,"Caronsmall",63221,"Ccaron",268,"Ccedilla",199,"Ccedillaacute",7688,"Ccedillasmall",63463,"Ccircle",9400,"Ccircumflex",264,"Cdot",266,"Cdotaccent",266,"Cedillasmall",63416,"Chaarmenian",1353,"Cheabkhasiancyrillic",1212,"Checyrillic",1063,"Chedescenderabkhasiancyrillic",1214,"Chedescendercyrillic",1206,"Chedieresiscyrillic",1268,"Cheharmenian",1347,"Chekhakassiancyrillic",1227,"Cheverticalstrokecyrillic",1208,"Chi",935,"Chook",391,"Circumflexsmall",63222,"Cmonospace",65315,"Coarmenian",1361,"Csmall",63331,"D",68,"DZ",497,"DZcaron",452,"Daarmenian",1332,"Dafrican",393,"Dcaron",270,"Dcedilla",7696,"Dcircle",9401,"Dcircumflexbelow",7698,"Dcroat",272,"Ddotaccent",7690,"Ddotbelow",7692,"Decyrillic",1044,"Deicoptic",1006,"Delta",8710,"Deltagreek",916,"Dhook",394,"Dieresis",63179,"DieresisAcute",63180,"DieresisGrave",63181,"Dieresissmall",63400,"Digammagreek",988,"Djecyrillic",1026,"Dlinebelow",7694,"Dmonospace",65316,"Dotaccentsmall",63223,"Dslash",272,"Dsmall",63332,"Dtopbar",395,"Dz",498,"Dzcaron",453,"Dzeabkhasiancyrillic",1248,"Dzecyrillic",1029,"Dzhecyrillic",1039,"E",69,"Eacute",201,"Eacutesmall",63465,"Ebreve",276,"Ecaron",282,"Ecedillabreve",7708,"Echarmenian",1333,"Ecircle",9402,"Ecircumflex",202,"Ecircumflexacute",7870,"Ecircumflexbelow",7704,"Ecircumflexdotbelow",7878,"Ecircumflexgrave",7872,"Ecircumflexhookabove",7874,"Ecircumflexsmall",63466,"Ecircumflextilde",7876,"Ecyrillic",1028,"Edblgrave",516,"Edieresis",203,"Edieresissmall",63467,"Edot",278,"Edotaccent",278,"Edotbelow",7864,"Efcyrillic",1060,"Egrave",200,"Egravesmall",63464,"Eharmenian",1335,"Ehookabove",7866,"Eightroman",8551,"Einvertedbreve",518,"Eiotifiedcyrillic",1124,"Elcyrillic",1051,"Elevenroman",8554,"Emacron",274,"Emacronacute",7702,"Emacrongrave",7700,"Emcyrillic",1052,"Emonospace",65317,"Encyrillic",1053,"Endescendercyrillic",1186,"Eng",330,"Enghecyrillic",1188,"Enhookcyrillic",1223,"Eogonek",280,"Eopen",400,"Epsilon",917,"Epsilontonos",904,"Ercyrillic",1056,"Ereversed",398,"Ereversedcyrillic",1069,"Escyrillic",1057,"Esdescendercyrillic",1194,"Esh",425,"Esmall",63333,"Eta",919,"Etarmenian",1336,"Etatonos",905,"Eth",208,"Ethsmall",63472,"Etilde",7868,"Etildebelow",7706,"Euro",8364,"Ezh",439,"Ezhcaron",494,"Ezhreversed",440,"F",70,"Fcircle",9403,"Fdotaccent",7710,"Feharmenian",1366,"Feicoptic",996,"Fhook",401,"Fitacyrillic",1138,"Fiveroman",8548,"Fmonospace",65318,"Fourroman",8547,"Fsmall",63334,"G",71,"GBsquare",13191,"Gacute",500,"Gamma",915,"Gammaafrican",404,"Gangiacoptic",1002,"Gbreve",286,"Gcaron",486,"Gcedilla",290,"Gcircle",9404,"Gcircumflex",284,"Gcommaaccent",290,"Gdot",288,"Gdotaccent",288,"Gecyrillic",1043,"Ghadarmenian",1346,"Ghemiddlehookcyrillic",1172,"Ghestrokecyrillic",1170,"Gheupturncyrillic",1168,"Ghook",403,"Gimarmenian",1331,"Gjecyrillic",1027,"Gmacron",7712,"Gmonospace",65319,"Grave",63182,"Gravesmall",63328,"Gsmall",63335,"Gsmallhook",667,"Gstroke",484,"H",72,"H18533",9679,"H18543",9642,"H18551",9643,"H22073",9633,"HPsquare",13259,"Haabkhasiancyrillic",1192,"Hadescendercyrillic",1202,"Hardsigncyrillic",1066,"Hbar",294,"Hbrevebelow",7722,"Hcedilla",7720,"Hcircle",9405,"Hcircumflex",292,"Hdieresis",7718,"Hdotaccent",7714,"Hdotbelow",7716,"Hmonospace",65320,"Hoarmenian",1344,"Horicoptic",1e3,"Hsmall",63336,"Hungarumlaut",63183,"Hungarumlautsmall",63224,"Hzsquare",13200,"I",73,"IAcyrillic",1071,"IJ",306,"IUcyrillic",1070,"Iacute",205,"Iacutesmall",63469,"Ibreve",300,"Icaron",463,"Icircle",9406,"Icircumflex",206,"Icircumflexsmall",63470,"Icyrillic",1030,"Idblgrave",520,"Idieresis",207,"Idieresisacute",7726,"Idieresiscyrillic",1252,"Idieresissmall",63471,"Idot",304,"Idotaccent",304,"Idotbelow",7882,"Iebrevecyrillic",1238,"Iecyrillic",1045,"Ifraktur",8465,"Igrave",204,"Igravesmall",63468,"Ihookabove",7880,"Iicyrillic",1048,"Iinvertedbreve",522,"Iishortcyrillic",1049,"Imacron",298,"Imacroncyrillic",1250,"Imonospace",65321,"Iniarmenian",1339,"Iocyrillic",1025,"Iogonek",302,"Iota",921,"Iotaafrican",406,"Iotadieresis",938,"Iotatonos",906,"Ismall",63337,"Istroke",407,"Itilde",296,"Itildebelow",7724,"Izhitsacyrillic",1140,"Izhitsadblgravecyrillic",1142,"J",74,"Jaarmenian",1345,"Jcircle",9407,"Jcircumflex",308,"Jecyrillic",1032,"Jheharmenian",1355,"Jmonospace",65322,"Jsmall",63338,"K",75,"KBsquare",13189,"KKsquare",13261,"Kabashkircyrillic",1184,"Kacute",7728,"Kacyrillic",1050,"Kadescendercyrillic",1178,"Kahookcyrillic",1219,"Kappa",922,"Kastrokecyrillic",1182,"Kaverticalstrokecyrillic",1180,"Kcaron",488,"Kcedilla",310,"Kcircle",9408,"Kcommaaccent",310,"Kdotbelow",7730,"Keharmenian",1364,"Kenarmenian",1343,"Khacyrillic",1061,"Kheicoptic",998,"Khook",408,"Kjecyrillic",1036,"Klinebelow",7732,"Kmonospace",65323,"Koppacyrillic",1152,"Koppagreek",990,"Ksicyrillic",1134,"Ksmall",63339,"L",76,"LJ",455,"LL",63167,"Lacute",313,"Lambda",923,"Lcaron",317,"Lcedilla",315,"Lcircle",9409,"Lcircumflexbelow",7740,"Lcommaaccent",315,"Ldot",319,"Ldotaccent",319,"Ldotbelow",7734,"Ldotbelowmacron",7736,"Liwnarmenian",1340,"Lj",456,"Ljecyrillic",1033,"Llinebelow",7738,"Lmonospace",65324,"Lslash",321,"Lslashsmall",63225,"Lsmall",63340,"M",77,"MBsquare",13190,"Macron",63184,"Macronsmall",63407,"Macute",7742,"Mcircle",9410,"Mdotaccent",7744,"Mdotbelow",7746,"Menarmenian",1348,"Mmonospace",65325,"Msmall",63341,"Mturned",412,"Mu",924,"N",78,"NJ",458,"Nacute",323,"Ncaron",327,"Ncedilla",325,"Ncircle",9411,"Ncircumflexbelow",7754,"Ncommaaccent",325,"Ndotaccent",7748,"Ndotbelow",7750,"Nhookleft",413,"Nineroman",8552,"Nj",459,"Njecyrillic",1034,"Nlinebelow",7752,"Nmonospace",65326,"Nowarmenian",1350,"Nsmall",63342,"Ntilde",209,"Ntildesmall",63473,"Nu",925,"O",79,"OE",338,"OEsmall",63226,"Oacute",211,"Oacutesmall",63475,"Obarredcyrillic",1256,"Obarreddieresiscyrillic",1258,"Obreve",334,"Ocaron",465,"Ocenteredtilde",415,"Ocircle",9412,"Ocircumflex",212,"Ocircumflexacute",7888,"Ocircumflexdotbelow",7896,"Ocircumflexgrave",7890,"Ocircumflexhookabove",7892,"Ocircumflexsmall",63476,"Ocircumflextilde",7894,"Ocyrillic",1054,"Odblacute",336,"Odblgrave",524,"Odieresis",214,"Odieresiscyrillic",1254,"Odieresissmall",63478,"Odotbelow",7884,"Ogoneksmall",63227,"Ograve",210,"Ogravesmall",63474,"Oharmenian",1365,"Ohm",8486,"Ohookabove",7886,"Ohorn",416,"Ohornacute",7898,"Ohorndotbelow",7906,"Ohorngrave",7900,"Ohornhookabove",7902,"Ohorntilde",7904,"Ohungarumlaut",336,"Oi",418,"Oinvertedbreve",526,"Omacron",332,"Omacronacute",7762,"Omacrongrave",7760,"Omega",8486,"Omegacyrillic",1120,"Omegagreek",937,"Omegaroundcyrillic",1146,"Omegatitlocyrillic",1148,"Omegatonos",911,"Omicron",927,"Omicrontonos",908,"Omonospace",65327,"Oneroman",8544,"Oogonek",490,"Oogonekmacron",492,"Oopen",390,"Oslash",216,"Oslashacute",510,"Oslashsmall",63480,"Osmall",63343,"Ostrokeacute",510,"Otcyrillic",1150,"Otilde",213,"Otildeacute",7756,"Otildedieresis",7758,"Otildesmall",63477,"P",80,"Pacute",7764,"Pcircle",9413,"Pdotaccent",7766,"Pecyrillic",1055,"Peharmenian",1354,"Pemiddlehookcyrillic",1190,"Phi",934,"Phook",420,"Pi",928,"Piwrarmenian",1363,"Pmonospace",65328,"Psi",936,"Psicyrillic",1136,"Psmall",63344,"Q",81,"Qcircle",9414,"Qmonospace",65329,"Qsmall",63345,"R",82,"Raarmenian",1356,"Racute",340,"Rcaron",344,"Rcedilla",342,"Rcircle",9415,"Rcommaaccent",342,"Rdblgrave",528,"Rdotaccent",7768,"Rdotbelow",7770,"Rdotbelowmacron",7772,"Reharmenian",1360,"Rfraktur",8476,"Rho",929,"Ringsmall",63228,"Rinvertedbreve",530,"Rlinebelow",7774,"Rmonospace",65330,"Rsmall",63346,"Rsmallinverted",641,"Rsmallinvertedsuperior",694,"S",83,"SF010000",9484,"SF020000",9492,"SF030000",9488,"SF040000",9496,"SF050000",9532,"SF060000",9516,"SF070000",9524,"SF080000",9500,"SF090000",9508,"SF100000",9472,"SF110000",9474,"SF190000",9569,"SF200000",9570,"SF210000",9558,"SF220000",9557,"SF230000",9571,"SF240000",9553,"SF250000",9559,"SF260000",9565,"SF270000",9564,"SF280000",9563,"SF360000",9566,"SF370000",9567,"SF380000",9562,"SF390000",9556,"SF400000",9577,"SF410000",9574,"SF420000",9568,"SF430000",9552,"SF440000",9580,"SF450000",9575,"SF460000",9576,"SF470000",9572,"SF480000",9573,"SF490000",9561,"SF500000",9560,"SF510000",9554,"SF520000",9555,"SF530000",9579,"SF540000",9578,"Sacute",346,"Sacutedotaccent",7780,"Sampigreek",992,"Scaron",352,"Scarondotaccent",7782,"Scaronsmall",63229,"Scedilla",350,"Schwa",399,"Schwacyrillic",1240,"Schwadieresiscyrillic",1242,"Scircle",9416,"Scircumflex",348,"Scommaaccent",536,"Sdotaccent",7776,"Sdotbelow",7778,"Sdotbelowdotaccent",7784,"Seharmenian",1357,"Sevenroman",8550,"Shaarmenian",1351,"Shacyrillic",1064,"Shchacyrillic",1065,"Sheicoptic",994,"Shhacyrillic",1210,"Shimacoptic",1004,"Sigma",931,"Sixroman",8549,"Smonospace",65331,"Softsigncyrillic",1068,"Ssmall",63347,"Stigmagreek",986,"T",84,"Tau",932,"Tbar",358,"Tcaron",356,"Tcedilla",354,"Tcircle",9417,"Tcircumflexbelow",7792,"Tcommaaccent",354,"Tdotaccent",7786,"Tdotbelow",7788,"Tecyrillic",1058,"Tedescendercyrillic",1196,"Tenroman",8553,"Tetsecyrillic",1204,"Theta",920,"Thook",428,"Thorn",222,"Thornsmall",63486,"Threeroman",8546,"Tildesmall",63230,"Tiwnarmenian",1359,"Tlinebelow",7790,"Tmonospace",65332,"Toarmenian",1337,"Tonefive",444,"Tonesix",388,"Tonetwo",423,"Tretroflexhook",430,"Tsecyrillic",1062,"Tshecyrillic",1035,"Tsmall",63348,"Twelveroman",8555,"Tworoman",8545,"U",85,"Uacute",218,"Uacutesmall",63482,"Ubreve",364,"Ucaron",467,"Ucircle",9418,"Ucircumflex",219,"Ucircumflexbelow",7798,"Ucircumflexsmall",63483,"Ucyrillic",1059,"Udblacute",368,"Udblgrave",532,"Udieresis",220,"Udieresisacute",471,"Udieresisbelow",7794,"Udieresiscaron",473,"Udieresiscyrillic",1264,"Udieresisgrave",475,"Udieresismacron",469,"Udieresissmall",63484,"Udotbelow",7908,"Ugrave",217,"Ugravesmall",63481,"Uhookabove",7910,"Uhorn",431,"Uhornacute",7912,"Uhorndotbelow",7920,"Uhorngrave",7914,"Uhornhookabove",7916,"Uhorntilde",7918,"Uhungarumlaut",368,"Uhungarumlautcyrillic",1266,"Uinvertedbreve",534,"Ukcyrillic",1144,"Umacron",362,"Umacroncyrillic",1262,"Umacrondieresis",7802,"Umonospace",65333,"Uogonek",370,"Upsilon",933,"Upsilon1",978,"Upsilonacutehooksymbolgreek",979,"Upsilonafrican",433,"Upsilondieresis",939,"Upsilondieresishooksymbolgreek",980,"Upsilonhooksymbol",978,"Upsilontonos",910,"Uring",366,"Ushortcyrillic",1038,"Usmall",63349,"Ustraightcyrillic",1198,"Ustraightstrokecyrillic",1200,"Utilde",360,"Utildeacute",7800,"Utildebelow",7796,"V",86,"Vcircle",9419,"Vdotbelow",7806,"Vecyrillic",1042,"Vewarmenian",1358,"Vhook",434,"Vmonospace",65334,"Voarmenian",1352,"Vsmall",63350,"Vtilde",7804,"W",87,"Wacute",7810,"Wcircle",9420,"Wcircumflex",372,"Wdieresis",7812,"Wdotaccent",7814,"Wdotbelow",7816,"Wgrave",7808,"Wmonospace",65335,"Wsmall",63351,"X",88,"Xcircle",9421,"Xdieresis",7820,"Xdotaccent",7818,"Xeharmenian",1341,"Xi",926,"Xmonospace",65336,"Xsmall",63352,"Y",89,"Yacute",221,"Yacutesmall",63485,"Yatcyrillic",1122,"Ycircle",9422,"Ycircumflex",374,"Ydieresis",376,"Ydieresissmall",63487,"Ydotaccent",7822,"Ydotbelow",7924,"Yericyrillic",1067,"Yerudieresiscyrillic",1272,"Ygrave",7922,"Yhook",435,"Yhookabove",7926,"Yiarmenian",1349,"Yicyrillic",1031,"Yiwnarmenian",1362,"Ymonospace",65337,"Ysmall",63353,"Ytilde",7928,"Yusbigcyrillic",1130,"Yusbigiotifiedcyrillic",1132,"Yuslittlecyrillic",1126,"Yuslittleiotifiedcyrillic",1128,"Z",90,"Zaarmenian",1334,"Zacute",377,"Zcaron",381,"Zcaronsmall",63231,"Zcircle",9423,"Zcircumflex",7824,"Zdot",379,"Zdotaccent",379,"Zdotbelow",7826,"Zecyrillic",1047,"Zedescendercyrillic",1176,"Zedieresiscyrillic",1246,"Zeta",918,"Zhearmenian",1338,"Zhebrevecyrillic",1217,"Zhecyrillic",1046,"Zhedescendercyrillic",1174,"Zhedieresiscyrillic",1244,"Zlinebelow",7828,"Zmonospace",65338,"Zsmall",63354,"Zstroke",437,"a",97,"aabengali",2438,"aacute",225,"aadeva",2310,"aagujarati",2694,"aagurmukhi",2566,"aamatragurmukhi",2622,"aarusquare",13059,"aavowelsignbengali",2494,"aavowelsigndeva",2366,"aavowelsigngujarati",2750,"abbreviationmarkarmenian",1375,"abbreviationsigndeva",2416,"abengali",2437,"abopomofo",12570,"abreve",259,"abreveacute",7855,"abrevecyrillic",1233,"abrevedotbelow",7863,"abrevegrave",7857,"abrevehookabove",7859,"abrevetilde",7861,"acaron",462,"acircle",9424,"acircumflex",226,"acircumflexacute",7845,"acircumflexdotbelow",7853,"acircumflexgrave",7847,"acircumflexhookabove",7849,"acircumflextilde",7851,"acute",180,"acutebelowcmb",791,"acutecmb",769,"acutecomb",769,"acutedeva",2388,"acutelowmod",719,"acutetonecmb",833,"acyrillic",1072,"adblgrave",513,"addakgurmukhi",2673,"adeva",2309,"adieresis",228,"adieresiscyrillic",1235,"adieresismacron",479,"adotbelow",7841,"adotmacron",481,"ae",230,"aeacute",509,"aekorean",12624,"aemacron",483,"afii00208",8213,"afii08941",8356,"afii10017",1040,"afii10018",1041,"afii10019",1042,"afii10020",1043,"afii10021",1044,"afii10022",1045,"afii10023",1025,"afii10024",1046,"afii10025",1047,"afii10026",1048,"afii10027",1049,"afii10028",1050,"afii10029",1051,"afii10030",1052,"afii10031",1053,"afii10032",1054,"afii10033",1055,"afii10034",1056,"afii10035",1057,"afii10036",1058,"afii10037",1059,"afii10038",1060,"afii10039",1061,"afii10040",1062,"afii10041",1063,"afii10042",1064,"afii10043",1065,"afii10044",1066,"afii10045",1067,"afii10046",1068,"afii10047",1069,"afii10048",1070,"afii10049",1071,"afii10050",1168,"afii10051",1026,"afii10052",1027,"afii10053",1028,"afii10054",1029,"afii10055",1030,"afii10056",1031,"afii10057",1032,"afii10058",1033,"afii10059",1034,"afii10060",1035,"afii10061",1036,"afii10062",1038,"afii10063",63172,"afii10064",63173,"afii10065",1072,"afii10066",1073,"afii10067",1074,"afii10068",1075,"afii10069",1076,"afii10070",1077,"afii10071",1105,"afii10072",1078,"afii10073",1079,"afii10074",1080,"afii10075",1081,"afii10076",1082,"afii10077",1083,"afii10078",1084,"afii10079",1085,"afii10080",1086,"afii10081",1087,"afii10082",1088,"afii10083",1089,"afii10084",1090,"afii10085",1091,"afii10086",1092,"afii10087",1093,"afii10088",1094,"afii10089",1095,"afii10090",1096,"afii10091",1097,"afii10092",1098,"afii10093",1099,"afii10094",1100,"afii10095",1101,"afii10096",1102,"afii10097",1103,"afii10098",1169,"afii10099",1106,"afii10100",1107,"afii10101",1108,"afii10102",1109,"afii10103",1110,"afii10104",1111,"afii10105",1112,"afii10106",1113,"afii10107",1114,"afii10108",1115,"afii10109",1116,"afii10110",1118,"afii10145",1039,"afii10146",1122,"afii10147",1138,"afii10148",1140,"afii10192",63174,"afii10193",1119,"afii10194",1123,"afii10195",1139,"afii10196",1141,"afii10831",63175,"afii10832",63176,"afii10846",1241,"afii299",8206,"afii300",8207,"afii301",8205,"afii57381",1642,"afii57388",1548,"afii57392",1632,"afii57393",1633,"afii57394",1634,"afii57395",1635,"afii57396",1636,"afii57397",1637,"afii57398",1638,"afii57399",1639,"afii57400",1640,"afii57401",1641,"afii57403",1563,"afii57407",1567,"afii57409",1569,"afii57410",1570,"afii57411",1571,"afii57412",1572,"afii57413",1573,"afii57414",1574,"afii57415",1575,"afii57416",1576,"afii57417",1577,"afii57418",1578,"afii57419",1579,"afii57420",1580,"afii57421",1581,"afii57422",1582,"afii57423",1583,"afii57424",1584,"afii57425",1585,"afii57426",1586,"afii57427",1587,"afii57428",1588,"afii57429",1589,"afii57430",1590,"afii57431",1591,"afii57432",1592,"afii57433",1593,"afii57434",1594,"afii57440",1600,"afii57441",1601,"afii57442",1602,"afii57443",1603,"afii57444",1604,"afii57445",1605,"afii57446",1606,"afii57448",1608,"afii57449",1609,"afii57450",1610,"afii57451",1611,"afii57452",1612,"afii57453",1613,"afii57454",1614,"afii57455",1615,"afii57456",1616,"afii57457",1617,"afii57458",1618,"afii57470",1607,"afii57505",1700,"afii57506",1662,"afii57507",1670,"afii57508",1688,"afii57509",1711,"afii57511",1657,"afii57512",1672,"afii57513",1681,"afii57514",1722,"afii57519",1746,"afii57534",1749,"afii57636",8362,"afii57645",1470,"afii57658",1475,"afii57664",1488,"afii57665",1489,"afii57666",1490,"afii57667",1491,"afii57668",1492,"afii57669",1493,"afii57670",1494,"afii57671",1495,"afii57672",1496,"afii57673",1497,"afii57674",1498,"afii57675",1499,"afii57676",1500,"afii57677",1501,"afii57678",1502,"afii57679",1503,"afii57680",1504,"afii57681",1505,"afii57682",1506,"afii57683",1507,"afii57684",1508,"afii57685",1509,"afii57686",1510,"afii57687",1511,"afii57688",1512,"afii57689",1513,"afii57690",1514,"afii57694",64298,"afii57695",64299,"afii57700",64331,"afii57705",64287,"afii57716",1520,"afii57717",1521,"afii57718",1522,"afii57723",64309,"afii57793",1460,"afii57794",1461,"afii57795",1462,"afii57796",1467,"afii57797",1464,"afii57798",1463,"afii57799",1456,"afii57800",1458,"afii57801",1457,"afii57802",1459,"afii57803",1474,"afii57804",1473,"afii57806",1465,"afii57807",1468,"afii57839",1469,"afii57841",1471,"afii57842",1472,"afii57929",700,"afii61248",8453,"afii61289",8467,"afii61352",8470,"afii61573",8236,"afii61574",8237,"afii61575",8238,"afii61664",8204,"afii63167",1645,"afii64937",701,"agrave",224,"agujarati",2693,"agurmukhi",2565,"ahiragana",12354,"ahookabove",7843,"aibengali",2448,"aibopomofo",12574,"aideva",2320,"aiecyrillic",1237,"aigujarati",2704,"aigurmukhi",2576,"aimatragurmukhi",2632,"ainarabic",1593,"ainfinalarabic",65226,"aininitialarabic",65227,"ainmedialarabic",65228,"ainvertedbreve",515,"aivowelsignbengali",2504,"aivowelsigndeva",2376,"aivowelsigngujarati",2760,"akatakana",12450,"akatakanahalfwidth",65393,"akorean",12623,"alef",1488,"alefarabic",1575,"alefdageshhebrew",64304,"aleffinalarabic",65166,"alefhamzaabovearabic",1571,"alefhamzaabovefinalarabic",65156,"alefhamzabelowarabic",1573,"alefhamzabelowfinalarabic",65160,"alefhebrew",1488,"aleflamedhebrew",64335,"alefmaddaabovearabic",1570,"alefmaddaabovefinalarabic",65154,"alefmaksuraarabic",1609,"alefmaksurafinalarabic",65264,"alefmaksurainitialarabic",65267,"alefmaksuramedialarabic",65268,"alefpatahhebrew",64302,"alefqamatshebrew",64303,"aleph",8501,"allequal",8780,"alpha",945,"alphatonos",940,"amacron",257,"amonospace",65345,"ampersand",38,"ampersandmonospace",65286,"ampersandsmall",63270,"amsquare",13250,"anbopomofo",12578,"angbopomofo",12580,"angbracketleft",12296,"angbracketright",12297,"angkhankhuthai",3674,"angle",8736,"anglebracketleft",12296,"anglebracketleftvertical",65087,"anglebracketright",12297,"anglebracketrightvertical",65088,"angleleft",9001,"angleright",9002,"angstrom",8491,"anoteleia",903,"anudattadeva",2386,"anusvarabengali",2434,"anusvaradeva",2306,"anusvaragujarati",2690,"aogonek",261,"apaatosquare",13056,"aparen",9372,"apostrophearmenian",1370,"apostrophemod",700,"apple",63743,"approaches",8784,"approxequal",8776,"approxequalorimage",8786,"approximatelyequal",8773,"araeaekorean",12686,"araeakorean",12685,"arc",8978,"arighthalfring",7834,"aring",229,"aringacute",507,"aringbelow",7681,"arrowboth",8596,"arrowdashdown",8675,"arrowdashleft",8672,"arrowdashright",8674,"arrowdashup",8673,"arrowdblboth",8660,"arrowdbldown",8659,"arrowdblleft",8656,"arrowdblright",8658,"arrowdblup",8657,"arrowdown",8595,"arrowdownleft",8601,"arrowdownright",8600,"arrowdownwhite",8681,"arrowheaddownmod",709,"arrowheadleftmod",706,"arrowheadrightmod",707,"arrowheadupmod",708,"arrowhorizex",63719,"arrowleft",8592,"arrowleftdbl",8656,"arrowleftdblstroke",8653,"arrowleftoverright",8646,"arrowleftwhite",8678,"arrowright",8594,"arrowrightdblstroke",8655,"arrowrightheavy",10142,"arrowrightoverleft",8644,"arrowrightwhite",8680,"arrowtableft",8676,"arrowtabright",8677,"arrowup",8593,"arrowupdn",8597,"arrowupdnbse",8616,"arrowupdownbase",8616,"arrowupleft",8598,"arrowupleftofdown",8645,"arrowupright",8599,"arrowupwhite",8679,"arrowvertex",63718,"asciicircum",94,"asciicircummonospace",65342,"asciitilde",126,"asciitildemonospace",65374,"ascript",593,"ascriptturned",594,"asmallhiragana",12353,"asmallkatakana",12449,"asmallkatakanahalfwidth",65383,"asterisk",42,"asteriskaltonearabic",1645,"asteriskarabic",1645,"asteriskmath",8727,"asteriskmonospace",65290,"asterisksmall",65121,"asterism",8258,"asuperior",63209,"asymptoticallyequal",8771,"at",64,"atilde",227,"atmonospace",65312,"atsmall",65131,"aturned",592,"aubengali",2452,"aubopomofo",12576,"audeva",2324,"augujarati",2708,"augurmukhi",2580,"aulengthmarkbengali",2519,"aumatragurmukhi",2636,"auvowelsignbengali",2508,"auvowelsigndeva",2380,"auvowelsigngujarati",2764,"avagrahadeva",2365,"aybarmenian",1377,"ayin",1506,"ayinaltonehebrew",64288,"ayinhebrew",1506,"b",98,"babengali",2476,"backslash",92,"backslashmonospace",65340,"badeva",2348,"bagujarati",2732,"bagurmukhi",2604,"bahiragana",12400,"bahtthai",3647,"bakatakana",12496,"bar",124,"barmonospace",65372,"bbopomofo",12549,"bcircle",9425,"bdotaccent",7683,"bdotbelow",7685,"beamedsixteenthnotes",9836,"because",8757,"becyrillic",1073,"beharabic",1576,"behfinalarabic",65168,"behinitialarabic",65169,"behiragana",12409,"behmedialarabic",65170,"behmeeminitialarabic",64671,"behmeemisolatedarabic",64520,"behnoonfinalarabic",64621,"bekatakana",12505,"benarmenian",1378,"bet",1489,"beta",946,"betasymbolgreek",976,"betdagesh",64305,"betdageshhebrew",64305,"bethebrew",1489,"betrafehebrew",64332,"bhabengali",2477,"bhadeva",2349,"bhagujarati",2733,"bhagurmukhi",2605,"bhook",595,"bihiragana",12403,"bikatakana",12499,"bilabialclick",664,"bindigurmukhi",2562,"birusquare",13105,"blackcircle",9679,"blackdiamond",9670,"blackdownpointingtriangle",9660,"blackleftpointingpointer",9668,"blackleftpointingtriangle",9664,"blacklenticularbracketleft",12304,"blacklenticularbracketleftvertical",65083,"blacklenticularbracketright",12305,"blacklenticularbracketrightvertical",65084,"blacklowerlefttriangle",9699,"blacklowerrighttriangle",9698,"blackrectangle",9644,"blackrightpointingpointer",9658,"blackrightpointingtriangle",9654,"blacksmallsquare",9642,"blacksmilingface",9787,"blacksquare",9632,"blackstar",9733,"blackupperlefttriangle",9700,"blackupperrighttriangle",9701,"blackuppointingsmalltriangle",9652,"blackuppointingtriangle",9650,"blank",9251,"blinebelow",7687,"block",9608,"bmonospace",65346,"bobaimaithai",3610,"bohiragana",12412,"bokatakana",12508,"bparen",9373,"bqsquare",13251,"braceex",63732,"braceleft",123,"braceleftbt",63731,"braceleftmid",63730,"braceleftmonospace",65371,"braceleftsmall",65115,"bracelefttp",63729,"braceleftvertical",65079,"braceright",125,"bracerightbt",63742,"bracerightmid",63741,"bracerightmonospace",65373,"bracerightsmall",65116,"bracerighttp",63740,"bracerightvertical",65080,"bracketleft",91,"bracketleftbt",63728,"bracketleftex",63727,"bracketleftmonospace",65339,"bracketlefttp",63726,"bracketright",93,"bracketrightbt",63739,"bracketrightex",63738,"bracketrightmonospace",65341,"bracketrighttp",63737,"breve",728,"brevebelowcmb",814,"brevecmb",774,"breveinvertedbelowcmb",815,"breveinvertedcmb",785,"breveinverteddoublecmb",865,"bridgebelowcmb",810,"bridgeinvertedbelowcmb",826,"brokenbar",166,"bstroke",384,"bsuperior",63210,"btopbar",387,"buhiragana",12406,"bukatakana",12502,"bullet",8226,"bulletinverse",9688,"bulletoperator",8729,"bullseye",9678,"c",99,"caarmenian",1390,"cabengali",2458,"cacute",263,"cadeva",2330,"cagujarati",2714,"cagurmukhi",2586,"calsquare",13192,"candrabindubengali",2433,"candrabinducmb",784,"candrabindudeva",2305,"candrabindugujarati",2689,"capslock",8682,"careof",8453,"caron",711,"caronbelowcmb",812,"caroncmb",780,"carriagereturn",8629,"cbopomofo",12568,"ccaron",269,"ccedilla",231,"ccedillaacute",7689,"ccircle",9426,"ccircumflex",265,"ccurl",597,"cdot",267,"cdotaccent",267,"cdsquare",13253,"cedilla",184,"cedillacmb",807,"cent",162,"centigrade",8451,"centinferior",63199,"centmonospace",65504,"centoldstyle",63394,"centsuperior",63200,"chaarmenian",1401,"chabengali",2459,"chadeva",2331,"chagujarati",2715,"chagurmukhi",2587,"chbopomofo",12564,"cheabkhasiancyrillic",1213,"checkmark",10003,"checyrillic",1095,"chedescenderabkhasiancyrillic",1215,"chedescendercyrillic",1207,"chedieresiscyrillic",1269,"cheharmenian",1395,"chekhakassiancyrillic",1228,"cheverticalstrokecyrillic",1209,"chi",967,"chieuchacirclekorean",12919,"chieuchaparenkorean",12823,"chieuchcirclekorean",12905,"chieuchkorean",12618,"chieuchparenkorean",12809,"chochangthai",3594,"chochanthai",3592,"chochingthai",3593,"chochoethai",3596,"chook",392,"cieucacirclekorean",12918,"cieucaparenkorean",12822,"cieuccirclekorean",12904,"cieuckorean",12616,"cieucparenkorean",12808,"cieucuparenkorean",12828,"circle",9675,"circlecopyrt",169,"circlemultiply",8855,"circleot",8857,"circleplus",8853,"circlepostalmark",12342,"circlewithlefthalfblack",9680,"circlewithrighthalfblack",9681,"circumflex",710,"circumflexbelowcmb",813,"circumflexcmb",770,"clear",8999,"clickalveolar",450,"clickdental",448,"clicklateral",449,"clickretroflex",451,"club",9827,"clubsuitblack",9827,"clubsuitwhite",9831,"cmcubedsquare",13220,"cmonospace",65347,"cmsquaredsquare",13216,"coarmenian",1409,"colon",58,"colonmonetary",8353,"colonmonospace",65306,"colonsign",8353,"colonsmall",65109,"colontriangularhalfmod",721,"colontriangularmod",720,"comma",44,"commaabovecmb",787,"commaaboverightcmb",789,"commaaccent",63171,"commaarabic",1548,"commaarmenian",1373,"commainferior",63201,"commamonospace",65292,"commareversedabovecmb",788,"commareversedmod",701,"commasmall",65104,"commasuperior",63202,"commaturnedabovecmb",786,"commaturnedmod",699,"compass",9788,"congruent",8773,"contourintegral",8750,"control",8963,"controlACK",6,"controlBEL",7,"controlBS",8,"controlCAN",24,"controlCR",13,"controlDC1",17,"controlDC2",18,"controlDC3",19,"controlDC4",20,"controlDEL",127,"controlDLE",16,"controlEM",25,"controlENQ",5,"controlEOT",4,"controlESC",27,"controlETB",23,"controlETX",3,"controlFF",12,"controlFS",28,"controlGS",29,"controlHT",9,"controlLF",10,"controlNAK",21,"controlNULL",0,"controlRS",30,"controlSI",15,"controlSO",14,"controlSOT",2,"controlSTX",1,"controlSUB",26,"controlSYN",22,"controlUS",31,"controlVT",11,"copyright",169,"copyrightsans",63721,"copyrightserif",63193,"cornerbracketleft",12300,"cornerbracketlefthalfwidth",65378,"cornerbracketleftvertical",65089,"cornerbracketright",12301,"cornerbracketrighthalfwidth",65379,"cornerbracketrightvertical",65090,"corporationsquare",13183,"cosquare",13255,"coverkgsquare",13254,"cparen",9374,"cruzeiro",8354,"cstretched",663,"curlyand",8911,"curlyor",8910,"currency",164,"cyrBreve",63185,"cyrFlex",63186,"cyrbreve",63188,"cyrflex",63189,"d",100,"daarmenian",1380,"dabengali",2470,"dadarabic",1590,"dadeva",2342,"dadfinalarabic",65214,"dadinitialarabic",65215,"dadmedialarabic",65216,"dagesh",1468,"dageshhebrew",1468,"dagger",8224,"daggerdbl",8225,"dagujarati",2726,"dagurmukhi",2598,"dahiragana",12384,"dakatakana",12480,"dalarabic",1583,"dalet",1491,"daletdagesh",64307,"daletdageshhebrew",64307,"dalethebrew",1491,"dalfinalarabic",65194,"dammaarabic",1615,"dammalowarabic",1615,"dammatanaltonearabic",1612,"dammatanarabic",1612,"danda",2404,"dargahebrew",1447,"dargalefthebrew",1447,"dasiapneumatacyrilliccmb",1157,"dblGrave",63187,"dblanglebracketleft",12298,"dblanglebracketleftvertical",65085,"dblanglebracketright",12299,"dblanglebracketrightvertical",65086,"dblarchinvertedbelowcmb",811,"dblarrowleft",8660,"dblarrowright",8658,"dbldanda",2405,"dblgrave",63190,"dblgravecmb",783,"dblintegral",8748,"dbllowline",8215,"dbllowlinecmb",819,"dbloverlinecmb",831,"dblprimemod",698,"dblverticalbar",8214,"dblverticallineabovecmb",782,"dbopomofo",12553,"dbsquare",13256,"dcaron",271,"dcedilla",7697,"dcircle",9427,"dcircumflexbelow",7699,"dcroat",273,"ddabengali",2465,"ddadeva",2337,"ddagujarati",2721,"ddagurmukhi",2593,"ddalarabic",1672,"ddalfinalarabic",64393,"dddhadeva",2396,"ddhabengali",2466,"ddhadeva",2338,"ddhagujarati",2722,"ddhagurmukhi",2594,"ddotaccent",7691,"ddotbelow",7693,"decimalseparatorarabic",1643,"decimalseparatorpersian",1643,"decyrillic",1076,"degree",176,"dehihebrew",1453,"dehiragana",12391,"deicoptic",1007,"dekatakana",12487,"deleteleft",9003,"deleteright",8998,"delta",948,"deltaturned",397,"denominatorminusonenumeratorbengali",2552,"dezh",676,"dhabengali",2471,"dhadeva",2343,"dhagujarati",2727,"dhagurmukhi",2599,"dhook",599,"dialytikatonos",901,"dialytikatonoscmb",836,"diamond",9830,"diamondsuitwhite",9826,"dieresis",168,"dieresisacute",63191,"dieresisbelowcmb",804,"dieresiscmb",776,"dieresisgrave",63192,"dieresistonos",901,"dihiragana",12386,"dikatakana",12482,"dittomark",12291,"divide",247,"divides",8739,"divisionslash",8725,"djecyrillic",1106,"dkshade",9619,"dlinebelow",7695,"dlsquare",13207,"dmacron",273,"dmonospace",65348,"dnblock",9604,"dochadathai",3598,"dodekthai",3604,"dohiragana",12393,"dokatakana",12489,"dollar",36,"dollarinferior",63203,"dollarmonospace",65284,"dollaroldstyle",63268,"dollarsmall",65129,"dollarsuperior",63204,"dong",8363,"dorusquare",13094,"dotaccent",729,"dotaccentcmb",775,"dotbelowcmb",803,"dotbelowcomb",803,"dotkatakana",12539,"dotlessi",305,"dotlessj",63166,"dotlessjstrokehook",644,"dotmath",8901,"dottedcircle",9676,"doubleyodpatah",64287,"doubleyodpatahhebrew",64287,"downtackbelowcmb",798,"downtackmod",725,"dparen",9375,"dsuperior",63211,"dtail",598,"dtopbar",396,"duhiragana",12389,"dukatakana",12485,"dz",499,"dzaltone",675,"dzcaron",454,"dzcurl",677,"dzeabkhasiancyrillic",1249,"dzecyrillic",1109,"dzhecyrillic",1119,"e",101,"eacute",233,"earth",9793,"ebengali",2447,"ebopomofo",12572,"ebreve",277,"ecandradeva",2317,"ecandragujarati",2701,"ecandravowelsigndeva",2373,"ecandravowelsigngujarati",2757,"ecaron",283,"ecedillabreve",7709,"echarmenian",1381,"echyiwnarmenian",1415,"ecircle",9428,"ecircumflex",234,"ecircumflexacute",7871,"ecircumflexbelow",7705,"ecircumflexdotbelow",7879,"ecircumflexgrave",7873,"ecircumflexhookabove",7875,"ecircumflextilde",7877,"ecyrillic",1108,"edblgrave",517,"edeva",2319,"edieresis",235,"edot",279,"edotaccent",279,"edotbelow",7865,"eegurmukhi",2575,"eematragurmukhi",2631,"efcyrillic",1092,"egrave",232,"egujarati",2703,"eharmenian",1383,"ehbopomofo",12573,"ehiragana",12360,"ehookabove",7867,"eibopomofo",12575,"eight",56,"eightarabic",1640,"eightbengali",2542,"eightcircle",9319,"eightcircleinversesansserif",10129,"eightdeva",2414,"eighteencircle",9329,"eighteenparen",9349,"eighteenperiod",9369,"eightgujarati",2798,"eightgurmukhi",2670,"eighthackarabic",1640,"eighthangzhou",12328,"eighthnotebeamed",9835,"eightideographicparen",12839,"eightinferior",8328,"eightmonospace",65304,"eightoldstyle",63288,"eightparen",9339,"eightperiod",9359,"eightpersian",1784,"eightroman",8567,"eightsuperior",8312,"eightthai",3672,"einvertedbreve",519,"eiotifiedcyrillic",1125,"ekatakana",12456,"ekatakanahalfwidth",65396,"ekonkargurmukhi",2676,"ekorean",12628,"elcyrillic",1083,"element",8712,"elevencircle",9322,"elevenparen",9342,"elevenperiod",9362,"elevenroman",8570,"ellipsis",8230,"ellipsisvertical",8942,"emacron",275,"emacronacute",7703,"emacrongrave",7701,"emcyrillic",1084,"emdash",8212,"emdashvertical",65073,"emonospace",65349,"emphasismarkarmenian",1371,"emptyset",8709,"enbopomofo",12579,"encyrillic",1085,"endash",8211,"endashvertical",65074,"endescendercyrillic",1187,"eng",331,"engbopomofo",12581,"enghecyrillic",1189,"enhookcyrillic",1224,"enspace",8194,"eogonek",281,"eokorean",12627,"eopen",603,"eopenclosed",666,"eopenreversed",604,"eopenreversedclosed",606,"eopenreversedhook",605,"eparen",9376,"epsilon",949,"epsilontonos",941,"equal",61,"equalmonospace",65309,"equalsmall",65126,"equalsuperior",8316,"equivalence",8801,"erbopomofo",12582,"ercyrillic",1088,"ereversed",600,"ereversedcyrillic",1101,"escyrillic",1089,"esdescendercyrillic",1195,"esh",643,"eshcurl",646,"eshortdeva",2318,"eshortvowelsigndeva",2374,"eshreversedloop",426,"eshsquatreversed",645,"esmallhiragana",12359,"esmallkatakana",12455,"esmallkatakanahalfwidth",65386,"estimated",8494,"esuperior",63212,"eta",951,"etarmenian",1384,"etatonos",942,"eth",240,"etilde",7869,"etildebelow",7707,"etnahtafoukhhebrew",1425,"etnahtafoukhlefthebrew",1425,"etnahtahebrew",1425,"etnahtalefthebrew",1425,"eturned",477,"eukorean",12641,"euro",8364,"evowelsignbengali",2503,"evowelsigndeva",2375,"evowelsigngujarati",2759,"exclam",33,"exclamarmenian",1372,"exclamdbl",8252,"exclamdown",161,"exclamdownsmall",63393,"exclammonospace",65281,"exclamsmall",63265,"existential",8707,"ezh",658,"ezhcaron",495,"ezhcurl",659,"ezhreversed",441,"ezhtail",442,"f",102,"fadeva",2398,"fagurmukhi",2654,"fahrenheit",8457,"fathaarabic",1614,"fathalowarabic",1614,"fathatanarabic",1611,"fbopomofo",12552,"fcircle",9429,"fdotaccent",7711,"feharabic",1601,"feharmenian",1414,"fehfinalarabic",65234,"fehinitialarabic",65235,"fehmedialarabic",65236,"feicoptic",997,"female",9792,"ff",64256,"f_f",64256,"ffi",64259,"f_f_i",64259,"ffl",64260,"f_f_l",64260,"fi",64257,"f_i",64257,"fifteencircle",9326,"fifteenparen",9346,"fifteenperiod",9366,"figuredash",8210,"filledbox",9632,"filledrect",9644,"finalkaf",1498,"finalkafdagesh",64314,"finalkafdageshhebrew",64314,"finalkafhebrew",1498,"finalmem",1501,"finalmemhebrew",1501,"finalnun",1503,"finalnunhebrew",1503,"finalpe",1507,"finalpehebrew",1507,"finaltsadi",1509,"finaltsadihebrew",1509,"firsttonechinese",713,"fisheye",9673,"fitacyrillic",1139,"five",53,"fivearabic",1637,"fivebengali",2539,"fivecircle",9316,"fivecircleinversesansserif",10126,"fivedeva",2411,"fiveeighths",8541,"fivegujarati",2795,"fivegurmukhi",2667,"fivehackarabic",1637,"fivehangzhou",12325,"fiveideographicparen",12836,"fiveinferior",8325,"fivemonospace",65301,"fiveoldstyle",63285,"fiveparen",9336,"fiveperiod",9356,"fivepersian",1781,"fiveroman",8564,"fivesuperior",8309,"fivethai",3669,"fl",64258,"f_l",64258,"florin",402,"fmonospace",65350,"fmsquare",13209,"fofanthai",3615,"fofathai",3613,"fongmanthai",3663,"forall",8704,"four",52,"fourarabic",1636,"fourbengali",2538,"fourcircle",9315,"fourcircleinversesansserif",10125,"fourdeva",2410,"fourgujarati",2794,"fourgurmukhi",2666,"fourhackarabic",1636,"fourhangzhou",12324,"fourideographicparen",12835,"fourinferior",8324,"fourmonospace",65300,"fournumeratorbengali",2551,"fouroldstyle",63284,"fourparen",9335,"fourperiod",9355,"fourpersian",1780,"fourroman",8563,"foursuperior",8308,"fourteencircle",9325,"fourteenparen",9345,"fourteenperiod",9365,"fourthai",3668,"fourthtonechinese",715,"fparen",9377,"fraction",8260,"franc",8355,"g",103,"gabengali",2455,"gacute",501,"gadeva",2327,"gafarabic",1711,"gaffinalarabic",64403,"gafinitialarabic",64404,"gafmedialarabic",64405,"gagujarati",2711,"gagurmukhi",2583,"gahiragana",12364,"gakatakana",12460,"gamma",947,"gammalatinsmall",611,"gammasuperior",736,"gangiacoptic",1003,"gbopomofo",12557,"gbreve",287,"gcaron",487,"gcedilla",291,"gcircle",9430,"gcircumflex",285,"gcommaaccent",291,"gdot",289,"gdotaccent",289,"gecyrillic",1075,"gehiragana",12370,"gekatakana",12466,"geometricallyequal",8785,"gereshaccenthebrew",1436,"gereshhebrew",1523,"gereshmuqdamhebrew",1437,"germandbls",223,"gershayimaccenthebrew",1438,"gershayimhebrew",1524,"getamark",12307,"ghabengali",2456,"ghadarmenian",1394,"ghadeva",2328,"ghagujarati",2712,"ghagurmukhi",2584,"ghainarabic",1594,"ghainfinalarabic",65230,"ghaininitialarabic",65231,"ghainmedialarabic",65232,"ghemiddlehookcyrillic",1173,"ghestrokecyrillic",1171,"gheupturncyrillic",1169,"ghhadeva",2394,"ghhagurmukhi",2650,"ghook",608,"ghzsquare",13203,"gihiragana",12366,"gikatakana",12462,"gimarmenian",1379,"gimel",1490,"gimeldagesh",64306,"gimeldageshhebrew",64306,"gimelhebrew",1490,"gjecyrillic",1107,"glottalinvertedstroke",446,"glottalstop",660,"glottalstopinverted",662,"glottalstopmod",704,"glottalstopreversed",661,"glottalstopreversedmod",705,"glottalstopreversedsuperior",740,"glottalstopstroke",673,"glottalstopstrokereversed",674,"gmacron",7713,"gmonospace",65351,"gohiragana",12372,"gokatakana",12468,"gparen",9378,"gpasquare",13228,"gradient",8711,"grave",96,"gravebelowcmb",790,"gravecmb",768,"gravecomb",768,"gravedeva",2387,"gravelowmod",718,"gravemonospace",65344,"gravetonecmb",832,"greater",62,"greaterequal",8805,"greaterequalorless",8923,"greatermonospace",65310,"greaterorequivalent",8819,"greaterorless",8823,"greateroverequal",8807,"greatersmall",65125,"gscript",609,"gstroke",485,"guhiragana",12368,"guillemotleft",171,"guillemotright",187,"guilsinglleft",8249,"guilsinglright",8250,"gukatakana",12464,"guramusquare",13080,"gysquare",13257,"h",104,"haabkhasiancyrillic",1193,"haaltonearabic",1729,"habengali",2489,"hadescendercyrillic",1203,"hadeva",2361,"hagujarati",2745,"hagurmukhi",2617,"haharabic",1581,"hahfinalarabic",65186,"hahinitialarabic",65187,"hahiragana",12399,"hahmedialarabic",65188,"haitusquare",13098,"hakatakana",12495,"hakatakanahalfwidth",65418,"halantgurmukhi",2637,"hamzaarabic",1569,"hamzalowarabic",1569,"hangulfiller",12644,"hardsigncyrillic",1098,"harpoonleftbarbup",8636,"harpoonrightbarbup",8640,"hasquare",13258,"hatafpatah",1458,"hatafpatah16",1458,"hatafpatah23",1458,"hatafpatah2f",1458,"hatafpatahhebrew",1458,"hatafpatahnarrowhebrew",1458,"hatafpatahquarterhebrew",1458,"hatafpatahwidehebrew",1458,"hatafqamats",1459,"hatafqamats1b",1459,"hatafqamats28",1459,"hatafqamats34",1459,"hatafqamatshebrew",1459,"hatafqamatsnarrowhebrew",1459,"hatafqamatsquarterhebrew",1459,"hatafqamatswidehebrew",1459,"hatafsegol",1457,"hatafsegol17",1457,"hatafsegol24",1457,"hatafsegol30",1457,"hatafsegolhebrew",1457,"hatafsegolnarrowhebrew",1457,"hatafsegolquarterhebrew",1457,"hatafsegolwidehebrew",1457,"hbar",295,"hbopomofo",12559,"hbrevebelow",7723,"hcedilla",7721,"hcircle",9431,"hcircumflex",293,"hdieresis",7719,"hdotaccent",7715,"hdotbelow",7717,"he",1492,"heart",9829,"heartsuitblack",9829,"heartsuitwhite",9825,"hedagesh",64308,"hedageshhebrew",64308,"hehaltonearabic",1729,"heharabic",1607,"hehebrew",1492,"hehfinalaltonearabic",64423,"hehfinalalttwoarabic",65258,"hehfinalarabic",65258,"hehhamzaabovefinalarabic",64421,"hehhamzaaboveisolatedarabic",64420,"hehinitialaltonearabic",64424,"hehinitialarabic",65259,"hehiragana",12408,"hehmedialaltonearabic",64425,"hehmedialarabic",65260,"heiseierasquare",13179,"hekatakana",12504,"hekatakanahalfwidth",65421,"hekutaarusquare",13110,"henghook",615,"herutusquare",13113,"het",1495,"hethebrew",1495,"hhook",614,"hhooksuperior",689,"hieuhacirclekorean",12923,"hieuhaparenkorean",12827,"hieuhcirclekorean",12909,"hieuhkorean",12622,"hieuhparenkorean",12813,"hihiragana",12402,"hikatakana",12498,"hikatakanahalfwidth",65419,"hiriq",1460,"hiriq14",1460,"hiriq21",1460,"hiriq2d",1460,"hiriqhebrew",1460,"hiriqnarrowhebrew",1460,"hiriqquarterhebrew",1460,"hiriqwidehebrew",1460,"hlinebelow",7830,"hmonospace",65352,"hoarmenian",1392,"hohipthai",3627,"hohiragana",12411,"hokatakana",12507,"hokatakanahalfwidth",65422,"holam",1465,"holam19",1465,"holam26",1465,"holam32",1465,"holamhebrew",1465,"holamnarrowhebrew",1465,"holamquarterhebrew",1465,"holamwidehebrew",1465,"honokhukthai",3630,"hookabovecomb",777,"hookcmb",777,"hookpalatalizedbelowcmb",801,"hookretroflexbelowcmb",802,"hoonsquare",13122,"horicoptic",1001,"horizontalbar",8213,"horncmb",795,"hotsprings",9832,"house",8962,"hparen",9379,"hsuperior",688,"hturned",613,"huhiragana",12405,"huiitosquare",13107,"hukatakana",12501,"hukatakanahalfwidth",65420,"hungarumlaut",733,"hungarumlautcmb",779,"hv",405,"hyphen",45,"hypheninferior",63205,"hyphenmonospace",65293,"hyphensmall",65123,"hyphensuperior",63206,"hyphentwo",8208,"i",105,"iacute",237,"iacyrillic",1103,"ibengali",2439,"ibopomofo",12583,"ibreve",301,"icaron",464,"icircle",9432,"icircumflex",238,"icyrillic",1110,"idblgrave",521,"ideographearthcircle",12943,"ideographfirecircle",12939,"ideographicallianceparen",12863,"ideographiccallparen",12858,"ideographiccentrecircle",12965,"ideographicclose",12294,"ideographiccomma",12289,"ideographiccommaleft",65380,"ideographiccongratulationparen",12855,"ideographiccorrectcircle",12963,"ideographicearthparen",12847,"ideographicenterpriseparen",12861,"ideographicexcellentcircle",12957,"ideographicfestivalparen",12864,"ideographicfinancialcircle",12950,"ideographicfinancialparen",12854,"ideographicfireparen",12843,"ideographichaveparen",12850,"ideographichighcircle",12964,"ideographiciterationmark",12293,"ideographiclaborcircle",12952,"ideographiclaborparen",12856,"ideographicleftcircle",12967,"ideographiclowcircle",12966,"ideographicmedicinecircle",12969,"ideographicmetalparen",12846,"ideographicmoonparen",12842,"ideographicnameparen",12852,"ideographicperiod",12290,"ideographicprintcircle",12958,"ideographicreachparen",12867,"ideographicrepresentparen",12857,"ideographicresourceparen",12862,"ideographicrightcircle",12968,"ideographicsecretcircle",12953,"ideographicselfparen",12866,"ideographicsocietyparen",12851,"ideographicspace",12288,"ideographicspecialparen",12853,"ideographicstockparen",12849,"ideographicstudyparen",12859,"ideographicsunparen",12848,"ideographicsuperviseparen",12860,"ideographicwaterparen",12844,"ideographicwoodparen",12845,"ideographiczero",12295,"ideographmetalcircle",12942,"ideographmooncircle",12938,"ideographnamecircle",12948,"ideographsuncircle",12944,"ideographwatercircle",12940,"ideographwoodcircle",12941,"ideva",2311,"idieresis",239,"idieresisacute",7727,"idieresiscyrillic",1253,"idotbelow",7883,"iebrevecyrillic",1239,"iecyrillic",1077,"ieungacirclekorean",12917,"ieungaparenkorean",12821,"ieungcirclekorean",12903,"ieungkorean",12615,"ieungparenkorean",12807,"igrave",236,"igujarati",2695,"igurmukhi",2567,"ihiragana",12356,"ihookabove",7881,"iibengali",2440,"iicyrillic",1080,"iideva",2312,"iigujarati",2696,"iigurmukhi",2568,"iimatragurmukhi",2624,"iinvertedbreve",523,"iishortcyrillic",1081,"iivowelsignbengali",2496,"iivowelsigndeva",2368,"iivowelsigngujarati",2752,"ij",307,"ikatakana",12452,"ikatakanahalfwidth",65394,"ikorean",12643,"ilde",732,"iluyhebrew",1452,"imacron",299,"imacroncyrillic",1251,"imageorapproximatelyequal",8787,"imatragurmukhi",2623,"imonospace",65353,"increment",8710,"infinity",8734,"iniarmenian",1387,"integral",8747,"integralbottom",8993,"integralbt",8993,"integralex",63733,"integraltop",8992,"integraltp",8992,"intersection",8745,"intisquare",13061,"invbullet",9688,"invcircle",9689,"invsmileface",9787,"iocyrillic",1105,"iogonek",303,"iota",953,"iotadieresis",970,"iotadieresistonos",912,"iotalatin",617,"iotatonos",943,"iparen",9380,"irigurmukhi",2674,"ismallhiragana",12355,"ismallkatakana",12451,"ismallkatakanahalfwidth",65384,"issharbengali",2554,"istroke",616,"isuperior",63213,"iterationhiragana",12445,"iterationkatakana",12541,"itilde",297,"itildebelow",7725,"iubopomofo",12585,"iucyrillic",1102,"ivowelsignbengali",2495,"ivowelsigndeva",2367,"ivowelsigngujarati",2751,"izhitsacyrillic",1141,"izhitsadblgravecyrillic",1143,"j",106,"jaarmenian",1393,"jabengali",2460,"jadeva",2332,"jagujarati",2716,"jagurmukhi",2588,"jbopomofo",12560,"jcaron",496,"jcircle",9433,"jcircumflex",309,"jcrossedtail",669,"jdotlessstroke",607,"jecyrillic",1112,"jeemarabic",1580,"jeemfinalarabic",65182,"jeeminitialarabic",65183,"jeemmedialarabic",65184,"jeharabic",1688,"jehfinalarabic",64395,"jhabengali",2461,"jhadeva",2333,"jhagujarati",2717,"jhagurmukhi",2589,"jheharmenian",1403,"jis",12292,"jmonospace",65354,"jparen",9381,"jsuperior",690,"k",107,"kabashkircyrillic",1185,"kabengali",2453,"kacute",7729,"kacyrillic",1082,"kadescendercyrillic",1179,"kadeva",2325,"kaf",1499,"kafarabic",1603,"kafdagesh",64315,"kafdageshhebrew",64315,"kaffinalarabic",65242,"kafhebrew",1499,"kafinitialarabic",65243,"kafmedialarabic",65244,"kafrafehebrew",64333,"kagujarati",2709,"kagurmukhi",2581,"kahiragana",12363,"kahookcyrillic",1220,"kakatakana",12459,"kakatakanahalfwidth",65398,"kappa",954,"kappasymbolgreek",1008,"kapyeounmieumkorean",12657,"kapyeounphieuphkorean",12676,"kapyeounpieupkorean",12664,"kapyeounssangpieupkorean",12665,"karoriisquare",13069,"kashidaautoarabic",1600,"kashidaautonosidebearingarabic",1600,"kasmallkatakana",12533,"kasquare",13188,"kasraarabic",1616,"kasratanarabic",1613,"kastrokecyrillic",1183,"katahiraprolongmarkhalfwidth",65392,"kaverticalstrokecyrillic",1181,"kbopomofo",12558,"kcalsquare",13193,"kcaron",489,"kcedilla",311,"kcircle",9434,"kcommaaccent",311,"kdotbelow",7731,"keharmenian",1412,"kehiragana",12369,"kekatakana",12465,"kekatakanahalfwidth",65401,"kenarmenian",1391,"kesmallkatakana",12534,"kgreenlandic",312,"khabengali",2454,"khacyrillic",1093,"khadeva",2326,"khagujarati",2710,"khagurmukhi",2582,"khaharabic",1582,"khahfinalarabic",65190,"khahinitialarabic",65191,"khahmedialarabic",65192,"kheicoptic",999,"khhadeva",2393,"khhagurmukhi",2649,"khieukhacirclekorean",12920,"khieukhaparenkorean",12824,"khieukhcirclekorean",12906,"khieukhkorean",12619,"khieukhparenkorean",12810,"khokhaithai",3586,"khokhonthai",3589,"khokhuatthai",3587,"khokhwaithai",3588,"khomutthai",3675,"khook",409,"khorakhangthai",3590,"khzsquare",13201,"kihiragana",12365,"kikatakana",12461,"kikatakanahalfwidth",65399,"kiroguramusquare",13077,"kiromeetorusquare",13078,"kirosquare",13076,"kiyeokacirclekorean",12910,"kiyeokaparenkorean",12814,"kiyeokcirclekorean",12896,"kiyeokkorean",12593,"kiyeokparenkorean",12800,"kiyeoksioskorean",12595,"kjecyrillic",1116,"klinebelow",7733,"klsquare",13208,"kmcubedsquare",13222,"kmonospace",65355,"kmsquaredsquare",13218,"kohiragana",12371,"kohmsquare",13248,"kokaithai",3585,"kokatakana",12467,"kokatakanahalfwidth",65402,"kooposquare",13086,"koppacyrillic",1153,"koreanstandardsymbol",12927,"koroniscmb",835,"kparen",9382,"kpasquare",13226,"ksicyrillic",1135,"ktsquare",13263,"kturned",670,"kuhiragana",12367,"kukatakana",12463,"kukatakanahalfwidth",65400,"kvsquare",13240,"kwsquare",13246,"l",108,"labengali",2482,"lacute",314,"ladeva",2354,"lagujarati",2738,"lagurmukhi",2610,"lakkhangyaothai",3653,"lamaleffinalarabic",65276,"lamalefhamzaabovefinalarabic",65272,"lamalefhamzaaboveisolatedarabic",65271,"lamalefhamzabelowfinalarabic",65274,"lamalefhamzabelowisolatedarabic",65273,"lamalefisolatedarabic",65275,"lamalefmaddaabovefinalarabic",65270,"lamalefmaddaaboveisolatedarabic",65269,"lamarabic",1604,"lambda",955,"lambdastroke",411,"lamed",1500,"lameddagesh",64316,"lameddageshhebrew",64316,"lamedhebrew",1500,"lamfinalarabic",65246,"lamhahinitialarabic",64714,"laminitialarabic",65247,"lamjeeminitialarabic",64713,"lamkhahinitialarabic",64715,"lamlamhehisolatedarabic",65010,"lammedialarabic",65248,"lammeemhahinitialarabic",64904,"lammeeminitialarabic",64716,"largecircle",9711,"lbar",410,"lbelt",620,"lbopomofo",12556,"lcaron",318,"lcedilla",316,"lcircle",9435,"lcircumflexbelow",7741,"lcommaaccent",316,"ldot",320,"ldotaccent",320,"ldotbelow",7735,"ldotbelowmacron",7737,"leftangleabovecmb",794,"lefttackbelowcmb",792,"less",60,"lessequal",8804,"lessequalorgreater",8922,"lessmonospace",65308,"lessorequivalent",8818,"lessorgreater",8822,"lessoverequal",8806,"lesssmall",65124,"lezh",622,"lfblock",9612,"lhookretroflex",621,"lira",8356,"liwnarmenian",1388,"lj",457,"ljecyrillic",1113,"ll",63168,"lladeva",2355,"llagujarati",2739,"llinebelow",7739,"llladeva",2356,"llvocalicbengali",2529,"llvocalicdeva",2401,"llvocalicvowelsignbengali",2531,"llvocalicvowelsigndeva",2403,"lmiddletilde",619,"lmonospace",65356,"lmsquare",13264,"lochulathai",3628,"logicaland",8743,"logicalnot",172,"logicalnotreversed",8976,"logicalor",8744,"lolingthai",3621,"longs",383,"lowlinecenterline",65102,"lowlinecmb",818,"lowlinedashed",65101,"lozenge",9674,"lparen",9383,"lslash",322,"lsquare",8467,"lsuperior",63214,"ltshade",9617,"luthai",3622,"lvocalicbengali",2444,"lvocalicdeva",2316,"lvocalicvowelsignbengali",2530,"lvocalicvowelsigndeva",2402,"lxsquare",13267,"m",109,"mabengali",2478,"macron",175,"macronbelowcmb",817,"macroncmb",772,"macronlowmod",717,"macronmonospace",65507,"macute",7743,"madeva",2350,"magujarati",2734,"magurmukhi",2606,"mahapakhhebrew",1444,"mahapakhlefthebrew",1444,"mahiragana",12414,"maichattawalowleftthai",63637,"maichattawalowrightthai",63636,"maichattawathai",3659,"maichattawaupperleftthai",63635,"maieklowleftthai",63628,"maieklowrightthai",63627,"maiekthai",3656,"maiekupperleftthai",63626,"maihanakatleftthai",63620,"maihanakatthai",3633,"maitaikhuleftthai",63625,"maitaikhuthai",3655,"maitholowleftthai",63631,"maitholowrightthai",63630,"maithothai",3657,"maithoupperleftthai",63629,"maitrilowleftthai",63634,"maitrilowrightthai",63633,"maitrithai",3658,"maitriupperleftthai",63632,"maiyamokthai",3654,"makatakana",12510,"makatakanahalfwidth",65423,"male",9794,"mansyonsquare",13127,"maqafhebrew",1470,"mars",9794,"masoracirclehebrew",1455,"masquare",13187,"mbopomofo",12551,"mbsquare",13268,"mcircle",9436,"mcubedsquare",13221,"mdotaccent",7745,"mdotbelow",7747,"meemarabic",1605,"meemfinalarabic",65250,"meeminitialarabic",65251,"meemmedialarabic",65252,"meemmeeminitialarabic",64721,"meemmeemisolatedarabic",64584,"meetorusquare",13133,"mehiragana",12417,"meizierasquare",13182,"mekatakana",12513,"mekatakanahalfwidth",65426,"mem",1502,"memdagesh",64318,"memdageshhebrew",64318,"memhebrew",1502,"menarmenian",1396,"merkhahebrew",1445,"merkhakefulahebrew",1446,"merkhakefulalefthebrew",1446,"merkhalefthebrew",1445,"mhook",625,"mhzsquare",13202,"middledotkatakanahalfwidth",65381,"middot",183,"mieumacirclekorean",12914,"mieumaparenkorean",12818,"mieumcirclekorean",12900,"mieumkorean",12609,"mieumpansioskorean",12656,"mieumparenkorean",12804,"mieumpieupkorean",12654,"mieumsioskorean",12655,"mihiragana",12415,"mikatakana",12511,"mikatakanahalfwidth",65424,"minus",8722,"minusbelowcmb",800,"minuscircle",8854,"minusmod",727,"minusplus",8723,"minute",8242,"miribaarusquare",13130,"mirisquare",13129,"mlonglegturned",624,"mlsquare",13206,"mmcubedsquare",13219,"mmonospace",65357,"mmsquaredsquare",13215,"mohiragana",12418,"mohmsquare",13249,"mokatakana",12514,"mokatakanahalfwidth",65427,"molsquare",13270,"momathai",3617,"moverssquare",13223,"moverssquaredsquare",13224,"mparen",9384,"mpasquare",13227,"mssquare",13235,"msuperior",63215,"mturned",623,"mu",181,"mu1",181,"muasquare",13186,"muchgreater",8811,"muchless",8810,"mufsquare",13196,"mugreek",956,"mugsquare",13197,"muhiragana",12416,"mukatakana",12512,"mukatakanahalfwidth",65425,"mulsquare",13205,"multiply",215,"mumsquare",13211,"munahhebrew",1443,"munahlefthebrew",1443,"musicalnote",9834,"musicalnotedbl",9835,"musicflatsign",9837,"musicsharpsign",9839,"mussquare",13234,"muvsquare",13238,"muwsquare",13244,"mvmegasquare",13241,"mvsquare",13239,"mwmegasquare",13247,"mwsquare",13245,"n",110,"nabengali",2472,"nabla",8711,"nacute",324,"nadeva",2344,"nagujarati",2728,"nagurmukhi",2600,"nahiragana",12394,"nakatakana",12490,"nakatakanahalfwidth",65413,"napostrophe",329,"nasquare",13185,"nbopomofo",12555,"nbspace",160,"ncaron",328,"ncedilla",326,"ncircle",9437,"ncircumflexbelow",7755,"ncommaaccent",326,"ndotaccent",7749,"ndotbelow",7751,"nehiragana",12397,"nekatakana",12493,"nekatakanahalfwidth",65416,"newsheqelsign",8362,"nfsquare",13195,"ngabengali",2457,"ngadeva",2329,"ngagujarati",2713,"ngagurmukhi",2585,"ngonguthai",3591,"nhiragana",12435,"nhookleft",626,"nhookretroflex",627,"nieunacirclekorean",12911,"nieunaparenkorean",12815,"nieuncieuckorean",12597,"nieuncirclekorean",12897,"nieunhieuhkorean",12598,"nieunkorean",12596,"nieunpansioskorean",12648,"nieunparenkorean",12801,"nieunsioskorean",12647,"nieuntikeutkorean",12646,"nihiragana",12395,"nikatakana",12491,"nikatakanahalfwidth",65414,"nikhahitleftthai",63641,"nikhahitthai",3661,"nine",57,"ninearabic",1641,"ninebengali",2543,"ninecircle",9320,"ninecircleinversesansserif",10130,"ninedeva",2415,"ninegujarati",2799,"ninegurmukhi",2671,"ninehackarabic",1641,"ninehangzhou",12329,"nineideographicparen",12840,"nineinferior",8329,"ninemonospace",65305,"nineoldstyle",63289,"nineparen",9340,"nineperiod",9360,"ninepersian",1785,"nineroman",8568,"ninesuperior",8313,"nineteencircle",9330,"nineteenparen",9350,"nineteenperiod",9370,"ninethai",3673,"nj",460,"njecyrillic",1114,"nkatakana",12531,"nkatakanahalfwidth",65437,"nlegrightlong",414,"nlinebelow",7753,"nmonospace",65358,"nmsquare",13210,"nnabengali",2467,"nnadeva",2339,"nnagujarati",2723,"nnagurmukhi",2595,"nnnadeva",2345,"nohiragana",12398,"nokatakana",12494,"nokatakanahalfwidth",65417,"nonbreakingspace",160,"nonenthai",3603,"nonuthai",3609,"noonarabic",1606,"noonfinalarabic",65254,"noonghunnaarabic",1722,"noonghunnafinalarabic",64415,"nooninitialarabic",65255,"noonjeeminitialarabic",64722,"noonjeemisolatedarabic",64587,"noonmedialarabic",65256,"noonmeeminitialarabic",64725,"noonmeemisolatedarabic",64590,"noonnoonfinalarabic",64653,"notcontains",8716,"notelement",8713,"notelementof",8713,"notequal",8800,"notgreater",8815,"notgreaternorequal",8817,"notgreaternorless",8825,"notidentical",8802,"notless",8814,"notlessnorequal",8816,"notparallel",8742,"notprecedes",8832,"notsubset",8836,"notsucceeds",8833,"notsuperset",8837,"nowarmenian",1398,"nparen",9385,"nssquare",13233,"nsuperior",8319,"ntilde",241,"nu",957,"nuhiragana",12396,"nukatakana",12492,"nukatakanahalfwidth",65415,"nuktabengali",2492,"nuktadeva",2364,"nuktagujarati",2748,"nuktagurmukhi",2620,"numbersign",35,"numbersignmonospace",65283,"numbersignsmall",65119,"numeralsigngreek",884,"numeralsignlowergreek",885,"numero",8470,"nun",1504,"nundagesh",64320,"nundageshhebrew",64320,"nunhebrew",1504,"nvsquare",13237,"nwsquare",13243,"nyabengali",2462,"nyadeva",2334,"nyagujarati",2718,"nyagurmukhi",2590,"o",111,"oacute",243,"oangthai",3629,"obarred",629,"obarredcyrillic",1257,"obarreddieresiscyrillic",1259,"obengali",2451,"obopomofo",12571,"obreve",335,"ocandradeva",2321,"ocandragujarati",2705,"ocandravowelsigndeva",2377,"ocandravowelsigngujarati",2761,"ocaron",466,"ocircle",9438,"ocircumflex",244,"ocircumflexacute",7889,"ocircumflexdotbelow",7897,"ocircumflexgrave",7891,"ocircumflexhookabove",7893,"ocircumflextilde",7895,"ocyrillic",1086,"odblacute",337,"odblgrave",525,"odeva",2323,"odieresis",246,"odieresiscyrillic",1255,"odotbelow",7885,"oe",339,"oekorean",12634,"ogonek",731,"ogonekcmb",808,"ograve",242,"ogujarati",2707,"oharmenian",1413,"ohiragana",12362,"ohookabove",7887,"ohorn",417,"ohornacute",7899,"ohorndotbelow",7907,"ohorngrave",7901,"ohornhookabove",7903,"ohorntilde",7905,"ohungarumlaut",337,"oi",419,"oinvertedbreve",527,"okatakana",12458,"okatakanahalfwidth",65397,"okorean",12631,"olehebrew",1451,"omacron",333,"omacronacute",7763,"omacrongrave",7761,"omdeva",2384,"omega",969,"omega1",982,"omegacyrillic",1121,"omegalatinclosed",631,"omegaroundcyrillic",1147,"omegatitlocyrillic",1149,"omegatonos",974,"omgujarati",2768,"omicron",959,"omicrontonos",972,"omonospace",65359,"one",49,"onearabic",1633,"onebengali",2535,"onecircle",9312,"onecircleinversesansserif",10122,"onedeva",2407,"onedotenleader",8228,"oneeighth",8539,"onefitted",63196,"onegujarati",2791,"onegurmukhi",2663,"onehackarabic",1633,"onehalf",189,"onehangzhou",12321,"oneideographicparen",12832,"oneinferior",8321,"onemonospace",65297,"onenumeratorbengali",2548,"oneoldstyle",63281,"oneparen",9332,"oneperiod",9352,"onepersian",1777,"onequarter",188,"oneroman",8560,"onesuperior",185,"onethai",3665,"onethird",8531,"oogonek",491,"oogonekmacron",493,"oogurmukhi",2579,"oomatragurmukhi",2635,"oopen",596,"oparen",9386,"openbullet",9702,"option",8997,"ordfeminine",170,"ordmasculine",186,"orthogonal",8735,"oshortdeva",2322,"oshortvowelsigndeva",2378,"oslash",248,"oslashacute",511,"osmallhiragana",12361,"osmallkatakana",12457,"osmallkatakanahalfwidth",65387,"ostrokeacute",511,"osuperior",63216,"otcyrillic",1151,"otilde",245,"otildeacute",7757,"otildedieresis",7759,"oubopomofo",12577,"overline",8254,"overlinecenterline",65098,"overlinecmb",773,"overlinedashed",65097,"overlinedblwavy",65100,"overlinewavy",65099,"overscore",175,"ovowelsignbengali",2507,"ovowelsigndeva",2379,"ovowelsigngujarati",2763,"p",112,"paampssquare",13184,"paasentosquare",13099,"pabengali",2474,"pacute",7765,"padeva",2346,"pagedown",8671,"pageup",8670,"pagujarati",2730,"pagurmukhi",2602,"pahiragana",12401,"paiyannoithai",3631,"pakatakana",12497,"palatalizationcyrilliccmb",1156,"palochkacyrillic",1216,"pansioskorean",12671,"paragraph",182,"parallel",8741,"parenleft",40,"parenleftaltonearabic",64830,"parenleftbt",63725,"parenleftex",63724,"parenleftinferior",8333,"parenleftmonospace",65288,"parenleftsmall",65113,"parenleftsuperior",8317,"parenlefttp",63723,"parenleftvertical",65077,"parenright",41,"parenrightaltonearabic",64831,"parenrightbt",63736,"parenrightex",63735,"parenrightinferior",8334,"parenrightmonospace",65289,"parenrightsmall",65114,"parenrightsuperior",8318,"parenrighttp",63734,"parenrightvertical",65078,"partialdiff",8706,"paseqhebrew",1472,"pashtahebrew",1433,"pasquare",13225,"patah",1463,"patah11",1463,"patah1d",1463,"patah2a",1463,"patahhebrew",1463,"patahnarrowhebrew",1463,"patahquarterhebrew",1463,"patahwidehebrew",1463,"pazerhebrew",1441,"pbopomofo",12550,"pcircle",9439,"pdotaccent",7767,"pe",1508,"pecyrillic",1087,"pedagesh",64324,"pedageshhebrew",64324,"peezisquare",13115,"pefinaldageshhebrew",64323,"peharabic",1662,"peharmenian",1402,"pehebrew",1508,"pehfinalarabic",64343,"pehinitialarabic",64344,"pehiragana",12410,"pehmedialarabic",64345,"pekatakana",12506,"pemiddlehookcyrillic",1191,"perafehebrew",64334,"percent",37,"percentarabic",1642,"percentmonospace",65285,"percentsmall",65130,"period",46,"periodarmenian",1417,"periodcentered",183,"periodhalfwidth",65377,"periodinferior",63207,"periodmonospace",65294,"periodsmall",65106,"periodsuperior",63208,"perispomenigreekcmb",834,"perpendicular",8869,"perthousand",8240,"peseta",8359,"pfsquare",13194,"phabengali",2475,"phadeva",2347,"phagujarati",2731,"phagurmukhi",2603,"phi",966,"phi1",981,"phieuphacirclekorean",12922,"phieuphaparenkorean",12826,"phieuphcirclekorean",12908,"phieuphkorean",12621,"phieuphparenkorean",12812,"philatin",632,"phinthuthai",3642,"phisymbolgreek",981,"phook",421,"phophanthai",3614,"phophungthai",3612,"phosamphaothai",3616,"pi",960,"pieupacirclekorean",12915,"pieupaparenkorean",12819,"pieupcieuckorean",12662,"pieupcirclekorean",12901,"pieupkiyeokkorean",12658,"pieupkorean",12610,"pieupparenkorean",12805,"pieupsioskiyeokkorean",12660,"pieupsioskorean",12612,"pieupsiostikeutkorean",12661,"pieupthieuthkorean",12663,"pieuptikeutkorean",12659,"pihiragana",12404,"pikatakana",12500,"pisymbolgreek",982,"piwrarmenian",1411,"plus",43,"plusbelowcmb",799,"pluscircle",8853,"plusminus",177,"plusmod",726,"plusmonospace",65291,"plussmall",65122,"plussuperior",8314,"pmonospace",65360,"pmsquare",13272,"pohiragana",12413,"pointingindexdownwhite",9759,"pointingindexleftwhite",9756,"pointingindexrightwhite",9758,"pointingindexupwhite",9757,"pokatakana",12509,"poplathai",3611,"postalmark",12306,"postalmarkface",12320,"pparen",9387,"precedes",8826,"prescription",8478,"primemod",697,"primereversed",8245,"product",8719,"projective",8965,"prolongedkana",12540,"propellor",8984,"propersubset",8834,"propersuperset",8835,"proportion",8759,"proportional",8733,"psi",968,"psicyrillic",1137,"psilipneumatacyrilliccmb",1158,"pssquare",13232,"puhiragana",12407,"pukatakana",12503,"pvsquare",13236,"pwsquare",13242,"q",113,"qadeva",2392,"qadmahebrew",1448,"qafarabic",1602,"qaffinalarabic",65238,"qafinitialarabic",65239,"qafmedialarabic",65240,"qamats",1464,"qamats10",1464,"qamats1a",1464,"qamats1c",1464,"qamats27",1464,"qamats29",1464,"qamats33",1464,"qamatsde",1464,"qamatshebrew",1464,"qamatsnarrowhebrew",1464,"qamatsqatanhebrew",1464,"qamatsqatannarrowhebrew",1464,"qamatsqatanquarterhebrew",1464,"qamatsqatanwidehebrew",1464,"qamatsquarterhebrew",1464,"qamatswidehebrew",1464,"qarneyparahebrew",1439,"qbopomofo",12561,"qcircle",9440,"qhook",672,"qmonospace",65361,"qof",1511,"qofdagesh",64327,"qofdageshhebrew",64327,"qofhebrew",1511,"qparen",9388,"quarternote",9833,"qubuts",1467,"qubuts18",1467,"qubuts25",1467,"qubuts31",1467,"qubutshebrew",1467,"qubutsnarrowhebrew",1467,"qubutsquarterhebrew",1467,"qubutswidehebrew",1467,"question",63,"questionarabic",1567,"questionarmenian",1374,"questiondown",191,"questiondownsmall",63423,"questiongreek",894,"questionmonospace",65311,"questionsmall",63295,"quotedbl",34,"quotedblbase",8222,"quotedblleft",8220,"quotedblmonospace",65282,"quotedblprime",12318,"quotedblprimereversed",12317,"quotedblright",8221,"quoteleft",8216,"quoteleftreversed",8219,"quotereversed",8219,"quoteright",8217,"quoterightn",329,"quotesinglbase",8218,"quotesingle",39,"quotesinglemonospace",65287,"r",114,"raarmenian",1404,"rabengali",2480,"racute",341,"radeva",2352,"radical",8730,"radicalex",63717,"radoverssquare",13230,"radoverssquaredsquare",13231,"radsquare",13229,"rafe",1471,"rafehebrew",1471,"ragujarati",2736,"ragurmukhi",2608,"rahiragana",12425,"rakatakana",12521,"rakatakanahalfwidth",65431,"ralowerdiagonalbengali",2545,"ramiddlediagonalbengali",2544,"ramshorn",612,"ratio",8758,"rbopomofo",12566,"rcaron",345,"rcedilla",343,"rcircle",9441,"rcommaaccent",343,"rdblgrave",529,"rdotaccent",7769,"rdotbelow",7771,"rdotbelowmacron",7773,"referencemark",8251,"reflexsubset",8838,"reflexsuperset",8839,"registered",174,"registersans",63720,"registerserif",63194,"reharabic",1585,"reharmenian",1408,"rehfinalarabic",65198,"rehiragana",12428,"rekatakana",12524,"rekatakanahalfwidth",65434,"resh",1512,"reshdageshhebrew",64328,"reshhebrew",1512,"reversedtilde",8765,"reviahebrew",1431,"reviamugrashhebrew",1431,"revlogicalnot",8976,"rfishhook",638,"rfishhookreversed",639,"rhabengali",2525,"rhadeva",2397,"rho",961,"rhook",637,"rhookturned",635,"rhookturnedsuperior",693,"rhosymbolgreek",1009,"rhotichookmod",734,"rieulacirclekorean",12913,"rieulaparenkorean",12817,"rieulcirclekorean",12899,"rieulhieuhkorean",12608,"rieulkiyeokkorean",12602,"rieulkiyeoksioskorean",12649,"rieulkorean",12601,"rieulmieumkorean",12603,"rieulpansioskorean",12652,"rieulparenkorean",12803,"rieulphieuphkorean",12607,"rieulpieupkorean",12604,"rieulpieupsioskorean",12651,"rieulsioskorean",12605,"rieulthieuthkorean",12606,"rieultikeutkorean",12650,"rieulyeorinhieuhkorean",12653,"rightangle",8735,"righttackbelowcmb",793,"righttriangle",8895,"rihiragana",12426,"rikatakana",12522,"rikatakanahalfwidth",65432,"ring",730,"ringbelowcmb",805,"ringcmb",778,"ringhalfleft",703,"ringhalfleftarmenian",1369,"ringhalfleftbelowcmb",796,"ringhalfleftcentered",723,"ringhalfright",702,"ringhalfrightbelowcmb",825,"ringhalfrightcentered",722,"rinvertedbreve",531,"rittorusquare",13137,"rlinebelow",7775,"rlongleg",636,"rlonglegturned",634,"rmonospace",65362,"rohiragana",12429,"rokatakana",12525,"rokatakanahalfwidth",65435,"roruathai",3619,"rparen",9389,"rrabengali",2524,"rradeva",2353,"rragurmukhi",2652,"rreharabic",1681,"rrehfinalarabic",64397,"rrvocalicbengali",2528,"rrvocalicdeva",2400,"rrvocalicgujarati",2784,"rrvocalicvowelsignbengali",2500,"rrvocalicvowelsigndeva",2372,"rrvocalicvowelsigngujarati",2756,"rsuperior",63217,"rtblock",9616,"rturned",633,"rturnedsuperior",692,"ruhiragana",12427,"rukatakana",12523,"rukatakanahalfwidth",65433,"rupeemarkbengali",2546,"rupeesignbengali",2547,"rupiah",63197,"ruthai",3620,"rvocalicbengali",2443,"rvocalicdeva",2315,"rvocalicgujarati",2699,"rvocalicvowelsignbengali",2499,"rvocalicvowelsigndeva",2371,"rvocalicvowelsigngujarati",2755,"s",115,"sabengali",2488,"sacute",347,"sacutedotaccent",7781,"sadarabic",1589,"sadeva",2360,"sadfinalarabic",65210,"sadinitialarabic",65211,"sadmedialarabic",65212,"sagujarati",2744,"sagurmukhi",2616,"sahiragana",12373,"sakatakana",12469,"sakatakanahalfwidth",65403,"sallallahoualayhewasallamarabic",65018,"samekh",1505,"samekhdagesh",64321,"samekhdageshhebrew",64321,"samekhhebrew",1505,"saraaathai",3634,"saraaethai",3649,"saraaimaimalaithai",3652,"saraaimaimuanthai",3651,"saraamthai",3635,"saraathai",3632,"saraethai",3648,"saraiileftthai",63622,"saraiithai",3637,"saraileftthai",63621,"saraithai",3636,"saraothai",3650,"saraueeleftthai",63624,"saraueethai",3639,"saraueleftthai",63623,"sarauethai",3638,"sarauthai",3640,"sarauuthai",3641,"sbopomofo",12569,"scaron",353,"scarondotaccent",7783,"scedilla",351,"schwa",601,"schwacyrillic",1241,"schwadieresiscyrillic",1243,"schwahook",602,"scircle",9442,"scircumflex",349,"scommaaccent",537,"sdotaccent",7777,"sdotbelow",7779,"sdotbelowdotaccent",7785,"seagullbelowcmb",828,"second",8243,"secondtonechinese",714,"section",167,"seenarabic",1587,"seenfinalarabic",65202,"seeninitialarabic",65203,"seenmedialarabic",65204,"segol",1462,"segol13",1462,"segol1f",1462,"segol2c",1462,"segolhebrew",1462,"segolnarrowhebrew",1462,"segolquarterhebrew",1462,"segoltahebrew",1426,"segolwidehebrew",1462,"seharmenian",1405,"sehiragana",12379,"sekatakana",12475,"sekatakanahalfwidth",65406,"semicolon",59,"semicolonarabic",1563,"semicolonmonospace",65307,"semicolonsmall",65108,"semivoicedmarkkana",12444,"semivoicedmarkkanahalfwidth",65439,"sentisquare",13090,"sentosquare",13091,"seven",55,"sevenarabic",1639,"sevenbengali",2541,"sevencircle",9318,"sevencircleinversesansserif",10128,"sevendeva",2413,"seveneighths",8542,"sevengujarati",2797,"sevengurmukhi",2669,"sevenhackarabic",1639,"sevenhangzhou",12327,"sevenideographicparen",12838,"seveninferior",8327,"sevenmonospace",65303,"sevenoldstyle",63287,"sevenparen",9338,"sevenperiod",9358,"sevenpersian",1783,"sevenroman",8566,"sevensuperior",8311,"seventeencircle",9328,"seventeenparen",9348,"seventeenperiod",9368,"seventhai",3671,"sfthyphen",173,"shaarmenian",1399,"shabengali",2486,"shacyrillic",1096,"shaddaarabic",1617,"shaddadammaarabic",64609,"shaddadammatanarabic",64606,"shaddafathaarabic",64608,"shaddakasraarabic",64610,"shaddakasratanarabic",64607,"shade",9618,"shadedark",9619,"shadelight",9617,"shademedium",9618,"shadeva",2358,"shagujarati",2742,"shagurmukhi",2614,"shalshelethebrew",1427,"shbopomofo",12565,"shchacyrillic",1097,"sheenarabic",1588,"sheenfinalarabic",65206,"sheeninitialarabic",65207,"sheenmedialarabic",65208,"sheicoptic",995,"sheqel",8362,"sheqelhebrew",8362,"sheva",1456,"sheva115",1456,"sheva15",1456,"sheva22",1456,"sheva2e",1456,"shevahebrew",1456,"shevanarrowhebrew",1456,"shevaquarterhebrew",1456,"shevawidehebrew",1456,"shhacyrillic",1211,"shimacoptic",1005,"shin",1513,"shindagesh",64329,"shindageshhebrew",64329,"shindageshshindot",64300,"shindageshshindothebrew",64300,"shindageshsindot",64301,"shindageshsindothebrew",64301,"shindothebrew",1473,"shinhebrew",1513,"shinshindot",64298,"shinshindothebrew",64298,"shinsindot",64299,"shinsindothebrew",64299,"shook",642,"sigma",963,"sigma1",962,"sigmafinal",962,"sigmalunatesymbolgreek",1010,"sihiragana",12375,"sikatakana",12471,"sikatakanahalfwidth",65404,"siluqhebrew",1469,"siluqlefthebrew",1469,"similar",8764,"sindothebrew",1474,"siosacirclekorean",12916,"siosaparenkorean",12820,"sioscieuckorean",12670,"sioscirclekorean",12902,"sioskiyeokkorean",12666,"sioskorean",12613,"siosnieunkorean",12667,"siosparenkorean",12806,"siospieupkorean",12669,"siostikeutkorean",12668,"six",54,"sixarabic",1638,"sixbengali",2540,"sixcircle",9317,"sixcircleinversesansserif",10127,"sixdeva",2412,"sixgujarati",2796,"sixgurmukhi",2668,"sixhackarabic",1638,"sixhangzhou",12326,"sixideographicparen",12837,"sixinferior",8326,"sixmonospace",65302,"sixoldstyle",63286,"sixparen",9337,"sixperiod",9357,"sixpersian",1782,"sixroman",8565,"sixsuperior",8310,"sixteencircle",9327,"sixteencurrencydenominatorbengali",2553,"sixteenparen",9347,"sixteenperiod",9367,"sixthai",3670,"slash",47,"slashmonospace",65295,"slong",383,"slongdotaccent",7835,"smileface",9786,"smonospace",65363,"sofpasuqhebrew",1475,"softhyphen",173,"softsigncyrillic",1100,"sohiragana",12381,"sokatakana",12477,"sokatakanahalfwidth",65407,"soliduslongoverlaycmb",824,"solidusshortoverlaycmb",823,"sorusithai",3625,"sosalathai",3624,"sosothai",3595,"sosuathai",3626,"space",32,"spacehackarabic",32,"spade",9824,"spadesuitblack",9824,"spadesuitwhite",9828,"sparen",9390,"squarebelowcmb",827,"squarecc",13252,"squarecm",13213,"squarediagonalcrosshatchfill",9641,"squarehorizontalfill",9636,"squarekg",13199,"squarekm",13214,"squarekmcapital",13262,"squareln",13265,"squarelog",13266,"squaremg",13198,"squaremil",13269,"squaremm",13212,"squaremsquared",13217,"squareorthogonalcrosshatchfill",9638,"squareupperlefttolowerrightfill",9639,"squareupperrighttolowerleftfill",9640,"squareverticalfill",9637,"squarewhitewithsmallblack",9635,"srsquare",13275,"ssabengali",2487,"ssadeva",2359,"ssagujarati",2743,"ssangcieuckorean",12617,"ssanghieuhkorean",12677,"ssangieungkorean",12672,"ssangkiyeokkorean",12594,"ssangnieunkorean",12645,"ssangpieupkorean",12611,"ssangsioskorean",12614,"ssangtikeutkorean",12600,"ssuperior",63218,"sterling",163,"sterlingmonospace",65505,"strokelongoverlaycmb",822,"strokeshortoverlaycmb",821,"subset",8834,"subsetnotequal",8842,"subsetorequal",8838,"succeeds",8827,"suchthat",8715,"suhiragana",12377,"sukatakana",12473,"sukatakanahalfwidth",65405,"sukunarabic",1618,"summation",8721,"sun",9788,"superset",8835,"supersetnotequal",8843,"supersetorequal",8839,"svsquare",13276,"syouwaerasquare",13180,"t",116,"tabengali",2468,"tackdown",8868,"tackleft",8867,"tadeva",2340,"tagujarati",2724,"tagurmukhi",2596,"taharabic",1591,"tahfinalarabic",65218,"tahinitialarabic",65219,"tahiragana",12383,"tahmedialarabic",65220,"taisyouerasquare",13181,"takatakana",12479,"takatakanahalfwidth",65408,"tatweelarabic",1600,"tau",964,"tav",1514,"tavdages",64330,"tavdagesh",64330,"tavdageshhebrew",64330,"tavhebrew",1514,"tbar",359,"tbopomofo",12554,"tcaron",357,"tccurl",680,"tcedilla",355,"tcheharabic",1670,"tchehfinalarabic",64379,"tchehinitialarabic",64380,"tchehmedialarabic",64381,"tcircle",9443,"tcircumflexbelow",7793,"tcommaaccent",355,"tdieresis",7831,"tdotaccent",7787,"tdotbelow",7789,"tecyrillic",1090,"tedescendercyrillic",1197,"teharabic",1578,"tehfinalarabic",65174,"tehhahinitialarabic",64674,"tehhahisolatedarabic",64524,"tehinitialarabic",65175,"tehiragana",12390,"tehjeeminitialarabic",64673,"tehjeemisolatedarabic",64523,"tehmarbutaarabic",1577,"tehmarbutafinalarabic",65172,"tehmedialarabic",65176,"tehmeeminitialarabic",64676,"tehmeemisolatedarabic",64526,"tehnoonfinalarabic",64627,"tekatakana",12486,"tekatakanahalfwidth",65411,"telephone",8481,"telephoneblack",9742,"telishagedolahebrew",1440,"telishaqetanahebrew",1449,"tencircle",9321,"tenideographicparen",12841,"tenparen",9341,"tenperiod",9361,"tenroman",8569,"tesh",679,"tet",1496,"tetdagesh",64312,"tetdageshhebrew",64312,"tethebrew",1496,"tetsecyrillic",1205,"tevirhebrew",1435,"tevirlefthebrew",1435,"thabengali",2469,"thadeva",2341,"thagujarati",2725,"thagurmukhi",2597,"thalarabic",1584,"thalfinalarabic",65196,"thanthakhatlowleftthai",63640,"thanthakhatlowrightthai",63639,"thanthakhatthai",3660,"thanthakhatupperleftthai",63638,"theharabic",1579,"thehfinalarabic",65178,"thehinitialarabic",65179,"thehmedialarabic",65180,"thereexists",8707,"therefore",8756,"theta",952,"theta1",977,"thetasymbolgreek",977,"thieuthacirclekorean",12921,"thieuthaparenkorean",12825,"thieuthcirclekorean",12907,"thieuthkorean",12620,"thieuthparenkorean",12811,"thirteencircle",9324,"thirteenparen",9344,"thirteenperiod",9364,"thonangmonthothai",3601,"thook",429,"thophuthaothai",3602,"thorn",254,"thothahanthai",3607,"thothanthai",3600,"thothongthai",3608,"thothungthai",3606,"thousandcyrillic",1154,"thousandsseparatorarabic",1644,"thousandsseparatorpersian",1644,"three",51,"threearabic",1635,"threebengali",2537,"threecircle",9314,"threecircleinversesansserif",10124,"threedeva",2409,"threeeighths",8540,"threegujarati",2793,"threegurmukhi",2665,"threehackarabic",1635,"threehangzhou",12323,"threeideographicparen",12834,"threeinferior",8323,"threemonospace",65299,"threenumeratorbengali",2550,"threeoldstyle",63283,"threeparen",9334,"threeperiod",9354,"threepersian",1779,"threequarters",190,"threequartersemdash",63198,"threeroman",8562,"threesuperior",179,"threethai",3667,"thzsquare",13204,"tihiragana",12385,"tikatakana",12481,"tikatakanahalfwidth",65409,"tikeutacirclekorean",12912,"tikeutaparenkorean",12816,"tikeutcirclekorean",12898,"tikeutkorean",12599,"tikeutparenkorean",12802,"tilde",732,"tildebelowcmb",816,"tildecmb",771,"tildecomb",771,"tildedoublecmb",864,"tildeoperator",8764,"tildeoverlaycmb",820,"tildeverticalcmb",830,"timescircle",8855,"tipehahebrew",1430,"tipehalefthebrew",1430,"tippigurmukhi",2672,"titlocyrilliccmb",1155,"tiwnarmenian",1407,"tlinebelow",7791,"tmonospace",65364,"toarmenian",1385,"tohiragana",12392,"tokatakana",12488,"tokatakanahalfwidth",65412,"tonebarextrahighmod",741,"tonebarextralowmod",745,"tonebarhighmod",742,"tonebarlowmod",744,"tonebarmidmod",743,"tonefive",445,"tonesix",389,"tonetwo",424,"tonos",900,"tonsquare",13095,"topatakthai",3599,"tortoiseshellbracketleft",12308,"tortoiseshellbracketleftsmall",65117,"tortoiseshellbracketleftvertical",65081,"tortoiseshellbracketright",12309,"tortoiseshellbracketrightsmall",65118,"tortoiseshellbracketrightvertical",65082,"totaothai",3605,"tpalatalhook",427,"tparen",9391,"trademark",8482,"trademarksans",63722,"trademarkserif",63195,"tretroflexhook",648,"triagdn",9660,"triaglf",9668,"triagrt",9658,"triagup",9650,"ts",678,"tsadi",1510,"tsadidagesh",64326,"tsadidageshhebrew",64326,"tsadihebrew",1510,"tsecyrillic",1094,"tsere",1461,"tsere12",1461,"tsere1e",1461,"tsere2b",1461,"tserehebrew",1461,"tserenarrowhebrew",1461,"tserequarterhebrew",1461,"tserewidehebrew",1461,"tshecyrillic",1115,"tsuperior",63219,"ttabengali",2463,"ttadeva",2335,"ttagujarati",2719,"ttagurmukhi",2591,"tteharabic",1657,"ttehfinalarabic",64359,"ttehinitialarabic",64360,"ttehmedialarabic",64361,"tthabengali",2464,"tthadeva",2336,"tthagujarati",2720,"tthagurmukhi",2592,"tturned",647,"tuhiragana",12388,"tukatakana",12484,"tukatakanahalfwidth",65410,"tusmallhiragana",12387,"tusmallkatakana",12483,"tusmallkatakanahalfwidth",65391,"twelvecircle",9323,"twelveparen",9343,"twelveperiod",9363,"twelveroman",8571,"twentycircle",9331,"twentyhangzhou",21316,"twentyparen",9351,"twentyperiod",9371,"two",50,"twoarabic",1634,"twobengali",2536,"twocircle",9313,"twocircleinversesansserif",10123,"twodeva",2408,"twodotenleader",8229,"twodotleader",8229,"twodotleadervertical",65072,"twogujarati",2792,"twogurmukhi",2664,"twohackarabic",1634,"twohangzhou",12322,"twoideographicparen",12833,"twoinferior",8322,"twomonospace",65298,"twonumeratorbengali",2549,"twooldstyle",63282,"twoparen",9333,"twoperiod",9353,"twopersian",1778,"tworoman",8561,"twostroke",443,"twosuperior",178,"twothai",3666,"twothirds",8532,"u",117,"uacute",250,"ubar",649,"ubengali",2441,"ubopomofo",12584,"ubreve",365,"ucaron",468,"ucircle",9444,"ucircumflex",251,"ucircumflexbelow",7799,"ucyrillic",1091,"udattadeva",2385,"udblacute",369,"udblgrave",533,"udeva",2313,"udieresis",252,"udieresisacute",472,"udieresisbelow",7795,"udieresiscaron",474,"udieresiscyrillic",1265,"udieresisgrave",476,"udieresismacron",470,"udotbelow",7909,"ugrave",249,"ugujarati",2697,"ugurmukhi",2569,"uhiragana",12358,"uhookabove",7911,"uhorn",432,"uhornacute",7913,"uhorndotbelow",7921,"uhorngrave",7915,"uhornhookabove",7917,"uhorntilde",7919,"uhungarumlaut",369,"uhungarumlautcyrillic",1267,"uinvertedbreve",535,"ukatakana",12454,"ukatakanahalfwidth",65395,"ukcyrillic",1145,"ukorean",12636,"umacron",363,"umacroncyrillic",1263,"umacrondieresis",7803,"umatragurmukhi",2625,"umonospace",65365,"underscore",95,"underscoredbl",8215,"underscoremonospace",65343,"underscorevertical",65075,"underscorewavy",65103,"union",8746,"universal",8704,"uogonek",371,"uparen",9392,"upblock",9600,"upperdothebrew",1476,"upsilon",965,"upsilondieresis",971,"upsilondieresistonos",944,"upsilonlatin",650,"upsilontonos",973,"uptackbelowcmb",797,"uptackmod",724,"uragurmukhi",2675,"uring",367,"ushortcyrillic",1118,"usmallhiragana",12357,"usmallkatakana",12453,"usmallkatakanahalfwidth",65385,"ustraightcyrillic",1199,"ustraightstrokecyrillic",1201,"utilde",361,"utildeacute",7801,"utildebelow",7797,"uubengali",2442,"uudeva",2314,"uugujarati",2698,"uugurmukhi",2570,"uumatragurmukhi",2626,"uuvowelsignbengali",2498,"uuvowelsigndeva",2370,"uuvowelsigngujarati",2754,"uvowelsignbengali",2497,"uvowelsigndeva",2369,"uvowelsigngujarati",2753,"v",118,"vadeva",2357,"vagujarati",2741,"vagurmukhi",2613,"vakatakana",12535,"vav",1493,"vavdagesh",64309,"vavdagesh65",64309,"vavdageshhebrew",64309,"vavhebrew",1493,"vavholam",64331,"vavholamhebrew",64331,"vavvavhebrew",1520,"vavyodhebrew",1521,"vcircle",9445,"vdotbelow",7807,"vecyrillic",1074,"veharabic",1700,"vehfinalarabic",64363,"vehinitialarabic",64364,"vehmedialarabic",64365,"vekatakana",12537,"venus",9792,"verticalbar",124,"verticallineabovecmb",781,"verticallinebelowcmb",809,"verticallinelowmod",716,"verticallinemod",712,"vewarmenian",1406,"vhook",651,"vikatakana",12536,"viramabengali",2509,"viramadeva",2381,"viramagujarati",2765,"visargabengali",2435,"visargadeva",2307,"visargagujarati",2691,"vmonospace",65366,"voarmenian",1400,"voicediterationhiragana",12446,"voicediterationkatakana",12542,"voicedmarkkana",12443,"voicedmarkkanahalfwidth",65438,"vokatakana",12538,"vparen",9393,"vtilde",7805,"vturned",652,"vuhiragana",12436,"vukatakana",12532,"w",119,"wacute",7811,"waekorean",12633,"wahiragana",12431,"wakatakana",12527,"wakatakanahalfwidth",65436,"wakorean",12632,"wasmallhiragana",12430,"wasmallkatakana",12526,"wattosquare",13143,"wavedash",12316,"wavyunderscorevertical",65076,"wawarabic",1608,"wawfinalarabic",65262,"wawhamzaabovearabic",1572,"wawhamzaabovefinalarabic",65158,"wbsquare",13277,"wcircle",9446,"wcircumflex",373,"wdieresis",7813,"wdotaccent",7815,"wdotbelow",7817,"wehiragana",12433,"weierstrass",8472,"wekatakana",12529,"wekorean",12638,"weokorean",12637,"wgrave",7809,"whitebullet",9702,"whitecircle",9675,"whitecircleinverse",9689,"whitecornerbracketleft",12302,"whitecornerbracketleftvertical",65091,"whitecornerbracketright",12303,"whitecornerbracketrightvertical",65092,"whitediamond",9671,"whitediamondcontainingblacksmalldiamond",9672,"whitedownpointingsmalltriangle",9663,"whitedownpointingtriangle",9661,"whiteleftpointingsmalltriangle",9667,"whiteleftpointingtriangle",9665,"whitelenticularbracketleft",12310,"whitelenticularbracketright",12311,"whiterightpointingsmalltriangle",9657,"whiterightpointingtriangle",9655,"whitesmallsquare",9643,"whitesmilingface",9786,"whitesquare",9633,"whitestar",9734,"whitetelephone",9743,"whitetortoiseshellbracketleft",12312,"whitetortoiseshellbracketright",12313,"whiteuppointingsmalltriangle",9653,"whiteuppointingtriangle",9651,"wihiragana",12432,"wikatakana",12528,"wikorean",12639,"wmonospace",65367,"wohiragana",12434,"wokatakana",12530,"wokatakanahalfwidth",65382,"won",8361,"wonmonospace",65510,"wowaenthai",3623,"wparen",9394,"wring",7832,"wsuperior",695,"wturned",653,"wynn",447,"x",120,"xabovecmb",829,"xbopomofo",12562,"xcircle",9447,"xdieresis",7821,"xdotaccent",7819,"xeharmenian",1389,"xi",958,"xmonospace",65368,"xparen",9395,"xsuperior",739,"y",121,"yaadosquare",13134,"yabengali",2479,"yacute",253,"yadeva",2351,"yaekorean",12626,"yagujarati",2735,"yagurmukhi",2607,"yahiragana",12420,"yakatakana",12516,"yakatakanahalfwidth",65428,"yakorean",12625,"yamakkanthai",3662,"yasmallhiragana",12419,"yasmallkatakana",12515,"yasmallkatakanahalfwidth",65388,"yatcyrillic",1123,"ycircle",9448,"ycircumflex",375,"ydieresis",255,"ydotaccent",7823,"ydotbelow",7925,"yeharabic",1610,"yehbarreearabic",1746,"yehbarreefinalarabic",64431,"yehfinalarabic",65266,"yehhamzaabovearabic",1574,"yehhamzaabovefinalarabic",65162,"yehhamzaaboveinitialarabic",65163,"yehhamzaabovemedialarabic",65164,"yehinitialarabic",65267,"yehmedialarabic",65268,"yehmeeminitialarabic",64733,"yehmeemisolatedarabic",64600,"yehnoonfinalarabic",64660,"yehthreedotsbelowarabic",1745,"yekorean",12630,"yen",165,"yenmonospace",65509,"yeokorean",12629,"yeorinhieuhkorean",12678,"yerahbenyomohebrew",1450,"yerahbenyomolefthebrew",1450,"yericyrillic",1099,"yerudieresiscyrillic",1273,"yesieungkorean",12673,"yesieungpansioskorean",12675,"yesieungsioskorean",12674,"yetivhebrew",1434,"ygrave",7923,"yhook",436,"yhookabove",7927,"yiarmenian",1397,"yicyrillic",1111,"yikorean",12642,"yinyang",9775,"yiwnarmenian",1410,"ymonospace",65369,"yod",1497,"yoddagesh",64313,"yoddageshhebrew",64313,"yodhebrew",1497,"yodyodhebrew",1522,"yodyodpatahhebrew",64287,"yohiragana",12424,"yoikorean",12681,"yokatakana",12520,"yokatakanahalfwidth",65430,"yokorean",12635,"yosmallhiragana",12423,"yosmallkatakana",12519,"yosmallkatakanahalfwidth",65390,"yotgreek",1011,"yoyaekorean",12680,"yoyakorean",12679,"yoyakthai",3618,"yoyingthai",3597,"yparen",9396,"ypogegrammeni",890,"ypogegrammenigreekcmb",837,"yr",422,"yring",7833,"ysuperior",696,"ytilde",7929,"yturned",654,"yuhiragana",12422,"yuikorean",12684,"yukatakana",12518,"yukatakanahalfwidth",65429,"yukorean",12640,"yusbigcyrillic",1131,"yusbigiotifiedcyrillic",1133,"yuslittlecyrillic",1127,"yuslittleiotifiedcyrillic",1129,"yusmallhiragana",12421,"yusmallkatakana",12517,"yusmallkatakanahalfwidth",65389,"yuyekorean",12683,"yuyeokorean",12682,"yyabengali",2527,"yyadeva",2399,"z",122,"zaarmenian",1382,"zacute",378,"zadeva",2395,"zagurmukhi",2651,"zaharabic",1592,"zahfinalarabic",65222,"zahinitialarabic",65223,"zahiragana",12374,"zahmedialarabic",65224,"zainarabic",1586,"zainfinalarabic",65200,"zakatakana",12470,"zaqefgadolhebrew",1429,"zaqefqatanhebrew",1428,"zarqahebrew",1432,"zayin",1494,"zayindagesh",64310,"zayindageshhebrew",64310,"zayinhebrew",1494,"zbopomofo",12567,"zcaron",382,"zcircle",9449,"zcircumflex",7825,"zcurl",657,"zdot",380,"zdotaccent",380,"zdotbelow",7827,"zecyrillic",1079,"zedescendercyrillic",1177,"zedieresiscyrillic",1247,"zehiragana",12380,"zekatakana",12476,"zero",48,"zeroarabic",1632,"zerobengali",2534,"zerodeva",2406,"zerogujarati",2790,"zerogurmukhi",2662,"zerohackarabic",1632,"zeroinferior",8320,"zeromonospace",65296,"zerooldstyle",63280,"zeropersian",1776,"zerosuperior",8304,"zerothai",3664,"zerowidthjoiner",65279,"zerowidthnonjoiner",8204,"zerowidthspace",8203,"zeta",950,"zhbopomofo",12563,"zhearmenian",1386,"zhebrevecyrillic",1218,"zhecyrillic",1078,"zhedescendercyrillic",1175,"zhedieresiscyrillic",1245,"zihiragana",12376,"zikatakana",12472,"zinorhebrew",1454,"zlinebelow",7829,"zmonospace",65370,"zohiragana",12382,"zokatakana",12478,"zparen",9397,"zretroflexhook",656,"zstroke",438,"zuhiragana",12378,"zukatakana",12474,".notdef",0,"angbracketleftbig",9001,"angbracketleftBig",9001,"angbracketleftbigg",9001,"angbracketleftBigg",9001,"angbracketrightBig",9002,"angbracketrightbig",9002,"angbracketrightBigg",9002,"angbracketrightbigg",9002,"arrowhookleft",8618,"arrowhookright",8617,"arrowlefttophalf",8636,"arrowleftbothalf",8637,"arrownortheast",8599,"arrownorthwest",8598,"arrowrighttophalf",8640,"arrowrightbothalf",8641,"arrowsoutheast",8600,"arrowsouthwest",8601,"backslashbig",8726,"backslashBig",8726,"backslashBigg",8726,"backslashbigg",8726,"bardbl",8214,"bracehtipdownleft",65079,"bracehtipdownright",65079,"bracehtipupleft",65080,"bracehtipupright",65080,"braceleftBig",123,"braceleftbig",123,"braceleftbigg",123,"braceleftBigg",123,"bracerightBig",125,"bracerightbig",125,"bracerightbigg",125,"bracerightBigg",125,"bracketleftbig",91,"bracketleftBig",91,"bracketleftbigg",91,"bracketleftBigg",91,"bracketrightBig",93,"bracketrightbig",93,"bracketrightbigg",93,"bracketrightBigg",93,"ceilingleftbig",8968,"ceilingleftBig",8968,"ceilingleftBigg",8968,"ceilingleftbigg",8968,"ceilingrightbig",8969,"ceilingrightBig",8969,"ceilingrightbigg",8969,"ceilingrightBigg",8969,"circledotdisplay",8857,"circledottext",8857,"circlemultiplydisplay",8855,"circlemultiplytext",8855,"circleplusdisplay",8853,"circleplustext",8853,"contintegraldisplay",8750,"contintegraltext",8750,"coproductdisplay",8720,"coproducttext",8720,"floorleftBig",8970,"floorleftbig",8970,"floorleftbigg",8970,"floorleftBigg",8970,"floorrightbig",8971,"floorrightBig",8971,"floorrightBigg",8971,"floorrightbigg",8971,"hatwide",770,"hatwider",770,"hatwidest",770,"intercal",7488,"integraldisplay",8747,"integraltext",8747,"intersectiondisplay",8898,"intersectiontext",8898,"logicalanddisplay",8743,"logicalandtext",8743,"logicalordisplay",8744,"logicalortext",8744,"parenleftBig",40,"parenleftbig",40,"parenleftBigg",40,"parenleftbigg",40,"parenrightBig",41,"parenrightbig",41,"parenrightBigg",41,"parenrightbigg",41,"prime",8242,"productdisplay",8719,"producttext",8719,"radicalbig",8730,"radicalBig",8730,"radicalBigg",8730,"radicalbigg",8730,"radicalbt",8730,"radicaltp",8730,"radicalvertex",8730,"slashbig",47,"slashBig",47,"slashBigg",47,"slashbigg",47,"summationdisplay",8721,"summationtext",8721,"tildewide",732,"tildewider",732,"tildewidest",732,"uniondisplay",8899,"unionmultidisplay",8846,"unionmultitext",8846,"unionsqdisplay",8852,"unionsqtext",8852,"uniontext",8899,"vextenddouble",8741,"vextendsingle",8739]})),i=(0,r.getArrayLookupTableFactory)((function(){return["space",32,"a1",9985,"a2",9986,"a202",9987,"a3",9988,"a4",9742,"a5",9990,"a119",9991,"a118",9992,"a117",9993,"a11",9755,"a12",9758,"a13",9996,"a14",9997,"a15",9998,"a16",9999,"a105",1e4,"a17",10001,"a18",10002,"a19",10003,"a20",10004,"a21",10005,"a22",10006,"a23",10007,"a24",10008,"a25",10009,"a26",10010,"a27",10011,"a28",10012,"a6",10013,"a7",10014,"a8",10015,"a9",10016,"a10",10017,"a29",10018,"a30",10019,"a31",10020,"a32",10021,"a33",10022,"a34",10023,"a35",9733,"a36",10025,"a37",10026,"a38",10027,"a39",10028,"a40",10029,"a41",10030,"a42",10031,"a43",10032,"a44",10033,"a45",10034,"a46",10035,"a47",10036,"a48",10037,"a49",10038,"a50",10039,"a51",10040,"a52",10041,"a53",10042,"a54",10043,"a55",10044,"a56",10045,"a57",10046,"a58",10047,"a59",10048,"a60",10049,"a61",10050,"a62",10051,"a63",10052,"a64",10053,"a65",10054,"a66",10055,"a67",10056,"a68",10057,"a69",10058,"a70",10059,"a71",9679,"a72",10061,"a73",9632,"a74",10063,"a203",10064,"a75",10065,"a204",10066,"a76",9650,"a77",9660,"a78",9670,"a79",10070,"a81",9687,"a82",10072,"a83",10073,"a84",10074,"a97",10075,"a98",10076,"a99",10077,"a100",10078,"a101",10081,"a102",10082,"a103",10083,"a104",10084,"a106",10085,"a107",10086,"a108",10087,"a112",9827,"a111",9830,"a110",9829,"a109",9824,"a120",9312,"a121",9313,"a122",9314,"a123",9315,"a124",9316,"a125",9317,"a126",9318,"a127",9319,"a128",9320,"a129",9321,"a130",10102,"a131",10103,"a132",10104,"a133",10105,"a134",10106,"a135",10107,"a136",10108,"a137",10109,"a138",10110,"a139",10111,"a140",10112,"a141",10113,"a142",10114,"a143",10115,"a144",10116,"a145",10117,"a146",10118,"a147",10119,"a148",10120,"a149",10121,"a150",10122,"a151",10123,"a152",10124,"a153",10125,"a154",10126,"a155",10127,"a156",10128,"a157",10129,"a158",10130,"a159",10131,"a160",10132,"a161",8594,"a163",8596,"a164",8597,"a196",10136,"a165",10137,"a192",10138,"a166",10139,"a167",10140,"a168",10141,"a169",10142,"a170",10143,"a171",10144,"a172",10145,"a173",10146,"a162",10147,"a174",10148,"a175",10149,"a176",10150,"a177",10151,"a178",10152,"a179",10153,"a193",10154,"a180",10155,"a199",10156,"a181",10157,"a200",10158,"a182",10159,"a201",10161,"a183",10162,"a184",10163,"a197",10164,"a185",10165,"a194",10166,"a198",10167,"a186",10168,"a195",10169,"a187",10170,"a188",10171,"a189",10172,"a190",10173,"a191",10174,"a89",10088,"a90",10089,"a93",10090,"a94",10091,"a91",10092,"a92",10093,"a205",10094,"a85",10095,"a206",10096,"a86",10097,"a87",10098,"a88",10099,"a95",10100,"a96",10101,".notdef",0]}))},(e,t,a)=>{a.r(t);a.d(t,{clearUnicodeCaches:()=>clearUnicodeCaches,getCharUnicodeCategory:()=>getCharUnicodeCategory,getNormalizedUnicodes:()=>s,getUnicodeForGlyph:()=>getUnicodeForGlyph,getUnicodeRangeFor:()=>getUnicodeRangeFor,mapSpecialUnicodeValues:()=>mapSpecialUnicodeValues,reverseIfRtl:()=>reverseIfRtl});var r=a(3);const n=(0,r.getLookupTableFactory)((function(e){e[63721]=169;e[63193]=169;e[63720]=174;e[63194]=174;e[63722]=8482;e[63195]=8482;e[63729]=9127;e[63730]=9128;e[63731]=9129;e[63740]=9131;e[63741]=9132;e[63742]=9133;e[63726]=9121;e[63727]=9122;e[63728]=9123;e[63737]=9124;e[63738]=9125;e[63739]=9126;e[63723]=9115;e[63724]=9116;e[63725]=9117;e[63734]=9118;e[63735]=9119;e[63736]=9120}));function mapSpecialUnicodeValues(e){return e>=65520&&e<=65535?0:e>=62976&&e<=63743?n()[e]||e:173===e?45:e}function getUnicodeForGlyph(e,t){let a=t[e];if(void 0!==a)return a;if(!e)return-1;if("u"===e[0]){const t=e.length;let r;if(7===t&&"n"===e[1]&&"i"===e[2])r=e.substring(3);else{if(!(t>=5&&t<=7))return-1;r=e.substring(1)}if(r===r.toUpperCase()){a=parseInt(r,16);if(a>=0)return a}}return-1}const i=[{begin:0,end:127},{begin:128,end:255},{begin:256,end:383},{begin:384,end:591},{begin:592,end:687},{begin:688,end:767},{begin:768,end:879},{begin:880,end:1023},{begin:11392,end:11519},{begin:1024,end:1279},{begin:1328,end:1423},{begin:1424,end:1535},{begin:42240,end:42559},{begin:1536,end:1791},{begin:1984,end:2047},{begin:2304,end:2431},{begin:2432,end:2559},{begin:2560,end:2687},{begin:2688,end:2815},{begin:2816,end:2943},{begin:2944,end:3071},{begin:3072,end:3199},{begin:3200,end:3327},{begin:3328,end:3455},{begin:3584,end:3711},{begin:3712,end:3839},{begin:4256,end:4351},{begin:6912,end:7039},{begin:4352,end:4607},{begin:7680,end:7935},{begin:7936,end:8191},{begin:8192,end:8303},{begin:8304,end:8351},{begin:8352,end:8399},{begin:8400,end:8447},{begin:8448,end:8527},{begin:8528,end:8591},{begin:8592,end:8703},{begin:8704,end:8959},{begin:8960,end:9215},{begin:9216,end:9279},{begin:9280,end:9311},{begin:9312,end:9471},{begin:9472,end:9599},{begin:9600,end:9631},{begin:9632,end:9727},{begin:9728,end:9983},{begin:9984,end:10175},{begin:12288,end:12351},{begin:12352,end:12447},{begin:12448,end:12543},{begin:12544,end:12591},{begin:12592,end:12687},{begin:43072,end:43135},{begin:12800,end:13055},{begin:13056,end:13311},{begin:44032,end:55215},{begin:55296,end:57343},{begin:67840,end:67871},{begin:19968,end:40959},{begin:57344,end:63743},{begin:12736,end:12783},{begin:64256,end:64335},{begin:64336,end:65023},{begin:65056,end:65071},{begin:65040,end:65055},{begin:65104,end:65135},{begin:65136,end:65279},{begin:65280,end:65519},{begin:65520,end:65535},{begin:3840,end:4095},{begin:1792,end:1871},{begin:1920,end:1983},{begin:3456,end:3583},{begin:4096,end:4255},{begin:4608,end:4991},{begin:5024,end:5119},{begin:5120,end:5759},{begin:5760,end:5791},{begin:5792,end:5887},{begin:6016,end:6143},{begin:6144,end:6319},{begin:10240,end:10495},{begin:40960,end:42127},{begin:5888,end:5919},{begin:66304,end:66351},{begin:66352,end:66383},{begin:66560,end:66639},{begin:118784,end:119039},{begin:119808,end:120831},{begin:1044480,end:1048573},{begin:65024,end:65039},{begin:917504,end:917631},{begin:6400,end:6479},{begin:6480,end:6527},{begin:6528,end:6623},{begin:6656,end:6687},{begin:11264,end:11359},{begin:11568,end:11647},{begin:19904,end:19967},{begin:43008,end:43055},{begin:65536,end:65663},{begin:65856,end:65935},{begin:66432,end:66463},{begin:66464,end:66527},{begin:66640,end:66687},{begin:66688,end:66735},{begin:67584,end:67647},{begin:68096,end:68191},{begin:119552,end:119647},{begin:73728,end:74751},{begin:119648,end:119679},{begin:7040,end:7103},{begin:7168,end:7247},{begin:7248,end:7295},{begin:43136,end:43231},{begin:43264,end:43311},{begin:43312,end:43359},{begin:43520,end:43615},{begin:65936,end:65999},{begin:66e3,end:66047},{begin:66208,end:66271},{begin:127024,end:127135}];function getUnicodeRangeFor(e){for(let t=0,a=i.length;t<a;t++){const a=i[t];if(e>=a.begin&&e<a.end)return t}return-1}const s=(0,r.getArrayLookupTableFactory)((function(){return["¨"," ̈","¯"," ̄","´"," ́","µ","μ","¸"," ̧","IJ","IJ","ij","ij","Ŀ","L·","ŀ","l·","ʼn","ʼn","ſ","s","DŽ","DŽ","Dž","Dž","dž","dž","LJ","LJ","Lj","Lj","lj","lj","NJ","NJ","Nj","Nj","nj","nj","DZ","DZ","Dz","Dz","dz","dz","˘"," ̆","˙"," ̇","˚"," ̊","˛"," ̨","˜"," ̃","˝"," ̋","ͺ"," ͅ","΄"," ́","ϐ","β","ϑ","θ","ϒ","Υ","ϕ","φ","ϖ","π","ϰ","κ","ϱ","ρ","ϲ","ς","ϴ","Θ","ϵ","ε","Ϲ","Σ","և","եւ","ٵ","اٴ","ٶ","وٴ","ٷ","ۇٴ","ٸ","يٴ","ำ","ํา","ຳ","ໍາ","ໜ","ຫນ","ໝ","ຫມ","ཷ","ྲཱྀ","ཹ","ླཱྀ","ẚ","aʾ","᾽"," ̓","᾿"," ̓","῀"," ͂","῾"," ̔"," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," ","‗"," ̳","․",".","‥","..","…","...","″","′′","‴","′′′","‶","‵‵","‷","‵‵‵","‼","!!","‾"," ̅","⁇","??","⁈","?!","⁉","!?","⁗","′′′′"," "," ","₨","Rs","℀","a/c","℁","a/s","℃","°C","℅","c/o","℆","c/u","ℇ","Ɛ","℉","°F","№","No","℡","TEL","ℵ","א","ℶ","ב","ℷ","ג","ℸ","ד","℻","FAX","Ⅰ","I","Ⅱ","II","Ⅲ","III","Ⅳ","IV","Ⅴ","V","Ⅵ","VI","Ⅶ","VII","Ⅷ","VIII","Ⅸ","IX","Ⅹ","X","Ⅺ","XI","Ⅻ","XII","Ⅼ","L","Ⅽ","C","Ⅾ","D","Ⅿ","M","ⅰ","i","ⅱ","ii","ⅲ","iii","ⅳ","iv","ⅴ","v","ⅵ","vi","ⅶ","vii","ⅷ","viii","ⅸ","ix","ⅹ","x","ⅺ","xi","ⅻ","xii","ⅼ","l","ⅽ","c","ⅾ","d","ⅿ","m","∬","∫∫","∭","∫∫∫","∯","∮∮","∰","∮∮∮","⑴","(1)","⑵","(2)","⑶","(3)","⑷","(4)","⑸","(5)","⑹","(6)","⑺","(7)","⑻","(8)","⑼","(9)","⑽","(10)","⑾","(11)","⑿","(12)","⒀","(13)","⒁","(14)","⒂","(15)","⒃","(16)","⒄","(17)","⒅","(18)","⒆","(19)","⒇","(20)","⒈","1.","⒉","2.","⒊","3.","⒋","4.","⒌","5.","⒍","6.","⒎","7.","⒏","8.","⒐","9.","⒑","10.","⒒","11.","⒓","12.","⒔","13.","⒕","14.","⒖","15.","⒗","16.","⒘","17.","⒙","18.","⒚","19.","⒛","20.","⒜","(a)","⒝","(b)","⒞","(c)","⒟","(d)","⒠","(e)","⒡","(f)","⒢","(g)","⒣","(h)","⒤","(i)","⒥","(j)","⒦","(k)","⒧","(l)","⒨","(m)","⒩","(n)","⒪","(o)","⒫","(p)","⒬","(q)","⒭","(r)","⒮","(s)","⒯","(t)","⒰","(u)","⒱","(v)","⒲","(w)","⒳","(x)","⒴","(y)","⒵","(z)","⨌","∫∫∫∫","⩴","::=","⩵","==","⩶","===","⺟","母","⻳","龟","⼀","一","⼁","丨","⼂","丶","⼃","丿","⼄","乙","⼅","亅","⼆","二","⼇","亠","⼈","人","⼉","儿","⼊","入","⼋","八","⼌","冂","⼍","冖","⼎","冫","⼏","几","⼐","凵","⼑","刀","⼒","力","⼓","勹","⼔","匕","⼕","匚","⼖","匸","⼗","十","⼘","卜","⼙","卩","⼚","厂","⼛","厶","⼜","又","⼝","口","⼞","囗","⼟","土","⼠","士","⼡","夂","⼢","夊","⼣","夕","⼤","大","⼥","女","⼦","子","⼧","宀","⼨","寸","⼩","小","⼪","尢","⼫","尸","⼬","屮","⼭","山","⼮","巛","⼯","工","⼰","己","⼱","巾","⼲","干","⼳","幺","⼴","广","⼵","廴","⼶","廾","⼷","弋","⼸","弓","⼹","彐","⼺","彡","⼻","彳","⼼","心","⼽","戈","⼾","戶","⼿","手","⽀","支","⽁","攴","⽂","文","⽃","斗","⽄","斤","⽅","方","⽆","无","⽇","日","⽈","曰","⽉","月","⽊","木","⽋","欠","⽌","止","⽍","歹","⽎","殳","⽏","毋","⽐","比","⽑","毛","⽒","氏","⽓","气","⽔","水","⽕","火","⽖","爪","⽗","父","⽘","爻","⽙","爿","⽚","片","⽛","牙","⽜","牛","⽝","犬","⽞","玄","⽟","玉","⽠","瓜","⽡","瓦","⽢","甘","⽣","生","⽤","用","⽥","田","⽦","疋","⽧","疒","⽨","癶","⽩","白","⽪","皮","⽫","皿","⽬","目","⽭","矛","⽮","矢","⽯","石","⽰","示","⽱","禸","⽲","禾","⽳","穴","⽴","立","⽵","竹","⽶","米","⽷","糸","⽸","缶","⽹","网","⽺","羊","⽻","羽","⽼","老","⽽","而","⽾","耒","⽿","耳","⾀","聿","⾁","肉","⾂","臣","⾃","自","⾄","至","⾅","臼","⾆","舌","⾇","舛","⾈","舟","⾉","艮","⾊","色","⾋","艸","⾌","虍","⾍","虫","⾎","血","⾏","行","⾐","衣","⾑","襾","⾒","見","⾓","角","⾔","言","⾕","谷","⾖","豆","⾗","豕","⾘","豸","⾙","貝","⾚","赤","⾛","走","⾜","足","⾝","身","⾞","車","⾟","辛","⾠","辰","⾡","辵","⾢","邑","⾣","酉","⾤","釆","⾥","里","⾦","金","⾧","長","⾨","門","⾩","阜","⾪","隶","⾫","隹","⾬","雨","⾭","靑","⾮","非","⾯","面","⾰","革","⾱","韋","⾲","韭","⾳","音","⾴","頁","⾵","風","⾶","飛","⾷","食","⾸","首","⾹","香","⾺","馬","⾻","骨","⾼","高","⾽","髟","⾾","鬥","⾿","鬯","⿀","鬲","⿁","鬼","⿂","魚","⿃","鳥","⿄","鹵","⿅","鹿","⿆","麥","⿇","麻","⿈","黃","⿉","黍","⿊","黑","⿋","黹","⿌","黽","⿍","鼎","⿎","鼓","⿏","鼠","⿐","鼻","⿑","齊","⿒","齒","⿓","龍","⿔","龜","⿕","龠","〶","〒","〸","十","〹","卄","〺","卅","゛"," ゙","゜"," ゚","ㄱ","ᄀ","ㄲ","ᄁ","ㄳ","ᆪ","ㄴ","ᄂ","ㄵ","ᆬ","ㄶ","ᆭ","ㄷ","ᄃ","ㄸ","ᄄ","ㄹ","ᄅ","ㄺ","ᆰ","ㄻ","ᆱ","ㄼ","ᆲ","ㄽ","ᆳ","ㄾ","ᆴ","ㄿ","ᆵ","ㅀ","ᄚ","ㅁ","ᄆ","ㅂ","ᄇ","ㅃ","ᄈ","ㅄ","ᄡ","ㅅ","ᄉ","ㅆ","ᄊ","ㅇ","ᄋ","ㅈ","ᄌ","ㅉ","ᄍ","ㅊ","ᄎ","ㅋ","ᄏ","ㅌ","ᄐ","ㅍ","ᄑ","ㅎ","ᄒ","ㅏ","ᅡ","ㅐ","ᅢ","ㅑ","ᅣ","ㅒ","ᅤ","ㅓ","ᅥ","ㅔ","ᅦ","ㅕ","ᅧ","ㅖ","ᅨ","ㅗ","ᅩ","ㅘ","ᅪ","ㅙ","ᅫ","ㅚ","ᅬ","ㅛ","ᅭ","ㅜ","ᅮ","ㅝ","ᅯ","ㅞ","ᅰ","ㅟ","ᅱ","ㅠ","ᅲ","ㅡ","ᅳ","ㅢ","ᅴ","ㅣ","ᅵ","ㅤ","ᅠ","ㅥ","ᄔ","ㅦ","ᄕ","ㅧ","ᇇ","ㅨ","ᇈ","ㅩ","ᇌ","ㅪ","ᇎ","ㅫ","ᇓ","ㅬ","ᇗ","ㅭ","ᇙ","ㅮ","ᄜ","ㅯ","ᇝ","ㅰ","ᇟ","ㅱ","ᄝ","ㅲ","ᄞ","ㅳ","ᄠ","ㅴ","ᄢ","ㅵ","ᄣ","ㅶ","ᄧ","ㅷ","ᄩ","ㅸ","ᄫ","ㅹ","ᄬ","ㅺ","ᄭ","ㅻ","ᄮ","ㅼ","ᄯ","ㅽ","ᄲ","ㅾ","ᄶ","ㅿ","ᅀ","ㆀ","ᅇ","ㆁ","ᅌ","ㆂ","ᇱ","ㆃ","ᇲ","ㆄ","ᅗ","ㆅ","ᅘ","ㆆ","ᅙ","ㆇ","ᆄ","ㆈ","ᆅ","ㆉ","ᆈ","ㆊ","ᆑ","ㆋ","ᆒ","ㆌ","ᆔ","ㆍ","ᆞ","ㆎ","ᆡ","㈀","(ᄀ)","㈁","(ᄂ)","㈂","(ᄃ)","㈃","(ᄅ)","㈄","(ᄆ)","㈅","(ᄇ)","㈆","(ᄉ)","㈇","(ᄋ)","㈈","(ᄌ)","㈉","(ᄎ)","㈊","(ᄏ)","㈋","(ᄐ)","㈌","(ᄑ)","㈍","(ᄒ)","㈎","(가)","㈏","(나)","㈐","(다)","㈑","(라)","㈒","(마)","㈓","(바)","㈔","(사)","㈕","(아)","㈖","(자)","㈗","(차)","㈘","(카)","㈙","(타)","㈚","(파)","㈛","(하)","㈜","(주)","㈝","(오전)","㈞","(오후)","㈠","(一)","㈡","(二)","㈢","(三)","㈣","(四)","㈤","(五)","㈥","(六)","㈦","(七)","㈧","(八)","㈨","(九)","㈩","(十)","㈪","(月)","㈫","(火)","㈬","(水)","㈭","(木)","㈮","(金)","㈯","(土)","㈰","(日)","㈱","(株)","㈲","(有)","㈳","(社)","㈴","(名)","㈵","(特)","㈶","(財)","㈷","(祝)","㈸","(労)","㈹","(代)","㈺","(呼)","㈻","(学)","㈼","(監)","㈽","(企)","㈾","(資)","㈿","(協)","㉀","(祭)","㉁","(休)","㉂","(自)","㉃","(至)","㋀","1月","㋁","2月","㋂","3月","㋃","4月","㋄","5月","㋅","6月","㋆","7月","㋇","8月","㋈","9月","㋉","10月","㋊","11月","㋋","12月","㍘","0点","㍙","1点","㍚","2点","㍛","3点","㍜","4点","㍝","5点","㍞","6点","㍟","7点","㍠","8点","㍡","9点","㍢","10点","㍣","11点","㍤","12点","㍥","13点","㍦","14点","㍧","15点","㍨","16点","㍩","17点","㍪","18点","㍫","19点","㍬","20点","㍭","21点","㍮","22点","㍯","23点","㍰","24点","㏠","1日","㏡","2日","㏢","3日","㏣","4日","㏤","5日","㏥","6日","㏦","7日","㏧","8日","㏨","9日","㏩","10日","㏪","11日","㏫","12日","㏬","13日","㏭","14日","㏮","15日","㏯","16日","㏰","17日","㏱","18日","㏲","19日","㏳","20日","㏴","21日","㏵","22日","㏶","23日","㏷","24日","㏸","25日","㏹","26日","㏺","27日","㏻","28日","㏼","29日","㏽","30日","㏾","31日","ff","ff","fi","fi","fl","fl","ffi","ffi","ffl","ffl","ſt","ſt","st","st","ﬓ","մն","ﬔ","մե","ﬕ","մի","ﬖ","վն","ﬗ","մխ","ﭏ","אל","ﭐ","ٱ","ﭑ","ٱ","ﭒ","ٻ","ﭓ","ٻ","ﭔ","ٻ","ﭕ","ٻ","ﭖ","پ","ﭗ","پ","ﭘ","پ","ﭙ","پ","ﭚ","ڀ","ﭛ","ڀ","ﭜ","ڀ","ﭝ","ڀ","ﭞ","ٺ","ﭟ","ٺ","ﭠ","ٺ","ﭡ","ٺ","ﭢ","ٿ","ﭣ","ٿ","ﭤ","ٿ","ﭥ","ٿ","ﭦ","ٹ","ﭧ","ٹ","ﭨ","ٹ","ﭩ","ٹ","ﭪ","ڤ","ﭫ","ڤ","ﭬ","ڤ","ﭭ","ڤ","ﭮ","ڦ","ﭯ","ڦ","ﭰ","ڦ","ﭱ","ڦ","ﭲ","ڄ","ﭳ","ڄ","ﭴ","ڄ","ﭵ","ڄ","ﭶ","ڃ","ﭷ","ڃ","ﭸ","ڃ","ﭹ","ڃ","ﭺ","چ","ﭻ","چ","ﭼ","چ","ﭽ","چ","ﭾ","ڇ","ﭿ","ڇ","ﮀ","ڇ","ﮁ","ڇ","ﮂ","ڍ","ﮃ","ڍ","ﮄ","ڌ","ﮅ","ڌ","ﮆ","ڎ","ﮇ","ڎ","ﮈ","ڈ","ﮉ","ڈ","ﮊ","ژ","ﮋ","ژ","ﮌ","ڑ","ﮍ","ڑ","ﮎ","ک","ﮏ","ک","ﮐ","ک","ﮑ","ک","ﮒ","گ","ﮓ","گ","ﮔ","گ","ﮕ","گ","ﮖ","ڳ","ﮗ","ڳ","ﮘ","ڳ","ﮙ","ڳ","ﮚ","ڱ","ﮛ","ڱ","ﮜ","ڱ","ﮝ","ڱ","ﮞ","ں","ﮟ","ں","ﮠ","ڻ","ﮡ","ڻ","ﮢ","ڻ","ﮣ","ڻ","ﮤ","ۀ","ﮥ","ۀ","ﮦ","ہ","ﮧ","ہ","ﮨ","ہ","ﮩ","ہ","ﮪ","ھ","ﮫ","ھ","ﮬ","ھ","ﮭ","ھ","ﮮ","ے","ﮯ","ے","ﮰ","ۓ","ﮱ","ۓ","ﯓ","ڭ","ﯔ","ڭ","ﯕ","ڭ","ﯖ","ڭ","ﯗ","ۇ","ﯘ","ۇ","ﯙ","ۆ","ﯚ","ۆ","ﯛ","ۈ","ﯜ","ۈ","ﯝ","ٷ","ﯞ","ۋ","ﯟ","ۋ","ﯠ","ۅ","ﯡ","ۅ","ﯢ","ۉ","ﯣ","ۉ","ﯤ","ې","ﯥ","ې","ﯦ","ې","ﯧ","ې","ﯨ","ى","ﯩ","ى","ﯪ","ئا","ﯫ","ئا","ﯬ","ئە","ﯭ","ئە","ﯮ","ئو","ﯯ","ئو","ﯰ","ئۇ","ﯱ","ئۇ","ﯲ","ئۆ","ﯳ","ئۆ","ﯴ","ئۈ","ﯵ","ئۈ","ﯶ","ئې","ﯷ","ئې","ﯸ","ئې","ﯹ","ئى","ﯺ","ئى","ﯻ","ئى","ﯼ","ی","ﯽ","ی","ﯾ","ی","ﯿ","ی","ﰀ","ئج","ﰁ","ئح","ﰂ","ئم","ﰃ","ئى","ﰄ","ئي","ﰅ","بج","ﰆ","بح","ﰇ","بخ","ﰈ","بم","ﰉ","بى","ﰊ","بي","ﰋ","تج","ﰌ","تح","ﰍ","تخ","ﰎ","تم","ﰏ","تى","ﰐ","تي","ﰑ","ثج","ﰒ","ثم","ﰓ","ثى","ﰔ","ثي","ﰕ","جح","ﰖ","جم","ﰗ","حج","ﰘ","حم","ﰙ","خج","ﰚ","خح","ﰛ","خم","ﰜ","سج","ﰝ","سح","ﰞ","سخ","ﰟ","سم","ﰠ","صح","ﰡ","صم","ﰢ","ضج","ﰣ","ضح","ﰤ","ضخ","ﰥ","ضم","ﰦ","طح","ﰧ","طم","ﰨ","ظم","ﰩ","عج","ﰪ","عم","ﰫ","غج","ﰬ","غم","ﰭ","فج","ﰮ","فح","ﰯ","فخ","ﰰ","فم","ﰱ","فى","ﰲ","في","ﰳ","قح","ﰴ","قم","ﰵ","قى","ﰶ","قي","ﰷ","كا","ﰸ","كج","ﰹ","كح","ﰺ","كخ","ﰻ","كل","ﰼ","كم","ﰽ","كى","ﰾ","كي","ﰿ","لج","ﱀ","لح","ﱁ","لخ","ﱂ","لم","ﱃ","لى","ﱄ","لي","ﱅ","مج","ﱆ","مح","ﱇ","مخ","ﱈ","مم","ﱉ","مى","ﱊ","مي","ﱋ","نج","ﱌ","نح","ﱍ","نخ","ﱎ","نم","ﱏ","نى","ﱐ","ني","ﱑ","هج","ﱒ","هم","ﱓ","هى","ﱔ","هي","ﱕ","يج","ﱖ","يح","ﱗ","يخ","ﱘ","يم","ﱙ","يى","ﱚ","يي","ﱛ","ذٰ","ﱜ","رٰ","ﱝ","ىٰ","ﱞ"," ٌّ","ﱟ"," ٍّ","ﱠ"," َّ","ﱡ"," ُّ","ﱢ"," ِّ","ﱣ"," ّٰ","ﱤ","ئر","ﱥ","ئز","ﱦ","ئم","ﱧ","ئن","ﱨ","ئى","ﱩ","ئي","ﱪ","بر","ﱫ","بز","ﱬ","بم","ﱭ","بن","ﱮ","بى","ﱯ","بي","ﱰ","تر","ﱱ","تز","ﱲ","تم","ﱳ","تن","ﱴ","تى","ﱵ","تي","ﱶ","ثر","ﱷ","ثز","ﱸ","ثم","ﱹ","ثن","ﱺ","ثى","ﱻ","ثي","ﱼ","فى","ﱽ","في","ﱾ","قى","ﱿ","قي","ﲀ","كا","ﲁ","كل","ﲂ","كم","ﲃ","كى","ﲄ","كي","ﲅ","لم","ﲆ","لى","ﲇ","لي","ﲈ","ما","ﲉ","مم","ﲊ","نر","ﲋ","نز","ﲌ","نم","ﲍ","نن","ﲎ","نى","ﲏ","ني","ﲐ","ىٰ","ﲑ","ير","ﲒ","يز","ﲓ","يم","ﲔ","ين","ﲕ","يى","ﲖ","يي","ﲗ","ئج","ﲘ","ئح","ﲙ","ئخ","ﲚ","ئم","ﲛ","ئه","ﲜ","بج","ﲝ","بح","ﲞ","بخ","ﲟ","بم","ﲠ","به","ﲡ","تج","ﲢ","تح","ﲣ","تخ","ﲤ","تم","ﲥ","ته","ﲦ","ثم","ﲧ","جح","ﲨ","جم","ﲩ","حج","ﲪ","حم","ﲫ","خج","ﲬ","خم","ﲭ","سج","ﲮ","سح","ﲯ","سخ","ﲰ","سم","ﲱ","صح","ﲲ","صخ","ﲳ","صم","ﲴ","ضج","ﲵ","ضح","ﲶ","ضخ","ﲷ","ضم","ﲸ","طح","ﲹ","ظم","ﲺ","عج","ﲻ","عم","ﲼ","غج","ﲽ","غم","ﲾ","فج","ﲿ","فح","ﳀ","فخ","ﳁ","فم","ﳂ","قح","ﳃ","قم","ﳄ","كج","ﳅ","كح","ﳆ","كخ","ﳇ","كل","ﳈ","كم","ﳉ","لج","ﳊ","لح","ﳋ","لخ","ﳌ","لم","ﳍ","له","ﳎ","مج","ﳏ","مح","ﳐ","مخ","ﳑ","مم","ﳒ","نج","ﳓ","نح","ﳔ","نخ","ﳕ","نم","ﳖ","نه","ﳗ","هج","ﳘ","هم","ﳙ","هٰ","ﳚ","يج","ﳛ","يح","ﳜ","يخ","ﳝ","يم","ﳞ","يه","ﳟ","ئم","ﳠ","ئه","ﳡ","بم","ﳢ","به","ﳣ","تم","ﳤ","ته","ﳥ","ثم","ﳦ","ثه","ﳧ","سم","ﳨ","سه","ﳩ","شم","ﳪ","شه","ﳫ","كل","ﳬ","كم","ﳭ","لم","ﳮ","نم","ﳯ","نه","ﳰ","يم","ﳱ","يه","ﳲ","ـَّ","ﳳ","ـُّ","ﳴ","ـِّ","ﳵ","طى","ﳶ","طي","ﳷ","عى","ﳸ","عي","ﳹ","غى","ﳺ","غي","ﳻ","سى","ﳼ","سي","ﳽ","شى","ﳾ","شي","ﳿ","حى","ﴀ","حي","ﴁ","جى","ﴂ","جي","ﴃ","خى","ﴄ","خي","ﴅ","صى","ﴆ","صي","ﴇ","ضى","ﴈ","ضي","ﴉ","شج","ﴊ","شح","ﴋ","شخ","ﴌ","شم","ﴍ","شر","ﴎ","سر","ﴏ","صر","ﴐ","ضر","ﴑ","طى","ﴒ","طي","ﴓ","عى","ﴔ","عي","ﴕ","غى","ﴖ","غي","ﴗ","سى","ﴘ","سي","ﴙ","شى","ﴚ","شي","ﴛ","حى","ﴜ","حي","ﴝ","جى","ﴞ","جي","ﴟ","خى","ﴠ","خي","ﴡ","صى","ﴢ","صي","ﴣ","ضى","ﴤ","ضي","ﴥ","شج","ﴦ","شح","ﴧ","شخ","ﴨ","شم","ﴩ","شر","ﴪ","سر","ﴫ","صر","ﴬ","ضر","ﴭ","شج","ﴮ","شح","ﴯ","شخ","ﴰ","شم","ﴱ","سه","ﴲ","شه","ﴳ","طم","ﴴ","سج","ﴵ","سح","ﴶ","سخ","ﴷ","شج","ﴸ","شح","ﴹ","شخ","ﴺ","طم","ﴻ","ظم","ﴼ","اً","ﴽ","اً","ﵐ","تجم","ﵑ","تحج","ﵒ","تحج","ﵓ","تحم","ﵔ","تخم","ﵕ","تمج","ﵖ","تمح","ﵗ","تمخ","ﵘ","جمح","ﵙ","جمح","ﵚ","حمي","ﵛ","حمى","ﵜ","سحج","ﵝ","سجح","ﵞ","سجى","ﵟ","سمح","ﵠ","سمح","ﵡ","سمج","ﵢ","سمم","ﵣ","سمم","ﵤ","صحح","ﵥ","صحح","ﵦ","صمم","ﵧ","شحم","ﵨ","شحم","ﵩ","شجي","ﵪ","شمخ","ﵫ","شمخ","ﵬ","شمم","ﵭ","شمم","ﵮ","ضحى","ﵯ","ضخم","ﵰ","ضخم","ﵱ","طمح","ﵲ","طمح","ﵳ","طمم","ﵴ","طمي","ﵵ","عجم","ﵶ","عمم","ﵷ","عمم","ﵸ","عمى","ﵹ","غمم","ﵺ","غمي","ﵻ","غمى","ﵼ","فخم","ﵽ","فخم","ﵾ","قمح","ﵿ","قمم","ﶀ","لحم","ﶁ","لحي","ﶂ","لحى","ﶃ","لجج","ﶄ","لجج","ﶅ","لخم","ﶆ","لخم","ﶇ","لمح","ﶈ","لمح","ﶉ","محج","ﶊ","محم","ﶋ","محي","ﶌ","مجح","ﶍ","مجم","ﶎ","مخج","ﶏ","مخم","ﶒ","مجخ","ﶓ","همج","ﶔ","همم","ﶕ","نحم","ﶖ","نحى","ﶗ","نجم","ﶘ","نجم","ﶙ","نجى","ﶚ","نمي","ﶛ","نمى","ﶜ","يمم","ﶝ","يمم","ﶞ","بخي","ﶟ","تجي","ﶠ","تجى","ﶡ","تخي","ﶢ","تخى","ﶣ","تمي","ﶤ","تمى","ﶥ","جمي","ﶦ","جحى","ﶧ","جمى","ﶨ","سخى","ﶩ","صحي","ﶪ","شحي","ﶫ","ضحي","ﶬ","لجي","ﶭ","لمي","ﶮ","يحي","ﶯ","يجي","ﶰ","يمي","ﶱ","ممي","ﶲ","قمي","ﶳ","نحي","ﶴ","قمح","ﶵ","لحم","ﶶ","عمي","ﶷ","كمي","ﶸ","نجح","ﶹ","مخي","ﶺ","لجم","ﶻ","كمم","ﶼ","لجم","ﶽ","نجح","ﶾ","جحي","ﶿ","حجي","ﷀ","مجي","ﷁ","فمي","ﷂ","بحي","ﷃ","كمم","ﷄ","عجم","ﷅ","صمم","ﷆ","سخي","ﷇ","نجي","﹉","‾","﹊","‾","﹋","‾","﹌","‾","﹍","_","﹎","_","﹏","_","ﺀ","ء","ﺁ","آ","ﺂ","آ","ﺃ","أ","ﺄ","أ","ﺅ","ؤ","ﺆ","ؤ","ﺇ","إ","ﺈ","إ","ﺉ","ئ","ﺊ","ئ","ﺋ","ئ","ﺌ","ئ","ﺍ","ا","ﺎ","ا","ﺏ","ب","ﺐ","ب","ﺑ","ب","ﺒ","ب","ﺓ","ة","ﺔ","ة","ﺕ","ت","ﺖ","ت","ﺗ","ت","ﺘ","ت","ﺙ","ث","ﺚ","ث","ﺛ","ث","ﺜ","ث","ﺝ","ج","ﺞ","ج","ﺟ","ج","ﺠ","ج","ﺡ","ح","ﺢ","ح","ﺣ","ح","ﺤ","ح","ﺥ","خ","ﺦ","خ","ﺧ","خ","ﺨ","خ","ﺩ","د","ﺪ","د","ﺫ","ذ","ﺬ","ذ","ﺭ","ر","ﺮ","ر","ﺯ","ز","ﺰ","ز","ﺱ","س","ﺲ","س","ﺳ","س","ﺴ","س","ﺵ","ش","ﺶ","ش","ﺷ","ش","ﺸ","ش","ﺹ","ص","ﺺ","ص","ﺻ","ص","ﺼ","ص","ﺽ","ض","ﺾ","ض","ﺿ","ض","ﻀ","ض","ﻁ","ط","ﻂ","ط","ﻃ","ط","ﻄ","ط","ﻅ","ظ","ﻆ","ظ","ﻇ","ظ","ﻈ","ظ","ﻉ","ع","ﻊ","ع","ﻋ","ع","ﻌ","ع","ﻍ","غ","ﻎ","غ","ﻏ","غ","ﻐ","غ","ﻑ","ف","ﻒ","ف","ﻓ","ف","ﻔ","ف","ﻕ","ق","ﻖ","ق","ﻗ","ق","ﻘ","ق","ﻙ","ك","ﻚ","ك","ﻛ","ك","ﻜ","ك","ﻝ","ل","ﻞ","ل","ﻟ","ل","ﻠ","ل","ﻡ","م","ﻢ","م","ﻣ","م","ﻤ","م","ﻥ","ن","ﻦ","ن","ﻧ","ن","ﻨ","ن","ﻩ","ه","ﻪ","ه","ﻫ","ه","ﻬ","ه","ﻭ","و","ﻮ","و","ﻯ","ى","ﻰ","ى","ﻱ","ي","ﻲ","ي","ﻳ","ي","ﻴ","ي","ﻵ","لآ","ﻶ","لآ","ﻷ","لأ","ﻸ","لأ","ﻹ","لإ","ﻺ","لإ","ﻻ","لا","ﻼ","لا"]}));function reverseIfRtl(e){const t=e.length;if(t<=1||!function isRTLRangeFor(e){let t=i[13];if(e>=t.begin&&e<t.end)return!0;t=i[11];return e>=t.begin&&e<t.end}(e.charCodeAt(0)))return e;const a=[];for(let r=t-1;r>=0;r--)a.push(e[r]);return a.join("")}const o=new RegExp("^(\\s)|(\\p{Mn})|(\\p{Cf})$","u"),c=new Map;function getCharUnicodeCategory(e){const t=c.get(e);if(t)return t;const a=e.match(o),r={isWhitespace:!(!a||!a[1]),isZeroWidthDiacritic:!(!a||!a[2]),isInvisibleFormatMark:!(!a||!a[3])};c.set(e,r);return r}function clearUnicodeCaches(){c.clear()}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.getSerifFonts=t.getNonStdFontMap=t.getGlyphMapForStandardFonts=t.getFontNameToFileMap=void 0;t.getStandardFontName=function getStandardFontName(e){const t=(0,n.normalizeFontName)(e);return i()[t]};t.getSymbolsFonts=t.getSupplementalGlyphMapForCalibri=t.getSupplementalGlyphMapForArialBlack=t.getStdFontMap=void 0;var r=a(3),n=a(36);const i=(0,r.getLookupTableFactory)((function(e){e["Times-Roman"]="Times-Roman";e.Helvetica="Helvetica";e.Courier="Courier";e.Symbol="Symbol";e["Times-Bold"]="Times-Bold";e["Helvetica-Bold"]="Helvetica-Bold";e["Courier-Bold"]="Courier-Bold";e.ZapfDingbats="ZapfDingbats";e["Times-Italic"]="Times-Italic";e["Helvetica-Oblique"]="Helvetica-Oblique";e["Courier-Oblique"]="Courier-Oblique";e["Times-BoldItalic"]="Times-BoldItalic";e["Helvetica-BoldOblique"]="Helvetica-BoldOblique";e["Courier-BoldOblique"]="Courier-BoldOblique";e.ArialNarrow="Helvetica";e["ArialNarrow-Bold"]="Helvetica-Bold";e["ArialNarrow-BoldItalic"]="Helvetica-BoldOblique";e["ArialNarrow-Italic"]="Helvetica-Oblique";e.ArialBlack="Helvetica";e["ArialBlack-Bold"]="Helvetica-Bold";e["ArialBlack-BoldItalic"]="Helvetica-BoldOblique";e["ArialBlack-Italic"]="Helvetica-Oblique";e["Arial-Black"]="Helvetica";e["Arial-Black-Bold"]="Helvetica-Bold";e["Arial-Black-BoldItalic"]="Helvetica-BoldOblique";e["Arial-Black-Italic"]="Helvetica-Oblique";e.Arial="Helvetica";e["Arial-Bold"]="Helvetica-Bold";e["Arial-BoldItalic"]="Helvetica-BoldOblique";e["Arial-Italic"]="Helvetica-Oblique";e.ArialMT="Helvetica";e["Arial-BoldItalicMT"]="Helvetica-BoldOblique";e["Arial-BoldMT"]="Helvetica-Bold";e["Arial-ItalicMT"]="Helvetica-Oblique";e.ArialUnicodeMS="Helvetica";e["ArialUnicodeMS-Bold"]="Helvetica-Bold";e["ArialUnicodeMS-BoldItalic"]="Helvetica-BoldOblique";e["ArialUnicodeMS-Italic"]="Helvetica-Oblique";e["Courier-BoldItalic"]="Courier-BoldOblique";e["Courier-Italic"]="Courier-Oblique";e.CourierNew="Courier";e["CourierNew-Bold"]="Courier-Bold";e["CourierNew-BoldItalic"]="Courier-BoldOblique";e["CourierNew-Italic"]="Courier-Oblique";e["CourierNewPS-BoldItalicMT"]="Courier-BoldOblique";e["CourierNewPS-BoldMT"]="Courier-Bold";e["CourierNewPS-ItalicMT"]="Courier-Oblique";e.CourierNewPSMT="Courier";e["Helvetica-BoldItalic"]="Helvetica-BoldOblique";e["Helvetica-Italic"]="Helvetica-Oblique";e["Symbol-Bold"]="Symbol";e["Symbol-BoldItalic"]="Symbol";e["Symbol-Italic"]="Symbol";e.TimesNewRoman="Times-Roman";e["TimesNewRoman-Bold"]="Times-Bold";e["TimesNewRoman-BoldItalic"]="Times-BoldItalic";e["TimesNewRoman-Italic"]="Times-Italic";e.TimesNewRomanPS="Times-Roman";e["TimesNewRomanPS-Bold"]="Times-Bold";e["TimesNewRomanPS-BoldItalic"]="Times-BoldItalic";e["TimesNewRomanPS-BoldItalicMT"]="Times-BoldItalic";e["TimesNewRomanPS-BoldMT"]="Times-Bold";e["TimesNewRomanPS-Italic"]="Times-Italic";e["TimesNewRomanPS-ItalicMT"]="Times-Italic";e.TimesNewRomanPSMT="Times-Roman";e["TimesNewRomanPSMT-Bold"]="Times-Bold";e["TimesNewRomanPSMT-BoldItalic"]="Times-BoldItalic";e["TimesNewRomanPSMT-Italic"]="Times-Italic"}));t.getStdFontMap=i;const s=(0,r.getLookupTableFactory)((function(e){e.Courier="FoxitFixed.pfb";e["Courier-Bold"]="FoxitFixedBold.pfb";e["Courier-BoldOblique"]="FoxitFixedBoldItalic.pfb";e["Courier-Oblique"]="FoxitFixedItalic.pfb";e.Helvetica="FoxitSans.pfb";e["Helvetica-Bold"]="FoxitSansBold.pfb";e["Helvetica-BoldOblique"]="FoxitSansBoldItalic.pfb";e["Helvetica-Oblique"]="FoxitSansItalic.pfb";e["Times-Roman"]="FoxitSerif.pfb";e["Times-Bold"]="FoxitSerifBold.pfb";e["Times-BoldItalic"]="FoxitSerifBoldItalic.pfb";e["Times-Italic"]="FoxitSerifItalic.pfb";e.Symbol="FoxitSymbol.pfb";e.ZapfDingbats="FoxitDingbats.pfb";e["LiberationSans-Regular"]="LiberationSans-Regular.ttf";e["LiberationSans-Bold"]="LiberationSans-Bold.ttf";e["LiberationSans-Italic"]="LiberationSans-Italic.ttf";e["LiberationSans-BoldItalic"]="LiberationSans-BoldItalic.ttf"}));t.getFontNameToFileMap=s;const o=(0,r.getLookupTableFactory)((function(e){e.Calibri="Helvetica";e["Calibri-Bold"]="Helvetica-Bold";e["Calibri-BoldItalic"]="Helvetica-BoldOblique";e["Calibri-Italic"]="Helvetica-Oblique";e.CenturyGothic="Helvetica";e["CenturyGothic-Bold"]="Helvetica-Bold";e["CenturyGothic-BoldItalic"]="Helvetica-BoldOblique";e["CenturyGothic-Italic"]="Helvetica-Oblique";e.ComicSansMS="Comic Sans MS";e["ComicSansMS-Bold"]="Comic Sans MS-Bold";e["ComicSansMS-BoldItalic"]="Comic Sans MS-BoldItalic";e["ComicSansMS-Italic"]="Comic Sans MS-Italic";e["ItcSymbol-Bold"]="Helvetica-Bold";e["ItcSymbol-BoldItalic"]="Helvetica-BoldOblique";e["ItcSymbol-Book"]="Helvetica";e["ItcSymbol-BookItalic"]="Helvetica-Oblique";e["ItcSymbol-Medium"]="Helvetica";e["ItcSymbol-MediumItalic"]="Helvetica-Oblique";e.LucidaConsole="Courier";e["LucidaConsole-Bold"]="Courier-Bold";e["LucidaConsole-BoldItalic"]="Courier-BoldOblique";e["LucidaConsole-Italic"]="Courier-Oblique";e["LucidaSans-Demi"]="Helvetica-Bold";e["MS-Gothic"]="MS Gothic";e["MS-Gothic-Bold"]="MS Gothic-Bold";e["MS-Gothic-BoldItalic"]="MS Gothic-BoldItalic";e["MS-Gothic-Italic"]="MS Gothic-Italic";e["MS-Mincho"]="MS Mincho";e["MS-Mincho-Bold"]="MS Mincho-Bold";e["MS-Mincho-BoldItalic"]="MS Mincho-BoldItalic";e["MS-Mincho-Italic"]="MS Mincho-Italic";e["MS-PGothic"]="MS PGothic";e["MS-PGothic-Bold"]="MS PGothic-Bold";e["MS-PGothic-BoldItalic"]="MS PGothic-BoldItalic";e["MS-PGothic-Italic"]="MS PGothic-Italic";e["MS-PMincho"]="MS PMincho";e["MS-PMincho-Bold"]="MS PMincho-Bold";e["MS-PMincho-BoldItalic"]="MS PMincho-BoldItalic";e["MS-PMincho-Italic"]="MS PMincho-Italic";e.NuptialScript="Times-Italic";e.SegoeUISymbol="Helvetica";e.Wingdings="ZapfDingbats";e["Wingdings-Regular"]="ZapfDingbats"}));t.getNonStdFontMap=o;const c=(0,r.getLookupTableFactory)((function(e){e["Adobe Jenson"]=!0;e["Adobe Text"]=!0;e.Albertus=!0;e.Aldus=!0;e.Alexandria=!0;e.Algerian=!0;e["American Typewriter"]=!0;e.Antiqua=!0;e.Apex=!0;e.Arno=!0;e.Aster=!0;e.Aurora=!0;e.Baskerville=!0;e.Bell=!0;e.Bembo=!0;e["Bembo Schoolbook"]=!0;e.Benguiat=!0;e["Berkeley Old Style"]=!0;e["Bernhard Modern"]=!0;e["Berthold City"]=!0;e.Bodoni=!0;e["Bauer Bodoni"]=!0;e["Book Antiqua"]=!0;e.Bookman=!0;e["Bordeaux Roman"]=!0;e["Californian FB"]=!0;e.Calisto=!0;e.Calvert=!0;e.Capitals=!0;e.Cambria=!0;e.Cartier=!0;e.Caslon=!0;e.Catull=!0;e.Centaur=!0;e["Century Old Style"]=!0;e["Century Schoolbook"]=!0;e.Chaparral=!0;e["Charis SIL"]=!0;e.Cheltenham=!0;e["Cholla Slab"]=!0;e.Clarendon=!0;e.Clearface=!0;e.Cochin=!0;e.Colonna=!0;e["Computer Modern"]=!0;e["Concrete Roman"]=!0;e.Constantia=!0;e["Cooper Black"]=!0;e.Corona=!0;e.Ecotype=!0;e.Egyptienne=!0;e.Elephant=!0;e.Excelsior=!0;e.Fairfield=!0;e["FF Scala"]=!0;e.Folkard=!0;e.Footlight=!0;e.FreeSerif=!0;e["Friz Quadrata"]=!0;e.Garamond=!0;e.Gentium=!0;e.Georgia=!0;e.Gloucester=!0;e["Goudy Old Style"]=!0;e["Goudy Schoolbook"]=!0;e["Goudy Pro Font"]=!0;e.Granjon=!0;e["Guardian Egyptian"]=!0;e.Heather=!0;e.Hercules=!0;e["High Tower Text"]=!0;e.Hiroshige=!0;e["Hoefler Text"]=!0;e["Humana Serif"]=!0;e.Imprint=!0;e["Ionic No. 5"]=!0;e.Janson=!0;e.Joanna=!0;e.Korinna=!0;e.Lexicon=!0;e.LiberationSerif=!0;e["Liberation Serif"]=!0;e["Linux Libertine"]=!0;e.Literaturnaya=!0;e.Lucida=!0;e["Lucida Bright"]=!0;e.Melior=!0;e.Memphis=!0;e.Miller=!0;e.Minion=!0;e.Modern=!0;e["Mona Lisa"]=!0;e["Mrs Eaves"]=!0;e["MS Serif"]=!0;e["Museo Slab"]=!0;e["New York"]=!0;e["Nimbus Roman"]=!0;e["NPS Rawlinson Roadway"]=!0;e.NuptialScript=!0;e.Palatino=!0;e.Perpetua=!0;e.Plantin=!0;e["Plantin Schoolbook"]=!0;e.Playbill=!0;e["Poor Richard"]=!0;e["Rawlinson Roadway"]=!0;e.Renault=!0;e.Requiem=!0;e.Rockwell=!0;e.Roman=!0;e["Rotis Serif"]=!0;e.Sabon=!0;e.Scala=!0;e.Seagull=!0;e.Sistina=!0;e.Souvenir=!0;e.STIX=!0;e["Stone Informal"]=!0;e["Stone Serif"]=!0;e.Sylfaen=!0;e.Times=!0;e.Trajan=!0;e["Trinité"]=!0;e["Trump Mediaeval"]=!0;e.Utopia=!0;e["Vale Type"]=!0;e["Bitstream Vera"]=!0;e["Vera Serif"]=!0;e.Versailles=!0;e.Wanted=!0;e.Weiss=!0;e["Wide Latin"]=!0;e.Windsor=!0;e.XITS=!0}));t.getSerifFonts=c;const l=(0,r.getLookupTableFactory)((function(e){e.Dingbats=!0;e.Symbol=!0;e.ZapfDingbats=!0}));t.getSymbolsFonts=l;const h=(0,r.getLookupTableFactory)((function(e){e[2]=10;e[3]=32;e[4]=33;e[5]=34;e[6]=35;e[7]=36;e[8]=37;e[9]=38;e[10]=39;e[11]=40;e[12]=41;e[13]=42;e[14]=43;e[15]=44;e[16]=45;e[17]=46;e[18]=47;e[19]=48;e[20]=49;e[21]=50;e[22]=51;e[23]=52;e[24]=53;e[25]=54;e[26]=55;e[27]=56;e[28]=57;e[29]=58;e[30]=894;e[31]=60;e[32]=61;e[33]=62;e[34]=63;e[35]=64;e[36]=65;e[37]=66;e[38]=67;e[39]=68;e[40]=69;e[41]=70;e[42]=71;e[43]=72;e[44]=73;e[45]=74;e[46]=75;e[47]=76;e[48]=77;e[49]=78;e[50]=79;e[51]=80;e[52]=81;e[53]=82;e[54]=83;e[55]=84;e[56]=85;e[57]=86;e[58]=87;e[59]=88;e[60]=89;e[61]=90;e[62]=91;e[63]=92;e[64]=93;e[65]=94;e[66]=95;e[67]=96;e[68]=97;e[69]=98;e[70]=99;e[71]=100;e[72]=101;e[73]=102;e[74]=103;e[75]=104;e[76]=105;e[77]=106;e[78]=107;e[79]=108;e[80]=109;e[81]=110;e[82]=111;e[83]=112;e[84]=113;e[85]=114;e[86]=115;e[87]=116;e[88]=117;e[89]=118;e[90]=119;e[91]=120;e[92]=121;e[93]=122;e[94]=123;e[95]=124;e[96]=125;e[97]=126;e[98]=196;e[99]=197;e[100]=199;e[101]=201;e[102]=209;e[103]=214;e[104]=220;e[105]=225;e[106]=224;e[107]=226;e[108]=228;e[109]=227;e[110]=229;e[111]=231;e[112]=233;e[113]=232;e[114]=234;e[115]=235;e[116]=237;e[117]=236;e[118]=238;e[119]=239;e[120]=241;e[121]=243;e[122]=242;e[123]=244;e[124]=246;e[125]=245;e[126]=250;e[127]=249;e[128]=251;e[129]=252;e[130]=8224;e[131]=176;e[132]=162;e[133]=163;e[134]=167;e[135]=8226;e[136]=182;e[137]=223;e[138]=174;e[139]=169;e[140]=8482;e[141]=180;e[142]=168;e[143]=8800;e[144]=198;e[145]=216;e[146]=8734;e[147]=177;e[148]=8804;e[149]=8805;e[150]=165;e[151]=181;e[152]=8706;e[153]=8721;e[154]=8719;e[156]=8747;e[157]=170;e[158]=186;e[159]=8486;e[160]=230;e[161]=248;e[162]=191;e[163]=161;e[164]=172;e[165]=8730;e[166]=402;e[167]=8776;e[168]=8710;e[169]=171;e[170]=187;e[171]=8230;e[179]=8220;e[180]=8221;e[181]=8216;e[182]=8217;e[200]=193;e[203]=205;e[207]=211;e[210]=218;e[223]=711;e[224]=321;e[225]=322;e[226]=352;e[227]=353;e[228]=381;e[229]=382;e[233]=221;e[234]=253;e[252]=263;e[253]=268;e[254]=269;e[258]=258;e[260]=260;e[261]=261;e[265]=280;e[266]=281;e[267]=282;e[268]=283;e[269]=313;e[275]=323;e[276]=324;e[278]=328;e[283]=344;e[284]=345;e[285]=346;e[286]=347;e[292]=367;e[295]=377;e[296]=378;e[298]=380;e[305]=963;e[306]=964;e[307]=966;e[308]=8215;e[309]=8252;e[310]=8319;e[311]=8359;e[312]=8592;e[313]=8593;e[337]=9552;e[493]=1039;e[494]=1040;e[672]=1488;e[673]=1489;e[674]=1490;e[675]=1491;e[676]=1492;e[677]=1493;e[678]=1494;e[679]=1495;e[680]=1496;e[681]=1497;e[682]=1498;e[683]=1499;e[684]=1500;e[685]=1501;e[686]=1502;e[687]=1503;e[688]=1504;e[689]=1505;e[690]=1506;e[691]=1507;e[692]=1508;e[693]=1509;e[694]=1510;e[695]=1511;e[696]=1512;e[697]=1513;e[698]=1514;e[705]=1524;e[706]=8362;e[710]=64288;e[711]=64298;e[759]=1617;e[761]=1776;e[763]=1778;e[775]=1652;e[777]=1764;e[778]=1780;e[779]=1781;e[780]=1782;e[782]=771;e[783]=64726;e[786]=8363;e[788]=8532;e[790]=768;e[791]=769;e[792]=768;e[795]=803;e[797]=64336;e[798]=64337;e[799]=64342;e[800]=64343;e[801]=64344;e[802]=64345;e[803]=64362;e[804]=64363;e[805]=64364;e[2424]=7821;e[2425]=7822;e[2426]=7823;e[2427]=7824;e[2428]=7825;e[2429]=7826;e[2430]=7827;e[2433]=7682;e[2678]=8045;e[2679]=8046;e[2830]=1552;e[2838]=686;e[2840]=751;e[2842]=753;e[2843]=754;e[2844]=755;e[2846]=757;e[2856]=767;e[2857]=848;e[2858]=849;e[2862]=853;e[2863]=854;e[2864]=855;e[2865]=861;e[2866]=862;e[2906]=7460;e[2908]=7462;e[2909]=7463;e[2910]=7464;e[2912]=7466;e[2913]=7467;e[2914]=7468;e[2916]=7470;e[2917]=7471;e[2918]=7472;e[2920]=7474;e[2921]=7475;e[2922]=7476;e[2924]=7478;e[2925]=7479;e[2926]=7480;e[2928]=7482;e[2929]=7483;e[2930]=7484;e[2932]=7486;e[2933]=7487;e[2934]=7488;e[2936]=7490;e[2937]=7491;e[2938]=7492;e[2940]=7494;e[2941]=7495;e[2942]=7496;e[2944]=7498;e[2946]=7500;e[2948]=7502;e[2950]=7504;e[2951]=7505;e[2952]=7506;e[2954]=7508;e[2955]=7509;e[2956]=7510;e[2958]=7512;e[2959]=7513;e[2960]=7514;e[2962]=7516;e[2963]=7517;e[2964]=7518;e[2966]=7520;e[2967]=7521;e[2968]=7522;e[2970]=7524;e[2971]=7525;e[2972]=7526;e[2974]=7528;e[2975]=7529;e[2976]=7530;e[2978]=1537;e[2979]=1538;e[2980]=1539;e[2982]=1549;e[2983]=1551;e[2984]=1552;e[2986]=1554;e[2987]=1555;e[2988]=1556;e[2990]=1623;e[2991]=1624;e[2995]=1775;e[2999]=1791;e[3002]=64290;e[3003]=64291;e[3004]=64292;e[3006]=64294;e[3007]=64295;e[3008]=64296;e[3011]=1900;e[3014]=8223;e[3015]=8244;e[3017]=7532;e[3018]=7533;e[3019]=7534;e[3075]=7590;e[3076]=7591;e[3079]=7594;e[3080]=7595;e[3083]=7598;e[3084]=7599;e[3087]=7602;e[3088]=7603;e[3091]=7606;e[3092]=7607;e[3095]=7610;e[3096]=7611;e[3099]=7614;e[3100]=7615;e[3103]=7618;e[3104]=7619;e[3107]=8337;e[3108]=8338;e[3116]=1884;e[3119]=1885;e[3120]=1885;e[3123]=1886;e[3124]=1886;e[3127]=1887;e[3128]=1887;e[3131]=1888;e[3132]=1888;e[3135]=1889;e[3136]=1889;e[3139]=1890;e[3140]=1890;e[3143]=1891;e[3144]=1891;e[3147]=1892;e[3148]=1892;e[3153]=580;e[3154]=581;e[3157]=584;e[3158]=585;e[3161]=588;e[3162]=589;e[3165]=891;e[3166]=892;e[3169]=1274;e[3170]=1275;e[3173]=1278;e[3174]=1279;e[3181]=7622;e[3182]=7623;e[3282]=11799;e[3316]=578;e[3379]=42785;e[3393]=1159;e[3416]=8377}));t.getGlyphMapForStandardFonts=h;const u=(0,r.getLookupTableFactory)((function(e){e[227]=322;e[264]=261;e[291]=346}));t.getSupplementalGlyphMapForArialBlack=u;const d=(0,r.getLookupTableFactory)((function(e){e[1]=32;e[4]=65;e[5]=192;e[6]=193;e[9]=196;e[17]=66;e[18]=67;e[21]=268;e[24]=68;e[28]=69;e[29]=200;e[30]=201;e[32]=282;e[38]=70;e[39]=71;e[44]=72;e[47]=73;e[48]=204;e[49]=205;e[58]=74;e[60]=75;e[62]=76;e[68]=77;e[69]=78;e[75]=79;e[76]=210;e[80]=214;e[87]=80;e[89]=81;e[90]=82;e[92]=344;e[94]=83;e[97]=352;e[100]=84;e[104]=85;e[109]=220;e[115]=86;e[116]=87;e[121]=88;e[122]=89;e[124]=221;e[127]=90;e[129]=381;e[258]=97;e[259]=224;e[260]=225;e[263]=228;e[268]=261;e[271]=98;e[272]=99;e[273]=263;e[275]=269;e[282]=100;e[286]=101;e[287]=232;e[288]=233;e[290]=283;e[295]=281;e[296]=102;e[336]=103;e[346]=104;e[349]=105;e[350]=236;e[351]=237;e[361]=106;e[364]=107;e[367]=108;e[371]=322;e[373]=109;e[374]=110;e[381]=111;e[382]=242;e[383]=243;e[386]=246;e[393]=112;e[395]=113;e[396]=114;e[398]=345;e[400]=115;e[401]=347;e[403]=353;e[410]=116;e[437]=117;e[442]=252;e[448]=118;e[449]=119;e[454]=120;e[455]=121;e[457]=253;e[460]=122;e[462]=382;e[463]=380;e[853]=44;e[855]=58;e[856]=46;e[876]=47;e[878]=45;e[882]=45;e[894]=40;e[895]=41;e[896]=91;e[897]=93;e[923]=64;e[1004]=48;e[1005]=49;e[1006]=50;e[1007]=51;e[1008]=52;e[1009]=53;e[1010]=54;e[1011]=55;e[1012]=56;e[1013]=57;e[1081]=37;e[1085]=43;e[1086]=45}));t.getSupplementalGlyphMapForCalibri=d},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.ToUnicodeMap=t.IdentityToUnicodeMap=void 0;var r=a(2);t.ToUnicodeMap=class ToUnicodeMap{constructor(e=[]){this._map=e}get length(){return this._map.length}forEach(e){for(const t in this._map)e(t,this._map[t].charCodeAt(0))}has(e){return void 0!==this._map[e]}get(e){return this._map[e]}charCodeOf(e){const t=this._map;if(t.length<=65536)return t.indexOf(e);for(const a in t)if(t[a]===e)return 0|a;return-1}amend(e){for(const t in e)this._map[t]=e[t]}};t.IdentityToUnicodeMap=class IdentityToUnicodeMap{constructor(e,t){this.firstChar=e;this.lastChar=t}get length(){return this.lastChar+1-this.firstChar}forEach(e){for(let t=this.firstChar,a=this.lastChar;t<=a;t++)e(t,t)}has(e){return this.firstChar<=e&&e<=this.lastChar}get(e){if(this.firstChar<=e&&e<=this.lastChar)return String.fromCharCode(e)}charCodeOf(e){return Number.isInteger(e)&&e>=this.firstChar&&e<=this.lastChar?e:-1}amend(e){(0,r.unreachable)("Should not call amend()")}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.CFFFont=void 0;var r=a(33),n=a(36),i=a(2);t.CFFFont=class CFFFont{constructor(e,t){this.properties=t;const a=new r.CFFParser(e,t,n.SEAC_ANALYSIS_ENABLED);this.cff=a.parse();this.cff.duplicateFirstGlyph();const s=new r.CFFCompiler(this.cff);this.seacs=this.cff.seacs;try{this.data=s.compile()}catch(a){(0,i.warn)("Failed to compile font "+t.loadedName);this.data=e}this._createBuiltInEncoding()}get numGlyphs(){return this.cff.charStrings.count}getCharset(){return this.cff.charset.charset}getGlyphMapping(){const e=this.cff,t=this.properties,{cidToGidMap:a,cMap:r}=t,i=e.charset.charset;let s,o;if(t.composite){let t,n;if(a&&a.length>0){t=Object.create(null);for(let e=0,r=a.length;e<r;e++){const r=a[e];void 0!==r&&(t[r]=e)}}s=Object.create(null);if(e.isCIDFont)for(o=0;o<i.length;o++){const e=i[o];n=r.charCodeOf(e);t&&void 0!==t[n]&&(n=t[n]);s[n]=o}else for(o=0;o<e.charStrings.count;o++){n=r.charCodeOf(o);s[n]=o}return s}let c=e.encoding?e.encoding.encoding:null;t.isInternalFont&&(c=t.defaultEncoding);s=(0,n.type1FontGlyphMapping)(t,c,i);return s}hasGlyphId(e){return this.cff.hasGlyphId(e)}_createBuiltInEncoding(){const{charset:e,encoding:t}=this.cff;if(!e||!t)return;const a=e.charset,r=t.encoding,n=[];for(const e in r){const t=r[e];if(t>=0){const r=a[t];r&&(n[e]=r)}}n.length>0&&(this.properties.builtInEncoding=n)}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.FontRendererFactory=void 0;var r=a(2),n=a(33),i=a(37),s=a(35),o=a(8);function getUint32(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function getUint16(e,t){return e[t]<<8|e[t+1]}function getInt16(e,t){return(e[t]<<24|e[t+1]<<16)>>16}function getInt8(e,t){return e[t]<<24>>24}function getFloat214(e,t){return getInt16(e,t)/16384}function getSubroutineBias(e){const t=e.length;let a=32768;t<1240?a=107:t<33900&&(a=1131);return a}function parseCmap(e,t,a){const n=1===getUint16(e,t+2)?getUint32(e,t+8):getUint32(e,t+16),i=getUint16(e,t+n);let s,o,c;if(4===i){getUint16(e,t+n+2);const a=getUint16(e,t+n+6)>>1;o=t+n+14;s=[];for(c=0;c<a;c++,o+=2)s[c]={end:getUint16(e,o)};o+=2;for(c=0;c<a;c++,o+=2)s[c].start=getUint16(e,o);for(c=0;c<a;c++,o+=2)s[c].idDelta=getUint16(e,o);for(c=0;c<a;c++,o+=2){let t=getUint16(e,o);if(0!==t){s[c].ids=[];for(let a=0,r=s[c].end-s[c].start+1;a<r;a++){s[c].ids[a]=getUint16(e,o+t);t+=2}}}return s}if(12===i){const a=getUint32(e,t+n+12);o=t+n+16;s=[];for(c=0;c<a;c++){t=getUint32(e,o);s.push({start:t,end:getUint32(e,o+4),idDelta:getUint32(e,o+8)-t});o+=12}return s}throw new r.FormatError(`unsupported cmap: ${i}`)}function parseCff(e,t,a,r){const i=new n.CFFParser(new o.Stream(e,t,a-t),{},r).parse();return{glyphs:i.charStrings.objects,subrs:i.topDict.privateDict&&i.topDict.privateDict.subrsIndex&&i.topDict.privateDict.subrsIndex.objects,gsubrs:i.globalSubrIndex&&i.globalSubrIndex.objects,isCFFCIDFont:i.isCIDFont,fdSelect:i.fdSelect,fdArray:i.fdArray}}function lookupCmap(e,t){const a=t.codePointAt(0);let r=0,n=0,i=e.length-1;for(;n<i;){const t=n+i+1>>1;a<e[t].start?i=t-1:n=t}e[n].start<=a&&a<=e[n].end&&(r=e[n].idDelta+(e[n].ids?e[n].ids[a-e[n].start]:a)&65535);return{charCode:a,glyphId:r}}function compileGlyf(e,t,a){function moveTo(e,a){t.push({cmd:"moveTo",args:[e,a]})}function lineTo(e,a){t.push({cmd:"lineTo",args:[e,a]})}function quadraticCurveTo(e,a,r,n){t.push({cmd:"quadraticCurveTo",args:[e,a,r,n]})}let r=0;const n=getInt16(e,r);let i,s=0,o=0;r+=10;if(n<0)do{i=getUint16(e,r);const n=getUint16(e,r+2);r+=4;let c,l;if(1&i){if(2&i){c=getInt16(e,r);l=getInt16(e,r+2)}else{c=getUint16(e,r);l=getUint16(e,r+2)}r+=4}else if(2&i){c=getInt8(e,r++);l=getInt8(e,r++)}else{c=e[r++];l=e[r++]}if(2&i){s=c;o=l}else{s=0;o=0}let h=1,u=1,d=0,f=0;if(8&i){h=u=getFloat214(e,r);r+=2}else if(64&i){h=getFloat214(e,r);u=getFloat214(e,r+2);r+=4}else if(128&i){h=getFloat214(e,r);d=getFloat214(e,r+2);f=getFloat214(e,r+4);u=getFloat214(e,r+6);r+=8}const g=a.glyphs[n];if(g){t.push({cmd:"save"},{cmd:"transform",args:[h,d,f,u,s,o]});compileGlyf(g,t,a);t.push({cmd:"restore"})}}while(32&i);else{const t=[];let a,c;for(a=0;a<n;a++){t.push(getUint16(e,r));r+=2}r+=2+getUint16(e,r);const l=t.at(-1)+1,h=[];for(;h.length<l;){i=e[r++];let t=1;8&i&&(t+=e[r++]);for(;t-- >0;)h.push({flags:i})}for(a=0;a<l;a++){switch(18&h[a].flags){case 0:s+=getInt16(e,r);r+=2;break;case 2:s-=e[r++];break;case 18:s+=e[r++]}h[a].x=s}for(a=0;a<l;a++){switch(36&h[a].flags){case 0:o+=getInt16(e,r);r+=2;break;case 4:o-=e[r++];break;case 36:o+=e[r++]}h[a].y=o}let u=0;for(r=0;r<n;r++){const e=t[r],n=h.slice(u,e+1);if(1&n[0].flags)n.push(n[0]);else if(1&n.at(-1).flags)n.unshift(n.at(-1));else{const e={flags:1,x:(n[0].x+n.at(-1).x)/2,y:(n[0].y+n.at(-1).y)/2};n.unshift(e);n.push(e)}moveTo(n[0].x,n[0].y);for(a=1,c=n.length;a<c;a++)if(1&n[a].flags)lineTo(n[a].x,n[a].y);else if(1&n[a+1].flags){quadraticCurveTo(n[a].x,n[a].y,n[a+1].x,n[a+1].y);a++}else quadraticCurveTo(n[a].x,n[a].y,(n[a].x+n[a+1].x)/2,(n[a].y+n[a+1].y)/2);u=e+1}}}function compileCharString(e,t,a,n){function moveTo(e,a){t.push({cmd:"moveTo",args:[e,a]})}function lineTo(e,a){t.push({cmd:"lineTo",args:[e,a]})}function bezierCurveTo(e,a,r,n,i,s){t.push({cmd:"bezierCurveTo",args:[e,a,r,n,i,s]})}const i=[];let o=0,c=0,l=0;!function parse(e){let h=0;for(;h<e.length;){let u,d,f,g,p,m,b,y,w,S=!1,x=e[h++];switch(x){case 1:case 3:case 18:case 23:l+=i.length>>1;S=!0;break;case 4:c+=i.pop();moveTo(o,c);S=!0;break;case 5:for(;i.length>0;){o+=i.shift();c+=i.shift();lineTo(o,c)}break;case 6:for(;i.length>0;){o+=i.shift();lineTo(o,c);if(0===i.length)break;c+=i.shift();lineTo(o,c)}break;case 7:for(;i.length>0;){c+=i.shift();lineTo(o,c);if(0===i.length)break;o+=i.shift();lineTo(o,c)}break;case 8:for(;i.length>0;){u=o+i.shift();f=c+i.shift();d=u+i.shift();g=f+i.shift();o=d+i.shift();c=g+i.shift();bezierCurveTo(u,f,d,g,o,c)}break;case 10:y=i.pop();w=null;if(a.isCFFCIDFont){const e=a.fdSelect.getFDIndex(n);if(e>=0&&e<a.fdArray.length){const t=a.fdArray[e];let r;t.privateDict&&t.privateDict.subrsIndex&&(r=t.privateDict.subrsIndex.objects);if(r){y+=getSubroutineBias(r);w=r[y]}}else(0,r.warn)("Invalid fd index for glyph index.")}else w=a.subrs[y+a.subrsBias];w&&parse(w);break;case 11:return;case 12:x=e[h++];switch(x){case 34:u=o+i.shift();d=u+i.shift();p=c+i.shift();o=d+i.shift();bezierCurveTo(u,c,d,p,o,p);u=o+i.shift();d=u+i.shift();o=d+i.shift();bezierCurveTo(u,p,d,c,o,c);break;case 35:u=o+i.shift();f=c+i.shift();d=u+i.shift();g=f+i.shift();o=d+i.shift();c=g+i.shift();bezierCurveTo(u,f,d,g,o,c);u=o+i.shift();f=c+i.shift();d=u+i.shift();g=f+i.shift();o=d+i.shift();c=g+i.shift();bezierCurveTo(u,f,d,g,o,c);i.pop();break;case 36:u=o+i.shift();p=c+i.shift();d=u+i.shift();m=p+i.shift();o=d+i.shift();bezierCurveTo(u,p,d,m,o,m);u=o+i.shift();d=u+i.shift();b=m+i.shift();o=d+i.shift();bezierCurveTo(u,m,d,b,o,c);break;case 37:const e=o,t=c;u=o+i.shift();f=c+i.shift();d=u+i.shift();g=f+i.shift();o=d+i.shift();c=g+i.shift();bezierCurveTo(u,f,d,g,o,c);u=o+i.shift();f=c+i.shift();d=u+i.shift();g=f+i.shift();o=d;c=g;Math.abs(o-e)>Math.abs(c-t)?o+=i.shift():c+=i.shift();bezierCurveTo(u,f,d,g,o,c);break;default:throw new r.FormatError(`unknown operator: 12 ${x}`)}break;case 14:if(i.length>=4){const e=i.pop(),r=i.pop();c=i.pop();o=i.pop();t.push({cmd:"save"},{cmd:"translate",args:[o,c]});let n=lookupCmap(a.cmap,String.fromCharCode(a.glyphNameMap[s.StandardEncoding[e]]));compileCharString(a.glyphs[n.glyphId],t,a,n.glyphId);t.push({cmd:"restore"});n=lookupCmap(a.cmap,String.fromCharCode(a.glyphNameMap[s.StandardEncoding[r]]));compileCharString(a.glyphs[n.glyphId],t,a,n.glyphId)}return;case 19:case 20:l+=i.length>>1;h+=l+7>>3;S=!0;break;case 21:c+=i.pop();o+=i.pop();moveTo(o,c);S=!0;break;case 22:o+=i.pop();moveTo(o,c);S=!0;break;case 24:for(;i.length>2;){u=o+i.shift();f=c+i.shift();d=u+i.shift();g=f+i.shift();o=d+i.shift();c=g+i.shift();bezierCurveTo(u,f,d,g,o,c)}o+=i.shift();c+=i.shift();lineTo(o,c);break;case 25:for(;i.length>6;){o+=i.shift();c+=i.shift();lineTo(o,c)}u=o+i.shift();f=c+i.shift();d=u+i.shift();g=f+i.shift();o=d+i.shift();c=g+i.shift();bezierCurveTo(u,f,d,g,o,c);break;case 26:i.length%2&&(o+=i.shift());for(;i.length>0;){u=o;f=c+i.shift();d=u+i.shift();g=f+i.shift();o=d;c=g+i.shift();bezierCurveTo(u,f,d,g,o,c)}break;case 27:i.length%2&&(c+=i.shift());for(;i.length>0;){u=o+i.shift();f=c;d=u+i.shift();g=f+i.shift();o=d+i.shift();c=g;bezierCurveTo(u,f,d,g,o,c)}break;case 28:i.push((e[h]<<24|e[h+1]<<16)>>16);h+=2;break;case 29:y=i.pop()+a.gsubrsBias;w=a.gsubrs[y];w&&parse(w);break;case 30:for(;i.length>0;){u=o;f=c+i.shift();d=u+i.shift();g=f+i.shift();o=d+i.shift();c=g+(1===i.length?i.shift():0);bezierCurveTo(u,f,d,g,o,c);if(0===i.length)break;u=o+i.shift();f=c;d=u+i.shift();g=f+i.shift();c=g+i.shift();o=d+(1===i.length?i.shift():0);bezierCurveTo(u,f,d,g,o,c)}break;case 31:for(;i.length>0;){u=o+i.shift();f=c;d=u+i.shift();g=f+i.shift();c=g+i.shift();o=d+(1===i.length?i.shift():0);bezierCurveTo(u,f,d,g,o,c);if(0===i.length)break;u=o;f=c+i.shift();d=u+i.shift();g=f+i.shift();o=d+i.shift();c=g+(1===i.length?i.shift():0);bezierCurveTo(u,f,d,g,o,c)}break;default:if(x<32)throw new r.FormatError(`unknown operator: ${x}`);if(x<247)i.push(x-139);else if(x<251)i.push(256*(x-247)+e[h++]+108);else if(x<255)i.push(256*-(x-251)-e[h++]-108);else{i.push((e[h]<<24|e[h+1]<<16|e[h+2]<<8|e[h+3])/65536);h+=4}}S&&(i.length=0)}}(e)}const c=[];class CompiledFont{constructor(e){this.constructor===CompiledFont&&(0,r.unreachable)("Cannot initialize CompiledFont.");this.fontMatrix=e;this.compiledGlyphs=Object.create(null);this.compiledCharCodeToGlyphId=Object.create(null)}getPathJs(e){const{charCode:t,glyphId:a}=lookupCmap(this.cmap,e);let r=this.compiledGlyphs[a];if(!r)try{r=this.compileGlyph(this.glyphs[a],a);this.compiledGlyphs[a]=r}catch(e){this.compiledGlyphs[a]=c;void 0===this.compiledCharCodeToGlyphId[t]&&(this.compiledCharCodeToGlyphId[t]=a);throw e}void 0===this.compiledCharCodeToGlyphId[t]&&(this.compiledCharCodeToGlyphId[t]=a);return r}compileGlyph(e,t){if(!e||0===e.length||14===e[0])return c;let a=this.fontMatrix;if(this.isCFFCIDFont){const e=this.fdSelect.getFDIndex(t);if(e>=0&&e<this.fdArray.length){a=this.fdArray[e].getByName("FontMatrix")||r.FONT_IDENTITY_MATRIX}else(0,r.warn)("Invalid fd index for glyph index.")}const n=[{cmd:"save"},{cmd:"transform",args:a.slice()},{cmd:"scale",args:["size","-size"]}];this.compileGlyphImpl(e,n,t);n.push({cmd:"restore"});return n}compileGlyphImpl(){(0,r.unreachable)("Children classes should implement this.")}hasBuiltPath(e){const{charCode:t,glyphId:a}=lookupCmap(this.cmap,e);return void 0!==this.compiledGlyphs[a]&&void 0!==this.compiledCharCodeToGlyphId[t]}}class TrueTypeCompiled extends CompiledFont{constructor(e,t,a){super(a||[488e-6,0,0,488e-6,0,0]);this.glyphs=e;this.cmap=t}compileGlyphImpl(e,t){compileGlyf(e,t,this)}}class Type2Compiled extends CompiledFont{constructor(e,t,a,r){super(a||[.001,0,0,.001,0,0]);this.glyphs=e.glyphs;this.gsubrs=e.gsubrs||[];this.subrs=e.subrs||[];this.cmap=t;this.glyphNameMap=r||(0,i.getGlyphsUnicode)();this.gsubrsBias=getSubroutineBias(this.gsubrs);this.subrsBias=getSubroutineBias(this.subrs);this.isCFFCIDFont=e.isCFFCIDFont;this.fdSelect=e.fdSelect;this.fdArray=e.fdArray}compileGlyphImpl(e,t,a){compileCharString(e,t,this,a)}}t.FontRendererFactory=class FontRendererFactory{static create(e,t){const a=new Uint8Array(e.data);let n,i,s,o,c,l;const h=getUint16(a,4);for(let e=0,u=12;e<h;e++,u+=16){const e=(0,r.bytesToString)(a.subarray(u,u+4)),h=getUint32(a,u+8),d=getUint32(a,u+12);switch(e){case"cmap":n=parseCmap(a,h);break;case"glyf":i=a.subarray(h,h+d);break;case"loca":s=a.subarray(h,h+d);break;case"head":l=getUint16(a,h+18);c=getUint16(a,h+50);break;case"CFF ":o=parseCff(a,h,h+d,t)}}if(i){const t=l?[1/l,0,0,1/l,0,0]:e.fontMatrix;return new TrueTypeCompiled(function parseGlyfTable(e,t,a){let r,n;if(a){r=4;n=getUint32}else{r=2;n=(e,t)=>2*getUint16(e,t)}const i=[];let s=n(t,0);for(let a=r;a<t.length;a+=r){const r=n(t,a);i.push(e.subarray(s,r));s=r}return i}(i,s,c),n,t)}return new Type2Compiled(o,n,e.fontMatrix,e.glyphNameMap)}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.getMetrics=t.getFontBasicMetrics=void 0;var r=a(3);const n=(0,r.getLookupTableFactory)((function(e){e.Courier=600;e["Courier-Bold"]=600;e["Courier-BoldOblique"]=600;e["Courier-Oblique"]=600;e.Helvetica=(0,r.getLookupTableFactory)((function(e){e.space=278;e.exclam=278;e.quotedbl=355;e.numbersign=556;e.dollar=556;e.percent=889;e.ampersand=667;e.quoteright=222;e.parenleft=333;e.parenright=333;e.asterisk=389;e.plus=584;e.comma=278;e.hyphen=333;e.period=278;e.slash=278;e.zero=556;e.one=556;e.two=556;e.three=556;e.four=556;e.five=556;e.six=556;e.seven=556;e.eight=556;e.nine=556;e.colon=278;e.semicolon=278;e.less=584;e.equal=584;e.greater=584;e.question=556;e.at=1015;e.A=667;e.B=667;e.C=722;e.D=722;e.E=667;e.F=611;e.G=778;e.H=722;e.I=278;e.J=500;e.K=667;e.L=556;e.M=833;e.N=722;e.O=778;e.P=667;e.Q=778;e.R=722;e.S=667;e.T=611;e.U=722;e.V=667;e.W=944;e.X=667;e.Y=667;e.Z=611;e.bracketleft=278;e.backslash=278;e.bracketright=278;e.asciicircum=469;e.underscore=556;e.quoteleft=222;e.a=556;e.b=556;e.c=500;e.d=556;e.e=556;e.f=278;e.g=556;e.h=556;e.i=222;e.j=222;e.k=500;e.l=222;e.m=833;e.n=556;e.o=556;e.p=556;e.q=556;e.r=333;e.s=500;e.t=278;e.u=556;e.v=500;e.w=722;e.x=500;e.y=500;e.z=500;e.braceleft=334;e.bar=260;e.braceright=334;e.asciitilde=584;e.exclamdown=333;e.cent=556;e.sterling=556;e.fraction=167;e.yen=556;e.florin=556;e.section=556;e.currency=556;e.quotesingle=191;e.quotedblleft=333;e.guillemotleft=556;e.guilsinglleft=333;e.guilsinglright=333;e.fi=500;e.fl=500;e.endash=556;e.dagger=556;e.daggerdbl=556;e.periodcentered=278;e.paragraph=537;e.bullet=350;e.quotesinglbase=222;e.quotedblbase=333;e.quotedblright=333;e.guillemotright=556;e.ellipsis=1e3;e.perthousand=1e3;e.questiondown=611;e.grave=333;e.acute=333;e.circumflex=333;e.tilde=333;e.macron=333;e.breve=333;e.dotaccent=333;e.dieresis=333;e.ring=333;e.cedilla=333;e.hungarumlaut=333;e.ogonek=333;e.caron=333;e.emdash=1e3;e.AE=1e3;e.ordfeminine=370;e.Lslash=556;e.Oslash=778;e.OE=1e3;e.ordmasculine=365;e.ae=889;e.dotlessi=278;e.lslash=222;e.oslash=611;e.oe=944;e.germandbls=611;e.Idieresis=278;e.eacute=556;e.abreve=556;e.uhungarumlaut=556;e.ecaron=556;e.Ydieresis=667;e.divide=584;e.Yacute=667;e.Acircumflex=667;e.aacute=556;e.Ucircumflex=722;e.yacute=500;e.scommaaccent=500;e.ecircumflex=556;e.Uring=722;e.Udieresis=722;e.aogonek=556;e.Uacute=722;e.uogonek=556;e.Edieresis=667;e.Dcroat=722;e.commaaccent=250;e.copyright=737;e.Emacron=667;e.ccaron=500;e.aring=556;e.Ncommaaccent=722;e.lacute=222;e.agrave=556;e.Tcommaaccent=611;e.Cacute=722;e.atilde=556;e.Edotaccent=667;e.scaron=500;e.scedilla=500;e.iacute=278;e.lozenge=471;e.Rcaron=722;e.Gcommaaccent=778;e.ucircumflex=556;e.acircumflex=556;e.Amacron=667;e.rcaron=333;e.ccedilla=500;e.Zdotaccent=611;e.Thorn=667;e.Omacron=778;e.Racute=722;e.Sacute=667;e.dcaron=643;e.Umacron=722;e.uring=556;e.threesuperior=333;e.Ograve=778;e.Agrave=667;e.Abreve=667;e.multiply=584;e.uacute=556;e.Tcaron=611;e.partialdiff=476;e.ydieresis=500;e.Nacute=722;e.icircumflex=278;e.Ecircumflex=667;e.adieresis=556;e.edieresis=556;e.cacute=500;e.nacute=556;e.umacron=556;e.Ncaron=722;e.Iacute=278;e.plusminus=584;e.brokenbar=260;e.registered=737;e.Gbreve=778;e.Idotaccent=278;e.summation=600;e.Egrave=667;e.racute=333;e.omacron=556;e.Zacute=611;e.Zcaron=611;e.greaterequal=549;e.Eth=722;e.Ccedilla=722;e.lcommaaccent=222;e.tcaron=317;e.eogonek=556;e.Uogonek=722;e.Aacute=667;e.Adieresis=667;e.egrave=556;e.zacute=500;e.iogonek=222;e.Oacute=778;e.oacute=556;e.amacron=556;e.sacute=500;e.idieresis=278;e.Ocircumflex=778;e.Ugrave=722;e.Delta=612;e.thorn=556;e.twosuperior=333;e.Odieresis=778;e.mu=556;e.igrave=278;e.ohungarumlaut=556;e.Eogonek=667;e.dcroat=556;e.threequarters=834;e.Scedilla=667;e.lcaron=299;e.Kcommaaccent=667;e.Lacute=556;e.trademark=1e3;e.edotaccent=556;e.Igrave=278;e.Imacron=278;e.Lcaron=556;e.onehalf=834;e.lessequal=549;e.ocircumflex=556;e.ntilde=556;e.Uhungarumlaut=722;e.Eacute=667;e.emacron=556;e.gbreve=556;e.onequarter=834;e.Scaron=667;e.Scommaaccent=667;e.Ohungarumlaut=778;e.degree=400;e.ograve=556;e.Ccaron=722;e.ugrave=556;e.radical=453;e.Dcaron=722;e.rcommaaccent=333;e.Ntilde=722;e.otilde=556;e.Rcommaaccent=722;e.Lcommaaccent=556;e.Atilde=667;e.Aogonek=667;e.Aring=667;e.Otilde=778;e.zdotaccent=500;e.Ecaron=667;e.Iogonek=278;e.kcommaaccent=500;e.minus=584;e.Icircumflex=278;e.ncaron=556;e.tcommaaccent=278;e.logicalnot=584;e.odieresis=556;e.udieresis=556;e.notequal=549;e.gcommaaccent=556;e.eth=556;e.zcaron=500;e.ncommaaccent=556;e.onesuperior=333;e.imacron=278;e.Euro=556}));e["Helvetica-Bold"]=(0,r.getLookupTableFactory)((function(e){e.space=278;e.exclam=333;e.quotedbl=474;e.numbersign=556;e.dollar=556;e.percent=889;e.ampersand=722;e.quoteright=278;e.parenleft=333;e.parenright=333;e.asterisk=389;e.plus=584;e.comma=278;e.hyphen=333;e.period=278;e.slash=278;e.zero=556;e.one=556;e.two=556;e.three=556;e.four=556;e.five=556;e.six=556;e.seven=556;e.eight=556;e.nine=556;e.colon=333;e.semicolon=333;e.less=584;e.equal=584;e.greater=584;e.question=611;e.at=975;e.A=722;e.B=722;e.C=722;e.D=722;e.E=667;e.F=611;e.G=778;e.H=722;e.I=278;e.J=556;e.K=722;e.L=611;e.M=833;e.N=722;e.O=778;e.P=667;e.Q=778;e.R=722;e.S=667;e.T=611;e.U=722;e.V=667;e.W=944;e.X=667;e.Y=667;e.Z=611;e.bracketleft=333;e.backslash=278;e.bracketright=333;e.asciicircum=584;e.underscore=556;e.quoteleft=278;e.a=556;e.b=611;e.c=556;e.d=611;e.e=556;e.f=333;e.g=611;e.h=611;e.i=278;e.j=278;e.k=556;e.l=278;e.m=889;e.n=611;e.o=611;e.p=611;e.q=611;e.r=389;e.s=556;e.t=333;e.u=611;e.v=556;e.w=778;e.x=556;e.y=556;e.z=500;e.braceleft=389;e.bar=280;e.braceright=389;e.asciitilde=584;e.exclamdown=333;e.cent=556;e.sterling=556;e.fraction=167;e.yen=556;e.florin=556;e.section=556;e.currency=556;e.quotesingle=238;e.quotedblleft=500;e.guillemotleft=556;e.guilsinglleft=333;e.guilsinglright=333;e.fi=611;e.fl=611;e.endash=556;e.dagger=556;e.daggerdbl=556;e.periodcentered=278;e.paragraph=556;e.bullet=350;e.quotesinglbase=278;e.quotedblbase=500;e.quotedblright=500;e.guillemotright=556;e.ellipsis=1e3;e.perthousand=1e3;e.questiondown=611;e.grave=333;e.acute=333;e.circumflex=333;e.tilde=333;e.macron=333;e.breve=333;e.dotaccent=333;e.dieresis=333;e.ring=333;e.cedilla=333;e.hungarumlaut=333;e.ogonek=333;e.caron=333;e.emdash=1e3;e.AE=1e3;e.ordfeminine=370;e.Lslash=611;e.Oslash=778;e.OE=1e3;e.ordmasculine=365;e.ae=889;e.dotlessi=278;e.lslash=278;e.oslash=611;e.oe=944;e.germandbls=611;e.Idieresis=278;e.eacute=556;e.abreve=556;e.uhungarumlaut=611;e.ecaron=556;e.Ydieresis=667;e.divide=584;e.Yacute=667;e.Acircumflex=722;e.aacute=556;e.Ucircumflex=722;e.yacute=556;e.scommaaccent=556;e.ecircumflex=556;e.Uring=722;e.Udieresis=722;e.aogonek=556;e.Uacute=722;e.uogonek=611;e.Edieresis=667;e.Dcroat=722;e.commaaccent=250;e.copyright=737;e.Emacron=667;e.ccaron=556;e.aring=556;e.Ncommaaccent=722;e.lacute=278;e.agrave=556;e.Tcommaaccent=611;e.Cacute=722;e.atilde=556;e.Edotaccent=667;e.scaron=556;e.scedilla=556;e.iacute=278;e.lozenge=494;e.Rcaron=722;e.Gcommaaccent=778;e.ucircumflex=611;e.acircumflex=556;e.Amacron=722;e.rcaron=389;e.ccedilla=556;e.Zdotaccent=611;e.Thorn=667;e.Omacron=778;e.Racute=722;e.Sacute=667;e.dcaron=743;e.Umacron=722;e.uring=611;e.threesuperior=333;e.Ograve=778;e.Agrave=722;e.Abreve=722;e.multiply=584;e.uacute=611;e.Tcaron=611;e.partialdiff=494;e.ydieresis=556;e.Nacute=722;e.icircumflex=278;e.Ecircumflex=667;e.adieresis=556;e.edieresis=556;e.cacute=556;e.nacute=611;e.umacron=611;e.Ncaron=722;e.Iacute=278;e.plusminus=584;e.brokenbar=280;e.registered=737;e.Gbreve=778;e.Idotaccent=278;e.summation=600;e.Egrave=667;e.racute=389;e.omacron=611;e.Zacute=611;e.Zcaron=611;e.greaterequal=549;e.Eth=722;e.Ccedilla=722;e.lcommaaccent=278;e.tcaron=389;e.eogonek=556;e.Uogonek=722;e.Aacute=722;e.Adieresis=722;e.egrave=556;e.zacute=500;e.iogonek=278;e.Oacute=778;e.oacute=611;e.amacron=556;e.sacute=556;e.idieresis=278;e.Ocircumflex=778;e.Ugrave=722;e.Delta=612;e.thorn=611;e.twosuperior=333;e.Odieresis=778;e.mu=611;e.igrave=278;e.ohungarumlaut=611;e.Eogonek=667;e.dcroat=611;e.threequarters=834;e.Scedilla=667;e.lcaron=400;e.Kcommaaccent=722;e.Lacute=611;e.trademark=1e3;e.edotaccent=556;e.Igrave=278;e.Imacron=278;e.Lcaron=611;e.onehalf=834;e.lessequal=549;e.ocircumflex=611;e.ntilde=611;e.Uhungarumlaut=722;e.Eacute=667;e.emacron=556;e.gbreve=611;e.onequarter=834;e.Scaron=667;e.Scommaaccent=667;e.Ohungarumlaut=778;e.degree=400;e.ograve=611;e.Ccaron=722;e.ugrave=611;e.radical=549;e.Dcaron=722;e.rcommaaccent=389;e.Ntilde=722;e.otilde=611;e.Rcommaaccent=722;e.Lcommaaccent=611;e.Atilde=722;e.Aogonek=722;e.Aring=722;e.Otilde=778;e.zdotaccent=500;e.Ecaron=667;e.Iogonek=278;e.kcommaaccent=556;e.minus=584;e.Icircumflex=278;e.ncaron=611;e.tcommaaccent=333;e.logicalnot=584;e.odieresis=611;e.udieresis=611;e.notequal=549;e.gcommaaccent=611;e.eth=611;e.zcaron=500;e.ncommaaccent=611;e.onesuperior=333;e.imacron=278;e.Euro=556}));e["Helvetica-BoldOblique"]=(0,r.getLookupTableFactory)((function(e){e.space=278;e.exclam=333;e.quotedbl=474;e.numbersign=556;e.dollar=556;e.percent=889;e.ampersand=722;e.quoteright=278;e.parenleft=333;e.parenright=333;e.asterisk=389;e.plus=584;e.comma=278;e.hyphen=333;e.period=278;e.slash=278;e.zero=556;e.one=556;e.two=556;e.three=556;e.four=556;e.five=556;e.six=556;e.seven=556;e.eight=556;e.nine=556;e.colon=333;e.semicolon=333;e.less=584;e.equal=584;e.greater=584;e.question=611;e.at=975;e.A=722;e.B=722;e.C=722;e.D=722;e.E=667;e.F=611;e.G=778;e.H=722;e.I=278;e.J=556;e.K=722;e.L=611;e.M=833;e.N=722;e.O=778;e.P=667;e.Q=778;e.R=722;e.S=667;e.T=611;e.U=722;e.V=667;e.W=944;e.X=667;e.Y=667;e.Z=611;e.bracketleft=333;e.backslash=278;e.bracketright=333;e.asciicircum=584;e.underscore=556;e.quoteleft=278;e.a=556;e.b=611;e.c=556;e.d=611;e.e=556;e.f=333;e.g=611;e.h=611;e.i=278;e.j=278;e.k=556;e.l=278;e.m=889;e.n=611;e.o=611;e.p=611;e.q=611;e.r=389;e.s=556;e.t=333;e.u=611;e.v=556;e.w=778;e.x=556;e.y=556;e.z=500;e.braceleft=389;e.bar=280;e.braceright=389;e.asciitilde=584;e.exclamdown=333;e.cent=556;e.sterling=556;e.fraction=167;e.yen=556;e.florin=556;e.section=556;e.currency=556;e.quotesingle=238;e.quotedblleft=500;e.guillemotleft=556;e.guilsinglleft=333;e.guilsinglright=333;e.fi=611;e.fl=611;e.endash=556;e.dagger=556;e.daggerdbl=556;e.periodcentered=278;e.paragraph=556;e.bullet=350;e.quotesinglbase=278;e.quotedblbase=500;e.quotedblright=500;e.guillemotright=556;e.ellipsis=1e3;e.perthousand=1e3;e.questiondown=611;e.grave=333;e.acute=333;e.circumflex=333;e.tilde=333;e.macron=333;e.breve=333;e.dotaccent=333;e.dieresis=333;e.ring=333;e.cedilla=333;e.hungarumlaut=333;e.ogonek=333;e.caron=333;e.emdash=1e3;e.AE=1e3;e.ordfeminine=370;e.Lslash=611;e.Oslash=778;e.OE=1e3;e.ordmasculine=365;e.ae=889;e.dotlessi=278;e.lslash=278;e.oslash=611;e.oe=944;e.germandbls=611;e.Idieresis=278;e.eacute=556;e.abreve=556;e.uhungarumlaut=611;e.ecaron=556;e.Ydieresis=667;e.divide=584;e.Yacute=667;e.Acircumflex=722;e.aacute=556;e.Ucircumflex=722;e.yacute=556;e.scommaaccent=556;e.ecircumflex=556;e.Uring=722;e.Udieresis=722;e.aogonek=556;e.Uacute=722;e.uogonek=611;e.Edieresis=667;e.Dcroat=722;e.commaaccent=250;e.copyright=737;e.Emacron=667;e.ccaron=556;e.aring=556;e.Ncommaaccent=722;e.lacute=278;e.agrave=556;e.Tcommaaccent=611;e.Cacute=722;e.atilde=556;e.Edotaccent=667;e.scaron=556;e.scedilla=556;e.iacute=278;e.lozenge=494;e.Rcaron=722;e.Gcommaaccent=778;e.ucircumflex=611;e.acircumflex=556;e.Amacron=722;e.rcaron=389;e.ccedilla=556;e.Zdotaccent=611;e.Thorn=667;e.Omacron=778;e.Racute=722;e.Sacute=667;e.dcaron=743;e.Umacron=722;e.uring=611;e.threesuperior=333;e.Ograve=778;e.Agrave=722;e.Abreve=722;e.multiply=584;e.uacute=611;e.Tcaron=611;e.partialdiff=494;e.ydieresis=556;e.Nacute=722;e.icircumflex=278;e.Ecircumflex=667;e.adieresis=556;e.edieresis=556;e.cacute=556;e.nacute=611;e.umacron=611;e.Ncaron=722;e.Iacute=278;e.plusminus=584;e.brokenbar=280;e.registered=737;e.Gbreve=778;e.Idotaccent=278;e.summation=600;e.Egrave=667;e.racute=389;e.omacron=611;e.Zacute=611;e.Zcaron=611;e.greaterequal=549;e.Eth=722;e.Ccedilla=722;e.lcommaaccent=278;e.tcaron=389;e.eogonek=556;e.Uogonek=722;e.Aacute=722;e.Adieresis=722;e.egrave=556;e.zacute=500;e.iogonek=278;e.Oacute=778;e.oacute=611;e.amacron=556;e.sacute=556;e.idieresis=278;e.Ocircumflex=778;e.Ugrave=722;e.Delta=612;e.thorn=611;e.twosuperior=333;e.Odieresis=778;e.mu=611;e.igrave=278;e.ohungarumlaut=611;e.Eogonek=667;e.dcroat=611;e.threequarters=834;e.Scedilla=667;e.lcaron=400;e.Kcommaaccent=722;e.Lacute=611;e.trademark=1e3;e.edotaccent=556;e.Igrave=278;e.Imacron=278;e.Lcaron=611;e.onehalf=834;e.lessequal=549;e.ocircumflex=611;e.ntilde=611;e.Uhungarumlaut=722;e.Eacute=667;e.emacron=556;e.gbreve=611;e.onequarter=834;e.Scaron=667;e.Scommaaccent=667;e.Ohungarumlaut=778;e.degree=400;e.ograve=611;e.Ccaron=722;e.ugrave=611;e.radical=549;e.Dcaron=722;e.rcommaaccent=389;e.Ntilde=722;e.otilde=611;e.Rcommaaccent=722;e.Lcommaaccent=611;e.Atilde=722;e.Aogonek=722;e.Aring=722;e.Otilde=778;e.zdotaccent=500;e.Ecaron=667;e.Iogonek=278;e.kcommaaccent=556;e.minus=584;e.Icircumflex=278;e.ncaron=611;e.tcommaaccent=333;e.logicalnot=584;e.odieresis=611;e.udieresis=611;e.notequal=549;e.gcommaaccent=611;e.eth=611;e.zcaron=500;e.ncommaaccent=611;e.onesuperior=333;e.imacron=278;e.Euro=556}));e["Helvetica-Oblique"]=(0,r.getLookupTableFactory)((function(e){e.space=278;e.exclam=278;e.quotedbl=355;e.numbersign=556;e.dollar=556;e.percent=889;e.ampersand=667;e.quoteright=222;e.parenleft=333;e.parenright=333;e.asterisk=389;e.plus=584;e.comma=278;e.hyphen=333;e.period=278;e.slash=278;e.zero=556;e.one=556;e.two=556;e.three=556;e.four=556;e.five=556;e.six=556;e.seven=556;e.eight=556;e.nine=556;e.colon=278;e.semicolon=278;e.less=584;e.equal=584;e.greater=584;e.question=556;e.at=1015;e.A=667;e.B=667;e.C=722;e.D=722;e.E=667;e.F=611;e.G=778;e.H=722;e.I=278;e.J=500;e.K=667;e.L=556;e.M=833;e.N=722;e.O=778;e.P=667;e.Q=778;e.R=722;e.S=667;e.T=611;e.U=722;e.V=667;e.W=944;e.X=667;e.Y=667;e.Z=611;e.bracketleft=278;e.backslash=278;e.bracketright=278;e.asciicircum=469;e.underscore=556;e.quoteleft=222;e.a=556;e.b=556;e.c=500;e.d=556;e.e=556;e.f=278;e.g=556;e.h=556;e.i=222;e.j=222;e.k=500;e.l=222;e.m=833;e.n=556;e.o=556;e.p=556;e.q=556;e.r=333;e.s=500;e.t=278;e.u=556;e.v=500;e.w=722;e.x=500;e.y=500;e.z=500;e.braceleft=334;e.bar=260;e.braceright=334;e.asciitilde=584;e.exclamdown=333;e.cent=556;e.sterling=556;e.fraction=167;e.yen=556;e.florin=556;e.section=556;e.currency=556;e.quotesingle=191;e.quotedblleft=333;e.guillemotleft=556;e.guilsinglleft=333;e.guilsinglright=333;e.fi=500;e.fl=500;e.endash=556;e.dagger=556;e.daggerdbl=556;e.periodcentered=278;e.paragraph=537;e.bullet=350;e.quotesinglbase=222;e.quotedblbase=333;e.quotedblright=333;e.guillemotright=556;e.ellipsis=1e3;e.perthousand=1e3;e.questiondown=611;e.grave=333;e.acute=333;e.circumflex=333;e.tilde=333;e.macron=333;e.breve=333;e.dotaccent=333;e.dieresis=333;e.ring=333;e.cedilla=333;e.hungarumlaut=333;e.ogonek=333;e.caron=333;e.emdash=1e3;e.AE=1e3;e.ordfeminine=370;e.Lslash=556;e.Oslash=778;e.OE=1e3;e.ordmasculine=365;e.ae=889;e.dotlessi=278;e.lslash=222;e.oslash=611;e.oe=944;e.germandbls=611;e.Idieresis=278;e.eacute=556;e.abreve=556;e.uhungarumlaut=556;e.ecaron=556;e.Ydieresis=667;e.divide=584;e.Yacute=667;e.Acircumflex=667;e.aacute=556;e.Ucircumflex=722;e.yacute=500;e.scommaaccent=500;e.ecircumflex=556;e.Uring=722;e.Udieresis=722;e.aogonek=556;e.Uacute=722;e.uogonek=556;e.Edieresis=667;e.Dcroat=722;e.commaaccent=250;e.copyright=737;e.Emacron=667;e.ccaron=500;e.aring=556;e.Ncommaaccent=722;e.lacute=222;e.agrave=556;e.Tcommaaccent=611;e.Cacute=722;e.atilde=556;e.Edotaccent=667;e.scaron=500;e.scedilla=500;e.iacute=278;e.lozenge=471;e.Rcaron=722;e.Gcommaaccent=778;e.ucircumflex=556;e.acircumflex=556;e.Amacron=667;e.rcaron=333;e.ccedilla=500;e.Zdotaccent=611;e.Thorn=667;e.Omacron=778;e.Racute=722;e.Sacute=667;e.dcaron=643;e.Umacron=722;e.uring=556;e.threesuperior=333;e.Ograve=778;e.Agrave=667;e.Abreve=667;e.multiply=584;e.uacute=556;e.Tcaron=611;e.partialdiff=476;e.ydieresis=500;e.Nacute=722;e.icircumflex=278;e.Ecircumflex=667;e.adieresis=556;e.edieresis=556;e.cacute=500;e.nacute=556;e.umacron=556;e.Ncaron=722;e.Iacute=278;e.plusminus=584;e.brokenbar=260;e.registered=737;e.Gbreve=778;e.Idotaccent=278;e.summation=600;e.Egrave=667;e.racute=333;e.omacron=556;e.Zacute=611;e.Zcaron=611;e.greaterequal=549;e.Eth=722;e.Ccedilla=722;e.lcommaaccent=222;e.tcaron=317;e.eogonek=556;e.Uogonek=722;e.Aacute=667;e.Adieresis=667;e.egrave=556;e.zacute=500;e.iogonek=222;e.Oacute=778;e.oacute=556;e.amacron=556;e.sacute=500;e.idieresis=278;e.Ocircumflex=778;e.Ugrave=722;e.Delta=612;e.thorn=556;e.twosuperior=333;e.Odieresis=778;e.mu=556;e.igrave=278;e.ohungarumlaut=556;e.Eogonek=667;e.dcroat=556;e.threequarters=834;e.Scedilla=667;e.lcaron=299;e.Kcommaaccent=667;e.Lacute=556;e.trademark=1e3;e.edotaccent=556;e.Igrave=278;e.Imacron=278;e.Lcaron=556;e.onehalf=834;e.lessequal=549;e.ocircumflex=556;e.ntilde=556;e.Uhungarumlaut=722;e.Eacute=667;e.emacron=556;e.gbreve=556;e.onequarter=834;e.Scaron=667;e.Scommaaccent=667;e.Ohungarumlaut=778;e.degree=400;e.ograve=556;e.Ccaron=722;e.ugrave=556;e.radical=453;e.Dcaron=722;e.rcommaaccent=333;e.Ntilde=722;e.otilde=556;e.Rcommaaccent=722;e.Lcommaaccent=556;e.Atilde=667;e.Aogonek=667;e.Aring=667;e.Otilde=778;e.zdotaccent=500;e.Ecaron=667;e.Iogonek=278;e.kcommaaccent=500;e.minus=584;e.Icircumflex=278;e.ncaron=556;e.tcommaaccent=278;e.logicalnot=584;e.odieresis=556;e.udieresis=556;e.notequal=549;e.gcommaaccent=556;e.eth=556;e.zcaron=500;e.ncommaaccent=556;e.onesuperior=333;e.imacron=278;e.Euro=556}));e.Symbol=(0,r.getLookupTableFactory)((function(e){e.space=250;e.exclam=333;e.universal=713;e.numbersign=500;e.existential=549;e.percent=833;e.ampersand=778;e.suchthat=439;e.parenleft=333;e.parenright=333;e.asteriskmath=500;e.plus=549;e.comma=250;e.minus=549;e.period=250;e.slash=278;e.zero=500;e.one=500;e.two=500;e.three=500;e.four=500;e.five=500;e.six=500;e.seven=500;e.eight=500;e.nine=500;e.colon=278;e.semicolon=278;e.less=549;e.equal=549;e.greater=549;e.question=444;e.congruent=549;e.Alpha=722;e.Beta=667;e.Chi=722;e.Delta=612;e.Epsilon=611;e.Phi=763;e.Gamma=603;e.Eta=722;e.Iota=333;e.theta1=631;e.Kappa=722;e.Lambda=686;e.Mu=889;e.Nu=722;e.Omicron=722;e.Pi=768;e.Theta=741;e.Rho=556;e.Sigma=592;e.Tau=611;e.Upsilon=690;e.sigma1=439;e.Omega=768;e.Xi=645;e.Psi=795;e.Zeta=611;e.bracketleft=333;e.therefore=863;e.bracketright=333;e.perpendicular=658;e.underscore=500;e.radicalex=500;e.alpha=631;e.beta=549;e.chi=549;e.delta=494;e.epsilon=439;e.phi=521;e.gamma=411;e.eta=603;e.iota=329;e.phi1=603;e.kappa=549;e.lambda=549;e.mu=576;e.nu=521;e.omicron=549;e.pi=549;e.theta=521;e.rho=549;e.sigma=603;e.tau=439;e.upsilon=576;e.omega1=713;e.omega=686;e.xi=493;e.psi=686;e.zeta=494;e.braceleft=480;e.bar=200;e.braceright=480;e.similar=549;e.Euro=750;e.Upsilon1=620;e.minute=247;e.lessequal=549;e.fraction=167;e.infinity=713;e.florin=500;e.club=753;e.diamond=753;e.heart=753;e.spade=753;e.arrowboth=1042;e.arrowleft=987;e.arrowup=603;e.arrowright=987;e.arrowdown=603;e.degree=400;e.plusminus=549;e.second=411;e.greaterequal=549;e.multiply=549;e.proportional=713;e.partialdiff=494;e.bullet=460;e.divide=549;e.notequal=549;e.equivalence=549;e.approxequal=549;e.ellipsis=1e3;e.arrowvertex=603;e.arrowhorizex=1e3;e.carriagereturn=658;e.aleph=823;e.Ifraktur=686;e.Rfraktur=795;e.weierstrass=987;e.circlemultiply=768;e.circleplus=768;e.emptyset=823;e.intersection=768;e.union=768;e.propersuperset=713;e.reflexsuperset=713;e.notsubset=713;e.propersubset=713;e.reflexsubset=713;e.element=713;e.notelement=713;e.angle=768;e.gradient=713;e.registerserif=790;e.copyrightserif=790;e.trademarkserif=890;e.product=823;e.radical=549;e.dotmath=250;e.logicalnot=713;e.logicaland=603;e.logicalor=603;e.arrowdblboth=1042;e.arrowdblleft=987;e.arrowdblup=603;e.arrowdblright=987;e.arrowdbldown=603;e.lozenge=494;e.angleleft=329;e.registersans=790;e.copyrightsans=790;e.trademarksans=786;e.summation=713;e.parenlefttp=384;e.parenleftex=384;e.parenleftbt=384;e.bracketlefttp=384;e.bracketleftex=384;e.bracketleftbt=384;e.bracelefttp=494;e.braceleftmid=494;e.braceleftbt=494;e.braceex=494;e.angleright=329;e.integral=274;e.integraltp=686;e.integralex=686;e.integralbt=686;e.parenrighttp=384;e.parenrightex=384;e.parenrightbt=384;e.bracketrighttp=384;e.bracketrightex=384;e.bracketrightbt=384;e.bracerighttp=494;e.bracerightmid=494;e.bracerightbt=494;e.apple=790}));e["Times-Roman"]=(0,r.getLookupTableFactory)((function(e){e.space=250;e.exclam=333;e.quotedbl=408;e.numbersign=500;e.dollar=500;e.percent=833;e.ampersand=778;e.quoteright=333;e.parenleft=333;e.parenright=333;e.asterisk=500;e.plus=564;e.comma=250;e.hyphen=333;e.period=250;e.slash=278;e.zero=500;e.one=500;e.two=500;e.three=500;e.four=500;e.five=500;e.six=500;e.seven=500;e.eight=500;e.nine=500;e.colon=278;e.semicolon=278;e.less=564;e.equal=564;e.greater=564;e.question=444;e.at=921;e.A=722;e.B=667;e.C=667;e.D=722;e.E=611;e.F=556;e.G=722;e.H=722;e.I=333;e.J=389;e.K=722;e.L=611;e.M=889;e.N=722;e.O=722;e.P=556;e.Q=722;e.R=667;e.S=556;e.T=611;e.U=722;e.V=722;e.W=944;e.X=722;e.Y=722;e.Z=611;e.bracketleft=333;e.backslash=278;e.bracketright=333;e.asciicircum=469;e.underscore=500;e.quoteleft=333;e.a=444;e.b=500;e.c=444;e.d=500;e.e=444;e.f=333;e.g=500;e.h=500;e.i=278;e.j=278;e.k=500;e.l=278;e.m=778;e.n=500;e.o=500;e.p=500;e.q=500;e.r=333;e.s=389;e.t=278;e.u=500;e.v=500;e.w=722;e.x=500;e.y=500;e.z=444;e.braceleft=480;e.bar=200;e.braceright=480;e.asciitilde=541;e.exclamdown=333;e.cent=500;e.sterling=500;e.fraction=167;e.yen=500;e.florin=500;e.section=500;e.currency=500;e.quotesingle=180;e.quotedblleft=444;e.guillemotleft=500;e.guilsinglleft=333;e.guilsinglright=333;e.fi=556;e.fl=556;e.endash=500;e.dagger=500;e.daggerdbl=500;e.periodcentered=250;e.paragraph=453;e.bullet=350;e.quotesinglbase=333;e.quotedblbase=444;e.quotedblright=444;e.guillemotright=500;e.ellipsis=1e3;e.perthousand=1e3;e.questiondown=444;e.grave=333;e.acute=333;e.circumflex=333;e.tilde=333;e.macron=333;e.breve=333;e.dotaccent=333;e.dieresis=333;e.ring=333;e.cedilla=333;e.hungarumlaut=333;e.ogonek=333;e.caron=333;e.emdash=1e3;e.AE=889;e.ordfeminine=276;e.Lslash=611;e.Oslash=722;e.OE=889;e.ordmasculine=310;e.ae=667;e.dotlessi=278;e.lslash=278;e.oslash=500;e.oe=722;e.germandbls=500;e.Idieresis=333;e.eacute=444;e.abreve=444;e.uhungarumlaut=500;e.ecaron=444;e.Ydieresis=722;e.divide=564;e.Yacute=722;e.Acircumflex=722;e.aacute=444;e.Ucircumflex=722;e.yacute=500;e.scommaaccent=389;e.ecircumflex=444;e.Uring=722;e.Udieresis=722;e.aogonek=444;e.Uacute=722;e.uogonek=500;e.Edieresis=611;e.Dcroat=722;e.commaaccent=250;e.copyright=760;e.Emacron=611;e.ccaron=444;e.aring=444;e.Ncommaaccent=722;e.lacute=278;e.agrave=444;e.Tcommaaccent=611;e.Cacute=667;e.atilde=444;e.Edotaccent=611;e.scaron=389;e.scedilla=389;e.iacute=278;e.lozenge=471;e.Rcaron=667;e.Gcommaaccent=722;e.ucircumflex=500;e.acircumflex=444;e.Amacron=722;e.rcaron=333;e.ccedilla=444;e.Zdotaccent=611;e.Thorn=556;e.Omacron=722;e.Racute=667;e.Sacute=556;e.dcaron=588;e.Umacron=722;e.uring=500;e.threesuperior=300;e.Ograve=722;e.Agrave=722;e.Abreve=722;e.multiply=564;e.uacute=500;e.Tcaron=611;e.partialdiff=476;e.ydieresis=500;e.Nacute=722;e.icircumflex=278;e.Ecircumflex=611;e.adieresis=444;e.edieresis=444;e.cacute=444;e.nacute=500;e.umacron=500;e.Ncaron=722;e.Iacute=333;e.plusminus=564;e.brokenbar=200;e.registered=760;e.Gbreve=722;e.Idotaccent=333;e.summation=600;e.Egrave=611;e.racute=333;e.omacron=500;e.Zacute=611;e.Zcaron=611;e.greaterequal=549;e.Eth=722;e.Ccedilla=667;e.lcommaaccent=278;e.tcaron=326;e.eogonek=444;e.Uogonek=722;e.Aacute=722;e.Adieresis=722;e.egrave=444;e.zacute=444;e.iogonek=278;e.Oacute=722;e.oacute=500;e.amacron=444;e.sacute=389;e.idieresis=278;e.Ocircumflex=722;e.Ugrave=722;e.Delta=612;e.thorn=500;e.twosuperior=300;e.Odieresis=722;e.mu=500;e.igrave=278;e.ohungarumlaut=500;e.Eogonek=611;e.dcroat=500;e.threequarters=750;e.Scedilla=556;e.lcaron=344;e.Kcommaaccent=722;e.Lacute=611;e.trademark=980;e.edotaccent=444;e.Igrave=333;e.Imacron=333;e.Lcaron=611;e.onehalf=750;e.lessequal=549;e.ocircumflex=500;e.ntilde=500;e.Uhungarumlaut=722;e.Eacute=611;e.emacron=444;e.gbreve=500;e.onequarter=750;e.Scaron=556;e.Scommaaccent=556;e.Ohungarumlaut=722;e.degree=400;e.ograve=500;e.Ccaron=667;e.ugrave=500;e.radical=453;e.Dcaron=722;e.rcommaaccent=333;e.Ntilde=722;e.otilde=500;e.Rcommaaccent=667;e.Lcommaaccent=611;e.Atilde=722;e.Aogonek=722;e.Aring=722;e.Otilde=722;e.zdotaccent=444;e.Ecaron=611;e.Iogonek=333;e.kcommaaccent=500;e.minus=564;e.Icircumflex=333;e.ncaron=500;e.tcommaaccent=278;e.logicalnot=564;e.odieresis=500;e.udieresis=500;e.notequal=549;e.gcommaaccent=500;e.eth=500;e.zcaron=444;e.ncommaaccent=500;e.onesuperior=300;e.imacron=278;e.Euro=500}));e["Times-Bold"]=(0,r.getLookupTableFactory)((function(e){e.space=250;e.exclam=333;e.quotedbl=555;e.numbersign=500;e.dollar=500;e.percent=1e3;e.ampersand=833;e.quoteright=333;e.parenleft=333;e.parenright=333;e.asterisk=500;e.plus=570;e.comma=250;e.hyphen=333;e.period=250;e.slash=278;e.zero=500;e.one=500;e.two=500;e.three=500;e.four=500;e.five=500;e.six=500;e.seven=500;e.eight=500;e.nine=500;e.colon=333;e.semicolon=333;e.less=570;e.equal=570;e.greater=570;e.question=500;e.at=930;e.A=722;e.B=667;e.C=722;e.D=722;e.E=667;e.F=611;e.G=778;e.H=778;e.I=389;e.J=500;e.K=778;e.L=667;e.M=944;e.N=722;e.O=778;e.P=611;e.Q=778;e.R=722;e.S=556;e.T=667;e.U=722;e.V=722;e.W=1e3;e.X=722;e.Y=722;e.Z=667;e.bracketleft=333;e.backslash=278;e.bracketright=333;e.asciicircum=581;e.underscore=500;e.quoteleft=333;e.a=500;e.b=556;e.c=444;e.d=556;e.e=444;e.f=333;e.g=500;e.h=556;e.i=278;e.j=333;e.k=556;e.l=278;e.m=833;e.n=556;e.o=500;e.p=556;e.q=556;e.r=444;e.s=389;e.t=333;e.u=556;e.v=500;e.w=722;e.x=500;e.y=500;e.z=444;e.braceleft=394;e.bar=220;e.braceright=394;e.asciitilde=520;e.exclamdown=333;e.cent=500;e.sterling=500;e.fraction=167;e.yen=500;e.florin=500;e.section=500;e.currency=500;e.quotesingle=278;e.quotedblleft=500;e.guillemotleft=500;e.guilsinglleft=333;e.guilsinglright=333;e.fi=556;e.fl=556;e.endash=500;e.dagger=500;e.daggerdbl=500;e.periodcentered=250;e.paragraph=540;e.bullet=350;e.quotesinglbase=333;e.quotedblbase=500;e.quotedblright=500;e.guillemotright=500;e.ellipsis=1e3;e.perthousand=1e3;e.questiondown=500;e.grave=333;e.acute=333;e.circumflex=333;e.tilde=333;e.macron=333;e.breve=333;e.dotaccent=333;e.dieresis=333;e.ring=333;e.cedilla=333;e.hungarumlaut=333;e.ogonek=333;e.caron=333;e.emdash=1e3;e.AE=1e3;e.ordfeminine=300;e.Lslash=667;e.Oslash=778;e.OE=1e3;e.ordmasculine=330;e.ae=722;e.dotlessi=278;e.lslash=278;e.oslash=500;e.oe=722;e.germandbls=556;e.Idieresis=389;e.eacute=444;e.abreve=500;e.uhungarumlaut=556;e.ecaron=444;e.Ydieresis=722;e.divide=570;e.Yacute=722;e.Acircumflex=722;e.aacute=500;e.Ucircumflex=722;e.yacute=500;e.scommaaccent=389;e.ecircumflex=444;e.Uring=722;e.Udieresis=722;e.aogonek=500;e.Uacute=722;e.uogonek=556;e.Edieresis=667;e.Dcroat=722;e.commaaccent=250;e.copyright=747;e.Emacron=667;e.ccaron=444;e.aring=500;e.Ncommaaccent=722;e.lacute=278;e.agrave=500;e.Tcommaaccent=667;e.Cacute=722;e.atilde=500;e.Edotaccent=667;e.scaron=389;e.scedilla=389;e.iacute=278;e.lozenge=494;e.Rcaron=722;e.Gcommaaccent=778;e.ucircumflex=556;e.acircumflex=500;e.Amacron=722;e.rcaron=444;e.ccedilla=444;e.Zdotaccent=667;e.Thorn=611;e.Omacron=778;e.Racute=722;e.Sacute=556;e.dcaron=672;e.Umacron=722;e.uring=556;e.threesuperior=300;e.Ograve=778;e.Agrave=722;e.Abreve=722;e.multiply=570;e.uacute=556;e.Tcaron=667;e.partialdiff=494;e.ydieresis=500;e.Nacute=722;e.icircumflex=278;e.Ecircumflex=667;e.adieresis=500;e.edieresis=444;e.cacute=444;e.nacute=556;e.umacron=556;e.Ncaron=722;e.Iacute=389;e.plusminus=570;e.brokenbar=220;e.registered=747;e.Gbreve=778;e.Idotaccent=389;e.summation=600;e.Egrave=667;e.racute=444;e.omacron=500;e.Zacute=667;e.Zcaron=667;e.greaterequal=549;e.Eth=722;e.Ccedilla=722;e.lcommaaccent=278;e.tcaron=416;e.eogonek=444;e.Uogonek=722;e.Aacute=722;e.Adieresis=722;e.egrave=444;e.zacute=444;e.iogonek=278;e.Oacute=778;e.oacute=500;e.amacron=500;e.sacute=389;e.idieresis=278;e.Ocircumflex=778;e.Ugrave=722;e.Delta=612;e.thorn=556;e.twosuperior=300;e.Odieresis=778;e.mu=556;e.igrave=278;e.ohungarumlaut=500;e.Eogonek=667;e.dcroat=556;e.threequarters=750;e.Scedilla=556;e.lcaron=394;e.Kcommaaccent=778;e.Lacute=667;e.trademark=1e3;e.edotaccent=444;e.Igrave=389;e.Imacron=389;e.Lcaron=667;e.onehalf=750;e.lessequal=549;e.ocircumflex=500;e.ntilde=556;e.Uhungarumlaut=722;e.Eacute=667;e.emacron=444;e.gbreve=500;e.onequarter=750;e.Scaron=556;e.Scommaaccent=556;e.Ohungarumlaut=778;e.degree=400;e.ograve=500;e.Ccaron=722;e.ugrave=556;e.radical=549;e.Dcaron=722;e.rcommaaccent=444;e.Ntilde=722;e.otilde=500;e.Rcommaaccent=722;e.Lcommaaccent=667;e.Atilde=722;e.Aogonek=722;e.Aring=722;e.Otilde=778;e.zdotaccent=444;e.Ecaron=667;e.Iogonek=389;e.kcommaaccent=556;e.minus=570;e.Icircumflex=389;e.ncaron=556;e.tcommaaccent=333;e.logicalnot=570;e.odieresis=500;e.udieresis=556;e.notequal=549;e.gcommaaccent=500;e.eth=500;e.zcaron=444;e.ncommaaccent=556;e.onesuperior=300;e.imacron=278;e.Euro=500}));e["Times-BoldItalic"]=(0,r.getLookupTableFactory)((function(e){e.space=250;e.exclam=389;e.quotedbl=555;e.numbersign=500;e.dollar=500;e.percent=833;e.ampersand=778;e.quoteright=333;e.parenleft=333;e.parenright=333;e.asterisk=500;e.plus=570;e.comma=250;e.hyphen=333;e.period=250;e.slash=278;e.zero=500;e.one=500;e.two=500;e.three=500;e.four=500;e.five=500;e.six=500;e.seven=500;e.eight=500;e.nine=500;e.colon=333;e.semicolon=333;e.less=570;e.equal=570;e.greater=570;e.question=500;e.at=832;e.A=667;e.B=667;e.C=667;e.D=722;e.E=667;e.F=667;e.G=722;e.H=778;e.I=389;e.J=500;e.K=667;e.L=611;e.M=889;e.N=722;e.O=722;e.P=611;e.Q=722;e.R=667;e.S=556;e.T=611;e.U=722;e.V=667;e.W=889;e.X=667;e.Y=611;e.Z=611;e.bracketleft=333;e.backslash=278;e.bracketright=333;e.asciicircum=570;e.underscore=500;e.quoteleft=333;e.a=500;e.b=500;e.c=444;e.d=500;e.e=444;e.f=333;e.g=500;e.h=556;e.i=278;e.j=278;e.k=500;e.l=278;e.m=778;e.n=556;e.o=500;e.p=500;e.q=500;e.r=389;e.s=389;e.t=278;e.u=556;e.v=444;e.w=667;e.x=500;e.y=444;e.z=389;e.braceleft=348;e.bar=220;e.braceright=348;e.asciitilde=570;e.exclamdown=389;e.cent=500;e.sterling=500;e.fraction=167;e.yen=500;e.florin=500;e.section=500;e.currency=500;e.quotesingle=278;e.quotedblleft=500;e.guillemotleft=500;e.guilsinglleft=333;e.guilsinglright=333;e.fi=556;e.fl=556;e.endash=500;e.dagger=500;e.daggerdbl=500;e.periodcentered=250;e.paragraph=500;e.bullet=350;e.quotesinglbase=333;e.quotedblbase=500;e.quotedblright=500;e.guillemotright=500;e.ellipsis=1e3;e.perthousand=1e3;e.questiondown=500;e.grave=333;e.acute=333;e.circumflex=333;e.tilde=333;e.macron=333;e.breve=333;e.dotaccent=333;e.dieresis=333;e.ring=333;e.cedilla=333;e.hungarumlaut=333;e.ogonek=333;e.caron=333;e.emdash=1e3;e.AE=944;e.ordfeminine=266;e.Lslash=611;e.Oslash=722;e.OE=944;e.ordmasculine=300;e.ae=722;e.dotlessi=278;e.lslash=278;e.oslash=500;e.oe=722;e.germandbls=500;e.Idieresis=389;e.eacute=444;e.abreve=500;e.uhungarumlaut=556;e.ecaron=444;e.Ydieresis=611;e.divide=570;e.Yacute=611;e.Acircumflex=667;e.aacute=500;e.Ucircumflex=722;e.yacute=444;e.scommaaccent=389;e.ecircumflex=444;e.Uring=722;e.Udieresis=722;e.aogonek=500;e.Uacute=722;e.uogonek=556;e.Edieresis=667;e.Dcroat=722;e.commaaccent=250;e.copyright=747;e.Emacron=667;e.ccaron=444;e.aring=500;e.Ncommaaccent=722;e.lacute=278;e.agrave=500;e.Tcommaaccent=611;e.Cacute=667;e.atilde=500;e.Edotaccent=667;e.scaron=389;e.scedilla=389;e.iacute=278;e.lozenge=494;e.Rcaron=667;e.Gcommaaccent=722;e.ucircumflex=556;e.acircumflex=500;e.Amacron=667;e.rcaron=389;e.ccedilla=444;e.Zdotaccent=611;e.Thorn=611;e.Omacron=722;e.Racute=667;e.Sacute=556;e.dcaron=608;e.Umacron=722;e.uring=556;e.threesuperior=300;e.Ograve=722;e.Agrave=667;e.Abreve=667;e.multiply=570;e.uacute=556;e.Tcaron=611;e.partialdiff=494;e.ydieresis=444;e.Nacute=722;e.icircumflex=278;e.Ecircumflex=667;e.adieresis=500;e.edieresis=444;e.cacute=444;e.nacute=556;e.umacron=556;e.Ncaron=722;e.Iacute=389;e.plusminus=570;e.brokenbar=220;e.registered=747;e.Gbreve=722;e.Idotaccent=389;e.summation=600;e.Egrave=667;e.racute=389;e.omacron=500;e.Zacute=611;e.Zcaron=611;e.greaterequal=549;e.Eth=722;e.Ccedilla=667;e.lcommaaccent=278;e.tcaron=366;e.eogonek=444;e.Uogonek=722;e.Aacute=667;e.Adieresis=667;e.egrave=444;e.zacute=389;e.iogonek=278;e.Oacute=722;e.oacute=500;e.amacron=500;e.sacute=389;e.idieresis=278;e.Ocircumflex=722;e.Ugrave=722;e.Delta=612;e.thorn=500;e.twosuperior=300;e.Odieresis=722;e.mu=576;e.igrave=278;e.ohungarumlaut=500;e.Eogonek=667;e.dcroat=500;e.threequarters=750;e.Scedilla=556;e.lcaron=382;e.Kcommaaccent=667;e.Lacute=611;e.trademark=1e3;e.edotaccent=444;e.Igrave=389;e.Imacron=389;e.Lcaron=611;e.onehalf=750;e.lessequal=549;e.ocircumflex=500;e.ntilde=556;e.Uhungarumlaut=722;e.Eacute=667;e.emacron=444;e.gbreve=500;e.onequarter=750;e.Scaron=556;e.Scommaaccent=556;e.Ohungarumlaut=722;e.degree=400;e.ograve=500;e.Ccaron=667;e.ugrave=556;e.radical=549;e.Dcaron=722;e.rcommaaccent=389;e.Ntilde=722;e.otilde=500;e.Rcommaaccent=667;e.Lcommaaccent=611;e.Atilde=667;e.Aogonek=667;e.Aring=667;e.Otilde=722;e.zdotaccent=389;e.Ecaron=667;e.Iogonek=389;e.kcommaaccent=500;e.minus=606;e.Icircumflex=389;e.ncaron=556;e.tcommaaccent=278;e.logicalnot=606;e.odieresis=500;e.udieresis=556;e.notequal=549;e.gcommaaccent=500;e.eth=500;e.zcaron=389;e.ncommaaccent=556;e.onesuperior=300;e.imacron=278;e.Euro=500}));e["Times-Italic"]=(0,r.getLookupTableFactory)((function(e){e.space=250;e.exclam=333;e.quotedbl=420;e.numbersign=500;e.dollar=500;e.percent=833;e.ampersand=778;e.quoteright=333;e.parenleft=333;e.parenright=333;e.asterisk=500;e.plus=675;e.comma=250;e.hyphen=333;e.period=250;e.slash=278;e.zero=500;e.one=500;e.two=500;e.three=500;e.four=500;e.five=500;e.six=500;e.seven=500;e.eight=500;e.nine=500;e.colon=333;e.semicolon=333;e.less=675;e.equal=675;e.greater=675;e.question=500;e.at=920;e.A=611;e.B=611;e.C=667;e.D=722;e.E=611;e.F=611;e.G=722;e.H=722;e.I=333;e.J=444;e.K=667;e.L=556;e.M=833;e.N=667;e.O=722;e.P=611;e.Q=722;e.R=611;e.S=500;e.T=556;e.U=722;e.V=611;e.W=833;e.X=611;e.Y=556;e.Z=556;e.bracketleft=389;e.backslash=278;e.bracketright=389;e.asciicircum=422;e.underscore=500;e.quoteleft=333;e.a=500;e.b=500;e.c=444;e.d=500;e.e=444;e.f=278;e.g=500;e.h=500;e.i=278;e.j=278;e.k=444;e.l=278;e.m=722;e.n=500;e.o=500;e.p=500;e.q=500;e.r=389;e.s=389;e.t=278;e.u=500;e.v=444;e.w=667;e.x=444;e.y=444;e.z=389;e.braceleft=400;e.bar=275;e.braceright=400;e.asciitilde=541;e.exclamdown=389;e.cent=500;e.sterling=500;e.fraction=167;e.yen=500;e.florin=500;e.section=500;e.currency=500;e.quotesingle=214;e.quotedblleft=556;e.guillemotleft=500;e.guilsinglleft=333;e.guilsinglright=333;e.fi=500;e.fl=500;e.endash=500;e.dagger=500;e.daggerdbl=500;e.periodcentered=250;e.paragraph=523;e.bullet=350;e.quotesinglbase=333;e.quotedblbase=556;e.quotedblright=556;e.guillemotright=500;e.ellipsis=889;e.perthousand=1e3;e.questiondown=500;e.grave=333;e.acute=333;e.circumflex=333;e.tilde=333;e.macron=333;e.breve=333;e.dotaccent=333;e.dieresis=333;e.ring=333;e.cedilla=333;e.hungarumlaut=333;e.ogonek=333;e.caron=333;e.emdash=889;e.AE=889;e.ordfeminine=276;e.Lslash=556;e.Oslash=722;e.OE=944;e.ordmasculine=310;e.ae=667;e.dotlessi=278;e.lslash=278;e.oslash=500;e.oe=667;e.germandbls=500;e.Idieresis=333;e.eacute=444;e.abreve=500;e.uhungarumlaut=500;e.ecaron=444;e.Ydieresis=556;e.divide=675;e.Yacute=556;e.Acircumflex=611;e.aacute=500;e.Ucircumflex=722;e.yacute=444;e.scommaaccent=389;e.ecircumflex=444;e.Uring=722;e.Udieresis=722;e.aogonek=500;e.Uacute=722;e.uogonek=500;e.Edieresis=611;e.Dcroat=722;e.commaaccent=250;e.copyright=760;e.Emacron=611;e.ccaron=444;e.aring=500;e.Ncommaaccent=667;e.lacute=278;e.agrave=500;e.Tcommaaccent=556;e.Cacute=667;e.atilde=500;e.Edotaccent=611;e.scaron=389;e.scedilla=389;e.iacute=278;e.lozenge=471;e.Rcaron=611;e.Gcommaaccent=722;e.ucircumflex=500;e.acircumflex=500;e.Amacron=611;e.rcaron=389;e.ccedilla=444;e.Zdotaccent=556;e.Thorn=611;e.Omacron=722;e.Racute=611;e.Sacute=500;e.dcaron=544;e.Umacron=722;e.uring=500;e.threesuperior=300;e.Ograve=722;e.Agrave=611;e.Abreve=611;e.multiply=675;e.uacute=500;e.Tcaron=556;e.partialdiff=476;e.ydieresis=444;e.Nacute=667;e.icircumflex=278;e.Ecircumflex=611;e.adieresis=500;e.edieresis=444;e.cacute=444;e.nacute=500;e.umacron=500;e.Ncaron=667;e.Iacute=333;e.plusminus=675;e.brokenbar=275;e.registered=760;e.Gbreve=722;e.Idotaccent=333;e.summation=600;e.Egrave=611;e.racute=389;e.omacron=500;e.Zacute=556;e.Zcaron=556;e.greaterequal=549;e.Eth=722;e.Ccedilla=667;e.lcommaaccent=278;e.tcaron=300;e.eogonek=444;e.Uogonek=722;e.Aacute=611;e.Adieresis=611;e.egrave=444;e.zacute=389;e.iogonek=278;e.Oacute=722;e.oacute=500;e.amacron=500;e.sacute=389;e.idieresis=278;e.Ocircumflex=722;e.Ugrave=722;e.Delta=612;e.thorn=500;e.twosuperior=300;e.Odieresis=722;e.mu=500;e.igrave=278;e.ohungarumlaut=500;e.Eogonek=611;e.dcroat=500;e.threequarters=750;e.Scedilla=500;e.lcaron=300;e.Kcommaaccent=667;e.Lacute=556;e.trademark=980;e.edotaccent=444;e.Igrave=333;e.Imacron=333;e.Lcaron=611;e.onehalf=750;e.lessequal=549;e.ocircumflex=500;e.ntilde=500;e.Uhungarumlaut=722;e.Eacute=611;e.emacron=444;e.gbreve=500;e.onequarter=750;e.Scaron=500;e.Scommaaccent=500;e.Ohungarumlaut=722;e.degree=400;e.ograve=500;e.Ccaron=667;e.ugrave=500;e.radical=453;e.Dcaron=722;e.rcommaaccent=389;e.Ntilde=667;e.otilde=500;e.Rcommaaccent=611;e.Lcommaaccent=556;e.Atilde=611;e.Aogonek=611;e.Aring=611;e.Otilde=722;e.zdotaccent=389;e.Ecaron=611;e.Iogonek=333;e.kcommaaccent=444;e.minus=675;e.Icircumflex=333;e.ncaron=500;e.tcommaaccent=278;e.logicalnot=675;e.odieresis=500;e.udieresis=500;e.notequal=549;e.gcommaaccent=500;e.eth=500;e.zcaron=389;e.ncommaaccent=500;e.onesuperior=300;e.imacron=278;e.Euro=500}));e.ZapfDingbats=(0,r.getLookupTableFactory)((function(e){e.space=278;e.a1=974;e.a2=961;e.a202=974;e.a3=980;e.a4=719;e.a5=789;e.a119=790;e.a118=791;e.a117=690;e.a11=960;e.a12=939;e.a13=549;e.a14=855;e.a15=911;e.a16=933;e.a105=911;e.a17=945;e.a18=974;e.a19=755;e.a20=846;e.a21=762;e.a22=761;e.a23=571;e.a24=677;e.a25=763;e.a26=760;e.a27=759;e.a28=754;e.a6=494;e.a7=552;e.a8=537;e.a9=577;e.a10=692;e.a29=786;e.a30=788;e.a31=788;e.a32=790;e.a33=793;e.a34=794;e.a35=816;e.a36=823;e.a37=789;e.a38=841;e.a39=823;e.a40=833;e.a41=816;e.a42=831;e.a43=923;e.a44=744;e.a45=723;e.a46=749;e.a47=790;e.a48=792;e.a49=695;e.a50=776;e.a51=768;e.a52=792;e.a53=759;e.a54=707;e.a55=708;e.a56=682;e.a57=701;e.a58=826;e.a59=815;e.a60=789;e.a61=789;e.a62=707;e.a63=687;e.a64=696;e.a65=689;e.a66=786;e.a67=787;e.a68=713;e.a69=791;e.a70=785;e.a71=791;e.a72=873;e.a73=761;e.a74=762;e.a203=762;e.a75=759;e.a204=759;e.a76=892;e.a77=892;e.a78=788;e.a79=784;e.a81=438;e.a82=138;e.a83=277;e.a84=415;e.a97=392;e.a98=392;e.a99=668;e.a100=668;e.a89=390;e.a90=390;e.a93=317;e.a94=317;e.a91=276;e.a92=276;e.a205=509;e.a85=509;e.a206=410;e.a86=410;e.a87=234;e.a88=234;e.a95=334;e.a96=334;e.a101=732;e.a102=544;e.a103=544;e.a104=910;e.a106=667;e.a107=760;e.a108=760;e.a112=776;e.a111=595;e.a110=694;e.a109=626;e.a120=788;e.a121=788;e.a122=788;e.a123=788;e.a124=788;e.a125=788;e.a126=788;e.a127=788;e.a128=788;e.a129=788;e.a130=788;e.a131=788;e.a132=788;e.a133=788;e.a134=788;e.a135=788;e.a136=788;e.a137=788;e.a138=788;e.a139=788;e.a140=788;e.a141=788;e.a142=788;e.a143=788;e.a144=788;e.a145=788;e.a146=788;e.a147=788;e.a148=788;e.a149=788;e.a150=788;e.a151=788;e.a152=788;e.a153=788;e.a154=788;e.a155=788;e.a156=788;e.a157=788;e.a158=788;e.a159=788;e.a160=894;e.a161=838;e.a163=1016;e.a164=458;e.a196=748;e.a165=924;e.a192=748;e.a166=918;e.a167=927;e.a168=928;e.a169=928;e.a170=834;e.a171=873;e.a172=828;e.a173=924;e.a162=924;e.a174=917;e.a175=930;e.a176=931;e.a177=463;e.a178=883;e.a179=836;e.a193=836;e.a180=867;e.a199=867;e.a181=696;e.a200=696;e.a182=874;e.a201=874;e.a183=760;e.a184=946;e.a197=771;e.a185=865;e.a194=771;e.a198=888;e.a186=967;e.a195=888;e.a187=831;e.a188=873;e.a189=927;e.a190=970;e.a191=918}))}));t.getMetrics=n;const i=(0,r.getLookupTableFactory)((function(e){e.Courier={ascent:629,descent:-157,capHeight:562,xHeight:-426};e["Courier-Bold"]={ascent:629,descent:-157,capHeight:562,xHeight:439};e["Courier-Oblique"]={ascent:629,descent:-157,capHeight:562,xHeight:426};e["Courier-BoldOblique"]={ascent:629,descent:-157,capHeight:562,xHeight:426};e.Helvetica={ascent:718,descent:-207,capHeight:718,xHeight:523};e["Helvetica-Bold"]={ascent:718,descent:-207,capHeight:718,xHeight:532};e["Helvetica-Oblique"]={ascent:718,descent:-207,capHeight:718,xHeight:523};e["Helvetica-BoldOblique"]={ascent:718,descent:-207,capHeight:718,xHeight:532};e["Times-Roman"]={ascent:683,descent:-217,capHeight:662,xHeight:450};e["Times-Bold"]={ascent:683,descent:-217,capHeight:676,xHeight:461};e["Times-Italic"]={ascent:683,descent:-217,capHeight:653,xHeight:441};e["Times-BoldItalic"]={ascent:683,descent:-217,capHeight:669,xHeight:462};e.Symbol={ascent:Math.NaN,descent:Math.NaN,capHeight:Math.NaN,xHeight:Math.NaN};e.ZapfDingbats={ascent:Math.NaN,descent:Math.NaN,capHeight:Math.NaN,xHeight:Math.NaN}}));t.getFontBasicMetrics=i},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.GlyfTable=void 0;t.GlyfTable=class GlyfTable{constructor({glyfTable:e,isGlyphLocationsLong:t,locaTable:a,numGlyphs:r}){this.glyphs=[];const n=new DataView(a.buffer,a.byteOffset,a.byteLength),i=new DataView(e.buffer,e.byteOffset,e.byteLength),s=t?4:2;let o=t?n.getUint32(0):2*n.getUint16(0),c=0;for(let e=0;e<r;e++){c+=s;const e=t?n.getUint32(c):2*n.getUint16(c);if(e===o){this.glyphs.push(new Glyph({}));continue}const a=Glyph.parse(o,i);this.glyphs.push(a);o=e}}getSize(){return this.glyphs.reduce(((e,t)=>e+(t.getSize()+3&-4)),0)}write(){const e=this.getSize(),t=new DataView(new ArrayBuffer(e)),a=e>131070,r=a?4:2,n=new DataView(new ArrayBuffer((this.glyphs.length+1)*r));a?n.setUint32(0,0):n.setUint16(0,0);let i=0,s=0;for(const e of this.glyphs){i+=e.write(i,t);i=i+3&-4;s+=r;a?n.setUint32(s,i):n.setUint16(s,i>>1)}return{isLocationLong:a,loca:new Uint8Array(n.buffer),glyf:new Uint8Array(t.buffer)}}scale(e){for(let t=0,a=this.glyphs.length;t<a;t++)this.glyphs[t].scale(e[t])}};class Glyph{constructor({header:e=null,simple:t=null,composites:a=null}){this.header=e;this.simple=t;this.composites=a}static parse(e,t){const[a,r]=GlyphHeader.parse(e,t);e+=a;if(r.numberOfContours<0){const a=[];for(;;){const[r,n]=CompositeGlyph.parse(e,t);e+=r;a.push(n);if(!(32&n.flags))break}return new Glyph({header:r,composites:a})}const n=SimpleGlyph.parse(e,t,r.numberOfContours);return new Glyph({header:r,simple:n})}getSize(){if(!this.header)return 0;const e=this.simple?this.simple.getSize():this.composites.reduce(((e,t)=>e+t.getSize()),0);return this.header.getSize()+e}write(e,t){if(!this.header)return 0;const a=e;e+=this.header.write(e,t);if(this.simple)e+=this.simple.write(e,t);else for(const a of this.composites)e+=a.write(e,t);return e-a}scale(e){if(!this.header)return;const t=(this.header.xMin+this.header.xMax)/2;this.header.scale(t,e);if(this.simple)this.simple.scale(t,e);else for(const a of this.composites)a.scale(t,e)}}class GlyphHeader{constructor({numberOfContours:e,xMin:t,yMin:a,xMax:r,yMax:n}){this.numberOfContours=e;this.xMin=t;this.yMin=a;this.xMax=r;this.yMax=n}static parse(e,t){return[10,new GlyphHeader({numberOfContours:t.getInt16(e),xMin:t.getInt16(e+2),yMin:t.getInt16(e+4),xMax:t.getInt16(e+6),yMax:t.getInt16(e+8)})]}getSize(){return 10}write(e,t){t.setInt16(e,this.numberOfContours);t.setInt16(e+2,this.xMin);t.setInt16(e+4,this.yMin);t.setInt16(e+6,this.xMax);t.setInt16(e+8,this.yMax);return 10}scale(e,t){this.xMin=Math.round(e+(this.xMin-e)*t);this.xMax=Math.round(e+(this.xMax-e)*t)}}class Contour{constructor({flags:e,xCoordinates:t,yCoordinates:a}){this.xCoordinates=t;this.yCoordinates=a;this.flags=e}}class SimpleGlyph{constructor({contours:e,instructions:t}){this.contours=e;this.instructions=t}static parse(e,t,a){const r=[];for(let n=0;n<a;n++){const a=t.getUint16(e);e+=2;r.push(a)}const n=r[a-1]+1,i=t.getUint16(e);e+=2;const s=new Uint8Array(t).slice(e,e+i);e+=i;const o=[];for(let a=0;a<n;e++,a++){let r=t.getUint8(e);o.push(r);if(8&r){const n=t.getUint8(++e);r^=8;for(let e=0;e<n;e++)o.push(r);a+=n}}const c=[];let l=[],h=[],u=[];const d=[];let f=0,g=0;for(let a=0;a<n;a++){const n=o[a];if(2&n){const a=t.getUint8(e++);g+=16&n?a:-a;l.push(g)}else if(16&n)l.push(g);else{g+=t.getInt16(e);e+=2;l.push(g)}if(r[f]===a){f++;c.push(l);l=[]}}g=0;f=0;for(let a=0;a<n;a++){const n=o[a];if(4&n){const a=t.getUint8(e++);g+=32&n?a:-a;h.push(g)}else if(32&n)h.push(g);else{g+=t.getInt16(e);e+=2;h.push(g)}u.push(1&n|64&n);if(r[f]===a){l=c[f];f++;d.push(new Contour({flags:u,xCoordinates:l,yCoordinates:h}));h=[];u=[]}}return new SimpleGlyph({contours:d,instructions:s})}getSize(){let e=2*this.contours.length+2+this.instructions.length,t=0,a=0;for(const r of this.contours){e+=r.flags.length;for(let n=0,i=r.xCoordinates.length;n<i;n++){const i=r.xCoordinates[n],s=r.yCoordinates[n];let o=Math.abs(i-t);o>255?e+=2:o>0&&(e+=1);t=i;o=Math.abs(s-a);o>255?e+=2:o>0&&(e+=1);a=s}}return e}write(e,t){const a=e,r=[],n=[],i=[];let s=0,o=0;for(const a of this.contours){for(let e=0,t=a.xCoordinates.length;e<t;e++){let t=a.flags[e];const c=a.xCoordinates[e];let l=c-s;if(0===l){t|=16;r.push(0)}else{const e=Math.abs(l);if(e<=255){t|=l>=0?18:2;r.push(e)}else r.push(l)}s=c;const h=a.yCoordinates[e];l=h-o;if(0===l){t|=32;n.push(0)}else{const e=Math.abs(l);if(e<=255){t|=l>=0?36:4;n.push(e)}else n.push(l)}o=h;i.push(t)}t.setUint16(e,r.length-1);e+=2}t.setUint16(e,this.instructions.length);e+=2;if(this.instructions.length){new Uint8Array(t.buffer,0,t.buffer.byteLength).set(this.instructions,e);e+=this.instructions.length}for(const a of i)t.setUint8(e++,a);for(let a=0,n=r.length;a<n;a++){const n=r[a],s=i[a];if(2&s)t.setUint8(e++,n);else if(!(16&s)){t.setInt16(e,n);e+=2}}for(let a=0,r=n.length;a<r;a++){const r=n[a],s=i[a];if(4&s)t.setUint8(e++,r);else if(!(32&s)){t.setInt16(e,r);e+=2}}return e-a}scale(e,t){for(const a of this.contours)if(0!==a.xCoordinates.length)for(let r=0,n=a.xCoordinates.length;r<n;r++)a.xCoordinates[r]=Math.round(e+(a.xCoordinates[r]-e)*t)}}class CompositeGlyph{constructor({flags:e,glyphIndex:t,argument1:a,argument2:r,transf:n,instructions:i}){this.flags=e;this.glyphIndex=t;this.argument1=a;this.argument2=r;this.transf=n;this.instructions=i}static parse(e,t){const a=e,r=[];let n=t.getUint16(e);const i=t.getUint16(e+2);e+=4;let s,o;if(1&n){if(2&n){s=t.getInt16(e);o=t.getInt16(e+2)}else{s=t.getUint16(e);o=t.getUint16(e+2)}e+=4;n^=1}else{if(2&n){s=t.getInt8(e);o=t.getInt8(e+1)}else{s=t.getUint8(e);o=t.getUint8(e+1)}e+=2}if(8&n){r.push(t.getUint16(e));e+=2}else if(64&n){r.push(t.getUint16(e),t.getUint16(e+2));e+=4}else if(128&n){r.push(t.getUint16(e),t.getUint16(e+2),t.getUint16(e+4),t.getUint16(e+6));e+=8}let c=null;if(256&n){const a=t.getUint16(e);e+=2;c=new Uint8Array(t).slice(e,e+a);e+=a}return[e-a,new CompositeGlyph({flags:n,glyphIndex:i,argument1:s,argument2:o,transf:r,instructions:c})]}getSize(){let e=4+2*this.transf.length;256&this.flags&&(e+=2+this.instructions.length);e+=2;2&this.flags?this.argument1>=-128&&this.argument1<=127&&this.argument2>=-128&&this.argument2<=127||(e+=2):this.argument1>=0&&this.argument1<=255&&this.argument2>=0&&this.argument2<=255||(e+=2);return e}write(e,t){const a=e;2&this.flags?this.argument1>=-128&&this.argument1<=127&&this.argument2>=-128&&this.argument2<=127||(this.flags|=1):this.argument1>=0&&this.argument1<=255&&this.argument2>=0&&this.argument2<=255||(this.flags|=1);t.setUint16(e,this.flags);t.setUint16(e+2,this.glyphIndex);e+=4;if(1&this.flags){if(2&this.flags){t.setInt16(e,this.argument1);t.setInt16(e+2,this.argument2)}else{t.setUint16(e,this.argument1);t.setUint16(e+2,this.argument2)}e+=4}else{t.setUint8(e,this.argument1);t.setUint8(e+1,this.argument2);e+=2}if(256&this.flags){t.setUint16(e,this.instructions.length);e+=2;if(this.instructions.length){new Uint8Array(t.buffer,0,t.buffer.byteLength).set(this.instructions,e);e+=this.instructions.length}}return e-a}scale(e,t){}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.OpenTypeFileBuilder=void 0;var r=a(3),n=a(2);function writeInt16(e,t,a){e[t]=a>>8&255;e[t+1]=255&a}function writeInt32(e,t,a){e[t]=a>>24&255;e[t+1]=a>>16&255;e[t+2]=a>>8&255;e[t+3]=255&a}function writeData(e,t,a){if(a instanceof Uint8Array)e.set(a,t);else if("string"==typeof a)for(let r=0,n=a.length;r<n;r++)e[t++]=255&a.charCodeAt(r);else for(const r of a)e[t++]=255&r}class OpenTypeFileBuilder{constructor(e){this.sfnt=e;this.tables=Object.create(null)}static getSearchParams(e,t){let a=1,r=0;for(;(a^e)>a;){a<<=1;r++}const n=a*t;return{range:n,entry:r,rangeShift:t*e-n}}toArray(){let e=this.sfnt;const t=this.tables,a=Object.keys(t);a.sort();const i=a.length;let s,o,c,l,h,u=12+16*i;const d=[u];for(s=0;s<i;s++){l=t[a[s]];u+=(l.length+3&-4)>>>0;d.push(u)}const f=new Uint8Array(u);for(s=0;s<i;s++){l=t[a[s]];writeData(f,d[s],l)}"true"===e&&(e=(0,n.string32)(65536));f[0]=255&e.charCodeAt(0);f[1]=255&e.charCodeAt(1);f[2]=255&e.charCodeAt(2);f[3]=255&e.charCodeAt(3);writeInt16(f,4,i);const g=OpenTypeFileBuilder.getSearchParams(i,16);writeInt16(f,6,g.range);writeInt16(f,8,g.entry);writeInt16(f,10,g.rangeShift);u=12;for(s=0;s<i;s++){h=a[s];f[u]=255&h.charCodeAt(0);f[u+1]=255&h.charCodeAt(1);f[u+2]=255&h.charCodeAt(2);f[u+3]=255&h.charCodeAt(3);let e=0;for(o=d[s],c=d[s+1];o<c;o+=4){e=e+(0,r.readUint32)(f,o)>>>0}writeInt32(f,u+4,e);writeInt32(f,u+8,d[s]);writeInt32(f,u+12,t[h].length);u+=16}return f}addTable(e,t){if(e in this.tables)throw new Error("Table "+e+" already exists");this.tables[e]=t}}t.OpenTypeFileBuilder=OpenTypeFileBuilder},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.Type1Font=void 0;var r=a(33),n=a(2),i=a(36),s=a(3),o=a(8),c=a(47);function findBlock(e,t,a){const r=e.length,n=t.length,i=r-n;let o=a,c=!1;for(;o<i;){let a=0;for(;a<n&&e[o+a]===t[a];)a++;if(a>=n){o+=a;for(;o<r&&(0,s.isWhiteSpace)(e[o]);)o++;c=!0;break}o++}return{found:c,length:o}}t.Type1Font=class Type1Font{constructor(e,t,a){let r=a.length1,s=a.length2,l=t.peekBytes(6);const h=128===l[0]&&1===l[1];if(h){t.skip(6);r=l[5]<<24|l[4]<<16|l[3]<<8|l[2]}const u=function getHeaderBlock(e,t){const a=[101,101,120,101,99],r=e.pos;let i,s,c,l;try{i=e.getBytes(t);s=i.length}catch(e){}if(s===t){c=findBlock(i,a,t-2*a.length);if(c.found&&c.length===t)return{stream:new o.Stream(i),length:t}}(0,n.warn)('Invalid "Length1" property in Type1 font -- trying to recover.');e.pos=r;for(;;){c=findBlock(e.peekBytes(2048),a,0);if(0===c.length)break;e.pos+=c.length;if(c.found){l=e.pos-r;break}}e.pos=r;if(l)return{stream:new o.Stream(e.getBytes(l)),length:l};(0,n.warn)('Unable to recover "Length1" property in Type1 font -- using as is.');return{stream:new o.Stream(e.getBytes(t)),length:t}}(t,r);new c.Type1Parser(u.stream,!1,i.SEAC_ANALYSIS_ENABLED).extractFontHeader(a);if(h){l=t.getBytes(6);s=l[5]<<24|l[4]<<16|l[3]<<8|l[2]}const d=function getEexecBlock(e,t){const a=e.getBytes();if(0===a.length)throw new n.FormatError("getEexecBlock - no font program found.");return{stream:new o.Stream(a),length:a.length}}(t),f=new c.Type1Parser(d.stream,!0,i.SEAC_ANALYSIS_ENABLED).extractFontProgram(a);for(const e in f.properties)a[e]=f.properties[e];const g=f.charstrings,p=this.getType2Charstrings(g),m=this.getType2Subrs(f.subrs);this.charstrings=g;this.data=this.wrap(e,p,this.charstrings,m,a);this.seacs=this.getSeacs(f.charstrings)}get numGlyphs(){return this.charstrings.length+1}getCharset(){const e=[".notdef"];for(const{glyphName:t}of this.charstrings)e.push(t);return e}getGlyphMapping(e){const t=this.charstrings;if(e.composite){const a=Object.create(null);for(let r=0,n=t.length;r<n;r++){a[e.cMap.charCodeOf(r)]=r+1}return a}const a=[".notdef"];let r,n;for(n=0;n<t.length;n++)a.push(t[n].glyphName);const s=e.builtInEncoding;if(s){r=Object.create(null);for(const e in s){n=a.indexOf(s[e]);n>=0&&(r[e]=n)}}return(0,i.type1FontGlyphMapping)(e,r,a)}hasGlyphId(e){if(e<0||e>=this.numGlyphs)return!1;if(0===e)return!0;return this.charstrings[e-1].charstring.length>0}getSeacs(e){const t=[];for(let a=0,r=e.length;a<r;a++){const r=e[a];r.seac&&(t[a+1]=r.seac)}return t}getType2Charstrings(e){const t=[];for(const a of e)t.push(a.charstring);return t}getType2Subrs(e){let t=0;const a=e.length;t=a<1133?107:a<33769?1131:32768;const r=[];let n;for(n=0;n<t;n++)r.push([11]);for(n=0;n<a;n++)r.push(e[n]);return r}wrap(e,t,a,n,i){const s=new r.CFF;s.header=new r.CFFHeader(1,0,4,4);s.names=[e];const o=new r.CFFTopDict;o.setByName("version",391);o.setByName("Notice",392);o.setByName("FullName",393);o.setByName("FamilyName",394);o.setByName("Weight",395);o.setByName("Encoding",null);o.setByName("FontMatrix",i.fontMatrix);o.setByName("FontBBox",i.bbox);o.setByName("charset",null);o.setByName("CharStrings",null);o.setByName("Private",null);s.topDict=o;const c=new r.CFFStrings;c.add("Version 0.11");c.add("See original notice");c.add(e);c.add(e);c.add("Medium");s.strings=c;s.globalSubrIndex=new r.CFFIndex;const l=t.length,h=[".notdef"];let u,d;for(u=0;u<l;u++){const e=a[u].glyphName;-1===r.CFFStandardStrings.indexOf(e)&&c.add(e);h.push(e)}s.charset=new r.CFFCharset(!1,0,h);const f=new r.CFFIndex;f.add([139,14]);for(u=0;u<l;u++)f.add(t[u]);s.charStrings=f;const g=new r.CFFPrivateDict;g.setByName("Subrs",null);const p=["BlueValues","OtherBlues","FamilyBlues","FamilyOtherBlues","StemSnapH","StemSnapV","BlueShift","BlueFuzz","BlueScale","LanguageGroup","ExpansionFactor","ForceBold","StdHW","StdVW"];for(u=0,d=p.length;u<d;u++){const e=p[u];if(!(e in i.privateData))continue;const t=i.privateData[e];if(Array.isArray(t))for(let e=t.length-1;e>0;e--)t[e]-=t[e-1];g.setByName(e,t)}s.topDict.privateDict=g;const m=new r.CFFIndex;for(u=0,d=n.length;u<d;u++)m.add(n[u]);g.subrsIndex=m;return new r.CFFCompiler(s).compile()}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.Type1Parser=void 0;var r=a(35),n=a(3),i=a(8),s=a(2);const o=[4],c=[5],l=[6],h=[7],u=[8],d=[12,35],f=[14],g=[21],p=[22],m=[30],b=[31];class Type1CharString{constructor(){this.width=0;this.lsb=0;this.flexing=!1;this.output=[];this.stack=[]}convert(e,t,a){const r=e.length;let n,i,y,w=!1;for(let S=0;S<r;S++){let r=e[S];if(r<32){12===r&&(r=(r<<8)+e[++S]);switch(r){case 1:case 3:case 9:case 3072:case 3073:case 3074:case 3105:this.stack=[];break;case 4:if(this.flexing){if(this.stack.length<1){w=!0;break}const e=this.stack.pop();this.stack.push(0,e);break}w=this.executeCommand(1,o);break;case 5:w=this.executeCommand(2,c);break;case 6:w=this.executeCommand(1,l);break;case 7:w=this.executeCommand(1,h);break;case 8:w=this.executeCommand(6,u);break;case 10:if(this.stack.length<1){w=!0;break}y=this.stack.pop();if(!t[y]){w=!0;break}w=this.convert(t[y],t,a);break;case 11:return w;case 13:if(this.stack.length<2){w=!0;break}n=this.stack.pop();i=this.stack.pop();this.lsb=i;this.width=n;this.stack.push(n,i);w=this.executeCommand(2,p);break;case 14:this.output.push(f[0]);break;case 21:if(this.flexing)break;w=this.executeCommand(2,g);break;case 22:if(this.flexing){this.stack.push(0);break}w=this.executeCommand(1,p);break;case 30:w=this.executeCommand(4,m);break;case 31:w=this.executeCommand(4,b);break;case 3078:if(a){const e=this.stack.at(-5);this.seac=this.stack.splice(-4,4);this.seac[0]+=this.lsb-e;w=this.executeCommand(0,f)}else w=this.executeCommand(4,f);break;case 3079:if(this.stack.length<4){w=!0;break}this.stack.pop();n=this.stack.pop();const e=this.stack.pop();i=this.stack.pop();this.lsb=i;this.width=n;this.stack.push(n,i,e);w=this.executeCommand(3,g);break;case 3084:if(this.stack.length<2){w=!0;break}const S=this.stack.pop(),x=this.stack.pop();this.stack.push(x/S);break;case 3088:if(this.stack.length<2){w=!0;break}y=this.stack.pop();const C=this.stack.pop();if(0===y&&3===C){const e=this.stack.splice(this.stack.length-17,17);this.stack.push(e[2]+e[0],e[3]+e[1],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14]);w=this.executeCommand(13,d,!0);this.flexing=!1;this.stack.push(e[15],e[16])}else 1===y&&0===C&&(this.flexing=!0);break;case 3089:break;default:(0,s.warn)('Unknown type 1 charstring command of "'+r+'"')}if(w)break}else{r<=246?r-=139:r=r<=250?256*(r-247)+e[++S]+108:r<=254?-256*(r-251)-e[++S]-108:(255&e[++S])<<24|(255&e[++S])<<16|(255&e[++S])<<8|(255&e[++S])<<0;this.stack.push(r)}}return w}executeCommand(e,t,a){const r=this.stack.length;if(e>r)return!0;const n=r-e;for(let e=n;e<r;e++){let t=this.stack[e];if(Number.isInteger(t))this.output.push(28,t>>8&255,255&t);else{t=65536*t|0;this.output.push(255,t>>24&255,t>>16&255,t>>8&255,255&t)}}this.output.push(...t);a?this.stack.splice(n,e):this.stack.length=0;return!1}}function isHexDigit(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function decrypt(e,t,a){if(a>=e.length)return new Uint8Array(0);let r,n,i=0|t;for(r=0;r<a;r++)i=52845*(e[r]+i)+22719&65535;const s=e.length-a,o=new Uint8Array(s);for(r=a,n=0;n<s;r++,n++){const t=e[r];o[n]=t^i>>8;i=52845*(t+i)+22719&65535}return o}function isSpecial(e){return 47===e||91===e||93===e||123===e||125===e||40===e||41===e}t.Type1Parser=class Type1Parser{constructor(e,t,a){if(t){const t=e.getBytes(),a=!((isHexDigit(t[0])||(0,n.isWhiteSpace)(t[0]))&&isHexDigit(t[1])&&isHexDigit(t[2])&&isHexDigit(t[3])&&isHexDigit(t[4])&&isHexDigit(t[5])&&isHexDigit(t[6])&&isHexDigit(t[7]));e=new i.Stream(a?decrypt(t,55665,4):function decryptAscii(e,t,a){let r=0|t;const n=e.length,i=new Uint8Array(n>>>1);let s,o;for(s=0,o=0;s<n;s++){const t=e[s];if(!isHexDigit(t))continue;s++;let a;for(;s<n&&!isHexDigit(a=e[s]);)s++;if(s<n){const e=parseInt(String.fromCharCode(t,a),16);i[o++]=e^r>>8;r=52845*(e+r)+22719&65535}}return i.slice(a,o)}(t,55665,4))}this.seacAnalysisEnabled=!!a;this.stream=e;this.nextChar()}readNumberArray(){this.getToken();const e=[];for(;;){const t=this.getToken();if(null===t||"]"===t||"}"===t)break;e.push(parseFloat(t||0))}return e}readNumber(){const e=this.getToken();return parseFloat(e||0)}readInt(){const e=this.getToken();return 0|parseInt(e||0,10)}readBoolean(){return"true"===this.getToken()?1:0}nextChar(){return this.currentChar=this.stream.getByte()}prevChar(){this.stream.skip(-2);return this.currentChar=this.stream.getByte()}getToken(){let e=!1,t=this.currentChar;for(;;){if(-1===t)return null;if(e)10!==t&&13!==t||(e=!1);else if(37===t)e=!0;else if(!(0,n.isWhiteSpace)(t))break;t=this.nextChar()}if(isSpecial(t)){this.nextChar();return String.fromCharCode(t)}let a="";do{a+=String.fromCharCode(t);t=this.nextChar()}while(t>=0&&!(0,n.isWhiteSpace)(t)&&!isSpecial(t));return a}readCharStrings(e,t){return-1===t?e:decrypt(e,4330,t)}extractFontProgram(e){const t=this.stream,a=[],r=[],n=Object.create(null);n.lenIV=4;const i={subrs:[],charstrings:[],properties:{privateData:n}};let s,o,c,l;for(;null!==(s=this.getToken());)if("/"===s){s=this.getToken();switch(s){case"CharStrings":this.getToken();this.getToken();this.getToken();this.getToken();for(;;){s=this.getToken();if(null===s||"end"===s)break;if("/"!==s)continue;const e=this.getToken();o=this.readInt();this.getToken();c=o>0?t.getBytes(o):new Uint8Array(0);l=i.properties.privateData.lenIV;const a=this.readCharStrings(c,l);this.nextChar();s=this.getToken();"noaccess"===s?this.getToken():"/"===s&&this.prevChar();r.push({glyph:e,encoded:a})}break;case"Subrs":this.readInt();this.getToken();for(;"dup"===this.getToken();){const e=this.readInt();o=this.readInt();this.getToken();c=o>0?t.getBytes(o):new Uint8Array(0);l=i.properties.privateData.lenIV;const r=this.readCharStrings(c,l);this.nextChar();s=this.getToken();"noaccess"===s&&this.getToken();a[e]=r}break;case"BlueValues":case"OtherBlues":case"FamilyBlues":case"FamilyOtherBlues":const e=this.readNumberArray();e.length>0&&e.length,0;break;case"StemSnapH":case"StemSnapV":i.properties.privateData[s]=this.readNumberArray();break;case"StdHW":case"StdVW":i.properties.privateData[s]=this.readNumberArray()[0];break;case"BlueShift":case"lenIV":case"BlueFuzz":case"BlueScale":case"LanguageGroup":i.properties.privateData[s]=this.readNumber();break;case"ExpansionFactor":i.properties.privateData[s]=this.readNumber()||.06;break;case"ForceBold":i.properties.privateData[s]=this.readBoolean()}}for(const{encoded:t,glyph:n}of r){const r=new Type1CharString,s=r.convert(t,a,this.seacAnalysisEnabled);let o=r.output;s&&(o=[14]);const c={glyphName:n,charstring:o,width:r.width,lsb:r.lsb,seac:r.seac};".notdef"===n?i.charstrings.unshift(c):i.charstrings.push(c);if(e.builtInEncoding){const t=e.builtInEncoding.indexOf(n);t>-1&&void 0===e.widths[t]&&t>=e.firstChar&&t<=e.lastChar&&(e.widths[t]=r.width)}}return i}extractFontHeader(e){let t;for(;null!==(t=this.getToken());)if("/"===t){t=this.getToken();switch(t){case"FontMatrix":const a=this.readNumberArray();e.fontMatrix=a;break;case"Encoding":const n=this.getToken();let i;if(/^\d+$/.test(n)){i=[];const e=0|parseInt(n,10);this.getToken();for(let a=0;a<e;a++){t=this.getToken();for(;"dup"!==t&&"def"!==t;){t=this.getToken();if(null===t)return}if("def"===t)break;const e=this.readInt();this.getToken();const a=this.getToken();i[e]=a;this.getToken()}}else i=(0,r.getEncoding)(n);e.builtInEncoding=i;break;case"FontBBox":const s=this.readNumberArray();e.ascent=Math.max(s[3],s[1]);e.descent=Math.min(s[1],s[3]);e.ascentScaled=!0}}}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.Pattern=void 0;t.getTilingPatternIR=function getTilingPatternIR(e,t,a){const n=t.getArray("Matrix"),i=r.Util.normalizeRect(t.getArray("BBox")),s=t.get("XStep"),o=t.get("YStep"),c=t.get("PaintType"),l=t.get("TilingType");if(i[2]-i[0]==0||i[3]-i[1]==0)throw new r.FormatError(`Invalid getTilingPatternIR /BBox array: [${i}].`);return["TilingPattern",a,e,n,i,s,o,c,l]};var r=a(2),n=a(5),i=a(12),s=a(3);const o=2,c=3,l=4,h=5,u=6,d=7;t.Pattern=class Pattern{constructor(){(0,r.unreachable)("Cannot initialize Pattern.")}static parseShading(e,t,a,i,f,g){const p=e instanceof n.BaseStream?e.dict:e,m=p.get("ShadingType");try{switch(m){case o:case c:return new RadialAxialShading(p,t,a,f,g);case l:case h:case u:case d:return new MeshShading(e,t,a,f,g);default:throw new r.FormatError("Unsupported ShadingType: "+m)}}catch(e){if(e instanceof s.MissingDataException)throw e;i.send("UnsupportedFeature",{featureId:r.UNSUPPORTED_FEATURES.shadingPattern});(0,r.warn)(e);return new DummyShading}}};class BaseShading{static get SMALL_NUMBER(){return(0,r.shadow)(this,"SMALL_NUMBER",1e-6)}constructor(){this.constructor===BaseShading&&(0,r.unreachable)("Cannot initialize BaseShading.")}getIR(){(0,r.unreachable)("Abstract method `getIR` called.")}}class RadialAxialShading extends BaseShading{constructor(e,t,a,n,s){super();this.coordsArr=e.getArray("Coords");this.shadingType=e.get("ShadingType");const o=i.ColorSpace.parse({cs:e.getRaw("CS")||e.getRaw("ColorSpace"),xref:t,resources:a,pdfFunctionFactory:n,localColorSpaceCache:s}),l=e.getArray("BBox");Array.isArray(l)&&4===l.length?this.bbox=r.Util.normalizeRect(l):this.bbox=null;let h=0,u=1;if(e.has("Domain")){const t=e.getArray("Domain");h=t[0];u=t[1]}let d=!1,f=!1;if(e.has("Extend")){const t=e.getArray("Extend");d=t[0];f=t[1]}if(!(this.shadingType!==c||d&&f)){const[e,t,a,n,i,s]=this.coordsArr,o=Math.hypot(e-n,t-i);a<=s+o&&s<=a+o&&(0,r.warn)("Unsupported radial gradient.")}this.extendStart=d;this.extendEnd=f;const g=e.getRaw("Function"),p=n.createFromArray(g),m=(u-h)/10,b=this.colorStops=[];if(h>=u||m<=0){(0,r.info)("Bad shading domain.");return}const y=new Float32Array(o.numComps),w=new Float32Array(1);let S;for(let e=0;e<=10;e++){w[0]=h+e*m;p(w,0,y,0);S=o.getRgb(y,0);const t=r.Util.makeHexColor(S[0],S[1],S[2]);b.push([e/10,t])}let x="transparent";if(e.has("Background")){S=o.getRgb(e.get("Background"),0);x=r.Util.makeHexColor(S[0],S[1],S[2])}if(!d){b.unshift([0,x]);b[1][0]+=BaseShading.SMALL_NUMBER}if(!f){b.at(-1)[0]-=BaseShading.SMALL_NUMBER;b.push([1,x])}this.colorStops=b}getIR(){const e=this.coordsArr,t=this.shadingType;let a,n,i,s,l;if(t===o){n=[e[0],e[1]];i=[e[2],e[3]];s=null;l=null;a="axial"}else if(t===c){n=[e[0],e[1]];i=[e[3],e[4]];s=e[2];l=e[5];a="radial"}else(0,r.unreachable)(`getPattern type unknown: ${t}`);return["RadialAxial",a,this.bbox,this.colorStops,n,i,s,l]}}class MeshStreamReader{constructor(e,t){this.stream=e;this.context=t;this.buffer=0;this.bufferLength=0;const a=t.numComps;this.tmpCompsBuf=new Float32Array(a);const r=t.colorSpace.numComps;this.tmpCsCompsBuf=t.colorFn?new Float32Array(r):this.tmpCompsBuf}get hasData(){if(this.stream.end)return this.stream.pos<this.stream.end;if(this.bufferLength>0)return!0;const e=this.stream.getByte();if(e<0)return!1;this.buffer=e;this.bufferLength=8;return!0}readBits(e){let t=this.buffer,a=this.bufferLength;if(32===e){if(0===a)return(this.stream.getByte()<<24|this.stream.getByte()<<16|this.stream.getByte()<<8|this.stream.getByte())>>>0;t=t<<24|this.stream.getByte()<<16|this.stream.getByte()<<8|this.stream.getByte();const e=this.stream.getByte();this.buffer=e&(1<<a)-1;return(t<<8-a|(255&e)>>a)>>>0}if(8===e&&0===a)return this.stream.getByte();for(;a<e;){t=t<<8|this.stream.getByte();a+=8}a-=e;this.bufferLength=a;this.buffer=t&(1<<a)-1;return t>>a}align(){this.buffer=0;this.bufferLength=0}readFlag(){return this.readBits(this.context.bitsPerFlag)}readCoordinate(){const e=this.context.bitsPerCoordinate,t=this.readBits(e),a=this.readBits(e),r=this.context.decode,n=e<32?1/((1<<e)-1):2.3283064365386963e-10;return[t*n*(r[1]-r[0])+r[0],a*n*(r[3]-r[2])+r[2]]}readComponents(){const e=this.context.numComps,t=this.context.bitsPerComponent,a=t<32?1/((1<<t)-1):2.3283064365386963e-10,r=this.context.decode,n=this.tmpCompsBuf;for(let i=0,s=4;i<e;i++,s+=2){const e=this.readBits(t);n[i]=e*a*(r[s+1]-r[s])+r[s]}const i=this.tmpCsCompsBuf;this.context.colorFn&&this.context.colorFn(n,0,i,0);return this.context.colorSpace.getRgb(i,0)}}const f=function getBClosure(){const e=[];return function(t){e[t]||(e[t]=function buildB(e){const t=[];for(let a=0;a<=e;a++){const r=a/e,n=1-r;t.push(new Float32Array([n*n*n,3*r*n*n,3*r*r*n,r*r*r]))}return t}(t));return e[t]}}();class MeshShading extends BaseShading{static get MIN_SPLIT_PATCH_CHUNKS_AMOUNT(){return(0,r.shadow)(this,"MIN_SPLIT_PATCH_CHUNKS_AMOUNT",3)}static get MAX_SPLIT_PATCH_CHUNKS_AMOUNT(){return(0,r.shadow)(this,"MAX_SPLIT_PATCH_CHUNKS_AMOUNT",20)}static get TRIANGLE_DENSITY(){return(0,r.shadow)(this,"TRIANGLE_DENSITY",20)}constructor(e,t,a,s,o){super();if(!(e instanceof n.BaseStream))throw new r.FormatError("Mesh data is not a stream");const c=e.dict;this.shadingType=c.get("ShadingType");const f=c.getArray("BBox");Array.isArray(f)&&4===f.length?this.bbox=r.Util.normalizeRect(f):this.bbox=null;const g=i.ColorSpace.parse({cs:c.getRaw("CS")||c.getRaw("ColorSpace"),xref:t,resources:a,pdfFunctionFactory:s,localColorSpaceCache:o});this.background=c.has("Background")?g.getRgb(c.get("Background"),0):null;const p=c.getRaw("Function"),m=p?s.createFromArray(p):null;this.coords=[];this.colors=[];this.figures=[];const b={bitsPerCoordinate:c.get("BitsPerCoordinate"),bitsPerComponent:c.get("BitsPerComponent"),bitsPerFlag:c.get("BitsPerFlag"),decode:c.getArray("Decode"),colorFn:m,colorSpace:g,numComps:m?1:g.numComps},y=new MeshStreamReader(e,b);let w=!1;switch(this.shadingType){case l:this._decodeType4Shading(y);break;case h:const e=0|c.get("VerticesPerRow");if(e<2)throw new r.FormatError("Invalid VerticesPerRow");this._decodeType5Shading(y,e);break;case u:this._decodeType6Shading(y);w=!0;break;case d:this._decodeType7Shading(y);w=!0;break;default:(0,r.unreachable)("Unsupported mesh type.")}if(w){this._updateBounds();for(let e=0,t=this.figures.length;e<t;e++)this._buildFigureFromPatch(e)}this._updateBounds();this._packData()}_decodeType4Shading(e){const t=this.coords,a=this.colors,n=[],i=[];let s=0;for(;e.hasData;){const o=e.readFlag(),c=e.readCoordinate(),l=e.readComponents();if(0===s){if(!(0<=o&&o<=2))throw new r.FormatError("Unknown type4 flag");switch(o){case 0:s=3;break;case 1:i.push(i.at(-2),i.at(-1));s=1;break;case 2:i.push(i.at(-3),i.at(-1));s=1}n.push(o)}i.push(t.length);t.push(c);a.push(l);s--;e.align()}this.figures.push({type:"triangles",coords:new Int32Array(i),colors:new Int32Array(i)})}_decodeType5Shading(e,t){const a=this.coords,r=this.colors,n=[];for(;e.hasData;){const t=e.readCoordinate(),i=e.readComponents();n.push(a.length);a.push(t);r.push(i)}this.figures.push({type:"lattice",coords:new Int32Array(n),colors:new Int32Array(n),verticesPerRow:t})}_decodeType6Shading(e){const t=this.coords,a=this.colors,n=new Int32Array(16),i=new Int32Array(4);for(;e.hasData;){const s=e.readFlag();if(!(0<=s&&s<=3))throw new r.FormatError("Unknown type6 flag");const o=t.length;for(let a=0,r=0!==s?8:12;a<r;a++)t.push(e.readCoordinate());const c=a.length;for(let t=0,r=0!==s?2:4;t<r;t++)a.push(e.readComponents());let l,h,u,d;switch(s){case 0:n[12]=o+3;n[13]=o+4;n[14]=o+5;n[15]=o+6;n[8]=o+2;n[11]=o+7;n[4]=o+1;n[7]=o+8;n[0]=o;n[1]=o+11;n[2]=o+10;n[3]=o+9;i[2]=c+1;i[3]=c+2;i[0]=c;i[1]=c+3;break;case 1:l=n[12];h=n[13];u=n[14];d=n[15];n[12]=d;n[13]=o+0;n[14]=o+1;n[15]=o+2;n[8]=u;n[11]=o+3;n[4]=h;n[7]=o+4;n[0]=l;n[1]=o+7;n[2]=o+6;n[3]=o+5;l=i[2];h=i[3];i[2]=h;i[3]=c;i[0]=l;i[1]=c+1;break;case 2:l=n[15];h=n[11];n[12]=n[3];n[13]=o+0;n[14]=o+1;n[15]=o+2;n[8]=n[7];n[11]=o+3;n[4]=h;n[7]=o+4;n[0]=l;n[1]=o+7;n[2]=o+6;n[3]=o+5;l=i[3];i[2]=i[1];i[3]=c;i[0]=l;i[1]=c+1;break;case 3:n[12]=n[0];n[13]=o+0;n[14]=o+1;n[15]=o+2;n[8]=n[1];n[11]=o+3;n[4]=n[2];n[7]=o+4;n[0]=n[3];n[1]=o+7;n[2]=o+6;n[3]=o+5;i[2]=i[0];i[3]=c;i[0]=i[1];i[1]=c+1}n[5]=t.length;t.push([(-4*t[n[0]][0]-t[n[15]][0]+6*(t[n[4]][0]+t[n[1]][0])-2*(t[n[12]][0]+t[n[3]][0])+3*(t[n[13]][0]+t[n[7]][0]))/9,(-4*t[n[0]][1]-t[n[15]][1]+6*(t[n[4]][1]+t[n[1]][1])-2*(t[n[12]][1]+t[n[3]][1])+3*(t[n[13]][1]+t[n[7]][1]))/9]);n[6]=t.length;t.push([(-4*t[n[3]][0]-t[n[12]][0]+6*(t[n[2]][0]+t[n[7]][0])-2*(t[n[0]][0]+t[n[15]][0])+3*(t[n[4]][0]+t[n[14]][0]))/9,(-4*t[n[3]][1]-t[n[12]][1]+6*(t[n[2]][1]+t[n[7]][1])-2*(t[n[0]][1]+t[n[15]][1])+3*(t[n[4]][1]+t[n[14]][1]))/9]);n[9]=t.length;t.push([(-4*t[n[12]][0]-t[n[3]][0]+6*(t[n[8]][0]+t[n[13]][0])-2*(t[n[0]][0]+t[n[15]][0])+3*(t[n[11]][0]+t[n[1]][0]))/9,(-4*t[n[12]][1]-t[n[3]][1]+6*(t[n[8]][1]+t[n[13]][1])-2*(t[n[0]][1]+t[n[15]][1])+3*(t[n[11]][1]+t[n[1]][1]))/9]);n[10]=t.length;t.push([(-4*t[n[15]][0]-t[n[0]][0]+6*(t[n[11]][0]+t[n[14]][0])-2*(t[n[12]][0]+t[n[3]][0])+3*(t[n[2]][0]+t[n[8]][0]))/9,(-4*t[n[15]][1]-t[n[0]][1]+6*(t[n[11]][1]+t[n[14]][1])-2*(t[n[12]][1]+t[n[3]][1])+3*(t[n[2]][1]+t[n[8]][1]))/9]);this.figures.push({type:"patch",coords:new Int32Array(n),colors:new Int32Array(i)})}}_decodeType7Shading(e){const t=this.coords,a=this.colors,n=new Int32Array(16),i=new Int32Array(4);for(;e.hasData;){const s=e.readFlag();if(!(0<=s&&s<=3))throw new r.FormatError("Unknown type7 flag");const o=t.length;for(let a=0,r=0!==s?12:16;a<r;a++)t.push(e.readCoordinate());const c=a.length;for(let t=0,r=0!==s?2:4;t<r;t++)a.push(e.readComponents());let l,h,u,d;switch(s){case 0:n[12]=o+3;n[13]=o+4;n[14]=o+5;n[15]=o+6;n[8]=o+2;n[9]=o+13;n[10]=o+14;n[11]=o+7;n[4]=o+1;n[5]=o+12;n[6]=o+15;n[7]=o+8;n[0]=o;n[1]=o+11;n[2]=o+10;n[3]=o+9;i[2]=c+1;i[3]=c+2;i[0]=c;i[1]=c+3;break;case 1:l=n[12];h=n[13];u=n[14];d=n[15];n[12]=d;n[13]=o+0;n[14]=o+1;n[15]=o+2;n[8]=u;n[9]=o+9;n[10]=o+10;n[11]=o+3;n[4]=h;n[5]=o+8;n[6]=o+11;n[7]=o+4;n[0]=l;n[1]=o+7;n[2]=o+6;n[3]=o+5;l=i[2];h=i[3];i[2]=h;i[3]=c;i[0]=l;i[1]=c+1;break;case 2:l=n[15];h=n[11];n[12]=n[3];n[13]=o+0;n[14]=o+1;n[15]=o+2;n[8]=n[7];n[9]=o+9;n[10]=o+10;n[11]=o+3;n[4]=h;n[5]=o+8;n[6]=o+11;n[7]=o+4;n[0]=l;n[1]=o+7;n[2]=o+6;n[3]=o+5;l=i[3];i[2]=i[1];i[3]=c;i[0]=l;i[1]=c+1;break;case 3:n[12]=n[0];n[13]=o+0;n[14]=o+1;n[15]=o+2;n[8]=n[1];n[9]=o+9;n[10]=o+10;n[11]=o+3;n[4]=n[2];n[5]=o+8;n[6]=o+11;n[7]=o+4;n[0]=n[3];n[1]=o+7;n[2]=o+6;n[3]=o+5;i[2]=i[0];i[3]=c;i[0]=i[1];i[1]=c+1}this.figures.push({type:"patch",coords:new Int32Array(n),colors:new Int32Array(i)})}}_buildFigureFromPatch(e){const t=this.figures[e];(0,r.assert)("patch"===t.type,"Unexpected patch mesh figure");const a=this.coords,n=this.colors,i=t.coords,s=t.colors,o=Math.min(a[i[0]][0],a[i[3]][0],a[i[12]][0],a[i[15]][0]),c=Math.min(a[i[0]][1],a[i[3]][1],a[i[12]][1],a[i[15]][1]),l=Math.max(a[i[0]][0],a[i[3]][0],a[i[12]][0],a[i[15]][0]),h=Math.max(a[i[0]][1],a[i[3]][1],a[i[12]][1],a[i[15]][1]);let u=Math.ceil((l-o)*MeshShading.TRIANGLE_DENSITY/(this.bounds[2]-this.bounds[0]));u=Math.max(MeshShading.MIN_SPLIT_PATCH_CHUNKS_AMOUNT,Math.min(MeshShading.MAX_SPLIT_PATCH_CHUNKS_AMOUNT,u));let d=Math.ceil((h-c)*MeshShading.TRIANGLE_DENSITY/(this.bounds[3]-this.bounds[1]));d=Math.max(MeshShading.MIN_SPLIT_PATCH_CHUNKS_AMOUNT,Math.min(MeshShading.MAX_SPLIT_PATCH_CHUNKS_AMOUNT,d));const g=u+1,p=new Int32Array((d+1)*g),m=new Int32Array((d+1)*g);let b=0;const y=new Uint8Array(3),w=new Uint8Array(3),S=n[s[0]],x=n[s[1]],C=n[s[2]],k=n[s[3]],v=f(d),F=f(u);for(let e=0;e<=d;e++){y[0]=(S[0]*(d-e)+C[0]*e)/d|0;y[1]=(S[1]*(d-e)+C[1]*e)/d|0;y[2]=(S[2]*(d-e)+C[2]*e)/d|0;w[0]=(x[0]*(d-e)+k[0]*e)/d|0;w[1]=(x[1]*(d-e)+k[1]*e)/d|0;w[2]=(x[2]*(d-e)+k[2]*e)/d|0;for(let t=0;t<=u;t++,b++){if(!(0!==e&&e!==d||0!==t&&t!==u))continue;let r=0,s=0,o=0;for(let n=0;n<=3;n++)for(let c=0;c<=3;c++,o++){const l=v[e][n]*F[t][c];r+=a[i[o]][0]*l;s+=a[i[o]][1]*l}p[b]=a.length;a.push([r,s]);m[b]=n.length;const c=new Uint8Array(3);c[0]=(y[0]*(u-t)+w[0]*t)/u|0;c[1]=(y[1]*(u-t)+w[1]*t)/u|0;c[2]=(y[2]*(u-t)+w[2]*t)/u|0;n.push(c)}}p[0]=i[0];m[0]=s[0];p[u]=i[3];m[u]=s[1];p[g*d]=i[12];m[g*d]=s[2];p[g*d+u]=i[15];m[g*d+u]=s[3];this.figures[e]={type:"lattice",coords:p,colors:m,verticesPerRow:g}}_updateBounds(){let e=this.coords[0][0],t=this.coords[0][1],a=e,r=t;for(let n=1,i=this.coords.length;n<i;n++){const i=this.coords[n][0],s=this.coords[n][1];e=e>i?i:e;t=t>s?s:t;a=a<i?i:a;r=r<s?s:r}this.bounds=[e,t,a,r]}_packData(){let e,t,a,r;const n=this.coords,i=new Float32Array(2*n.length);for(e=0,a=0,t=n.length;e<t;e++){const t=n[e];i[a++]=t[0];i[a++]=t[1]}this.coords=i;const s=this.colors,o=new Uint8Array(3*s.length);for(e=0,a=0,t=s.length;e<t;e++){const t=s[e];o[a++]=t[0];o[a++]=t[1];o[a++]=t[2]}this.colors=o;const c=this.figures;for(e=0,t=c.length;e<t;e++){const t=c[e],n=t.coords,i=t.colors;for(a=0,r=n.length;a<r;a++){n[a]*=2;i[a]*=3}}}getIR(){return["Mesh",this.shadingType,this.coords,this.colors,this.figures,this.bounds,this.bbox,this.background]}}class DummyShading extends BaseShading{getIR(){return["Dummy"]}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.getXfaFontDict=function getXfaFontDict(e){const t=function getXfaFontWidths(e){const t=getXfaFontName(e);if(!t)return null;const{baseWidths:a,baseMapping:r,factors:n}=t;let i;i=n?a.map(((e,t)=>e*n[t])):a;let s,o=-2;const c=[];for(const[e,t]of r.map(((e,t)=>[e,t])).sort((([e],[t])=>e-t)))if(-1!==e)if(e===o+1){s.push(i[t]);o+=1}else{o=e;s=[i[t]];c.push(e,s)}return c}(e),a=new n.Dict(null);a.set("BaseFont",n.Name.get(e));a.set("Type",n.Name.get("Font"));a.set("Subtype",n.Name.get("CIDFontType2"));a.set("Encoding",n.Name.get("Identity-H"));a.set("CIDToGIDMap",n.Name.get("Identity"));a.set("W",t);a.set("FirstChar",t[0]);a.set("LastChar",t.at(-2)+t.at(-1).length-1);const r=new n.Dict(null);a.set("FontDescriptor",r);const i=new n.Dict(null);i.set("Ordering","Identity");i.set("Registry","Adobe");i.set("Supplement",0);a.set("CIDSystemInfo",i);return a};t.getXfaFontName=getXfaFontName;var r=a(50),n=a(4),i=a(51),s=a(52),o=a(53),c=a(54),l=a(3),h=a(36);const u=(0,l.getLookupTableFactory)((function(e){e["MyriadPro-Regular"]=e["PdfJS-Fallback-Regular"]={name:"LiberationSans-Regular",factors:o.MyriadProRegularFactors,baseWidths:s.LiberationSansRegularWidths,baseMapping:s.LiberationSansRegularMapping,metrics:o.MyriadProRegularMetrics};e["MyriadPro-Bold"]=e["PdfJS-Fallback-Bold"]={name:"LiberationSans-Bold",factors:o.MyriadProBoldFactors,baseWidths:s.LiberationSansBoldWidths,baseMapping:s.LiberationSansBoldMapping,metrics:o.MyriadProBoldMetrics};e["MyriadPro-It"]=e["MyriadPro-Italic"]=e["PdfJS-Fallback-Italic"]={name:"LiberationSans-Italic",factors:o.MyriadProItalicFactors,baseWidths:s.LiberationSansItalicWidths,baseMapping:s.LiberationSansItalicMapping,metrics:o.MyriadProItalicMetrics};e["MyriadPro-BoldIt"]=e["MyriadPro-BoldItalic"]=e["PdfJS-Fallback-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:o.MyriadProBoldItalicFactors,baseWidths:s.LiberationSansBoldItalicWidths,baseMapping:s.LiberationSansBoldItalicMapping,metrics:o.MyriadProBoldItalicMetrics};e.ArialMT=e.Arial=e["Arial-Regular"]={name:"LiberationSans-Regular",baseWidths:s.LiberationSansRegularWidths,baseMapping:s.LiberationSansRegularMapping};e["Arial-BoldMT"]=e["Arial-Bold"]={name:"LiberationSans-Bold",baseWidths:s.LiberationSansBoldWidths,baseMapping:s.LiberationSansBoldMapping};e["Arial-ItalicMT"]=e["Arial-Italic"]={name:"LiberationSans-Italic",baseWidths:s.LiberationSansItalicWidths,baseMapping:s.LiberationSansItalicMapping};e["Arial-BoldItalicMT"]=e["Arial-BoldItalic"]={name:"LiberationSans-BoldItalic",baseWidths:s.LiberationSansBoldItalicWidths,baseMapping:s.LiberationSansBoldItalicMapping};e["Calibri-Regular"]={name:"LiberationSans-Regular",factors:r.CalibriRegularFactors,baseWidths:s.LiberationSansRegularWidths,baseMapping:s.LiberationSansRegularMapping,metrics:r.CalibriRegularMetrics};e["Calibri-Bold"]={name:"LiberationSans-Bold",factors:r.CalibriBoldFactors,baseWidths:s.LiberationSansBoldWidths,baseMapping:s.LiberationSansBoldMapping,metrics:r.CalibriBoldMetrics};e["Calibri-Italic"]={name:"LiberationSans-Italic",factors:r.CalibriItalicFactors,baseWidths:s.LiberationSansItalicWidths,baseMapping:s.LiberationSansItalicMapping,metrics:r.CalibriItalicMetrics};e["Calibri-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:r.CalibriBoldItalicFactors,baseWidths:s.LiberationSansBoldItalicWidths,baseMapping:s.LiberationSansBoldItalicMapping,metrics:r.CalibriBoldItalicMetrics};e["Segoeui-Regular"]={name:"LiberationSans-Regular",factors:c.SegoeuiRegularFactors,baseWidths:s.LiberationSansRegularWidths,baseMapping:s.LiberationSansRegularMapping,metrics:c.SegoeuiRegularMetrics};e["Segoeui-Bold"]={name:"LiberationSans-Bold",factors:c.SegoeuiBoldFactors,baseWidths:s.LiberationSansBoldWidths,baseMapping:s.LiberationSansBoldMapping,metrics:c.SegoeuiBoldMetrics};e["Segoeui-Italic"]={name:"LiberationSans-Italic",factors:c.SegoeuiItalicFactors,baseWidths:s.LiberationSansItalicWidths,baseMapping:s.LiberationSansItalicMapping,metrics:c.SegoeuiItalicMetrics};e["Segoeui-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:c.SegoeuiBoldItalicFactors,baseWidths:s.LiberationSansBoldItalicWidths,baseMapping:s.LiberationSansBoldItalicMapping,metrics:c.SegoeuiBoldItalicMetrics};e["Helvetica-Regular"]=e.Helvetica={name:"LiberationSans-Regular",factors:i.HelveticaRegularFactors,baseWidths:s.LiberationSansRegularWidths,baseMapping:s.LiberationSansRegularMapping,metrics:i.HelveticaRegularMetrics};e["Helvetica-Bold"]={name:"LiberationSans-Bold",factors:i.HelveticaBoldFactors,baseWidths:s.LiberationSansBoldWidths,baseMapping:s.LiberationSansBoldMapping,metrics:i.HelveticaBoldMetrics};e["Helvetica-Italic"]={name:"LiberationSans-Italic",factors:i.HelveticaItalicFactors,baseWidths:s.LiberationSansItalicWidths,baseMapping:s.LiberationSansItalicMapping,metrics:i.HelveticaItalicMetrics};e["Helvetica-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:i.HelveticaBoldItalicFactors,baseWidths:s.LiberationSansBoldItalicWidths,baseMapping:s.LiberationSansBoldItalicMapping,metrics:i.HelveticaBoldItalicMetrics}}));function getXfaFontName(e){const t=(0,h.normalizeFontName)(e);return u()[t]}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.CalibriRegularMetrics=t.CalibriRegularFactors=t.CalibriItalicMetrics=t.CalibriItalicFactors=t.CalibriBoldMetrics=t.CalibriBoldItalicMetrics=t.CalibriBoldItalicFactors=t.CalibriBoldFactors=void 0;t.CalibriBoldFactors=[1.3877,1,1,1,.97801,.92482,.89552,.91133,.81988,.97566,.98152,.93548,.93548,1.2798,.85284,.92794,1,.96134,1.54657,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.82845,.82845,.85284,.85284,.85284,.75859,.92138,.83908,.7762,.73293,.87289,.73133,.7514,.81921,.87356,.95958,.59526,.75727,.69225,1.04924,.9121,.86943,.79795,.88198,.77958,.70864,.81055,.90399,.88653,.96017,.82577,.77892,.78257,.97507,1.54657,.97507,.85284,.89552,.90176,.88762,.8785,.75241,.8785,.90518,.95015,.77618,.8785,.88401,.91916,.86304,.88401,.91488,.8785,.8801,.8785,.8785,.91343,.7173,1.04106,.8785,.85075,.95794,.82616,.85162,.79492,.88331,1.69808,.88331,.85284,.97801,.89552,.91133,.89552,.91133,1.7801,.89552,1.24487,1.13254,1.12401,.96839,.85284,.68787,.70645,.85592,.90747,1.01466,1.0088,.90323,1,1.07463,1,.91056,.75806,1.19118,.96839,.78864,.82845,.84133,.75859,.83908,.83908,.83908,.83908,.83908,.83908,.77539,.73293,.73133,.73133,.73133,.73133,.95958,.95958,.95958,.95958,.88506,.9121,.86943,.86943,.86943,.86943,.86943,.85284,.87508,.90399,.90399,.90399,.90399,.77892,.79795,.90807,.88762,.88762,.88762,.88762,.88762,.88762,.8715,.75241,.90518,.90518,.90518,.90518,.88401,.88401,.88401,.88401,.8785,.8785,.8801,.8801,.8801,.8801,.8801,.90747,.89049,.8785,.8785,.8785,.8785,.85162,.8785,.85162,.83908,.88762,.83908,.88762,.83908,.88762,.73293,.75241,.73293,.75241,.73293,.75241,.73293,.75241,.87289,.83016,.88506,.93125,.73133,.90518,.73133,.90518,.73133,.90518,.73133,.90518,.73133,.90518,.81921,.77618,.81921,.77618,.81921,.77618,1,1,.87356,.8785,.91075,.89608,.95958,.88401,.95958,.88401,.95958,.88401,.95958,.88401,.95958,.88401,.76229,.90167,.59526,.91916,1,1,.86304,.69225,.88401,1,1,.70424,.79468,.91926,.88175,.70823,.94903,.9121,.8785,1,1,.9121,.8785,.87802,.88656,.8785,.86943,.8801,.86943,.8801,.86943,.8801,.87402,.89291,.77958,.91343,1,1,.77958,.91343,.70864,.7173,.70864,.7173,.70864,.7173,.70864,.7173,1,1,.81055,.75841,.81055,1.06452,.90399,.8785,.90399,.8785,.90399,.8785,.90399,.8785,.90399,.8785,.90399,.8785,.96017,.95794,.77892,.85162,.77892,.78257,.79492,.78257,.79492,.78257,.79492,.9297,.56892,.83908,.88762,.77539,.8715,.87508,.89049,1,1,.81055,1.04106,1.20528,1.20528,1,1.15543,.70674,.98387,.94721,1.33431,1.45894,.95161,1.06303,.83908,.80352,.57184,.6965,.56289,.82001,.56029,.81235,1.02988,.83908,.7762,.68156,.80367,.73133,.78257,.87356,.86943,.95958,.75727,.89019,1.04924,.9121,.7648,.86943,.87356,.79795,.78275,.81055,.77892,.9762,.82577,.99819,.84896,.95958,.77892,.96108,1.01407,.89049,1.02988,.94211,.96108,.8936,.84021,.87842,.96399,.79109,.89049,1.00813,1.02988,.86077,.87445,.92099,.84723,.86513,.8801,.75638,.85714,.78216,.79586,.87965,.94211,.97747,.78287,.97926,.84971,1.02988,.94211,.8801,.94211,.84971,.73133,1,1,1,1,1,1,1,1,1,1,1,1,.90264,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.90518,1,1,1,1,1,1,1,1,1,1,1,1,.90548,1,1,1,1,1,1,.96017,.95794,.96017,.95794,.96017,.95794,.77892,.85162,1,1,.89552,.90527,1,.90363,.92794,.92794,.92794,.92794,.87012,.87012,.87012,.89552,.89552,1.42259,.71143,1.06152,1,1,1.03372,1.03372,.97171,1.4956,2.2807,.93835,.83406,.91133,.84107,.91133,1,1,1,.72021,1,1.23108,.83489,.88525,.88525,.81499,.90527,1.81055,.90527,1.81055,1.31006,1.53711,.94434,1.08696,1,.95018,.77192,.85284,.90747,1.17534,.69825,.9716,1.37077,.90747,.90747,.85356,.90747,.90747,1.44947,.85284,.8941,.8941,.70572,.8,.70572,.70572,.70572,.70572,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.99862,.99862,1,1,1,1,1,1.08004,.91027,1,1,1,.99862,1,1,1,1,1,1,1,1,1,1,1,1,.90727,.90727,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];t.CalibriBoldMetrics={lineHeight:1.2207,lineGap:.2207};t.CalibriBoldItalicFactors=[1.3877,1,1,1,.97801,.92482,.89552,.91133,.81988,.97566,.98152,.93548,.93548,1.2798,.85284,.92794,1,.96134,1.56239,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.82845,.82845,.85284,.85284,.85284,.75859,.92138,.83908,.7762,.71805,.87289,.73133,.7514,.81921,.87356,.95958,.59526,.75727,.69225,1.04924,.90872,.85938,.79795,.87068,.77958,.69766,.81055,.90399,.88653,.96068,.82577,.77892,.78257,.97507,1.529,.97507,.85284,.89552,.90176,.94908,.86411,.74012,.86411,.88323,.95015,.86411,.86331,.88401,.91916,.86304,.88401,.9039,.86331,.86331,.86411,.86411,.90464,.70852,1.04106,.86331,.84372,.95794,.82616,.84548,.79492,.88331,1.69808,.88331,.85284,.97801,.89552,.91133,.89552,.91133,1.7801,.89552,1.24487,1.13254,1.19129,.96839,.85284,.68787,.70645,.85592,.90747,1.01466,1.0088,.90323,1,1.07463,1,.91056,.75806,1.19118,.96839,.78864,.82845,.84133,.75859,.83908,.83908,.83908,.83908,.83908,.83908,.77539,.71805,.73133,.73133,.73133,.73133,.95958,.95958,.95958,.95958,.88506,.90872,.85938,.85938,.85938,.85938,.85938,.85284,.87068,.90399,.90399,.90399,.90399,.77892,.79795,.90807,.94908,.94908,.94908,.94908,.94908,.94908,.85887,.74012,.88323,.88323,.88323,.88323,.88401,.88401,.88401,.88401,.8785,.86331,.86331,.86331,.86331,.86331,.86331,.90747,.89049,.86331,.86331,.86331,.86331,.84548,.86411,.84548,.83908,.94908,.83908,.94908,.83908,.94908,.71805,.74012,.71805,.74012,.71805,.74012,.71805,.74012,.87289,.79538,.88506,.92726,.73133,.88323,.73133,.88323,.73133,.88323,.73133,.88323,.73133,.88323,.81921,.86411,.81921,.86411,.81921,.86411,1,1,.87356,.86331,.91075,.8777,.95958,.88401,.95958,.88401,.95958,.88401,.95958,.88401,.95958,.88401,.76467,.90167,.59526,.91916,1,1,.86304,.69225,.88401,1,1,.70424,.77312,.91926,.88175,.70823,.94903,.90872,.86331,1,1,.90872,.86331,.86906,.88116,.86331,.85938,.86331,.85938,.86331,.85938,.86331,.87402,.86549,.77958,.90464,1,1,.77958,.90464,.69766,.70852,.69766,.70852,.69766,.70852,.69766,.70852,1,1,.81055,.75841,.81055,1.06452,.90399,.86331,.90399,.86331,.90399,.86331,.90399,.86331,.90399,.86331,.90399,.86331,.96068,.95794,.77892,.84548,.77892,.78257,.79492,.78257,.79492,.78257,.79492,.9297,.56892,.83908,.94908,.77539,.85887,.87068,.89049,1,1,.81055,1.04106,1.20528,1.20528,1,1.15543,.70088,.98387,.94721,1.33431,1.45894,.95161,1.48387,.83908,.80352,.57118,.6965,.56347,.79179,.55853,.80346,1.02988,.83908,.7762,.67174,.86036,.73133,.78257,.87356,.86441,.95958,.75727,.89019,1.04924,.90872,.74889,.85938,.87891,.79795,.7957,.81055,.77892,.97447,.82577,.97466,.87179,.95958,.77892,.94252,.95612,.8753,1.02988,.92733,.94252,.87411,.84021,.8728,.95612,.74081,.8753,1.02189,1.02988,.84814,.87445,.91822,.84723,.85668,.86331,.81344,.87581,.76422,.82046,.96057,.92733,.99375,.78022,.95452,.86015,1.02988,.92733,.86331,.92733,.86015,.73133,1,1,1,1,1,1,1,1,1,1,1,1,.90631,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.88323,1,1,1,1,1,1,1,1,1,1,1,1,.85174,1,1,1,1,1,1,.96068,.95794,.96068,.95794,.96068,.95794,.77892,.84548,1,1,.89552,.90527,1,.90363,.92794,.92794,.92794,.89807,.87012,.87012,.87012,.89552,.89552,1.42259,.71094,1.06152,1,1,1.03372,1.03372,.97171,1.4956,2.2807,.92972,.83406,.91133,.83326,.91133,1,1,1,.72021,1,1.23108,.83489,.88525,.88525,.81499,.90616,1.81055,.90527,1.81055,1.3107,1.53711,.94434,1.08696,1,.95018,.77192,.85284,.90747,1.17534,.69825,.9716,1.37077,.90747,.90747,.85356,.90747,.90747,1.44947,.85284,.8941,.8941,.70572,.8,.70572,.70572,.70572,.70572,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.99862,.99862,1,1,1,1,1,1.08004,.91027,1,1,1,.99862,1,1,1,1,1,1,1,1,1,1,1,1,.90727,.90727,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];t.CalibriBoldItalicMetrics={lineHeight:1.2207,lineGap:.2207};t.CalibriItalicFactors=[1.3877,1,1,1,1.17223,1.1293,.89552,.91133,.80395,1.02269,1.15601,.91056,.91056,1.2798,.85284,.89807,1,.90861,1.39543,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.96309,.96309,.85284,.85284,.85284,.83319,.88071,.8675,.81552,.72346,.85193,.73206,.7522,.81105,.86275,.90685,.6377,.77892,.75593,1.02638,.89249,.84118,.77452,.85374,.75186,.67789,.79776,.88844,.85066,.94309,.77818,.7306,.76659,1.10369,1.38313,1.10369,1.06139,.89552,.8739,.9245,.9245,.83203,.9245,.85865,1.09842,.9245,.9245,1.03297,1.07692,.90918,1.03297,.94959,.9245,.92274,.9245,.9245,1.02933,.77832,1.20562,.9245,.8916,.98986,.86621,.89453,.79004,.94152,1.77256,.94152,.85284,.97801,.89552,.91133,.89552,.91133,1.91729,.89552,1.17889,1.13254,1.16359,.92098,.85284,.68787,.71353,.84737,.90747,1.0088,1.0044,.87683,1,1.09091,1,.92229,.739,1.15642,.92098,.76288,.80504,.80972,.75859,.8675,.8675,.8675,.8675,.8675,.8675,.76318,.72346,.73206,.73206,.73206,.73206,.90685,.90685,.90685,.90685,.86477,.89249,.84118,.84118,.84118,.84118,.84118,.85284,.84557,.88844,.88844,.88844,.88844,.7306,.77452,.86331,.9245,.9245,.9245,.9245,.9245,.9245,.84843,.83203,.85865,.85865,.85865,.85865,.82601,.82601,.82601,.82601,.94469,.9245,.92274,.92274,.92274,.92274,.92274,.90747,.86651,.9245,.9245,.9245,.9245,.89453,.9245,.89453,.8675,.9245,.8675,.9245,.8675,.9245,.72346,.83203,.72346,.83203,.72346,.83203,.72346,.83203,.85193,.8875,.86477,.99034,.73206,.85865,.73206,.85865,.73206,.85865,.73206,.85865,.73206,.85865,.81105,.9245,.81105,.9245,.81105,.9245,1,1,.86275,.9245,.90872,.93591,.90685,.82601,.90685,.82601,.90685,.82601,.90685,1.03297,.90685,.82601,.77896,1.05611,.6377,1.07692,1,1,.90918,.75593,1.03297,1,1,.76032,.9375,.98156,.93407,.77261,1.11429,.89249,.9245,1,1,.89249,.9245,.92534,.86698,.9245,.84118,.92274,.84118,.92274,.84118,.92274,.8667,.86291,.75186,1.02933,1,1,.75186,1.02933,.67789,.77832,.67789,.77832,.67789,.77832,.67789,.77832,1,1,.79776,.97655,.79776,1.23023,.88844,.9245,.88844,.9245,.88844,.9245,.88844,.9245,.88844,.9245,.88844,.9245,.94309,.98986,.7306,.89453,.7306,.76659,.79004,.76659,.79004,.76659,.79004,1.09231,.54873,.8675,.9245,.76318,.84843,.84557,.86651,1,1,.79776,1.20562,1.18622,1.18622,1,1.1437,.67009,.96334,.93695,1.35191,1.40909,.95161,1.48387,.8675,.90861,.6192,.7363,.64824,.82411,.56321,.85696,1.23516,.8675,.81552,.7286,.84134,.73206,.76659,.86275,.84369,.90685,.77892,.85871,1.02638,.89249,.75828,.84118,.85984,.77452,.76466,.79776,.7306,.90782,.77818,.903,.87291,.90685,.7306,.99058,1.03667,.94635,1.23516,.9849,.99058,.92393,.8916,.942,1.03667,.75026,.94635,1.0297,1.23516,.90918,.94048,.98217,.89746,.84153,.92274,.82507,.88832,.84438,.88178,1.03525,.9849,1.00225,.78086,.97248,.89404,1.23516,.9849,.92274,.9849,.89404,.73206,1,1,1,1,1,1,1,1,1,1,1,1,.89693,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.85865,1,1,1,1,1,1,1,1,1,1,1,1,.90933,1,1,1,1,1,1,.94309,.98986,.94309,.98986,.94309,.98986,.7306,.89453,1,1,.89552,.90527,1,.90186,1.12308,1.12308,1.12308,1.12308,1.2566,1.2566,1.2566,.89552,.89552,1.42259,.68994,1.03809,1,1,1.0176,1.0176,1.11523,1.4956,2.01462,.97858,.82616,.91133,.83437,.91133,1,1,1,.70508,1,1.23108,.79801,.84426,.84426,.774,.90572,1.81055,.90749,1.81055,1.28809,1.55469,.94434,1.07806,1,.97094,.7589,.85284,.90747,1.19658,.69825,.97622,1.33512,.90747,.90747,.85284,.90747,.90747,1.44947,.85284,.8941,.8941,.70572,.8,.70572,.70572,.70572,.70572,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.99862,.99862,1,1,1,1,1,1.0336,.91027,1,1,1,.99862,1,1,1,1,1,1,1,1,1,1,1,1,1.05859,1.05859,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];t.CalibriItalicMetrics={lineHeight:1.2207,lineGap:.2207};t.CalibriRegularFactors=[1.3877,1,1,1,1.17223,1.1293,.89552,.91133,.80395,1.02269,1.15601,.91056,.91056,1.2798,.85284,.89807,1,.90861,1.39016,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.96309,.96309,.85284,.85284,.85284,.83319,.88071,.8675,.81552,.73834,.85193,.73206,.7522,.81105,.86275,.90685,.6377,.77892,.75593,1.02638,.89385,.85122,.77452,.86503,.75186,.68887,.79776,.88844,.85066,.94258,.77818,.7306,.76659,1.10369,1.39016,1.10369,1.06139,.89552,.8739,.86128,.94469,.8457,.94469,.89464,1.09842,.84636,.94469,1.03297,1.07692,.90918,1.03297,.95897,.94469,.9482,.94469,.94469,1.04692,.78223,1.20562,.94469,.90332,.98986,.86621,.90527,.79004,.94152,1.77256,.94152,.85284,.97801,.89552,.91133,.89552,.91133,1.91729,.89552,1.17889,1.13254,1.08707,.92098,.85284,.68787,.71353,.84737,.90747,1.0088,1.0044,.87683,1,1.09091,1,.92229,.739,1.15642,.92098,.76288,.80504,.80972,.75859,.8675,.8675,.8675,.8675,.8675,.8675,.76318,.73834,.73206,.73206,.73206,.73206,.90685,.90685,.90685,.90685,.86477,.89385,.85122,.85122,.85122,.85122,.85122,.85284,.85311,.88844,.88844,.88844,.88844,.7306,.77452,.86331,.86128,.86128,.86128,.86128,.86128,.86128,.8693,.8457,.89464,.89464,.89464,.89464,.82601,.82601,.82601,.82601,.94469,.94469,.9482,.9482,.9482,.9482,.9482,.90747,.86651,.94469,.94469,.94469,.94469,.90527,.94469,.90527,.8675,.86128,.8675,.86128,.8675,.86128,.73834,.8457,.73834,.8457,.73834,.8457,.73834,.8457,.85193,.92454,.86477,.9921,.73206,.89464,.73206,.89464,.73206,.89464,.73206,.89464,.73206,.89464,.81105,.84636,.81105,.84636,.81105,.84636,1,1,.86275,.94469,.90872,.95786,.90685,.82601,.90685,.82601,.90685,.82601,.90685,1.03297,.90685,.82601,.77741,1.05611,.6377,1.07692,1,1,.90918,.75593,1.03297,1,1,.76032,.90452,.98156,1.11842,.77261,1.11429,.89385,.94469,1,1,.89385,.94469,.95877,.86901,.94469,.85122,.9482,.85122,.9482,.85122,.9482,.8667,.90016,.75186,1.04692,1,1,.75186,1.04692,.68887,.78223,.68887,.78223,.68887,.78223,.68887,.78223,1,1,.79776,.92188,.79776,1.23023,.88844,.94469,.88844,.94469,.88844,.94469,.88844,.94469,.88844,.94469,.88844,.94469,.94258,.98986,.7306,.90527,.7306,.76659,.79004,.76659,.79004,.76659,.79004,1.09231,.54873,.8675,.86128,.76318,.8693,.85311,.86651,1,1,.79776,1.20562,1.18622,1.18622,1,1.1437,.67742,.96334,.93695,1.35191,1.40909,.95161,1.48387,.86686,.90861,.62267,.74359,.65649,.85498,.56963,.88254,1.23516,.8675,.81552,.75443,.84503,.73206,.76659,.86275,.85122,.90685,.77892,.85746,1.02638,.89385,.75657,.85122,.86275,.77452,.74171,.79776,.7306,.95165,.77818,.89772,.88831,.90685,.7306,.98142,1.02191,.96576,1.23516,.99018,.98142,.9236,.89258,.94035,1.02191,.78848,.96576,.9561,1.23516,.90918,.92578,.95424,.89746,.83969,.9482,.80113,.89442,.85208,.86155,.98022,.99018,1.00452,.81209,.99247,.89181,1.23516,.99018,.9482,.99018,.89181,.73206,1,1,1,1,1,1,1,1,1,1,1,1,.88844,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.89464,1,1,1,1,1,1,1,1,1,1,1,1,.96766,1,1,1,1,1,1,.94258,.98986,.94258,.98986,.94258,.98986,.7306,.90527,1,1,.89552,.90527,1,.90186,1.12308,1.12308,1.12308,1.12308,1.2566,1.2566,1.2566,.89552,.89552,1.42259,.69043,1.03809,1,1,1.0176,1.0176,1.11523,1.4956,2.01462,.99331,.82616,.91133,.84286,.91133,1,1,1,.70508,1,1.23108,.79801,.84426,.84426,.774,.90527,1.81055,.90527,1.81055,1.28809,1.55469,.94434,1.07806,1,.97094,.7589,.85284,.90747,1.19658,.69825,.97622,1.33512,.90747,.90747,.85356,.90747,.90747,1.44947,.85284,.8941,.8941,.70572,.8,.70572,.70572,.70572,.70572,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.99862,.99862,1,1,1,1,1,1.0336,.91027,1,1,1,.99862,1,1,1,1,1,1,1,1,1,1,1,1,1.05859,1.05859,1,1,1,1.07185,.99413,.96334,1.08065,1,1,1,1,1,1,1,1,1,1,1];t.CalibriRegularMetrics={lineHeight:1.2207,lineGap:.2207}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.HelveticaRegularMetrics=t.HelveticaRegularFactors=t.HelveticaItalicMetrics=t.HelveticaItalicFactors=t.HelveticaBoldMetrics=t.HelveticaBoldItalicMetrics=t.HelveticaBoldItalicFactors=t.HelveticaBoldFactors=void 0;t.HelveticaBoldFactors=[.76116,1,1,1.0006,.99998,.99974,.99973,.99973,.99982,.99977,1.00087,.99998,.99998,.99959,1.00003,1.0006,.99998,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99998,1,1.00003,1.00003,1.00003,1.00026,.9999,.99977,.99977,.99977,.99977,1.00001,1.00026,1.00022,.99977,1.0006,.99973,.99977,1.00026,.99999,.99977,1.00022,1.00001,1.00022,.99977,1.00001,1.00026,.99977,1.00001,1.00016,1.00001,1.00001,1.00026,.99998,1.0006,.99998,1.00003,.99973,.99998,.99973,1.00026,.99973,1.00026,.99973,.99998,1.00026,1.00026,1.0006,1.0006,.99973,1.0006,.99982,1.00026,1.00026,1.00026,1.00026,.99959,.99973,.99998,1.00026,.99973,1.00022,.99973,.99973,1,.99959,1.00077,.99959,1.00003,.99998,.99973,.99973,.99973,.99973,1.00077,.99973,.99998,1.00025,.99968,.99973,1.00003,1.00025,.60299,1.00024,1.06409,1,1,.99998,1,.99973,1.0006,.99998,1,.99936,.99973,1.00002,1.00002,1.00002,1.00026,.99977,.99977,.99977,.99977,.99977,.99977,1,.99977,1.00001,1.00001,1.00001,1.00001,1.0006,1.0006,1.0006,1.0006,.99977,.99977,1.00022,1.00022,1.00022,1.00022,1.00022,1.00003,1.00022,.99977,.99977,.99977,.99977,1.00001,1.00001,1.00026,.99973,.99973,.99973,.99973,.99973,.99973,.99982,.99973,.99973,.99973,.99973,.99973,1.0006,1.0006,1.0006,1.0006,1.00026,1.00026,1.00026,1.00026,1.00026,1.00026,1.00026,1.06409,1.00026,1.00026,1.00026,1.00026,1.00026,.99973,1.00026,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,1.03374,.99977,1.00026,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,.99977,1.00026,.99977,1.00026,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.00042,.99973,.99973,1.0006,.99977,.99973,.99973,1.00026,1.0006,1.00026,1.0006,1.00026,1.03828,1.00026,.99999,1.00026,1.0006,.99977,1.00026,.99977,1.00026,.99977,1.00026,.9993,.9998,1.00026,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,1,1.00016,.99977,.99959,.99977,.99959,.99977,.99959,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00026,.99998,1.00026,.8121,1.00026,.99998,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,1.00016,1.00022,1.00001,.99973,1.00001,1.00026,1,1.00026,1,1.00026,1,1.0006,.99973,.99977,.99973,1,.99982,1.00022,1.00026,1.00001,.99973,1.00026,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,1.00034,.99977,1,.99997,1.00026,1.00078,1.00036,.99973,1.00013,1.0006,.99977,.99977,.99988,.85148,1.00001,1.00026,.99977,1.00022,1.0006,.99977,1.00001,.99999,.99977,1.00069,1.00022,.99977,1.00001,.99984,1.00026,1.00001,1.00024,1.00001,.9999,1,1.0006,1.00001,1.00041,.99962,1.00026,1.0006,.99995,1.00041,.99942,.99973,.99927,1.00082,.99902,1.00026,1.00087,1.0006,1.00069,.99973,.99867,.99973,.9993,1.00026,1.00049,1.00056,1,.99988,.99935,.99995,.99954,1.00055,.99945,1.00032,1.0006,.99995,1.00026,.99995,1.00032,1.00001,1.00008,.99971,1.00019,.9994,1.00001,1.0006,1.00044,.99973,1.00023,1.00047,1,.99942,.99561,.99989,1.00035,.99977,1.00035,.99977,1.00019,.99944,1.00001,1.00021,.99926,1.00035,1.00035,.99942,1.00048,.99999,.99977,1.00022,1.00035,1.00001,.99977,1.00026,.99989,1.00057,1.00001,.99936,1.00052,1.00012,.99996,1.00043,1,1.00035,.9994,.99976,1.00035,.99973,1.00052,1.00041,1.00119,1.00037,.99973,1.00002,.99986,1.00041,1.00041,.99902,.9996,1.00034,.99999,1.00026,.99999,1.00026,.99973,1.00052,.99973,1,.99973,1.00041,1.00075,.9994,1.0003,.99999,1,1.00041,.99955,1,.99915,.99973,.99973,1.00026,1.00119,.99955,.99973,1.0006,.99911,1.0006,1.00026,.99972,1.00026,.99902,1.00041,.99973,.99999,1,1,1.00038,1.0005,1.00016,1.00022,1.00016,1.00022,1.00016,1.00022,1.00001,.99973,1,1,.99973,1,1,.99955,1.0006,1.0006,1.0006,1.0006,1,1,1,.99973,.99973,.99972,1,1,1.00106,.99999,.99998,.99998,.99999,.99998,1.66475,1,.99973,.99973,1.00023,.99973,.99971,1.00047,1.00023,1,.99991,.99984,1.00002,1.00002,1.00002,1.00002,1,1,1,1,1,1,1,.99972,1,1.20985,1.39713,1.00003,1.00031,1.00015,1,.99561,1.00027,1.00031,1.00031,.99915,1.00031,1.00031,.99999,1.00003,.99999,.99999,1.41144,1.6,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.40579,1.40579,1.36625,.99999,1,.99861,.99861,1,1.00026,1.00026,1.00026,1.00026,.99972,.99999,.99999,.99999,.99999,1.40483,1,.99977,1.00054,1,1,.99953,.99962,1.00042,.9995,1,1,1,1,1,1,1,1,.99998,.99998,.99998,.99998,1,1,1,1,1,1,1,1,1,1,1];t.HelveticaBoldMetrics={lineHeight:1.2,lineGap:.2};t.HelveticaBoldItalicFactors=[.76116,1,1,1.0006,.99998,.99974,.99973,.99973,.99982,.99977,1.00087,.99998,.99998,.99959,1.00003,1.0006,.99998,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99998,1,1.00003,1.00003,1.00003,1.00026,.9999,.99977,.99977,.99977,.99977,1.00001,1.00026,1.00022,.99977,1.0006,.99973,.99977,1.00026,.99999,.99977,1.00022,1.00001,1.00022,.99977,1.00001,1.00026,.99977,1.00001,1.00016,1.00001,1.00001,1.00026,.99998,1.0006,.99998,1.00003,.99973,.99998,.99973,1.00026,.99973,1.00026,.99973,.99998,1.00026,1.00026,1.0006,1.0006,.99973,1.0006,.99982,1.00026,1.00026,1.00026,1.00026,.99959,.99973,.99998,1.00026,.99973,1.00022,.99973,.99973,1,.99959,1.00077,.99959,1.00003,.99998,.99973,.99973,.99973,.99973,1.00077,.99973,.99998,1.00025,.99968,.99973,1.00003,1.00025,.60299,1.00024,1.06409,1,1,.99998,1,.99973,1.0006,.99998,1,.99936,.99973,1.00002,1.00002,1.00002,1.00026,.99977,.99977,.99977,.99977,.99977,.99977,1,.99977,1.00001,1.00001,1.00001,1.00001,1.0006,1.0006,1.0006,1.0006,.99977,.99977,1.00022,1.00022,1.00022,1.00022,1.00022,1.00003,1.00022,.99977,.99977,.99977,.99977,1.00001,1.00001,1.00026,.99973,.99973,.99973,.99973,.99973,.99973,.99982,.99973,.99973,.99973,.99973,.99973,1.0006,1.0006,1.0006,1.0006,1.00026,1.00026,1.00026,1.00026,1.00026,1.00026,1.00026,1.06409,1.00026,1.00026,1.00026,1.00026,1.00026,.99973,1.00026,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,1.0044,.99977,1.00026,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,.99977,1.00026,.99977,1.00026,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,.99971,.99973,.99973,1.0006,.99977,.99973,.99973,1.00026,1.0006,1.00026,1.0006,1.00026,1.01011,1.00026,.99999,1.00026,1.0006,.99977,1.00026,.99977,1.00026,.99977,1.00026,.9993,.9998,1.00026,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,1,1.00016,.99977,.99959,.99977,.99959,.99977,.99959,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00026,.99998,1.00026,.8121,1.00026,.99998,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,1.00016,1.00022,1.00001,.99973,1.00001,1.00026,1,1.00026,1,1.00026,1,1.0006,.99973,.99977,.99973,1,.99982,1.00022,1.00026,1.00001,.99973,1.00026,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99977,1,1,1.00026,.99969,.99972,.99981,.9998,1.0006,.99977,.99977,1.00022,.91155,1.00001,1.00026,.99977,1.00022,1.0006,.99977,1.00001,.99999,.99977,.99966,1.00022,1.00032,1.00001,.99944,1.00026,1.00001,.99968,1.00001,1.00047,1,1.0006,1.00001,.99981,1.00101,1.00026,1.0006,.99948,.99981,1.00064,.99973,.99942,1.00101,1.00061,1.00026,1.00069,1.0006,1.00014,.99973,1.01322,.99973,1.00065,1.00026,1.00012,.99923,1,1.00064,1.00076,.99948,1.00055,1.00063,1.00007,.99943,1.0006,.99948,1.00026,.99948,.99943,1.00001,1.00001,1.00029,1.00038,1.00035,1.00001,1.0006,1.0006,.99973,.99978,1.00001,1.00057,.99989,.99967,.99964,.99967,.99977,.99999,.99977,1.00038,.99977,1.00001,.99973,1.00066,.99967,.99967,1.00041,.99998,.99999,.99977,1.00022,.99967,1.00001,.99977,1.00026,.99964,1.00031,1.00001,.99999,.99999,1,1.00023,1,1,.99999,1.00035,1.00001,.99999,.99973,.99977,.99999,1.00058,.99973,.99973,.99955,.9995,1.00026,1.00026,1.00032,.99989,1.00034,.99999,1.00026,1.00026,1.00026,.99973,.45998,.99973,1.00026,.99973,1.00001,.99999,.99982,.99994,.99996,1,1.00042,1.00044,1.00029,1.00023,.99973,.99973,1.00026,.99949,1.00002,.99973,1.0006,1.0006,1.0006,.99975,1.00026,1.00026,1.00032,.98685,.99973,1.00026,1,1,.99966,1.00044,1.00016,1.00022,1.00016,1.00022,1.00016,1.00022,1.00001,.99973,1,1,.99973,1,1,.99955,1.0006,1.0006,1.0006,1.0006,1,1,1,.99973,.99973,.99972,1,1,1.00106,.99999,.99998,.99998,.99999,.99998,1.66475,1,.99973,.99973,1,.99973,.99971,.99978,1,1,.99991,.99984,1.00002,1.00002,1.00002,1.00002,1.00098,1,1,1,1.00049,1,1,.99972,1,1.20985,1.39713,1.00003,1.00031,1.00015,1,.99561,1.00027,1.00031,1.00031,.99915,1.00031,1.00031,.99999,1.00003,.99999,.99999,1.41144,1.6,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.40579,1.40579,1.36625,.99999,1,.99861,.99861,1,1.00026,1.00026,1.00026,1.00026,.99972,.99999,.99999,.99999,.99999,1.40483,1,.99977,1.00054,1,1,.99953,.99962,1.00042,.9995,1,1,1,1,1,1,1,1,.99998,.99998,.99998,.99998,1,1,1,1,1,1,1,1,1,1,1];t.HelveticaBoldItalicMetrics={lineHeight:1.35,lineGap:.2};t.HelveticaItalicFactors=[.76116,1,1,1.0006,1.0006,1.00006,.99973,.99973,.99982,1.00001,1.00043,.99998,.99998,.99959,1.00003,1.0006,.99998,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,1.0006,1,1.00003,1.00003,1.00003,.99973,.99987,1.00001,1.00001,.99977,.99977,1.00001,1.00026,1.00022,.99977,1.0006,1,1.00001,.99973,.99999,.99977,1.00022,1.00001,1.00022,.99977,1.00001,1.00026,.99977,1.00001,1.00016,1.00001,1.00001,1.00026,1.0006,1.0006,1.0006,.99949,.99973,.99998,.99973,.99973,1,.99973,.99973,1.0006,.99973,.99973,.99924,.99924,1,.99924,.99999,.99973,.99973,.99973,.99973,.99998,1,1.0006,.99973,1,.99977,1,1,1,1.00005,1.0009,1.00005,1.00003,.99998,.99973,.99973,.99973,.99973,1.0009,.99973,.99998,1.00025,.99968,.99973,1.00003,1.00025,.60299,1.00024,1.06409,1,1,.99998,1,.9998,1.0006,.99998,1,.99936,.99973,1.00002,1.00002,1.00002,1.00026,1.00001,1.00001,1.00001,1.00001,1.00001,1.00001,1,.99977,1.00001,1.00001,1.00001,1.00001,1.0006,1.0006,1.0006,1.0006,.99977,.99977,1.00022,1.00022,1.00022,1.00022,1.00022,1.00003,1.00022,.99977,.99977,.99977,.99977,1.00001,1.00001,1.00026,.99973,.99973,.99973,.99973,.99973,.99973,.99982,1,.99973,.99973,.99973,.99973,1.0006,1.0006,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,1.06409,1.00026,.99973,.99973,.99973,.99973,1,.99973,1,1.00001,.99973,1.00001,.99973,1.00001,.99973,.99977,1,.99977,1,.99977,1,.99977,1,.99977,1.0288,.99977,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,.99977,.99973,.99977,.99973,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,.99924,1.0006,1.0006,.99946,1.00034,1,.99924,1.00001,1,1,.99973,.99924,.99973,.99924,.99973,1.06311,.99973,1.00024,.99973,.99924,.99977,.99973,.99977,.99973,.99977,.99973,1.00041,.9998,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,1,1.00016,.99977,.99998,.99977,.99998,.99977,.99998,1.00001,1,1.00001,1,1.00001,1,1.00001,1,1.00026,1.0006,1.00026,.89547,1.00026,1.0006,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,1.00016,.99977,1.00001,1,1.00001,1.00026,1,1.00026,1,1.00026,1,.99924,.99973,1.00001,.99973,1,.99982,1.00022,1.00026,1.00001,1,1.00026,1.0006,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,1.00001,1,1.00054,.99977,1.00084,1.00007,.99973,1.00013,.99924,1.00001,1.00001,.99945,.91221,1.00001,1.00026,.99977,1.00022,1.0006,1.00001,1.00001,.99999,.99977,.99933,1.00022,1.00054,1.00001,1.00065,1.00026,1.00001,1.0001,1.00001,1.00052,1,1.0006,1.00001,.99945,.99897,.99968,.99924,1.00036,.99945,.99949,1,1.0006,.99897,.99918,.99968,.99911,.99924,1,.99962,1.01487,1,1.0005,.99973,1.00012,1.00043,1,.99995,.99994,1.00036,.99947,1.00019,1.00063,1.00025,.99924,1.00036,.99973,1.00036,1.00025,1.00001,1.00001,1.00027,1.0001,1.00068,1.00001,1.0006,1.0006,1,1.00008,.99957,.99972,.9994,.99954,.99975,1.00051,1.00001,1.00019,1.00001,1.0001,.99986,1.00001,1.00001,1.00038,.99954,.99954,.9994,1.00066,.99999,.99977,1.00022,1.00054,1.00001,.99977,1.00026,.99975,1.0001,1.00001,.99993,.9995,.99955,1.00016,.99978,.99974,1.00019,1.00022,.99955,1.00053,.99973,1.00089,1.00005,.99967,1.00048,.99973,1.00002,1.00034,.99973,.99973,.99964,1.00006,1.00066,.99947,.99973,.98894,.99973,1,.44898,1,.99946,1,1.00039,1.00082,.99991,.99991,.99985,1.00022,1.00023,1.00061,1.00006,.99966,.99973,.99973,.99973,1.00019,1.0008,1,.99924,.99924,.99924,.99983,1.00044,.99973,.99964,.98332,1,.99973,1,1,.99962,.99895,1.00016,.99977,1.00016,.99977,1.00016,.99977,1.00001,1,1,1,.99973,1,1,.99955,.99924,.99924,.99924,.99924,.99998,.99998,.99998,.99973,.99973,.99972,1,1,1.00267,.99999,.99998,.99998,1,.99998,1.66475,1,.99973,.99973,1.00023,.99973,1.00423,.99925,.99999,1,.99991,.99984,1.00002,1.00002,1.00002,1.00002,1.00049,1,1.00245,1,1,1,1,.96329,1,1.20985,1.39713,1.00003,.8254,1.00015,1,1.00035,1.00027,1.00031,1.00031,1.00003,1.00031,1.00031,.99999,1.00003,.99999,.99999,1.41144,1.6,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.40579,1.40579,1.36625,.99999,1,.99861,.99861,1,1.00026,1.00026,1.00026,1.00026,.95317,.99999,.99999,.99999,.99999,1.40483,1,.99977,1.00054,1,1,.99953,.99962,1.00042,.9995,1,1,1,1,1,1,1,1,.99998,.99998,.99998,.99998,1,1,1,1,1,1,1,1,1,1,1];t.HelveticaItalicMetrics={lineHeight:1.35,lineGap:.2};t.HelveticaRegularFactors=[.76116,1,1,1.0006,1.0006,1.00006,.99973,.99973,.99982,1.00001,1.00043,.99998,.99998,.99959,1.00003,1.0006,.99998,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,1.0006,1,1.00003,1.00003,1.00003,.99973,.99987,1.00001,1.00001,.99977,.99977,1.00001,1.00026,1.00022,.99977,1.0006,1,1.00001,.99973,.99999,.99977,1.00022,1.00001,1.00022,.99977,1.00001,1.00026,.99977,1.00001,1.00016,1.00001,1.00001,1.00026,1.0006,1.0006,1.0006,.99949,.99973,.99998,.99973,.99973,1,.99973,.99973,1.0006,.99973,.99973,.99924,.99924,1,.99924,.99999,.99973,.99973,.99973,.99973,.99998,1,1.0006,.99973,1,.99977,1,1,1,1.00005,1.0009,1.00005,1.00003,.99998,.99973,.99973,.99973,.99973,1.0009,.99973,.99998,1.00025,.99968,.99973,1.00003,1.00025,.60299,1.00024,1.06409,1,1,.99998,1,.9998,1.0006,.99998,1,.99936,.99973,1.00002,1.00002,1.00002,1.00026,1.00001,1.00001,1.00001,1.00001,1.00001,1.00001,1,.99977,1.00001,1.00001,1.00001,1.00001,1.0006,1.0006,1.0006,1.0006,.99977,.99977,1.00022,1.00022,1.00022,1.00022,1.00022,1.00003,1.00022,.99977,.99977,.99977,.99977,1.00001,1.00001,1.00026,.99973,.99973,.99973,.99973,.99973,.99973,.99982,1,.99973,.99973,.99973,.99973,1.0006,1.0006,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,1.06409,1.00026,.99973,.99973,.99973,.99973,1,.99973,1,1.00001,.99973,1.00001,.99973,1.00001,.99973,.99977,1,.99977,1,.99977,1,.99977,1,.99977,1.04596,.99977,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,.99977,.99973,.99977,.99973,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,.99924,1.0006,1.0006,1.00019,1.00034,1,.99924,1.00001,1,1,.99973,.99924,.99973,.99924,.99973,1.02572,.99973,1.00005,.99973,.99924,.99977,.99973,.99977,.99973,.99977,.99973,.99999,.9998,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,1,1.00016,.99977,.99998,.99977,.99998,.99977,.99998,1.00001,1,1.00001,1,1.00001,1,1.00001,1,1.00026,1.0006,1.00026,.84533,1.00026,1.0006,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,1.00016,.99977,1.00001,1,1.00001,1.00026,1,1.00026,1,1.00026,1,.99924,.99973,1.00001,.99973,1,.99982,1.00022,1.00026,1.00001,1,1.00026,1.0006,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99928,1,.99977,1.00013,1.00055,.99947,.99945,.99941,.99924,1.00001,1.00001,1.0004,.91621,1.00001,1.00026,.99977,1.00022,1.0006,1.00001,1.00005,.99999,.99977,1.00015,1.00022,.99977,1.00001,.99973,1.00026,1.00001,1.00019,1.00001,.99946,1,1.0006,1.00001,.99978,1.00045,.99973,.99924,1.00023,.99978,.99966,1,1.00065,1.00045,1.00019,.99973,.99973,.99924,1,1,.96499,1,1.00055,.99973,1.00008,1.00027,1,.9997,.99995,1.00023,.99933,1.00019,1.00015,1.00031,.99924,1.00023,.99973,1.00023,1.00031,1.00001,.99928,1.00029,1.00092,1.00035,1.00001,1.0006,1.0006,1,.99988,.99975,1,1.00082,.99561,.9996,1.00035,1.00001,.99962,1.00001,1.00092,.99964,1.00001,.99963,.99999,1.00035,1.00035,1.00082,.99962,.99999,.99977,1.00022,1.00035,1.00001,.99977,1.00026,.9996,.99967,1.00001,1.00034,1.00074,1.00054,1.00053,1.00063,.99971,.99962,1.00035,.99975,.99977,.99973,1.00043,.99953,1.0007,.99915,.99973,1.00008,.99892,1.00073,1.00073,1.00114,.99915,1.00073,.99955,.99973,1.00092,.99973,1,.99998,1,1.0003,1,1.00043,1.00001,.99969,1.0003,1,1.00035,1.00001,.9995,1,1.00092,.99973,.99973,.99973,1.0007,.9995,1,.99924,1.0006,.99924,.99972,1.00062,.99973,1.00114,1.00073,1,.99955,1,1,1.00047,.99968,1.00016,.99977,1.00016,.99977,1.00016,.99977,1.00001,1,1,1,.99973,1,1,.99955,.99924,.99924,.99924,.99924,.99998,.99998,.99998,.99973,.99973,.99972,1,1,1.00267,.99999,.99998,.99998,1,.99998,1.66475,1,.99973,.99973,1.00023,.99973,.99971,.99925,1.00023,1,.99991,.99984,1.00002,1.00002,1.00002,1.00002,1,1,1,1,1,1,1,.96329,1,1.20985,1.39713,1.00003,.8254,1.00015,1,1.00035,1.00027,1.00031,1.00031,.99915,1.00031,1.00031,.99999,1.00003,.99999,.99999,1.41144,1.6,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.40579,1.40579,1.36625,.99999,1,.99861,.99861,1,1.00026,1.00026,1.00026,1.00026,.95317,.99999,.99999,.99999,.99999,1.40483,1,.99977,1.00054,1,1,.99953,.99962,1.00042,.9995,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];t.HelveticaRegularMetrics={lineHeight:1.2,lineGap:.2}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.LiberationSansRegularWidths=t.LiberationSansRegularMapping=t.LiberationSansItalicWidths=t.LiberationSansItalicMapping=t.LiberationSansBoldWidths=t.LiberationSansBoldMapping=t.LiberationSansBoldItalicWidths=t.LiberationSansBoldItalicMapping=void 0;t.LiberationSansBoldWidths=[365,0,333,278,333,474,556,556,889,722,238,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,333,333,584,584,584,611,975,722,722,722,722,667,611,778,722,278,556,722,611,833,722,778,667,778,722,667,611,722,667,944,667,667,611,333,278,333,584,556,333,556,611,556,611,556,333,611,611,278,278,556,278,889,611,611,611,611,389,556,333,611,556,778,556,556,500,389,280,389,584,333,556,556,556,556,280,556,333,737,370,556,584,737,552,400,549,333,333,333,576,556,278,333,333,365,556,834,834,834,611,722,722,722,722,722,722,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,556,556,556,556,556,278,278,278,278,611,611,611,611,611,611,611,549,611,611,611,611,611,556,611,556,722,556,722,556,722,556,722,556,722,556,722,556,722,556,722,719,722,611,667,556,667,556,667,556,667,556,667,556,778,611,778,611,778,611,778,611,722,611,722,611,278,278,278,278,278,278,278,278,278,278,785,556,556,278,722,556,556,611,278,611,278,611,385,611,479,611,278,722,611,722,611,722,611,708,723,611,778,611,778,611,778,611,1e3,944,722,389,722,389,722,389,667,556,667,556,667,556,667,556,611,333,611,479,611,333,722,611,722,611,722,611,722,611,722,611,722,611,944,778,667,556,667,611,500,611,500,611,500,278,556,722,556,1e3,889,778,611,667,556,611,333,333,333,333,333,333,333,333,333,333,333,465,722,333,853,906,474,825,927,838,278,722,722,601,719,667,611,722,778,278,722,667,833,722,644,778,722,667,600,611,667,821,667,809,802,278,667,615,451,611,278,582,615,610,556,606,475,460,611,541,278,558,556,612,556,445,611,766,619,520,684,446,582,715,576,753,845,278,582,611,582,845,667,669,885,567,711,667,278,276,556,1094,1062,875,610,722,622,719,722,719,722,567,712,667,904,626,719,719,610,702,833,722,778,719,667,722,611,622,854,667,730,703,1005,1019,870,979,719,711,1031,719,556,618,615,417,635,556,709,497,615,615,500,635,740,604,611,604,611,556,490,556,875,556,615,581,833,844,729,854,615,552,854,583,556,556,611,417,552,556,278,281,278,969,906,611,500,615,556,604,778,611,487,447,944,778,944,778,944,778,667,556,333,333,556,1e3,1e3,552,278,278,278,278,500,500,500,556,556,350,1e3,1e3,240,479,333,333,604,333,167,396,556,556,1094,556,885,489,1115,1e3,768,600,834,834,834,834,1e3,500,1e3,500,1e3,500,500,494,612,823,713,584,549,713,979,722,274,549,549,583,549,549,604,584,604,604,708,625,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,729,604,604,354,354,1e3,990,990,990,990,494,604,604,604,604,354,1021,1052,917,750,750,531,656,594,510,500,750,750,611,611,333,333,333,333,333,333,333,333,222,222,333,333,333,333,333,333,333,333];t.LiberationSansBoldMapping=[-1,-1,-1,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,402,506,507,508,509,510,511,536,537,538,539,710,711,713,728,729,730,731,732,733,900,901,902,903,904,905,906,908,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1138,1139,1168,1169,7808,7809,7810,7811,7812,7813,7922,7923,8208,8209,8211,8212,8213,8215,8216,8217,8218,8219,8220,8221,8222,8224,8225,8226,8230,8240,8242,8243,8249,8250,8252,8254,8260,8319,8355,8356,8359,8364,8453,8467,8470,8482,8486,8494,8539,8540,8541,8542,8592,8593,8594,8595,8596,8597,8616,8706,8710,8719,8721,8722,8730,8734,8735,8745,8747,8776,8800,8801,8804,8805,8962,8976,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9600,9604,9608,9612,9616,9617,9618,9619,9632,9633,9642,9643,9644,9650,9658,9660,9668,9674,9675,9679,9688,9689,9702,9786,9787,9788,9792,9794,9824,9827,9829,9830,9834,9835,9836,61441,61442,61445,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];t.LiberationSansBoldItalicWidths=[365,0,333,278,333,474,556,556,889,722,238,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,333,333,584,584,584,611,975,722,722,722,722,667,611,778,722,278,556,722,611,833,722,778,667,778,722,667,611,722,667,944,667,667,611,333,278,333,584,556,333,556,611,556,611,556,333,611,611,278,278,556,278,889,611,611,611,611,389,556,333,611,556,778,556,556,500,389,280,389,584,333,556,556,556,556,280,556,333,737,370,556,584,737,552,400,549,333,333,333,576,556,278,333,333,365,556,834,834,834,611,722,722,722,722,722,722,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,556,556,556,556,556,278,278,278,278,611,611,611,611,611,611,611,549,611,611,611,611,611,556,611,556,722,556,722,556,722,556,722,556,722,556,722,556,722,556,722,740,722,611,667,556,667,556,667,556,667,556,667,556,778,611,778,611,778,611,778,611,722,611,722,611,278,278,278,278,278,278,278,278,278,278,782,556,556,278,722,556,556,611,278,611,278,611,396,611,479,611,278,722,611,722,611,722,611,708,723,611,778,611,778,611,778,611,1e3,944,722,389,722,389,722,389,667,556,667,556,667,556,667,556,611,333,611,479,611,333,722,611,722,611,722,611,722,611,722,611,722,611,944,778,667,556,667,611,500,611,500,611,500,278,556,722,556,1e3,889,778,611,667,556,611,333,333,333,333,333,333,333,333,333,333,333,333,722,333,854,906,473,844,930,847,278,722,722,610,671,667,611,722,778,278,722,667,833,722,657,778,718,667,590,611,667,822,667,829,781,278,667,620,479,611,278,591,620,621,556,610,479,492,611,558,278,566,556,603,556,450,611,712,605,532,664,409,591,704,578,773,834,278,591,611,591,834,667,667,886,614,719,667,278,278,556,1094,1042,854,622,719,677,719,722,708,722,614,722,667,927,643,719,719,615,687,833,722,778,719,667,722,611,677,781,667,729,708,979,989,854,1e3,708,719,1042,729,556,619,604,534,618,556,736,510,611,611,507,622,740,604,611,611,611,556,889,556,885,556,646,583,889,935,707,854,594,552,865,589,556,556,611,469,563,556,278,278,278,969,906,611,507,619,556,611,778,611,575,467,944,778,944,778,944,778,667,556,333,333,556,1e3,1e3,552,278,278,278,278,500,500,500,556,556,350,1e3,1e3,240,479,333,333,604,333,167,396,556,556,1104,556,885,516,1146,1e3,768,600,834,834,834,834,999,500,1e3,500,1e3,500,500,494,612,823,713,584,549,713,979,722,274,549,549,583,549,549,604,584,604,604,708,625,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,729,604,604,354,354,1e3,990,990,990,990,494,604,604,604,604,354,1021,1052,917,750,750,531,656,594,510,500,750,750,611,611,333,333,333,333,333,333,333,333,222,222,333,333,333,333,333,333,333,333];t.LiberationSansBoldItalicMapping=[-1,-1,-1,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,402,506,507,508,509,510,511,536,537,538,539,710,711,713,728,729,730,731,732,733,900,901,902,903,904,905,906,908,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1138,1139,1168,1169,7808,7809,7810,7811,7812,7813,7922,7923,8208,8209,8211,8212,8213,8215,8216,8217,8218,8219,8220,8221,8222,8224,8225,8226,8230,8240,8242,8243,8249,8250,8252,8254,8260,8319,8355,8356,8359,8364,8453,8467,8470,8482,8486,8494,8539,8540,8541,8542,8592,8593,8594,8595,8596,8597,8616,8706,8710,8719,8721,8722,8730,8734,8735,8745,8747,8776,8800,8801,8804,8805,8962,8976,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9600,9604,9608,9612,9616,9617,9618,9619,9632,9633,9642,9643,9644,9650,9658,9660,9668,9674,9675,9679,9688,9689,9702,9786,9787,9788,9792,9794,9824,9827,9829,9830,9834,9835,9836,61441,61442,61445,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];t.LiberationSansItalicWidths=[365,0,333,278,278,355,556,556,889,667,191,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,278,278,584,584,584,556,1015,667,667,722,722,667,611,778,722,278,500,667,556,833,722,778,667,778,722,667,611,722,667,944,667,667,611,278,278,278,469,556,333,556,556,500,556,556,278,556,556,222,222,500,222,833,556,556,556,556,333,500,278,556,500,722,500,500,500,334,260,334,584,333,556,556,556,556,260,556,333,737,370,556,584,737,552,400,549,333,333,333,576,537,278,333,333,365,556,834,834,834,611,667,667,667,667,667,667,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,500,556,556,556,556,278,278,278,278,556,556,556,556,556,556,556,549,611,556,556,556,556,500,556,500,667,556,667,556,667,556,722,500,722,500,722,500,722,500,722,625,722,556,667,556,667,556,667,556,667,556,667,556,778,556,778,556,778,556,778,556,722,556,722,556,278,278,278,278,278,278,278,222,278,278,733,444,500,222,667,500,500,556,222,556,222,556,281,556,400,556,222,722,556,722,556,722,556,615,723,556,778,556,778,556,778,556,1e3,944,722,333,722,333,722,333,667,500,667,500,667,500,667,500,611,278,611,354,611,278,722,556,722,556,722,556,722,556,722,556,722,556,944,722,667,500,667,611,500,611,500,611,500,222,556,667,556,1e3,889,778,611,667,500,611,278,333,333,333,333,333,333,333,333,333,333,333,667,278,789,846,389,794,865,775,222,667,667,570,671,667,611,722,778,278,667,667,833,722,648,778,725,667,600,611,667,837,667,831,761,278,667,570,439,555,222,550,570,571,500,556,439,463,555,542,222,500,492,548,500,447,556,670,573,486,603,374,550,652,546,728,779,222,550,556,550,779,667,667,843,544,708,667,278,278,500,1066,982,844,589,715,639,724,667,651,667,544,704,667,917,614,715,715,589,686,833,722,778,725,667,722,611,639,795,667,727,673,920,923,805,886,651,694,1022,682,556,562,522,493,553,556,688,465,556,556,472,564,686,550,556,556,556,500,833,500,835,500,572,518,830,851,621,736,526,492,752,534,556,556,556,378,496,500,222,222,222,910,828,556,472,565,500,556,778,556,492,339,944,722,944,722,944,722,667,500,333,333,556,1e3,1e3,552,222,222,222,222,333,333,333,556,556,350,1e3,1e3,188,354,333,333,500,333,167,365,556,556,1094,556,885,323,1083,1e3,768,600,834,834,834,834,1e3,500,998,500,1e3,500,500,494,612,823,713,584,549,713,979,719,274,549,549,584,549,549,604,584,604,604,708,625,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,729,604,604,354,354,1e3,990,990,990,990,494,604,604,604,604,354,1021,1052,917,750,750,531,656,594,510,500,750,750,500,500,333,333,333,333,333,333,333,333,222,222,294,294,324,324,316,328,398,285];t.LiberationSansItalicMapping=[-1,-1,-1,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,402,506,507,508,509,510,511,536,537,538,539,710,711,713,728,729,730,731,732,733,900,901,902,903,904,905,906,908,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1138,1139,1168,1169,7808,7809,7810,7811,7812,7813,7922,7923,8208,8209,8211,8212,8213,8215,8216,8217,8218,8219,8220,8221,8222,8224,8225,8226,8230,8240,8242,8243,8249,8250,8252,8254,8260,8319,8355,8356,8359,8364,8453,8467,8470,8482,8486,8494,8539,8540,8541,8542,8592,8593,8594,8595,8596,8597,8616,8706,8710,8719,8721,8722,8730,8734,8735,8745,8747,8776,8800,8801,8804,8805,8962,8976,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9600,9604,9608,9612,9616,9617,9618,9619,9632,9633,9642,9643,9644,9650,9658,9660,9668,9674,9675,9679,9688,9689,9702,9786,9787,9788,9792,9794,9824,9827,9829,9830,9834,9835,9836,61441,61442,61445,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];t.LiberationSansRegularWidths=[365,0,333,278,278,355,556,556,889,667,191,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,278,278,584,584,584,556,1015,667,667,722,722,667,611,778,722,278,500,667,556,833,722,778,667,778,722,667,611,722,667,944,667,667,611,278,278,278,469,556,333,556,556,500,556,556,278,556,556,222,222,500,222,833,556,556,556,556,333,500,278,556,500,722,500,500,500,334,260,334,584,333,556,556,556,556,260,556,333,737,370,556,584,737,552,400,549,333,333,333,576,537,278,333,333,365,556,834,834,834,611,667,667,667,667,667,667,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,500,556,556,556,556,278,278,278,278,556,556,556,556,556,556,556,549,611,556,556,556,556,500,556,500,667,556,667,556,667,556,722,500,722,500,722,500,722,500,722,615,722,556,667,556,667,556,667,556,667,556,667,556,778,556,778,556,778,556,778,556,722,556,722,556,278,278,278,278,278,278,278,222,278,278,735,444,500,222,667,500,500,556,222,556,222,556,292,556,334,556,222,722,556,722,556,722,556,604,723,556,778,556,778,556,778,556,1e3,944,722,333,722,333,722,333,667,500,667,500,667,500,667,500,611,278,611,375,611,278,722,556,722,556,722,556,722,556,722,556,722,556,944,722,667,500,667,611,500,611,500,611,500,222,556,667,556,1e3,889,778,611,667,500,611,278,333,333,333,333,333,333,333,333,333,333,333,667,278,784,838,384,774,855,752,222,667,667,551,668,667,611,722,778,278,667,668,833,722,650,778,722,667,618,611,667,798,667,835,748,278,667,578,446,556,222,547,578,575,500,557,446,441,556,556,222,500,500,576,500,448,556,690,569,482,617,395,547,648,525,713,781,222,547,556,547,781,667,667,865,542,719,667,278,278,500,1057,1010,854,583,722,635,719,667,656,667,542,677,667,923,604,719,719,583,656,833,722,778,719,667,722,611,635,760,667,740,667,917,938,792,885,656,719,1010,722,556,573,531,365,583,556,669,458,559,559,438,583,688,552,556,542,556,500,458,500,823,500,573,521,802,823,625,719,521,510,750,542,556,556,556,365,510,500,222,278,222,906,812,556,438,559,500,552,778,556,489,411,944,722,944,722,944,722,667,500,333,333,556,1e3,1e3,552,222,222,222,222,333,333,333,556,556,350,1e3,1e3,188,354,333,333,500,333,167,365,556,556,1094,556,885,323,1073,1e3,768,600,834,834,834,834,1e3,500,1e3,500,1e3,500,500,494,612,823,713,584,549,713,979,719,274,549,549,583,549,549,604,584,604,604,708,625,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,729,604,604,354,354,1e3,990,990,990,990,494,604,604,604,604,354,1021,1052,917,750,750,531,656,594,510,500,750,750,500,500,333,333,333,333,333,333,333,333,222,222,294,294,324,324,316,328,398,285];t.LiberationSansRegularMapping=[-1,-1,-1,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,402,506,507,508,509,510,511,536,537,538,539,710,711,713,728,729,730,731,732,733,900,901,902,903,904,905,906,908,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1138,1139,1168,1169,7808,7809,7810,7811,7812,7813,7922,7923,8208,8209,8211,8212,8213,8215,8216,8217,8218,8219,8220,8221,8222,8224,8225,8226,8230,8240,8242,8243,8249,8250,8252,8254,8260,8319,8355,8356,8359,8364,8453,8467,8470,8482,8486,8494,8539,8540,8541,8542,8592,8593,8594,8595,8596,8597,8616,8706,8710,8719,8721,8722,8730,8734,8735,8745,8747,8776,8800,8801,8804,8805,8962,8976,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9600,9604,9608,9612,9616,9617,9618,9619,9632,9633,9642,9643,9644,9650,9658,9660,9668,9674,9675,9679,9688,9689,9702,9786,9787,9788,9792,9794,9824,9827,9829,9830,9834,9835,9836,61441,61442,61445,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.MyriadProRegularMetrics=t.MyriadProRegularFactors=t.MyriadProItalicMetrics=t.MyriadProItalicFactors=t.MyriadProBoldMetrics=t.MyriadProBoldItalicMetrics=t.MyriadProBoldItalicFactors=t.MyriadProBoldFactors=void 0;t.MyriadProBoldFactors=[1.36898,1,1,.72706,.80479,.83734,.98894,.99793,.9897,.93884,.86209,.94292,.94292,1.16661,1.02058,.93582,.96694,.93582,1.19137,.99793,.99793,.99793,.99793,.99793,.99793,.99793,.99793,.99793,.99793,.78076,.78076,1.02058,1.02058,1.02058,.72851,.78966,.90838,.83637,.82391,.96376,.80061,.86275,.8768,.95407,1.0258,.73901,.85022,.83655,1.0156,.95546,.92179,.87107,.92179,.82114,.8096,.89713,.94438,.95353,.94083,.91905,.90406,.9446,.94292,1.18777,.94292,1.02058,.89903,.90088,.94938,.97898,.81093,.97571,.94938,1.024,.9577,.95933,.98621,1.0474,.97455,.98981,.9672,.95933,.9446,.97898,.97407,.97646,.78036,1.10208,.95442,.95298,.97579,.9332,.94039,.938,.80687,1.01149,.80687,1.02058,.80479,.99793,.99793,.99793,.99793,1.01149,1.00872,.90088,.91882,1.0213,.8361,1.02058,.62295,.54324,.89022,1.08595,1,1,.90088,1,.97455,.93582,.90088,1,1.05686,.8361,.99642,.99642,.99642,.72851,.90838,.90838,.90838,.90838,.90838,.90838,.868,.82391,.80061,.80061,.80061,.80061,1.0258,1.0258,1.0258,1.0258,.97484,.95546,.92179,.92179,.92179,.92179,.92179,1.02058,.92179,.94438,.94438,.94438,.94438,.90406,.86958,.98225,.94938,.94938,.94938,.94938,.94938,.94938,.9031,.81093,.94938,.94938,.94938,.94938,.98621,.98621,.98621,.98621,.93969,.95933,.9446,.9446,.9446,.9446,.9446,1.08595,.9446,.95442,.95442,.95442,.95442,.94039,.97898,.94039,.90838,.94938,.90838,.94938,.90838,.94938,.82391,.81093,.82391,.81093,.82391,.81093,.82391,.81093,.96376,.84313,.97484,.97571,.80061,.94938,.80061,.94938,.80061,.94938,.80061,.94938,.80061,.94938,.8768,.9577,.8768,.9577,.8768,.9577,1,1,.95407,.95933,.97069,.95933,1.0258,.98621,1.0258,.98621,1.0258,.98621,1.0258,.98621,1.0258,.98621,.887,1.01591,.73901,1.0474,1,1,.97455,.83655,.98981,1,1,.83655,.73977,.83655,.73903,.84638,1.033,.95546,.95933,1,1,.95546,.95933,.8271,.95417,.95933,.92179,.9446,.92179,.9446,.92179,.9446,.936,.91964,.82114,.97646,1,1,.82114,.97646,.8096,.78036,.8096,.78036,1,1,.8096,.78036,1,1,.89713,.77452,.89713,1.10208,.94438,.95442,.94438,.95442,.94438,.95442,.94438,.95442,.94438,.95442,.94438,.95442,.94083,.97579,.90406,.94039,.90406,.9446,.938,.9446,.938,.9446,.938,1,.99793,.90838,.94938,.868,.9031,.92179,.9446,1,1,.89713,1.10208,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90989,.9358,.91945,.83181,.75261,.87992,.82976,.96034,.83689,.97268,1.0078,.90838,.83637,.8019,.90157,.80061,.9446,.95407,.92436,1.0258,.85022,.97153,1.0156,.95546,.89192,.92179,.92361,.87107,.96318,.89713,.93704,.95638,.91905,.91709,.92796,1.0258,.93704,.94836,1.0373,.95933,1.0078,.95871,.94836,.96174,.92601,.9498,.98607,.95776,.95933,1.05453,1.0078,.98275,.9314,.95617,.91701,1.05993,.9446,.78367,.9553,1,.86832,1.0128,.95871,.99394,.87548,.96361,.86774,1.0078,.95871,.9446,.95871,.86774,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.94083,.97579,.94083,.97579,.94083,.97579,.90406,.94039,.96694,1,.89903,1,1,1,.93582,.93582,.93582,1,.908,.908,.918,.94219,.94219,.96544,1,1.285,1,1,.81079,.81079,1,1,.74854,1,1,1,1,.99793,1,1,1,.65,1,1.36145,1,1,1,1,1,1,1,1,1,1,1,1.17173,1,.80535,.76169,1.02058,1.0732,1.05486,1,1,1.30692,1.08595,1.08595,1,1.08595,1.08595,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.16161,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];t.MyriadProBoldMetrics={lineHeight:1.2,lineGap:.2};t.MyriadProBoldItalicFactors=[1.36898,1,1,.66227,.80779,.81625,.97276,.97276,.97733,.92222,.83266,.94292,.94292,1.16148,1.02058,.93582,.96694,.93582,1.17337,.97276,.97276,.97276,.97276,.97276,.97276,.97276,.97276,.97276,.97276,.78076,.78076,1.02058,1.02058,1.02058,.71541,.76813,.85576,.80591,.80729,.94299,.77512,.83655,.86523,.92222,.98621,.71743,.81698,.79726,.98558,.92222,.90637,.83809,.90637,.80729,.76463,.86275,.90699,.91605,.9154,.85308,.85458,.90531,.94292,1.21296,.94292,1.02058,.89903,1.18616,.99613,.91677,.78216,.91677,.90083,.98796,.9135,.92168,.95381,.98981,.95298,.95381,.93459,.92168,.91513,.92004,.91677,.95077,.748,1.04502,.91677,.92061,.94236,.89544,.89364,.9,.80687,.8578,.80687,1.02058,.80779,.97276,.97276,.97276,.97276,.8578,.99973,1.18616,.91339,1.08074,.82891,1.02058,.55509,.71526,.89022,1.08595,1,1,1.18616,1,.96736,.93582,1.18616,1,1.04864,.82711,.99043,.99043,.99043,.71541,.85576,.85576,.85576,.85576,.85576,.85576,.845,.80729,.77512,.77512,.77512,.77512,.98621,.98621,.98621,.98621,.95961,.92222,.90637,.90637,.90637,.90637,.90637,1.02058,.90251,.90699,.90699,.90699,.90699,.85458,.83659,.94951,.99613,.99613,.99613,.99613,.99613,.99613,.85811,.78216,.90083,.90083,.90083,.90083,.95381,.95381,.95381,.95381,.9135,.92168,.91513,.91513,.91513,.91513,.91513,1.08595,.91677,.91677,.91677,.91677,.91677,.89364,.92332,.89364,.85576,.99613,.85576,.99613,.85576,.99613,.80729,.78216,.80729,.78216,.80729,.78216,.80729,.78216,.94299,.76783,.95961,.91677,.77512,.90083,.77512,.90083,.77512,.90083,.77512,.90083,.77512,.90083,.86523,.9135,.86523,.9135,.86523,.9135,1,1,.92222,.92168,.92222,.92168,.98621,.95381,.98621,.95381,.98621,.95381,.98621,.95381,.98621,.95381,.86036,.97096,.71743,.98981,1,1,.95298,.79726,.95381,1,1,.79726,.6894,.79726,.74321,.81691,1.0006,.92222,.92168,1,1,.92222,.92168,.79464,.92098,.92168,.90637,.91513,.90637,.91513,.90637,.91513,.909,.87514,.80729,.95077,1,1,.80729,.95077,.76463,.748,.76463,.748,1,1,.76463,.748,1,1,.86275,.72651,.86275,1.04502,.90699,.91677,.90699,.91677,.90699,.91677,.90699,.91677,.90699,.91677,.90699,.91677,.9154,.94236,.85458,.89364,.85458,.90531,.9,.90531,.9,.90531,.9,1,.97276,.85576,.99613,.845,.85811,.90251,.91677,1,1,.86275,1.04502,1.18616,1.18616,1.18616,1.18616,1.18616,1.18616,1.18616,1.18616,1.18616,1.00899,1.30628,.85576,.80178,.66862,.7927,.69323,.88127,.72459,.89711,.95381,.85576,.80591,.7805,.94729,.77512,.90531,.92222,.90637,.98621,.81698,.92655,.98558,.92222,.85359,.90637,.90976,.83809,.94523,.86275,.83509,.93157,.85308,.83392,.92346,.98621,.83509,.92886,.91324,.92168,.95381,.90646,.92886,.90557,.86847,.90276,.91324,.86842,.92168,.99531,.95381,.9224,.85408,.92699,.86847,1.0051,.91513,.80487,.93481,1,.88159,1.05214,.90646,.97355,.81539,.89398,.85923,.95381,.90646,.91513,.90646,.85923,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.9154,.94236,.9154,.94236,.9154,.94236,.85458,.89364,.96694,1,.89903,1,1,1,.91782,.91782,.91782,1,.896,.896,.896,.9332,.9332,.95973,1,1.26,1,1,.80479,.80178,1,1,.85633,1,1,1,1,.97276,1,1,1,.698,1,1.36145,1,1,1,1,1,1,1,1,1,1,1,1.14542,1,.79199,.78694,1.02058,1.03493,1.05486,1,1,1.23026,1.08595,1.08595,1,1.08595,1.08595,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.20006,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];t.MyriadProBoldItalicMetrics={lineHeight:1.2,lineGap:.2};t.MyriadProItalicFactors=[1.36898,1,1,.65507,.84943,.85639,.88465,.88465,.86936,.88307,.86948,.85283,.85283,1.06383,1.02058,.75945,.9219,.75945,1.17337,.88465,.88465,.88465,.88465,.88465,.88465,.88465,.88465,.88465,.88465,.75945,.75945,1.02058,1.02058,1.02058,.69046,.70926,.85158,.77812,.76852,.89591,.70466,.76125,.80094,.86822,.83864,.728,.77212,.79475,.93637,.87514,.8588,.76013,.8588,.72421,.69866,.77598,.85991,.80811,.87832,.78112,.77512,.8562,1.0222,1.18417,1.0222,1.27014,.89903,1.15012,.93859,.94399,.846,.94399,.81453,1.0186,.94219,.96017,1.03075,1.02175,.912,1.03075,.96998,.96017,.93859,.94399,.94399,.95493,.746,1.12658,.94578,.91,.979,.882,.882,.83,.85034,.83537,.85034,1.02058,.70869,.88465,.88465,.88465,.88465,.83537,.90083,1.15012,.9161,.94565,.73541,1.02058,.53609,.69353,.79519,1.08595,1,1,1.15012,1,.91974,.75945,1.15012,1,.9446,.73361,.9005,.9005,.9005,.62864,.85158,.85158,.85158,.85158,.85158,.85158,.773,.76852,.70466,.70466,.70466,.70466,.83864,.83864,.83864,.83864,.90561,.87514,.8588,.8588,.8588,.8588,.8588,1.02058,.85751,.85991,.85991,.85991,.85991,.77512,.76013,.88075,.93859,.93859,.93859,.93859,.93859,.93859,.8075,.846,.81453,.81453,.81453,.81453,.82424,.82424,.82424,.82424,.9278,.96017,.93859,.93859,.93859,.93859,.93859,1.08595,.8562,.94578,.94578,.94578,.94578,.882,.94578,.882,.85158,.93859,.85158,.93859,.85158,.93859,.76852,.846,.76852,.846,.76852,.846,.76852,.846,.89591,.8544,.90561,.94399,.70466,.81453,.70466,.81453,.70466,.81453,.70466,.81453,.70466,.81453,.80094,.94219,.80094,.94219,.80094,.94219,1,1,.86822,.96017,.86822,.96017,.83864,.82424,.83864,.82424,.83864,.82424,.83864,1.03075,.83864,.82424,.81402,1.02738,.728,1.02175,1,1,.912,.79475,1.03075,1,1,.79475,.83911,.79475,.66266,.80553,1.06676,.87514,.96017,1,1,.87514,.96017,.86865,.87396,.96017,.8588,.93859,.8588,.93859,.8588,.93859,.867,.84759,.72421,.95493,1,1,.72421,.95493,.69866,.746,.69866,.746,1,1,.69866,.746,1,1,.77598,.88417,.77598,1.12658,.85991,.94578,.85991,.94578,.85991,.94578,.85991,.94578,.85991,.94578,.85991,.94578,.87832,.979,.77512,.882,.77512,.8562,.83,.8562,.83,.8562,.83,1,.88465,.85158,.93859,.773,.8075,.85751,.8562,1,1,.77598,1.12658,1.15012,1.15012,1.15012,1.15012,1.15012,1.15313,1.15012,1.15012,1.15012,1.08106,1.03901,.85158,.77025,.62264,.7646,.65351,.86026,.69461,.89947,1.03075,.85158,.77812,.76449,.88836,.70466,.8562,.86822,.8588,.83864,.77212,.85308,.93637,.87514,.82352,.8588,.85701,.76013,.89058,.77598,.8156,.82565,.78112,.77899,.89386,.83864,.8156,.9486,.92388,.96186,1.03075,.91123,.9486,.93298,.878,.93942,.92388,.84596,.96186,.95119,1.03075,.922,.88787,.95829,.88,.93559,.93859,.78815,.93758,1,.89217,1.03737,.91123,.93969,.77487,.85769,.86799,1.03075,.91123,.93859,.91123,.86799,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.87832,.979,.87832,.979,.87832,.979,.77512,.882,.9219,1,.89903,1,1,1,.87321,.87321,.87321,1,1.027,1.027,1.027,.86847,.86847,.79121,1,1.124,1,1,.73572,.73572,1,1,.85034,1,1,1,1,.88465,1,1,1,.669,1,1.36145,1,1,1,1,1,1,1,1,1,1,1,1.04828,1,.74948,.75187,1.02058,.98391,1.02119,1,1,1.06233,1.08595,1.08595,1,1.08595,1.08595,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.05233,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];t.MyriadProItalicMetrics={lineHeight:1.2,lineGap:.2};t.MyriadProRegularFactors=[1.36898,1,1,.76305,.82784,.94935,.89364,.92241,.89073,.90706,.98472,.85283,.85283,1.0664,1.02058,.74505,.9219,.74505,1.23456,.92241,.92241,.92241,.92241,.92241,.92241,.92241,.92241,.92241,.92241,.74505,.74505,1.02058,1.02058,1.02058,.73002,.72601,.91755,.8126,.80314,.92222,.73764,.79726,.83051,.90284,.86023,.74,.8126,.84869,.96518,.91115,.8858,.79761,.8858,.74498,.73914,.81363,.89591,.83659,.89633,.85608,.8111,.90531,1.0222,1.22736,1.0222,1.27014,.89903,.90088,.86667,1.0231,.896,1.01411,.90083,1.05099,1.00512,.99793,1.05326,1.09377,.938,1.06226,1.00119,.99793,.98714,1.0231,1.01231,.98196,.792,1.19137,.99074,.962,1.01915,.926,.942,.856,.85034,.92006,.85034,1.02058,.69067,.92241,.92241,.92241,.92241,.92006,.9332,.90088,.91882,.93484,.75339,1.02058,.56866,.54324,.79519,1.08595,1,1,.90088,1,.95325,.74505,.90088,1,.97198,.75339,.91009,.91009,.91009,.66466,.91755,.91755,.91755,.91755,.91755,.91755,.788,.80314,.73764,.73764,.73764,.73764,.86023,.86023,.86023,.86023,.92915,.91115,.8858,.8858,.8858,.8858,.8858,1.02058,.8858,.89591,.89591,.89591,.89591,.8111,.79611,.89713,.86667,.86667,.86667,.86667,.86667,.86667,.86936,.896,.90083,.90083,.90083,.90083,.84224,.84224,.84224,.84224,.97276,.99793,.98714,.98714,.98714,.98714,.98714,1.08595,.89876,.99074,.99074,.99074,.99074,.942,1.0231,.942,.91755,.86667,.91755,.86667,.91755,.86667,.80314,.896,.80314,.896,.80314,.896,.80314,.896,.92222,.93372,.92915,1.01411,.73764,.90083,.73764,.90083,.73764,.90083,.73764,.90083,.73764,.90083,.83051,1.00512,.83051,1.00512,.83051,1.00512,1,1,.90284,.99793,.90976,.99793,.86023,.84224,.86023,.84224,.86023,.84224,.86023,1.05326,.86023,.84224,.82873,1.07469,.74,1.09377,1,1,.938,.84869,1.06226,1,1,.84869,.83704,.84869,.81441,.85588,1.08927,.91115,.99793,1,1,.91115,.99793,.91887,.90991,.99793,.8858,.98714,.8858,.98714,.8858,.98714,.894,.91434,.74498,.98196,1,1,.74498,.98196,.73914,.792,.73914,.792,1,1,.73914,.792,1,1,.81363,.904,.81363,1.19137,.89591,.99074,.89591,.99074,.89591,.99074,.89591,.99074,.89591,.99074,.89591,.99074,.89633,1.01915,.8111,.942,.8111,.90531,.856,.90531,.856,.90531,.856,1,.92241,.91755,.86667,.788,.86936,.8858,.89876,1,1,.81363,1.19137,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90388,1.03901,.92138,.78105,.7154,.86169,.80513,.94007,.82528,.98612,1.06226,.91755,.8126,.81884,.92819,.73764,.90531,.90284,.8858,.86023,.8126,.91172,.96518,.91115,.83089,.8858,.87791,.79761,.89297,.81363,.88157,.89992,.85608,.81992,.94307,.86023,.88157,.95308,.98699,.99793,1.06226,.95817,.95308,.97358,.928,.98088,.98699,.92761,.99793,.96017,1.06226,.986,.944,.95978,.938,.96705,.98714,.80442,.98972,1,.89762,1.04552,.95817,.99007,.87064,.91879,.88888,1.06226,.95817,.98714,.95817,.88888,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.89633,1.01915,.89633,1.01915,.89633,1.01915,.8111,.942,.9219,1,.89903,1,1,1,.93173,.93173,.93173,1,1.06304,1.06304,1.06904,.89903,.89903,.80549,1,1.156,1,1,.76575,.76575,1,1,.72458,1,1,1,1,.92241,1,1,1,.619,1,1.36145,1,1,1,1,1,1,1,1,1,1,1,1.07257,1,.74705,.71119,1.02058,1.024,1.02119,1,1,1.1536,1.08595,1.08595,1,1.08595,1.08595,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.05638,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];t.MyriadProRegularMetrics={lineHeight:1.2,lineGap:.2}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.SegoeuiRegularMetrics=t.SegoeuiRegularFactors=t.SegoeuiItalicMetrics=t.SegoeuiItalicFactors=t.SegoeuiBoldMetrics=t.SegoeuiBoldItalicMetrics=t.SegoeuiBoldItalicFactors=t.SegoeuiBoldFactors=void 0;t.SegoeuiBoldFactors=[1.76738,1,1,.99297,.9824,1.04016,1.06497,1.03424,.97529,1.17647,1.23203,1.1085,1.1085,1.16939,1.2107,.9754,1.21408,.9754,1.59578,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,.81378,.81378,1.2107,1.2107,1.2107,.71703,.97847,.97363,.88776,.8641,1.02096,.79795,.85132,.914,1.06085,1.1406,.8007,.89858,.83693,1.14889,1.09398,.97489,.92094,.97489,.90399,.84041,.95923,1.00135,1,1.06467,.98243,.90996,.99361,1.1085,1.56942,1.1085,1.2107,.74627,.94282,.96752,1.01519,.86304,1.01359,.97278,1.15103,1.01359,.98561,1.02285,1.02285,1.00527,1.02285,1.0302,.99041,1.0008,1.01519,1.01359,1.02258,.79104,1.16862,.99041,.97454,1.02511,.99298,.96752,.95801,.94856,1.16579,.94856,1.2107,.9824,1.03424,1.03424,1,1.03424,1.16579,.8727,1.3871,1.18622,1.10818,1.04478,1.2107,1.18622,.75155,.94994,1.28826,1.21408,1.21408,.91056,1,.91572,.9754,.64663,1.18328,1.24866,1.04478,1.14169,1.15749,1.17389,.71703,.97363,.97363,.97363,.97363,.97363,.97363,.93506,.8641,.79795,.79795,.79795,.79795,1.1406,1.1406,1.1406,1.1406,1.02096,1.09398,.97426,.97426,.97426,.97426,.97426,1.2107,.97489,1.00135,1.00135,1.00135,1.00135,.90996,.92094,1.02798,.96752,.96752,.96752,.96752,.96752,.96752,.93136,.86304,.97278,.97278,.97278,.97278,1.02285,1.02285,1.02285,1.02285,.97122,.99041,1,1,1,1,1,1.28826,1.0008,.99041,.99041,.99041,.99041,.96752,1.01519,.96752,.97363,.96752,.97363,.96752,.97363,.96752,.8641,.86304,.8641,.86304,.8641,.86304,.8641,.86304,1.02096,1.03057,1.02096,1.03517,.79795,.97278,.79795,.97278,.79795,.97278,.79795,.97278,.79795,.97278,.914,1.01359,.914,1.01359,.914,1.01359,1,1,1.06085,.98561,1.06085,1.00879,1.1406,1.02285,1.1406,1.02285,1.1406,1.02285,1.1406,1.02285,1.1406,1.02285,.97138,1.08692,.8007,1.02285,1,1,1.00527,.83693,1.02285,1,1,.83693,.9455,.83693,.90418,.83693,1.13005,1.09398,.99041,1,1,1.09398,.99041,.96692,1.09251,.99041,.97489,1.0008,.97489,1.0008,.97489,1.0008,.93994,.97931,.90399,1.02258,1,1,.90399,1.02258,.84041,.79104,.84041,.79104,.84041,.79104,.84041,.79104,1,1,.95923,1.07034,.95923,1.16862,1.00135,.99041,1.00135,.99041,1.00135,.99041,1.00135,.99041,1.00135,.99041,1.00135,.99041,1.06467,1.02511,.90996,.96752,.90996,.99361,.95801,.99361,.95801,.99361,.95801,1.07733,1.03424,.97363,.96752,.93506,.93136,.97489,1.0008,1,1,.95923,1.16862,1.15103,1.15103,1.01173,1.03959,.75953,.81378,.79912,1.15103,1.21994,.95161,.87815,1.01149,.81525,.7676,.98167,1.01134,1.02546,.84097,1.03089,1.18102,.97363,.88776,.85134,.97826,.79795,.99361,1.06085,.97489,1.1406,.89858,1.0388,1.14889,1.09398,.86039,.97489,1.0595,.92094,.94793,.95923,.90996,.99346,.98243,1.02112,.95493,1.1406,.90996,1.03574,1.02597,1.0008,1.18102,1.06628,1.03574,1.0192,1.01932,1.00886,.97531,1.0106,1.0008,1.13189,1.18102,1.02277,.98683,1.0016,.99561,1.07237,1.0008,.90434,.99921,.93803,.8965,1.23085,1.06628,1.04983,.96268,1.0499,.98439,1.18102,1.06628,1.0008,1.06628,.98439,.79795,1,1,1,1,1,1,1,1,1,1,1,1,1.09466,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.97278,1,1,1,1,1,1,1,1,1,1,1,1,1.02065,1,1,1,1,1,1,1.06467,1.02511,1.06467,1.02511,1.06467,1.02511,.90996,.96752,1,1.21408,.89903,1,1,.75155,1.04394,1.04394,1.04394,1.04394,.98633,.98633,.98633,.73047,.73047,1.20642,.91211,1.25635,1.222,1.02956,1.03372,1.03372,.96039,1.24633,1,1.12454,.93503,1.03424,1.19687,1.03424,1,1,1,.771,1,1,1.15749,1.15749,1.15749,1.10948,.86279,.94434,.86279,.94434,.86182,1,1,1.16897,1,.96085,.90137,1.2107,1.18416,1.13973,.69825,.9716,2.10339,1.29004,1.29004,1.21172,1.29004,1.29004,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.42603,1,.99862,.99862,1,.87025,.87025,.87025,.87025,1.18874,1.42603,1,1.42603,1.42603,.99862,1,1,1,1,1,1.2886,1.04315,1.15296,1.34163,1,1,1,1.09193,1.09193,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];t.SegoeuiBoldMetrics={lineHeight:1.33008,lineGap:0};t.SegoeuiBoldItalicFactors=[1.76738,1,1,.98946,1.03959,1.04016,1.02809,1.036,.97639,1.10953,1.23203,1.11144,1.11144,1.16939,1.21237,.9754,1.21261,.9754,1.59754,1.036,1.036,1.036,1.036,1.036,1.036,1.036,1.036,1.036,1.036,.81378,.81378,1.21237,1.21237,1.21237,.73541,.97847,.97363,.89723,.87897,1.0426,.79429,.85292,.91149,1.05815,1.1406,.79631,.90128,.83853,1.04396,1.10615,.97552,.94436,.97552,.88641,.80527,.96083,1.00135,1,1.06777,.9817,.91142,.99361,1.11144,1.57293,1.11144,1.21237,.74627,1.31818,1.06585,.97042,.83055,.97042,.93503,1.1261,.97042,.97922,1.14236,.94552,1.01054,1.14236,1.02471,.97922,.94165,.97042,.97042,1.0276,.78929,1.1261,.97922,.95874,1.02197,.98507,.96752,.97168,.95107,1.16579,.95107,1.21237,1.03959,1.036,1.036,1,1.036,1.16579,.87357,1.31818,1.18754,1.26781,1.05356,1.21237,1.18622,.79487,.94994,1.29004,1.24047,1.24047,1.31818,1,.91484,.9754,1.31818,1.1349,1.24866,1.05356,1.13934,1.15574,1.17389,.73541,.97363,.97363,.97363,.97363,.97363,.97363,.94385,.87897,.79429,.79429,.79429,.79429,1.1406,1.1406,1.1406,1.1406,1.0426,1.10615,.97552,.97552,.97552,.97552,.97552,1.21237,.97552,1.00135,1.00135,1.00135,1.00135,.91142,.94436,.98721,1.06585,1.06585,1.06585,1.06585,1.06585,1.06585,.96705,.83055,.93503,.93503,.93503,.93503,1.14236,1.14236,1.14236,1.14236,.93125,.97922,.94165,.94165,.94165,.94165,.94165,1.29004,.94165,.97922,.97922,.97922,.97922,.96752,.97042,.96752,.97363,1.06585,.97363,1.06585,.97363,1.06585,.87897,.83055,.87897,.83055,.87897,.83055,.87897,.83055,1.0426,1.0033,1.0426,.97042,.79429,.93503,.79429,.93503,.79429,.93503,.79429,.93503,.79429,.93503,.91149,.97042,.91149,.97042,.91149,.97042,1,1,1.05815,.97922,1.05815,.97922,1.1406,1.14236,1.1406,1.14236,1.1406,1.14236,1.1406,1.14236,1.1406,1.14236,.97441,1.04302,.79631,1.01582,1,1,1.01054,.83853,1.14236,1,1,.83853,1.09125,.83853,.90418,.83853,1.19508,1.10615,.97922,1,1,1.10615,.97922,1.01034,1.10466,.97922,.97552,.94165,.97552,.94165,.97552,.94165,.91602,.91981,.88641,1.0276,1,1,.88641,1.0276,.80527,.78929,.80527,.78929,.80527,.78929,.80527,.78929,1,1,.96083,1.05403,.95923,1.16862,1.00135,.97922,1.00135,.97922,1.00135,.97922,1.00135,.97922,1.00135,.97922,1.00135,.97922,1.06777,1.02197,.91142,.96752,.91142,.99361,.97168,.99361,.97168,.99361,.97168,1.23199,1.036,.97363,1.06585,.94385,.96705,.97552,.94165,1,1,.96083,1.1261,1.31818,1.31818,1.31818,1.31818,1.31818,1.31818,1.31818,1.31818,1.31818,.95161,1.27126,1.00811,.83284,.77702,.99137,.95253,1.0347,.86142,1.07205,1.14236,.97363,.89723,.86869,1.09818,.79429,.99361,1.05815,.97552,1.1406,.90128,1.06662,1.04396,1.10615,.84918,.97552,1.04694,.94436,.98015,.96083,.91142,1.00356,.9817,1.01945,.98999,1.1406,.91142,1.04961,.9898,1.00639,1.14236,1.07514,1.04961,.99607,1.02897,1.008,.9898,.95134,1.00639,1.11121,1.14236,1.00518,.97981,1.02186,1,1.08578,.94165,.99314,.98387,.93028,.93377,1.35125,1.07514,1.10687,.93491,1.04232,1.00351,1.14236,1.07514,.94165,1.07514,1.00351,.79429,1,1,1,1,1,1,1,1,1,1,1,1,1.09097,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.93503,1,1,1,1,1,1,1,1,1,1,1,1,.96609,1,1,1,1,1,1,1.06777,1.02197,1.06777,1.02197,1.06777,1.02197,.91142,.96752,1,1.21261,.89903,1,1,.75155,1.04745,1.04745,1.04745,1.04394,.98633,.98633,.98633,.72959,.72959,1.20502,.91406,1.26514,1.222,1.02956,1.03372,1.03372,.96039,1.24633,1,1.09125,.93327,1.03336,1.16541,1.036,1,1,1,.771,1,1,1.15574,1.15574,1.15574,1.15574,.86364,.94434,.86279,.94434,.86224,1,1,1.16798,1,.96085,.90068,1.21237,1.18416,1.13904,.69825,.9716,2.10339,1.29004,1.29004,1.21339,1.29004,1.29004,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.42603,1,.99862,.99862,1,.87025,.87025,.87025,.87025,1.18775,1.42603,1,1.42603,1.42603,.99862,1,1,1,1,1,1.2886,1.04315,1.15296,1.34163,1,1,1,1.13269,1.13269,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];t.SegoeuiBoldItalicMetrics={lineHeight:1.33008,lineGap:0};t.SegoeuiItalicFactors=[1.76738,1,1,.98946,1.14763,1.05365,1.06234,.96927,.92586,1.15373,1.18414,.91349,.91349,1.07403,1.17308,.78383,1.20088,.78383,1.42531,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.78383,.78383,1.17308,1.17308,1.17308,.77349,.94565,.94729,.85944,.88506,.9858,.74817,.80016,.88449,.98039,.95782,.69238,.89898,.83231,.98183,1.03989,.96924,.86237,.96924,.80595,.74524,.86091,.95402,.94143,.98448,.8858,.83089,.93285,1.0949,1.39016,1.0949,1.45994,.74627,1.04839,.97454,.97454,.87207,.97454,.87533,1.06151,.97454,1.00176,1.16484,1.08132,.98047,1.16484,1.02989,1.01054,.96225,.97454,.97454,1.06598,.79004,1.16344,1.00351,.94629,.9973,.91016,.96777,.9043,.91082,.92481,.91082,1.17308,.95748,.96927,.96927,1,.96927,.92481,.80597,1.04839,1.23393,1.1781,.9245,1.17308,1.20808,.63218,.94261,1.24822,1.09971,1.09971,1.04839,1,.85273,.78032,1.04839,1.09971,1.22326,.9245,1.09836,1.13525,1.15222,.70424,.94729,.94729,.94729,.94729,.94729,.94729,.85498,.88506,.74817,.74817,.74817,.74817,.95782,.95782,.95782,.95782,.9858,1.03989,.96924,.96924,.96924,.96924,.96924,1.17308,.96924,.95402,.95402,.95402,.95402,.83089,.86237,.88409,.97454,.97454,.97454,.97454,.97454,.97454,.92916,.87207,.87533,.87533,.87533,.87533,.93146,.93146,.93146,.93146,.93854,1.01054,.96225,.96225,.96225,.96225,.96225,1.24822,.8761,1.00351,1.00351,1.00351,1.00351,.96777,.97454,.96777,.94729,.97454,.94729,.97454,.94729,.97454,.88506,.87207,.88506,.87207,.88506,.87207,.88506,.87207,.9858,.95391,.9858,.97454,.74817,.87533,.74817,.87533,.74817,.87533,.74817,.87533,.74817,.87533,.88449,.97454,.88449,.97454,.88449,.97454,1,1,.98039,1.00176,.98039,1.00176,.95782,.93146,.95782,.93146,.95782,.93146,.95782,1.16484,.95782,.93146,.84421,1.12761,.69238,1.08132,1,1,.98047,.83231,1.16484,1,1,.84723,1.04861,.84723,.78755,.83231,1.23736,1.03989,1.01054,1,1,1.03989,1.01054,.9857,1.03849,1.01054,.96924,.96225,.96924,.96225,.96924,.96225,.92383,.90171,.80595,1.06598,1,1,.80595,1.06598,.74524,.79004,.74524,.79004,.74524,.79004,.74524,.79004,1,1,.86091,1.02759,.85771,1.16344,.95402,1.00351,.95402,1.00351,.95402,1.00351,.95402,1.00351,.95402,1.00351,.95402,1.00351,.98448,.9973,.83089,.96777,.83089,.93285,.9043,.93285,.9043,.93285,.9043,1.31868,.96927,.94729,.97454,.85498,.92916,.96924,.8761,1,1,.86091,1.16344,1.04839,1.04839,1.04839,1.04839,1.04839,1.04839,1.04839,1.04839,1.04839,.81965,.81965,.94729,.78032,.71022,.90883,.84171,.99877,.77596,1.05734,1.2,.94729,.85944,.82791,.9607,.74817,.93285,.98039,.96924,.95782,.89898,.98316,.98183,1.03989,.78614,.96924,.97642,.86237,.86075,.86091,.83089,.90082,.8858,.97296,1.01284,.95782,.83089,1.0976,1.04,1.03342,1.2,1.0675,1.0976,.98205,1.03809,1.05097,1.04,.95364,1.03342,1.05401,1.2,1.02148,1.0119,1.04724,1.0127,1.02732,.96225,.8965,.97783,.93574,.94818,1.30679,1.0675,1.11826,.99821,1.0557,1.0326,1.2,1.0675,.96225,1.0675,1.0326,.74817,1,1,1,1,1,1,1,1,1,1,1,1,1.03754,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.87533,1,1,1,1,1,1,1,1,1,1,1,1,.98705,1,1,1,1,1,1,.98448,.9973,.98448,.9973,.98448,.9973,.83089,.96777,1,1.20088,.89903,1,1,.75155,.94945,.94945,.94945,.94945,1.12317,1.12317,1.12317,.67603,.67603,1.15621,.73584,1.21191,1.22135,1.06483,.94868,.94868,.95996,1.24633,1,1.07497,.87709,.96927,1.01473,.96927,1,1,1,.77295,1,1,1.09836,1.09836,1.09836,1.01522,.86321,.94434,.8649,.94434,.86182,1,1,1.083,1,.91578,.86438,1.17308,1.18416,1.14589,.69825,.97622,1.96791,1.24822,1.24822,1.17308,1.24822,1.24822,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.42603,1,.99862,.99862,1,.87025,.87025,.87025,.87025,1.17984,1.42603,1,1.42603,1.42603,.99862,1,1,1,1,1,1.2886,1.04315,1.15296,1.34163,1,1,1,1.10742,1.10742,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];t.SegoeuiItalicMetrics={lineHeight:1.33008,lineGap:0};t.SegoeuiRegularFactors=[1.76738,1,1,.98594,1.02285,1.10454,1.06234,.96927,.92037,1.19985,1.2046,.90616,.90616,1.07152,1.1714,.78032,1.20088,.78032,1.40246,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.78032,.78032,1.1714,1.1714,1.1714,.80597,.94084,.96706,.85944,.85734,.97093,.75842,.79936,.88198,.9831,.95782,.71387,.86969,.84636,1.07796,1.03584,.96924,.83968,.96924,.82826,.79649,.85771,.95132,.93119,.98965,.88433,.8287,.93365,1.08612,1.3638,1.08612,1.45786,.74627,.80499,.91484,1.05707,.92383,1.05882,.9403,1.12654,1.05882,1.01756,1.09011,1.09011,.99414,1.09011,1.034,1.01756,1.05356,1.05707,1.05882,1.04399,.84863,1.21968,1.01756,.95801,1.00068,.91797,.96777,.9043,.90351,.92105,.90351,1.1714,.85337,.96927,.96927,.99912,.96927,.92105,.80597,1.2434,1.20808,1.05937,.90957,1.1714,1.20808,.75155,.94261,1.24644,1.09971,1.09971,.84751,1,.85273,.78032,.61584,1.05425,1.17914,.90957,1.08665,1.11593,1.14169,.73381,.96706,.96706,.96706,.96706,.96706,.96706,.86035,.85734,.75842,.75842,.75842,.75842,.95782,.95782,.95782,.95782,.97093,1.03584,.96924,.96924,.96924,.96924,.96924,1.1714,.96924,.95132,.95132,.95132,.95132,.8287,.83968,.89049,.91484,.91484,.91484,.91484,.91484,.91484,.93575,.92383,.9403,.9403,.9403,.9403,.8717,.8717,.8717,.8717,1.00527,1.01756,1.05356,1.05356,1.05356,1.05356,1.05356,1.24644,.95923,1.01756,1.01756,1.01756,1.01756,.96777,1.05707,.96777,.96706,.91484,.96706,.91484,.96706,.91484,.85734,.92383,.85734,.92383,.85734,.92383,.85734,.92383,.97093,1.0969,.97093,1.05882,.75842,.9403,.75842,.9403,.75842,.9403,.75842,.9403,.75842,.9403,.88198,1.05882,.88198,1.05882,.88198,1.05882,1,1,.9831,1.01756,.9831,1.01756,.95782,.8717,.95782,.8717,.95782,.8717,.95782,1.09011,.95782,.8717,.84784,1.11551,.71387,1.09011,1,1,.99414,.84636,1.09011,1,1,.84636,1.0536,.84636,.94298,.84636,1.23297,1.03584,1.01756,1,1,1.03584,1.01756,1.00323,1.03444,1.01756,.96924,1.05356,.96924,1.05356,.96924,1.05356,.93066,.98293,.82826,1.04399,1,1,.82826,1.04399,.79649,.84863,.79649,.84863,.79649,.84863,.79649,.84863,1,1,.85771,1.17318,.85771,1.21968,.95132,1.01756,.95132,1.01756,.95132,1.01756,.95132,1.01756,.95132,1.01756,.95132,1.01756,.98965,1.00068,.8287,.96777,.8287,.93365,.9043,.93365,.9043,.93365,.9043,1.08571,.96927,.96706,.91484,.86035,.93575,.96924,.95923,1,1,.85771,1.21968,1.11437,1.11437,.93109,.91202,.60411,.84164,.55572,1.01173,.97361,.81818,.81818,.96635,.78032,.72727,.92366,.98601,1.03405,.77968,1.09799,1.2,.96706,.85944,.85638,.96491,.75842,.93365,.9831,.96924,.95782,.86969,.94152,1.07796,1.03584,.78437,.96924,.98715,.83968,.83491,.85771,.8287,.94492,.88433,.9287,1.0098,.95782,.8287,1.0625,.98248,1.03424,1.2,1.01071,1.0625,.95246,1.03809,1.04912,.98248,1.00221,1.03424,1.05443,1.2,1.04785,.99609,1.00169,1.05176,.99346,1.05356,.9087,1.03004,.95542,.93117,1.23362,1.01071,1.07831,1.02512,1.05205,1.03502,1.2,1.01071,1.05356,1.01071,1.03502,.75842,1,1,1,1,1,1,1,1,1,1,1,1,1.03719,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.9403,1,1,1,1,1,1,1,1,1,1,1,1,1.04021,1,1,1,1,1,1,.98965,1.00068,.98965,1.00068,.98965,1.00068,.8287,.96777,1,1.20088,.89903,1,1,.75155,1.03077,1.03077,1.03077,1.03077,1.13196,1.13196,1.13196,.67428,.67428,1.16039,.73291,1.20996,1.22135,1.06483,.94868,.94868,.95996,1.24633,1,1.07497,.87796,.96927,1.01518,.96927,1,1,1,.77295,1,1,1.10539,1.10539,1.11358,1.06967,.86279,.94434,.86279,.94434,.86182,1,1,1.083,1,.91578,.86507,1.1714,1.18416,1.14589,.69825,.97622,1.9697,1.24822,1.24822,1.17238,1.24822,1.24822,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.42603,1,.99862,.99862,1,.87025,.87025,.87025,.87025,1.18083,1.42603,1,1.42603,1.42603,.99862,1,1,1,1,1,1.2886,1.04315,1.15296,1.34163,1,1,1,1.10938,1.10938,1,1,1,1.05425,1.09971,1.09971,1.09971,1,1,1,1,1,1,1,1,1,1,1];t.SegoeuiRegularMetrics={lineHeight:1.33008,lineGap:0}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.PostScriptEvaluator=t.PostScriptCompiler=t.PDFFunctionFactory=void 0;t.isPDFFunction=function isPDFFunction(e){let t;if("object"!=typeof e)return!1;if(e instanceof r.Dict)t=e;else{if(!(e instanceof s.BaseStream))return!1;t=e.dict}return t.has("FunctionType")};var r=a(4),n=a(2),i=a(56),s=a(5),o=a(57);t.PDFFunctionFactory=class PDFFunctionFactory{constructor({xref:e,isEvalSupported:t=!0}){this.xref=e;this.isEvalSupported=!1!==t}create(e){const t=this.getCached(e);if(t)return t;const a=PDFFunction.parse({xref:this.xref,isEvalSupported:this.isEvalSupported,fn:e instanceof r.Ref?this.xref.fetch(e):e});this._cache(e,a);return a}createFromArray(e){const t=this.getCached(e);if(t)return t;const a=PDFFunction.parseArray({xref:this.xref,isEvalSupported:this.isEvalSupported,fnObj:e instanceof r.Ref?this.xref.fetch(e):e});this._cache(e,a);return a}getCached(e){let t;e instanceof r.Ref?t=e:e instanceof r.Dict?t=e.objId:e instanceof s.BaseStream&&(t=e.dict&&e.dict.objId);if(t){const e=this._localFunctionCache.getByRef(t);if(e)return e}return null}_cache(e,t){if(!t)throw new Error('PDFFunctionFactory._cache - expected "parsedFunction" argument.');let a;e instanceof r.Ref?a=e:e instanceof r.Dict?a=e.objId:e instanceof s.BaseStream&&(a=e.dict&&e.dict.objId);a&&this._localFunctionCache.set(null,a,t)}get _localFunctionCache(){return(0,n.shadow)(this,"_localFunctionCache",new o.LocalFunctionCache)}};function toNumberArray(e){if(!Array.isArray(e))return null;const t=e.length;for(let a=0;a<t;a++)if("number"!=typeof e[a]){const a=new Array(t);for(let r=0;r<t;r++)a[r]=+e[r];return a}return e}class PDFFunction{static getSampleArray(e,t,a,r){let n,i,s=1;for(n=0,i=e.length;n<i;n++)s*=e[n];s*=t;const o=new Array(s);let c=0,l=0;const h=1/(2**a-1),u=r.getBytes((s*a+7)/8);let d=0;for(n=0;n<s;n++){for(;c<a;){l<<=8;l|=u[d++];c+=8}c-=a;o[n]=(l>>c)*h;l&=(1<<c)-1}return o}static parse({xref:e,isEvalSupported:t,fn:a}){const r=a.dict||a;switch(r.get("FunctionType")){case 0:return this.constructSampled({xref:e,isEvalSupported:t,fn:a,dict:r});case 1:break;case 2:return this.constructInterpolated({xref:e,isEvalSupported:t,dict:r});case 3:return this.constructStiched({xref:e,isEvalSupported:t,dict:r});case 4:return this.constructPostScript({xref:e,isEvalSupported:t,fn:a,dict:r})}throw new n.FormatError("Unknown type of function")}static parseArray({xref:e,isEvalSupported:t,fnObj:a}){if(!Array.isArray(a))return this.parse({xref:e,isEvalSupported:t,fn:a});const r=[];for(const n of a)r.push(this.parse({xref:e,isEvalSupported:t,fn:e.fetchIfRef(n)}));return function(e,t,a,n){for(let i=0,s=r.length;i<s;i++)r[i](e,t,a,n+i)}}static constructSampled({xref:e,isEvalSupported:t,fn:a,dict:r}){function toMultiArray(e){const t=e.length,a=[];let r=0;for(let n=0;n<t;n+=2)a[r++]=[e[n],e[n+1]];return a}function interpolate(e,t,a,r,n){return r+(n-r)/(a-t)*(e-t)}let i=toNumberArray(r.getArray("Domain")),s=toNumberArray(r.getArray("Range"));if(!i||!s)throw new n.FormatError("No domain or range");const o=i.length/2,c=s.length/2;i=toMultiArray(i);s=toMultiArray(s);const l=toNumberArray(r.getArray("Size")),h=r.get("BitsPerSample"),u=r.get("Order")||1;1!==u&&(0,n.info)("No support for cubic spline interpolation: "+u);let d=toNumberArray(r.getArray("Encode"));if(d)d=toMultiArray(d);else{d=[];for(let e=0;e<o;++e)d.push([0,l[e]-1])}let f=toNumberArray(r.getArray("Decode"));f=f?toMultiArray(f):s;const g=this.getSampleArray(l,c,h,a);return function constructSampledFn(e,t,a,r){const n=1<<o,h=new Float64Array(n),u=new Uint32Array(n);let p,m;for(m=0;m<n;m++)h[m]=1;let b=c,y=1;for(p=0;p<o;++p){const a=i[p][0],r=i[p][1];let s=interpolate(Math.min(Math.max(e[t+p],a),r),a,r,d[p][0],d[p][1]);const o=l[p];s=Math.min(Math.max(s,0),o-1);const c=s<o-1?Math.floor(s):s-1,f=c+1-s,g=s-c,w=c*b,S=w+b;for(m=0;m<n;m++)if(m&y){h[m]*=g;u[m]+=S}else{h[m]*=f;u[m]+=w}b*=o;y<<=1}for(m=0;m<c;++m){let e=0;for(p=0;p<n;p++)e+=g[u[p]+m]*h[p];e=interpolate(e,0,1,f[m][0],f[m][1]);a[r+m]=Math.min(Math.max(e,s[m][0]),s[m][1])}}}static constructInterpolated({xref:e,isEvalSupported:t,dict:a}){const r=toNumberArray(a.getArray("C0"))||[0],n=toNumberArray(a.getArray("C1"))||[1],i=a.get("N"),s=[];for(let e=0,t=r.length;e<t;++e)s.push(n[e]-r[e]);const o=s.length;return function constructInterpolatedFn(e,t,a,n){const c=1===i?e[t]:e[t]**i;for(let e=0;e<o;++e)a[n+e]=r[e]+c*s[e]}}static constructStiched({xref:e,isEvalSupported:t,dict:a}){const r=toNumberArray(a.getArray("Domain"));if(!r)throw new n.FormatError("No domain");if(1!==r.length/2)throw new n.FormatError("Bad domain for stiched function");const i=[];for(const r of a.get("Functions"))i.push(this.parse({xref:e,isEvalSupported:t,fn:e.fetchIfRef(r)}));const s=toNumberArray(a.getArray("Bounds")),o=toNumberArray(a.getArray("Encode")),c=new Float32Array(1);return function constructStichedFn(e,t,a,n){const l=function constructStichedFromIRClip(e,t,a){e>a?e=a:e<t&&(e=t);return e}(e[t],r[0],r[1]),h=s.length;let u;for(u=0;u<h&&!(l<s[u]);++u);let d=r[0];u>0&&(d=s[u-1]);let f=r[1];u<s.length&&(f=s[u]);const g=o[2*u],p=o[2*u+1];c[0]=d===f?g:g+(l-d)*(p-g)/(f-d);i[u](c,0,a,n)}}static constructPostScript({xref:e,isEvalSupported:t,fn:a,dict:r}){const s=toNumberArray(r.getArray("Domain")),o=toNumberArray(r.getArray("Range"));if(!s)throw new n.FormatError("No domain.");if(!o)throw new n.FormatError("No range.");const c=new i.PostScriptLexer(a),l=new i.PostScriptParser(c).parse();if(t&&n.FeatureTest.isEvalSupported){const e=(new PostScriptCompiler).compile(l,s,o);if(e)return new Function("src","srcOffset","dest","destOffset",e)}(0,n.info)("Unable to compile PS function");const h=o.length>>1,u=s.length>>1,d=new PostScriptEvaluator(l),f=Object.create(null);let g=8192;const p=new Float32Array(u);return function constructPostScriptFn(e,t,a,r){let n,i,s="";const c=p;for(n=0;n<u;n++){i=e[t+n];c[n]=i;s+=i+"_"}const l=f[s];if(void 0!==l){a.set(l,r);return}const m=new Float32Array(h),b=d.execute(c),y=b.length-h;for(n=0;n<h;n++){i=b[y+n];let e=o[2*n];if(i<e)i=e;else{e=o[2*n+1];i>e&&(i=e)}m[n]=i}if(g>0){g--;f[s]=m}a.set(m,r)}}}class PostScriptStack{static get MAX_STACK_SIZE(){return(0,n.shadow)(this,"MAX_STACK_SIZE",100)}constructor(e){this.stack=e?Array.from(e):[]}push(e){if(this.stack.length>=PostScriptStack.MAX_STACK_SIZE)throw new Error("PostScript function stack overflow.");this.stack.push(e)}pop(){if(this.stack.length<=0)throw new Error("PostScript function stack underflow.");return this.stack.pop()}copy(e){if(this.stack.length+e>=PostScriptStack.MAX_STACK_SIZE)throw new Error("PostScript function stack overflow.");const t=this.stack;for(let a=t.length-e,r=e-1;r>=0;r--,a++)t.push(t[a])}index(e){this.push(this.stack[this.stack.length-e-1])}roll(e,t){const a=this.stack,r=a.length-e,n=a.length-1,i=r+(t-Math.floor(t/e)*e);for(let e=r,t=n;e<t;e++,t--){const r=a[e];a[e]=a[t];a[t]=r}for(let e=r,t=i-1;e<t;e++,t--){const r=a[e];a[e]=a[t];a[t]=r}for(let e=i,t=n;e<t;e++,t--){const r=a[e];a[e]=a[t];a[t]=r}}}class PostScriptEvaluator{constructor(e){this.operators=e}execute(e){const t=new PostScriptStack(e);let a=0;const r=this.operators,i=r.length;let s,o,c;for(;a<i;){s=r[a++];if("number"!=typeof s)switch(s){case"jz":c=t.pop();o=t.pop();o||(a=c);break;case"j":o=t.pop();a=o;break;case"abs":o=t.pop();t.push(Math.abs(o));break;case"add":c=t.pop();o=t.pop();t.push(o+c);break;case"and":c=t.pop();o=t.pop();"boolean"==typeof o&&"boolean"==typeof c?t.push(o&&c):t.push(o&c);break;case"atan":o=t.pop();t.push(Math.atan(o));break;case"bitshift":c=t.pop();o=t.pop();o>0?t.push(o<<c):t.push(o>>c);break;case"ceiling":o=t.pop();t.push(Math.ceil(o));break;case"copy":o=t.pop();t.copy(o);break;case"cos":o=t.pop();t.push(Math.cos(o));break;case"cvi":o=0|t.pop();t.push(o);break;case"cvr":break;case"div":c=t.pop();o=t.pop();t.push(o/c);break;case"dup":t.copy(1);break;case"eq":c=t.pop();o=t.pop();t.push(o===c);break;case"exch":t.roll(2,1);break;case"exp":c=t.pop();o=t.pop();t.push(o**c);break;case"false":t.push(!1);break;case"floor":o=t.pop();t.push(Math.floor(o));break;case"ge":c=t.pop();o=t.pop();t.push(o>=c);break;case"gt":c=t.pop();o=t.pop();t.push(o>c);break;case"idiv":c=t.pop();o=t.pop();t.push(o/c|0);break;case"index":o=t.pop();t.index(o);break;case"le":c=t.pop();o=t.pop();t.push(o<=c);break;case"ln":o=t.pop();t.push(Math.log(o));break;case"log":o=t.pop();t.push(Math.log(o)/Math.LN10);break;case"lt":c=t.pop();o=t.pop();t.push(o<c);break;case"mod":c=t.pop();o=t.pop();t.push(o%c);break;case"mul":c=t.pop();o=t.pop();t.push(o*c);break;case"ne":c=t.pop();o=t.pop();t.push(o!==c);break;case"neg":o=t.pop();t.push(-o);break;case"not":o=t.pop();"boolean"==typeof o?t.push(!o):t.push(~o);break;case"or":c=t.pop();o=t.pop();"boolean"==typeof o&&"boolean"==typeof c?t.push(o||c):t.push(o|c);break;case"pop":t.pop();break;case"roll":c=t.pop();o=t.pop();t.roll(o,c);break;case"round":o=t.pop();t.push(Math.round(o));break;case"sin":o=t.pop();t.push(Math.sin(o));break;case"sqrt":o=t.pop();t.push(Math.sqrt(o));break;case"sub":c=t.pop();o=t.pop();t.push(o-c);break;case"true":t.push(!0);break;case"truncate":o=t.pop();o=o<0?Math.ceil(o):Math.floor(o);t.push(o);break;case"xor":c=t.pop();o=t.pop();"boolean"==typeof o&&"boolean"==typeof c?t.push(o!==c):t.push(o^c);break;default:throw new n.FormatError(`Unknown operator ${s}`)}else t.push(s)}return t.stack}}t.PostScriptEvaluator=PostScriptEvaluator;class AstNode{constructor(e){this.type=e}visit(e){(0,n.unreachable)("abstract method")}}class AstArgument extends AstNode{constructor(e,t,a){super("args");this.index=e;this.min=t;this.max=a}visit(e){e.visitArgument(this)}}class AstLiteral extends AstNode{constructor(e){super("literal");this.number=e;this.min=e;this.max=e}visit(e){e.visitLiteral(this)}}class AstBinaryOperation extends AstNode{constructor(e,t,a,r,n){super("binary");this.op=e;this.arg1=t;this.arg2=a;this.min=r;this.max=n}visit(e){e.visitBinaryOperation(this)}}class AstMin extends AstNode{constructor(e,t){super("max");this.arg=e;this.min=e.min;this.max=t}visit(e){e.visitMin(this)}}class AstVariable extends AstNode{constructor(e,t,a){super("var");this.index=e;this.min=t;this.max=a}visit(e){e.visitVariable(this)}}class AstVariableDefinition extends AstNode{constructor(e,t){super("definition");this.variable=e;this.arg=t}visit(e){e.visitVariableDefinition(this)}}class ExpressionBuilderVisitor{constructor(){this.parts=[]}visitArgument(e){this.parts.push("Math.max(",e.min,", Math.min(",e.max,", src[srcOffset + ",e.index,"]))")}visitVariable(e){this.parts.push("v",e.index)}visitLiteral(e){this.parts.push(e.number)}visitBinaryOperation(e){this.parts.push("(");e.arg1.visit(this);this.parts.push(" ",e.op," ");e.arg2.visit(this);this.parts.push(")")}visitVariableDefinition(e){this.parts.push("var ");e.variable.visit(this);this.parts.push(" = ");e.arg.visit(this);this.parts.push(";")}visitMin(e){this.parts.push("Math.min(");e.arg.visit(this);this.parts.push(", ",e.max,")")}toString(){return this.parts.join("")}}function buildAddOperation(e,t){return"literal"===t.type&&0===t.number?e:"literal"===e.type&&0===e.number?t:"literal"===t.type&&"literal"===e.type?new AstLiteral(e.number+t.number):new AstBinaryOperation("+",e,t,e.min+t.min,e.max+t.max)}function buildMulOperation(e,t){if("literal"===t.type){if(0===t.number)return new AstLiteral(0);if(1===t.number)return e;if("literal"===e.type)return new AstLiteral(e.number*t.number)}if("literal"===e.type){if(0===e.number)return new AstLiteral(0);if(1===e.number)return t}const a=Math.min(e.min*t.min,e.min*t.max,e.max*t.min,e.max*t.max),r=Math.max(e.min*t.min,e.min*t.max,e.max*t.min,e.max*t.max);return new AstBinaryOperation("*",e,t,a,r)}function buildSubOperation(e,t){if("literal"===t.type){if(0===t.number)return e;if("literal"===e.type)return new AstLiteral(e.number-t.number)}return"binary"===t.type&&"-"===t.op&&"literal"===e.type&&1===e.number&&"literal"===t.arg1.type&&1===t.arg1.number?t.arg2:new AstBinaryOperation("-",e,t,e.min-t.max,e.max-t.min)}function buildMinOperation(e,t){return e.min>=t?new AstLiteral(t):e.max<=t?e:new AstMin(e,t)}class PostScriptCompiler{compile(e,t,a){const r=[],n=[],i=t.length>>1,s=a.length>>1;let o,c,l,h,u,d,f,g,p=0;for(let e=0;e<i;e++)r.push(new AstArgument(e,t[2*e],t[2*e+1]));for(let t=0,a=e.length;t<a;t++){g=e[t];if("number"!=typeof g)switch(g){case"add":if(r.length<2)return null;h=r.pop();l=r.pop();r.push(buildAddOperation(l,h));break;case"cvr":if(r.length<1)return null;break;case"mul":if(r.length<2)return null;h=r.pop();l=r.pop();r.push(buildMulOperation(l,h));break;case"sub":if(r.length<2)return null;h=r.pop();l=r.pop();r.push(buildSubOperation(l,h));break;case"exch":if(r.length<2)return null;u=r.pop();d=r.pop();r.push(u,d);break;case"pop":if(r.length<1)return null;r.pop();break;case"index":if(r.length<1)return null;l=r.pop();if("literal"!==l.type)return null;o=l.number;if(o<0||!Number.isInteger(o)||r.length<o)return null;u=r[r.length-o-1];if("literal"===u.type||"var"===u.type){r.push(u);break}f=new AstVariable(p++,u.min,u.max);r[r.length-o-1]=f;r.push(f);n.push(new AstVariableDefinition(f,u));break;case"dup":if(r.length<1)return null;if("number"==typeof e[t+1]&&"gt"===e[t+2]&&e[t+3]===t+7&&"jz"===e[t+4]&&"pop"===e[t+5]&&e[t+6]===e[t+1]){l=r.pop();r.push(buildMinOperation(l,e[t+1]));t+=6;break}u=r.at(-1);if("literal"===u.type||"var"===u.type){r.push(u);break}f=new AstVariable(p++,u.min,u.max);r[r.length-1]=f;r.push(f);n.push(new AstVariableDefinition(f,u));break;case"roll":if(r.length<2)return null;h=r.pop();l=r.pop();if("literal"!==h.type||"literal"!==l.type)return null;c=h.number;o=l.number;if(o<=0||!Number.isInteger(o)||!Number.isInteger(c)||r.length<o)return null;c=(c%o+o)%o;if(0===c)break;r.push(...r.splice(r.length-o,o-c));break;default:return null}else r.push(new AstLiteral(g))}if(r.length!==s)return null;const m=[];for(const e of n){const t=new ExpressionBuilderVisitor;e.visit(t);m.push(t.toString())}for(let e=0,t=r.length;e<t;e++){const t=r[e],n=new ExpressionBuilderVisitor;t.visit(n);const i=a[2*e],s=a[2*e+1],o=[n.toString()];if(i>t.min){o.unshift("Math.max(",i,", ");o.push(")")}if(s<t.max){o.unshift("Math.min(",s,", ");o.push(")")}o.unshift("dest[destOffset + ",e,"] = ");o.push(";");m.push(o.join(""))}return m.join("\n")}}t.PostScriptCompiler=PostScriptCompiler},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.PostScriptParser=t.PostScriptLexer=void 0;var r=a(2),n=a(4),i=a(3);t.PostScriptParser=class PostScriptParser{constructor(e){this.lexer=e;this.operators=[];this.token=null;this.prev=null}nextToken(){this.prev=this.token;this.token=this.lexer.getToken()}accept(e){if(this.token.type===e){this.nextToken();return!0}return!1}expect(e){if(this.accept(e))return!0;throw new r.FormatError(`Unexpected symbol: found ${this.token.type} expected ${e}.`)}parse(){this.nextToken();this.expect(s.LBRACE);this.parseBlock();this.expect(s.RBRACE);return this.operators}parseBlock(){for(;;)if(this.accept(s.NUMBER))this.operators.push(this.prev.value);else if(this.accept(s.OPERATOR))this.operators.push(this.prev.value);else{if(!this.accept(s.LBRACE))return;this.parseCondition()}}parseCondition(){const e=this.operators.length;this.operators.push(null,null);this.parseBlock();this.expect(s.RBRACE);if(this.accept(s.IF)){this.operators[e]=this.operators.length;this.operators[e+1]="jz"}else{if(!this.accept(s.LBRACE))throw new r.FormatError("PS Function: error parsing conditional.");{const t=this.operators.length;this.operators.push(null,null);const a=this.operators.length;this.parseBlock();this.expect(s.RBRACE);this.expect(s.IFELSE);this.operators[t]=this.operators.length;this.operators[t+1]="j";this.operators[e]=a;this.operators[e+1]="jz"}}}};const s={LBRACE:0,RBRACE:1,NUMBER:2,OPERATOR:3,IF:4,IFELSE:5};class PostScriptToken{static get opCache(){return(0,r.shadow)(this,"opCache",Object.create(null))}constructor(e,t){this.type=e;this.value=t}static getOperator(e){const t=PostScriptToken.opCache[e];return t||(PostScriptToken.opCache[e]=new PostScriptToken(s.OPERATOR,e))}static get LBRACE(){return(0,r.shadow)(this,"LBRACE",new PostScriptToken(s.LBRACE,"{"))}static get RBRACE(){return(0,r.shadow)(this,"RBRACE",new PostScriptToken(s.RBRACE,"}"))}static get IF(){return(0,r.shadow)(this,"IF",new PostScriptToken(s.IF,"IF"))}static get IFELSE(){return(0,r.shadow)(this,"IFELSE",new PostScriptToken(s.IFELSE,"IFELSE"))}}t.PostScriptLexer=class PostScriptLexer{constructor(e){this.stream=e;this.nextChar();this.strBuf=[]}nextChar(){return this.currentChar=this.stream.getByte()}getToken(){let e=!1,t=this.currentChar;for(;;){if(t<0)return n.EOF;if(e)10!==t&&13!==t||(e=!1);else if(37===t)e=!0;else if(!(0,i.isWhiteSpace)(t))break;t=this.nextChar()}switch(0|t){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 43:case 45:case 46:return new PostScriptToken(s.NUMBER,this.getNumber());case 123:this.nextChar();return PostScriptToken.LBRACE;case 125:this.nextChar();return PostScriptToken.RBRACE}const a=this.strBuf;a.length=0;a[0]=String.fromCharCode(t);for(;(t=this.nextChar())>=0&&(t>=65&&t<=90||t>=97&&t<=122);)a.push(String.fromCharCode(t));const r=a.join("");switch(r.toLowerCase()){case"if":return PostScriptToken.IF;case"ifelse":return PostScriptToken.IFELSE;default:return PostScriptToken.getOperator(r)}}getNumber(){let e=this.currentChar;const t=this.strBuf;t.length=0;t[0]=String.fromCharCode(e);for(;(e=this.nextChar())>=0&&(e>=48&&e<=57||45===e||46===e);)t.push(String.fromCharCode(e));const a=parseFloat(t.join(""));if(isNaN(a))throw new r.FormatError(`Invalid floating point number: ${a}`);return a}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.LocalTilingPatternCache=t.LocalImageCache=t.LocalGStateCache=t.LocalFunctionCache=t.LocalColorSpaceCache=t.GlobalImageCache=void 0;var r=a(2),n=a(4);class BaseLocalCache{constructor(e){this.constructor===BaseLocalCache&&(0,r.unreachable)("Cannot initialize BaseLocalCache.");this._onlyRefs=!0===(e&&e.onlyRefs);if(!this._onlyRefs){this._nameRefMap=new Map;this._imageMap=new Map}this._imageCache=new n.RefSetCache}getByName(e){this._onlyRefs&&(0,r.unreachable)("Should not call `getByName` method.");const t=this._nameRefMap.get(e);return t?this.getByRef(t):this._imageMap.get(e)||null}getByRef(e){return this._imageCache.get(e)||null}set(e,t,a){(0,r.unreachable)("Abstract method `set` called.")}}t.LocalImageCache=class LocalImageCache extends BaseLocalCache{set(e,t=null,a){if("string"!=typeof e)throw new Error('LocalImageCache.set - expected "name" argument.');if(t){if(this._imageCache.has(t))return;this._nameRefMap.set(e,t);this._imageCache.put(t,a)}else this._imageMap.has(e)||this._imageMap.set(e,a)}};t.LocalColorSpaceCache=class LocalColorSpaceCache extends BaseLocalCache{set(e=null,t=null,a){if("string"!=typeof e&&!t)throw new Error('LocalColorSpaceCache.set - expected "name" and/or "ref" argument.');if(t){if(this._imageCache.has(t))return;null!==e&&this._nameRefMap.set(e,t);this._imageCache.put(t,a)}else this._imageMap.has(e)||this._imageMap.set(e,a)}};t.LocalFunctionCache=class LocalFunctionCache extends BaseLocalCache{constructor(e){super({onlyRefs:!0})}set(e=null,t,a){if(!t)throw new Error('LocalFunctionCache.set - expected "ref" argument.');this._imageCache.has(t)||this._imageCache.put(t,a)}};t.LocalGStateCache=class LocalGStateCache extends BaseLocalCache{set(e,t=null,a){if("string"!=typeof e)throw new Error('LocalGStateCache.set - expected "name" argument.');if(t){if(this._imageCache.has(t))return;this._nameRefMap.set(e,t);this._imageCache.put(t,a)}else this._imageMap.has(e)||this._imageMap.set(e,a)}};t.LocalTilingPatternCache=class LocalTilingPatternCache extends BaseLocalCache{constructor(e){super({onlyRefs:!0})}set(e=null,t,a){if(!t)throw new Error('LocalTilingPatternCache.set - expected "ref" argument.');this._imageCache.has(t)||this._imageCache.put(t,a)}};class GlobalImageCache{static get NUM_PAGES_THRESHOLD(){return(0,r.shadow)(this,"NUM_PAGES_THRESHOLD",2)}static get MIN_IMAGES_TO_CACHE(){return(0,r.shadow)(this,"MIN_IMAGES_TO_CACHE",10)}static get MAX_BYTE_SIZE(){return(0,r.shadow)(this,"MAX_BYTE_SIZE",4e7)}constructor(){this._refCache=new n.RefSetCache;this._imageCache=new n.RefSetCache}get _byteSize(){let e=0;for(const t of this._imageCache)e+=t.byteSize;return e}get _cacheLimitReached(){return!(this._imageCache.size<GlobalImageCache.MIN_IMAGES_TO_CACHE)&&!(this._byteSize<GlobalImageCache.MAX_BYTE_SIZE)}shouldCache(e,t){const a=this._refCache.get(e);return!((a?a.size+(a.has(t)?0:1):1)<GlobalImageCache.NUM_PAGES_THRESHOLD)&&!(!this._imageCache.has(e)&&this._cacheLimitReached)}addPageIndex(e,t){let a=this._refCache.get(e);if(!a){a=new Set;this._refCache.put(e,a)}a.add(t)}addByteSize(e,t){const a=this._imageCache.get(e);a&&(a.byteSize||(a.byteSize=t))}getData(e,t){const a=this._refCache.get(e);if(!a)return null;if(a.size<GlobalImageCache.NUM_PAGES_THRESHOLD)return null;const r=this._imageCache.get(e);if(!r)return null;a.add(t);return r}setData(e,t){if(!this._refCache.has(e))throw new Error('GlobalImageCache.setData - expected "addPageIndex" to have been called.');this._imageCache.has(e)||(this._cacheLimitReached?(0,r.warn)("GlobalImageCache.setData - cache limit reached."):this._imageCache.put(e,t))}clear(e=!1){e||this._refCache.clear();this._imageCache.clear()}}t.GlobalImageCache=GlobalImageCache},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.bidi=function bidi(e,t=-1,a=!1){let c=!0;const l=e.length;if(0===l||a)return createBidiText(e,c,a);s.length=l;o.length=l;let h,u,d=0;for(h=0;h<l;++h){s[h]=e.charAt(h);const t=e.charCodeAt(h);let a="L";if(t<=255)a=n[t];else if(1424<=t&&t<=1524)a="R";else if(1536<=t&&t<=1791){a=i[255&t];a||(0,r.warn)("Bidi: invalid Unicode character "+t.toString(16))}else 1792<=t&&t<=2220&&(a="AL");"R"!==a&&"AL"!==a&&"AN"!==a||d++;o[h]=a}if(0===d){c=!0;return createBidiText(e,c)}if(-1===t)if(d/l<.3&&l>4){c=!0;t=0}else{c=!1;t=1}const f=[];for(h=0;h<l;++h)f[h]=t;const g=isOdd(t)?"R":"L",p=g,m=p;let b,y=p;for(h=0;h<l;++h)"NSM"===o[h]?o[h]=y:y=o[h];y=p;for(h=0;h<l;++h){b=o[h];"EN"===b?o[h]="AL"===y?"AN":"EN":"R"!==b&&"L"!==b&&"AL"!==b||(y=b)}for(h=0;h<l;++h){b=o[h];"AL"===b&&(o[h]="R")}for(h=1;h<l-1;++h){"ES"===o[h]&&"EN"===o[h-1]&&"EN"===o[h+1]&&(o[h]="EN");"CS"!==o[h]||"EN"!==o[h-1]&&"AN"!==o[h-1]||o[h+1]!==o[h-1]||(o[h]=o[h-1])}for(h=0;h<l;++h)if("EN"===o[h]){for(let e=h-1;e>=0&&"ET"===o[e];--e)o[e]="EN";for(let e=h+1;e<l&&"ET"===o[e];++e)o[e]="EN"}for(h=0;h<l;++h){b=o[h];"WS"!==b&&"ES"!==b&&"ET"!==b&&"CS"!==b||(o[h]="ON")}y=p;for(h=0;h<l;++h){b=o[h];"EN"===b?o[h]="L"===y?"L":"EN":"R"!==b&&"L"!==b||(y=b)}for(h=0;h<l;++h)if("ON"===o[h]){const e=findUnequal(o,h+1,"ON");let t=p;h>0&&(t=o[h-1]);let a=m;e+1<l&&(a=o[e+1]);"L"!==t&&(t="R");"L"!==a&&(a="R");t===a&&setValues(o,h,e,t);h=e-1}for(h=0;h<l;++h)"ON"===o[h]&&(o[h]=g);for(h=0;h<l;++h){b=o[h];isEven(f[h])?"R"===b?f[h]+=1:"AN"!==b&&"EN"!==b||(f[h]+=2):"L"!==b&&"AN"!==b&&"EN"!==b||(f[h]+=1)}let w,S=-1,x=99;for(h=0,u=f.length;h<u;++h){w=f[h];S<w&&(S=w);x>w&&isOdd(w)&&(x=w)}for(w=S;w>=x;--w){let e=-1;for(h=0,u=f.length;h<u;++h)if(f[h]<w){if(e>=0){reverseValues(s,e,h);e=-1}}else e<0&&(e=h);e>=0&&reverseValues(s,e,f.length)}for(h=0,u=s.length;h<u;++h){const e=s[h];"<"!==e&&">"!==e||(s[h]="")}return createBidiText(s.join(""),c)};var r=a(2);const n=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],i=["AN","AN","AN","AN","AN","AN","ON","ON","AL","ET","ET","AL","CS","AL","ON","ON","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","ON","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","ON","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL"];function isOdd(e){return 0!=(1&e)}function isEven(e){return 0==(1&e)}function findUnequal(e,t,a){let r,n;for(r=t,n=e.length;r<n;++r)if(e[r]!==a)return r;return r}function setValues(e,t,a,r){for(let n=t;n<a;++n)e[n]=r}function reverseValues(e,t,a){for(let r=t,n=a-1;r<n;++r,--n){const t=e[r];e[r]=e[n];e[n]=t}}function createBidiText(e,t,a=!1){let r="ltr";a?r="ttb":t||(r="rtl");return{str:e,dir:r}}const s=[],o=[]},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.MurmurHash3_64=void 0;var r=a(2);const n=3285377520,i=4294901760,s=65535;t.MurmurHash3_64=class MurmurHash3_64{constructor(e){this.h1=e?4294967295&e:n;this.h2=e?4294967295&e:n}update(e){let t,a;if("string"==typeof e){t=new Uint8Array(2*e.length);a=0;for(let r=0,n=e.length;r<n;r++){const n=e.charCodeAt(r);if(n<=255)t[a++]=n;else{t[a++]=n>>>8;t[a++]=255&n}}}else{if(!(0,r.isArrayBuffer)(e))throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");t=e.slice();a=t.byteLength}const n=a>>2,o=a-4*n,c=new Uint32Array(t.buffer,0,n);let l=0,h=0,u=this.h1,d=this.h2;const f=3432918353,g=461845907,p=11601,m=13715;for(let e=0;e<n;e++)if(1&e){l=c[e];l=l*f&i|l*p&s;l=l<<15|l>>>17;l=l*g&i|l*m&s;u^=l;u=u<<13|u>>>19;u=5*u+3864292196}else{h=c[e];h=h*f&i|h*p&s;h=h<<15|h>>>17;h=h*g&i|h*m&s;d^=h;d=d<<13|d>>>19;d=5*d+3864292196}l=0;switch(o){case 3:l^=t[4*n+2]<<16;case 2:l^=t[4*n+1]<<8;case 1:l^=t[4*n];l=l*f&i|l*p&s;l=l<<15|l>>>17;l=l*g&i|l*m&s;1&n?u^=l:d^=l}this.h1=u;this.h2=d}hexdigest(){let e=this.h1,t=this.h2;e^=t>>>1;e=3981806797*e&i|36045*e&s;t=4283543511*t&i|(2950163797*(t<<16|e>>>16)&i)>>>16;e^=t>>>1;e=444984403*e&i|60499*e&s;t=3301882366*t&i|(3120437893*(t<<16|e>>>16)&i)>>>16;e^=t>>>1;return(e>>>0).toString(16).padStart(8,"0")+(t>>>0).toString(16).padStart(8,"0")}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.OperatorList=void 0;var r=a(2);function addState(e,t,a,r,n){let i=e;for(let e=0,a=t.length-1;e<a;e++){const a=t[e];i=i[a]||(i[a]=[])}i[t.at(-1)]={checkFn:a,iterateFn:r,processFn:n}}const n=[];addState(n,[r.OPS.save,r.OPS.transform,r.OPS.paintInlineImageXObject,r.OPS.restore],null,(function iterateInlineImageGroup(e,t){const a=e.fnArray,n=(t-(e.iCurr-3))%4;switch(n){case 0:return a[t]===r.OPS.save;case 1:return a[t]===r.OPS.transform;case 2:return a[t]===r.OPS.paintInlineImageXObject;case 3:return a[t]===r.OPS.restore}throw new Error(`iterateInlineImageGroup - invalid pos: ${n}`)}),(function foundInlineImageGroup(e,t){const a=e.fnArray,n=e.argsArray,i=e.iCurr,s=i-3,o=i-2,c=i-1,l=Math.min(Math.floor((t-s)/4),200);if(l<10)return t-(t-s)%4;let h=0;const u=[];let d=0,f=1,g=1;for(let e=0;e<l;e++){const t=n[o+(e<<2)],a=n[c+(e<<2)][0];if(f+a.width>1e3){h=Math.max(h,f);g+=d+2;f=0;d=0}u.push({transform:t,x:f,y:g,w:a.width,h:a.height});f+=a.width+2;d=Math.max(d,a.height)}const p=Math.max(h,f)+1,m=g+d+1,b=new Uint8Array(p*m*4),y=p<<2;for(let e=0;e<l;e++){const t=n[c+(e<<2)][0].data,a=u[e].w<<2;let r=0,i=u[e].x+u[e].y*p<<2;b.set(t.subarray(0,a),i-y);for(let n=0,s=u[e].h;n<s;n++){b.set(t.subarray(r,r+a),i);r+=a;i+=y}b.set(t.subarray(r-a,r),i);for(;i>=0;){t[i-4]=t[i];t[i-3]=t[i+1];t[i-2]=t[i+2];t[i-1]=t[i+3];t[i+a]=t[i+a-4];t[i+a+1]=t[i+a-3];t[i+a+2]=t[i+a-2];t[i+a+3]=t[i+a-1];i-=y}}a.splice(s,4*l,r.OPS.paintInlineImageXObjectGroup);n.splice(s,4*l,[{width:p,height:m,kind:r.ImageKind.RGBA_32BPP,data:b},u]);return s+1}));addState(n,[r.OPS.save,r.OPS.transform,r.OPS.paintImageMaskXObject,r.OPS.restore],null,(function iterateImageMaskGroup(e,t){const a=e.fnArray,n=(t-(e.iCurr-3))%4;switch(n){case 0:return a[t]===r.OPS.save;case 1:return a[t]===r.OPS.transform;case 2:return a[t]===r.OPS.paintImageMaskXObject;case 3:return a[t]===r.OPS.restore}throw new Error(`iterateImageMaskGroup - invalid pos: ${n}`)}),(function foundImageMaskGroup(e,t){const a=e.fnArray,n=e.argsArray,i=e.iCurr,s=i-3,o=i-2,c=i-1;let l=Math.floor((t-s)/4);if(l<10)return t-(t-s)%4;let h,u,d=!1;const f=n[c][0],g=n[o][0],p=n[o][1],m=n[o][2],b=n[o][3];if(p===m){d=!0;h=o+4;let e=c+4;for(let t=1;t<l;t++,h+=4,e+=4){u=n[h];if(n[e][0]!==f||u[0]!==g||u[1]!==p||u[2]!==m||u[3]!==b){t<10?d=!1:l=t;break}}}if(d){l=Math.min(l,1e3);const e=new Float32Array(2*l);h=o;for(let t=0;t<l;t++,h+=4){u=n[h];e[t<<1]=u[4];e[1+(t<<1)]=u[5]}a.splice(s,4*l,r.OPS.paintImageMaskXObjectRepeat);n.splice(s,4*l,[f,g,p,m,b,e])}else{l=Math.min(l,100);const e=[];for(let t=0;t<l;t++){u=n[o+(t<<2)];const a=n[c+(t<<2)][0];e.push({data:a.data,width:a.width,height:a.height,interpolate:a.interpolate,count:a.count,transform:u})}a.splice(s,4*l,r.OPS.paintImageMaskXObjectGroup);n.splice(s,4*l,[e])}return s+1}));addState(n,[r.OPS.save,r.OPS.transform,r.OPS.paintImageXObject,r.OPS.restore],(function(e){const t=e.argsArray,a=e.iCurr-2;return 0===t[a][1]&&0===t[a][2]}),(function iterateImageGroup(e,t){const a=e.fnArray,n=e.argsArray,i=(t-(e.iCurr-3))%4;switch(i){case 0:return a[t]===r.OPS.save;case 1:if(a[t]!==r.OPS.transform)return!1;const i=e.iCurr-2,s=n[i][0],o=n[i][3];return n[t][0]===s&&0===n[t][1]&&0===n[t][2]&&n[t][3]===o;case 2:if(a[t]!==r.OPS.paintImageXObject)return!1;const c=n[e.iCurr-1][0];return n[t][0]===c;case 3:return a[t]===r.OPS.restore}throw new Error(`iterateImageGroup - invalid pos: ${i}`)}),(function(e,t){const a=e.fnArray,n=e.argsArray,i=e.iCurr,s=i-3,o=i-2,c=n[i-1][0],l=n[o][0],h=n[o][3],u=Math.min(Math.floor((t-s)/4),1e3);if(u<3)return t-(t-s)%4;const d=new Float32Array(2*u);let f=o;for(let e=0;e<u;e++,f+=4){const t=n[f];d[e<<1]=t[4];d[1+(e<<1)]=t[5]}const g=[c,l,h,d];a.splice(s,4*u,r.OPS.paintImageXObjectRepeat);n.splice(s,4*u,g);return s+1}));addState(n,[r.OPS.beginText,r.OPS.setFont,r.OPS.setTextMatrix,r.OPS.showText,r.OPS.endText],null,(function iterateShowTextGroup(e,t){const a=e.fnArray,n=e.argsArray,i=(t-(e.iCurr-4))%5;switch(i){case 0:return a[t]===r.OPS.beginText;case 1:return a[t]===r.OPS.setFont;case 2:return a[t]===r.OPS.setTextMatrix;case 3:if(a[t]!==r.OPS.showText)return!1;const i=e.iCurr-3,s=n[i][0],o=n[i][1];return n[t][0]===s&&n[t][1]===o;case 4:return a[t]===r.OPS.endText}throw new Error(`iterateShowTextGroup - invalid pos: ${i}`)}),(function(e,t){const a=e.fnArray,r=e.argsArray,n=e.iCurr,i=n-4,s=n-3,o=n-2,c=n-1,l=n,h=r[s][0],u=r[s][1];let d=Math.min(Math.floor((t-i)/5),1e3);if(d<3)return t-(t-i)%5;let f=i;if(i>=4&&a[i-4]===a[s]&&a[i-3]===a[o]&&a[i-2]===a[c]&&a[i-1]===a[l]&&r[i-4][0]===h&&r[i-4][1]===u){d++;f-=5}let g=f+4;for(let e=1;e<d;e++){a.splice(g,3);r.splice(g,3);g+=2}return g+1}));class NullOptimizer{constructor(e){this.queue=e}_optimize(){}push(e,t){this.queue.fnArray.push(e);this.queue.argsArray.push(t);this._optimize()}flush(){}reset(){}}class QueueOptimizer extends NullOptimizer{constructor(e){super(e);this.state=null;this.context={iCurr:0,fnArray:e.fnArray,argsArray:e.argsArray};this.match=null;this.lastProcessed=0}_optimize(){const e=this.queue.fnArray;let t=this.lastProcessed,a=e.length,r=this.state,i=this.match;if(!r&&!i&&t+1===a&&!n[e[t]]){this.lastProcessed=a;return}const s=this.context;for(;t<a;){if(i){if((0,i.iterateFn)(s,t)){t++;continue}t=(0,i.processFn)(s,t+1);a=e.length;i=null;r=null;if(t>=a)break}r=(r||n)[e[t]];if(r&&!Array.isArray(r)){s.iCurr=t;t++;if(!r.checkFn||(0,r.checkFn)(s)){i=r;r=null}else r=null}else t++}this.state=r;this.match=i;this.lastProcessed=t}flush(){for(;this.match;){const e=this.queue.fnArray.length;this.lastProcessed=(0,this.match.processFn)(this.context,e);this.match=null;this.state=null;this._optimize()}}reset(){this.state=null;this.match=null;this.lastProcessed=0}}class OperatorList{static get CHUNK_SIZE(){return(0,r.shadow)(this,"CHUNK_SIZE",1e3)}static get CHUNK_SIZE_ABOUT(){return(0,r.shadow)(this,"CHUNK_SIZE_ABOUT",this.CHUNK_SIZE-5)}constructor(e=0,t){this._streamSink=t;this.fnArray=[];this.argsArray=[];!t||e&r.RenderingIntentFlag.OPLIST?this.optimizer=new NullOptimizer(this):this.optimizer=new QueueOptimizer(this);this.dependencies=new Set;this._totalLength=0;this.weight=0;this._resolved=t?null:Promise.resolve()}get length(){return this.argsArray.length}get ready(){return this._resolved||this._streamSink.ready}get totalLength(){return this._totalLength+this.length}addOp(e,t){this.optimizer.push(e,t);this.weight++;this._streamSink&&(this.weight>=OperatorList.CHUNK_SIZE||this.weight>=OperatorList.CHUNK_SIZE_ABOUT&&(e===r.OPS.restore||e===r.OPS.endText))&&this.flush()}addImageOps(e,t,a){void 0!==a&&this.addOp(r.OPS.beginMarkedContentProps,["OC",a]);this.addOp(e,t);void 0!==a&&this.addOp(r.OPS.endMarkedContent,[])}addDependency(e){if(!this.dependencies.has(e)){this.dependencies.add(e);this.addOp(r.OPS.dependency,[e])}}addDependencies(e){for(const t of e)this.addDependency(t)}addOpList(e){if(e instanceof OperatorList){for(const t of e.dependencies)this.dependencies.add(t);for(let t=0,a=e.length;t<a;t++)this.addOp(e.fnArray[t],e.argsArray[t])}else(0,r.warn)('addOpList - ignoring invalid "opList" parameter.')}getIR(){return{fnArray:this.fnArray,argsArray:this.argsArray,length:this.length}}get _transfers(){const e=[],{fnArray:t,argsArray:a,length:n}=this;for(let i=0;i<n;i++)switch(t[i]){case r.OPS.paintInlineImageXObject:case r.OPS.paintInlineImageXObjectGroup:case r.OPS.paintImageMaskXObject:const t=a[i][0];!t.cached&&t.data&&t.data.buffer instanceof ArrayBuffer&&e.push(t.data.buffer)}return e}flush(e=!1,t=null){this.optimizer.flush();const a=this.length;this._totalLength+=a;this._streamSink.enqueue({fnArray:this.fnArray,argsArray:this.argsArray,lastChunk:e,separateAnnots:t,length:a},1,this._transfers);this.dependencies.clear();this.fnArray.length=0;this.argsArray.length=0;this.weight=0;this.optimizer.reset()}}t.OperatorList=OperatorList},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.PDFImage=void 0;var r=a(2),n=a(62),i=a(5),s=a(12),o=a(17),c=a(25),l=a(28),h=a(4);function decodeAndClamp(e,t,a,r){(e=t+e*a)<0?e=0:e>r&&(e=r);return e}function resizeImageMask(e,t,a,r,n,i){const s=n*i;let o;o=t<=8?new Uint8Array(s):t<=16?new Uint16Array(s):new Uint32Array(s);const c=a/n,l=r/i;let h,u,d,f,g=0;const p=new Uint16Array(n),m=a;for(h=0;h<n;h++)p[h]=Math.floor(h*c);for(h=0;h<i;h++){d=Math.floor(h*l)*m;for(u=0;u<n;u++){f=d+p[u];o[g++]=e[f]}}return o}class PDFImage{constructor({xref:e,res:t,image:a,isInline:n=!1,smask:o=null,mask:c=null,isMask:u=!1,pdfFunctionFactory:d,localColorSpaceCache:f}){this.image=a;const g=a.dict,p=g.get("F","Filter");let m;if(p instanceof h.Name)m=p.name;else if(Array.isArray(p)){const t=e.fetchIfRef(p[0]);t instanceof h.Name&&(m=t.name)}switch(m){case"JPXDecode":const e=new l.JpxImage;e.parseImageProperties(a.stream);a.stream.reset();a.width=e.width;a.height=e.height;a.bitsPerComponent=e.bitsPerComponent;a.numComps=e.componentsCount;break;case"JBIG2Decode":a.bitsPerComponent=1;a.numComps=1}let b=g.get("W","Width"),y=g.get("H","Height");if(Number.isInteger(a.width)&&a.width>0&&Number.isInteger(a.height)&&a.height>0&&(a.width!==b||a.height!==y)){(0,r.warn)("PDFImage - using the Width/Height of the image data, rather than the image dictionary.");b=a.width;y=a.height}if(b<1||y<1)throw new r.FormatError(`Invalid image width: ${b} or height: ${y}`);this.width=b;this.height=y;this.interpolate=g.get("I","Interpolate");this.imageMask=g.get("IM","ImageMask")||!1;this.matte=g.get("Matte")||!1;let w=a.bitsPerComponent;if(!w){w=g.get("BPC","BitsPerComponent");if(!w){if(!this.imageMask)throw new r.FormatError(`Bits per component missing in image: ${this.imageMask}`);w=1}}this.bpc=w;if(!this.imageMask){let i=g.getRaw("CS")||g.getRaw("ColorSpace");if(!i){(0,r.info)("JPX images (which do not require color spaces)");switch(a.numComps){case 1:i=h.Name.get("DeviceGray");break;case 3:i=h.Name.get("DeviceRGB");break;case 4:i=h.Name.get("DeviceCMYK");break;default:throw new Error(`JPX images with ${a.numComps} color components not supported.`)}}this.colorSpace=s.ColorSpace.parse({cs:i,xref:e,resources:n?t:null,pdfFunctionFactory:d,localColorSpaceCache:f});this.numComps=this.colorSpace.numComps}this.decode=g.getArray("D","Decode");this.needsDecode=!1;if(this.decode&&(this.colorSpace&&!this.colorSpace.isDefaultDecode(this.decode,w)||u&&!s.ColorSpace.isDefaultDecode(this.decode,1))){this.needsDecode=!0;const e=(1<<w)-1;this.decodeCoefficients=[];this.decodeAddends=[];const t=this.colorSpace&&"Indexed"===this.colorSpace.name;for(let a=0,r=0;a<this.decode.length;a+=2,++r){const n=this.decode[a],i=this.decode[a+1];this.decodeCoefficients[r]=t?(i-n)/e:i-n;this.decodeAddends[r]=t?n:e*n}}if(o)this.smask=new PDFImage({xref:e,res:t,image:o,isInline:n,pdfFunctionFactory:d,localColorSpaceCache:f});else if(c)if(c instanceof i.BaseStream){c.dict.get("IM","ImageMask")?this.mask=new PDFImage({xref:e,res:t,image:c,isInline:n,isMask:!0,pdfFunctionFactory:d,localColorSpaceCache:f}):(0,r.warn)("Ignoring /Mask in image without /ImageMask.")}else this.mask=c}static async buildImage({xref:e,res:t,image:a,isInline:n=!1,pdfFunctionFactory:s,localColorSpaceCache:o}){const c=a;let l=null,h=null;const u=a.dict.get("SMask"),d=a.dict.get("Mask");u?u instanceof i.BaseStream?l=u:(0,r.warn)("Unsupported /SMask format."):d&&(d instanceof i.BaseStream||Array.isArray(d)?h=d:(0,r.warn)("Unsupported /Mask format."));return new PDFImage({xref:e,res:t,image:c,isInline:n,smask:l,mask:h,pdfFunctionFactory:s,localColorSpaceCache:o})}static createRawMask({imgArray:e,width:t,height:a,imageIsFromDecodeStream:r,inverseDecode:n,interpolate:i}){const s=(t+7>>3)*a,o=e.byteLength;let c,l;if(!r||n&&!(s===o))if(n){c=new Uint8Array(s);c.set(e);c.fill(255,o)}else c=new Uint8Array(e);else c=e;if(n)for(l=0;l<o;l++)c[l]^=255;return{data:c,width:t,height:a,interpolate:i}}static createMask({imgArray:e,width:t,height:a,imageIsFromDecodeStream:i,inverseDecode:s,interpolate:o,isOffscreenCanvasSupported:c=!0}){const l=1===t&&1===a&&s===(0===e.length||!!(128&e[0]));if(l)return{isSingleOpaquePixel:l};if(c&&r.FeatureTest.isOffscreenCanvasSupported){const r=new OffscreenCanvas(t,a),i=r.getContext("2d"),c=i.createImageData(t,a);(0,n.applyMaskImageData)({src:e,dest:c.data,width:t,height:a,inverseDecode:s});i.putImageData(c,0,0);return{data:null,width:t,height:a,interpolate:o,bitmap:r.transferToImageBitmap()}}return this.createRawMask({imgArray:e,width:t,height:a,inverseDecode:s,imageIsFromDecodeStream:i,interpolate:o})}get drawWidth(){return Math.max(this.width,this.smask&&this.smask.width||0,this.mask&&this.mask.width||0)}get drawHeight(){return Math.max(this.height,this.smask&&this.smask.height||0,this.mask&&this.mask.height||0)}decodeBuffer(e){const t=this.bpc,a=this.numComps,r=this.decodeAddends,n=this.decodeCoefficients,i=(1<<t)-1;let s,o;if(1===t){for(s=0,o=e.length;s<o;s++)e[s]=+!e[s];return}let c=0;for(s=0,o=this.width*this.height;s<o;s++)for(let t=0;t<a;t++){e[c]=decodeAndClamp(e[c],r[t],n[t],i);c++}}getComponents(e){const t=this.bpc;if(8===t)return e;const a=this.width,r=this.height,n=this.numComps,i=a*r*n;let s,o=0;s=t<=8?new Uint8Array(i):t<=16?new Uint16Array(i):new Uint32Array(i);const c=a*n,l=(1<<t)-1;let h,u,d=0;if(1===t){let t,a,n;for(let i=0;i<r;i++){a=d+(-8&c);n=d+c;for(;d<a;){u=e[o++];s[d]=u>>7&1;s[d+1]=u>>6&1;s[d+2]=u>>5&1;s[d+3]=u>>4&1;s[d+4]=u>>3&1;s[d+5]=u>>2&1;s[d+6]=u>>1&1;s[d+7]=1&u;d+=8}if(d<n){u=e[o++];t=128;for(;d<n;){s[d++]=+!!(u&t);t>>=1}}}}else{let a=0;u=0;for(d=0,h=i;d<h;++d){if(d%c==0){u=0;a=0}for(;a<t;){u=u<<8|e[o++];a+=8}const r=a-t;let n=u>>r;n<0?n=0:n>l&&(n=l);s[d]=n;u&=(1<<r)-1;a=r}}return s}fillOpacity(e,t,a,n,i){const s=this.smask,o=this.mask;let c,l,h,u,d,f;if(s){l=s.width;h=s.height;c=new Uint8ClampedArray(l*h);s.fillGrayBuffer(c);l===t&&h===a||(c=resizeImageMask(c,s.bpc,l,h,t,a))}else if(o)if(o instanceof PDFImage){l=o.width;h=o.height;c=new Uint8ClampedArray(l*h);o.numComps=1;o.fillGrayBuffer(c);for(u=0,d=l*h;u<d;++u)c[u]=255-c[u];l===t&&h===a||(c=resizeImageMask(c,o.bpc,l,h,t,a))}else{if(!Array.isArray(o))throw new r.FormatError("Unknown mask format.");{c=new Uint8ClampedArray(t*a);const e=this.numComps;for(u=0,d=t*a;u<d;++u){let t=0;const a=u*e;for(f=0;f<e;++f){const e=i[a+f],r=2*f;if(e<o[r]||e>o[r+1]){t=255;break}}c[u]=t}}}if(c)for(u=0,f=3,d=t*n;u<d;++u,f+=4)e[f]=c[u];else for(u=0,f=3,d=t*n;u<d;++u,f+=4)e[f]=255}undoPreblend(e,t,a){const r=this.smask&&this.smask.matte;if(!r)return;const n=this.colorSpace.getRgb(r,0),i=n[0],s=n[1],o=n[2],c=t*a*4;for(let t=0;t<c;t+=4){const a=e[t+3];if(0===a){e[t]=255;e[t+1]=255;e[t+2]=255;continue}const r=255/a;e[t]=(e[t]-i)*r+i;e[t+1]=(e[t+1]-s)*r+s;e[t+2]=(e[t+2]-o)*r+o}}createImageData(e=!1){const t=this.drawWidth,a=this.drawHeight,n={width:t,height:a,interpolate:this.interpolate,kind:0,data:null},i=this.numComps,s=this.width,o=this.height,l=this.bpc,h=s*i*l+7>>3;if(!e){let e;"DeviceGray"===this.colorSpace.name&&1===l?e=r.ImageKind.GRAYSCALE_1BPP:"DeviceRGB"!==this.colorSpace.name||8!==l||this.needsDecode||(e=r.ImageKind.RGB_24BPP);if(e&&!this.smask&&!this.mask&&t===s&&a===o){n.kind=e;n.data=this.getImageBytes(o*h,{});if(this.needsDecode){(0,r.assert)(e===r.ImageKind.GRAYSCALE_1BPP,"PDFImage.createImageData: The image must be grayscale.");const t=n.data;for(let e=0,a=t.length;e<a;e++)t[e]^=255}return n}if(this.image instanceof c.JpegStream&&!this.smask&&!this.mask){let e=o*h;switch(this.colorSpace.name){case"DeviceGray":e*=3;case"DeviceRGB":case"DeviceCMYK":n.kind=r.ImageKind.RGB_24BPP;n.data=this.getImageBytes(e,{drawWidth:t,drawHeight:a,forceRGB:!0});return n}}}const u=this.getImageBytes(o*h,{internal:!0}),d=0|u.length/h*a/o,f=this.getComponents(u);let g,p;if(e||this.smask||this.mask){n.kind=r.ImageKind.RGBA_32BPP;n.data=new Uint8ClampedArray(t*a*4);g=1;p=!0;this.fillOpacity(n.data,t,a,d,f)}else{n.kind=r.ImageKind.RGB_24BPP;n.data=new Uint8ClampedArray(t*a*3);g=0;p=!1}this.needsDecode&&this.decodeBuffer(f);this.colorSpace.fillRgb(n.data,s,o,t,a,d,l,f,g);p&&this.undoPreblend(n.data,t,d);return n}fillGrayBuffer(e){const t=this.numComps;if(1!==t)throw new r.FormatError(`Reading gray scale from a color image: ${t}`);const a=this.width,n=this.height,i=this.bpc,s=a*t*i+7>>3,o=this.getImageBytes(n*s,{internal:!0}),c=this.getComponents(o);let l,h;if(1===i){h=a*n;if(this.needsDecode)for(l=0;l<h;++l)e[l]=c[l]-1&255;else for(l=0;l<h;++l)e[l]=255&-c[l];return}this.needsDecode&&this.decodeBuffer(c);h=a*n;const u=255/((1<<i)-1);for(l=0;l<h;++l)e[l]=u*c[l]}getImageBytes(e,{drawWidth:t,drawHeight:a,forceRGB:n=!1,internal:i=!1}){this.image.reset();this.image.drawWidth=t||this.width;this.image.drawHeight=a||this.height;this.image.forceRGB=!!n;const s=this.image.getBytes(e);if(i||this.image instanceof o.DecodeStream)return s;(0,r.assert)(s instanceof Uint8Array,'PDFImage.getImageBytes: Unsupported "imageBytes" type.');return new Uint8Array(s)}}t.PDFImage=PDFImage},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.applyMaskImageData=function applyMaskImageData({src:e,srcPos:t=0,dest:a,destPos:n=0,width:i,height:s,inverseDecode:o=!1}){const c=r.FeatureTest.isLittleEndian?4278190080:255,[l,h]=o?[0,c]:[c,0],u=i>>3,d=7&i,f=e.length;a=new Uint32Array(a.buffer);for(let r=0;r<s;r++){for(const r=t+u;t<r;t++){const r=t<f?e[t]:255;a[n++]=128&r?h:l;a[n++]=64&r?h:l;a[n++]=32&r?h:l;a[n++]=16&r?h:l;a[n++]=8&r?h:l;a[n++]=4&r?h:l;a[n++]=2&r?h:l;a[n++]=1&r?h:l}if(0===d)continue;const r=t<f?e[t++]:255;for(let e=0;e<d;e++)a[n++]=r&1<<7-e?h:l}return{srcPos:t,destPos:n}};var r=a(2)},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.incrementalUpdate=function incrementalUpdate({originalData:e,xrefInfo:t,newRefs:a,xref:o=null,hasXfa:l=!1,xfaDatasetsRef:h=null,hasXfaDatasetsEntry:u=!1,needAppearances:d,acroFormRef:f=null,acroForm:g=null,xfaData:p=null}){!function updateAcroform({xref:e,acroForm:t,acroFormRef:a,hasXfa:i,hasXfaDatasetsEntry:s,xfaDatasetsRef:o,needAppearances:c,newRefs:l}){!i||s||o||(0,r.warn)("XFA - Cannot save it");if(!(c||i&&o))return;const h=new n.Dict(e);for(const e of t.getKeys())h.set(e,t.getRaw(e));if(i&&!s){const e=t.get("XFA").slice();e.splice(2,0,"datasets");e.splice(3,0,o);h.set("XFA",e)}c&&h.set("NeedAppearances",!0);const u=e.encrypt;let d=null;u&&(d=u.createCipherTransform(a.num,a.gen));const f=[];writeObject(a,h,f,d);l.push({ref:a,data:f.join("")})}({xref:o,acroForm:g,acroFormRef:f,hasXfa:l,hasXfaDatasetsEntry:u,xfaDatasetsRef:h,needAppearances:d,newRefs:a});l&&function updateXFA({xfaData:e,xfaDatasetsRef:t,newRefs:a,xref:n}){if(null===e){e=function writeXFADataForAcroform(e,t){const a=new s.SimpleXMLParser({hasAttributes:!0}).parseFromString(e);for(const{xfa:e}of t){if(!e)continue;const{path:t,value:n}=e;if(!t)continue;const o=(0,i.parseXFAPath)(t);let c=a.documentElement.searchNode(o,0);!c&&o.length>1&&(c=a.documentElement.searchNode([o.at(-1)],0));c?Array.isArray(n)?c.childNodes=n.map((e=>new s.SimpleDOMNode("value",e))):c.childNodes=[new s.SimpleDOMNode("#text",n)]:(0,r.warn)(`Node not found for path: ${t}`)}const n=[];a.documentElement.dump(n);return n.join("")}(n.fetchIfRef(t).getString(),a)}const o=n.encrypt;if(o){e=o.createCipherTransform(t.num,t.gen).encryptString(e)}const c=`${t.num} ${t.gen} obj\n<< /Type /EmbeddedFile /Length ${e.length}>>\nstream\n`+e+"\nendstream\nendobj\n";a.push({ref:t,data:c})}({xfaData:p,xfaDatasetsRef:h,newRefs:a,xref:o});const m=new n.Dict(null),b=t.newRef;let y,w;const S=e.at(-1);if(10===S||13===S){y=[];w=e.length}else{y=["\n"];w=e.length+1}m.set("Size",b.num+1);m.set("Prev",t.startXRef);m.set("Type",n.Name.get("XRef"));null!==t.rootRef&&m.set("Root",t.rootRef);null!==t.infoRef&&m.set("Info",t.infoRef);null!==t.encryptRef&&m.set("Encrypt",t.encryptRef);a.push({ref:b,data:""});a=a.sort(((e,t)=>e.ref.num-t.ref.num));const x=[[0,1,65535]],C=[0,1];let k=0;for(const{ref:e,data:t}of a){k=Math.max(k,w);x.push([1,w,Math.min(e.gen,65535)]);w+=t.length;C.push(e.num,1);y.push(t)}m.set("Index",C);if(Array.isArray(t.fileIds)&&t.fileIds.length>0){const e=function computeMD5(e,t){const a=Math.floor(Date.now()/1e3),n=t.filename||"",i=[a.toString(),n,e.toString()];let s=i.reduce(((e,t)=>e+t.length),0);for(const e of Object.values(t.info)){i.push(e);s+=e.length}const o=new Uint8Array(s);let l=0;for(const e of i){writeString(e,l,o);l+=e.length}return(0,r.bytesToString)((0,c.calculateMD5)(o))}(w,t);m.set("ID",[t.fileIds[0],e])}const v=[1,Math.ceil(Math.log2(k)/8),2],F=(v[0]+v[1]+v[2])*x.length;m.set("W",v);m.set("Length",F);y.push(`${b.num} ${b.gen} obj\n`);writeDict(m,y,null);y.push(" stream\n");const O=y.reduce(((e,t)=>e+t.length),0),T=`\nendstream\nendobj\nstartxref\n${w}\n%%EOF\n`,M=new Uint8Array(e.length+O+F+T.length);M.set(e);let E=e.length;for(const e of y){writeString(e,E,M);E+=e.length}for(const[e,t,a]of x){E=writeInt(e,v[0],E,M);E=writeInt(t,v[1],E,M);E=writeInt(a,v[2],E,M)}writeString(T,E,M);return M};t.writeDict=writeDict;t.writeObject=writeObject;var r=a(2),n=a(4),i=a(3),s=a(64),o=a(5),c=a(65);function writeObject(e,t,a,r){a.push(`${e.num} ${e.gen} obj\n`);t instanceof n.Dict?writeDict(t,a,r):t instanceof o.BaseStream&&writeStream(t,a,r);a.push("\nendobj\n")}function writeDict(e,t,a){t.push("<<");for(const r of e.getKeys()){t.push(` /${(0,i.escapePDFName)(r)} `);writeValue(e.getRaw(r),t,a)}t.push(">>")}function writeStream(e,t,a){let r=e.getString();null!==a&&(r=a.encryptString(r));e.dict.set("Length",r.length);writeDict(e.dict,t,a);t.push(" stream\n",r,"\nendstream")}function writeValue(e,t,a){if(e instanceof n.Name)t.push(`/${(0,i.escapePDFName)(e.name)}`);else if(e instanceof n.Ref)t.push(`${e.num} ${e.gen} R`);else if(Array.isArray(e))!function writeArray(e,t,a){t.push("[");let r=!0;for(const n of e){r?r=!1:t.push(" ");writeValue(n,t,a)}t.push("]")}(e,t,a);else if("string"==typeof e){null!==a&&(e=a.encryptString(e));t.push(`(${(0,i.escapeString)(e)})`)}else"number"==typeof e?t.push((0,i.numberToString)(e)):"boolean"==typeof e?t.push(e.toString()):e instanceof n.Dict?writeDict(e,t,a):e instanceof o.BaseStream?writeStream(e,t,a):null===e?t.push("null"):(0,r.warn)(`Unhandled value in writer: ${typeof e}, please file a bug.`)}function writeInt(e,t,a,r){for(let n=t+a-1;n>a-1;n--){r[n]=255&e;e>>=8}return a+t}function writeString(e,t,a){for(let r=0,n=e.length;r<n;r++)a[t+r]=255&e.charCodeAt(r)}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.XMLParserErrorCode=t.XMLParserBase=t.SimpleXMLParser=t.SimpleDOMNode=void 0;var r=a(3);const n={NoError:0,EndOfDocument:-1,UnterminatedCdat:-2,UnterminatedXmlDeclaration:-3,UnterminatedDoctypeDeclaration:-4,UnterminatedComment:-5,MalformedElement:-6,OutOfMemory:-7,UnterminatedAttributeValue:-8,UnterminatedElement:-9,ElementNeverBegun:-10};t.XMLParserErrorCode=n;function isWhitespace(e,t){const a=e[t];return" "===a||"\n"===a||"\r"===a||"\t"===a}class XMLParserBase{_resolveEntities(e){return e.replace(/&([^;]+);/g,((e,t)=>{if("#x"===t.substring(0,2))return String.fromCodePoint(parseInt(t.substring(2),16));if("#"===t.substring(0,1))return String.fromCodePoint(parseInt(t.substring(1),10));switch(t){case"lt":return"<";case"gt":return">";case"amp":return"&";case"quot":return'"';case"apos":return"'"}return this.onResolveEntity(t)}))}_parseContent(e,t){const a=[];let r=t;function skipWs(){for(;r<e.length&&isWhitespace(e,r);)++r}for(;r<e.length&&!isWhitespace(e,r)&&">"!==e[r]&&"/"!==e[r];)++r;const n=e.substring(t,r);skipWs();for(;r<e.length&&">"!==e[r]&&"/"!==e[r]&&"?"!==e[r];){skipWs();let t="",n="";for(;r<e.length&&!isWhitespace(e,r)&&"="!==e[r];){t+=e[r];++r}skipWs();if("="!==e[r])return null;++r;skipWs();const i=e[r];if('"'!==i&&"'"!==i)return null;const s=e.indexOf(i,++r);if(s<0)return null;n=e.substring(r,s);a.push({name:t,value:this._resolveEntities(n)});r=s+1;skipWs()}return{name:n,attributes:a,parsed:r-t}}_parseProcessingInstruction(e,t){let a=t;for(;a<e.length&&!isWhitespace(e,a)&&">"!==e[a]&&"?"!==e[a]&&"/"!==e[a];)++a;const r=e.substring(t,a);!function skipWs(){for(;a<e.length&&isWhitespace(e,a);)++a}();const n=a;for(;a<e.length&&("?"!==e[a]||">"!==e[a+1]);)++a;return{name:r,value:e.substring(n,a),parsed:a-t}}parseXml(e){let t=0;for(;t<e.length;){let a=t;if("<"===e[t]){++a;let t;switch(e[a]){case"/":++a;t=e.indexOf(">",a);if(t<0){this.onError(n.UnterminatedElement);return}this.onEndElement(e.substring(a,t));a=t+1;break;case"?":++a;const r=this._parseProcessingInstruction(e,a);if("?>"!==e.substring(a+r.parsed,a+r.parsed+2)){this.onError(n.UnterminatedXmlDeclaration);return}this.onPi(r.name,r.value);a+=r.parsed+2;break;case"!":if("--"===e.substring(a+1,a+3)){t=e.indexOf("--\x3e",a+3);if(t<0){this.onError(n.UnterminatedComment);return}this.onComment(e.substring(a+3,t));a=t+3}else if("[CDATA["===e.substring(a+1,a+8)){t=e.indexOf("]]>",a+8);if(t<0){this.onError(n.UnterminatedCdat);return}this.onCdata(e.substring(a+8,t));a=t+3}else{if("DOCTYPE"!==e.substring(a+1,a+8)){this.onError(n.MalformedElement);return}{const r=e.indexOf("[",a+8);let i=!1;t=e.indexOf(">",a+8);if(t<0){this.onError(n.UnterminatedDoctypeDeclaration);return}if(r>0&&t>r){t=e.indexOf("]>",a+8);if(t<0){this.onError(n.UnterminatedDoctypeDeclaration);return}i=!0}const s=e.substring(a+8,t+(i?1:0));this.onDoctype(s);a=t+(i?2:1)}}break;default:const i=this._parseContent(e,a);if(null===i){this.onError(n.MalformedElement);return}let s=!1;if("/>"===e.substring(a+i.parsed,a+i.parsed+2))s=!0;else if(">"!==e.substring(a+i.parsed,a+i.parsed+1)){this.onError(n.UnterminatedElement);return}this.onBeginElement(i.name,i.attributes,s);a+=i.parsed+(s?2:1)}}else{for(;a<e.length&&"<"!==e[a];)a++;const r=e.substring(t,a);this.onText(this._resolveEntities(r))}t=a}}onResolveEntity(e){return`&${e};`}onPi(e,t){}onComment(e){}onCdata(e){}onDoctype(e){}onText(e){}onBeginElement(e,t,a){}onEndElement(e){}onError(e){}}t.XMLParserBase=XMLParserBase;class SimpleDOMNode{constructor(e,t){this.nodeName=e;this.nodeValue=t;Object.defineProperty(this,"parentNode",{value:null,writable:!0})}get firstChild(){return this.childNodes&&this.childNodes[0]}get nextSibling(){const e=this.parentNode.childNodes;if(!e)return;const t=e.indexOf(this);return-1!==t?e[t+1]:void 0}get textContent(){return this.childNodes?this.childNodes.map((function(e){return e.textContent})).join(""):this.nodeValue||""}get children(){return this.childNodes||[]}hasChildNodes(){return this.childNodes&&this.childNodes.length>0}searchNode(e,t){if(t>=e.length)return this;const a=e[t],r=[];let n=this;for(;;){if(a.name===n.nodeName){if(0!==a.pos){if(0===r.length)return null;{const[i]=r.pop();let s=0;for(const r of i.childNodes)if(a.name===r.nodeName){if(s===a.pos)return r.searchNode(e,t+1);s++}return n.searchNode(e,t+1)}}{const a=n.searchNode(e,t+1);if(null!==a)return a}}if(n.childNodes&&0!==n.childNodes.length){r.push([n,0]);n=n.childNodes[0]}else{if(0===r.length)return null;for(;0!==r.length;){const[e,t]=r.pop(),a=t+1;if(a<e.childNodes.length){r.push([e,a]);n=e.childNodes[a];break}}if(0===r.length)return null}}}dump(e){if("#text"!==this.nodeName){e.push(`<${this.nodeName}`);if(this.attributes)for(const t of this.attributes)e.push(` ${t.name}="${(0,r.encodeToXmlString)(t.value)}"`);if(this.hasChildNodes()){e.push(">");for(const t of this.childNodes)t.dump(e);e.push(`</${this.nodeName}>`)}else this.nodeValue?e.push(`>${(0,r.encodeToXmlString)(this.nodeValue)}</${this.nodeName}>`):e.push("/>")}else e.push((0,r.encodeToXmlString)(this.nodeValue))}}t.SimpleDOMNode=SimpleDOMNode;t.SimpleXMLParser=class SimpleXMLParser extends XMLParserBase{constructor({hasAttributes:e=!1,lowerCaseName:t=!1}){super();this._currentFragment=null;this._stack=null;this._errorCode=n.NoError;this._hasAttributes=e;this._lowerCaseName=t}parseFromString(e){this._currentFragment=[];this._stack=[];this._errorCode=n.NoError;this.parseXml(e);if(this._errorCode!==n.NoError)return;const[t]=this._currentFragment;return t?{documentElement:t}:void 0}onText(e){if(function isWhitespaceString(e){for(let t=0,a=e.length;t<a;t++)if(!isWhitespace(e,t))return!1;return!0}(e))return;const t=new SimpleDOMNode("#text",e);this._currentFragment.push(t)}onCdata(e){const t=new SimpleDOMNode("#text",e);this._currentFragment.push(t)}onBeginElement(e,t,a){this._lowerCaseName&&(e=e.toLowerCase());const r=new SimpleDOMNode(e);r.childNodes=[];this._hasAttributes&&(r.attributes=t);this._currentFragment.push(r);if(!a){this._stack.push(this._currentFragment);this._currentFragment=r.childNodes}}onEndElement(e){this._currentFragment=this._stack.pop()||[];const t=this._currentFragment.at(-1);if(!t)return null;for(const e of t.childNodes)e.parentNode=t;return t}onError(e){this._errorCode=e}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.calculateSHA256=t.calculateMD5=t.PDF20=t.PDF17=t.CipherTransformFactory=t.ARCFourCipher=t.AES256Cipher=t.AES128Cipher=void 0;t.calculateSHA384=calculateSHA384;t.calculateSHA512=void 0;var r=a(2),n=a(4),i=a(66);class ARCFourCipher{constructor(e){this.a=0;this.b=0;const t=new Uint8Array(256),a=e.length;for(let e=0;e<256;++e)t[e]=e;for(let r=0,n=0;r<256;++r){const i=t[r];n=n+i+e[r%a]&255;t[r]=t[n];t[n]=i}this.s=t}encryptBlock(e){let t=this.a,a=this.b;const r=this.s,n=e.length,i=new Uint8Array(n);for(let s=0;s<n;++s){t=t+1&255;const n=r[t];a=a+n&255;const o=r[a];r[t]=o;r[a]=n;i[s]=e[s]^r[n+o&255]}this.a=t;this.b=a;return i}decryptBlock(e){return this.encryptBlock(e)}encrypt(e){return this.encryptBlock(e)}}t.ARCFourCipher=ARCFourCipher;const s=function calculateMD5Closure(){const e=new Uint8Array([7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21]),t=new Int32Array([-680876936,-389564586,606105819,-1044525330,-176418897,1200080426,-1473231341,-45705983,1770035416,-1958414417,-42063,-1990404162,1804603682,-40341101,-1502002290,1236535329,-165796510,-1069501632,643717713,-373897302,-701558691,38016083,-660478335,-405537848,568446438,-1019803690,-187363961,1163531501,-1444681467,-51403784,1735328473,-1926607734,-378558,-2022574463,1839030562,-35309556,-1530992060,1272893353,-155497632,-1094730640,681279174,-358537222,-722521979,76029189,-640364487,-421815835,530742520,-995338651,-198630844,1126891415,-1416354905,-57434055,1700485571,-1894986606,-1051523,-2054922799,1873313359,-30611744,-1560198380,1309151649,-145523070,-1120210379,718787259,-343485551]);return function hash(a,r,n){let i=1732584193,s=-271733879,o=-1732584194,c=271733878;const l=n+72&-64,h=new Uint8Array(l);let u,d;for(u=0;u<n;++u)h[u]=a[r++];h[u++]=128;const f=l-8;for(;u<f;)h[u++]=0;h[u++]=n<<3&255;h[u++]=n>>5&255;h[u++]=n>>13&255;h[u++]=n>>21&255;h[u++]=n>>>29&255;h[u++]=0;h[u++]=0;h[u++]=0;const g=new Int32Array(16);for(u=0;u<l;){for(d=0;d<16;++d,u+=4)g[d]=h[u]|h[u+1]<<8|h[u+2]<<16|h[u+3]<<24;let a,r,n=i,l=s,f=o,p=c;for(d=0;d<64;++d){if(d<16){a=l&f|~l&p;r=d}else if(d<32){a=p&l|~p&f;r=5*d+1&15}else if(d<48){a=l^f^p;r=3*d+5&15}else{a=f^(l|~p);r=7*d&15}const i=p,s=n+a+t[d]+g[r]|0,o=e[d];p=f;f=l;l=l+(s<<o|s>>>32-o)|0;n=i}i=i+n|0;s=s+l|0;o=o+f|0;c=c+p|0}return new Uint8Array([255&i,i>>8&255,i>>16&255,i>>>24&255,255&s,s>>8&255,s>>16&255,s>>>24&255,255&o,o>>8&255,o>>16&255,o>>>24&255,255&c,c>>8&255,c>>16&255,c>>>24&255])}}();t.calculateMD5=s;class Word64{constructor(e,t){this.high=0|e;this.low=0|t}and(e){this.high&=e.high;this.low&=e.low}xor(e){this.high^=e.high;this.low^=e.low}or(e){this.high|=e.high;this.low|=e.low}shiftRight(e){if(e>=32){this.low=this.high>>>e-32|0;this.high=0}else{this.low=this.low>>>e|this.high<<32-e;this.high=this.high>>>e|0}}shiftLeft(e){if(e>=32){this.high=this.low<<e-32;this.low=0}else{this.high=this.high<<e|this.low>>>32-e;this.low<<=e}}rotateRight(e){let t,a;if(32&e){a=this.low;t=this.high}else{t=this.low;a=this.high}e&=31;this.low=t>>>e|a<<32-e;this.high=a>>>e|t<<32-e}not(){this.high=~this.high;this.low=~this.low}add(e){const t=(this.low>>>0)+(e.low>>>0);let a=(this.high>>>0)+(e.high>>>0);t>4294967295&&(a+=1);this.low=0|t;this.high=0|a}copyTo(e,t){e[t]=this.high>>>24&255;e[t+1]=this.high>>16&255;e[t+2]=this.high>>8&255;e[t+3]=255&this.high;e[t+4]=this.low>>>24&255;e[t+5]=this.low>>16&255;e[t+6]=this.low>>8&255;e[t+7]=255&this.low}assign(e){this.high=e.high;this.low=e.low}}const o=function calculateSHA256Closure(){function rotr(e,t){return e>>>t|e<<32-t}function ch(e,t,a){return e&t^~e&a}function maj(e,t,a){return e&t^e&a^t&a}function sigma(e){return rotr(e,2)^rotr(e,13)^rotr(e,22)}function sigmaPrime(e){return rotr(e,6)^rotr(e,11)^rotr(e,25)}function littleSigma(e){return rotr(e,7)^rotr(e,18)^e>>>3}const e=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];return function hash(t,a,r){let n=1779033703,i=3144134277,s=1013904242,o=2773480762,c=1359893119,l=2600822924,h=528734635,u=1541459225;const d=64*Math.ceil((r+9)/64),f=new Uint8Array(d);let g,p;for(g=0;g<r;++g)f[g]=t[a++];f[g++]=128;const m=d-8;for(;g<m;)f[g++]=0;f[g++]=0;f[g++]=0;f[g++]=0;f[g++]=r>>>29&255;f[g++]=r>>21&255;f[g++]=r>>13&255;f[g++]=r>>5&255;f[g++]=r<<3&255;const b=new Uint32Array(64);for(g=0;g<d;){for(p=0;p<16;++p){b[p]=f[g]<<24|f[g+1]<<16|f[g+2]<<8|f[g+3];g+=4}for(p=16;p<64;++p)b[p]=(rotr(y=b[p-2],17)^rotr(y,19)^y>>>10)+b[p-7]+littleSigma(b[p-15])+b[p-16]|0;let t,a,r=n,d=i,m=s,w=o,S=c,x=l,C=h,k=u;for(p=0;p<64;++p){t=k+sigmaPrime(S)+ch(S,x,C)+e[p]+b[p];a=sigma(r)+maj(r,d,m);k=C;C=x;x=S;S=w+t|0;w=m;m=d;d=r;r=t+a|0}n=n+r|0;i=i+d|0;s=s+m|0;o=o+w|0;c=c+S|0;l=l+x|0;h=h+C|0;u=u+k|0}var y;return new Uint8Array([n>>24&255,n>>16&255,n>>8&255,255&n,i>>24&255,i>>16&255,i>>8&255,255&i,s>>24&255,s>>16&255,s>>8&255,255&s,o>>24&255,o>>16&255,o>>8&255,255&o,c>>24&255,c>>16&255,c>>8&255,255&c,l>>24&255,l>>16&255,l>>8&255,255&l,h>>24&255,h>>16&255,h>>8&255,255&h,u>>24&255,u>>16&255,u>>8&255,255&u])}}();t.calculateSHA256=o;const c=function calculateSHA512Closure(){function ch(e,t,a,r,n){e.assign(t);e.and(a);n.assign(t);n.not();n.and(r);e.xor(n)}function maj(e,t,a,r,n){e.assign(t);e.and(a);n.assign(t);n.and(r);e.xor(n);n.assign(a);n.and(r);e.xor(n)}function sigma(e,t,a){e.assign(t);e.rotateRight(28);a.assign(t);a.rotateRight(34);e.xor(a);a.assign(t);a.rotateRight(39);e.xor(a)}function sigmaPrime(e,t,a){e.assign(t);e.rotateRight(14);a.assign(t);a.rotateRight(18);e.xor(a);a.assign(t);a.rotateRight(41);e.xor(a)}function littleSigma(e,t,a){e.assign(t);e.rotateRight(1);a.assign(t);a.rotateRight(8);e.xor(a);a.assign(t);a.shiftRight(7);e.xor(a)}function littleSigmaPrime(e,t,a){e.assign(t);e.rotateRight(19);a.assign(t);a.rotateRight(61);e.xor(a);a.assign(t);a.shiftRight(6);e.xor(a)}const e=[new Word64(1116352408,3609767458),new Word64(1899447441,602891725),new Word64(3049323471,3964484399),new Word64(3921009573,2173295548),new Word64(961987163,4081628472),new Word64(1508970993,3053834265),new Word64(2453635748,2937671579),new Word64(2870763221,3664609560),new Word64(3624381080,2734883394),new Word64(310598401,1164996542),new Word64(607225278,1323610764),new Word64(1426881987,3590304994),new Word64(1925078388,4068182383),new Word64(2162078206,991336113),new Word64(2614888103,633803317),new Word64(3248222580,3479774868),new Word64(3835390401,2666613458),new Word64(4022224774,944711139),new Word64(264347078,2341262773),new Word64(604807628,2007800933),new Word64(770255983,1495990901),new Word64(1249150122,1856431235),new Word64(1555081692,3175218132),new Word64(1996064986,2198950837),new Word64(2554220882,3999719339),new Word64(2821834349,766784016),new Word64(2952996808,2566594879),new Word64(3210313671,3203337956),new Word64(3336571891,1034457026),new Word64(3584528711,2466948901),new Word64(113926993,3758326383),new Word64(338241895,168717936),new Word64(666307205,1188179964),new Word64(773529912,1546045734),new Word64(1294757372,1522805485),new Word64(1396182291,2643833823),new Word64(1695183700,2343527390),new Word64(1986661051,1014477480),new Word64(2177026350,1206759142),new Word64(2456956037,344077627),new Word64(2730485921,1290863460),new Word64(2820302411,3158454273),new Word64(3259730800,3505952657),new Word64(3345764771,106217008),new Word64(3516065817,3606008344),new Word64(3600352804,1432725776),new Word64(4094571909,1467031594),new Word64(275423344,851169720),new Word64(430227734,3100823752),new Word64(506948616,1363258195),new Word64(659060556,3750685593),new Word64(883997877,3785050280),new Word64(958139571,3318307427),new Word64(1322822218,3812723403),new Word64(1537002063,2003034995),new Word64(1747873779,3602036899),new Word64(1955562222,1575990012),new Word64(2024104815,1125592928),new Word64(2227730452,2716904306),new Word64(2361852424,442776044),new Word64(2428436474,593698344),new Word64(2756734187,3733110249),new Word64(3204031479,2999351573),new Word64(3329325298,3815920427),new Word64(3391569614,3928383900),new Word64(3515267271,566280711),new Word64(3940187606,3454069534),new Word64(4118630271,4000239992),new Word64(116418474,1914138554),new Word64(174292421,2731055270),new Word64(289380356,3203993006),new Word64(460393269,320620315),new Word64(685471733,587496836),new Word64(852142971,1086792851),new Word64(1017036298,365543100),new Word64(1126000580,2618297676),new Word64(1288033470,3409855158),new Word64(1501505948,4234509866),new Word64(1607167915,987167468),new Word64(1816402316,1246189591)];return function hash(t,a,r,n=!1){let i,s,o,c,l,h,u,d;if(n){i=new Word64(3418070365,3238371032);s=new Word64(1654270250,914150663);o=new Word64(2438529370,812702999);c=new Word64(355462360,4144912697);l=new Word64(1731405415,4290775857);h=new Word64(2394180231,1750603025);u=new Word64(3675008525,1694076839);d=new Word64(1203062813,3204075428)}else{i=new Word64(1779033703,4089235720);s=new Word64(3144134277,2227873595);o=new Word64(1013904242,4271175723);c=new Word64(2773480762,1595750129);l=new Word64(1359893119,2917565137);h=new Word64(2600822924,725511199);u=new Word64(528734635,4215389547);d=new Word64(1541459225,327033209)}const f=128*Math.ceil((r+17)/128),g=new Uint8Array(f);let p,m;for(p=0;p<r;++p)g[p]=t[a++];g[p++]=128;const b=f-16;for(;p<b;)g[p++]=0;g[p++]=0;g[p++]=0;g[p++]=0;g[p++]=0;g[p++]=0;g[p++]=0;g[p++]=0;g[p++]=0;g[p++]=0;g[p++]=0;g[p++]=0;g[p++]=r>>>29&255;g[p++]=r>>21&255;g[p++]=r>>13&255;g[p++]=r>>5&255;g[p++]=r<<3&255;const y=new Array(80);for(p=0;p<80;p++)y[p]=new Word64(0,0);let w=new Word64(0,0),S=new Word64(0,0),x=new Word64(0,0),C=new Word64(0,0),k=new Word64(0,0),v=new Word64(0,0),F=new Word64(0,0),O=new Word64(0,0);const T=new Word64(0,0),M=new Word64(0,0),E=new Word64(0,0),D=new Word64(0,0);let N,R;for(p=0;p<f;){for(m=0;m<16;++m){y[m].high=g[p]<<24|g[p+1]<<16|g[p+2]<<8|g[p+3];y[m].low=g[p+4]<<24|g[p+5]<<16|g[p+6]<<8|g[p+7];p+=8}for(m=16;m<80;++m){N=y[m];littleSigmaPrime(N,y[m-2],D);N.add(y[m-7]);littleSigma(E,y[m-15],D);N.add(E);N.add(y[m-16])}w.assign(i);S.assign(s);x.assign(o);C.assign(c);k.assign(l);v.assign(h);F.assign(u);O.assign(d);for(m=0;m<80;++m){T.assign(O);sigmaPrime(E,k,D);T.add(E);ch(E,k,v,F,D);T.add(E);T.add(e[m]);T.add(y[m]);sigma(M,w,D);maj(E,w,S,x,D);M.add(E);N=O;O=F;F=v;v=k;C.add(T);k=C;C=x;x=S;S=w;N.assign(T);N.add(M);w=N}i.add(w);s.add(S);o.add(x);c.add(C);l.add(k);h.add(v);u.add(F);d.add(O)}if(n){R=new Uint8Array(48);i.copyTo(R,0);s.copyTo(R,8);o.copyTo(R,16);c.copyTo(R,24);l.copyTo(R,32);h.copyTo(R,40)}else{R=new Uint8Array(64);i.copyTo(R,0);s.copyTo(R,8);o.copyTo(R,16);c.copyTo(R,24);l.copyTo(R,32);h.copyTo(R,40);u.copyTo(R,48);d.copyTo(R,56)}return R}}();t.calculateSHA512=c;function calculateSHA384(e,t,a){return c(e,t,a,!0)}class NullCipher{decryptBlock(e){return e}encrypt(e){return e}}class AESBaseCipher{constructor(){this.constructor===AESBaseCipher&&(0,r.unreachable)("Cannot initialize AESBaseCipher.");this._s=new Uint8Array([99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22]);this._inv_s=new Uint8Array([82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125]);this._mix=new Uint32Array([0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795]);this._mixCol=new Uint8Array(256);for(let e=0;e<256;e++)this._mixCol[e]=e<128?e<<1:e<<1^27;this.buffer=new Uint8Array(16);this.bufferPosition=0}_expandKey(e){(0,r.unreachable)("Cannot call `_expandKey` on the base class")}_decrypt(e,t){let a,r,n;const i=new Uint8Array(16);i.set(e);for(let e=0,a=this._keySize;e<16;++e,++a)i[e]^=t[a];for(let e=this._cyclesOfRepetition-1;e>=1;--e){a=i[13];i[13]=i[9];i[9]=i[5];i[5]=i[1];i[1]=a;a=i[14];r=i[10];i[14]=i[6];i[10]=i[2];i[6]=a;i[2]=r;a=i[15];r=i[11];n=i[7];i[15]=i[3];i[11]=a;i[7]=r;i[3]=n;for(let e=0;e<16;++e)i[e]=this._inv_s[i[e]];for(let a=0,r=16*e;a<16;++a,++r)i[a]^=t[r];for(let e=0;e<16;e+=4){const t=this._mix[i[e]],r=this._mix[i[e+1]],n=this._mix[i[e+2]],s=this._mix[i[e+3]];a=t^r>>>8^r<<24^n>>>16^n<<16^s>>>24^s<<8;i[e]=a>>>24&255;i[e+1]=a>>16&255;i[e+2]=a>>8&255;i[e+3]=255&a}}a=i[13];i[13]=i[9];i[9]=i[5];i[5]=i[1];i[1]=a;a=i[14];r=i[10];i[14]=i[6];i[10]=i[2];i[6]=a;i[2]=r;a=i[15];r=i[11];n=i[7];i[15]=i[3];i[11]=a;i[7]=r;i[3]=n;for(let e=0;e<16;++e){i[e]=this._inv_s[i[e]];i[e]^=t[e]}return i}_encrypt(e,t){const a=this._s;let r,n,i;const s=new Uint8Array(16);s.set(e);for(let e=0;e<16;++e)s[e]^=t[e];for(let e=1;e<this._cyclesOfRepetition;e++){for(let e=0;e<16;++e)s[e]=a[s[e]];i=s[1];s[1]=s[5];s[5]=s[9];s[9]=s[13];s[13]=i;i=s[2];n=s[6];s[2]=s[10];s[6]=s[14];s[10]=i;s[14]=n;i=s[3];n=s[7];r=s[11];s[3]=s[15];s[7]=i;s[11]=n;s[15]=r;for(let e=0;e<16;e+=4){const t=s[e+0],a=s[e+1],n=s[e+2],i=s[e+3];r=t^a^n^i;s[e+0]^=r^this._mixCol[t^a];s[e+1]^=r^this._mixCol[a^n];s[e+2]^=r^this._mixCol[n^i];s[e+3]^=r^this._mixCol[i^t]}for(let a=0,r=16*e;a<16;++a,++r)s[a]^=t[r]}for(let e=0;e<16;++e)s[e]=a[s[e]];i=s[1];s[1]=s[5];s[5]=s[9];s[9]=s[13];s[13]=i;i=s[2];n=s[6];s[2]=s[10];s[6]=s[14];s[10]=i;s[14]=n;i=s[3];n=s[7];r=s[11];s[3]=s[15];s[7]=i;s[11]=n;s[15]=r;for(let e=0,a=this._keySize;e<16;++e,++a)s[e]^=t[a];return s}_decryptBlock2(e,t){const a=e.length;let r=this.buffer,n=this.bufferPosition;const i=[];let s=this.iv;for(let t=0;t<a;++t){r[n]=e[t];++n;if(n<16)continue;const a=this._decrypt(r,this._key);for(let e=0;e<16;++e)a[e]^=s[e];s=r;i.push(a);r=new Uint8Array(16);n=0}this.buffer=r;this.bufferLength=n;this.iv=s;if(0===i.length)return new Uint8Array(0);let o=16*i.length;if(t){const e=i.at(-1);let t=e[15];if(t<=16){for(let a=15,r=16-t;a>=r;--a)if(e[a]!==t){t=0;break}o-=t;i[i.length-1]=e.subarray(0,16-t)}}const c=new Uint8Array(o);for(let e=0,t=0,a=i.length;e<a;++e,t+=16)c.set(i[e],t);return c}decryptBlock(e,t,a=null){const r=e.length,n=this.buffer;let i=this.bufferPosition;if(a)this.iv=a;else{for(let t=0;i<16&&t<r;++t,++i)n[i]=e[t];if(i<16){this.bufferLength=i;return new Uint8Array(0)}this.iv=n;e=e.subarray(16)}this.buffer=new Uint8Array(16);this.bufferLength=0;this.decryptBlock=this._decryptBlock2;return this.decryptBlock(e,t)}encrypt(e,t){const a=e.length;let r=this.buffer,n=this.bufferPosition;const i=[];t||(t=new Uint8Array(16));for(let s=0;s<a;++s){r[n]=e[s];++n;if(n<16)continue;for(let e=0;e<16;++e)r[e]^=t[e];const a=this._encrypt(r,this._key);t=a;i.push(a);r=new Uint8Array(16);n=0}this.buffer=r;this.bufferLength=n;this.iv=t;if(0===i.length)return new Uint8Array(0);const s=16*i.length,o=new Uint8Array(s);for(let e=0,t=0,a=i.length;e<a;++e,t+=16)o.set(i[e],t);return o}}class AES128Cipher extends AESBaseCipher{constructor(e){super();this._cyclesOfRepetition=10;this._keySize=160;this._rcon=new Uint8Array([141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141]);this._key=this._expandKey(e)}_expandKey(e){const t=this._s,a=this._rcon,r=new Uint8Array(176);r.set(e);for(let e=16,n=1;e<176;++n){let i=r[e-3],s=r[e-2],o=r[e-1],c=r[e-4];i=t[i];s=t[s];o=t[o];c=t[c];i^=a[n];for(let t=0;t<4;++t){r[e]=i^=r[e-16];e++;r[e]=s^=r[e-16];e++;r[e]=o^=r[e-16];e++;r[e]=c^=r[e-16];e++}}return r}}t.AES128Cipher=AES128Cipher;class AES256Cipher extends AESBaseCipher{constructor(e){super();this._cyclesOfRepetition=14;this._keySize=224;this._key=this._expandKey(e)}_expandKey(e){const t=this._s,a=new Uint8Array(240);a.set(e);let r,n,i,s,o=1;for(let e=32,c=1;e<240;++c){if(e%32==16){r=t[r];n=t[n];i=t[i];s=t[s]}else if(e%32==0){r=a[e-3];n=a[e-2];i=a[e-1];s=a[e-4];r=t[r];n=t[n];i=t[i];s=t[s];r^=o;(o<<=1)>=256&&(o=255&(27^o))}for(let t=0;t<4;++t){a[e]=r^=a[e-32];e++;a[e]=n^=a[e-32];e++;a[e]=i^=a[e-32];e++;a[e]=s^=a[e-32];e++}}return a}}t.AES256Cipher=AES256Cipher;class PDF17{checkOwnerPassword(e,t,a,n){const i=new Uint8Array(e.length+56);i.set(e,0);i.set(t,e.length);i.set(a,e.length+t.length);const s=o(i,0,i.length);return(0,r.isArrayEqual)(s,n)}checkUserPassword(e,t,a){const n=new Uint8Array(e.length+8);n.set(e,0);n.set(t,e.length);const i=o(n,0,n.length);return(0,r.isArrayEqual)(i,a)}getOwnerKey(e,t,a,r){const n=new Uint8Array(e.length+56);n.set(e,0);n.set(t,e.length);n.set(a,e.length+t.length);const i=o(n,0,n.length);return new AES256Cipher(i).decryptBlock(r,!1,new Uint8Array(16))}getUserKey(e,t,a){const r=new Uint8Array(e.length+8);r.set(e,0);r.set(t,e.length);const n=o(r,0,r.length);return new AES256Cipher(n).decryptBlock(a,!1,new Uint8Array(16))}}t.PDF17=PDF17;const l=function PDF20Closure(){function calculatePDF20Hash(e,t,a){let r=o(t,0,t.length).subarray(0,32),n=[0],i=0;for(;i<64||n.at(-1)>i-32;){const t=e.length+r.length+a.length,s=new Uint8Array(t);let l=0;s.set(e,l);l+=e.length;s.set(r,l);l+=r.length;s.set(a,l);const h=new Uint8Array(64*t);for(let e=0,a=0;e<64;e++,a+=t)h.set(s,a);n=new AES128Cipher(r.subarray(0,16)).encrypt(h,r.subarray(16,32));const u=n.slice(0,16).reduce(((e,t)=>e+t),0)%3;0===u?r=o(n,0,n.length):1===u?r=calculateSHA384(n,0,n.length):2===u&&(r=c(n,0,n.length));i++}return r.subarray(0,32)}return class PDF20{hash(e,t,a){return calculatePDF20Hash(e,t,a)}checkOwnerPassword(e,t,a,n){const i=new Uint8Array(e.length+56);i.set(e,0);i.set(t,e.length);i.set(a,e.length+t.length);const s=calculatePDF20Hash(e,i,a);return(0,r.isArrayEqual)(s,n)}checkUserPassword(e,t,a){const n=new Uint8Array(e.length+8);n.set(e,0);n.set(t,e.length);const i=calculatePDF20Hash(e,n,[]);return(0,r.isArrayEqual)(i,a)}getOwnerKey(e,t,a,r){const n=new Uint8Array(e.length+56);n.set(e,0);n.set(t,e.length);n.set(a,e.length+t.length);const i=calculatePDF20Hash(e,n,a);return new AES256Cipher(i).decryptBlock(r,!1,new Uint8Array(16))}getUserKey(e,t,a){const r=new Uint8Array(e.length+8);r.set(e,0);r.set(t,e.length);const n=calculatePDF20Hash(e,r,[]);return new AES256Cipher(n).decryptBlock(a,!1,new Uint8Array(16))}}}();t.PDF20=l;class CipherTransform{constructor(e,t){this.StringCipherConstructor=e;this.StreamCipherConstructor=t}createStream(e,t){const a=new this.StreamCipherConstructor;return new i.DecryptStream(e,t,(function cipherTransformDecryptStream(e,t){return a.decryptBlock(e,t)}))}decryptString(e){const t=new this.StringCipherConstructor;let a=(0,r.stringToBytes)(e);a=t.decryptBlock(a,!0);return(0,r.bytesToString)(a)}encryptString(e){const t=new this.StringCipherConstructor;if(t instanceof AESBaseCipher){const a=16-e.length%16;e+=String.fromCharCode(a).repeat(a);const n=new Uint8Array(16);if("undefined"!=typeof crypto)crypto.getRandomValues(n);else for(let e=0;e<16;e++)n[e]=Math.floor(256*Math.random());let i=(0,r.stringToBytes)(e);i=t.encrypt(i,n);const s=new Uint8Array(16+i.length);s.set(n);s.set(i,16);return(0,r.bytesToString)(s)}let a=(0,r.stringToBytes)(e);a=t.encrypt(a);return(0,r.bytesToString)(a)}}const h=function CipherTransformFactoryClosure(){const e=new Uint8Array([40,191,78,94,78,117,138,65,100,0,78,86,255,250,1,8,46,46,0,182,208,104,62,128,47,12,169,254,100,83,105,122]);function prepareKeyData(t,a,r,n,i,o,c,l){const h=40+r.length+t.length,u=new Uint8Array(h);let d,f,g=0;if(a){f=Math.min(32,a.length);for(;g<f;++g)u[g]=a[g]}d=0;for(;g<32;)u[g++]=e[d++];for(d=0,f=r.length;d<f;++d)u[g++]=r[d];u[g++]=255&i;u[g++]=i>>8&255;u[g++]=i>>16&255;u[g++]=i>>>24&255;for(d=0,f=t.length;d<f;++d)u[g++]=t[d];if(o>=4&&!l){u[g++]=255;u[g++]=255;u[g++]=255;u[g++]=255}let p=s(u,0,g);const m=c>>3;if(o>=3)for(d=0;d<50;++d)p=s(p,0,m);const b=p.subarray(0,m);let y,w;if(o>=3){for(g=0;g<32;++g)u[g]=e[g];for(d=0,f=t.length;d<f;++d)u[g++]=t[d];y=new ARCFourCipher(b);w=y.encryptBlock(s(u,0,g));f=b.length;const a=new Uint8Array(f);for(d=1;d<=19;++d){for(let e=0;e<f;++e)a[e]=b[e]^d;y=new ARCFourCipher(a);w=y.encryptBlock(w)}for(d=0,f=w.length;d<f;++d)if(n[d]!==w[d])return null}else{y=new ARCFourCipher(b);w=y.encryptBlock(e);for(d=0,f=w.length;d<f;++d)if(n[d]!==w[d])return null}return b}const t=n.Name.get("Identity");function buildObjectKey(e,t,a,r=!1){const n=new Uint8Array(a.length+9),i=a.length;let o;for(o=0;o<i;++o)n[o]=a[o];n[o++]=255&e;n[o++]=e>>8&255;n[o++]=e>>16&255;n[o++]=255&t;n[o++]=t>>8&255;if(r){n[o++]=115;n[o++]=65;n[o++]=108;n[o++]=84}return s(n,0,o).subarray(0,Math.min(a.length+5,16))}function buildCipherConstructor(e,t,a,i,s){if(!(t instanceof n.Name))throw new r.FormatError("Invalid crypt filter name.");const o=e.get(t.name);let c;null!=o&&(c=o.get("CFM"));if(!c||"None"===c.name)return function cipherTransformFactoryBuildCipherConstructorNone(){return new NullCipher};if("V2"===c.name)return function cipherTransformFactoryBuildCipherConstructorV2(){return new ARCFourCipher(buildObjectKey(a,i,s,!1))};if("AESV2"===c.name)return function cipherTransformFactoryBuildCipherConstructorAESV2(){return new AES128Cipher(buildObjectKey(a,i,s,!0))};if("AESV3"===c.name)return function cipherTransformFactoryBuildCipherConstructorAESV3(){return new AES256Cipher(s)};throw new r.FormatError("Unknown crypto method")}return class CipherTransformFactory{constructor(a,i,o){const c=a.get("Filter");if(!(0,n.isName)(c,"Standard"))throw new r.FormatError("unknown encryption method");this.filterName=c.name;this.dict=a;const h=a.get("V");if(!Number.isInteger(h)||1!==h&&2!==h&&4!==h&&5!==h)throw new r.FormatError("unsupported encryption algorithm");this.algorithm=h;let u=a.get("Length");if(!u)if(h<=3)u=40;else{const e=a.get("CF"),t=a.get("StmF");if(e instanceof n.Dict&&t instanceof n.Name){e.suppressEncryption=!0;const a=e.get(t.name);u=a&&a.get("Length")||128;u<40&&(u<<=3)}}if(!Number.isInteger(u)||u<40||u%8!=0)throw new r.FormatError("invalid key length");const d=(0,r.stringToBytes)(a.get("O")).subarray(0,32),f=(0,r.stringToBytes)(a.get("U")).subarray(0,32),g=a.get("P"),p=a.get("R"),m=(4===h||5===h)&&!1!==a.get("EncryptMetadata");this.encryptMetadata=m;const b=(0,r.stringToBytes)(i);let y,w;if(o){if(6===p)try{o=(0,r.utf8StringToString)(o)}catch(e){(0,r.warn)("CipherTransformFactory: Unable to convert UTF8 encoded password.")}y=(0,r.stringToBytes)(o)}if(5!==h)w=prepareKeyData(b,y,d,f,g,p,u,m);else{const e=(0,r.stringToBytes)(a.get("O")).subarray(32,40),t=(0,r.stringToBytes)(a.get("O")).subarray(40,48),n=(0,r.stringToBytes)(a.get("U")).subarray(0,48),i=(0,r.stringToBytes)(a.get("U")).subarray(32,40),s=(0,r.stringToBytes)(a.get("U")).subarray(40,48),o=(0,r.stringToBytes)(a.get("OE")),c=(0,r.stringToBytes)(a.get("UE"));(0,r.stringToBytes)(a.get("Perms"));w=function createEncryptionKey20(e,t,a,r,n,i,s,o,c,h,u,d){if(t){const e=Math.min(127,t.length);t=t.subarray(0,e)}else t=[];let f;f=6===e?new l:new PDF17;return f.checkUserPassword(t,o,s)?f.getUserKey(t,c,u):t.length&&f.checkOwnerPassword(t,r,i,a)?f.getOwnerKey(t,n,i,h):null}(p,y,d,e,t,n,f,i,s,o,c)}if(!w&&!o)throw new r.PasswordException("No password given",r.PasswordResponses.NEED_PASSWORD);if(!w&&o){const t=function decodeUserPassword(t,a,r,n){const i=new Uint8Array(32);let o=0;const c=Math.min(32,t.length);for(;o<c;++o)i[o]=t[o];let l=0;for(;o<32;)i[o++]=e[l++];let h=s(i,0,o);const u=n>>3;if(r>=3)for(l=0;l<50;++l)h=s(h,0,h.length);let d,f;if(r>=3){f=a;const e=new Uint8Array(u);for(l=19;l>=0;l--){for(let t=0;t<u;++t)e[t]=h[t]^l;d=new ARCFourCipher(e);f=d.encryptBlock(f)}}else{d=new ARCFourCipher(h.subarray(0,u));f=d.encryptBlock(a)}return f}(y,d,p,u);w=prepareKeyData(b,t,d,f,g,p,u,m)}if(!w)throw new r.PasswordException("Incorrect Password",r.PasswordResponses.INCORRECT_PASSWORD);this.encryptionKey=w;if(h>=4){const e=a.get("CF");e instanceof n.Dict&&(e.suppressEncryption=!0);this.cf=e;this.stmf=a.get("StmF")||t;this.strf=a.get("StrF")||t;this.eff=a.get("EFF")||this.stmf}}createCipherTransform(e,t){if(4===this.algorithm||5===this.algorithm)return new CipherTransform(buildCipherConstructor(this.cf,this.strf,e,t,this.encryptionKey),buildCipherConstructor(this.cf,this.stmf,e,t,this.encryptionKey));const a=buildObjectKey(e,t,this.encryptionKey,!1),r=function buildCipherCipherConstructor(){return new ARCFourCipher(a)};return new CipherTransform(r,r)}}}();t.CipherTransformFactory=h},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.DecryptStream=void 0;var r=a(17);class DecryptStream extends r.DecodeStream{constructor(e,t,a){super(t);this.str=e;this.dict=e.dict;this.decrypt=a;this.nextChunk=null;this.initialized=!1}readBlock(){let e;if(this.initialized)e=this.nextChunk;else{e=this.str.getBytes(512);this.initialized=!0}if(!e||0===e.length){this.eof=!0;return}this.nextChunk=this.str.getBytes(512);const t=this.nextChunk&&this.nextChunk.length>0;e=(0,this.decrypt)(e,!t);const a=this.bufferLength,r=a+e.length;this.ensureBuffer(r).set(e,a);this.bufferLength=r}}t.DecryptStream=DecryptStream},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.Catalog=void 0;var r=a(3),n=a(2),i=a(4),s=a(68),o=a(5),c=a(69),l=a(12),h=a(70),u=a(57),d=a(71),f=a(72);function fetchDestination(e){e instanceof i.Dict&&(e=e.get("D"));return Array.isArray(e)?e:null}class Catalog{constructor(e,t){this.pdfManager=e;this.xref=t;this._catDict=t.getCatalogObj();if(!(this._catDict instanceof i.Dict))throw new n.FormatError("Catalog object is not a dictionary.");this.toplevelPagesDict;this._actualNumPages=null;this.fontCache=new i.RefSetCache;this.builtInCMapCache=new Map;this.standardFontDataCache=new Map;this.globalImageCache=new u.GlobalImageCache;this.pageKidsCountCache=new i.RefSetCache;this.pageIndexCache=new i.RefSetCache;this.nonBlendModesSet=new i.RefSet}get version(){const e=this._catDict.get("Version");if(e instanceof i.Name){if(r.PDF_VERSION_REGEXP.test(e.name))return(0,n.shadow)(this,"version",e.name);(0,n.warn)(`Invalid PDF catalog version: ${e.name}`)}return(0,n.shadow)(this,"version",null)}get lang(){const e=this._catDict.get("Lang");return(0,n.shadow)(this,"lang","string"==typeof e?(0,n.stringToPDFString)(e):null)}get needsRendering(){const e=this._catDict.get("NeedsRendering");return(0,n.shadow)(this,"needsRendering","boolean"==typeof e&&e)}get collection(){let e=null;try{const t=this._catDict.get("Collection");t instanceof i.Dict&&t.size>0&&(e=t)}catch(e){if(e instanceof r.MissingDataException)throw e;(0,n.info)("Cannot fetch Collection entry; assuming no collection is present.")}return(0,n.shadow)(this,"collection",e)}get acroForm(){let e=null;try{const t=this._catDict.get("AcroForm");t instanceof i.Dict&&t.size>0&&(e=t)}catch(e){if(e instanceof r.MissingDataException)throw e;(0,n.info)("Cannot fetch AcroForm entry; assuming no forms are present.")}return(0,n.shadow)(this,"acroForm",e)}get acroFormRef(){const e=this._catDict.getRaw("AcroForm");return(0,n.shadow)(this,"acroFormRef",e instanceof i.Ref?e:null)}get metadata(){const e=this._catDict.getRaw("Metadata");if(!(e instanceof i.Ref))return(0,n.shadow)(this,"metadata",null);let t=null;try{const a=!(this.xref.encrypt&&this.xref.encrypt.encryptMetadata),r=this.xref.fetch(e,a);if(r instanceof o.BaseStream&&r.dict instanceof i.Dict){const e=r.dict.get("Type"),a=r.dict.get("Subtype");if((0,i.isName)(e,"Metadata")&&(0,i.isName)(a,"XML")){const e=(0,n.stringToUTF8String)(r.getString());e&&(t=new d.MetadataParser(e).serializable)}}}catch(e){if(e instanceof r.MissingDataException)throw e;(0,n.info)(`Skipping invalid Metadata: "${e}".`)}return(0,n.shadow)(this,"metadata",t)}get markInfo(){let e=null;try{e=this._readMarkInfo()}catch(e){if(e instanceof r.MissingDataException)throw e;(0,n.warn)("Unable to read mark info.")}return(0,n.shadow)(this,"markInfo",e)}_readMarkInfo(){const e=this._catDict.get("MarkInfo");if(!(e instanceof i.Dict))return null;const t={Marked:!1,UserProperties:!1,Suspects:!1};for(const a in t){const r=e.get(a);"boolean"==typeof r&&(t[a]=r)}return t}get structTreeRoot(){let e=null;try{e=this._readStructTreeRoot()}catch(e){if(e instanceof r.MissingDataException)throw e;(0,n.warn)("Unable read to structTreeRoot info.")}return(0,n.shadow)(this,"structTreeRoot",e)}_readStructTreeRoot(){const e=this._catDict.get("StructTreeRoot");if(!(e instanceof i.Dict))return null;const t=new f.StructTreeRoot(e);t.init();return t}get toplevelPagesDict(){const e=this._catDict.get("Pages");if(!(e instanceof i.Dict))throw new n.FormatError("Invalid top-level pages dictionary.");return(0,n.shadow)(this,"toplevelPagesDict",e)}get documentOutline(){let e=null;try{e=this._readDocumentOutline()}catch(e){if(e instanceof r.MissingDataException)throw e;(0,n.warn)("Unable to read document outline.")}return(0,n.shadow)(this,"documentOutline",e)}_readDocumentOutline(){let e=this._catDict.get("Outlines");if(!(e instanceof i.Dict))return null;e=e.getRaw("First");if(!(e instanceof i.Ref))return null;const t={items:[]},a=[{obj:e,parent:t}],r=new i.RefSet;r.put(e);const s=this.xref,o=new Uint8ClampedArray(3);for(;a.length>0;){const t=a.shift(),c=s.fetchIfRef(t.obj);if(null===c)continue;if(!c.has("Title"))throw new n.FormatError("Invalid outline item encountered.");const h={url:null,dest:null,action:null};Catalog.parseDestDictionary({destDict:c,resultObj:h,docBaseUrl:this.pdfManager.docBaseUrl,docAttachments:this.attachments});const u=c.get("Title"),d=c.get("F")||0,f=c.getArray("C"),g=c.get("Count");let p=o;!Array.isArray(f)||3!==f.length||0===f[0]&&0===f[1]&&0===f[2]||(p=l.ColorSpace.singletons.rgb.getRgb(f,0));const m={action:h.action,attachment:h.attachment,dest:h.dest,url:h.url,unsafeUrl:h.unsafeUrl,newWindow:h.newWindow,setOCGState:h.setOCGState,title:(0,n.stringToPDFString)(u),color:p,count:Number.isInteger(g)?g:void 0,bold:!!(2&d),italic:!!(1&d),items:[]};t.parent.items.push(m);e=c.getRaw("First");if(e instanceof i.Ref&&!r.has(e)){a.push({obj:e,parent:m});r.put(e)}e=c.getRaw("Next");if(e instanceof i.Ref&&!r.has(e)){a.push({obj:e,parent:t.parent});r.put(e)}}return t.items.length>0?t.items:null}get permissions(){let e=null;try{e=this._readPermissions()}catch(e){if(e instanceof r.MissingDataException)throw e;(0,n.warn)("Unable to read permissions.")}return(0,n.shadow)(this,"permissions",e)}_readPermissions(){const e=this.xref.trailer.get("Encrypt");if(!(e instanceof i.Dict))return null;let t=e.get("P");if("number"!=typeof t)return null;t+=2**32;const a=[];for(const e in n.PermissionFlag){const r=n.PermissionFlag[e];t&r&&a.push(r)}return a}get optionalContentConfig(){let e=null;try{const t=this._catDict.get("OCProperties");if(!t)return(0,n.shadow)(this,"optionalContentConfig",null);const a=t.get("D");if(!a)return(0,n.shadow)(this,"optionalContentConfig",null);const r=t.get("OCGs");if(!Array.isArray(r))return(0,n.shadow)(this,"optionalContentConfig",null);const s=[],o=[];for(const e of r){if(!(e instanceof i.Ref))continue;o.push(e);const t=this.xref.fetchIfRef(e);s.push({id:e.toString(),name:"string"==typeof t.get("Name")?(0,n.stringToPDFString)(t.get("Name")):null,intent:"string"==typeof t.get("Intent")?(0,n.stringToPDFString)(t.get("Intent")):null})}e=this._readOptionalContentConfig(a,o);e.groups=s}catch(e){if(e instanceof r.MissingDataException)throw e;(0,n.warn)(`Unable to read optional content config: ${e}`)}return(0,n.shadow)(this,"optionalContentConfig",e)}_readOptionalContentConfig(e,t){function parseOnOff(e){const a=[];if(Array.isArray(e))for(const r of e)r instanceof i.Ref&&t.includes(r)&&a.push(r.toString());return a}function parseOrder(e,a=0){if(!Array.isArray(e))return null;const n=[];for(const s of e){if(s instanceof i.Ref&&t.includes(s)){r.put(s);n.push(s.toString());continue}const e=parseNestedOrder(s,a);e&&n.push(e)}if(a>0)return n;const s=[];for(const e of t)r.has(e)||s.push(e.toString());s.length&&n.push({name:null,order:s});return n}function parseNestedOrder(e,t){if(++t>s){(0,n.warn)("parseNestedOrder - reached MAX_NESTED_LEVELS.");return null}const r=a.fetchIfRef(e);if(!Array.isArray(r))return null;const i=a.fetchIfRef(r[0]);if("string"!=typeof i)return null;const o=parseOrder(r.slice(1),t);return o&&o.length?{name:(0,n.stringToPDFString)(i),order:o}:null}const a=this.xref,r=new i.RefSet,s=10;return{name:"string"==typeof e.get("Name")?(0,n.stringToPDFString)(e.get("Name")):null,creator:"string"==typeof e.get("Creator")?(0,n.stringToPDFString)(e.get("Creator")):null,baseState:e.get("BaseState")instanceof i.Name?e.get("BaseState").name:null,on:parseOnOff(e.get("ON")),off:parseOnOff(e.get("OFF")),order:parseOrder(e.get("Order")),groups:null}}setActualNumPages(e=null){this._actualNumPages=e}get hasActualNumPages(){return null!==this._actualNumPages}get _pagesCount(){const e=this.toplevelPagesDict.get("Count");if(!Number.isInteger(e))throw new n.FormatError("Page count in top-level pages dictionary is not an integer.");return(0,n.shadow)(this,"_pagesCount",e)}get numPages(){return this.hasActualNumPages?this._actualNumPages:this._pagesCount}get destinations(){const e=this._readDests(),t=Object.create(null);if(e instanceof s.NameTree)for(const[a,r]of e.getAll()){const e=fetchDestination(r);e&&(t[(0,n.stringToPDFString)(a)]=e)}else e instanceof i.Dict&&e.forEach((function(e,a){const r=fetchDestination(a);r&&(t[e]=r)}));return(0,n.shadow)(this,"destinations",t)}getDestination(e){const t=this._readDests();if(t instanceof s.NameTree){const a=fetchDestination(t.get(e));if(a)return a;const r=this.destinations[e];if(r){(0,n.warn)(`Found "${e}" at an incorrect position in the NameTree.`);return r}}else if(t instanceof i.Dict){const a=fetchDestination(t.get(e));if(a)return a}return null}_readDests(){const e=this._catDict.get("Names");return e&&e.has("Dests")?new s.NameTree(e.getRaw("Dests"),this.xref):this._catDict.has("Dests")?this._catDict.get("Dests"):void 0}get pageLabels(){let e=null;try{e=this._readPageLabels()}catch(e){if(e instanceof r.MissingDataException)throw e;(0,n.warn)("Unable to read page labels.")}return(0,n.shadow)(this,"pageLabels",e)}_readPageLabels(){const e=this._catDict.getRaw("PageLabels");if(!e)return null;const t=new Array(this.numPages);let a=null,o="";const c=new s.NumberTree(e,this.xref).getAll();let l="",h=1;for(let e=0,s=this.numPages;e<s;e++){const s=c.get(e);if(void 0!==s){if(!(s instanceof i.Dict))throw new n.FormatError("PageLabel is not a dictionary.");if(s.has("Type")&&!(0,i.isName)(s.get("Type"),"PageLabel"))throw new n.FormatError("Invalid type in PageLabel dictionary.");if(s.has("S")){const e=s.get("S");if(!(e instanceof i.Name))throw new n.FormatError("Invalid style in PageLabel dictionary.");a=e.name}else a=null;if(s.has("P")){const e=s.get("P");if("string"!=typeof e)throw new n.FormatError("Invalid prefix in PageLabel dictionary.");o=(0,n.stringToPDFString)(e)}else o="";if(s.has("St")){const e=s.get("St");if(!(Number.isInteger(e)&&e>=1))throw new n.FormatError("Invalid start in PageLabel dictionary.");h=e}else h=1}switch(a){case"D":l=h;break;case"R":case"r":l=(0,r.toRomanNumerals)(h,"r"===a);break;case"A":case"a":const e=26,t="a"===a?97:65,i=h-1;l=String.fromCharCode(t+i%e).repeat(Math.floor(i/e)+1);break;default:if(a)throw new n.FormatError(`Invalid style "${a}" in PageLabel dictionary.`);l=""}t[e]=o+l;h++}return t}get pageLayout(){const e=this._catDict.get("PageLayout");let t="";if(e instanceof i.Name)switch(e.name){case"SinglePage":case"OneColumn":case"TwoColumnLeft":case"TwoColumnRight":case"TwoPageLeft":case"TwoPageRight":t=e.name}return(0,n.shadow)(this,"pageLayout",t)}get pageMode(){const e=this._catDict.get("PageMode");let t="UseNone";if(e instanceof i.Name)switch(e.name){case"UseNone":case"UseOutlines":case"UseThumbs":case"FullScreen":case"UseOC":case"UseAttachments":t=e.name}return(0,n.shadow)(this,"pageMode",t)}get viewerPreferences(){const e=this._catDict.get("ViewerPreferences");if(!(e instanceof i.Dict))return(0,n.shadow)(this,"viewerPreferences",null);let t=null;for(const a of e.getKeys()){const r=e.get(a);let s;switch(a){case"HideToolbar":case"HideMenubar":case"HideWindowUI":case"FitWindow":case"CenterWindow":case"DisplayDocTitle":case"PickTrayByPDFSize":"boolean"==typeof r&&(s=r);break;case"NonFullScreenPageMode":if(r instanceof i.Name)switch(r.name){case"UseNone":case"UseOutlines":case"UseThumbs":case"UseOC":s=r.name;break;default:s="UseNone"}break;case"Direction":if(r instanceof i.Name)switch(r.name){case"L2R":case"R2L":s=r.name;break;default:s="L2R"}break;case"ViewArea":case"ViewClip":case"PrintArea":case"PrintClip":if(r instanceof i.Name)switch(r.name){case"MediaBox":case"CropBox":case"BleedBox":case"TrimBox":case"ArtBox":s=r.name;break;default:s="CropBox"}break;case"PrintScaling":if(r instanceof i.Name)switch(r.name){case"None":case"AppDefault":s=r.name;break;default:s="AppDefault"}break;case"Duplex":if(r instanceof i.Name)switch(r.name){case"Simplex":case"DuplexFlipShortEdge":case"DuplexFlipLongEdge":s=r.name;break;default:s="None"}break;case"PrintPageRange":if(Array.isArray(r)&&r.length%2==0){r.every(((e,t,a)=>Number.isInteger(e)&&e>0&&(0===t||e>=a[t-1])&&e<=this.numPages))&&(s=r)}break;case"NumCopies":Number.isInteger(r)&&r>0&&(s=r);break;default:(0,n.warn)(`Ignoring non-standard key in ViewerPreferences: ${a}.`);continue}if(void 0!==s){t||(t=Object.create(null));t[a]=s}else(0,n.warn)(`Bad value, for key "${a}", in ViewerPreferences: ${r}.`)}return(0,n.shadow)(this,"viewerPreferences",t)}get openAction(){const e=this._catDict.get("OpenAction"),t=Object.create(null);if(e instanceof i.Dict){const a=new i.Dict(this.xref);a.set("A",e);const r={url:null,dest:null,action:null};Catalog.parseDestDictionary({destDict:a,resultObj:r});Array.isArray(r.dest)?t.dest=r.dest:r.action&&(t.action=r.action)}else Array.isArray(e)&&(t.dest=e);return(0,n.shadow)(this,"openAction",(0,n.objectSize)(t)>0?t:null)}get attachments(){const e=this._catDict.get("Names");let t=null;if(e instanceof i.Dict&&e.has("EmbeddedFiles")){const a=new s.NameTree(e.getRaw("EmbeddedFiles"),this.xref);for(const[e,r]of a.getAll()){const a=new h.FileSpec(r,this.xref);t||(t=Object.create(null));t[(0,n.stringToPDFString)(e)]=a.serializable}}return(0,n.shadow)(this,"attachments",t)}get xfaImages(){const e=this._catDict.get("Names");let t=null;if(e instanceof i.Dict&&e.has("XFAImages")){const a=new s.NameTree(e.getRaw("XFAImages"),this.xref);for(const[e,r]of a.getAll()){t||(t=new i.Dict(this.xref));t.set((0,n.stringToPDFString)(e),r)}}return(0,n.shadow)(this,"xfaImages",t)}_collectJavaScript(){const e=this._catDict.get("Names");let t=null;function appendIfJavaScriptDict(e,a){if(!(a instanceof i.Dict))return;if(!(0,i.isName)(a.get("S"),"JavaScript"))return;let r=a.get("JS");if(r instanceof o.BaseStream)r=r.getString();else if("string"!=typeof r)return;null===t&&(t=new Map);r=(0,n.stringToPDFString)(r).replace(/\u0000/g,"");t.set(e,r)}if(e instanceof i.Dict&&e.has("JavaScript")){const t=new s.NameTree(e.getRaw("JavaScript"),this.xref);for(const[e,a]of t.getAll())appendIfJavaScriptDict((0,n.stringToPDFString)(e),a)}const a=this._catDict.get("OpenAction");a&&appendIfJavaScriptDict("OpenAction",a);return t}get javaScript(){const e=this._collectJavaScript();return(0,n.shadow)(this,"javaScript",e?[...e.values()]:null)}get jsActions(){const e=this._collectJavaScript();let t=(0,r.collectActions)(this.xref,this._catDict,n.DocumentActionEventType);if(e){t||(t=Object.create(null));for(const[a,r]of e)a in t?t[a].push(r):t[a]=[r]}return(0,n.shadow)(this,"jsActions",t)}async fontFallback(e,t){const a=await Promise.all(this.fontCache);for(const r of a)if(r.loadedName===e){r.fallback(t);return}}async cleanup(e=!1){(0,c.clearGlobalCaches)();this.globalImageCache.clear(e);this.pageKidsCountCache.clear();this.pageIndexCache.clear();this.nonBlendModesSet.clear();const t=await Promise.all(this.fontCache);for(const{dict:e}of t)delete e.cacheKey;this.fontCache.clear();this.builtInCMapCache.clear();this.standardFontDataCache.clear()}async getPageDict(e){const t=[this.toplevelPagesDict],a=new i.RefSet,r=this._catDict.getRaw("Pages");r instanceof i.Ref&&a.put(r);const s=this.xref,o=this.pageKidsCountCache,c=this.pageIndexCache;let l=0;for(;t.length;){const r=t.pop();if(r instanceof i.Ref){const h=o.get(r);if(h>=0&&l+h<=e){l+=h;continue}if(a.has(r))throw new n.FormatError("Pages tree contains circular reference.");a.put(r);const u=await s.fetchAsync(r);if(u instanceof i.Dict){let t=u.getRaw("Type");t instanceof i.Ref&&(t=await s.fetchAsync(t));if((0,i.isName)(t,"Page")||!u.has("Kids")){o.has(r)||o.put(r,1);c.has(r)||c.put(r,l);if(l===e)return[u,r];l++;continue}}t.push(u);continue}if(!(r instanceof i.Dict))throw new n.FormatError("Page dictionary kid reference points to wrong type of object.");const{objId:h}=r;let u=r.getRaw("Count");u instanceof i.Ref&&(u=await s.fetchAsync(u));if(Number.isInteger(u)&&u>=0){h&&!o.has(h)&&o.put(h,u);if(l+u<=e){l+=u;continue}}let d=r.getRaw("Kids");d instanceof i.Ref&&(d=await s.fetchAsync(d));if(!Array.isArray(d)){let t=r.getRaw("Type");t instanceof i.Ref&&(t=await s.fetchAsync(t));if((0,i.isName)(t,"Page")||!r.has("Kids")){if(l===e)return[r,null];l++;continue}throw new n.FormatError("Page dictionary kids object is not an array.")}for(let e=d.length-1;e>=0;e--)t.push(d[e])}throw new Error(`Page index ${e} not found.`)}async getAllPageDicts(e=!1){const{ignoreErrors:t}=this.pdfManager.evaluatorOptions,a=[{currentNode:this.toplevelPagesDict,posInKids:0}],s=new i.RefSet,o=this._catDict.getRaw("Pages");o instanceof i.Ref&&s.put(o);const c=new Map,l=this.xref,h=this.pageIndexCache;let u=0;function addPageDict(e,t){t&&!h.has(t)&&h.put(t,u);c.set(u++,[e,t])}function addPageError(a){if(a instanceof r.XRefEntryException&&!e)throw a;if(e&&t&&0===u){(0,n.warn)(`getAllPageDicts - Skipping invalid first page: "${a}".`);a=i.Dict.empty}c.set(u++,[a,null])}for(;a.length>0;){const e=a.at(-1),{currentNode:t,posInKids:r}=e;let o=t.getRaw("Kids");if(o instanceof i.Ref)try{o=await l.fetchAsync(o)}catch(e){addPageError(e);break}if(!Array.isArray(o)){addPageError(new n.FormatError("Page dictionary kids object is not an array."));break}if(r>=o.length){a.pop();continue}const c=o[r];let h;if(c instanceof i.Ref){if(s.has(c)){addPageError(new n.FormatError("Pages tree contains circular reference."));break}s.put(c);try{h=await l.fetchAsync(c)}catch(e){addPageError(e);break}}else h=c;if(!(h instanceof i.Dict)){addPageError(new n.FormatError("Page dictionary kid reference points to wrong type of object."));break}let u=h.getRaw("Type");if(u instanceof i.Ref)try{u=await l.fetchAsync(u)}catch(e){addPageError(e);break}(0,i.isName)(u,"Page")||!h.has("Kids")?addPageDict(h,c instanceof i.Ref?c:null):a.push({currentNode:h,posInKids:0});e.posInKids++}return c}getPageIndex(e){const t=this.pageIndexCache.get(e);if(void 0!==t)return Promise.resolve(t);const a=this.xref;let r=0;const next=t=>function pagesBeforeRef(t){let r,s=0;return a.fetchAsync(t).then((function(a){if((0,i.isRefsEqual)(t,e)&&!(0,i.isDict)(a,"Page")&&!(a instanceof i.Dict&&!a.has("Type")&&a.has("Contents")))throw new n.FormatError("The reference does not point to a /Page dictionary.");if(!a)return null;if(!(a instanceof i.Dict))throw new n.FormatError("Node must be a dictionary.");r=a.getRaw("Parent");return a.getAsync("Parent")})).then((function(e){if(!e)return null;if(!(e instanceof i.Dict))throw new n.FormatError("Parent must be a dictionary.");return e.getAsync("Kids")})).then((function(e){if(!e)return null;const o=[];let c=!1;for(const r of e){if(!(r instanceof i.Ref))throw new n.FormatError("Kid must be a reference.");if((0,i.isRefsEqual)(r,t)){c=!0;break}o.push(a.fetchAsync(r).then((function(e){if(!(e instanceof i.Dict))throw new n.FormatError("Kid node must be a dictionary.");e.has("Count")?s+=e.get("Count"):s++})))}if(!c)throw new n.FormatError("Kid reference not found in parent's kids.");return Promise.all(o).then((function(){return[s,r]}))}))}(t).then((t=>{if(!t){this.pageIndexCache.put(e,r);return r}const[a,n]=t;r+=a;return next(n)}));return next(e)}get baseUrl(){const e=this._catDict.get("URI");if(e instanceof i.Dict){const t=e.get("Base");if("string"==typeof t){const e=(0,n.createValidAbsoluteUrl)(t,null,{tryConvertEncoding:!0});if(e)return(0,n.shadow)(this,"baseUrl",e.href)}}return(0,n.shadow)(this,"baseUrl",null)}static parseDestDictionary(e){const t=e.destDict;if(!(t instanceof i.Dict)){(0,n.warn)("parseDestDictionary: `destDict` must be a dictionary.");return}const a=e.resultObj;if("object"!=typeof a){(0,n.warn)("parseDestDictionary: `resultObj` must be an object.");return}const s=e.docBaseUrl||null,c=e.docAttachments||null;let l,h,u=t.get("A");if(!(u instanceof i.Dict))if(t.has("Dest"))u=t.get("Dest");else{u=t.get("AA");u instanceof i.Dict&&(u.has("D")?u=u.get("D"):u.has("U")&&(u=u.get("U")))}if(u instanceof i.Dict){const e=u.get("S");if(!(e instanceof i.Name)){(0,n.warn)("parseDestDictionary: Invalid type in Action dictionary.");return}const t=e.name;switch(t){case"ResetForm":const e=u.get("Flags"),s=0==(1&("number"==typeof e?e:0)),d=[],f=[];for(const e of u.get("Fields")||[])e instanceof i.Ref?f.push(e.toString()):"string"==typeof e&&d.push((0,n.stringToPDFString)(e));a.resetForm={fields:d,refs:f,include:s};break;case"URI":l=u.get("URI");l instanceof i.Name&&(l="/"+l.name);break;case"GoTo":h=u.get("D");break;case"Launch":case"GoToR":const g=u.get("F");g instanceof i.Dict?l=g.get("F")||null:"string"==typeof g&&(l=g);let p=u.get("D");if(p){p instanceof i.Name&&(p=p.name);if("string"==typeof l){const e=l.split("#")[0];"string"==typeof p?l=e+"#"+p:Array.isArray(p)&&(l=e+"#"+JSON.stringify(p))}}const m=u.get("NewWindow");"boolean"==typeof m&&(a.newWindow=m);break;case"GoToE":const b=u.get("T");let y;if(c&&b instanceof i.Dict){const e=b.get("R"),t=b.get("N");(0,i.isName)(e,"C")&&"string"==typeof t&&(y=c[(0,n.stringToPDFString)(t)])}y?a.attachment=y:(0,n.warn)('parseDestDictionary - unimplemented "GoToE" action.');break;case"Named":const w=u.get("N");w instanceof i.Name&&(a.action=w.name);break;case"SetOCGState":const S=u.get("State"),x=u.get("PreserveRB");if(!Array.isArray(S)||0===S.length)break;const C=[];for(const e of S)if(e instanceof i.Name)switch(e.name){case"ON":case"OFF":case"Toggle":C.push(e.name)}else e instanceof i.Ref&&C.push(e.toString());if(C.length!==S.length)break;a.setOCGState={state:C,preserveRB:"boolean"!=typeof x||x};break;case"JavaScript":const k=u.get("JS");let v;k instanceof o.BaseStream?v=k.getString():"string"==typeof k&&(v=k);const F=v&&(0,r.recoverJsURL)((0,n.stringToPDFString)(v));if(F){l=F.url;a.newWindow=F.newWindow;break}default:if("JavaScript"===t||"SubmitForm"===t)break;(0,n.warn)(`parseDestDictionary - unsupported action: "${t}".`)}}else t.has("Dest")&&(h=t.get("Dest"));if("string"==typeof l){const e=(0,n.createValidAbsoluteUrl)(l,s,{addDefaultProtocol:!0,tryConvertEncoding:!0});e&&(a.url=e.href);a.unsafeUrl=l}if(h){h instanceof i.Name&&(h=h.name);"string"==typeof h?a.dest=(0,n.stringToPDFString)(h):Array.isArray(h)&&(a.dest=h)}}}t.Catalog=Catalog},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.NumberTree=t.NameTree=void 0;var r=a(4),n=a(2);class NameOrNumberTree{constructor(e,t,a){this.constructor===NameOrNumberTree&&(0,n.unreachable)("Cannot initialize NameOrNumberTree.");this.root=e;this.xref=t;this._type=a}getAll(){const e=new Map;if(!this.root)return e;const t=this.xref,a=new r.RefSet;a.put(this.root);const i=[this.root];for(;i.length>0;){const s=t.fetchIfRef(i.shift());if(!(s instanceof r.Dict))continue;if(s.has("Kids")){const e=s.get("Kids");if(!Array.isArray(e))continue;for(const t of e){if(a.has(t))throw new n.FormatError(`Duplicate entry in "${this._type}" tree.`);i.push(t);a.put(t)}continue}const o=s.get(this._type);if(Array.isArray(o))for(let a=0,r=o.length;a<r;a+=2)e.set(t.fetchIfRef(o[a]),t.fetchIfRef(o[a+1]))}return e}get(e){if(!this.root)return null;const t=this.xref;let a=t.fetchIfRef(this.root),r=0;for(;a.has("Kids");){if(++r>10){(0,n.warn)(`Search depth limit reached for "${this._type}" tree.`);return null}const i=a.get("Kids");if(!Array.isArray(i))return null;let s=0,o=i.length-1;for(;s<=o;){const r=s+o>>1,n=t.fetchIfRef(i[r]),c=n.get("Limits");if(e<t.fetchIfRef(c[0]))o=r-1;else{if(!(e>t.fetchIfRef(c[1]))){a=n;break}s=r+1}}if(s>o)return null}const i=a.get(this._type);if(Array.isArray(i)){let a=0,r=i.length-2;for(;a<=r;){const n=a+r>>1,s=n+(1&n),o=t.fetchIfRef(i[s]);if(e<o)r=s-2;else{if(!(e>o))return t.fetchIfRef(i[s+1]);a=s+2}}}return null}}t.NameTree=class NameTree extends NameOrNumberTree{constructor(e,t){super(e,t,"Names")}};t.NumberTree=class NumberTree extends NameOrNumberTree{constructor(e,t){super(e,t,"Nums")}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.clearGlobalCaches=function clearGlobalCaches(){(0,r.clearPrimitiveCaches)();(0,n.clearUnicodeCaches)()};var r=a(4),n=a(38)},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.FileSpec=void 0;var r=a(2),n=a(5),i=a(4);function pickPlatformItem(e){return e.has("UF")?e.get("UF"):e.has("F")?e.get("F"):e.has("Unix")?e.get("Unix"):e.has("Mac")?e.get("Mac"):e.has("DOS")?e.get("DOS"):null}t.FileSpec=class FileSpec{constructor(e,t){if(e instanceof i.Dict){this.xref=t;this.root=e;e.has("FS")&&(this.fs=e.get("FS"));this.description=e.has("Desc")?(0,r.stringToPDFString)(e.get("Desc")):"";e.has("RF")&&(0,r.warn)("Related file specifications are not supported");this.contentAvailable=!0;if(!e.has("EF")){this.contentAvailable=!1;(0,r.warn)("Non-embedded file specifications are not supported")}}}get filename(){if(!this._filename&&this.root){const e=pickPlatformItem(this.root)||"unnamed";this._filename=(0,r.stringToPDFString)(e).replace(/\\\\/g,"\\").replace(/\\\//g,"/").replace(/\\/g,"/")}return this._filename}get content(){if(!this.contentAvailable)return null;!this.contentRef&&this.root&&(this.contentRef=pickPlatformItem(this.root.get("EF")));let e=null;if(this.contentRef){const t=this.xref.fetchIfRef(this.contentRef);t instanceof n.BaseStream?e=t.getBytes():(0,r.warn)("Embedded file specification points to non-existing/invalid content")}else(0,r.warn)("Embedded file specification does not have a content");return e}get serializable(){return{filename:this.filename,content:this.content}}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.MetadataParser=void 0;var r=a(64);t.MetadataParser=class MetadataParser{constructor(e){e=this._repair(e);const t=new r.SimpleXMLParser({lowerCaseName:!0}).parseFromString(e);this._metadataMap=new Map;this._data=e;t&&this._parse(t)}_repair(e){return e.replace(/^[^<]+/,"").replace(/>\\376\\377([^<]+)/g,(function(e,t){const a=t.replace(/\\([0-3])([0-7])([0-7])/g,(function(e,t,a,r){return String.fromCharCode(64*t+8*a+1*r)})).replace(/&(amp|apos|gt|lt|quot);/g,(function(e,t){switch(t){case"amp":return"&";case"apos":return"'";case"gt":return">";case"lt":return"<";case"quot":return'"'}throw new Error(`_repair: ${t} isn't defined.`)})),r=[">"];for(let e=0,t=a.length;e<t;e+=2){const t=256*a.charCodeAt(e)+a.charCodeAt(e+1);t>=32&&t<127&&60!==t&&62!==t&&38!==t?r.push(String.fromCharCode(t)):r.push("&#x"+(65536+t).toString(16).substring(1)+";")}return r.join("")}))}_getSequence(e){const t=e.nodeName;return"rdf:bag"!==t&&"rdf:seq"!==t&&"rdf:alt"!==t?null:e.childNodes.filter((e=>"rdf:li"===e.nodeName))}_parseArray(e){if(!e.hasChildNodes())return;const[t]=e.childNodes,a=this._getSequence(t)||[];this._metadataMap.set(e.nodeName,a.map((e=>e.textContent.trim())))}_parse(e){let t=e.documentElement;if("rdf:rdf"!==t.nodeName){t=t.firstChild;for(;t&&"rdf:rdf"!==t.nodeName;)t=t.nextSibling}if(t&&"rdf:rdf"===t.nodeName&&t.hasChildNodes())for(const e of t.childNodes)if("rdf:description"===e.nodeName)for(const t of e.childNodes){const e=t.nodeName;switch(e){case"#text":continue;case"dc:creator":case"dc:subject":this._parseArray(t);continue}this._metadataMap.set(e,t.textContent.trim())}}get serializable(){return{parsedData:this._metadataMap,rawData:this._data}}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.StructTreeRoot=t.StructTreePage=void 0;var r=a(4),n=a(2),i=a(68);const s=40,o={PAGE_CONTENT:"PAGE_CONTENT",STREAM_CONTENT:"STREAM_CONTENT",OBJECT:"OBJECT",ELEMENT:"ELEMENT"};t.StructTreeRoot=class StructTreeRoot{constructor(e){this.dict=e;this.roleMap=new Map}init(){this.readRoleMap()}readRoleMap(){const e=this.dict.get("RoleMap");e instanceof r.Dict&&e.forEach(((e,t)=>{t instanceof r.Name&&this.roleMap.set(e,t.name)}))}};class StructElementNode{constructor(e,t){this.tree=e;this.dict=t;this.kids=[];this.parseKids()}get role(){const e=this.dict.get("S"),t=e instanceof r.Name?e.name:"",{root:a}=this.tree;return a.roleMap.has(t)?a.roleMap.get(t):t}parseKids(){let e=null;const t=this.dict.getRaw("Pg");t instanceof r.Ref&&(e=t.toString());const a=this.dict.get("K");if(Array.isArray(a))for(const t of a){const a=this.parseKid(e,t);a&&this.kids.push(a)}else{const t=this.parseKid(e,a);t&&this.kids.push(t)}}parseKid(e,t){if(Number.isInteger(t))return this.tree.pageDict.objId!==e?null:new StructElement({type:o.PAGE_CONTENT,mcid:t,pageObjId:e});let a=null;t instanceof r.Ref?a=this.dict.xref.fetch(t):t instanceof r.Dict&&(a=t);if(!a)return null;const n=a.getRaw("Pg");n instanceof r.Ref&&(e=n.toString());const i=a.get("Type")instanceof r.Name?a.get("Type").name:null;return"MCR"===i?this.tree.pageDict.objId!==e?null:new StructElement({type:o.STREAM_CONTENT,refObjId:a.getRaw("Stm")instanceof r.Ref?a.getRaw("Stm").toString():null,pageObjId:e,mcid:a.get("MCID")}):"OBJR"===i?this.tree.pageDict.objId!==e?null:new StructElement({type:o.OBJECT,refObjId:a.getRaw("Obj")instanceof r.Ref?a.getRaw("Obj").toString():null,pageObjId:e}):new StructElement({type:o.ELEMENT,dict:a})}}class StructElement{constructor({type:e,dict:t=null,mcid:a=null,pageObjId:r=null,refObjId:n=null}){this.type=e;this.dict=t;this.mcid=a;this.pageObjId=r;this.refObjId=n;this.parentNode=null}}t.StructTreePage=class StructTreePage{constructor(e,t){this.root=e;this.rootDict=e?e.dict:null;this.pageDict=t;this.nodes=[]}parse(){if(!this.root||!this.rootDict)return;const e=this.rootDict.get("ParentTree");if(!e)return;const t=this.pageDict.get("StructParents");if(!Number.isInteger(t))return;const a=new i.NumberTree(e,this.rootDict.xref).get(t);if(!Array.isArray(a))return;const n=new Map;for(const e of a)e instanceof r.Ref&&this.addNode(this.rootDict.xref.fetch(e),n)}addNode(e,t,a=0){if(a>s){(0,n.warn)("StructTree MAX_DEPTH reached.");return null}if(t.has(e))return t.get(e);const i=new StructElementNode(this,e);t.set(e,i);const c=e.get("P");if(!c||(0,r.isName)(c.get("Type"),"StructTreeRoot")){this.addTopLevelNode(e,i)||t.delete(e);return i}const l=this.addNode(c,t,a+1);if(!l)return i;let h=!1;for(const t of l.kids)if(t.type===o.ELEMENT&&t.dict===e){t.parentNode=i;h=!0}h||t.delete(e);return i}addTopLevelNode(e,t){const a=this.rootDict.get("K");if(!a)return!1;if(a instanceof r.Dict){if(a.objId!==e.objId)return!1;this.nodes[0]=t;return!0}if(!Array.isArray(a))return!0;let n=!1;for(let r=0;r<a.length;r++){const i=a[r];if(i&&i.toString()===e.objId){this.nodes[r]=t;n=!0}}return n}get serializable(){function nodeToSerializable(e,t,a=0){if(a>s){(0,n.warn)("StructTree too deep to be fully serialized.");return}const r=Object.create(null);r.role=e.role;r.children=[];t.children.push(r);const i=e.dict.get("Alt");"string"==typeof i&&(r.alt=(0,n.stringToPDFString)(i));const c=e.dict.get("Lang");"string"==typeof c&&(r.lang=(0,n.stringToPDFString)(c));for(const t of e.kids){const e=t.type===o.ELEMENT?t.parentNode:null;e?nodeToSerializable(e,r,a+1):t.type===o.PAGE_CONTENT||t.type===o.STREAM_CONTENT?r.children.push({type:"content",id:`page${t.pageObjId}_mcid${t.mcid}`}):t.type===o.OBJECT&&r.children.push({type:"object",id:t.refObjId})}}const e=Object.create(null);e.children=[];e.role="Root";for(const t of this.nodes)t&&nodeToSerializable(t,e);return e}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.ObjectLoader=void 0;var r=a(4),n=a(5),i=a(3),s=a(2);function addChildren(e,t){if(e instanceof r.Dict)e=e.getRawValues();else if(e instanceof n.BaseStream)e=e.dict.getRawValues();else if(!Array.isArray(e))return;for(const i of e)((a=i)instanceof r.Ref||a instanceof r.Dict||a instanceof n.BaseStream||Array.isArray(a))&&t.push(i);var a}t.ObjectLoader=class ObjectLoader{constructor(e,t,a){this.dict=e;this.keys=t;this.xref=a;this.refSet=null}async load(){if(this.xref.stream.isDataLoaded)return;const{keys:e,dict:t}=this;this.refSet=new r.RefSet;const a=[];for(const r of e){const e=t.getRaw(r);void 0!==e&&a.push(e)}return this._walk(a)}async _walk(e){const t=[],a=[];for(;e.length;){let o=e.pop();if(o instanceof r.Ref){if(this.refSet.has(o))continue;try{this.refSet.put(o);o=this.xref.fetch(o)}catch(e){if(!(e instanceof i.MissingDataException)){(0,s.warn)(`ObjectLoader._walk - requesting all data: "${e}".`);this.refSet=null;const{manager:t}=this.xref.stream;return t.requestAllChunks()}t.push(o);a.push({begin:e.begin,end:e.end})}}if(o instanceof n.BaseStream){const e=o.getBaseStreams();if(e){let r=!1;for(const t of e)if(!t.isDataLoaded){r=!0;a.push({begin:t.start,end:t.end})}r&&t.push(o)}}addChildren(o,e)}if(a.length){await this.xref.stream.manager.requestRanges(a);for(const e of t)e instanceof r.Ref&&this.refSet.remove(e);return this._walk(t)}this.refSet=null}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.XFAFactory=void 0;var r=a(75),n=a(79),i=a(85),s=a(83),o=a(76),c=a(2),l=a(86),h=a(96);class XFAFactory{constructor(e){try{this.root=(new l.XFAParser).parse(XFAFactory._createDocument(e));const t=new n.Binder(this.root);this.form=t.bind();this.dataHandler=new i.DataHandler(this.root,t.getData());this.form[r.$globalData].template=this.form}catch(e){(0,c.warn)(`XFA - an error occurred during parsing and binding: ${e}`)}}isValid(){return this.root&&this.form}_createPagesHelper(){const e=this.form[r.$toPages]();return new Promise(((t,a)=>{const nextIteration=()=>{try{const a=e.next();a.done?t(a.value):setTimeout(nextIteration,0)}catch(e){a(e)}};setTimeout(nextIteration,0)}))}async _createPages(){try{this.pages=await this._createPagesHelper();this.dims=this.pages.children.map((e=>{const{width:t,height:a}=e.attributes.style;return[0,0,parseInt(t),parseInt(a)]}))}catch(e){(0,c.warn)(`XFA - an error occurred during layout: ${e}`)}}getBoundingBox(e){return this.dims[e]}async getNumPages(){this.pages||await this._createPages();return this.dims.length}setImages(e){this.form[r.$globalData].images=e}setFonts(e){this.form[r.$globalData].fontFinder=new s.FontFinder(e);const t=[];for(let e of this.form[r.$globalData].usedTypefaces){e=(0,o.stripQuotes)(e);this.form[r.$globalData].fontFinder.find(e)||t.push(e)}return t.length>0?t:null}appendFonts(e,t){this.form[r.$globalData].fontFinder.add(e,t)}async getPages(){this.pages||await this._createPages();const e=this.pages;this.pages=null;return e}serializeData(e){return this.dataHandler.serialize(e)}static _createDocument(e){return e["/xdp:xdp"]?Object.values(e).join(""):e["xdp:xdp"]}static getRichTextAsHtml(e){if(!e||"string"!=typeof e)return null;try{let t=new l.XFAParser(h.XhtmlNamespace,!0).parse(e);if(!["body","xhtml"].includes(t[r.$nodeName])){const e=h.XhtmlNamespace.body({});e[r.$appendChild](t);t=e}const a=t[r.$toHTML]();if(!a.success)return null;const{html:n}=a,{attributes:i}=n;if(i){i.class&&(i.class=i.class.filter((e=>!e.startsWith("xfa"))));i.dir="auto"}return{html:n,str:t[r.$text]()}}catch(e){(0,c.warn)(`XFA - an error occurred during parsing of rich text: ${e}`)}return null}}t.XFAFactory=XFAFactory},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.XmlObject=t.XFAObjectArray=t.XFAObject=t.XFAAttribute=t.StringObject=t.OptionObject=t.Option10=t.Option01=t.IntegerObject=t.ContentObject=t.$uid=t.$toStyle=t.$toString=t.$toPages=t.$toHTML=t.$text=t.$tabIndex=t.$setValue=t.$setSetAttributes=t.$setId=t.$searchNode=t.$root=t.$resolvePrototypes=t.$removeChild=t.$pushPara=t.$pushGlyphs=t.$popPara=t.$onText=t.$onChildCheck=t.$onChild=t.$nsAttributes=t.$nodeName=t.$namespaceId=t.$isUsable=t.$isTransparent=t.$isThereMoreWidth=t.$isSplittable=t.$isNsAgnostic=t.$isDescendent=t.$isDataValue=t.$isCDATAXml=t.$isBindable=t.$insertAt=t.$indexOf=t.$ids=t.$hasSettableValue=t.$globalData=t.$getTemplateRoot=t.$getSubformParent=t.$getRealChildrenByNameIt=t.$getParent=t.$getNextPage=t.$getExtra=t.$getDataValue=t.$getContainedChildren=t.$getChildrenByNameIt=t.$getChildrenByName=t.$getChildrenByClass=t.$getChildren=t.$getAvailableSpace=t.$getAttributes=t.$getAttributeIt=t.$flushHTML=t.$finalize=t.$extra=t.$dump=t.$data=t.$content=t.$consumed=t.$clone=t.$cleanup=t.$cleanPage=t.$clean=t.$childrenToHTML=t.$appendChild=t.$addHTML=t.$acceptWhitespace=void 0;var r=a(76),n=a(2),i=a(3),s=a(77),o=a(78);const c=Symbol();t.$acceptWhitespace=c;const l=Symbol();t.$addHTML=l;const h=Symbol();t.$appendChild=h;const u=Symbol();t.$childrenToHTML=u;const d=Symbol();t.$clean=d;const f=Symbol();t.$cleanPage=f;const g=Symbol();t.$cleanup=g;const p=Symbol();t.$clone=p;const m=Symbol();t.$consumed=m;const b=Symbol("content");t.$content=b;const y=Symbol("data");t.$data=y;const w=Symbol();t.$dump=w;const S=Symbol("extra");t.$extra=S;const x=Symbol();t.$finalize=x;const C=Symbol();t.$flushHTML=C;const k=Symbol();t.$getAttributeIt=k;const v=Symbol();t.$getAttributes=v;const F=Symbol();t.$getAvailableSpace=F;const O=Symbol();t.$getChildrenByClass=O;const T=Symbol();t.$getChildrenByName=T;const M=Symbol();t.$getChildrenByNameIt=M;const E=Symbol();t.$getDataValue=E;const D=Symbol();t.$getExtra=D;const N=Symbol();t.$getRealChildrenByNameIt=N;const R=Symbol();t.$getChildren=R;const L=Symbol();t.$getContainedChildren=L;const j=Symbol();t.$getNextPage=j;const $=Symbol();t.$getSubformParent=$;const _=Symbol();t.$getParent=_;const U=Symbol();t.$getTemplateRoot=U;const X=Symbol();t.$globalData=X;const H=Symbol();t.$hasSettableValue=H;const q=Symbol();t.$ids=q;const z=Symbol();t.$indexOf=z;const W=Symbol();t.$insertAt=W;const G=Symbol();t.$isCDATAXml=G;const V=Symbol();t.$isBindable=V;const K=Symbol();t.$isDataValue=K;const J=Symbol();t.$isDescendent=J;const Y=Symbol();t.$isNsAgnostic=Y;const Z=Symbol();t.$isSplittable=Z;const Q=Symbol();t.$isThereMoreWidth=Q;const ee=Symbol();t.$isTransparent=ee;const te=Symbol();t.$isUsable=te;const ae=Symbol(),re=Symbol("namespaceId");t.$namespaceId=re;const ne=Symbol("nodeName");t.$nodeName=ne;const ie=Symbol();t.$nsAttributes=ie;const se=Symbol();t.$onChild=se;const oe=Symbol();t.$onChildCheck=oe;const ce=Symbol();t.$onText=ce;const le=Symbol();t.$pushGlyphs=le;const he=Symbol();t.$popPara=he;const ue=Symbol();t.$pushPara=ue;const de=Symbol();t.$removeChild=de;const fe=Symbol("root");t.$root=fe;const ge=Symbol();t.$resolvePrototypes=ge;const pe=Symbol();t.$searchNode=pe;const me=Symbol();t.$setId=me;const be=Symbol();t.$setSetAttributes=be;const ye=Symbol();t.$setValue=ye;const we=Symbol();t.$tabIndex=we;const Se=Symbol();t.$text=Se;const xe=Symbol();t.$toPages=xe;const Ae=Symbol();t.$toHTML=Ae;const Ce=Symbol();t.$toString=Ce;const ke=Symbol();t.$toStyle=ke;const ve=Symbol("uid");t.$uid=ve;const Fe=Symbol(),Oe=Symbol(),Te=Symbol(),Ie=Symbol("_children"),Me=Symbol(),Pe=Symbol(),Ee=Symbol(),De=Symbol(),Ne=Symbol(),Be=Symbol(),Re=Symbol(),Le=Symbol(),je=Symbol(),$e=Symbol("parent"),_e=Symbol(),Ue=Symbol(),Xe=Symbol();let He=0;const qe=s.NamespaceIds.datasets.id;class XFAObject{constructor(e,t,a=!1){this[re]=e;this[ne]=t;this[Re]=a;this[$e]=null;this[Ie]=[];this[ve]=`${t}${He++}`;this[X]=null}[se](e){if(!this[Re]||!this[oe](e))return!1;const t=e[ne],a=this[t];if(!(a instanceof XFAObjectArray)){null!==a&&this[de](a);this[t]=e;this[h](e);return!0}if(a.push(e)){this[h](e);return!0}let r="";this.id?r=` (id: ${this.id})`:this.name&&(r=` (name: ${this.name} ${this.h.value})`);(0,n.warn)(`XFA - node "${this[ne]}"${r} has already enough "${t}"!`);return!1}[oe](e){return this.hasOwnProperty(e[ne])&&e[re]===this[re]}[Y](){return!1}[c](){return!1}[G](){return!1}[V](){return!1}[he](){this.para&&this[U]()[S].paraStack.pop()}[ue](){this[U]()[S].paraStack.push(this.para)}[me](e){this.id&&this[re]===s.NamespaceIds.template.id&&e.set(this.id,this)}[U](){return this[X].template}[Z](){return!1}[Q](){return!1}[h](e){e[$e]=this;this[Ie].push(e);!e[X]&&this[X]&&(e[X]=this[X])}[de](e){const t=this[Ie].indexOf(e);this[Ie].splice(t,1)}[H](){return this.hasOwnProperty("value")}[ye](e){}[ce](e){}[x](){}[d](e){delete this[Re];if(this[g]){e.clean(this[g]);delete this[g]}}[z](e){return this[Ie].indexOf(e)}[W](e,t){t[$e]=this;this[Ie].splice(e,0,t);!t[X]&&this[X]&&(t[X]=this[X])}[ee](){return!this.name}[ae](){return""}[Se](){return 0===this[Ie].length?this[b]:this[Ie].map((e=>e[Se]())).join("")}get[Te](){const e=Object.getPrototypeOf(this);if(!e._attributes){const t=e._attributes=new Set;for(const e of Object.getOwnPropertyNames(this)){if(null===this[e]||this[e]instanceof XFAObject||this[e]instanceof XFAObjectArray)break;t.add(e)}}return(0,n.shadow)(this,Te,e._attributes)}[J](e){let t=this;for(;t;){if(t===e)return!0;t=t[_]()}return!1}[_](){return this[$e]}[$](){return this[_]()}[R](e=null){return e?this[e]:this[Ie]}[w](){const e=Object.create(null);this[b]&&(e.$content=this[b]);for(const t of Object.getOwnPropertyNames(this)){const a=this[t];null!==a&&(a instanceof XFAObject?e[t]=a[w]():a instanceof XFAObjectArray?a.isEmpty()||(e[t]=a.dump()):e[t]=a)}return e}[ke](){return null}[Ae](){return r.HTMLResult.EMPTY}*[L](){for(const e of this[R]())yield e}*[De](e,t){for(const a of this[L]())if(!e||t===e.has(a[ne])){const e=this[F](),t=a[Ae](e);t.success||(this[S].failingNode=a);yield t}}[C](){return null}[l](e,t){this[S].children.push(e)}[F](){}[u]({filter:e=null,include:t=!0}){if(this[S].generator){const e=this[F](),t=this[S].failingNode[Ae](e);if(!t.success)return t;t.html&&this[l](t.html,t.bbox);delete this[S].failingNode}else this[S].generator=this[De](e,t);for(;;){const e=this[S].generator.next();if(e.done)break;const t=e.value;if(!t.success)return t;t.html&&this[l](t.html,t.bbox)}this[S].generator=null;return r.HTMLResult.EMPTY}[be](e){this[Ue]=new Set(Object.keys(e))}[Be](e){const t=this[Te],a=this[Ue];return[...e].filter((e=>t.has(e)&&!a.has(e)))}[ge](e,t=new Set){for(const a of this[Ie])a[_e](e,t)}[_e](e,t){const a=this[Ne](e,t);a?this[Fe](a,e,t):this[ge](e,t)}[Ne](e,t){const{use:a,usehref:r}=this;if(!a&&!r)return null;let i=null,s=null,c=null,l=a;if(r){l=r;r.startsWith("#som(")&&r.endsWith(")")?s=r.slice("#som(".length,r.length-1):r.startsWith(".#som(")&&r.endsWith(")")?s=r.slice(".#som(".length,r.length-1):r.startsWith("#")?c=r.slice(1):r.startsWith(".#")&&(c=r.slice(2))}else a.startsWith("#")?c=a.slice(1):s=a;this.use=this.usehref="";if(c)i=e.get(c);else{i=(0,o.searchNode)(e.get(fe),this,s,!0,!1);i&&(i=i[0])}if(!i){(0,n.warn)(`XFA - Invalid prototype reference: ${l}.`);return null}if(i[ne]!==this[ne]){(0,n.warn)(`XFA - Incompatible prototype: ${i[ne]} !== ${this[ne]}.`);return null}if(t.has(i)){(0,n.warn)("XFA - Cycle detected in prototypes use.");return null}t.add(i);const h=i[Ne](e,t);h&&i[Fe](h,e,t);i[ge](e,t);t.delete(i);return i}[Fe](e,t,a){if(a.has(e)){(0,n.warn)("XFA - Cycle detected in prototypes use.");return}!this[b]&&e[b]&&(this[b]=e[b]);new Set(a).add(e);for(const t of this[Be](e[Ue])){this[t]=e[t];this[Ue]&&this[Ue].add(t)}for(const r of Object.getOwnPropertyNames(this)){if(this[Te].has(r))continue;const n=this[r],i=e[r];if(n instanceof XFAObjectArray){for(const e of n[Ie])e[_e](t,a);for(let r=n[Ie].length,s=i[Ie].length;r<s;r++){const i=e[Ie][r][p]();if(!n.push(i))break;i[$e]=this;this[Ie].push(i);i[_e](t,a)}}else if(null===n){if(null!==i){const e=i[p]();e[$e]=this;this[r]=e;this[Ie].push(e);e[_e](t,a)}}else{n[ge](t,a);i&&n[Fe](i,t,a)}}}static[Me](e){return Array.isArray(e)?e.map((e=>XFAObject[Me](e))):"object"==typeof e&&null!==e?Object.assign({},e):e}[p](){const e=Object.create(Object.getPrototypeOf(this));for(const t of Object.getOwnPropertySymbols(this))try{e[t]=this[t]}catch(a){(0,n.shadow)(e,t,this[t])}e[ve]=`${e[ne]}${He++}`;e[Ie]=[];for(const t of Object.getOwnPropertyNames(this)){if(this[Te].has(t)){e[t]=XFAObject[Me](this[t]);continue}const a=this[t];e[t]=a instanceof XFAObjectArray?new XFAObjectArray(a[Le]):null}for(const t of this[Ie]){const a=t[ne],r=t[p]();e[Ie].push(r);r[$e]=e;null===e[a]?e[a]=r:e[a][Ie].push(r)}return e}[R](e=null){return e?this[Ie].filter((t=>t[ne]===e)):this[Ie]}[O](e){return this[e]}[T](e,t,a=!0){return Array.from(this[M](e,t,a))}*[M](e,t,a=!0){if("parent"!==e){for(const a of this[Ie]){a[ne]===e&&(yield a);a.name===e&&(yield a);(t||a[ee]())&&(yield*a[M](e,t,!1))}a&&this[Te].has(e)&&(yield new XFAAttribute(this,e,this[e]))}else yield this[$e]}}t.XFAObject=XFAObject;class XFAObjectArray{constructor(e=1/0){this[Le]=e;this[Ie]=[]}push(e){if(this[Ie].length<=this[Le]){this[Ie].push(e);return!0}(0,n.warn)(`XFA - node "${e[ne]}" accepts no more than ${this[Le]} children`);return!1}isEmpty(){return 0===this[Ie].length}dump(){return 1===this[Ie].length?this[Ie][0][w]():this[Ie].map((e=>e[w]()))}[p](){const e=new XFAObjectArray(this[Le]);e[Ie]=this[Ie].map((e=>e[p]()));return e}get children(){return this[Ie]}clear(){this[Ie].length=0}}t.XFAObjectArray=XFAObjectArray;class XFAAttribute{constructor(e,t,a){this[$e]=e;this[ne]=t;this[b]=a;this[m]=!1;this[ve]="attribute"+He++}[_](){return this[$e]}[K](){return!0}[E](){return this[b].trim()}[ye](e){e=e.value||"";this[b]=e.toString()}[Se](){return this[b]}[J](e){return this[$e]===e||this[$e][J](e)}}t.XFAAttribute=XFAAttribute;class XmlObject extends XFAObject{constructor(e,t,a={}){super(e,t);this[b]="";this[Pe]=null;if("#text"!==t){const e=new Map;this[Oe]=e;for(const[t,r]of Object.entries(a))e.set(t,new XFAAttribute(this,t,r));if(a.hasOwnProperty(ie)){const e=a[ie].xfa.dataNode;void 0!==e&&("dataGroup"===e?this[Pe]=!1:"dataValue"===e&&(this[Pe]=!0))}}this[m]=!1}[Ce](e){const t=this[ne];if("#text"===t){e.push((0,i.encodeToXmlString)(this[b]));return}const a=(0,n.utf8StringToString)(t),r=this[re]===qe?"xfa:":"";e.push(`<${r}${a}`);for(const[t,a]of this[Oe].entries()){const r=(0,n.utf8StringToString)(t);e.push(` ${r}="${(0,i.encodeToXmlString)(a[b])}"`)}null!==this[Pe]&&(this[Pe]?e.push(' xfa:dataNode="dataValue"'):e.push(' xfa:dataNode="dataGroup"'));if(this[b]||0!==this[Ie].length){e.push(">");if(this[b])"string"==typeof this[b]?e.push((0,i.encodeToXmlString)(this[b])):this[b][Ce](e);else for(const t of this[Ie])t[Ce](e);e.push(`</${r}${a}>`)}else e.push("/>")}[se](e){if(this[b]){const e=new XmlObject(this[re],"#text");this[h](e);e[b]=this[b];this[b]=""}this[h](e);return!0}[ce](e){this[b]+=e}[x](){if(this[b]&&this[Ie].length>0){const e=new XmlObject(this[re],"#text");this[h](e);e[b]=this[b];delete this[b]}}[Ae](){return"#text"===this[ne]?r.HTMLResult.success({name:"#text",value:this[b]}):r.HTMLResult.EMPTY}[R](e=null){return e?this[Ie].filter((t=>t[ne]===e)):this[Ie]}[v](){return this[Oe]}[O](e){const t=this[Oe].get(e);return void 0!==t?t:this[R](e)}*[M](e,t){const a=this[Oe].get(e);a&&(yield a);for(const a of this[Ie]){a[ne]===e&&(yield a);t&&(yield*a[M](e,t))}}*[k](e,t){const a=this[Oe].get(e);!a||t&&a[m]||(yield a);for(const a of this[Ie])yield*a[k](e,t)}*[N](e,t,a){for(const r of this[Ie]){r[ne]!==e||a&&r[m]||(yield r);t&&(yield*r[N](e,t,a))}}[K](){return null===this[Pe]?0===this[Ie].length||this[Ie][0][re]===s.NamespaceIds.xhtml.id:this[Pe]}[E](){return null===this[Pe]?0===this[Ie].length?this[b].trim():this[Ie][0][re]===s.NamespaceIds.xhtml.id?this[Ie][0][Se]().trim():null:this[b].trim()}[ye](e){e=e.value||"";this[b]=e.toString()}[w](e=!1){const t=Object.create(null);e&&(t.$ns=this[re]);this[b]&&(t.$content=this[b]);t.$name=this[ne];t.children=[];for(const a of this[Ie])t.children.push(a[w](e));t.attributes=Object.create(null);for(const[e,a]of this[Oe])t.attributes[e]=a[b];return t}}t.XmlObject=XmlObject;class ContentObject extends XFAObject{constructor(e,t){super(e,t);this[b]=""}[ce](e){this[b]+=e}[x](){}}t.ContentObject=ContentObject;t.OptionObject=class OptionObject extends ContentObject{constructor(e,t,a){super(e,t);this[je]=a}[x](){this[b]=(0,r.getKeyword)({data:this[b],defaultValue:this[je][0],validate:e=>this[je].includes(e)})}[d](e){super[d](e);delete this[je]}};t.StringObject=class StringObject extends ContentObject{[x](){this[b]=this[b].trim()}};class IntegerObject extends ContentObject{constructor(e,t,a,r){super(e,t);this[Ee]=a;this[Xe]=r}[x](){this[b]=(0,r.getInteger)({data:this[b],defaultValue:this[Ee],validate:this[Xe]})}[d](e){super[d](e);delete this[Ee];delete this[Xe]}}t.IntegerObject=IntegerObject;t.Option01=class Option01 extends IntegerObject{constructor(e,t){super(e,t,0,(e=>1===e))}};t.Option10=class Option10 extends IntegerObject{constructor(e,t){super(e,t,1,(e=>0===e))}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.HTMLResult=void 0;t.getBBox=function getBBox(e){const t=-1;if(!e)return{x:t,y:t,width:t,height:t};const a=e.trim().split(/\s*,\s*/).map((e=>getMeasurement(e,"-1")));if(a.length<4||a[2]<0||a[3]<0)return{x:t,y:t,width:t,height:t};const[r,n,i,s]=a;return{x:r,y:n,width:i,height:s}};t.getColor=function getColor(e,t=[0,0,0]){let[a,r,n]=t;if(!e)return{r:a,g:r,b:n};const i=e.trim().split(/\s*,\s*/).map((e=>Math.min(Math.max(0,parseInt(e.trim(),10)),255))).map((e=>isNaN(e)?0:e));if(i.length<3)return{r:a,g:r,b:n};[a,r,n]=i;return{r:a,g:r,b:n}};t.getFloat=function getFloat({data:e,defaultValue:t,validate:a}){if(!e)return t;e=e.trim();const r=parseFloat(e);if(!isNaN(r)&&a(r))return r;return t};t.getInteger=function getInteger({data:e,defaultValue:t,validate:a}){if(!e)return t;e=e.trim();const r=parseInt(e,10);if(!isNaN(r)&&a(r))return r;return t};t.getKeyword=getKeyword;t.getMeasurement=getMeasurement;t.getRatio=function getRatio(e){if(!e)return{num:1,den:1};const t=e.trim().split(/\s*:\s*/).map((e=>parseFloat(e))).filter((e=>!isNaN(e)));1===t.length&&t.push(1);if(0===t.length)return{num:1,den:1};const[a,r]=t;return{num:a,den:r}};t.getRelevant=function getRelevant(e){if(!e)return[];return e.trim().split(/\s+/).map((e=>({excluded:"-"===e[0],viewname:e.substring(1)})))};t.getStringOption=function getStringOption(e,t){return getKeyword({data:e,defaultValue:t[0],validate:e=>t.includes(e)})};t.stripQuotes=function stripQuotes(e){if(e.startsWith("'")||e.startsWith('"'))return e.slice(1,e.length-1);return e};var r=a(2);const n={pt:e=>e,cm:e=>e/2.54*72,mm:e=>e/25.4*72,in:e=>72*e,px:e=>e},i=/([+-]?\d+\.?\d*)(.*)/;function getKeyword({data:e,defaultValue:t,validate:a}){return e&&a(e=e.trim())?e:t}function getMeasurement(e,t="0"){t=t||"0";if(!e)return getMeasurement(t);const a=e.trim().match(i);if(!a)return getMeasurement(t);const[,r,s]=a,o=parseFloat(r);if(isNaN(o))return getMeasurement(t);if(0===o)return 0;const c=n[s];return c?c(o):o}class HTMLResult{static get FAILURE(){return(0,r.shadow)(this,"FAILURE",new HTMLResult(!1,null,null,null))}static get EMPTY(){return(0,r.shadow)(this,"EMPTY",new HTMLResult(!0,null,null,null))}constructor(e,t,a,r){this.success=e;this.html=t;this.bbox=a;this.breakNode=r}isBreak(){return!!this.breakNode}static breakNode(e){return new HTMLResult(!1,null,null,e)}static success(e,t=null){return new HTMLResult(!0,e,t,null)}}t.HTMLResult=HTMLResult},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.NamespaceIds=t.$buildXFAObject=void 0;const a=Symbol();t.$buildXFAObject=a;t.NamespaceIds={config:{id:0,check:e=>e.startsWith("http://www.xfa.org/schema/xci/")},connectionSet:{id:1,check:e=>e.startsWith("http://www.xfa.org/schema/xfa-connection-set/")},datasets:{id:2,check:e=>e.startsWith("http://www.xfa.org/schema/xfa-data/")},form:{id:3,check:e=>e.startsWith("http://www.xfa.org/schema/xfa-form/")},localeSet:{id:4,check:e=>e.startsWith("http://www.xfa.org/schema/xfa-locale-set/")},pdf:{id:5,check:e=>"http://ns.adobe.com/xdp/pdf/"===e},signature:{id:6,check:e=>"http://www.w3.org/2000/09/xmldsig#"===e},sourceSet:{id:7,check:e=>e.startsWith("http://www.xfa.org/schema/xfa-source-set/")},stylesheet:{id:8,check:e=>"http://www.w3.org/1999/XSL/Transform"===e},template:{id:9,check:e=>e.startsWith("http://www.xfa.org/schema/xfa-template/")},xdc:{id:10,check:e=>e.startsWith("http://www.xfa.org/schema/xdc/")},xdp:{id:11,check:e=>"http://ns.adobe.com/xdp/"===e},xfdf:{id:12,check:e=>"http://ns.adobe.com/xfdf/"===e},xhtml:{id:13,check:e=>"http://www.w3.org/1999/xhtml"===e},xmpmeta:{id:14,check:e=>"http://ns.adobe.com/xmpmeta/"===e}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.createDataNode=function createDataNode(e,t,a){const n=parseExpression(a);if(!n)return null;if(n.some((e=>e.operator===c.dotDot)))return null;const s=l.get(n[0].name);let o=0;if(s){e=s(e,t);o=1}else e=t||e;for(let t=n.length;o<t;o++){const{name:t,operator:a,index:s}=n[o];if(!isFinite(s)){n[o].index=0;return createNodes(e,n.slice(o))}let l;switch(a){case c.dot:l=e[r.$getChildrenByName](t,!1);break;case c.dotDot:l=e[r.$getChildrenByName](t,!0);break;case c.dotHash:l=e[r.$getChildrenByClass](t);l=l instanceof r.XFAObjectArray?l.children:[l]}if(0===l.length)return createNodes(e,n.slice(o));if(!(s<l.length)){n[o].index=s-l.length;return createNodes(e,n.slice(o))}{const t=l[s];if(!(t instanceof r.XFAObject)){(0,i.warn)("XFA - Cannot create a node.");return null}e=t}}return null};t.searchNode=function searchNode(e,t,a,n=!0,i=!0){const s=parseExpression(a,n);if(!s)return null;const o=l.get(s[0].name);let u,d=0;if(o){u=!0;e=[o(e,t)];d=1}else{u=null===t;e=[t||e]}for(let a=s.length;d<a;d++){const{name:a,cacheName:n,operator:o,index:l}=s[d],f=[];for(const t of e){if(!(t instanceof r.XFAObject))continue;let e,s;if(i){s=h.get(t);if(!s){s=new Map;h.set(t,s)}e=s.get(n)}if(!e){switch(o){case c.dot:e=t[r.$getChildrenByName](a,!1);break;case c.dotDot:e=t[r.$getChildrenByName](a,!0);break;case c.dotHash:e=t[r.$getChildrenByClass](a);e=e instanceof r.XFAObjectArray?e.children:[e]}i&&s.set(n,e)}e.length>0&&f.push(e)}if(0!==f.length||u||0!==d)e=isFinite(l)?f.filter((e=>l<e.length)).map((e=>e[l])):f.flat();else{const a=t[r.$getParent]();if(!(t=a))return null;d=-1;e=[t]}}if(0===e.length)return null;return e};var r=a(75),n=a(77),i=a(2);const s=/^[^.[]+/,o=/^[^\]]+/,c={dot:0,dotDot:1,dotHash:2,dotBracket:3,dotParen:4},l=new Map([["$data",(e,t)=>e.datasets?e.datasets.data:e],["$record",(e,t)=>(e.datasets?e.datasets.data:e)[r.$getChildren]()[0]],["$template",(e,t)=>e.template],["$connectionSet",(e,t)=>e.connectionSet],["$form",(e,t)=>e.form],["$layout",(e,t)=>e.layout],["$host",(e,t)=>e.host],["$dataWindow",(e,t)=>e.dataWindow],["$event",(e,t)=>e.event],["!",(e,t)=>e.datasets],["$xfa",(e,t)=>e],["xfa",(e,t)=>e],["$",(e,t)=>t]]),h=new WeakMap,u=n.NamespaceIds.datasets.id;function parseExpression(e,t,a=!0){let r=e.match(s);if(!r)return null;let[n]=r;const l=[{name:n,cacheName:"."+n,index:0,js:null,formCalc:null,operator:c.dot}];let h=n.length;for(;h<e.length;){const d=h;if("["===e.charAt(h++)){r=e.slice(h).match(o);if(!r){(0,i.warn)("XFA - Invalid index in SOM expression");return null}l.at(-1).index="*"===(u=(u=r[0]).trim())?1/0:parseInt(u,10)||0;h+=r[0].length+1;continue}let f;switch(e.charAt(h)){case".":if(!t)return null;h++;f=c.dotDot;break;case"#":h++;f=c.dotHash;break;case"[":if(a){(0,i.warn)("XFA - SOM expression contains a FormCalc subexpression which is not supported for now.");return null}f=c.dotBracket;break;case"(":if(a){(0,i.warn)("XFA - SOM expression contains a JavaScript subexpression which is not supported for now.");return null}f=c.dotParen;break;default:f=c.dot}r=e.slice(h).match(s);if(!r)break;[n]=r;h+=n.length;l.push({name:n,cacheName:e.slice(d,h),operator:f,index:0,js:null,formCalc:null})}var u;return l}function createNodes(e,t){let a=null;for(const{name:n,index:i}of t){for(let t=0,s=isFinite(i)?i:0;t<=s;t++){const t=e[r.$namespaceId]===u?-1:e[r.$namespaceId];a=new r.XmlObject(t,n);e[r.$appendChild](a)}e=a}return a}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.Binder=void 0;var r=a(75),n=a(80),i=a(78),s=a(77),o=a(2);const c=s.NamespaceIds.datasets.id;function createText(e){const t=new n.Text({});t[r.$content]=e;return t}t.Binder=class Binder{constructor(e){this.root=e;this.datasets=e.datasets;e.datasets&&e.datasets.data?this.data=e.datasets.data:this.data=new r.XmlObject(s.NamespaceIds.datasets.id,"data");this.emptyMerge=0===this.data[r.$getChildren]().length;this.root.form=this.form=e.template[r.$clone]()}_isConsumeData(){return!this.emptyMerge&&this._mergeMode}_isMatchTemplate(){return!this._isConsumeData()}bind(){this._bindElement(this.form,this.data);return this.form}getData(){return this.data}_bindValue(e,t,a){e[r.$data]=t;if(e[r.$hasSettableValue]())if(t[r.$isDataValue]()){const a=t[r.$getDataValue]();e[r.$setValue](createText(a))}else if(e instanceof n.Field&&e.ui&&e.ui.choiceList&&"multiSelect"===e.ui.choiceList.open){const a=t[r.$getChildren]().map((e=>e[r.$content].trim())).join("\n");e[r.$setValue](createText(a))}else this._isConsumeData()&&(0,o.warn)("XFA - Nodes haven't the same type.");else!t[r.$isDataValue]()||this._isMatchTemplate()?this._bindElement(e,t):(0,o.warn)("XFA - Nodes haven't the same type.")}_findDataByNameToConsume(e,t,a,n){if(!e)return null;let i,o;for(let n=0;n<3;n++){i=a[r.$getRealChildrenByNameIt](e,!1,!0);for(;;){o=i.next().value;if(!o)break;if(t===o[r.$isDataValue]())return o}if(a[r.$namespaceId]===s.NamespaceIds.datasets.id&&"data"===a[r.$nodeName])break;a=a[r.$getParent]()}if(!n)return null;i=this.data[r.$getRealChildrenByNameIt](e,!0,!1);o=i.next().value;if(o)return o;i=this.data[r.$getAttributeIt](e,!0);o=i.next().value;return o&&o[r.$isDataValue]()?o:null}_setProperties(e,t){if(e.hasOwnProperty("setProperty"))for(const{ref:a,target:s,connection:c}of e.setProperty.children){if(c)continue;if(!a)continue;const l=(0,i.searchNode)(this.root,t,a,!1,!1);if(!l){(0,o.warn)(`XFA - Invalid reference: ${a}.`);continue}const[h]=l;if(!h[r.$isDescendent](this.data)){(0,o.warn)("XFA - Invalid node: must be a data node.");continue}const u=(0,i.searchNode)(this.root,e,s,!1,!1);if(!u){(0,o.warn)(`XFA - Invalid target: ${s}.`);continue}const[d]=u;if(!d[r.$isDescendent](e)){(0,o.warn)("XFA - Invalid target: must be a property or subproperty.");continue}const f=d[r.$getParent]();if(d instanceof n.SetProperty||f instanceof n.SetProperty){(0,o.warn)("XFA - Invalid target: cannot be a setProperty or one of its properties.");continue}if(d instanceof n.BindItems||f instanceof n.BindItems){(0,o.warn)("XFA - Invalid target: cannot be a bindItems or one of its properties.");continue}const g=h[r.$text](),p=d[r.$nodeName];if(d instanceof r.XFAAttribute){const e=Object.create(null);e[p]=g;const t=Reflect.construct(Object.getPrototypeOf(f).constructor,[e]);f[p]=t[p]}else if(d.hasOwnProperty(r.$content)){d[r.$data]=h;d[r.$content]=g;d[r.$finalize]()}else(0,o.warn)("XFA - Invalid node to use in setProperty")}}_bindItems(e,t){if(!e.hasOwnProperty("items")||!e.hasOwnProperty("bindItems")||e.bindItems.isEmpty())return;for(const t of e.items.children)e[r.$removeChild](t);e.items.clear();const a=new n.Items({}),s=new n.Items({});e[r.$appendChild](a);e.items.push(a);e[r.$appendChild](s);e.items.push(s);for(const{ref:n,labelRef:c,valueRef:l,connection:h}of e.bindItems.children){if(h)continue;if(!n)continue;const e=(0,i.searchNode)(this.root,t,n,!1,!1);if(e)for(const t of e){if(!t[r.$isDescendent](this.datasets)){(0,o.warn)(`XFA - Invalid ref (${n}): must be a datasets child.`);continue}const e=(0,i.searchNode)(this.root,t,c,!0,!1);if(!e){(0,o.warn)(`XFA - Invalid label: ${c}.`);continue}const[h]=e;if(!h[r.$isDescendent](this.datasets)){(0,o.warn)("XFA - Invalid label: must be a datasets child.");continue}const u=(0,i.searchNode)(this.root,t,l,!0,!1);if(!u){(0,o.warn)(`XFA - Invalid value: ${l}.`);continue}const[d]=u;if(!d[r.$isDescendent](this.datasets)){(0,o.warn)("XFA - Invalid value: must be a datasets child.");continue}const f=createText(h[r.$text]()),g=createText(d[r.$text]());a[r.$appendChild](f);a.text.push(f);s[r.$appendChild](g);s.text.push(g)}else(0,o.warn)(`XFA - Invalid reference: ${n}.`)}}_bindOccurrences(e,t,a){let n;if(t.length>1){n=e[r.$clone]();n[r.$removeChild](n.occur);n.occur=null}this._bindValue(e,t[0],a);this._setProperties(e,t[0]);this._bindItems(e,t[0]);if(1===t.length)return;const i=e[r.$getParent](),s=e[r.$nodeName],o=i[r.$indexOf](e);for(let e=1,c=t.length;e<c;e++){const c=t[e],l=n[r.$clone]();i[s].push(l);i[r.$insertAt](o+e,l);this._bindValue(l,c,a);this._setProperties(l,c);this._bindItems(l,c)}}_createOccurrences(e){if(!this.emptyMerge)return;const{occur:t}=e;if(!t||t.initial<=1)return;const a=e[r.$getParent](),n=e[r.$nodeName];if(!(a[n]instanceof r.XFAObjectArray))return;let i;i=e.name?a[n].children.filter((t=>t.name===e.name)).length:a[n].children.length;const s=a[r.$indexOf](e)+1,o=t.initial-i;if(o){const t=e[r.$clone]();t[r.$removeChild](t.occur);t.occur=null;a[n].push(t);a[r.$insertAt](s,t);for(let e=1;e<o;e++){const i=t[r.$clone]();a[n].push(i);a[r.$insertAt](s+e,i)}}}_getOccurInfo(e){const{name:t,occur:a}=e;if(!a||!t)return[1,1];const r=-1===a.max?1/0:a.max;return[a.min,r]}_setAndBind(e,t){this._setProperties(e,t);this._bindItems(e,t);this._bindElement(e,t)}_bindElement(e,t){const a=[];this._createOccurrences(e);for(const n of e[r.$getChildren]()){if(n[r.$data])continue;if(void 0===this._mergeMode&&"subform"===n[r.$nodeName]){this._mergeMode="consumeData"===n.mergeMode;const e=t[r.$getChildren]();if(e.length>0)this._bindOccurrences(n,[e[0]],null);else if(this.emptyMerge){const e=t[r.$namespaceId]===c?-1:t[r.$namespaceId],a=n[r.$data]=new r.XmlObject(e,n.name||"root");t[r.$appendChild](a);this._bindElement(n,a)}continue}if(!n[r.$isBindable]())continue;let e=!1,s=null,l=null,h=null;if(n.bind){switch(n.bind.match){case"none":this._setAndBind(n,t);continue;case"global":e=!0;break;case"dataRef":if(!n.bind.ref){(0,o.warn)(`XFA - ref is empty in node ${n[r.$nodeName]}.`);this._setAndBind(n,t);continue}l=n.bind.ref}n.bind.picture&&(s=n.bind.picture[r.$content])}const[u,d]=this._getOccurInfo(n);if(l){h=(0,i.searchNode)(this.root,t,l,!0,!1);if(null===h){h=(0,i.createDataNode)(this.data,t,l);if(!h)continue;this._isConsumeData()&&(h[r.$consumed]=!0);this._setAndBind(n,h);continue}this._isConsumeData()&&(h=h.filter((e=>!e[r.$consumed])));h.length>d?h=h.slice(0,d):0===h.length&&(h=null);h&&this._isConsumeData()&&h.forEach((e=>{e[r.$consumed]=!0}))}else{if(!n.name){this._setAndBind(n,t);continue}if(this._isConsumeData()){const a=[];for(;a.length<d;){const i=this._findDataByNameToConsume(n.name,n[r.$hasSettableValue](),t,e);if(!i)break;i[r.$consumed]=!0;a.push(i)}h=a.length>0?a:null}else{h=t[r.$getRealChildrenByNameIt](n.name,!1,this.emptyMerge).next().value;if(!h){if(0===u){a.push(n);continue}const e=t[r.$namespaceId]===c?-1:t[r.$namespaceId];h=n[r.$data]=new r.XmlObject(e,n.name);this.emptyMerge&&(h[r.$consumed]=!0);t[r.$appendChild](h);this._setAndBind(n,h);continue}this.emptyMerge&&(h[r.$consumed]=!0);h=[h]}}h?this._bindOccurrences(n,h,s):u>0?this._setAndBind(n,t):a.push(n)}a.forEach((e=>e[r.$getParent]()[r.$removeChild](e)))}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.Value=t.Text=t.TemplateNamespace=t.Template=t.SetProperty=t.Items=t.Field=t.BindItems=void 0;var r=a(75),n=a(77),i=a(81),s=a(82),o=a(76),c=a(2),l=a(83),h=a(3),u=a(78);const d=n.NamespaceIds.template.id,f="http://www.w3.org/2000/svg",g=/^H(\d+)$/,p=new Set(["image/gif","image/jpeg","image/jpg","image/pjpeg","image/png","image/apng","image/x-png","image/bmp","image/x-ms-bmp","image/tiff","image/tif","application/octet-stream"]),m=[[[66,77],"image/bmp"],[[255,216,255],"image/jpeg"],[[73,73,42,0],"image/tiff"],[[77,77,0,42],"image/tiff"],[[71,73,70,56,57,97],"image/gif"],[[137,80,78,71,13,10,26,10],"image/png"]];function getBorderDims(e){if(!e||!e.border)return{w:0,h:0};const t=e.border[r.$getExtra]();return t?{w:t.widths[0]+t.widths[2]+t.insets[0]+t.insets[2],h:t.widths[1]+t.widths[3]+t.insets[1]+t.insets[3]}:{w:0,h:0}}function hasMargin(e){return e.margin&&(e.margin.topInset||e.margin.rightInset||e.margin.bottomInset||e.margin.leftInset)}function _setValue(e,t){if(!e.value){const t=new Value({});e[r.$appendChild](t);e.value=t}e.value[r.$setValue](t)}function*getContainedChildren(e){for(const t of e[r.$getChildren]())t instanceof SubformSet?yield*t[r.$getContainedChildren]():yield t}function isRequired(e){return e.validate&&"error"===e.validate.nullTest}function setTabIndex(e){for(;e;){if(!e.traversal){e[r.$tabIndex]=e[r.$getParent]()[r.$tabIndex];return}if(e[r.$tabIndex])return;let t=null;for(const a of e.traversal[r.$getChildren]())if("next"===a.operation){t=a;break}if(!t||!t.ref){e[r.$tabIndex]=e[r.$getParent]()[r.$tabIndex];return}const a=e[r.$getTemplateRoot]();e[r.$tabIndex]=++a[r.$tabIndex];const n=a[r.$searchNode](t.ref,e);if(!n)return;e=n[0]}}function applyAssist(e,t){const a=e.assist;if(a){const e=a[r.$toHTML]();e&&(t.title=e);const n=a.role.match(g);if(n){const e="heading",a=n[1];t.role=e;t["aria-level"]=a}}if("table"===e.layout)t.role="table";else if("row"===e.layout)t.role="row";else{const a=e[r.$getParent]();"row"===a.layout&&(a.assist&&"TH"===a.assist.role?t.role="columnheader":t.role="cell")}}function ariaLabel(e){if(!e.assist)return null;const t=e.assist;return t.speak&&""!==t.speak[r.$content]?t.speak[r.$content]:t.toolTip?t.toolTip[r.$content]:null}function valueToHtml(e){return o.HTMLResult.success({name:"div",attributes:{class:["xfaRich"],style:Object.create(null)},children:[{name:"span",attributes:{style:Object.create(null)},value:e}]})}function setFirstUnsplittable(e){const t=e[r.$getTemplateRoot]();if(null===t[r.$extra].firstUnsplittable){t[r.$extra].firstUnsplittable=e;t[r.$extra].noLayoutFailure=!0}}function unsetFirstUnsplittable(e){const t=e[r.$getTemplateRoot]();t[r.$extra].firstUnsplittable===e&&(t[r.$extra].noLayoutFailure=!1)}function handleBreak(e){if(e[r.$extra])return!1;e[r.$extra]=Object.create(null);if("auto"===e.targetType)return!1;const t=e[r.$getTemplateRoot]();let a=null;if(e.target){a=t[r.$searchNode](e.target,e[r.$getParent]());if(!a)return!1;a=a[0]}const{currentPageArea:n,currentContentArea:i}=t[r.$extra];if("pageArea"===e.targetType){a instanceof PageArea||(a=null);if(e.startNew){e[r.$extra].target=a||n;return!0}if(a&&a!==n){e[r.$extra].target=a;return!0}return!1}a instanceof ContentArea||(a=null);const s=a&&a[r.$getParent]();let o,c=s;if(e.startNew)if(a){const e=s.contentArea.children,t=e.indexOf(i),r=e.indexOf(a);-1!==t&&t<r&&(c=null);o=r-1}else o=n.contentArea.children.indexOf(i);else{if(!a||a===i)return!1;o=s.contentArea.children.indexOf(a)-1;c=s===n?null:s}e[r.$extra].target=c;e[r.$extra].index=o;return!0}function handleOverflow(e,t,a){const n=e[r.$getTemplateRoot](),i=n[r.$extra].noLayoutFailure,s=t[r.$getSubformParent];t[r.$getSubformParent]=()=>e;n[r.$extra].noLayoutFailure=!0;const o=t[r.$toHTML](a);e[r.$addHTML](o.html,o.bbox);n[r.$extra].noLayoutFailure=i;t[r.$getSubformParent]=s}class AppearanceFilter extends r.StringObject{constructor(e){super(d,"appearanceFilter");this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||""}}class Arc extends r.XFAObject{constructor(e){super(d,"arc",!0);this.circular=(0,o.getInteger)({data:e.circular,defaultValue:0,validate:e=>1===e});this.hand=(0,o.getStringOption)(e.hand,["even","left","right"]);this.id=e.id||"";this.startAngle=(0,o.getFloat)({data:e.startAngle,defaultValue:0,validate:e=>!0});this.sweepAngle=(0,o.getFloat)({data:e.sweepAngle,defaultValue:360,validate:e=>!0});this.use=e.use||"";this.usehref=e.usehref||"";this.edge=null;this.fill=null}[r.$toHTML](){const e=this.edge||new Edge({}),t=e[r.$toStyle](),a=Object.create(null);this.fill&&"visible"===this.fill.presence?Object.assign(a,this.fill[r.$toStyle]()):a.fill="transparent";a.strokeWidth=(0,s.measureToString)("visible"===e.presence?e.thickness:0);a.stroke=t.color;let n;const i={xmlns:f,style:{width:"100%",height:"100%",overflow:"visible"}};if(360===this.sweepAngle)n={name:"ellipse",attributes:{xmlns:f,cx:"50%",cy:"50%",rx:"50%",ry:"50%",style:a}};else{const e=this.startAngle*Math.PI/180,t=this.sweepAngle*Math.PI/180,r=this.sweepAngle>180?1:0,[s,o,c,l]=[50*(1+Math.cos(e)),50*(1-Math.sin(e)),50*(1+Math.cos(e+t)),50*(1-Math.sin(e+t))];n={name:"path",attributes:{xmlns:f,d:`M ${s} ${o} A 50 50 0 ${r} 0 ${c} ${l}`,vectorEffect:"non-scaling-stroke",style:a}};Object.assign(i,{viewBox:"0 0 100 100",preserveAspectRatio:"none"})}const c={name:"svg",children:[n],attributes:i};if(hasMargin(this[r.$getParent]()[r.$getParent]()))return o.HTMLResult.success({name:"div",attributes:{style:{display:"inline",width:"100%",height:"100%"}},children:[c]});c.attributes.style.position="absolute";return o.HTMLResult.success(c)}}class Area extends r.XFAObject{constructor(e){super(d,"area",!0);this.colSpan=(0,o.getInteger)({data:e.colSpan,defaultValue:1,validate:e=>e>=1||-1===e});this.id=e.id||"";this.name=e.name||"";this.relevant=(0,o.getRelevant)(e.relevant);this.use=e.use||"";this.usehref=e.usehref||"";this.x=(0,o.getMeasurement)(e.x,"0pt");this.y=(0,o.getMeasurement)(e.y,"0pt");this.desc=null;this.extras=null;this.area=new r.XFAObjectArray;this.draw=new r.XFAObjectArray;this.exObject=new r.XFAObjectArray;this.exclGroup=new r.XFAObjectArray;this.field=new r.XFAObjectArray;this.subform=new r.XFAObjectArray;this.subformSet=new r.XFAObjectArray}*[r.$getContainedChildren](){yield*getContainedChildren(this)}[r.$isTransparent](){return!0}[r.$isBindable](){return!0}[r.$addHTML](e,t){const[a,n,i,s]=t;this[r.$extra].width=Math.max(this[r.$extra].width,a+i);this[r.$extra].height=Math.max(this[r.$extra].height,n+s);this[r.$extra].children.push(e)}[r.$getAvailableSpace](){return this[r.$extra].availableSpace}[r.$toHTML](e){const t=(0,s.toStyle)(this,"position"),a={style:t,id:this[r.$uid],class:["xfaArea"]};(0,s.isPrintOnly)(this)&&a.class.push("xfaPrintOnly");this.name&&(a.xfaName=this.name);const n=[];this[r.$extra]={children:n,width:0,height:0,availableSpace:e};const i=this[r.$childrenToHTML]({filter:new Set(["area","draw","field","exclGroup","subform","subformSet"]),include:!0});if(!i.success){if(i.isBreak())return i;delete this[r.$extra];return o.HTMLResult.FAILURE}t.width=(0,s.measureToString)(this[r.$extra].width);t.height=(0,s.measureToString)(this[r.$extra].height);const c={name:"div",attributes:a,children:n},l=[this.x,this.y,this[r.$extra].width,this[r.$extra].height];delete this[r.$extra];return o.HTMLResult.success(c,l)}}class Assist extends r.XFAObject{constructor(e){super(d,"assist",!0);this.id=e.id||"";this.role=e.role||"";this.use=e.use||"";this.usehref=e.usehref||"";this.speak=null;this.toolTip=null}[r.$toHTML](){return this.toolTip&&this.toolTip[r.$content]?this.toolTip[r.$content]:null}}class Barcode extends r.XFAObject{constructor(e){super(d,"barcode",!0);this.charEncoding=(0,o.getKeyword)({data:e.charEncoding?e.charEncoding.toLowerCase():"",defaultValue:"",validate:e=>["utf-8","big-five","fontspecific","gbk","gb-18030","gb-2312","ksc-5601","none","shift-jis","ucs-2","utf-16"].includes(e)||e.match(/iso-8859-\d{2}/)});this.checksum=(0,o.getStringOption)(e.checksum,["none","1mod10","1mod10_1mod11","2mod10","auto"]);this.dataColumnCount=(0,o.getInteger)({data:e.dataColumnCount,defaultValue:-1,validate:e=>e>=0});this.dataLength=(0,o.getInteger)({data:e.dataLength,defaultValue:-1,validate:e=>e>=0});this.dataPrep=(0,o.getStringOption)(e.dataPrep,["none","flateCompress"]);this.dataRowCount=(0,o.getInteger)({data:e.dataRowCount,defaultValue:-1,validate:e=>e>=0});this.endChar=e.endChar||"";this.errorCorrectionLevel=(0,o.getInteger)({data:e.errorCorrectionLevel,defaultValue:-1,validate:e=>e>=0&&e<=8});this.id=e.id||"";this.moduleHeight=(0,o.getMeasurement)(e.moduleHeight,"5mm");this.moduleWidth=(0,o.getMeasurement)(e.moduleWidth,"0.25mm");this.printCheckDigit=(0,o.getInteger)({data:e.printCheckDigit,defaultValue:0,validate:e=>1===e});this.rowColumnRatio=(0,o.getRatio)(e.rowColumnRatio);this.startChar=e.startChar||"";this.textLocation=(0,o.getStringOption)(e.textLocation,["below","above","aboveEmbedded","belowEmbedded","none"]);this.truncate=(0,o.getInteger)({data:e.truncate,defaultValue:0,validate:e=>1===e});this.type=(0,o.getStringOption)(e.type?e.type.toLowerCase():"",["aztec","codabar","code2of5industrial","code2of5interleaved","code2of5matrix","code2of5standard","code3of9","code3of9extended","code11","code49","code93","code128","code128a","code128b","code128c","code128sscc","datamatrix","ean8","ean8add2","ean8add5","ean13","ean13add2","ean13add5","ean13pwcd","fim","logmars","maxicode","msi","pdf417","pdf417macro","plessey","postauscust2","postauscust3","postausreplypaid","postausstandard","postukrm4scc","postusdpbc","postusimb","postusstandard","postus5zip","qrcode","rfid","rss14","rss14expanded","rss14limited","rss14stacked","rss14stackedomni","rss14truncated","telepen","ucc128","ucc128random","ucc128sscc","upca","upcaadd2","upcaadd5","upcapwcd","upce","upceadd2","upceadd5","upcean2","upcean5","upsmaxicode"]);this.upsMode=(0,o.getStringOption)(e.upsMode,["usCarrier","internationalCarrier","secureSymbol","standardSymbol"]);this.use=e.use||"";this.usehref=e.usehref||"";this.wideNarrowRatio=(0,o.getRatio)(e.wideNarrowRatio);this.encrypt=null;this.extras=null}}class Bind extends r.XFAObject{constructor(e){super(d,"bind",!0);this.match=(0,o.getStringOption)(e.match,["once","dataRef","global","none"]);this.ref=e.ref||"";this.picture=null}}class BindItems extends r.XFAObject{constructor(e){super(d,"bindItems");this.connection=e.connection||"";this.labelRef=e.labelRef||"";this.ref=e.ref||"";this.valueRef=e.valueRef||""}}t.BindItems=BindItems;class Bookend extends r.XFAObject{constructor(e){super(d,"bookend");this.id=e.id||"";this.leader=e.leader||"";this.trailer=e.trailer||"";this.use=e.use||"";this.usehref=e.usehref||""}}class BooleanElement extends r.Option01{constructor(e){super(d,"boolean");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}[r.$toHTML](e){return valueToHtml(1===this[r.$content]?"1":"0")}}class Border extends r.XFAObject{constructor(e){super(d,"border",!0);this.break=(0,o.getStringOption)(e.break,["close","open"]);this.hand=(0,o.getStringOption)(e.hand,["even","left","right"]);this.id=e.id||"";this.presence=(0,o.getStringOption)(e.presence,["visible","hidden","inactive","invisible"]);this.relevant=(0,o.getRelevant)(e.relevant);this.use=e.use||"";this.usehref=e.usehref||"";this.corner=new r.XFAObjectArray(4);this.edge=new r.XFAObjectArray(4);this.extras=null;this.fill=null;this.margin=null}[r.$getExtra](){if(!this[r.$extra]){const e=this.edge.children.slice();if(e.length<4){const t=e.at(-1)||new Edge({});for(let a=e.length;a<4;a++)e.push(t)}const t=e.map((e=>e.thickness)),a=[0,0,0,0];if(this.margin){a[0]=this.margin.topInset;a[1]=this.margin.rightInset;a[2]=this.margin.bottomInset;a[3]=this.margin.leftInset}this[r.$extra]={widths:t,insets:a,edges:e}}return this[r.$extra]}[r.$toStyle](){const{edges:e}=this[r.$getExtra](),t=e.map((e=>{const t=e[r.$toStyle]();t.color=t.color||"#000000";return t})),a=Object.create(null);this.margin&&Object.assign(a,this.margin[r.$toStyle]());this.fill&&"visible"===this.fill.presence&&Object.assign(a,this.fill[r.$toStyle]());if(this.corner.children.some((e=>0!==e.radius))){const e=this.corner.children.map((e=>e[r.$toStyle]()));if(2===e.length||3===e.length){const t=e.at(-1);for(let a=e.length;a<4;a++)e.push(t)}a.borderRadius=e.map((e=>e.radius)).join(" ")}switch(this.presence){case"invisible":case"hidden":a.borderStyle="";break;case"inactive":a.borderStyle="none";break;default:a.borderStyle=t.map((e=>e.style)).join(" ")}a.borderWidth=t.map((e=>e.width)).join(" ");a.borderColor=t.map((e=>e.color)).join(" ");return a}}class Break extends r.XFAObject{constructor(e){super(d,"break",!0);this.after=(0,o.getStringOption)(e.after,["auto","contentArea","pageArea","pageEven","pageOdd"]);this.afterTarget=e.afterTarget||"";this.before=(0,o.getStringOption)(e.before,["auto","contentArea","pageArea","pageEven","pageOdd"]);this.beforeTarget=e.beforeTarget||"";this.bookendLeader=e.bookendLeader||"";this.bookendTrailer=e.bookendTrailer||"";this.id=e.id||"";this.overflowLeader=e.overflowLeader||"";this.overflowTarget=e.overflowTarget||"";this.overflowTrailer=e.overflowTrailer||"";this.startNew=(0,o.getInteger)({data:e.startNew,defaultValue:0,validate:e=>1===e});this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null}}class BreakAfter extends r.XFAObject{constructor(e){super(d,"breakAfter",!0);this.id=e.id||"";this.leader=e.leader||"";this.startNew=(0,o.getInteger)({data:e.startNew,defaultValue:0,validate:e=>1===e});this.target=e.target||"";this.targetType=(0,o.getStringOption)(e.targetType,["auto","contentArea","pageArea"]);this.trailer=e.trailer||"";this.use=e.use||"";this.usehref=e.usehref||"";this.script=null}}class BreakBefore extends r.XFAObject{constructor(e){super(d,"breakBefore",!0);this.id=e.id||"";this.leader=e.leader||"";this.startNew=(0,o.getInteger)({data:e.startNew,defaultValue:0,validate:e=>1===e});this.target=e.target||"";this.targetType=(0,o.getStringOption)(e.targetType,["auto","contentArea","pageArea"]);this.trailer=e.trailer||"";this.use=e.use||"";this.usehref=e.usehref||"";this.script=null}[r.$toHTML](e){this[r.$extra]={};return o.HTMLResult.FAILURE}}class Button extends r.XFAObject{constructor(e){super(d,"button",!0);this.highlight=(0,o.getStringOption)(e.highlight,["inverted","none","outline","push"]);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null}[r.$toHTML](e){const t=this[r.$getParent]()[r.$getParent](),a={name:"button",attributes:{id:this[r.$uid],class:["xfaButton"],style:{}},children:[]};for(const e of t.event.children){if("click"!==e.activity||!e.script)continue;const t=(0,h.recoverJsURL)(e.script[r.$content]);if(!t)continue;const n=(0,s.fixURL)(t.url);n&&a.children.push({name:"a",attributes:{id:"link"+this[r.$uid],href:n,newWindow:t.newWindow,class:["xfaLink"],style:{}},children:[]})}return o.HTMLResult.success(a)}}class Calculate extends r.XFAObject{constructor(e){super(d,"calculate",!0);this.id=e.id||"";this.override=(0,o.getStringOption)(e.override,["disabled","error","ignore","warning"]);this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.message=null;this.script=null}}class Caption extends r.XFAObject{constructor(e){super(d,"caption",!0);this.id=e.id||"";this.placement=(0,o.getStringOption)(e.placement,["left","bottom","inline","right","top"]);this.presence=(0,o.getStringOption)(e.presence,["visible","hidden","inactive","invisible"]);this.reserve=Math.ceil((0,o.getMeasurement)(e.reserve));this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.font=null;this.margin=null;this.para=null;this.value=null}[r.$setValue](e){_setValue(this,e)}[r.$getExtra](e){if(!this[r.$extra]){let{width:t,height:a}=e;switch(this.placement){case"left":case"right":case"inline":t=this.reserve<=0?t:this.reserve;break;case"top":case"bottom":a=this.reserve<=0?a:this.reserve}this[r.$extra]=(0,s.layoutNode)(this,{width:t,height:a})}return this[r.$extra]}[r.$toHTML](e){if(!this.value)return o.HTMLResult.EMPTY;this[r.$pushPara]();const t=this.value[r.$toHTML](e).html;if(!t){this[r.$popPara]();return o.HTMLResult.EMPTY}const a=this.reserve;if(this.reserve<=0){const{w:t,h:a}=this[r.$getExtra](e);switch(this.placement){case"left":case"right":case"inline":this.reserve=t;break;case"top":case"bottom":this.reserve=a}}const n=[];"string"==typeof t?n.push({name:"#text",value:t}):n.push(t);const i=(0,s.toStyle)(this,"font","margin","visibility");switch(this.placement){case"left":case"right":this.reserve>0&&(i.width=(0,s.measureToString)(this.reserve));break;case"top":case"bottom":this.reserve>0&&(i.height=(0,s.measureToString)(this.reserve))}(0,s.setPara)(this,null,t);this[r.$popPara]();this.reserve=a;return o.HTMLResult.success({name:"div",attributes:{style:i,class:["xfaCaption"]},children:n})}}class Certificate extends r.StringObject{constructor(e){super(d,"certificate");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Certificates extends r.XFAObject{constructor(e){super(d,"certificates",!0);this.credentialServerPolicy=(0,o.getStringOption)(e.credentialServerPolicy,["optional","required"]);this.id=e.id||"";this.url=e.url||"";this.urlPolicy=e.urlPolicy||"";this.use=e.use||"";this.usehref=e.usehref||"";this.encryption=null;this.issuers=null;this.keyUsage=null;this.oids=null;this.signing=null;this.subjectDNs=null}}class CheckButton extends r.XFAObject{constructor(e){super(d,"checkButton",!0);this.id=e.id||"";this.mark=(0,o.getStringOption)(e.mark,["default","check","circle","cross","diamond","square","star"]);this.shape=(0,o.getStringOption)(e.shape,["square","round"]);this.size=(0,o.getMeasurement)(e.size,"10pt");this.use=e.use||"";this.usehref=e.usehref||"";this.border=null;this.extras=null;this.margin=null}[r.$toHTML](e){const t=(0,s.toStyle)("margin"),a=(0,s.measureToString)(this.size);t.width=t.height=a;let n,i,c;const l=this[r.$getParent]()[r.$getParent](),h=l.items.children.length&&l.items.children[0][r.$toHTML]().html||[],u={on:(void 0!==h[0]?h[0]:"on").toString(),off:(void 0!==h[1]?h[1]:"off").toString()},d=(l.value&&l.value[r.$text]()||"off")===u.on||void 0,f=l[r.$getSubformParent](),g=l[r.$uid];let p;if(f instanceof ExclGroup){c=f[r.$uid];n="radio";i="xfaRadio";p=f[r.$data]&&f[r.$data][r.$uid]||f[r.$uid]}else{n="checkbox";i="xfaCheckbox";p=l[r.$data]&&l[r.$data][r.$uid]||l[r.$uid]}const m={name:"input",attributes:{class:[i],style:t,fieldId:g,dataId:p,type:n,checked:d,xfaOn:u.on,xfaOff:u.off,"aria-label":ariaLabel(l),"aria-required":!1}};c&&(m.attributes.name=c);if(isRequired(l)){m.attributes["aria-required"]=!0;m.attributes.required=!0}return o.HTMLResult.success({name:"label",attributes:{class:["xfaLabel"]},children:[m]})}}class ChoiceList extends r.XFAObject{constructor(e){super(d,"choiceList",!0);this.commitOn=(0,o.getStringOption)(e.commitOn,["select","exit"]);this.id=e.id||"";this.open=(0,o.getStringOption)(e.open,["userControl","always","multiSelect","onEntry"]);this.textEntry=(0,o.getInteger)({data:e.textEntry,defaultValue:0,validate:e=>1===e});this.use=e.use||"";this.usehref=e.usehref||"";this.border=null;this.extras=null;this.margin=null}[r.$toHTML](e){const t=(0,s.toStyle)(this,"border","margin"),a=this[r.$getParent]()[r.$getParent](),n={fontSize:`calc(${a.font&&a.font.size||10}px * var(--scale-factor))`},i=[];if(a.items.children.length>0){const e=a.items;let t=0,s=0;if(2===e.children.length){t=e.children[0].save;s=1-t}const o=e.children[t][r.$toHTML]().html,c=e.children[s][r.$toHTML]().html;let l=!1;const h=a.value&&a.value[r.$text]()||"";for(let e=0,t=o.length;e<t;e++){const t={name:"option",attributes:{value:c[e]||o[e],style:n},value:o[e]};c[e]===h&&(t.attributes.selected=l=!0);i.push(t)}l||i.splice(0,0,{name:"option",attributes:{hidden:!0,selected:!0},value:" "})}const c={class:["xfaSelect"],fieldId:a[r.$uid],dataId:a[r.$data]&&a[r.$data][r.$uid]||a[r.$uid],style:t,"aria-label":ariaLabel(a),"aria-required":!1};if(isRequired(a)){c["aria-required"]=!0;c.required=!0}"multiSelect"===this.open&&(c.multiple=!0);return o.HTMLResult.success({name:"label",attributes:{class:["xfaLabel"]},children:[{name:"select",children:i,attributes:c}]})}}class Color extends r.XFAObject{constructor(e){super(d,"color",!0);this.cSpace=(0,o.getStringOption)(e.cSpace,["SRGB"]);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.value=e.value?(0,o.getColor)(e.value):"";this.extras=null}[r.$hasSettableValue](){return!1}[r.$toStyle](){return this.value?c.Util.makeHexColor(this.value.r,this.value.g,this.value.b):null}}class Comb extends r.XFAObject{constructor(e){super(d,"comb");this.id=e.id||"";this.numberOfCells=(0,o.getInteger)({data:e.numberOfCells,defaultValue:0,validate:e=>e>=0});this.use=e.use||"";this.usehref=e.usehref||""}}class Connect extends r.XFAObject{constructor(e){super(d,"connect",!0);this.connection=e.connection||"";this.id=e.id||"";this.ref=e.ref||"";this.usage=(0,o.getStringOption)(e.usage,["exportAndImport","exportOnly","importOnly"]);this.use=e.use||"";this.usehref=e.usehref||"";this.picture=null}}class ContentArea extends r.XFAObject{constructor(e){super(d,"contentArea",!0);this.h=(0,o.getMeasurement)(e.h);this.id=e.id||"";this.name=e.name||"";this.relevant=(0,o.getRelevant)(e.relevant);this.use=e.use||"";this.usehref=e.usehref||"";this.w=(0,o.getMeasurement)(e.w);this.x=(0,o.getMeasurement)(e.x,"0pt");this.y=(0,o.getMeasurement)(e.y,"0pt");this.desc=null;this.extras=null}[r.$toHTML](e){const t={left:(0,s.measureToString)(this.x),top:(0,s.measureToString)(this.y),width:(0,s.measureToString)(this.w),height:(0,s.measureToString)(this.h)},a=["xfaContentarea"];(0,s.isPrintOnly)(this)&&a.push("xfaPrintOnly");return o.HTMLResult.success({name:"div",children:[],attributes:{style:t,class:a,id:this[r.$uid]}})}}class Corner extends r.XFAObject{constructor(e){super(d,"corner",!0);this.id=e.id||"";this.inverted=(0,o.getInteger)({data:e.inverted,defaultValue:0,validate:e=>1===e});this.join=(0,o.getStringOption)(e.join,["square","round"]);this.presence=(0,o.getStringOption)(e.presence,["visible","hidden","inactive","invisible"]);this.radius=(0,o.getMeasurement)(e.radius);this.stroke=(0,o.getStringOption)(e.stroke,["solid","dashDot","dashDotDot","dashed","dotted","embossed","etched","lowered","raised"]);this.thickness=(0,o.getMeasurement)(e.thickness,"0.5pt");this.use=e.use||"";this.usehref=e.usehref||"";this.color=null;this.extras=null}[r.$toStyle](){const e=(0,s.toStyle)(this,"visibility");e.radius=(0,s.measureToString)("square"===this.join?0:this.radius);return e}}class DateElement extends r.ContentObject{constructor(e){super(d,"date");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}[r.$finalize](){const e=this[r.$content].trim();this[r.$content]=e?new Date(e):null}[r.$toHTML](e){return valueToHtml(this[r.$content]?this[r.$content].toString():"")}}class DateTime extends r.ContentObject{constructor(e){super(d,"dateTime");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}[r.$finalize](){const e=this[r.$content].trim();this[r.$content]=e?new Date(e):null}[r.$toHTML](e){return valueToHtml(this[r.$content]?this[r.$content].toString():"")}}class DateTimeEdit extends r.XFAObject{constructor(e){super(d,"dateTimeEdit",!0);this.hScrollPolicy=(0,o.getStringOption)(e.hScrollPolicy,["auto","off","on"]);this.id=e.id||"";this.picker=(0,o.getStringOption)(e.picker,["host","none"]);this.use=e.use||"";this.usehref=e.usehref||"";this.border=null;this.comb=null;this.extras=null;this.margin=null}[r.$toHTML](e){const t=(0,s.toStyle)(this,"border","font","margin"),a=this[r.$getParent]()[r.$getParent](),n={name:"input",attributes:{type:"text",fieldId:a[r.$uid],dataId:a[r.$data]&&a[r.$data][r.$uid]||a[r.$uid],class:["xfaTextfield"],style:t,"aria-label":ariaLabel(a),"aria-required":!1}};if(isRequired(a)){n.attributes["aria-required"]=!0;n.attributes.required=!0}return o.HTMLResult.success({name:"label",attributes:{class:["xfaLabel"]},children:[n]})}}class Decimal extends r.ContentObject{constructor(e){super(d,"decimal");this.fracDigits=(0,o.getInteger)({data:e.fracDigits,defaultValue:2,validate:e=>!0});this.id=e.id||"";this.leadDigits=(0,o.getInteger)({data:e.leadDigits,defaultValue:-1,validate:e=>!0});this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}[r.$finalize](){const e=parseFloat(this[r.$content].trim());this[r.$content]=isNaN(e)?null:e}[r.$toHTML](e){return valueToHtml(null!==this[r.$content]?this[r.$content].toString():"")}}class DefaultUi extends r.XFAObject{constructor(e){super(d,"defaultUi",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null}}class Desc extends r.XFAObject{constructor(e){super(d,"desc",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.boolean=new r.XFAObjectArray;this.date=new r.XFAObjectArray;this.dateTime=new r.XFAObjectArray;this.decimal=new r.XFAObjectArray;this.exData=new r.XFAObjectArray;this.float=new r.XFAObjectArray;this.image=new r.XFAObjectArray;this.integer=new r.XFAObjectArray;this.text=new r.XFAObjectArray;this.time=new r.XFAObjectArray}}class DigestMethod extends r.OptionObject{constructor(e){super(d,"digestMethod",["","SHA1","SHA256","SHA512","RIPEMD160"]);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||""}}class DigestMethods extends r.XFAObject{constructor(e){super(d,"digestMethods",!0);this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.digestMethod=new r.XFAObjectArray}}class Draw extends r.XFAObject{constructor(e){super(d,"draw",!0);this.anchorType=(0,o.getStringOption)(e.anchorType,["topLeft","bottomCenter","bottomLeft","bottomRight","middleCenter","middleLeft","middleRight","topCenter","topRight"]);this.colSpan=(0,o.getInteger)({data:e.colSpan,defaultValue:1,validate:e=>e>=1||-1===e});this.h=e.h?(0,o.getMeasurement)(e.h):"";this.hAlign=(0,o.getStringOption)(e.hAlign,["left","center","justify","justifyAll","radix","right"]);this.id=e.id||"";this.locale=e.locale||"";this.maxH=(0,o.getMeasurement)(e.maxH,"0pt");this.maxW=(0,o.getMeasurement)(e.maxW,"0pt");this.minH=(0,o.getMeasurement)(e.minH,"0pt");this.minW=(0,o.getMeasurement)(e.minW,"0pt");this.name=e.name||"";this.presence=(0,o.getStringOption)(e.presence,["visible","hidden","inactive","invisible"]);this.relevant=(0,o.getRelevant)(e.relevant);this.rotate=(0,o.getInteger)({data:e.rotate,defaultValue:0,validate:e=>e%90==0});this.use=e.use||"";this.usehref=e.usehref||"";this.w=e.w?(0,o.getMeasurement)(e.w):"";this.x=(0,o.getMeasurement)(e.x,"0pt");this.y=(0,o.getMeasurement)(e.y,"0pt");this.assist=null;this.border=null;this.caption=null;this.desc=null;this.extras=null;this.font=null;this.keep=null;this.margin=null;this.para=null;this.traversal=null;this.ui=null;this.value=null;this.setProperty=new r.XFAObjectArray}[r.$setValue](e){_setValue(this,e)}[r.$toHTML](e){setTabIndex(this);if("hidden"===this.presence||"inactive"===this.presence)return o.HTMLResult.EMPTY;(0,s.fixDimensions)(this);this[r.$pushPara]();const t=this.w,a=this.h,{w:n,h:c,isBroken:l}=(0,s.layoutNode)(this,e);if(n&&""===this.w){if(l&&this[r.$getSubformParent]()[r.$isThereMoreWidth]()){this[r.$popPara]();return o.HTMLResult.FAILURE}this.w=n}c&&""===this.h&&(this.h=c);setFirstUnsplittable(this);if(!(0,i.checkDimensions)(this,e)){this.w=t;this.h=a;this[r.$popPara]();return o.HTMLResult.FAILURE}unsetFirstUnsplittable(this);const h=(0,s.toStyle)(this,"font","hAlign","dimensions","position","presence","rotate","anchorType","border","margin");(0,s.setMinMaxDimensions)(this,h);if(h.margin){h.padding=h.margin;delete h.margin}const u=["xfaDraw"];this.font&&u.push("xfaFont");(0,s.isPrintOnly)(this)&&u.push("xfaPrintOnly");const d={style:h,id:this[r.$uid],class:u};this.name&&(d.xfaName=this.name);const f={name:"div",attributes:d,children:[]};applyAssist(this,d);const g=(0,s.computeBbox)(this,f,e),p=this.value?this.value[r.$toHTML](e).html:null;if(null===p){this.w=t;this.h=a;this[r.$popPara]();return o.HTMLResult.success((0,s.createWrapper)(this,f),g)}f.children.push(p);(0,s.setPara)(this,h,p);this.w=t;this.h=a;this[r.$popPara]();return o.HTMLResult.success((0,s.createWrapper)(this,f),g)}}class Edge extends r.XFAObject{constructor(e){super(d,"edge",!0);this.cap=(0,o.getStringOption)(e.cap,["square","butt","round"]);this.id=e.id||"";this.presence=(0,o.getStringOption)(e.presence,["visible","hidden","inactive","invisible"]);this.stroke=(0,o.getStringOption)(e.stroke,["solid","dashDot","dashDotDot","dashed","dotted","embossed","etched","lowered","raised"]);this.thickness=(0,o.getMeasurement)(e.thickness,"0.5pt");this.use=e.use||"";this.usehref=e.usehref||"";this.color=null;this.extras=null}[r.$toStyle](){const e=(0,s.toStyle)(this,"visibility");Object.assign(e,{linecap:this.cap,width:(0,s.measureToString)(this.thickness),color:this.color?this.color[r.$toStyle]():"#000000",style:""});if("visible"!==this.presence)e.style="none";else switch(this.stroke){case"solid":e.style="solid";break;case"dashDot":case"dashDotDot":case"dashed":e.style="dashed";break;case"dotted":e.style="dotted";break;case"embossed":e.style="ridge";break;case"etched":e.style="groove";break;case"lowered":e.style="inset";break;case"raised":e.style="outset"}return e}}class Encoding extends r.OptionObject{constructor(e){super(d,"encoding",["adbe.x509.rsa_sha1","adbe.pkcs7.detached","adbe.pkcs7.sha1"]);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Encodings extends r.XFAObject{constructor(e){super(d,"encodings",!0);this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.encoding=new r.XFAObjectArray}}class Encrypt extends r.XFAObject{constructor(e){super(d,"encrypt",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.certificate=null}}class EncryptData extends r.XFAObject{constructor(e){super(d,"encryptData",!0);this.id=e.id||"";this.operation=(0,o.getStringOption)(e.operation,["encrypt","decrypt"]);this.target=e.target||"";this.use=e.use||"";this.usehref=e.usehref||"";this.filter=null;this.manifest=null}}class Encryption extends r.XFAObject{constructor(e){super(d,"encryption",!0);this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.certificate=new r.XFAObjectArray}}class EncryptionMethod extends r.OptionObject{constructor(e){super(d,"encryptionMethod",["","AES256-CBC","TRIPLEDES-CBC","AES128-CBC","AES192-CBC"]);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||""}}class EncryptionMethods extends r.XFAObject{constructor(e){super(d,"encryptionMethods",!0);this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.encryptionMethod=new r.XFAObjectArray}}class Event extends r.XFAObject{constructor(e){super(d,"event",!0);this.activity=(0,o.getStringOption)(e.activity,["click","change","docClose","docReady","enter","exit","full","indexChange","initialize","mouseDown","mouseEnter","mouseExit","mouseUp","postExecute","postOpen","postPrint","postSave","postSign","postSubmit","preExecute","preOpen","prePrint","preSave","preSign","preSubmit","ready","validationState"]);this.id=e.id||"";this.listen=(0,o.getStringOption)(e.listen,["refOnly","refAndDescendents"]);this.name=e.name||"";this.ref=e.ref||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.encryptData=null;this.execute=null;this.script=null;this.signData=null;this.submit=null}}class ExData extends r.ContentObject{constructor(e){super(d,"exData");this.contentType=e.contentType||"";this.href=e.href||"";this.id=e.id||"";this.maxLength=(0,o.getInteger)({data:e.maxLength,defaultValue:-1,validate:e=>e>=-1});this.name=e.name||"";this.rid=e.rid||"";this.transferEncoding=(0,o.getStringOption)(e.transferEncoding,["none","base64","package"]);this.use=e.use||"";this.usehref=e.usehref||""}[r.$isCDATAXml](){return"text/html"===this.contentType}[r.$onChild](e){if("text/html"===this.contentType&&e[r.$namespaceId]===n.NamespaceIds.xhtml.id){this[r.$content]=e;return!0}if("text/xml"===this.contentType){this[r.$content]=e;return!0}return!1}[r.$toHTML](e){return"text/html"===this.contentType&&this[r.$content]?this[r.$content][r.$toHTML](e):o.HTMLResult.EMPTY}}class ExObject extends r.XFAObject{constructor(e){super(d,"exObject",!0);this.archive=e.archive||"";this.classId=e.classId||"";this.codeBase=e.codeBase||"";this.codeType=e.codeType||"";this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.boolean=new r.XFAObjectArray;this.date=new r.XFAObjectArray;this.dateTime=new r.XFAObjectArray;this.decimal=new r.XFAObjectArray;this.exData=new r.XFAObjectArray;this.exObject=new r.XFAObjectArray;this.float=new r.XFAObjectArray;this.image=new r.XFAObjectArray;this.integer=new r.XFAObjectArray;this.text=new r.XFAObjectArray;this.time=new r.XFAObjectArray}}class ExclGroup extends r.XFAObject{constructor(e){super(d,"exclGroup",!0);this.access=(0,o.getStringOption)(e.access,["open","nonInteractive","protected","readOnly"]);this.accessKey=e.accessKey||"";this.anchorType=(0,o.getStringOption)(e.anchorType,["topLeft","bottomCenter","bottomLeft","bottomRight","middleCenter","middleLeft","middleRight","topCenter","topRight"]);this.colSpan=(0,o.getInteger)({data:e.colSpan,defaultValue:1,validate:e=>e>=1||-1===e});this.h=e.h?(0,o.getMeasurement)(e.h):"";this.hAlign=(0,o.getStringOption)(e.hAlign,["left","center","justify","justifyAll","radix","right"]);this.id=e.id||"";this.layout=(0,o.getStringOption)(e.layout,["position","lr-tb","rl-row","rl-tb","row","table","tb"]);this.maxH=(0,o.getMeasurement)(e.maxH,"0pt");this.maxW=(0,o.getMeasurement)(e.maxW,"0pt");this.minH=(0,o.getMeasurement)(e.minH,"0pt");this.minW=(0,o.getMeasurement)(e.minW,"0pt");this.name=e.name||"";this.presence=(0,o.getStringOption)(e.presence,["visible","hidden","inactive","invisible"]);this.relevant=(0,o.getRelevant)(e.relevant);this.use=e.use||"";this.usehref=e.usehref||"";this.w=e.w?(0,o.getMeasurement)(e.w):"";this.x=(0,o.getMeasurement)(e.x,"0pt");this.y=(0,o.getMeasurement)(e.y,"0pt");this.assist=null;this.bind=null;this.border=null;this.calculate=null;this.caption=null;this.desc=null;this.extras=null;this.margin=null;this.para=null;this.traversal=null;this.validate=null;this.connect=new r.XFAObjectArray;this.event=new r.XFAObjectArray;this.field=new r.XFAObjectArray;this.setProperty=new r.XFAObjectArray}[r.$isBindable](){return!0}[r.$hasSettableValue](){return!0}[r.$setValue](e){for(const t of this.field.children){if(!t.value){const e=new Value({});t[r.$appendChild](e);t.value=e}t.value[r.$setValue](e)}}[r.$isThereMoreWidth](){return this.layout.endsWith("-tb")&&0===this[r.$extra].attempt&&this[r.$extra].numberInLine>0||this[r.$getParent]()[r.$isThereMoreWidth]()}[r.$isSplittable](){const e=this[r.$getSubformParent]();if(!e[r.$isSplittable]())return!1;if(void 0!==this[r.$extra]._isSplittable)return this[r.$extra]._isSplittable;if("position"===this.layout||this.layout.includes("row")){this[r.$extra]._isSplittable=!1;return!1}if(e.layout&&e.layout.endsWith("-tb")&&0!==e[r.$extra].numberInLine)return!1;this[r.$extra]._isSplittable=!0;return!0}[r.$flushHTML](){return(0,i.flushHTML)(this)}[r.$addHTML](e,t){(0,i.addHTML)(this,e,t)}[r.$getAvailableSpace](){return(0,i.getAvailableSpace)(this)}[r.$toHTML](e){setTabIndex(this);if("hidden"===this.presence||"inactive"===this.presence||0===this.h||0===this.w)return o.HTMLResult.EMPTY;(0,s.fixDimensions)(this);const t=[],a={id:this[r.$uid],class:[]};(0,s.setAccess)(this,a.class);this[r.$extra]||(this[r.$extra]=Object.create(null));Object.assign(this[r.$extra],{children:t,attributes:a,attempt:0,line:null,numberInLine:0,availableSpace:{width:Math.min(this.w||1/0,e.width),height:Math.min(this.h||1/0,e.height)},width:0,height:0,prevHeight:0,currentWidth:0});const n=this[r.$isSplittable]();n||setFirstUnsplittable(this);if(!(0,i.checkDimensions)(this,e))return o.HTMLResult.FAILURE;const c=new Set(["field"]);if(this.layout.includes("row")){const e=this[r.$getSubformParent]().columnWidths;if(Array.isArray(e)&&e.length>0){this[r.$extra].columnWidths=e;this[r.$extra].currentColumn=0}}const l=(0,s.toStyle)(this,"anchorType","dimensions","position","presence","border","margin","hAlign"),h=["xfaExclgroup"],u=(0,s.layoutClass)(this);u&&h.push(u);(0,s.isPrintOnly)(this)&&h.push("xfaPrintOnly");a.style=l;a.class=h;this.name&&(a.xfaName=this.name);this[r.$pushPara]();const d="lr-tb"===this.layout||"rl-tb"===this.layout,f=d?2:1;for(;this[r.$extra].attempt<f;this[r.$extra].attempt++){d&&1===this[r.$extra].attempt&&(this[r.$extra].numberInLine=0);const e=this[r.$childrenToHTML]({filter:c,include:!0});if(e.success)break;if(e.isBreak()){this[r.$popPara]();return e}if(d&&0===this[r.$extra].attempt&&0===this[r.$extra].numberInLine&&!this[r.$getTemplateRoot]()[r.$extra].noLayoutFailure){this[r.$extra].attempt=f;break}}this[r.$popPara]();n||unsetFirstUnsplittable(this);if(this[r.$extra].attempt===f){n||delete this[r.$extra];return o.HTMLResult.FAILURE}let g=0,p=0;if(this.margin){g=this.margin.leftInset+this.margin.rightInset;p=this.margin.topInset+this.margin.bottomInset}const m=Math.max(this[r.$extra].width+g,this.w||0),b=Math.max(this[r.$extra].height+p,this.h||0),y=[this.x,this.y,m,b];""===this.w&&(l.width=(0,s.measureToString)(m));""===this.h&&(l.height=(0,s.measureToString)(b));const w={name:"div",attributes:a,children:t};applyAssist(this,a);delete this[r.$extra];return o.HTMLResult.success((0,s.createWrapper)(this,w),y)}}class Execute extends r.XFAObject{constructor(e){super(d,"execute");this.connection=e.connection||"";this.executeType=(0,o.getStringOption)(e.executeType,["import","remerge"]);this.id=e.id||"";this.runAt=(0,o.getStringOption)(e.runAt,["client","both","server"]);this.use=e.use||"";this.usehref=e.usehref||""}}class Extras extends r.XFAObject{constructor(e){super(d,"extras",!0);this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||"";this.boolean=new r.XFAObjectArray;this.date=new r.XFAObjectArray;this.dateTime=new r.XFAObjectArray;this.decimal=new r.XFAObjectArray;this.exData=new r.XFAObjectArray;this.extras=new r.XFAObjectArray;this.float=new r.XFAObjectArray;this.image=new r.XFAObjectArray;this.integer=new r.XFAObjectArray;this.text=new r.XFAObjectArray;this.time=new r.XFAObjectArray}}class Field extends r.XFAObject{constructor(e){super(d,"field",!0);this.access=(0,o.getStringOption)(e.access,["open","nonInteractive","protected","readOnly"]);this.accessKey=e.accessKey||"";this.anchorType=(0,o.getStringOption)(e.anchorType,["topLeft","bottomCenter","bottomLeft","bottomRight","middleCenter","middleLeft","middleRight","topCenter","topRight"]);this.colSpan=(0,o.getInteger)({data:e.colSpan,defaultValue:1,validate:e=>e>=1||-1===e});this.h=e.h?(0,o.getMeasurement)(e.h):"";this.hAlign=(0,o.getStringOption)(e.hAlign,["left","center","justify","justifyAll","radix","right"]);this.id=e.id||"";this.locale=e.locale||"";this.maxH=(0,o.getMeasurement)(e.maxH,"0pt");this.maxW=(0,o.getMeasurement)(e.maxW,"0pt");this.minH=(0,o.getMeasurement)(e.minH,"0pt");this.minW=(0,o.getMeasurement)(e.minW,"0pt");this.name=e.name||"";this.presence=(0,o.getStringOption)(e.presence,["visible","hidden","inactive","invisible"]);this.relevant=(0,o.getRelevant)(e.relevant);this.rotate=(0,o.getInteger)({data:e.rotate,defaultValue:0,validate:e=>e%90==0});this.use=e.use||"";this.usehref=e.usehref||"";this.w=e.w?(0,o.getMeasurement)(e.w):"";this.x=(0,o.getMeasurement)(e.x,"0pt");this.y=(0,o.getMeasurement)(e.y,"0pt");this.assist=null;this.bind=null;this.border=null;this.calculate=null;this.caption=null;this.desc=null;this.extras=null;this.font=null;this.format=null;this.items=new r.XFAObjectArray(2);this.keep=null;this.margin=null;this.para=null;this.traversal=null;this.ui=null;this.validate=null;this.value=null;this.bindItems=new r.XFAObjectArray;this.connect=new r.XFAObjectArray;this.event=new r.XFAObjectArray;this.setProperty=new r.XFAObjectArray}[r.$isBindable](){return!0}[r.$setValue](e){_setValue(this,e)}[r.$toHTML](e){setTabIndex(this);if(!this.ui){this.ui=new Ui({});this.ui[r.$globalData]=this[r.$globalData];this[r.$appendChild](this.ui);let e;switch(this.items.children.length){case 0:e=new TextEdit({});this.ui.textEdit=e;break;case 1:e=new CheckButton({});this.ui.checkButton=e;break;case 2:e=new ChoiceList({});this.ui.choiceList=e}this.ui[r.$appendChild](e)}if(!this.ui||"hidden"===this.presence||"inactive"===this.presence||0===this.h||0===this.w)return o.HTMLResult.EMPTY;this.caption&&delete this.caption[r.$extra];this[r.$pushPara]();const t=this.caption?this.caption[r.$toHTML](e).html:null,a=this.w,n=this.h;let c=0,h=0;if(this.margin){c=this.margin.leftInset+this.margin.rightInset;h=this.margin.topInset+this.margin.bottomInset}let u=null;if(""===this.w||""===this.h){let t=null,a=null,n=0,i=0;if(this.ui.checkButton)n=i=this.ui.checkButton.size;else{const{w:t,h:a}=(0,s.layoutNode)(this,e);if(null!==t){n=t;i=a}else i=(0,l.getMetrics)(this.font,!0).lineNoGap}u=getBorderDims(this.ui[r.$getExtra]());n+=u.w;i+=u.h;if(this.caption){const{w:s,h:c,isBroken:l}=this.caption[r.$getExtra](e);if(l&&this[r.$getSubformParent]()[r.$isThereMoreWidth]()){this[r.$popPara]();return o.HTMLResult.FAILURE}t=s;a=c;switch(this.caption.placement){case"left":case"right":case"inline":t+=n;break;case"top":case"bottom":a+=i}}else{t=n;a=i}if(t&&""===this.w){t+=c;this.w=Math.min(this.maxW<=0?1/0:this.maxW,this.minW+1<t?t:this.minW)}if(a&&""===this.h){a+=h;this.h=Math.min(this.maxH<=0?1/0:this.maxH,this.minH+1<a?a:this.minH)}}this[r.$popPara]();(0,s.fixDimensions)(this);setFirstUnsplittable(this);if(!(0,i.checkDimensions)(this,e)){this.w=a;this.h=n;this[r.$popPara]();return o.HTMLResult.FAILURE}unsetFirstUnsplittable(this);const d=(0,s.toStyle)(this,"font","dimensions","position","rotate","anchorType","presence","margin","hAlign");(0,s.setMinMaxDimensions)(this,d);const f=["xfaField"];this.font&&f.push("xfaFont");(0,s.isPrintOnly)(this)&&f.push("xfaPrintOnly");const g={style:d,id:this[r.$uid],class:f};if(d.margin){d.padding=d.margin;delete d.margin}(0,s.setAccess)(this,f);this.name&&(g.xfaName=this.name);const p=[],m={name:"div",attributes:g,children:p};applyAssist(this,g);const b=this.border?this.border[r.$toStyle]():null,y=(0,s.computeBbox)(this,m,e),w=this.ui[r.$toHTML]().html;if(!w){Object.assign(d,b);return o.HTMLResult.success((0,s.createWrapper)(this,m),y)}this[r.$tabIndex]&&(w.children&&w.children[0]?w.children[0].attributes.tabindex=this[r.$tabIndex]:w.attributes.tabindex=this[r.$tabIndex]);w.attributes.style||(w.attributes.style=Object.create(null));let S=null;if(this.ui.button){1===w.children.length&&([S]=w.children.splice(0,1));Object.assign(w.attributes.style,b)}else Object.assign(d,b);p.push(w);if(this.value)if(this.ui.imageEdit)w.children.push(this.value[r.$toHTML]().html);else if(!this.ui.button){let e="";if(this.value.exData)e=this.value.exData[r.$text]();else if(this.value.text)e=this.value.text[r.$getExtra]();else{const t=this.value[r.$toHTML]().html;null!==t&&(e=t.children[0].value)}this.ui.textEdit&&this.value.text&&this.value.text.maxChars&&(w.children[0].attributes.maxLength=this.value.text.maxChars);if(e){if(this.ui.numericEdit){e=parseFloat(e);e=isNaN(e)?"":e.toString()}"textarea"===w.children[0].name?w.children[0].attributes.textContent=e:w.children[0].attributes.value=e}}if(!this.ui.imageEdit&&w.children&&w.children[0]&&this.h){u=u||getBorderDims(this.ui[r.$getExtra]());let t=0;if(this.caption&&["top","bottom"].includes(this.caption.placement)){t=this.caption.reserve;t<=0&&(t=this.caption[r.$getExtra](e).h);const a=this.h-t-h-u.h;w.children[0].attributes.style.height=(0,s.measureToString)(a)}else w.children[0].attributes.style.height="100%"}S&&w.children.push(S);if(!t){w.attributes.class&&w.attributes.class.push("xfaLeft");this.w=a;this.h=n;return o.HTMLResult.success((0,s.createWrapper)(this,m),y)}if(this.ui.button){d.padding&&delete d.padding;"div"===t.name&&(t.name="span");w.children.push(t);return o.HTMLResult.success(m,y)}this.ui.checkButton&&(t.attributes.class[0]="xfaCaptionForCheckButton");w.attributes.class||(w.attributes.class=[]);w.children.splice(0,0,t);switch(this.caption.placement){case"left":case"inline":w.attributes.class.push("xfaLeft");break;case"right":w.attributes.class.push("xfaRight");break;case"top":w.attributes.class.push("xfaTop");break;case"bottom":w.attributes.class.push("xfaBottom")}this.w=a;this.h=n;return o.HTMLResult.success((0,s.createWrapper)(this,m),y)}}t.Field=Field;class Fill extends r.XFAObject{constructor(e){super(d,"fill",!0);this.id=e.id||"";this.presence=(0,o.getStringOption)(e.presence,["visible","hidden","inactive","invisible"]);this.use=e.use||"";this.usehref=e.usehref||"";this.color=null;this.extras=null;this.linear=null;this.pattern=null;this.radial=null;this.solid=null;this.stipple=null}[r.$toStyle](){const e=this[r.$getParent](),t=e[r.$getParent]()[r.$getParent](),a=Object.create(null);let n="color",i=n;if(e instanceof Border){n="background-color";i="background";t instanceof Ui&&(a.backgroundColor="white")}if(e instanceof Rectangle||e instanceof Arc){n=i="fill";a.fill="white"}for(const e of Object.getOwnPropertyNames(this)){if("extras"===e||"color"===e)continue;const t=this[e];if(!(t instanceof r.XFAObject))continue;const s=t[r.$toStyle](this.color);s&&(a[s.startsWith("#")?n:i]=s);return a}if(this.color&&this.color.value){const e=this.color[r.$toStyle]();a[e.startsWith("#")?n:i]=e}return a}}class Filter extends r.XFAObject{constructor(e){super(d,"filter",!0);this.addRevocationInfo=(0,o.getStringOption)(e.addRevocationInfo,["","required","optional","none"]);this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||"";this.version=(0,o.getInteger)({data:this.version,defaultValue:5,validate:e=>e>=1&&e<=5});this.appearanceFilter=null;this.certificates=null;this.digestMethods=null;this.encodings=null;this.encryptionMethods=null;this.handler=null;this.lockDocument=null;this.mdp=null;this.reasons=null;this.timeStamp=null}}class Float extends r.ContentObject{constructor(e){super(d,"float");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}[r.$finalize](){const e=parseFloat(this[r.$content].trim());this[r.$content]=isNaN(e)?null:e}[r.$toHTML](e){return valueToHtml(null!==this[r.$content]?this[r.$content].toString():"")}}class Font extends r.XFAObject{constructor(e){super(d,"font",!0);this.baselineShift=(0,o.getMeasurement)(e.baselineShift);this.fontHorizontalScale=(0,o.getFloat)({data:e.fontHorizontalScale,defaultValue:100,validate:e=>e>=0});this.fontVerticalScale=(0,o.getFloat)({data:e.fontVerticalScale,defaultValue:100,validate:e=>e>=0});this.id=e.id||"";this.kerningMode=(0,o.getStringOption)(e.kerningMode,["none","pair"]);this.letterSpacing=(0,o.getMeasurement)(e.letterSpacing,"0");this.lineThrough=(0,o.getInteger)({data:e.lineThrough,defaultValue:0,validate:e=>1===e||2===e});this.lineThroughPeriod=(0,o.getStringOption)(e.lineThroughPeriod,["all","word"]);this.overline=(0,o.getInteger)({data:e.overline,defaultValue:0,validate:e=>1===e||2===e});this.overlinePeriod=(0,o.getStringOption)(e.overlinePeriod,["all","word"]);this.posture=(0,o.getStringOption)(e.posture,["normal","italic"]);this.size=(0,o.getMeasurement)(e.size,"10pt");this.typeface=e.typeface||"Courier";this.underline=(0,o.getInteger)({data:e.underline,defaultValue:0,validate:e=>1===e||2===e});this.underlinePeriod=(0,o.getStringOption)(e.underlinePeriod,["all","word"]);this.use=e.use||"";this.usehref=e.usehref||"";this.weight=(0,o.getStringOption)(e.weight,["normal","bold"]);this.extras=null;this.fill=null}[r.$clean](e){super[r.$clean](e);this[r.$globalData].usedTypefaces.add(this.typeface)}[r.$toStyle](){const e=(0,s.toStyle)(this,"fill"),t=e.color;if(t)if("#000000"===t)delete e.color;else if(!t.startsWith("#")){e.background=t;e.backgroundClip="text";e.color="transparent"}this.baselineShift&&(e.verticalAlign=(0,s.measureToString)(this.baselineShift));e.fontKerning="none"===this.kerningMode?"none":"normal";e.letterSpacing=(0,s.measureToString)(this.letterSpacing);if(0!==this.lineThrough){e.textDecoration="line-through";2===this.lineThrough&&(e.textDecorationStyle="double")}if(0!==this.overline){e.textDecoration="overline";2===this.overline&&(e.textDecorationStyle="double")}e.fontStyle=this.posture;e.fontSize=(0,s.measureToString)(.99*this.size);(0,s.setFontFamily)(this,this,this[r.$globalData].fontFinder,e);if(0!==this.underline){e.textDecoration="underline";2===this.underline&&(e.textDecorationStyle="double")}e.fontWeight=this.weight;return e}}class Format extends r.XFAObject{constructor(e){super(d,"format",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.picture=null}}class Handler extends r.StringObject{constructor(e){super(d,"handler");this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||""}}class Hyphenation extends r.XFAObject{constructor(e){super(d,"hyphenation");this.excludeAllCaps=(0,o.getInteger)({data:e.excludeAllCaps,defaultValue:0,validate:e=>1===e});this.excludeInitialCap=(0,o.getInteger)({data:e.excludeInitialCap,defaultValue:0,validate:e=>1===e});this.hyphenate=(0,o.getInteger)({data:e.hyphenate,defaultValue:0,validate:e=>1===e});this.id=e.id||"";this.pushCharacterCount=(0,o.getInteger)({data:e.pushCharacterCount,defaultValue:3,validate:e=>e>=0});this.remainCharacterCount=(0,o.getInteger)({data:e.remainCharacterCount,defaultValue:3,validate:e=>e>=0});this.use=e.use||"";this.usehref=e.usehref||"";this.wordCharacterCount=(0,o.getInteger)({data:e.wordCharacterCount,defaultValue:7,validate:e=>e>=0})}}class Image extends r.StringObject{constructor(e){super(d,"image");this.aspect=(0,o.getStringOption)(e.aspect,["fit","actual","height","none","width"]);this.contentType=e.contentType||"";this.href=e.href||"";this.id=e.id||"";this.name=e.name||"";this.transferEncoding=(0,o.getStringOption)(e.transferEncoding,["base64","none","package"]);this.use=e.use||"";this.usehref=e.usehref||""}[r.$toHTML](){if(this.contentType&&!p.has(this.contentType.toLowerCase()))return o.HTMLResult.EMPTY;let e=this[r.$globalData].images&&this[r.$globalData].images.get(this.href);if(!e&&(this.href||!this[r.$content]))return o.HTMLResult.EMPTY;e||"base64"!==this.transferEncoding||(e=(0,c.stringToBytes)(atob(this[r.$content])));if(!e)return o.HTMLResult.EMPTY;if(!this.contentType){for(const[t,a]of m)if(e.length>t.length&&t.every(((t,a)=>t===e[a]))){this.contentType=a;break}if(!this.contentType)return o.HTMLResult.EMPTY}const t=new Blob([e],{type:this.contentType});let a;switch(this.aspect){case"fit":case"actual":break;case"height":a={height:"100%",objectFit:"fill"};break;case"none":a={width:"100%",height:"100%",objectFit:"fill"};break;case"width":a={width:"100%",objectFit:"fill"}}const n=this[r.$getParent]();return o.HTMLResult.success({name:"img",attributes:{class:["xfaImage"],style:a,src:URL.createObjectURL(t),alt:n?ariaLabel(n[r.$getParent]()):null}})}}class ImageEdit extends r.XFAObject{constructor(e){super(d,"imageEdit",!0);this.data=(0,o.getStringOption)(e.data,["link","embed"]);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.border=null;this.extras=null;this.margin=null}[r.$toHTML](e){return"embed"===this.data?o.HTMLResult.success({name:"div",children:[],attributes:{}}):o.HTMLResult.EMPTY}}class Integer extends r.ContentObject{constructor(e){super(d,"integer");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}[r.$finalize](){const e=parseInt(this[r.$content].trim(),10);this[r.$content]=isNaN(e)?null:e}[r.$toHTML](e){return valueToHtml(null!==this[r.$content]?this[r.$content].toString():"")}}class Issuers extends r.XFAObject{constructor(e){super(d,"issuers",!0);this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.certificate=new r.XFAObjectArray}}class Items extends r.XFAObject{constructor(e){super(d,"items",!0);this.id=e.id||"";this.name=e.name||"";this.presence=(0,o.getStringOption)(e.presence,["visible","hidden","inactive","invisible"]);this.ref=e.ref||"";this.save=(0,o.getInteger)({data:e.save,defaultValue:0,validate:e=>1===e});this.use=e.use||"";this.usehref=e.usehref||"";this.boolean=new r.XFAObjectArray;this.date=new r.XFAObjectArray;this.dateTime=new r.XFAObjectArray;this.decimal=new r.XFAObjectArray;this.exData=new r.XFAObjectArray;this.float=new r.XFAObjectArray;this.image=new r.XFAObjectArray;this.integer=new r.XFAObjectArray;this.text=new r.XFAObjectArray;this.time=new r.XFAObjectArray}[r.$toHTML](){const e=[];for(const t of this[r.$getChildren]())e.push(t[r.$text]());return o.HTMLResult.success(e)}}t.Items=Items;class Keep extends r.XFAObject{constructor(e){super(d,"keep",!0);this.id=e.id||"";const t=["none","contentArea","pageArea"];this.intact=(0,o.getStringOption)(e.intact,t);this.next=(0,o.getStringOption)(e.next,t);this.previous=(0,o.getStringOption)(e.previous,t);this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null}}class KeyUsage extends r.XFAObject{constructor(e){super(d,"keyUsage");const t=["","yes","no"];this.crlSign=(0,o.getStringOption)(e.crlSign,t);this.dataEncipherment=(0,o.getStringOption)(e.dataEncipherment,t);this.decipherOnly=(0,o.getStringOption)(e.decipherOnly,t);this.digitalSignature=(0,o.getStringOption)(e.digitalSignature,t);this.encipherOnly=(0,o.getStringOption)(e.encipherOnly,t);this.id=e.id||"";this.keyAgreement=(0,o.getStringOption)(e.keyAgreement,t);this.keyCertSign=(0,o.getStringOption)(e.keyCertSign,t);this.keyEncipherment=(0,o.getStringOption)(e.keyEncipherment,t);this.nonRepudiation=(0,o.getStringOption)(e.nonRepudiation,t);this.type=(0,o.getStringOption)(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||""}}class Line extends r.XFAObject{constructor(e){super(d,"line",!0);this.hand=(0,o.getStringOption)(e.hand,["even","left","right"]);this.id=e.id||"";this.slope=(0,o.getStringOption)(e.slope,["\\","/"]);this.use=e.use||"";this.usehref=e.usehref||"";this.edge=null}[r.$toHTML](){const e=this[r.$getParent]()[r.$getParent](),t=this.edge||new Edge({}),a=t[r.$toStyle](),n=Object.create(null),i="visible"===t.presence?t.thickness:0;n.strokeWidth=(0,s.measureToString)(i);n.stroke=a.color;let c,l,h,u,d="100%",g="100%";if(e.w<=i){[c,l,h,u]=["50%",0,"50%","100%"];d=n.strokeWidth}else if(e.h<=i){[c,l,h,u]=[0,"50%","100%","50%"];g=n.strokeWidth}else"\\"===this.slope?[c,l,h,u]=[0,0,"100%","100%"]:[c,l,h,u]=[0,"100%","100%",0];const p={name:"svg",children:[{name:"line",attributes:{xmlns:f,x1:c,y1:l,x2:h,y2:u,style:n}}],attributes:{xmlns:f,width:d,height:g,style:{overflow:"visible"}}};if(hasMargin(e))return o.HTMLResult.success({name:"div",attributes:{style:{display:"inline",width:"100%",height:"100%"}},children:[p]});p.attributes.style.position="absolute";return o.HTMLResult.success(p)}}class Linear extends r.XFAObject{constructor(e){super(d,"linear",!0);this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["toRight","toBottom","toLeft","toTop"]);this.use=e.use||"";this.usehref=e.usehref||"";this.color=null;this.extras=null}[r.$toStyle](e){e=e?e[r.$toStyle]():"#FFFFFF";return`linear-gradient(${this.type.replace(/([RBLT])/," $1").toLowerCase()}, ${e}, ${this.color?this.color[r.$toStyle]():"#000000"})`}}class LockDocument extends r.ContentObject{constructor(e){super(d,"lockDocument");this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||""}[r.$finalize](){this[r.$content]=(0,o.getStringOption)(this[r.$content],["auto","0","1"])}}class Manifest extends r.XFAObject{constructor(e){super(d,"manifest",!0);this.action=(0,o.getStringOption)(e.action,["include","all","exclude"]);this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.ref=new r.XFAObjectArray}}class Margin extends r.XFAObject{constructor(e){super(d,"margin",!0);this.bottomInset=(0,o.getMeasurement)(e.bottomInset,"0");this.id=e.id||"";this.leftInset=(0,o.getMeasurement)(e.leftInset,"0");this.rightInset=(0,o.getMeasurement)(e.rightInset,"0");this.topInset=(0,o.getMeasurement)(e.topInset,"0");this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null}[r.$toStyle](){return{margin:(0,s.measureToString)(this.topInset)+" "+(0,s.measureToString)(this.rightInset)+" "+(0,s.measureToString)(this.bottomInset)+" "+(0,s.measureToString)(this.leftInset)}}}class Mdp extends r.XFAObject{constructor(e){super(d,"mdp");this.id=e.id||"";this.permissions=(0,o.getInteger)({data:e.permissions,defaultValue:2,validate:e=>1===e||3===e});this.signatureType=(0,o.getStringOption)(e.signatureType,["filler","author"]);this.use=e.use||"";this.usehref=e.usehref||""}}class Medium extends r.XFAObject{constructor(e){super(d,"medium");this.id=e.id||"";this.imagingBBox=(0,o.getBBox)(e.imagingBBox);this.long=(0,o.getMeasurement)(e.long);this.orientation=(0,o.getStringOption)(e.orientation,["portrait","landscape"]);this.short=(0,o.getMeasurement)(e.short);this.stock=e.stock||"";this.trayIn=(0,o.getStringOption)(e.trayIn,["auto","delegate","pageFront"]);this.trayOut=(0,o.getStringOption)(e.trayOut,["auto","delegate"]);this.use=e.use||"";this.usehref=e.usehref||""}}class Message extends r.XFAObject{constructor(e){super(d,"message",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.text=new r.XFAObjectArray}}class NumericEdit extends r.XFAObject{constructor(e){super(d,"numericEdit",!0);this.hScrollPolicy=(0,o.getStringOption)(e.hScrollPolicy,["auto","off","on"]);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.border=null;this.comb=null;this.extras=null;this.margin=null}[r.$toHTML](e){const t=(0,s.toStyle)(this,"border","font","margin"),a=this[r.$getParent]()[r.$getParent](),n={name:"input",attributes:{type:"text",fieldId:a[r.$uid],dataId:a[r.$data]&&a[r.$data][r.$uid]||a[r.$uid],class:["xfaTextfield"],style:t,"aria-label":ariaLabel(a),"aria-required":!1}};if(isRequired(a)){n.attributes["aria-required"]=!0;n.attributes.required=!0}return o.HTMLResult.success({name:"label",attributes:{class:["xfaLabel"]},children:[n]})}}class Occur extends r.XFAObject{constructor(e){super(d,"occur",!0);this.id=e.id||"";this.initial=""!==e.initial?(0,o.getInteger)({data:e.initial,defaultValue:"",validate:e=>!0}):"";this.max=""!==e.max?(0,o.getInteger)({data:e.max,defaultValue:1,validate:e=>!0}):"";this.min=""!==e.min?(0,o.getInteger)({data:e.min,defaultValue:1,validate:e=>!0}):"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null}[r.$clean](){const e=this[r.$getParent](),t=this.min;""===this.min&&(this.min=e instanceof PageArea||e instanceof PageSet?0:1);""===this.max&&(this.max=""===t?e instanceof PageArea||e instanceof PageSet?-1:1:this.min);-1!==this.max&&this.max<this.min&&(this.max=this.min);""===this.initial&&(this.initial=e instanceof Template?1:this.min)}}class Oid extends r.StringObject{constructor(e){super(d,"oid");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Oids extends r.XFAObject{constructor(e){super(d,"oids",!0);this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.oid=new r.XFAObjectArray}}class Overflow extends r.XFAObject{constructor(e){super(d,"overflow");this.id=e.id||"";this.leader=e.leader||"";this.target=e.target||"";this.trailer=e.trailer||"";this.use=e.use||"";this.usehref=e.usehref||""}[r.$getExtra](){if(!this[r.$extra]){const e=this[r.$getParent](),t=this[r.$getTemplateRoot](),a=t[r.$searchNode](this.target,e),n=t[r.$searchNode](this.leader,e),i=t[r.$searchNode](this.trailer,e);this[r.$extra]={target:a&&a[0]||null,leader:n&&n[0]||null,trailer:i&&i[0]||null,addLeader:!1,addTrailer:!1}}return this[r.$extra]}}class PageArea extends r.XFAObject{constructor(e){super(d,"pageArea",!0);this.blankOrNotBlank=(0,o.getStringOption)(e.blankOrNotBlank,["any","blank","notBlank"]);this.id=e.id||"";this.initialNumber=(0,o.getInteger)({data:e.initialNumber,defaultValue:1,validate:e=>!0});this.name=e.name||"";this.numbered=(0,o.getInteger)({data:e.numbered,defaultValue:1,validate:e=>!0});this.oddOrEven=(0,o.getStringOption)(e.oddOrEven,["any","even","odd"]);this.pagePosition=(0,o.getStringOption)(e.pagePosition,["any","first","last","only","rest"]);this.relevant=(0,o.getRelevant)(e.relevant);this.use=e.use||"";this.usehref=e.usehref||"";this.desc=null;this.extras=null;this.medium=null;this.occur=null;this.area=new r.XFAObjectArray;this.contentArea=new r.XFAObjectArray;this.draw=new r.XFAObjectArray;this.exclGroup=new r.XFAObjectArray;this.field=new r.XFAObjectArray;this.subform=new r.XFAObjectArray}[r.$isUsable](){if(!this[r.$extra]){this[r.$extra]={numberOfUse:0};return!0}return!this.occur||-1===this.occur.max||this[r.$extra].numberOfUse<this.occur.max}[r.$cleanPage](){delete this[r.$extra]}[r.$getNextPage](){this[r.$extra]||(this[r.$extra]={numberOfUse:0});const e=this[r.$getParent]();if("orderedOccurrence"===e.relation&&this[r.$isUsable]()){this[r.$extra].numberOfUse+=1;return this}return e[r.$getNextPage]()}[r.$getAvailableSpace](){return this[r.$extra].space||{width:0,height:0}}[r.$toHTML](){this[r.$extra]||(this[r.$extra]={numberOfUse:1});const e=[];this[r.$extra].children=e;const t=Object.create(null);if(this.medium&&this.medium.short&&this.medium.long){t.width=(0,s.measureToString)(this.medium.short);t.height=(0,s.measureToString)(this.medium.long);this[r.$extra].space={width:this.medium.short,height:this.medium.long};if("landscape"===this.medium.orientation){const e=t.width;t.width=t.height;t.height=e;this[r.$extra].space={width:this.medium.long,height:this.medium.short}}}else(0,c.warn)("XFA - No medium specified in pageArea: please file a bug.");this[r.$childrenToHTML]({filter:new Set(["area","draw","field","subform"]),include:!0});this[r.$childrenToHTML]({filter:new Set(["contentArea"]),include:!0});return o.HTMLResult.success({name:"div",children:e,attributes:{class:["xfaPage"],id:this[r.$uid],style:t,xfaName:this.name}})}}class PageSet extends r.XFAObject{constructor(e){super(d,"pageSet",!0);this.duplexImposition=(0,o.getStringOption)(e.duplexImposition,["longEdge","shortEdge"]);this.id=e.id||"";this.name=e.name||"";this.relation=(0,o.getStringOption)(e.relation,["orderedOccurrence","duplexPaginated","simplexPaginated"]);this.relevant=(0,o.getRelevant)(e.relevant);this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.occur=null;this.pageArea=new r.XFAObjectArray;this.pageSet=new r.XFAObjectArray}[r.$cleanPage](){for(const e of this.pageArea.children)e[r.$cleanPage]();for(const e of this.pageSet.children)e[r.$cleanPage]()}[r.$isUsable](){return!this.occur||-1===this.occur.max||this[r.$extra].numberOfUse<this.occur.max}[r.$getNextPage](){this[r.$extra]||(this[r.$extra]={numberOfUse:1,pageIndex:-1,pageSetIndex:-1});if("orderedOccurrence"===this.relation){if(this[r.$extra].pageIndex+1<this.pageArea.children.length){this[r.$extra].pageIndex+=1;return this.pageArea.children[this[r.$extra].pageIndex][r.$getNextPage]()}if(this[r.$extra].pageSetIndex+1<this.pageSet.children.length){this[r.$extra].pageSetIndex+=1;return this.pageSet.children[this[r.$extra].pageSetIndex][r.$getNextPage]()}if(this[r.$isUsable]()){this[r.$extra].numberOfUse+=1;this[r.$extra].pageIndex=-1;this[r.$extra].pageSetIndex=-1;return this[r.$getNextPage]()}const e=this[r.$getParent]();if(e instanceof PageSet)return e[r.$getNextPage]();this[r.$cleanPage]();return this[r.$getNextPage]()}const e=this[r.$getTemplateRoot]()[r.$extra].pageNumber,t=e%2==0?"even":"odd",a=0===e?"first":"rest";let n=this.pageArea.children.find((e=>e.oddOrEven===t&&e.pagePosition===a));if(n)return n;n=this.pageArea.children.find((e=>"any"===e.oddOrEven&&e.pagePosition===a));if(n)return n;n=this.pageArea.children.find((e=>"any"===e.oddOrEven&&"any"===e.pagePosition));return n||this.pageArea.children[0]}}class Para extends r.XFAObject{constructor(e){super(d,"para",!0);this.hAlign=(0,o.getStringOption)(e.hAlign,["left","center","justify","justifyAll","radix","right"]);this.id=e.id||"";this.lineHeight=e.lineHeight?(0,o.getMeasurement)(e.lineHeight,"0pt"):"";this.marginLeft=e.marginLeft?(0,o.getMeasurement)(e.marginLeft,"0pt"):"";this.marginRight=e.marginRight?(0,o.getMeasurement)(e.marginRight,"0pt"):"";this.orphans=(0,o.getInteger)({data:e.orphans,defaultValue:0,validate:e=>e>=0});this.preserve=e.preserve||"";this.radixOffset=e.radixOffset?(0,o.getMeasurement)(e.radixOffset,"0pt"):"";this.spaceAbove=e.spaceAbove?(0,o.getMeasurement)(e.spaceAbove,"0pt"):"";this.spaceBelow=e.spaceBelow?(0,o.getMeasurement)(e.spaceBelow,"0pt"):"";this.tabDefault=e.tabDefault?(0,o.getMeasurement)(this.tabDefault):"";this.tabStops=(e.tabStops||"").trim().split(/\s+/).map(((e,t)=>t%2==1?(0,o.getMeasurement)(e):e));this.textIndent=e.textIndent?(0,o.getMeasurement)(e.textIndent,"0pt"):"";this.use=e.use||"";this.usehref=e.usehref||"";this.vAlign=(0,o.getStringOption)(e.vAlign,["top","bottom","middle"]);this.widows=(0,o.getInteger)({data:e.widows,defaultValue:0,validate:e=>e>=0});this.hyphenation=null}[r.$toStyle](){const e=(0,s.toStyle)(this,"hAlign");""!==this.marginLeft&&(e.paddingLeft=(0,s.measureToString)(this.marginLeft));""!==this.marginRight&&(e.paddingight=(0,s.measureToString)(this.marginRight));""!==this.spaceAbove&&(e.paddingTop=(0,s.measureToString)(this.spaceAbove));""!==this.spaceBelow&&(e.paddingBottom=(0,s.measureToString)(this.spaceBelow));if(""!==this.textIndent){e.textIndent=(0,s.measureToString)(this.textIndent);(0,s.fixTextIndent)(e)}this.lineHeight>0&&(e.lineHeight=(0,s.measureToString)(this.lineHeight));""!==this.tabDefault&&(e.tabSize=(0,s.measureToString)(this.tabDefault));this.tabStops.length;this.hyphenatation&&Object.assign(e,this.hyphenatation[r.$toStyle]());return e}}class PasswordEdit extends r.XFAObject{constructor(e){super(d,"passwordEdit",!0);this.hScrollPolicy=(0,o.getStringOption)(e.hScrollPolicy,["auto","off","on"]);this.id=e.id||"";this.passwordChar=e.passwordChar||"*";this.use=e.use||"";this.usehref=e.usehref||"";this.border=null;this.extras=null;this.margin=null}}class Pattern extends r.XFAObject{constructor(e){super(d,"pattern",!0);this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["crossHatch","crossDiagonal","diagonalLeft","diagonalRight","horizontal","vertical"]);this.use=e.use||"";this.usehref=e.usehref||"";this.color=null;this.extras=null}[r.$toStyle](e){e=e?e[r.$toStyle]():"#FFFFFF";const t=this.color?this.color[r.$toStyle]():"#000000",a="repeating-linear-gradient",n=`${e},${e} 5px,${t} 5px,${t} 10px`;switch(this.type){case"crossHatch":return`${a}(to top,${n}) ${a}(to right,${n})`;case"crossDiagonal":return`${a}(45deg,${n}) ${a}(-45deg,${n})`;case"diagonalLeft":return`${a}(45deg,${n})`;case"diagonalRight":return`${a}(-45deg,${n})`;case"horizontal":return`${a}(to top,${n})`;case"vertical":return`${a}(to right,${n})`}return""}}class Picture extends r.StringObject{constructor(e){super(d,"picture");this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Proto extends r.XFAObject{constructor(e){super(d,"proto",!0);this.appearanceFilter=new r.XFAObjectArray;this.arc=new r.XFAObjectArray;this.area=new r.XFAObjectArray;this.assist=new r.XFAObjectArray;this.barcode=new r.XFAObjectArray;this.bindItems=new r.XFAObjectArray;this.bookend=new r.XFAObjectArray;this.boolean=new r.XFAObjectArray;this.border=new r.XFAObjectArray;this.break=new r.XFAObjectArray;this.breakAfter=new r.XFAObjectArray;this.breakBefore=new r.XFAObjectArray;this.button=new r.XFAObjectArray;this.calculate=new r.XFAObjectArray;this.caption=new r.XFAObjectArray;this.certificate=new r.XFAObjectArray;this.certificates=new r.XFAObjectArray;this.checkButton=new r.XFAObjectArray;this.choiceList=new r.XFAObjectArray;this.color=new r.XFAObjectArray;this.comb=new r.XFAObjectArray;this.connect=new r.XFAObjectArray;this.contentArea=new r.XFAObjectArray;this.corner=new r.XFAObjectArray;this.date=new r.XFAObjectArray;this.dateTime=new r.XFAObjectArray;this.dateTimeEdit=new r.XFAObjectArray;this.decimal=new r.XFAObjectArray;this.defaultUi=new r.XFAObjectArray;this.desc=new r.XFAObjectArray;this.digestMethod=new r.XFAObjectArray;this.digestMethods=new r.XFAObjectArray;this.draw=new r.XFAObjectArray;this.edge=new r.XFAObjectArray;this.encoding=new r.XFAObjectArray;this.encodings=new r.XFAObjectArray;this.encrypt=new r.XFAObjectArray;this.encryptData=new r.XFAObjectArray;this.encryption=new r.XFAObjectArray;this.encryptionMethod=new r.XFAObjectArray;this.encryptionMethods=new r.XFAObjectArray;this.event=new r.XFAObjectArray;this.exData=new r.XFAObjectArray;this.exObject=new r.XFAObjectArray;this.exclGroup=new r.XFAObjectArray;this.execute=new r.XFAObjectArray;this.extras=new r.XFAObjectArray;this.field=new r.XFAObjectArray;this.fill=new r.XFAObjectArray;this.filter=new r.XFAObjectArray;this.float=new r.XFAObjectArray;this.font=new r.XFAObjectArray;this.format=new r.XFAObjectArray;this.handler=new r.XFAObjectArray;this.hyphenation=new r.XFAObjectArray;this.image=new r.XFAObjectArray;this.imageEdit=new r.XFAObjectArray;this.integer=new r.XFAObjectArray;this.issuers=new r.XFAObjectArray;this.items=new r.XFAObjectArray;this.keep=new r.XFAObjectArray;this.keyUsage=new r.XFAObjectArray;this.line=new r.XFAObjectArray;this.linear=new r.XFAObjectArray;this.lockDocument=new r.XFAObjectArray;this.manifest=new r.XFAObjectArray;this.margin=new r.XFAObjectArray;this.mdp=new r.XFAObjectArray;this.medium=new r.XFAObjectArray;this.message=new r.XFAObjectArray;this.numericEdit=new r.XFAObjectArray;this.occur=new r.XFAObjectArray;this.oid=new r.XFAObjectArray;this.oids=new r.XFAObjectArray;this.overflow=new r.XFAObjectArray;this.pageArea=new r.XFAObjectArray;this.pageSet=new r.XFAObjectArray;this.para=new r.XFAObjectArray;this.passwordEdit=new r.XFAObjectArray;this.pattern=new r.XFAObjectArray;this.picture=new r.XFAObjectArray;this.radial=new r.XFAObjectArray;this.reason=new r.XFAObjectArray;this.reasons=new r.XFAObjectArray;this.rectangle=new r.XFAObjectArray;this.ref=new r.XFAObjectArray;this.script=new r.XFAObjectArray;this.setProperty=new r.XFAObjectArray;this.signData=new r.XFAObjectArray;this.signature=new r.XFAObjectArray;this.signing=new r.XFAObjectArray;this.solid=new r.XFAObjectArray;this.speak=new r.XFAObjectArray;this.stipple=new r.XFAObjectArray;this.subform=new r.XFAObjectArray;this.subformSet=new r.XFAObjectArray;this.subjectDN=new r.XFAObjectArray;this.subjectDNs=new r.XFAObjectArray;this.submit=new r.XFAObjectArray;this.text=new r.XFAObjectArray;this.textEdit=new r.XFAObjectArray;this.time=new r.XFAObjectArray;this.timeStamp=new r.XFAObjectArray;this.toolTip=new r.XFAObjectArray;this.traversal=new r.XFAObjectArray;this.traverse=new r.XFAObjectArray;this.ui=new r.XFAObjectArray;this.validate=new r.XFAObjectArray;this.value=new r.XFAObjectArray;this.variables=new r.XFAObjectArray}}class Radial extends r.XFAObject{constructor(e){super(d,"radial",!0);this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["toEdge","toCenter"]);this.use=e.use||"";this.usehref=e.usehref||"";this.color=null;this.extras=null}[r.$toStyle](e){e=e?e[r.$toStyle]():"#FFFFFF";const t=this.color?this.color[r.$toStyle]():"#000000";return`radial-gradient(circle at center, ${"toEdge"===this.type?`${e},${t}`:`${t},${e}`})`}}class Reason extends r.StringObject{constructor(e){super(d,"reason");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Reasons extends r.XFAObject{constructor(e){super(d,"reasons",!0);this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.reason=new r.XFAObjectArray}}class Rectangle extends r.XFAObject{constructor(e){super(d,"rectangle",!0);this.hand=(0,o.getStringOption)(e.hand,["even","left","right"]);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.corner=new r.XFAObjectArray(4);this.edge=new r.XFAObjectArray(4);this.fill=null}[r.$toHTML](){const e=this.edge.children.length?this.edge.children[0]:new Edge({}),t=e[r.$toStyle](),a=Object.create(null);this.fill&&"visible"===this.fill.presence?Object.assign(a,this.fill[r.$toStyle]()):a.fill="transparent";a.strokeWidth=(0,s.measureToString)("visible"===e.presence?e.thickness:0);a.stroke=t.color;const n=(this.corner.children.length?this.corner.children[0]:new Corner({}))[r.$toStyle](),i={name:"svg",children:[{name:"rect",attributes:{xmlns:f,width:"100%",height:"100%",x:0,y:0,rx:n.radius,ry:n.radius,style:a}}],attributes:{xmlns:f,style:{overflow:"visible"},width:"100%",height:"100%"}};if(hasMargin(this[r.$getParent]()[r.$getParent]()))return o.HTMLResult.success({name:"div",attributes:{style:{display:"inline",width:"100%",height:"100%"}},children:[i]});i.attributes.style.position="absolute";return o.HTMLResult.success(i)}}class RefElement extends r.StringObject{constructor(e){super(d,"ref");this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Script extends r.StringObject{constructor(e){super(d,"script");this.binding=e.binding||"";this.contentType=e.contentType||"";this.id=e.id||"";this.name=e.name||"";this.runAt=(0,o.getStringOption)(e.runAt,["client","both","server"]);this.use=e.use||"";this.usehref=e.usehref||""}}class SetProperty extends r.XFAObject{constructor(e){super(d,"setProperty");this.connection=e.connection||"";this.ref=e.ref||"";this.target=e.target||""}}t.SetProperty=SetProperty;class SignData extends r.XFAObject{constructor(e){super(d,"signData",!0);this.id=e.id||"";this.operation=(0,o.getStringOption)(e.operation,["sign","clear","verify"]);this.ref=e.ref||"";this.target=e.target||"";this.use=e.use||"";this.usehref=e.usehref||"";this.filter=null;this.manifest=null}}class Signature extends r.XFAObject{constructor(e){super(d,"signature",!0);this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["PDF1.3","PDF1.6"]);this.use=e.use||"";this.usehref=e.usehref||"";this.border=null;this.extras=null;this.filter=null;this.manifest=null;this.margin=null}}class Signing extends r.XFAObject{constructor(e){super(d,"signing",!0);this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.certificate=new r.XFAObjectArray}}class Solid extends r.XFAObject{constructor(e){super(d,"solid",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null}[r.$toStyle](e){return e?e[r.$toStyle]():"#FFFFFF"}}class Speak extends r.StringObject{constructor(e){super(d,"speak");this.disable=(0,o.getInteger)({data:e.disable,defaultValue:0,validate:e=>1===e});this.id=e.id||"";this.priority=(0,o.getStringOption)(e.priority,["custom","caption","name","toolTip"]);this.rid=e.rid||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Stipple extends r.XFAObject{constructor(e){super(d,"stipple",!0);this.id=e.id||"";this.rate=(0,o.getInteger)({data:e.rate,defaultValue:50,validate:e=>e>=0&&e<=100});this.use=e.use||"";this.usehref=e.usehref||"";this.color=null;this.extras=null}[r.$toStyle](e){const t=this.rate/100;return c.Util.makeHexColor(Math.round(e.value.r*(1-t)+this.value.r*t),Math.round(e.value.g*(1-t)+this.value.g*t),Math.round(e.value.b*(1-t)+this.value.b*t))}}class Subform extends r.XFAObject{constructor(e){super(d,"subform",!0);this.access=(0,o.getStringOption)(e.access,["open","nonInteractive","protected","readOnly"]);this.allowMacro=(0,o.getInteger)({data:e.allowMacro,defaultValue:0,validate:e=>1===e});this.anchorType=(0,o.getStringOption)(e.anchorType,["topLeft","bottomCenter","bottomLeft","bottomRight","middleCenter","middleLeft","middleRight","topCenter","topRight"]);this.colSpan=(0,o.getInteger)({data:e.colSpan,defaultValue:1,validate:e=>e>=1||-1===e});this.columnWidths=(e.columnWidths||"").trim().split(/\s+/).map((e=>"-1"===e?-1:(0,o.getMeasurement)(e)));this.h=e.h?(0,o.getMeasurement)(e.h):"";this.hAlign=(0,o.getStringOption)(e.hAlign,["left","center","justify","justifyAll","radix","right"]);this.id=e.id||"";this.layout=(0,o.getStringOption)(e.layout,["position","lr-tb","rl-row","rl-tb","row","table","tb"]);this.locale=e.locale||"";this.maxH=(0,o.getMeasurement)(e.maxH,"0pt");this.maxW=(0,o.getMeasurement)(e.maxW,"0pt");this.mergeMode=(0,o.getStringOption)(e.mergeMode,["consumeData","matchTemplate"]);this.minH=(0,o.getMeasurement)(e.minH,"0pt");this.minW=(0,o.getMeasurement)(e.minW,"0pt");this.name=e.name||"";this.presence=(0,o.getStringOption)(e.presence,["visible","hidden","inactive","invisible"]);this.relevant=(0,o.getRelevant)(e.relevant);this.restoreState=(0,o.getStringOption)(e.restoreState,["manual","auto"]);this.scope=(0,o.getStringOption)(e.scope,["name","none"]);this.use=e.use||"";this.usehref=e.usehref||"";this.w=e.w?(0,o.getMeasurement)(e.w):"";this.x=(0,o.getMeasurement)(e.x,"0pt");this.y=(0,o.getMeasurement)(e.y,"0pt");this.assist=null;this.bind=null;this.bookend=null;this.border=null;this.break=null;this.calculate=null;this.desc=null;this.extras=null;this.keep=null;this.margin=null;this.occur=null;this.overflow=null;this.pageSet=null;this.para=null;this.traversal=null;this.validate=null;this.variables=null;this.area=new r.XFAObjectArray;this.breakAfter=new r.XFAObjectArray;this.breakBefore=new r.XFAObjectArray;this.connect=new r.XFAObjectArray;this.draw=new r.XFAObjectArray;this.event=new r.XFAObjectArray;this.exObject=new r.XFAObjectArray;this.exclGroup=new r.XFAObjectArray;this.field=new r.XFAObjectArray;this.proto=new r.XFAObjectArray;this.setProperty=new r.XFAObjectArray;this.subform=new r.XFAObjectArray;this.subformSet=new r.XFAObjectArray}[r.$getSubformParent](){const e=this[r.$getParent]();return e instanceof SubformSet?e[r.$getSubformParent]():e}[r.$isBindable](){return!0}[r.$isThereMoreWidth](){return this.layout.endsWith("-tb")&&0===this[r.$extra].attempt&&this[r.$extra].numberInLine>0||this[r.$getParent]()[r.$isThereMoreWidth]()}*[r.$getContainedChildren](){yield*getContainedChildren(this)}[r.$flushHTML](){return(0,i.flushHTML)(this)}[r.$addHTML](e,t){(0,i.addHTML)(this,e,t)}[r.$getAvailableSpace](){return(0,i.getAvailableSpace)(this)}[r.$isSplittable](){const e=this[r.$getSubformParent]();if(!e[r.$isSplittable]())return!1;if(void 0!==this[r.$extra]._isSplittable)return this[r.$extra]._isSplittable;if("position"===this.layout||this.layout.includes("row")){this[r.$extra]._isSplittable=!1;return!1}if(this.keep&&"none"!==this.keep.intact){this[r.$extra]._isSplittable=!1;return!1}if(e.layout&&e.layout.endsWith("-tb")&&0!==e[r.$extra].numberInLine)return!1;this[r.$extra]._isSplittable=!0;return!0}[r.$toHTML](e){setTabIndex(this);if(this.break){if("auto"!==this.break.after||""!==this.break.afterTarget){const e=new BreakAfter({targetType:this.break.after,target:this.break.afterTarget,startNew:this.break.startNew.toString()});e[r.$globalData]=this[r.$globalData];this[r.$appendChild](e);this.breakAfter.push(e)}if("auto"!==this.break.before||""!==this.break.beforeTarget){const e=new BreakBefore({targetType:this.break.before,target:this.break.beforeTarget,startNew:this.break.startNew.toString()});e[r.$globalData]=this[r.$globalData];this[r.$appendChild](e);this.breakBefore.push(e)}if(""!==this.break.overflowTarget){const e=new Overflow({target:this.break.overflowTarget,leader:this.break.overflowLeader,trailer:this.break.overflowTrailer});e[r.$globalData]=this[r.$globalData];this[r.$appendChild](e);this.overflow.push(e)}this[r.$removeChild](this.break);this.break=null}if("hidden"===this.presence||"inactive"===this.presence)return o.HTMLResult.EMPTY;(this.breakBefore.children.length>1||this.breakAfter.children.length>1)&&(0,c.warn)("XFA - Several breakBefore or breakAfter in subforms: please file a bug.");if(this.breakBefore.children.length>=1){const e=this.breakBefore.children[0];if(handleBreak(e))return o.HTMLResult.breakNode(e)}if(this[r.$extra]&&this[r.$extra].afterBreakAfter)return o.HTMLResult.EMPTY;(0,s.fixDimensions)(this);const t=[],a={id:this[r.$uid],class:[]};(0,s.setAccess)(this,a.class);this[r.$extra]||(this[r.$extra]=Object.create(null));Object.assign(this[r.$extra],{children:t,line:null,attributes:a,attempt:0,numberInLine:0,availableSpace:{width:Math.min(this.w||1/0,e.width),height:Math.min(this.h||1/0,e.height)},width:0,height:0,prevHeight:0,currentWidth:0});const n=this[r.$getTemplateRoot](),l=n[r.$extra].noLayoutFailure,h=this[r.$isSplittable]();h||setFirstUnsplittable(this);if(!(0,i.checkDimensions)(this,e))return o.HTMLResult.FAILURE;const u=new Set(["area","draw","exclGroup","field","subform","subformSet"]);if(this.layout.includes("row")){const e=this[r.$getSubformParent]().columnWidths;if(Array.isArray(e)&&e.length>0){this[r.$extra].columnWidths=e;this[r.$extra].currentColumn=0}}const d=(0,s.toStyle)(this,"anchorType","dimensions","position","presence","border","margin","hAlign"),f=["xfaSubform"],g=(0,s.layoutClass)(this);g&&f.push(g);a.style=d;a.class=f;this.name&&(a.xfaName=this.name);if(this.overflow){const t=this.overflow[r.$getExtra]();if(t.addLeader){t.addLeader=!1;handleOverflow(this,t.leader,e)}}this[r.$pushPara]();const p="lr-tb"===this.layout||"rl-tb"===this.layout,m=p?2:1;for(;this[r.$extra].attempt<m;this[r.$extra].attempt++){p&&1===this[r.$extra].attempt&&(this[r.$extra].numberInLine=0);const e=this[r.$childrenToHTML]({filter:u,include:!0});if(e.success)break;if(e.isBreak()){this[r.$popPara]();return e}if(p&&0===this[r.$extra].attempt&&0===this[r.$extra].numberInLine&&!n[r.$extra].noLayoutFailure){this[r.$extra].attempt=m;break}}this[r.$popPara]();h||unsetFirstUnsplittable(this);n[r.$extra].noLayoutFailure=l;if(this[r.$extra].attempt===m){this.overflow&&(this[r.$getTemplateRoot]()[r.$extra].overflowNode=this.overflow);h||delete this[r.$extra];return o.HTMLResult.FAILURE}if(this.overflow){const t=this.overflow[r.$getExtra]();if(t.addTrailer){t.addTrailer=!1;handleOverflow(this,t.trailer,e)}}let b=0,y=0;if(this.margin){b=this.margin.leftInset+this.margin.rightInset;y=this.margin.topInset+this.margin.bottomInset}const w=Math.max(this[r.$extra].width+b,this.w||0),S=Math.max(this[r.$extra].height+y,this.h||0),x=[this.x,this.y,w,S];""===this.w&&(d.width=(0,s.measureToString)(w));""===this.h&&(d.height=(0,s.measureToString)(S));if(("0px"===d.width||"0px"===d.height)&&0===t.length)return o.HTMLResult.EMPTY;const C={name:"div",attributes:a,children:t};applyAssist(this,a);const k=o.HTMLResult.success((0,s.createWrapper)(this,C),x);if(this.breakAfter.children.length>=1){const e=this.breakAfter.children[0];if(handleBreak(e)){this[r.$extra].afterBreakAfter=k;return o.HTMLResult.breakNode(e)}}delete this[r.$extra];return k}}class SubformSet extends r.XFAObject{constructor(e){super(d,"subformSet",!0);this.id=e.id||"";this.name=e.name||"";this.relation=(0,o.getStringOption)(e.relation,["ordered","choice","unordered"]);this.relevant=(0,o.getRelevant)(e.relevant);this.use=e.use||"";this.usehref=e.usehref||"";this.bookend=null;this.break=null;this.desc=null;this.extras=null;this.occur=null;this.overflow=null;this.breakAfter=new r.XFAObjectArray;this.breakBefore=new r.XFAObjectArray;this.subform=new r.XFAObjectArray;this.subformSet=new r.XFAObjectArray}*[r.$getContainedChildren](){yield*getContainedChildren(this)}[r.$getSubformParent](){let e=this[r.$getParent]();for(;!(e instanceof Subform);)e=e[r.$getParent]();return e}[r.$isBindable](){return!0}}class SubjectDN extends r.ContentObject{constructor(e){super(d,"subjectDN");this.delimiter=e.delimiter||",";this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}[r.$finalize](){this[r.$content]=new Map(this[r.$content].split(this.delimiter).map((e=>{(e=e.split("=",2))[0]=e[0].trim();return e})))}}class SubjectDNs extends r.XFAObject{constructor(e){super(d,"subjectDNs",!0);this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.subjectDN=new r.XFAObjectArray}}class Submit extends r.XFAObject{constructor(e){super(d,"submit",!0);this.embedPDF=(0,o.getInteger)({data:e.embedPDF,defaultValue:0,validate:e=>1===e});this.format=(0,o.getStringOption)(e.format,["xdp","formdata","pdf","urlencoded","xfd","xml"]);this.id=e.id||"";this.target=e.target||"";this.textEncoding=(0,o.getKeyword)({data:e.textEncoding?e.textEncoding.toLowerCase():"",defaultValue:"",validate:e=>["utf-8","big-five","fontspecific","gbk","gb-18030","gb-2312","ksc-5601","none","shift-jis","ucs-2","utf-16"].includes(e)||e.match(/iso-8859-\d{2}/)});this.use=e.use||"";this.usehref=e.usehref||"";this.xdpContent=e.xdpContent||"";this.encrypt=null;this.encryptData=new r.XFAObjectArray;this.signData=new r.XFAObjectArray}}class Template extends r.XFAObject{constructor(e){super(d,"template",!0);this.baseProfile=(0,o.getStringOption)(e.baseProfile,["full","interactiveForms"]);this.extras=null;this.subform=new r.XFAObjectArray}[r.$finalize](){0===this.subform.children.length&&(0,c.warn)("XFA - No subforms in template node.");this.subform.children.length>=2&&(0,c.warn)("XFA - Several subforms in template node: please file a bug.");this[r.$tabIndex]=5e3}[r.$isSplittable](){return!0}[r.$searchNode](e,t){return e.startsWith("#")?[this[r.$ids].get(e.slice(1))]:(0,u.searchNode)(this,t,e,!0,!0)}*[r.$toPages](){if(!this.subform.children.length)return o.HTMLResult.success({name:"div",children:[]});this[r.$extra]={overflowNode:null,firstUnsplittable:null,currentContentArea:null,currentPageArea:null,noLayoutFailure:!1,pageNumber:1,pagePosition:"first",oddOrEven:"odd",blankOrNotBlank:"nonBlank",paraStack:[]};const e=this.subform.children[0];e.pageSet[r.$cleanPage]();const t=e.pageSet.pageArea.children,a={name:"div",children:[]};let n=null,i=null,s=null;if(e.breakBefore.children.length>=1){i=e.breakBefore.children[0];s=i.target}else if(e.subform.children.length>=1&&e.subform.children[0].breakBefore.children.length>=1){i=e.subform.children[0].breakBefore.children[0];s=i.target}else if(e.break&&e.break.beforeTarget){i=e.break;s=i.beforeTarget}else if(e.subform.children.length>=1&&e.subform.children[0].break&&e.subform.children[0].break.beforeTarget){i=e.subform.children[0].break;s=i.beforeTarget}if(i){const e=this[r.$searchNode](s,i[r.$getParent]());if(e instanceof PageArea){n=e;i[r.$extra]={}}}n||(n=t[0]);n[r.$extra]={numberOfUse:1};const l=n[r.$getParent]();l[r.$extra]={numberOfUse:1,pageIndex:l.pageArea.children.indexOf(n),pageSetIndex:0};let h,u=null,d=null,f=!0,g=0,p=0;for(;;){if(f)g=0;else{a.children.pop();if(3==++g){(0,c.warn)("XFA - Something goes wrong: please file a bug.");return a}}h=null;this[r.$extra].currentPageArea=n;const t=n[r.$toHTML]().html;a.children.push(t);if(u){this[r.$extra].noLayoutFailure=!0;t.children.push(u[r.$toHTML](n[r.$extra].space).html);u=null}if(d){this[r.$extra].noLayoutFailure=!0;t.children.push(d[r.$toHTML](n[r.$extra].space).html);d=null}const i=n.contentArea.children,s=t.children.filter((e=>e.attributes.class.includes("xfaContentarea")));f=!1;this[r.$extra].firstUnsplittable=null;this[r.$extra].noLayoutFailure=!1;const flush=t=>{const a=e[r.$flushHTML]();if(a){f=f||a.children&&0!==a.children.length;s[t].children.push(a)}};for(let t=p,n=i.length;t<n;t++){const n=this[r.$extra].currentContentArea=i[t],o={width:n.w,height:n.h};p=0;if(u){s[t].children.push(u[r.$toHTML](o).html);u=null}if(d){s[t].children.push(d[r.$toHTML](o).html);d=null}const c=e[r.$toHTML](o);if(c.success){if(c.html){f=f||c.html.children&&0!==c.html.children.length;s[t].children.push(c.html)}else!f&&a.children.length>1&&a.children.pop();return a}if(c.isBreak()){const e=c.breakNode;flush(t);if("auto"===e.targetType)continue;if(e.leader){u=this[r.$searchNode](e.leader,e[r.$getParent]());u=u?u[0]:null}if(e.trailer){d=this[r.$searchNode](e.trailer,e[r.$getParent]());d=d?d[0]:null}if("pageArea"===e.targetType){h=e[r.$extra].target;t=1/0}else if(e[r.$extra].target){h=e[r.$extra].target;p=e[r.$extra].index+1;t=1/0}else t=e[r.$extra].index}else if(this[r.$extra].overflowNode){const e=this[r.$extra].overflowNode;this[r.$extra].overflowNode=null;const a=e[r.$getExtra](),n=a.target;a.addLeader=null!==a.leader;a.addTrailer=null!==a.trailer;flush(t);const s=t;t=1/0;if(n instanceof PageArea)h=n;else if(n instanceof ContentArea){const e=i.indexOf(n);if(-1!==e)e>s?t=e-1:p=e;else{h=n[r.$getParent]();p=h.contentArea.children.indexOf(n)}}}else flush(t)}this[r.$extra].pageNumber+=1;h&&(h[r.$isUsable]()?h[r.$extra].numberOfUse+=1:h=null);n=h||n[r.$getNextPage]();yield null}}}t.Template=Template;class Text extends r.ContentObject{constructor(e){super(d,"text");this.id=e.id||"";this.maxChars=(0,o.getInteger)({data:e.maxChars,defaultValue:0,validate:e=>e>=0});this.name=e.name||"";this.rid=e.rid||"";this.use=e.use||"";this.usehref=e.usehref||""}[r.$acceptWhitespace](){return!0}[r.$onChild](e){if(e[r.$namespaceId]===n.NamespaceIds.xhtml.id){this[r.$content]=e;return!0}(0,c.warn)(`XFA - Invalid content in Text: ${e[r.$nodeName]}.`);return!1}[r.$onText](e){this[r.$content]instanceof r.XFAObject||super[r.$onText](e)}[r.$finalize](){"string"==typeof this[r.$content]&&(this[r.$content]=this[r.$content].replace(/\r\n/g,"\n"))}[r.$getExtra](){return"string"==typeof this[r.$content]?this[r.$content].split(/[\u2029\u2028\n]/).reduce(((e,t)=>{t&&e.push(t);return e}),[]).join("\n"):this[r.$content][r.$text]()}[r.$toHTML](e){if("string"==typeof this[r.$content]){const e=valueToHtml(this[r.$content]).html;if(this[r.$content].includes("\u2029")){e.name="div";e.children=[];this[r.$content].split("\u2029").map((e=>e.split(/[\u2028\n]/).reduce(((e,t)=>{e.push({name:"span",value:t},{name:"br"});return e}),[]))).forEach((t=>{e.children.push({name:"p",children:t})}))}else if(/[\u2028\n]/.test(this[r.$content])){e.name="div";e.children=[];this[r.$content].split(/[\u2028\n]/).forEach((t=>{e.children.push({name:"span",value:t},{name:"br"})}))}return o.HTMLResult.success(e)}return this[r.$content][r.$toHTML](e)}}t.Text=Text;class TextEdit extends r.XFAObject{constructor(e){super(d,"textEdit",!0);this.allowRichText=(0,o.getInteger)({data:e.allowRichText,defaultValue:0,validate:e=>1===e});this.hScrollPolicy=(0,o.getStringOption)(e.hScrollPolicy,["auto","off","on"]);this.id=e.id||"";this.multiLine=(0,o.getInteger)({data:e.multiLine,defaultValue:"",validate:e=>0===e||1===e});this.use=e.use||"";this.usehref=e.usehref||"";this.vScrollPolicy=(0,o.getStringOption)(e.vScrollPolicy,["auto","off","on"]);this.border=null;this.comb=null;this.extras=null;this.margin=null}[r.$toHTML](e){const t=(0,s.toStyle)(this,"border","font","margin");let a;const n=this[r.$getParent]()[r.$getParent]();""===this.multiLine&&(this.multiLine=n instanceof Draw?1:0);a=1===this.multiLine?{name:"textarea",attributes:{dataId:n[r.$data]&&n[r.$data][r.$uid]||n[r.$uid],fieldId:n[r.$uid],class:["xfaTextfield"],style:t,"aria-label":ariaLabel(n),"aria-required":!1}}:{name:"input",attributes:{type:"text",dataId:n[r.$data]&&n[r.$data][r.$uid]||n[r.$uid],fieldId:n[r.$uid],class:["xfaTextfield"],style:t,"aria-label":ariaLabel(n),"aria-required":!1}};if(isRequired(n)){a.attributes["aria-required"]=!0;a.attributes.required=!0}return o.HTMLResult.success({name:"label",attributes:{class:["xfaLabel"]},children:[a]})}}class Time extends r.StringObject{constructor(e){super(d,"time");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}[r.$finalize](){const e=this[r.$content].trim();this[r.$content]=e?new Date(e):null}[r.$toHTML](e){return valueToHtml(this[r.$content]?this[r.$content].toString():"")}}class TimeStamp extends r.XFAObject{constructor(e){super(d,"timeStamp");this.id=e.id||"";this.server=e.server||"";this.type=(0,o.getStringOption)(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||""}}class ToolTip extends r.StringObject{constructor(e){super(d,"toolTip");this.id=e.id||"";this.rid=e.rid||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Traversal extends r.XFAObject{constructor(e){super(d,"traversal",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.traverse=new r.XFAObjectArray}}class Traverse extends r.XFAObject{constructor(e){super(d,"traverse",!0);this.id=e.id||"";this.operation=(0,o.getStringOption)(e.operation,["next","back","down","first","left","right","up"]);this.ref=e.ref||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.script=null}get name(){return this.operation}[r.$isTransparent](){return!1}}class Ui extends r.XFAObject{constructor(e){super(d,"ui",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.picture=null;this.barcode=null;this.button=null;this.checkButton=null;this.choiceList=null;this.dateTimeEdit=null;this.defaultUi=null;this.imageEdit=null;this.numericEdit=null;this.passwordEdit=null;this.signature=null;this.textEdit=null}[r.$getExtra](){if(void 0===this[r.$extra]){for(const e of Object.getOwnPropertyNames(this)){if("extras"===e||"picture"===e)continue;const t=this[e];if(t instanceof r.XFAObject){this[r.$extra]=t;return t}}this[r.$extra]=null}return this[r.$extra]}[r.$toHTML](e){const t=this[r.$getExtra]();return t?t[r.$toHTML](e):o.HTMLResult.EMPTY}}class Validate extends r.XFAObject{constructor(e){super(d,"validate",!0);this.formatTest=(0,o.getStringOption)(e.formatTest,["warning","disabled","error"]);this.id=e.id||"";this.nullTest=(0,o.getStringOption)(e.nullTest,["disabled","error","warning"]);this.scriptTest=(0,o.getStringOption)(e.scriptTest,["error","disabled","warning"]);this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.message=null;this.picture=null;this.script=null}}class Value extends r.XFAObject{constructor(e){super(d,"value",!0);this.id=e.id||"";this.override=(0,o.getInteger)({data:e.override,defaultValue:0,validate:e=>1===e});this.relevant=(0,o.getRelevant)(e.relevant);this.use=e.use||"";this.usehref=e.usehref||"";this.arc=null;this.boolean=null;this.date=null;this.dateTime=null;this.decimal=null;this.exData=null;this.float=null;this.image=null;this.integer=null;this.line=null;this.rectangle=null;this.text=null;this.time=null}[r.$setValue](e){const t=this[r.$getParent]();if(t instanceof Field&&t.ui&&t.ui.imageEdit){if(!this.image){this.image=new Image({});this[r.$appendChild](this.image)}this.image[r.$content]=e[r.$content];return}const a=e[r.$nodeName];if(null===this[a]){for(const e of Object.getOwnPropertyNames(this)){const t=this[e];if(t instanceof r.XFAObject){this[e]=null;this[r.$removeChild](t)}}this[e[r.$nodeName]]=e;this[r.$appendChild](e)}else this[a][r.$content]=e[r.$content]}[r.$text](){if(this.exData)return"string"==typeof this.exData[r.$content]?this.exData[r.$content].trim():this.exData[r.$content][r.$text]().trim();for(const e of Object.getOwnPropertyNames(this)){if("image"===e)continue;const t=this[e];if(t instanceof r.XFAObject)return(t[r.$content]||"").toString().trim()}return null}[r.$toHTML](e){for(const t of Object.getOwnPropertyNames(this)){const a=this[t];if(a instanceof r.XFAObject)return a[r.$toHTML](e)}return o.HTMLResult.EMPTY}}t.Value=Value;class Variables extends r.XFAObject{constructor(e){super(d,"variables",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.boolean=new r.XFAObjectArray;this.date=new r.XFAObjectArray;this.dateTime=new r.XFAObjectArray;this.decimal=new r.XFAObjectArray;this.exData=new r.XFAObjectArray;this.float=new r.XFAObjectArray;this.image=new r.XFAObjectArray;this.integer=new r.XFAObjectArray;this.manifest=new r.XFAObjectArray;this.script=new r.XFAObjectArray;this.text=new r.XFAObjectArray;this.time=new r.XFAObjectArray}[r.$isTransparent](){return!0}}class TemplateNamespace{static[n.$buildXFAObject](e,t){if(TemplateNamespace.hasOwnProperty(e)){const a=TemplateNamespace[e](t);a[r.$setSetAttributes](t);return a}}static appearanceFilter(e){return new AppearanceFilter(e)}static arc(e){return new Arc(e)}static area(e){return new Area(e)}static assist(e){return new Assist(e)}static barcode(e){return new Barcode(e)}static bind(e){return new Bind(e)}static bindItems(e){return new BindItems(e)}static bookend(e){return new Bookend(e)}static boolean(e){return new BooleanElement(e)}static border(e){return new Border(e)}static break(e){return new Break(e)}static breakAfter(e){return new BreakAfter(e)}static breakBefore(e){return new BreakBefore(e)}static button(e){return new Button(e)}static calculate(e){return new Calculate(e)}static caption(e){return new Caption(e)}static certificate(e){return new Certificate(e)}static certificates(e){return new Certificates(e)}static checkButton(e){return new CheckButton(e)}static choiceList(e){return new ChoiceList(e)}static color(e){return new Color(e)}static comb(e){return new Comb(e)}static connect(e){return new Connect(e)}static contentArea(e){return new ContentArea(e)}static corner(e){return new Corner(e)}static date(e){return new DateElement(e)}static dateTime(e){return new DateTime(e)}static dateTimeEdit(e){return new DateTimeEdit(e)}static decimal(e){return new Decimal(e)}static defaultUi(e){return new DefaultUi(e)}static desc(e){return new Desc(e)}static digestMethod(e){return new DigestMethod(e)}static digestMethods(e){return new DigestMethods(e)}static draw(e){return new Draw(e)}static edge(e){return new Edge(e)}static encoding(e){return new Encoding(e)}static encodings(e){return new Encodings(e)}static encrypt(e){return new Encrypt(e)}static encryptData(e){return new EncryptData(e)}static encryption(e){return new Encryption(e)}static encryptionMethod(e){return new EncryptionMethod(e)}static encryptionMethods(e){return new EncryptionMethods(e)}static event(e){return new Event(e)}static exData(e){return new ExData(e)}static exObject(e){return new ExObject(e)}static exclGroup(e){return new ExclGroup(e)}static execute(e){return new Execute(e)}static extras(e){return new Extras(e)}static field(e){return new Field(e)}static fill(e){return new Fill(e)}static filter(e){return new Filter(e)}static float(e){return new Float(e)}static font(e){return new Font(e)}static format(e){return new Format(e)}static handler(e){return new Handler(e)}static hyphenation(e){return new Hyphenation(e)}static image(e){return new Image(e)}static imageEdit(e){return new ImageEdit(e)}static integer(e){return new Integer(e)}static issuers(e){return new Issuers(e)}static items(e){return new Items(e)}static keep(e){return new Keep(e)}static keyUsage(e){return new KeyUsage(e)}static line(e){return new Line(e)}static linear(e){return new Linear(e)}static lockDocument(e){return new LockDocument(e)}static manifest(e){return new Manifest(e)}static margin(e){return new Margin(e)}static mdp(e){return new Mdp(e)}static medium(e){return new Medium(e)}static message(e){return new Message(e)}static numericEdit(e){return new NumericEdit(e)}static occur(e){return new Occur(e)}static oid(e){return new Oid(e)}static oids(e){return new Oids(e)}static overflow(e){return new Overflow(e)}static pageArea(e){return new PageArea(e)}static pageSet(e){return new PageSet(e)}static para(e){return new Para(e)}static passwordEdit(e){return new PasswordEdit(e)}static pattern(e){return new Pattern(e)}static picture(e){return new Picture(e)}static proto(e){return new Proto(e)}static radial(e){return new Radial(e)}static reason(e){return new Reason(e)}static reasons(e){return new Reasons(e)}static rectangle(e){return new Rectangle(e)}static ref(e){return new RefElement(e)}static script(e){return new Script(e)}static setProperty(e){return new SetProperty(e)}static signData(e){return new SignData(e)}static signature(e){return new Signature(e)}static signing(e){return new Signing(e)}static solid(e){return new Solid(e)}static speak(e){return new Speak(e)}static stipple(e){return new Stipple(e)}static subform(e){return new Subform(e)}static subformSet(e){return new SubformSet(e)}static subjectDN(e){return new SubjectDN(e)}static subjectDNs(e){return new SubjectDNs(e)}static submit(e){return new Submit(e)}static template(e){return new Template(e)}static text(e){return new Text(e)}static textEdit(e){return new TextEdit(e)}static time(e){return new Time(e)}static timeStamp(e){return new TimeStamp(e)}static toolTip(e){return new ToolTip(e)}static traversal(e){return new Traversal(e)}static traverse(e){return new Traverse(e)}static ui(e){return new Ui(e)}static validate(e){return new Validate(e)}static value(e){return new Value(e)}static variables(e){return new Variables(e)}}t.TemplateNamespace=TemplateNamespace},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.addHTML=function addHTML(e,t,a){const i=e[r.$extra],s=i.availableSpace,[o,c,l,h]=a;switch(e.layout){case"position":i.width=Math.max(i.width,o+l);i.height=Math.max(i.height,c+h);i.children.push(t);break;case"lr-tb":case"rl-tb":if(!i.line||1===i.attempt){i.line=createLine(e,[]);i.children.push(i.line);i.numberInLine=0}i.numberInLine+=1;i.line.children.push(t);if(0===i.attempt){i.currentWidth+=l;i.height=Math.max(i.height,i.prevHeight+h)}else{i.currentWidth=l;i.prevHeight=i.height;i.height+=h;i.attempt=0}i.width=Math.max(i.width,i.currentWidth);break;case"rl-row":case"row":{i.children.push(t);i.width+=l;i.height=Math.max(i.height,h);const e=(0,n.measureToString)(i.height);for(const t of i.children)t.attributes.style.height=e;break}case"table":case"tb":i.width=Math.min(s.width,Math.max(i.width,l));i.height+=h;i.children.push(t)}};t.checkDimensions=function checkDimensions(e,t){if(null===e[r.$getTemplateRoot]()[r.$extra].firstUnsplittable)return!0;if(0===e.w||0===e.h)return!0;const a=e[r.$getSubformParent](),n=a[r.$extra]&&a[r.$extra].attempt||0,[,i,s,o]=function getTransformedBBox(e){let t,a,r=""===e.w?NaN:e.w,n=""===e.h?NaN:e.h,[i,s]=[0,0];switch(e.anchorType||""){case"bottomCenter":[i,s]=[r/2,n];break;case"bottomLeft":[i,s]=[0,n];break;case"bottomRight":[i,s]=[r,n];break;case"middleCenter":[i,s]=[r/2,n/2];break;case"middleLeft":[i,s]=[0,n/2];break;case"middleRight":[i,s]=[r,n/2];break;case"topCenter":[i,s]=[r/2,0];break;case"topRight":[i,s]=[r,0]}switch(e.rotate||0){case 0:[t,a]=[-i,-s];break;case 90:[t,a]=[-s,i];[r,n]=[n,-r];break;case 180:[t,a]=[i,s];[r,n]=[-r,-n];break;case 270:[t,a]=[s,-i];[r,n]=[-n,r]}return[e.x+t+Math.min(0,r),e.y+a+Math.min(0,n),Math.abs(r),Math.abs(n)]}(e);switch(a.layout){case"lr-tb":case"rl-tb":return 0===n?e[r.$getTemplateRoot]()[r.$extra].noLayoutFailure?""!==e.w?Math.round(s-t.width)<=2:t.width>2:!(""!==e.h&&Math.round(o-t.height)>2)&&(""!==e.w?Math.round(s-t.width)<=2||0===a[r.$extra].numberInLine&&t.height>2:t.width>2):!!e[r.$getTemplateRoot]()[r.$extra].noLayoutFailure||!(""!==e.h&&Math.round(o-t.height)>2)&&((""===e.w||Math.round(s-t.width)<=2||!a[r.$isThereMoreWidth]())&&t.height>2);case"table":case"tb":return!!e[r.$getTemplateRoot]()[r.$extra].noLayoutFailure||(""===e.h||e[r.$isSplittable]()?(""===e.w||Math.round(s-t.width)<=2||!a[r.$isThereMoreWidth]())&&t.height>2:Math.round(o-t.height)<=2);case"position":if(e[r.$getTemplateRoot]()[r.$extra].noLayoutFailure)return!0;if(""===e.h||Math.round(o+i-t.height)<=2)return!0;return o+i>e[r.$getTemplateRoot]()[r.$extra].currentContentArea.h;case"rl-row":case"row":return!!e[r.$getTemplateRoot]()[r.$extra].noLayoutFailure||(""===e.h||Math.round(o-t.height)<=2);default:return!0}};t.flushHTML=function flushHTML(e){if(!e[r.$extra])return null;const t={name:"div",attributes:e[r.$extra].attributes,children:e[r.$extra].children};if(e[r.$extra].failingNode){const a=e[r.$extra].failingNode[r.$flushHTML]();a&&(e.layout.endsWith("-tb")?t.children.push(createLine(e,[a])):t.children.push(a))}if(0===t.children.length)return null;return t};t.getAvailableSpace=function getAvailableSpace(e){const t=e[r.$extra].availableSpace,a=e.margin?e.margin.topInset+e.margin.bottomInset:0,n=e.margin?e.margin.leftInset+e.margin.rightInset:0;switch(e.layout){case"lr-tb":case"rl-tb":return 0===e[r.$extra].attempt?{width:t.width-n-e[r.$extra].currentWidth,height:t.height-a-e[r.$extra].prevHeight}:{width:t.width-n,height:t.height-a-e[r.$extra].height};case"rl-row":case"row":return{width:e[r.$extra].columnWidths.slice(e[r.$extra].currentColumn).reduce(((e,t)=>e+t)),height:t.height-n};case"table":case"tb":return{width:t.width-n,height:t.height-a-e[r.$extra].height};default:return t}};var r=a(75),n=a(82);function createLine(e,t){return{name:"div",attributes:{class:["lr-tb"===e.layout?"xfaLr":"xfaRl"]},children:t}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.computeBbox=function computeBbox(e,t,a){let n;if(""!==e.w&&""!==e.h)n=[e.x,e.y,e.w,e.h];else{if(!a)return null;let i=e.w;if(""===i){if(0===e.maxW){const t=e[r.$getSubformParent]();i="position"===t.layout&&""!==t.w?0:e.minW}else i=Math.min(e.maxW,a.width);t.attributes.style.width=measureToString(i)}let s=e.h;if(""===s){if(0===e.maxH){const t=e[r.$getSubformParent]();s="position"===t.layout&&""!==t.h?0:e.minH}else s=Math.min(e.maxH,a.height);t.attributes.style.height=measureToString(s)}n=[e.x,e.y,i,s]}return n};t.createWrapper=function createWrapper(e,t){const{attributes:a}=t,{style:n}=a,i={name:"div",attributes:{class:["xfaWrapper"],style:Object.create(null)},children:[]};a.class.push("xfaWrapped");if(e.border){const{widths:a,insets:s}=e.border[r.$extra];let o,c,l=s[0],h=s[3];const u=s[0]+s[2],d=s[1]+s[3];switch(e.border.hand){case"even":l-=a[0]/2;h-=a[3]/2;o=`calc(100% + ${(a[1]+a[3])/2-d}px)`;c=`calc(100% + ${(a[0]+a[2])/2-u}px)`;break;case"left":l-=a[0];h-=a[3];o=`calc(100% + ${a[1]+a[3]-d}px)`;c=`calc(100% + ${a[0]+a[2]-u}px)`;break;case"right":o=d?`calc(100% - ${d}px)`:"100%";c=u?`calc(100% - ${u}px)`:"100%"}const f=["xfaBorder"];isPrintOnly(e.border)&&f.push("xfaPrintOnly");const g={name:"div",attributes:{class:f,style:{top:`${l}px`,left:`${h}px`,width:o,height:c}},children:[]};for(const e of["border","borderWidth","borderColor","borderRadius","borderStyle"])if(void 0!==n[e]){g.attributes.style[e]=n[e];delete n[e]}i.children.push(g,t)}else i.children.push(t);for(const e of["background","backgroundClip","top","left","width","height","minWidth","minHeight","maxWidth","maxHeight","transform","transformOrigin","visibility"])if(void 0!==n[e]){i.attributes.style[e]=n[e];delete n[e]}"absolute"===n.position?i.attributes.style.position="absolute":i.attributes.style.position="relative";delete n.position;if(n.alignSelf){i.attributes.style.alignSelf=n.alignSelf;delete n.alignSelf}return i};t.fixDimensions=function fixDimensions(e){const t=e[r.$getSubformParent]();if(t.layout&&t.layout.includes("row")){const a=t[r.$extra],n=e.colSpan;let i;i=-1===n?a.columnWidths.slice(a.currentColumn).reduce(((e,t)=>e+t),0):a.columnWidths.slice(a.currentColumn,a.currentColumn+n).reduce(((e,t)=>e+t),0);isNaN(i)||(e.w=i)}t.layout&&"position"!==t.layout&&(e.x=e.y=0);"table"===e.layout&&""===e.w&&Array.isArray(e.columnWidths)&&(e.w=e.columnWidths.reduce(((e,t)=>e+t),0))};t.fixTextIndent=function fixTextIndent(e){const t=(0,i.getMeasurement)(e.textIndent,"0px");if(t>=0)return;const a="padding"+("left"==("right"===e.textAlign?"right":"left")?"Left":"Right"),r=(0,i.getMeasurement)(e[a],"0px");e[a]=r-t+"px"};t.fixURL=function fixURL(e){const t=(0,n.createValidAbsoluteUrl)(e,null,{addDefaultProtocol:!0,tryConvertEncoding:!0});return t?t.href:null};t.isPrintOnly=isPrintOnly;t.layoutClass=function layoutClass(e){switch(e.layout){case"position":default:return"xfaPosition";case"lr-tb":return"xfaLrTb";case"rl-row":return"xfaRlRow";case"rl-tb":return"xfaRlTb";case"row":return"xfaRow";case"table":return"xfaTable";case"tb":return"xfaTb"}};t.layoutNode=function layoutNode(e,t){let a=null,n=null,i=!1;if((!e.w||!e.h)&&e.value){let s=0,o=0;if(e.margin){s=e.margin.leftInset+e.margin.rightInset;o=e.margin.topInset+e.margin.bottomInset}let c=null,l=null;if(e.para){l=Object.create(null);c=""===e.para.lineHeight?null:e.para.lineHeight;l.top=""===e.para.spaceAbove?0:e.para.spaceAbove;l.bottom=""===e.para.spaceBelow?0:e.para.spaceBelow;l.left=""===e.para.marginLeft?0:e.para.marginLeft;l.right=""===e.para.marginRight?0:e.para.marginRight}let h=e.font;if(!h){const t=e[r.$getTemplateRoot]();let a=e[r.$getParent]();for(;a&&a!==t;){if(a.font){h=a.font;break}a=a[r.$getParent]()}}const u=(e.w||t.width)-s,d=e[r.$globalData].fontFinder;if(e.value.exData&&e.value.exData[r.$content]&&"text/html"===e.value.exData.contentType){const t=layoutText(e.value.exData[r.$content],h,l,c,d,u);n=t.width;a=t.height;i=t.isBroken}else{const t=e.value[r.$text]();if(t){const e=layoutText(t,h,l,c,d,u);n=e.width;a=e.height;i=e.isBroken}}null===n||e.w||(n+=s);null===a||e.h||(a+=o)}return{w:n,h:a,isBroken:i}};t.measureToString=measureToString;t.setAccess=function setAccess(e,t){switch(e.access){case"nonInteractive":t.push("xfaNonInteractive");break;case"readOnly":t.push("xfaReadOnly");break;case"protected":t.push("xfaDisabled")}};t.setFontFamily=function setFontFamily(e,t,a,r){if(!a){delete r.fontFamily;return}const n=(0,i.stripQuotes)(e.typeface);r.fontFamily=`"${n}"`;const o=a.find(n);if(o){const{fontFamily:a}=o.regular.cssFontInfo;a!==n&&(r.fontFamily=`"${a}"`);const i=getCurrentPara(t);if(i&&""!==i.lineHeight)return;if(r.lineHeight)return;const c=(0,s.selectFont)(e,o);c&&(r.lineHeight=Math.max(1.2,c.lineHeight))}};t.setMinMaxDimensions=function setMinMaxDimensions(e,t){if("position"===e[r.$getSubformParent]().layout){e.minW>0&&(t.minWidth=measureToString(e.minW));e.maxW>0&&(t.maxWidth=measureToString(e.maxW));e.minH>0&&(t.minHeight=measureToString(e.minH));e.maxH>0&&(t.maxHeight=measureToString(e.maxH))}};t.setPara=function setPara(e,t,a){if(a.attributes.class&&a.attributes.class.includes("xfaRich")){if(t){""===e.h&&(t.height="auto");""===e.w&&(t.width="auto")}const n=getCurrentPara(e);if(n){const e=a.attributes.style;e.display="flex";e.flexDirection="column";switch(n.vAlign){case"top":e.justifyContent="start";break;case"bottom":e.justifyContent="end";break;case"middle":e.justifyContent="center"}const t=n[r.$toStyle]();for(const[a,r]of Object.entries(t))a in e||(e[a]=r)}}};t.toStyle=function toStyle(e,...t){const a=Object.create(null);for(const i of t){const t=e[i];if(null!==t)if(c.hasOwnProperty(i))c[i](e,a);else if(t instanceof r.XFAObject){const e=t[r.$toStyle]();e?Object.assign(a,e):(0,n.warn)(`(DEBUG) - XFA - style for ${i} not implemented yet`)}}return a};var r=a(75),n=a(2),i=a(76),s=a(83),o=a(84);function measureToString(e){return"string"==typeof e?"0px":Number.isInteger(e)?`${e}px`:`${e.toFixed(2)}px`}const c={anchorType(e,t){const a=e[r.$getSubformParent]();if(a&&(!a.layout||"position"===a.layout)){"transform"in t||(t.transform="");switch(e.anchorType){case"bottomCenter":t.transform+="translate(-50%, -100%)";break;case"bottomLeft":t.transform+="translate(0,-100%)";break;case"bottomRight":t.transform+="translate(-100%,-100%)";break;case"middleCenter":t.transform+="translate(-50%,-50%)";break;case"middleLeft":t.transform+="translate(0,-50%)";break;case"middleRight":t.transform+="translate(-100%,-50%)";break;case"topCenter":t.transform+="translate(-50%,0)";break;case"topRight":t.transform+="translate(-100%,0)"}}},dimensions(e,t){const a=e[r.$getSubformParent]();let n=e.w;const i=e.h;if(a.layout&&a.layout.includes("row")){const t=a[r.$extra],i=e.colSpan;let s;if(-1===i){s=t.columnWidths.slice(t.currentColumn).reduce(((e,t)=>e+t),0);t.currentColumn=0}else{s=t.columnWidths.slice(t.currentColumn,t.currentColumn+i).reduce(((e,t)=>e+t),0);t.currentColumn=(t.currentColumn+e.colSpan)%t.columnWidths.length}isNaN(s)||(n=e.w=s)}t.width=""!==n?measureToString(n):"auto";t.height=""!==i?measureToString(i):"auto"},position(e,t){const a=e[r.$getSubformParent]();if(!a||!a.layout||"position"===a.layout){t.position="absolute";t.left=measureToString(e.x);t.top=measureToString(e.y)}},rotate(e,t){if(e.rotate){"transform"in t||(t.transform="");t.transform+=`rotate(-${e.rotate}deg)`;t.transformOrigin="top left"}},presence(e,t){switch(e.presence){case"invisible":t.visibility="hidden";break;case"hidden":case"inactive":t.display="none"}},hAlign(e,t){if("para"===e[r.$nodeName])switch(e.hAlign){case"justifyAll":t.textAlign="justify-all";break;case"radix":t.textAlign="left";break;default:t.textAlign=e.hAlign}else switch(e.hAlign){case"left":t.alignSelf="start";break;case"center":t.alignSelf="center";break;case"right":t.alignSelf="end"}},margin(e,t){e.margin&&(t.margin=e.margin[r.$toStyle]().margin)}};function layoutText(e,t,a,n,i,s){const c=new o.TextMeasure(t,a,n,i);"string"==typeof e?c.addString(e):e[r.$pushGlyphs](c);return c.compute(s)}function isPrintOnly(e){return e.relevant.length>0&&!e.relevant[0].excluded&&"print"===e.relevant[0].viewname}function getCurrentPara(e){const t=e[r.$getTemplateRoot]()[r.$extra].paraStack;return t.length?t.at(-1):null}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.FontFinder=void 0;t.getMetrics=function getMetrics(e,t=!1){let a=null;if(e){const t=(0,n.stripQuotes)(e.typeface),i=e[r.$globalData].fontFinder.find(t);a=selectFont(e,i)}if(!a)return{lineHeight:12,lineGap:2,lineNoGap:10};const i=e.size||10,s=a.lineHeight?Math.max(t?0:1.2,a.lineHeight):1.2,o=void 0===a.lineGap?.2:a.lineGap;return{lineHeight:s*i,lineGap:o*i,lineNoGap:Math.max(1,s-o)*i}};t.selectFont=selectFont;var r=a(75),n=a(76),i=a(2);t.FontFinder=class FontFinder{constructor(e){this.fonts=new Map;this.cache=new Map;this.warned=new Set;this.defaultFont=null;this.add(e)}add(e,t=null){for(const t of e)this.addPdfFont(t);for(const e of this.fonts.values())e.regular||(e.regular=e.italic||e.bold||e.bolditalic);if(!t||0===t.size)return;const a=this.fonts.get("PdfJS-Fallback-PdfJS-XFA");for(const e of t)this.fonts.set(e,a)}addPdfFont(e){const t=e.cssFontInfo,a=t.fontFamily;let r=this.fonts.get(a);if(!r){r=Object.create(null);this.fonts.set(a,r);this.defaultFont||(this.defaultFont=r)}let n="";const i=parseFloat(t.fontWeight);0!==parseFloat(t.italicAngle)?n=i>=700?"bolditalic":"italic":i>=700&&(n="bold");if(!n){(e.name.includes("Bold")||e.psName&&e.psName.includes("Bold"))&&(n="bold");(e.name.includes("Italic")||e.name.endsWith("It")||e.psName&&(e.psName.includes("Italic")||e.psName.endsWith("It")))&&(n+="italic")}n||(n="regular");r[n]=e}getDefault(){return this.defaultFont}find(e,t=!0){let a=this.fonts.get(e)||this.cache.get(e);if(a)return a;const r=/,|-|_| |bolditalic|bold|italic|regular|it/gi;let n=e.replace(r,"");a=this.fonts.get(n);if(a){this.cache.set(e,a);return a}n=n.toLowerCase();const s=[];for(const[e,t]of this.fonts.entries())e.replace(r,"").toLowerCase().startsWith(n)&&s.push(t);if(0===s.length)for(const[,e]of this.fonts.entries())e.regular.name&&e.regular.name.replace(r,"").toLowerCase().startsWith(n)&&s.push(e);if(0===s.length){n=n.replace(/psmt|mt/gi,"");for(const[e,t]of this.fonts.entries())e.replace(r,"").toLowerCase().startsWith(n)&&s.push(t)}if(0===s.length)for(const e of this.fonts.values())e.regular.name&&e.regular.name.replace(r,"").toLowerCase().startsWith(n)&&s.push(e);if(s.length>=1){1!==s.length&&t&&(0,i.warn)(`XFA - Too many choices to guess the correct font: ${e}`);this.cache.set(e,s[0]);return s[0]}if(t&&!this.warned.has(e)){this.warned.add(e);(0,i.warn)(`XFA - Cannot find the font: ${e}`)}return null}};function selectFont(e,t){return"italic"===e.posture?"bold"===e.weight?t.bolditalic:t.italic:"bold"===e.weight?t.bold:t.regular}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.TextMeasure=void 0;var r=a(83);class FontInfo{constructor(e,t,a,n){this.lineHeight=a;this.paraMargin=t||{top:0,bottom:0,left:0,right:0};if(!e){[this.pdfFont,this.xfaFont]=this.defaultFont(n);return}this.xfaFont={typeface:e.typeface,posture:e.posture,weight:e.weight,size:e.size,letterSpacing:e.letterSpacing};const i=n.find(e.typeface);if(i){this.pdfFont=(0,r.selectFont)(e,i);this.pdfFont||([this.pdfFont,this.xfaFont]=this.defaultFont(n))}else[this.pdfFont,this.xfaFont]=this.defaultFont(n)}defaultFont(e){const t=e.find("Helvetica",!1)||e.find("Myriad Pro",!1)||e.find("Arial",!1)||e.getDefault();if(t&&t.regular){const e=t.regular;return[e,{typeface:e.cssFontInfo.fontFamily,posture:"normal",weight:"normal",size:10,letterSpacing:0}]}return[null,{typeface:"Courier",posture:"normal",weight:"normal",size:10,letterSpacing:0}]}}class FontSelector{constructor(e,t,a,r){this.fontFinder=r;this.stack=[new FontInfo(e,t,a,r)]}pushData(e,t,a){const r=this.stack.at(-1);for(const t of["typeface","posture","weight","size","letterSpacing"])e[t]||(e[t]=r.xfaFont[t]);for(const e of["top","bottom","left","right"])isNaN(t[e])&&(t[e]=r.paraMargin[e]);const n=new FontInfo(e,t,a||r.lineHeight,this.fontFinder);n.pdfFont||(n.pdfFont=r.pdfFont);this.stack.push(n)}popFont(){this.stack.pop()}topFont(){return this.stack.at(-1)}}t.TextMeasure=class TextMeasure{constructor(e,t,a,r){this.glyphs=[];this.fontSelector=new FontSelector(e,t,a,r);this.extraHeight=0}pushData(e,t,a){this.fontSelector.pushData(e,t,a)}popFont(e){return this.fontSelector.popFont()}addPara(){const e=this.fontSelector.topFont();this.extraHeight+=e.paraMargin.top+e.paraMargin.bottom}addString(e){if(!e)return;const t=this.fontSelector.topFont(),a=t.xfaFont.size;if(t.pdfFont){const r=t.xfaFont.letterSpacing,n=t.pdfFont,i=n.lineHeight||1.2,s=t.lineHeight||Math.max(1.2,i)*a,o=i-(void 0===n.lineGap?.2:n.lineGap),c=Math.max(1,o)*a,l=a/1e3,h=n.defaultWidth||n.charsToGlyphs(" ")[0].width;for(const t of e.split(/[\u2029\n]/)){const e=n.encodeString(t).join(""),a=n.charsToGlyphs(e);for(const e of a){const t=e.width||h;this.glyphs.push([t*l+r,s,c,e.unicode,!1])}this.glyphs.push([0,0,0,"\n",!0])}this.glyphs.pop()}else{for(const t of e.split(/[\u2029\n]/)){for(const e of t.split(""))this.glyphs.push([a,1.2*a,a,e,!1]);this.glyphs.push([0,0,0,"\n",!0])}this.glyphs.pop()}}compute(e){let t=-1,a=0,r=0,n=0,i=0,s=0,o=!1,c=!0;for(let l=0,h=this.glyphs.length;l<h;l++){const[h,u,d,f,g]=this.glyphs[l],p=" "===f,m=c?d:u;if(g){r=Math.max(r,i);i=0;n+=s;s=m;t=-1;a=0;c=!1}else if(p)if(i+h>e){r=Math.max(r,i);i=0;n+=s;s=m;t=-1;a=0;o=!0;c=!1}else{s=Math.max(m,s);a=i;i+=h;t=l}else if(i+h>e){n+=s;s=m;if(-1!==t){l=t;r=Math.max(r,a);i=0;t=-1;a=0}else{r=Math.max(r,i);i=h}o=!0;c=!1}else{i+=h;s=Math.max(m,s)}}r=Math.max(r,i);n+=s+this.extraHeight;return{width:1.02*r,height:n,isBroken:o}}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.DataHandler=void 0;var r=a(75);t.DataHandler=class DataHandler{constructor(e,t){this.data=t;this.dataset=e.datasets||null}serialize(e){const t=[[-1,this.data[r.$getChildren]()]];for(;t.length>0;){const a=t.at(-1),[n,i]=a;if(n+1===i.length){t.pop();continue}const s=i[++a[0]],o=e.get(s[r.$uid]);if(o)s[r.$setValue](o);else{const t=s[r.$getAttributes]();for(const a of t.values()){const t=e.get(a[r.$uid]);if(t){a[r.$setValue](t);break}}}const c=s[r.$getChildren]();c.length>0&&t.push([-1,c])}const a=['<xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">'];if(this.dataset)for(const e of this.dataset[r.$getChildren]())"data"!==e[r.$nodeName]&&e[r.$toString](a);this.data[r.$toString](a);a.push("</xfa:datasets>");return a.join("")}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.XFAParser=void 0;var r=a(75),n=a(64),i=a(87),s=a(2);class XFAParser extends n.XMLParserBase{constructor(e=null,t=!1){super();this._builder=new i.Builder(e);this._stack=[];this._globalData={usedTypefaces:new Set};this._ids=new Map;this._current=this._builder.buildRoot(this._ids);this._errorCode=n.XMLParserErrorCode.NoError;this._whiteRegex=/^\s+$/;this._nbsps=/\xa0+/g;this._richText=t}parse(e){this.parseXml(e);if(this._errorCode===n.XMLParserErrorCode.NoError){this._current[r.$finalize]();return this._current.element}}onText(e){e=e.replace(this._nbsps,(e=>e.slice(1)+" "));this._richText||this._current[r.$acceptWhitespace]()?this._current[r.$onText](e,this._richText):this._whiteRegex.test(e)||this._current[r.$onText](e.trim())}onCdata(e){this._current[r.$onText](e)}_mkAttributes(e,t){let a=null,n=null;const i=Object.create({});for(const{name:o,value:c}of e)if("xmlns"===o)a?(0,s.warn)(`XFA - multiple namespace definition in <${t}>`):a=c;else if(o.startsWith("xmlns:")){const e=o.substring("xmlns:".length);n||(n=[]);n.push({prefix:e,value:c})}else{const e=o.indexOf(":");if(-1===e)i[o]=c;else{let t=i[r.$nsAttributes];t||(t=i[r.$nsAttributes]=Object.create(null));const[a,n]=[o.slice(0,e),o.slice(e+1)];let s=t[a];s||(s=t[a]=Object.create(null));s[n]=c}}return[a,n,i]}_getNameAndPrefix(e,t){const a=e.indexOf(":");return-1===a?[e,null]:[e.substring(a+1),t?"":e.substring(0,a)]}onBeginElement(e,t,a){const[n,i,s]=this._mkAttributes(t,e),[o,c]=this._getNameAndPrefix(e,this._builder.isNsAgnostic()),l=this._builder.build({nsPrefix:c,name:o,attributes:s,namespace:n,prefixes:i});l[r.$globalData]=this._globalData;if(a){l[r.$finalize]();this._current[r.$onChild](l)&&l[r.$setId](this._ids);l[r.$clean](this._builder)}else{this._stack.push(this._current);this._current=l}}onEndElement(e){const t=this._current;if(t[r.$isCDATAXml]()&&"string"==typeof t[r.$content]){const e=new XFAParser;e._globalData=this._globalData;const a=e.parse(t[r.$content]);t[r.$content]=null;t[r.$onChild](a)}t[r.$finalize]();this._current=this._stack.pop();this._current[r.$onChild](t)&&t[r.$setId](this._ids);t[r.$clean](this._builder)}onError(e){this._errorCode=e}}t.XFAParser=XFAParser},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.Builder=void 0;var r=a(77),n=a(75),i=a(88),s=a(80),o=a(97),c=a(2);class Root extends n.XFAObject{constructor(e){super(-1,"root",Object.create(null));this.element=null;this[n.$ids]=e}[n.$onChild](e){this.element=e;return!0}[n.$finalize](){super[n.$finalize]();if(this.element.template instanceof s.Template){this[n.$ids].set(n.$root,this.element);this.element.template[n.$resolvePrototypes](this[n.$ids]);this.element.template[n.$ids]=this[n.$ids]}}}class Empty extends n.XFAObject{constructor(){super(-1,"",Object.create(null))}[n.$onChild](e){return!1}}t.Builder=class Builder{constructor(e=null){this._namespaceStack=[];this._nsAgnosticLevel=0;this._namespacePrefixes=new Map;this._namespaces=new Map;this._nextNsId=Math.max(...Object.values(r.NamespaceIds).map((({id:e})=>e)));this._currentNamespace=e||new o.UnknownNamespace(++this._nextNsId)}buildRoot(e){return new Root(e)}build({nsPrefix:e,name:t,attributes:a,namespace:s,prefixes:o}){const c=null!==s;if(c){this._namespaceStack.push(this._currentNamespace);this._currentNamespace=this._searchNamespace(s)}o&&this._addNamespacePrefix(o);if(a.hasOwnProperty(n.$nsAttributes)){const e=i.NamespaceSetUp.datasets,t=a[n.$nsAttributes];let r=null;for(const[a,n]of Object.entries(t)){if(this._getNamespaceToUse(a)===e){r={xfa:n};break}}r?a[n.$nsAttributes]=r:delete a[n.$nsAttributes]}const l=this._getNamespaceToUse(e),h=l&&l[r.$buildXFAObject](t,a)||new Empty;h[n.$isNsAgnostic]()&&this._nsAgnosticLevel++;(c||o||h[n.$isNsAgnostic]())&&(h[n.$cleanup]={hasNamespace:c,prefixes:o,nsAgnostic:h[n.$isNsAgnostic]()});return h}isNsAgnostic(){return this._nsAgnosticLevel>0}_searchNamespace(e){let t=this._namespaces.get(e);if(t)return t;for(const[a,{check:n}]of Object.entries(r.NamespaceIds))if(n(e)){t=i.NamespaceSetUp[a];if(t){this._namespaces.set(e,t);return t}break}t=new o.UnknownNamespace(++this._nextNsId);this._namespaces.set(e,t);return t}_addNamespacePrefix(e){for(const{prefix:t,value:a}of e){const e=this._searchNamespace(a);let r=this._namespacePrefixes.get(t);if(!r){r=[];this._namespacePrefixes.set(t,r)}r.push(e)}}_getNamespaceToUse(e){if(!e)return this._currentNamespace;const t=this._namespacePrefixes.get(e);if(t&&t.length>0)return t.at(-1);(0,c.warn)(`Unknown namespace prefix: ${e}.`);return null}clean(e){const{hasNamespace:t,prefixes:a,nsAgnostic:r}=e;t&&(this._currentNamespace=this._namespaceStack.pop());a&&a.forEach((({prefix:e})=>{this._namespacePrefixes.get(e).pop()}));r&&this._nsAgnosticLevel--}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.NamespaceSetUp=void 0;var r=a(89),n=a(90),i=a(91),s=a(92),o=a(93),c=a(94),l=a(80),h=a(95),u=a(96);const d={config:r.ConfigNamespace,connection:n.ConnectionSetNamespace,datasets:i.DatasetsNamespace,localeSet:s.LocaleSetNamespace,signature:o.SignatureNamespace,stylesheet:c.StylesheetNamespace,template:l.TemplateNamespace,xdp:h.XdpNamespace,xhtml:u.XhtmlNamespace};t.NamespaceSetUp=d},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.ConfigNamespace=void 0;var r=a(77),n=a(75),i=a(76),s=a(2);const o=r.NamespaceIds.config.id;class Acrobat extends n.XFAObject{constructor(e){super(o,"acrobat",!0);this.acrobat7=null;this.autoSave=null;this.common=null;this.validate=null;this.validateApprovalSignatures=null;this.submitUrl=new n.XFAObjectArray}}class Acrobat7 extends n.XFAObject{constructor(e){super(o,"acrobat7",!0);this.dynamicRender=null}}class ADBE_JSConsole extends n.OptionObject{constructor(e){super(o,"ADBE_JSConsole",["delegate","Enable","Disable"])}}class ADBE_JSDebugger extends n.OptionObject{constructor(e){super(o,"ADBE_JSDebugger",["delegate","Enable","Disable"])}}class AddSilentPrint extends n.Option01{constructor(e){super(o,"addSilentPrint")}}class AddViewerPreferences extends n.Option01{constructor(e){super(o,"addViewerPreferences")}}class AdjustData extends n.Option10{constructor(e){super(o,"adjustData")}}class AdobeExtensionLevel extends n.IntegerObject{constructor(e){super(o,"adobeExtensionLevel",0,(e=>e>=1&&e<=8))}}class Agent extends n.XFAObject{constructor(e){super(o,"agent",!0);this.name=e.name?e.name.trim():"";this.common=new n.XFAObjectArray}}class AlwaysEmbed extends n.ContentObject{constructor(e){super(o,"alwaysEmbed")}}class Amd extends n.StringObject{constructor(e){super(o,"amd")}}class Area extends n.XFAObject{constructor(e){super(o,"area");this.level=(0,i.getInteger)({data:e.level,defaultValue:0,validate:e=>e>=1&&e<=3});this.name=(0,i.getStringOption)(e.name,["","barcode","coreinit","deviceDriver","font","general","layout","merge","script","signature","sourceSet","templateCache"])}}class Attributes extends n.OptionObject{constructor(e){super(o,"attributes",["preserve","delegate","ignore"])}}class AutoSave extends n.OptionObject{constructor(e){super(o,"autoSave",["disabled","enabled"])}}class Base extends n.StringObject{constructor(e){super(o,"base")}}class BatchOutput extends n.XFAObject{constructor(e){super(o,"batchOutput");this.format=(0,i.getStringOption)(e.format,["none","concat","zip","zipCompress"])}}class BehaviorOverride extends n.ContentObject{constructor(e){super(o,"behaviorOverride")}[n.$finalize](){this[n.$content]=new Map(this[n.$content].trim().split(/\s+/).filter((e=>e.includes(":"))).map((e=>e.split(":",2))))}}class Cache extends n.XFAObject{constructor(e){super(o,"cache",!0);this.templateCache=null}}class Change extends n.Option01{constructor(e){super(o,"change")}}class Common extends n.XFAObject{constructor(e){super(o,"common",!0);this.data=null;this.locale=null;this.localeSet=null;this.messaging=null;this.suppressBanner=null;this.template=null;this.validationMessaging=null;this.versionControl=null;this.log=new n.XFAObjectArray}}class Compress extends n.XFAObject{constructor(e){super(o,"compress");this.scope=(0,i.getStringOption)(e.scope,["imageOnly","document"])}}class CompressLogicalStructure extends n.Option01{constructor(e){super(o,"compressLogicalStructure")}}class CompressObjectStream extends n.Option10{constructor(e){super(o,"compressObjectStream")}}class Compression extends n.XFAObject{constructor(e){super(o,"compression",!0);this.compressLogicalStructure=null;this.compressObjectStream=null;this.level=null;this.type=null}}class Config extends n.XFAObject{constructor(e){super(o,"config",!0);this.acrobat=null;this.present=null;this.trace=null;this.agent=new n.XFAObjectArray}}class Conformance extends n.OptionObject{constructor(e){super(o,"conformance",["A","B"])}}class ContentCopy extends n.Option01{constructor(e){super(o,"contentCopy")}}class Copies extends n.IntegerObject{constructor(e){super(o,"copies",1,(e=>e>=1))}}class Creator extends n.StringObject{constructor(e){super(o,"creator")}}class CurrentPage extends n.IntegerObject{constructor(e){super(o,"currentPage",0,(e=>e>=0))}}class Data extends n.XFAObject{constructor(e){super(o,"data",!0);this.adjustData=null;this.attributes=null;this.incrementalLoad=null;this.outputXSL=null;this.range=null;this.record=null;this.startNode=null;this.uri=null;this.window=null;this.xsl=null;this.excludeNS=new n.XFAObjectArray;this.transform=new n.XFAObjectArray}}class Debug extends n.XFAObject{constructor(e){super(o,"debug",!0);this.uri=null}}class DefaultTypeface extends n.ContentObject{constructor(e){super(o,"defaultTypeface");this.writingScript=(0,i.getStringOption)(e.writingScript,["*","Arabic","Cyrillic","EastEuropeanRoman","Greek","Hebrew","Japanese","Korean","Roman","SimplifiedChinese","Thai","TraditionalChinese","Vietnamese"])}}class Destination extends n.OptionObject{constructor(e){super(o,"destination",["pdf","pcl","ps","webClient","zpl"])}}class DocumentAssembly extends n.Option01{constructor(e){super(o,"documentAssembly")}}class Driver extends n.XFAObject{constructor(e){super(o,"driver",!0);this.name=e.name?e.name.trim():"";this.fontInfo=null;this.xdc=null}}class DuplexOption extends n.OptionObject{constructor(e){super(o,"duplexOption",["simplex","duplexFlipLongEdge","duplexFlipShortEdge"])}}class DynamicRender extends n.OptionObject{constructor(e){super(o,"dynamicRender",["forbidden","required"])}}class Embed extends n.Option01{constructor(e){super(o,"embed")}}class Encrypt extends n.Option01{constructor(e){super(o,"encrypt")}}class Encryption extends n.XFAObject{constructor(e){super(o,"encryption",!0);this.encrypt=null;this.encryptionLevel=null;this.permissions=null}}class EncryptionLevel extends n.OptionObject{constructor(e){super(o,"encryptionLevel",["40bit","128bit"])}}class Enforce extends n.StringObject{constructor(e){super(o,"enforce")}}class Equate extends n.XFAObject{constructor(e){super(o,"equate");this.force=(0,i.getInteger)({data:e.force,defaultValue:1,validate:e=>0===e});this.from=e.from||"";this.to=e.to||""}}class EquateRange extends n.XFAObject{constructor(e){super(o,"equateRange");this.from=e.from||"";this.to=e.to||"";this._unicodeRange=e.unicodeRange||""}get unicodeRange(){const e=[],t=/U\+([0-9a-fA-F]+)/,a=this._unicodeRange;for(let r of a.split(",").map((e=>e.trim())).filter((e=>!!e))){r=r.split("-",2).map((e=>{const a=e.match(t);return a?parseInt(a[1],16):0}));1===r.length&&r.push(r[0]);e.push(r)}return(0,s.shadow)(this,"unicodeRange",e)}}class Exclude extends n.ContentObject{constructor(e){super(o,"exclude")}[n.$finalize](){this[n.$content]=this[n.$content].trim().split(/\s+/).filter((e=>e&&["calculate","close","enter","exit","initialize","ready","validate"].includes(e)))}}class ExcludeNS extends n.StringObject{constructor(e){super(o,"excludeNS")}}class FlipLabel extends n.OptionObject{constructor(e){super(o,"flipLabel",["usePrinterSetting","on","off"])}}class FontInfo extends n.XFAObject{constructor(e){super(o,"fontInfo",!0);this.embed=null;this.map=null;this.subsetBelow=null;this.alwaysEmbed=new n.XFAObjectArray;this.defaultTypeface=new n.XFAObjectArray;this.neverEmbed=new n.XFAObjectArray}}class FormFieldFilling extends n.Option01{constructor(e){super(o,"formFieldFilling")}}class GroupParent extends n.StringObject{constructor(e){super(o,"groupParent")}}class IfEmpty extends n.OptionObject{constructor(e){super(o,"ifEmpty",["dataValue","dataGroup","ignore","remove"])}}class IncludeXDPContent extends n.StringObject{constructor(e){super(o,"includeXDPContent")}}class IncrementalLoad extends n.OptionObject{constructor(e){super(o,"incrementalLoad",["none","forwardOnly"])}}class IncrementalMerge extends n.Option01{constructor(e){super(o,"incrementalMerge")}}class Interactive extends n.Option01{constructor(e){super(o,"interactive")}}class Jog extends n.OptionObject{constructor(e){super(o,"jog",["usePrinterSetting","none","pageSet"])}}class LabelPrinter extends n.XFAObject{constructor(e){super(o,"labelPrinter",!0);this.name=(0,i.getStringOption)(e.name,["zpl","dpl","ipl","tcpl"]);this.batchOutput=null;this.flipLabel=null;this.fontInfo=null;this.xdc=null}}class Layout extends n.OptionObject{constructor(e){super(o,"layout",["paginate","panel"])}}class Level extends n.IntegerObject{constructor(e){super(o,"level",0,(e=>e>0))}}class Linearized extends n.Option01{constructor(e){super(o,"linearized")}}class Locale extends n.StringObject{constructor(e){super(o,"locale")}}class LocaleSet extends n.StringObject{constructor(e){super(o,"localeSet")}}class Log extends n.XFAObject{constructor(e){super(o,"log",!0);this.mode=null;this.threshold=null;this.to=null;this.uri=null}}class MapElement extends n.XFAObject{constructor(e){super(o,"map",!0);this.equate=new n.XFAObjectArray;this.equateRange=new n.XFAObjectArray}}class MediumInfo extends n.XFAObject{constructor(e){super(o,"mediumInfo",!0);this.map=null}}class Message extends n.XFAObject{constructor(e){super(o,"message",!0);this.msgId=null;this.severity=null}}class Messaging extends n.XFAObject{constructor(e){super(o,"messaging",!0);this.message=new n.XFAObjectArray}}class Mode extends n.OptionObject{constructor(e){super(o,"mode",["append","overwrite"])}}class ModifyAnnots extends n.Option01{constructor(e){super(o,"modifyAnnots")}}class MsgId extends n.IntegerObject{constructor(e){super(o,"msgId",1,(e=>e>=1))}}class NameAttr extends n.StringObject{constructor(e){super(o,"nameAttr")}}class NeverEmbed extends n.ContentObject{constructor(e){super(o,"neverEmbed")}}class NumberOfCopies extends n.IntegerObject{constructor(e){super(o,"numberOfCopies",null,(e=>e>=2&&e<=5))}}class OpenAction extends n.XFAObject{constructor(e){super(o,"openAction",!0);this.destination=null}}class Output extends n.XFAObject{constructor(e){super(o,"output",!0);this.to=null;this.type=null;this.uri=null}}class OutputBin extends n.StringObject{constructor(e){super(o,"outputBin")}}class OutputXSL extends n.XFAObject{constructor(e){super(o,"outputXSL",!0);this.uri=null}}class Overprint extends n.OptionObject{constructor(e){super(o,"overprint",["none","both","draw","field"])}}class Packets extends n.StringObject{constructor(e){super(o,"packets")}[n.$finalize](){"*"!==this[n.$content]&&(this[n.$content]=this[n.$content].trim().split(/\s+/).filter((e=>["config","datasets","template","xfdf","xslt"].includes(e))))}}class PageOffset extends n.XFAObject{constructor(e){super(o,"pageOffset");this.x=(0,i.getInteger)({data:e.x,defaultValue:"useXDCSetting",validate:e=>!0});this.y=(0,i.getInteger)({data:e.y,defaultValue:"useXDCSetting",validate:e=>!0})}}class PageRange extends n.StringObject{constructor(e){super(o,"pageRange")}[n.$finalize](){const e=this[n.$content].trim().split(/\s+/).map((e=>parseInt(e,10))),t=[];for(let a=0,r=e.length;a<r;a+=2)t.push(e.slice(a,a+2));this[n.$content]=t}}class Pagination extends n.OptionObject{constructor(e){super(o,"pagination",["simplex","duplexShortEdge","duplexLongEdge"])}}class PaginationOverride extends n.OptionObject{constructor(e){super(o,"paginationOverride",["none","forceDuplex","forceDuplexLongEdge","forceDuplexShortEdge","forceSimplex"])}}class Part extends n.IntegerObject{constructor(e){super(o,"part",1,(e=>!1))}}class Pcl extends n.XFAObject{constructor(e){super(o,"pcl",!0);this.name=e.name||"";this.batchOutput=null;this.fontInfo=null;this.jog=null;this.mediumInfo=null;this.outputBin=null;this.pageOffset=null;this.staple=null;this.xdc=null}}class Pdf extends n.XFAObject{constructor(e){super(o,"pdf",!0);this.name=e.name||"";this.adobeExtensionLevel=null;this.batchOutput=null;this.compression=null;this.creator=null;this.encryption=null;this.fontInfo=null;this.interactive=null;this.linearized=null;this.openAction=null;this.pdfa=null;this.producer=null;this.renderPolicy=null;this.scriptModel=null;this.silentPrint=null;this.submitFormat=null;this.tagged=null;this.version=null;this.viewerPreferences=null;this.xdc=null}}class Pdfa extends n.XFAObject{constructor(e){super(o,"pdfa",!0);this.amd=null;this.conformance=null;this.includeXDPContent=null;this.part=null}}class Permissions extends n.XFAObject{constructor(e){super(o,"permissions",!0);this.accessibleContent=null;this.change=null;this.contentCopy=null;this.documentAssembly=null;this.formFieldFilling=null;this.modifyAnnots=null;this.plaintextMetadata=null;this.print=null;this.printHighQuality=null}}class PickTrayByPDFSize extends n.Option01{constructor(e){super(o,"pickTrayByPDFSize")}}class Picture extends n.StringObject{constructor(e){super(o,"picture")}}class PlaintextMetadata extends n.Option01{constructor(e){super(o,"plaintextMetadata")}}class Presence extends n.OptionObject{constructor(e){super(o,"presence",["preserve","dissolve","dissolveStructure","ignore","remove"])}}class Present extends n.XFAObject{constructor(e){super(o,"present",!0);this.behaviorOverride=null;this.cache=null;this.common=null;this.copies=null;this.destination=null;this.incrementalMerge=null;this.layout=null;this.output=null;this.overprint=null;this.pagination=null;this.paginationOverride=null;this.script=null;this.validate=null;this.xdp=null;this.driver=new n.XFAObjectArray;this.labelPrinter=new n.XFAObjectArray;this.pcl=new n.XFAObjectArray;this.pdf=new n.XFAObjectArray;this.ps=new n.XFAObjectArray;this.submitUrl=new n.XFAObjectArray;this.webClient=new n.XFAObjectArray;this.zpl=new n.XFAObjectArray}}class Print extends n.Option01{constructor(e){super(o,"print")}}class PrintHighQuality extends n.Option01{constructor(e){super(o,"printHighQuality")}}class PrintScaling extends n.OptionObject{constructor(e){super(o,"printScaling",["appdefault","noScaling"])}}class PrinterName extends n.StringObject{constructor(e){super(o,"printerName")}}class Producer extends n.StringObject{constructor(e){super(o,"producer")}}class Ps extends n.XFAObject{constructor(e){super(o,"ps",!0);this.name=e.name||"";this.batchOutput=null;this.fontInfo=null;this.jog=null;this.mediumInfo=null;this.outputBin=null;this.staple=null;this.xdc=null}}class Range extends n.ContentObject{constructor(e){super(o,"range")}[n.$finalize](){this[n.$content]=this[n.$content].trim().split(/\s*,\s*/,2).map((e=>e.split("-").map((e=>parseInt(e.trim(),10))))).filter((e=>e.every((e=>!isNaN(e))))).map((e=>{1===e.length&&e.push(e[0]);return e}))}}class Record extends n.ContentObject{constructor(e){super(o,"record")}[n.$finalize](){this[n.$content]=this[n.$content].trim();const e=parseInt(this[n.$content],10);!isNaN(e)&&e>=0&&(this[n.$content]=e)}}class Relevant extends n.ContentObject{constructor(e){super(o,"relevant")}[n.$finalize](){this[n.$content]=this[n.$content].trim().split(/\s+/)}}class Rename extends n.ContentObject{constructor(e){super(o,"rename")}[n.$finalize](){this[n.$content]=this[n.$content].trim();(this[n.$content].toLowerCase().startsWith("xml")||new RegExp("[\\p{L}_][\\p{L}\\d._\\p{M}-]*","u").test(this[n.$content]))&&(0,s.warn)("XFA - Rename: invalid XFA name")}}class RenderPolicy extends n.OptionObject{constructor(e){super(o,"renderPolicy",["server","client"])}}class RunScripts extends n.OptionObject{constructor(e){super(o,"runScripts",["both","client","none","server"])}}class Script extends n.XFAObject{constructor(e){super(o,"script",!0);this.currentPage=null;this.exclude=null;this.runScripts=null}}class ScriptModel extends n.OptionObject{constructor(e){super(o,"scriptModel",["XFA","none"])}}class Severity extends n.OptionObject{constructor(e){super(o,"severity",["ignore","error","information","trace","warning"])}}class SilentPrint extends n.XFAObject{constructor(e){super(o,"silentPrint",!0);this.addSilentPrint=null;this.printerName=null}}class Staple extends n.XFAObject{constructor(e){super(o,"staple");this.mode=(0,i.getStringOption)(e.mode,["usePrinterSetting","on","off"])}}class StartNode extends n.StringObject{constructor(e){super(o,"startNode")}}class StartPage extends n.IntegerObject{constructor(e){super(o,"startPage",0,(e=>!0))}}class SubmitFormat extends n.OptionObject{constructor(e){super(o,"submitFormat",["html","delegate","fdf","xml","pdf"])}}class SubmitUrl extends n.StringObject{constructor(e){super(o,"submitUrl")}}class SubsetBelow extends n.IntegerObject{constructor(e){super(o,"subsetBelow",100,(e=>e>=0&&e<=100))}}class SuppressBanner extends n.Option01{constructor(e){super(o,"suppressBanner")}}class Tagged extends n.Option01{constructor(e){super(o,"tagged")}}class Template extends n.XFAObject{constructor(e){super(o,"template",!0);this.base=null;this.relevant=null;this.startPage=null;this.uri=null;this.xsl=null}}class Threshold extends n.OptionObject{constructor(e){super(o,"threshold",["trace","error","information","warning"])}}class To extends n.OptionObject{constructor(e){super(o,"to",["null","memory","stderr","stdout","system","uri"])}}class TemplateCache extends n.XFAObject{constructor(e){super(o,"templateCache");this.maxEntries=(0,i.getInteger)({data:e.maxEntries,defaultValue:5,validate:e=>e>=0})}}class Trace extends n.XFAObject{constructor(e){super(o,"trace",!0);this.area=new n.XFAObjectArray}}class Transform extends n.XFAObject{constructor(e){super(o,"transform",!0);this.groupParent=null;this.ifEmpty=null;this.nameAttr=null;this.picture=null;this.presence=null;this.rename=null;this.whitespace=null}}class Type extends n.OptionObject{constructor(e){super(o,"type",["none","ascii85","asciiHex","ccittfax","flate","lzw","runLength","native","xdp","mergedXDP"])}}class Uri extends n.StringObject{constructor(e){super(o,"uri")}}class Validate extends n.OptionObject{constructor(e){super(o,"validate",["preSubmit","prePrint","preExecute","preSave"])}}class ValidateApprovalSignatures extends n.ContentObject{constructor(e){super(o,"validateApprovalSignatures")}[n.$finalize](){this[n.$content]=this[n.$content].trim().split(/\s+/).filter((e=>["docReady","postSign"].includes(e)))}}class ValidationMessaging extends n.OptionObject{constructor(e){super(o,"validationMessaging",["allMessagesIndividually","allMessagesTogether","firstMessageOnly","noMessages"])}}class Version extends n.OptionObject{constructor(e){super(o,"version",["1.7","1.6","1.5","1.4","1.3","1.2"])}}class VersionControl extends n.XFAObject{constructor(e){super(o,"VersionControl");this.outputBelow=(0,i.getStringOption)(e.outputBelow,["warn","error","update"]);this.sourceAbove=(0,i.getStringOption)(e.sourceAbove,["warn","error"]);this.sourceBelow=(0,i.getStringOption)(e.sourceBelow,["update","maintain"])}}class ViewerPreferences extends n.XFAObject{constructor(e){super(o,"viewerPreferences",!0);this.ADBE_JSConsole=null;this.ADBE_JSDebugger=null;this.addViewerPreferences=null;this.duplexOption=null;this.enforce=null;this.numberOfCopies=null;this.pageRange=null;this.pickTrayByPDFSize=null;this.printScaling=null}}class WebClient extends n.XFAObject{constructor(e){super(o,"webClient",!0);this.name=e.name?e.name.trim():"";this.fontInfo=null;this.xdc=null}}class Whitespace extends n.OptionObject{constructor(e){super(o,"whitespace",["preserve","ltrim","normalize","rtrim","trim"])}}class Window extends n.ContentObject{constructor(e){super(o,"window")}[n.$finalize](){const e=this[n.$content].trim().split(/\s*,\s*/,2).map((e=>parseInt(e,10)));if(e.some((e=>isNaN(e))))this[n.$content]=[0,0];else{1===e.length&&e.push(e[0]);this[n.$content]=e}}}class Xdc extends n.XFAObject{constructor(e){super(o,"xdc",!0);this.uri=new n.XFAObjectArray;this.xsl=new n.XFAObjectArray}}class Xdp extends n.XFAObject{constructor(e){super(o,"xdp",!0);this.packets=null}}class Xsl extends n.XFAObject{constructor(e){super(o,"xsl",!0);this.debug=null;this.uri=null}}class Zpl extends n.XFAObject{constructor(e){super(o,"zpl",!0);this.name=e.name?e.name.trim():"";this.batchOutput=null;this.flipLabel=null;this.fontInfo=null;this.xdc=null}}class ConfigNamespace{static[r.$buildXFAObject](e,t){if(ConfigNamespace.hasOwnProperty(e))return ConfigNamespace[e](t)}static acrobat(e){return new Acrobat(e)}static acrobat7(e){return new Acrobat7(e)}static ADBE_JSConsole(e){return new ADBE_JSConsole(e)}static ADBE_JSDebugger(e){return new ADBE_JSDebugger(e)}static addSilentPrint(e){return new AddSilentPrint(e)}static addViewerPreferences(e){return new AddViewerPreferences(e)}static adjustData(e){return new AdjustData(e)}static adobeExtensionLevel(e){return new AdobeExtensionLevel(e)}static agent(e){return new Agent(e)}static alwaysEmbed(e){return new AlwaysEmbed(e)}static amd(e){return new Amd(e)}static area(e){return new Area(e)}static attributes(e){return new Attributes(e)}static autoSave(e){return new AutoSave(e)}static base(e){return new Base(e)}static batchOutput(e){return new BatchOutput(e)}static behaviorOverride(e){return new BehaviorOverride(e)}static cache(e){return new Cache(e)}static change(e){return new Change(e)}static common(e){return new Common(e)}static compress(e){return new Compress(e)}static compressLogicalStructure(e){return new CompressLogicalStructure(e)}static compressObjectStream(e){return new CompressObjectStream(e)}static compression(e){return new Compression(e)}static config(e){return new Config(e)}static conformance(e){return new Conformance(e)}static contentCopy(e){return new ContentCopy(e)}static copies(e){return new Copies(e)}static creator(e){return new Creator(e)}static currentPage(e){return new CurrentPage(e)}static data(e){return new Data(e)}static debug(e){return new Debug(e)}static defaultTypeface(e){return new DefaultTypeface(e)}static destination(e){return new Destination(e)}static documentAssembly(e){return new DocumentAssembly(e)}static driver(e){return new Driver(e)}static duplexOption(e){return new DuplexOption(e)}static dynamicRender(e){return new DynamicRender(e)}static embed(e){return new Embed(e)}static encrypt(e){return new Encrypt(e)}static encryption(e){return new Encryption(e)}static encryptionLevel(e){return new EncryptionLevel(e)}static enforce(e){return new Enforce(e)}static equate(e){return new Equate(e)}static equateRange(e){return new EquateRange(e)}static exclude(e){return new Exclude(e)}static excludeNS(e){return new ExcludeNS(e)}static flipLabel(e){return new FlipLabel(e)}static fontInfo(e){return new FontInfo(e)}static formFieldFilling(e){return new FormFieldFilling(e)}static groupParent(e){return new GroupParent(e)}static ifEmpty(e){return new IfEmpty(e)}static includeXDPContent(e){return new IncludeXDPContent(e)}static incrementalLoad(e){return new IncrementalLoad(e)}static incrementalMerge(e){return new IncrementalMerge(e)}static interactive(e){return new Interactive(e)}static jog(e){return new Jog(e)}static labelPrinter(e){return new LabelPrinter(e)}static layout(e){return new Layout(e)}static level(e){return new Level(e)}static linearized(e){return new Linearized(e)}static locale(e){return new Locale(e)}static localeSet(e){return new LocaleSet(e)}static log(e){return new Log(e)}static map(e){return new MapElement(e)}static mediumInfo(e){return new MediumInfo(e)}static message(e){return new Message(e)}static messaging(e){return new Messaging(e)}static mode(e){return new Mode(e)}static modifyAnnots(e){return new ModifyAnnots(e)}static msgId(e){return new MsgId(e)}static nameAttr(e){return new NameAttr(e)}static neverEmbed(e){return new NeverEmbed(e)}static numberOfCopies(e){return new NumberOfCopies(e)}static openAction(e){return new OpenAction(e)}static output(e){return new Output(e)}static outputBin(e){return new OutputBin(e)}static outputXSL(e){return new OutputXSL(e)}static overprint(e){return new Overprint(e)}static packets(e){return new Packets(e)}static pageOffset(e){return new PageOffset(e)}static pageRange(e){return new PageRange(e)}static pagination(e){return new Pagination(e)}static paginationOverride(e){return new PaginationOverride(e)}static part(e){return new Part(e)}static pcl(e){return new Pcl(e)}static pdf(e){return new Pdf(e)}static pdfa(e){return new Pdfa(e)}static permissions(e){return new Permissions(e)}static pickTrayByPDFSize(e){return new PickTrayByPDFSize(e)}static picture(e){return new Picture(e)}static plaintextMetadata(e){return new PlaintextMetadata(e)}static presence(e){return new Presence(e)}static present(e){return new Present(e)}static print(e){return new Print(e)}static printHighQuality(e){return new PrintHighQuality(e)}static printScaling(e){return new PrintScaling(e)}static printerName(e){return new PrinterName(e)}static producer(e){return new Producer(e)}static ps(e){return new Ps(e)}static range(e){return new Range(e)}static record(e){return new Record(e)}static relevant(e){return new Relevant(e)}static rename(e){return new Rename(e)}static renderPolicy(e){return new RenderPolicy(e)}static runScripts(e){return new RunScripts(e)}static script(e){return new Script(e)}static scriptModel(e){return new ScriptModel(e)}static severity(e){return new Severity(e)}static silentPrint(e){return new SilentPrint(e)}static staple(e){return new Staple(e)}static startNode(e){return new StartNode(e)}static startPage(e){return new StartPage(e)}static submitFormat(e){return new SubmitFormat(e)}static submitUrl(e){return new SubmitUrl(e)}static subsetBelow(e){return new SubsetBelow(e)}static suppressBanner(e){return new SuppressBanner(e)}static tagged(e){return new Tagged(e)}static template(e){return new Template(e)}static templateCache(e){return new TemplateCache(e)}static threshold(e){return new Threshold(e)}static to(e){return new To(e)}static trace(e){return new Trace(e)}static transform(e){return new Transform(e)}static type(e){return new Type(e)}static uri(e){return new Uri(e)}static validate(e){return new Validate(e)}static validateApprovalSignatures(e){return new ValidateApprovalSignatures(e)}static validationMessaging(e){return new ValidationMessaging(e)}static version(e){return new Version(e)}static versionControl(e){return new VersionControl(e)}static viewerPreferences(e){return new ViewerPreferences(e)}static webClient(e){return new WebClient(e)}static whitespace(e){return new Whitespace(e)}static window(e){return new Window(e)}static xdc(e){return new Xdc(e)}static xdp(e){return new Xdp(e)}static xsl(e){return new Xsl(e)}static zpl(e){return new Zpl(e)}}t.ConfigNamespace=ConfigNamespace},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.ConnectionSetNamespace=void 0;var r=a(77),n=a(75);const i=r.NamespaceIds.connectionSet.id;class ConnectionSet extends n.XFAObject{constructor(e){super(i,"connectionSet",!0);this.wsdlConnection=new n.XFAObjectArray;this.xmlConnection=new n.XFAObjectArray;this.xsdConnection=new n.XFAObjectArray}}class EffectiveInputPolicy extends n.XFAObject{constructor(e){super(i,"effectiveInputPolicy");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class EffectiveOutputPolicy extends n.XFAObject{constructor(e){super(i,"effectiveOutputPolicy");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Operation extends n.StringObject{constructor(e){super(i,"operation");this.id=e.id||"";this.input=e.input||"";this.name=e.name||"";this.output=e.output||"";this.use=e.use||"";this.usehref=e.usehref||""}}class RootElement extends n.StringObject{constructor(e){super(i,"rootElement");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class SoapAction extends n.StringObject{constructor(e){super(i,"soapAction");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class SoapAddress extends n.StringObject{constructor(e){super(i,"soapAddress");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Uri extends n.StringObject{constructor(e){super(i,"uri");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class WsdlAddress extends n.StringObject{constructor(e){super(i,"wsdlAddress");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class WsdlConnection extends n.XFAObject{constructor(e){super(i,"wsdlConnection",!0);this.dataDescription=e.dataDescription||"";this.name=e.name||"";this.effectiveInputPolicy=null;this.effectiveOutputPolicy=null;this.operation=null;this.soapAction=null;this.soapAddress=null;this.wsdlAddress=null}}class XmlConnection extends n.XFAObject{constructor(e){super(i,"xmlConnection",!0);this.dataDescription=e.dataDescription||"";this.name=e.name||"";this.uri=null}}class XsdConnection extends n.XFAObject{constructor(e){super(i,"xsdConnection",!0);this.dataDescription=e.dataDescription||"";this.name=e.name||"";this.rootElement=null;this.uri=null}}class ConnectionSetNamespace{static[r.$buildXFAObject](e,t){if(ConnectionSetNamespace.hasOwnProperty(e))return ConnectionSetNamespace[e](t)}static connectionSet(e){return new ConnectionSet(e)}static effectiveInputPolicy(e){return new EffectiveInputPolicy(e)}static effectiveOutputPolicy(e){return new EffectiveOutputPolicy(e)}static operation(e){return new Operation(e)}static rootElement(e){return new RootElement(e)}static soapAction(e){return new SoapAction(e)}static soapAddress(e){return new SoapAddress(e)}static uri(e){return new Uri(e)}static wsdlAddress(e){return new WsdlAddress(e)}static wsdlConnection(e){return new WsdlConnection(e)}static xmlConnection(e){return new XmlConnection(e)}static xsdConnection(e){return new XsdConnection(e)}}t.ConnectionSetNamespace=ConnectionSetNamespace},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.DatasetsNamespace=void 0;var r=a(75),n=a(77);const i=n.NamespaceIds.datasets.id;class Data extends r.XmlObject{constructor(e){super(i,"data",e)}[r.$isNsAgnostic](){return!0}}class Datasets extends r.XFAObject{constructor(e){super(i,"datasets",!0);this.data=null;this.Signature=null}[r.$onChild](e){const t=e[r.$nodeName];("data"===t&&e[r.$namespaceId]===i||"Signature"===t&&e[r.$namespaceId]===n.NamespaceIds.signature.id)&&(this[t]=e);this[r.$appendChild](e)}}class DatasetsNamespace{static[n.$buildXFAObject](e,t){if(DatasetsNamespace.hasOwnProperty(e))return DatasetsNamespace[e](t)}static datasets(e){return new Datasets(e)}static data(e){return new Data(e)}}t.DatasetsNamespace=DatasetsNamespace},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.LocaleSetNamespace=void 0;var r=a(77),n=a(75),i=a(76);const s=r.NamespaceIds.localeSet.id;class CalendarSymbols extends n.XFAObject{constructor(e){super(s,"calendarSymbols",!0);this.name="gregorian";this.dayNames=new n.XFAObjectArray(2);this.eraNames=null;this.meridiemNames=null;this.monthNames=new n.XFAObjectArray(2)}}class CurrencySymbol extends n.StringObject{constructor(e){super(s,"currencySymbol");this.name=(0,i.getStringOption)(e.name,["symbol","isoname","decimal"])}}class CurrencySymbols extends n.XFAObject{constructor(e){super(s,"currencySymbols",!0);this.currencySymbol=new n.XFAObjectArray(3)}}class DatePattern extends n.StringObject{constructor(e){super(s,"datePattern");this.name=(0,i.getStringOption)(e.name,["full","long","med","short"])}}class DatePatterns extends n.XFAObject{constructor(e){super(s,"datePatterns",!0);this.datePattern=new n.XFAObjectArray(4)}}class DateTimeSymbols extends n.ContentObject{constructor(e){super(s,"dateTimeSymbols")}}class Day extends n.StringObject{constructor(e){super(s,"day")}}class DayNames extends n.XFAObject{constructor(e){super(s,"dayNames",!0);this.abbr=(0,i.getInteger)({data:e.abbr,defaultValue:0,validate:e=>1===e});this.day=new n.XFAObjectArray(7)}}class Era extends n.StringObject{constructor(e){super(s,"era")}}class EraNames extends n.XFAObject{constructor(e){super(s,"eraNames",!0);this.era=new n.XFAObjectArray(2)}}class Locale extends n.XFAObject{constructor(e){super(s,"locale",!0);this.desc=e.desc||"";this.name="isoname";this.calendarSymbols=null;this.currencySymbols=null;this.datePatterns=null;this.dateTimeSymbols=null;this.numberPatterns=null;this.numberSymbols=null;this.timePatterns=null;this.typeFaces=null}}class LocaleSet extends n.XFAObject{constructor(e){super(s,"localeSet",!0);this.locale=new n.XFAObjectArray}}class Meridiem extends n.StringObject{constructor(e){super(s,"meridiem")}}class MeridiemNames extends n.XFAObject{constructor(e){super(s,"meridiemNames",!0);this.meridiem=new n.XFAObjectArray(2)}}class Month extends n.StringObject{constructor(e){super(s,"month")}}class MonthNames extends n.XFAObject{constructor(e){super(s,"monthNames",!0);this.abbr=(0,i.getInteger)({data:e.abbr,defaultValue:0,validate:e=>1===e});this.month=new n.XFAObjectArray(12)}}class NumberPattern extends n.StringObject{constructor(e){super(s,"numberPattern");this.name=(0,i.getStringOption)(e.name,["full","long","med","short"])}}class NumberPatterns extends n.XFAObject{constructor(e){super(s,"numberPatterns",!0);this.numberPattern=new n.XFAObjectArray(4)}}class NumberSymbol extends n.StringObject{constructor(e){super(s,"numberSymbol");this.name=(0,i.getStringOption)(e.name,["decimal","grouping","percent","minus","zero"])}}class NumberSymbols extends n.XFAObject{constructor(e){super(s,"numberSymbols",!0);this.numberSymbol=new n.XFAObjectArray(5)}}class TimePattern extends n.StringObject{constructor(e){super(s,"timePattern");this.name=(0,i.getStringOption)(e.name,["full","long","med","short"])}}class TimePatterns extends n.XFAObject{constructor(e){super(s,"timePatterns",!0);this.timePattern=new n.XFAObjectArray(4)}}class TypeFace extends n.XFAObject{constructor(e){super(s,"typeFace",!0);this.name=""|e.name}}class TypeFaces extends n.XFAObject{constructor(e){super(s,"typeFaces",!0);this.typeFace=new n.XFAObjectArray}}class LocaleSetNamespace{static[r.$buildXFAObject](e,t){if(LocaleSetNamespace.hasOwnProperty(e))return LocaleSetNamespace[e](t)}static calendarSymbols(e){return new CalendarSymbols(e)}static currencySymbol(e){return new CurrencySymbol(e)}static currencySymbols(e){return new CurrencySymbols(e)}static datePattern(e){return new DatePattern(e)}static datePatterns(e){return new DatePatterns(e)}static dateTimeSymbols(e){return new DateTimeSymbols(e)}static day(e){return new Day(e)}static dayNames(e){return new DayNames(e)}static era(e){return new Era(e)}static eraNames(e){return new EraNames(e)}static locale(e){return new Locale(e)}static localeSet(e){return new LocaleSet(e)}static meridiem(e){return new Meridiem(e)}static meridiemNames(e){return new MeridiemNames(e)}static month(e){return new Month(e)}static monthNames(e){return new MonthNames(e)}static numberPattern(e){return new NumberPattern(e)}static numberPatterns(e){return new NumberPatterns(e)}static numberSymbol(e){return new NumberSymbol(e)}static numberSymbols(e){return new NumberSymbols(e)}static timePattern(e){return new TimePattern(e)}static timePatterns(e){return new TimePatterns(e)}static typeFace(e){return new TypeFace(e)}static typeFaces(e){return new TypeFaces(e)}}t.LocaleSetNamespace=LocaleSetNamespace},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.SignatureNamespace=void 0;var r=a(77),n=a(75);const i=r.NamespaceIds.signature.id;class Signature extends n.XFAObject{constructor(e){super(i,"signature",!0)}}class SignatureNamespace{static[r.$buildXFAObject](e,t){if(SignatureNamespace.hasOwnProperty(e))return SignatureNamespace[e](t)}static signature(e){return new Signature(e)}}t.SignatureNamespace=SignatureNamespace},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.StylesheetNamespace=void 0;var r=a(77),n=a(75);const i=r.NamespaceIds.stylesheet.id;class Stylesheet extends n.XFAObject{constructor(e){super(i,"stylesheet",!0)}}class StylesheetNamespace{static[r.$buildXFAObject](e,t){if(StylesheetNamespace.hasOwnProperty(e))return StylesheetNamespace[e](t)}static stylesheet(e){return new Stylesheet(e)}}t.StylesheetNamespace=StylesheetNamespace},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.XdpNamespace=void 0;var r=a(77),n=a(75);const i=r.NamespaceIds.xdp.id;class Xdp extends n.XFAObject{constructor(e){super(i,"xdp",!0);this.uuid=e.uuid||"";this.timeStamp=e.timeStamp||"";this.config=null;this.connectionSet=null;this.datasets=null;this.localeSet=null;this.stylesheet=new n.XFAObjectArray;this.template=null}[n.$onChildCheck](e){const t=r.NamespaceIds[e[n.$nodeName]];return t&&e[n.$namespaceId]===t.id}}class XdpNamespace{static[r.$buildXFAObject](e,t){if(XdpNamespace.hasOwnProperty(e))return XdpNamespace[e](t)}static xdp(e){return new Xdp(e)}}t.XdpNamespace=XdpNamespace},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.XhtmlNamespace=void 0;var r=a(75),n=a(77),i=a(82),s=a(76);const o=n.NamespaceIds.xhtml.id,c=Symbol(),l=new Set(["color","font","font-family","font-size","font-stretch","font-style","font-weight","margin","margin-bottom","margin-left","margin-right","margin-top","letter-spacing","line-height","orphans","page-break-after","page-break-before","page-break-inside","tab-interval","tab-stop","text-align","text-decoration","text-indent","vertical-align","widows","kerning-mode","xfa-font-horizontal-scale","xfa-font-vertical-scale","xfa-spacerun","xfa-tab-stops"]),h=new Map([["page-break-after","breakAfter"],["page-break-before","breakBefore"],["page-break-inside","breakInside"],["kerning-mode",e=>"none"===e?"none":"normal"],["xfa-font-horizontal-scale",e=>`scaleX(${Math.max(0,Math.min(parseInt(e)/100)).toFixed(2)})`],["xfa-font-vertical-scale",e=>`scaleY(${Math.max(0,Math.min(parseInt(e)/100)).toFixed(2)})`],["xfa-spacerun",""],["xfa-tab-stops",""],["font-size",(e,t)=>{e=t.fontSize=(0,s.getMeasurement)(e);return(0,i.measureToString)(.99*e)}],["letter-spacing",e=>(0,i.measureToString)((0,s.getMeasurement)(e))],["line-height",e=>(0,i.measureToString)((0,s.getMeasurement)(e))],["margin",e=>(0,i.measureToString)((0,s.getMeasurement)(e))],["margin-bottom",e=>(0,i.measureToString)((0,s.getMeasurement)(e))],["margin-left",e=>(0,i.measureToString)((0,s.getMeasurement)(e))],["margin-right",e=>(0,i.measureToString)((0,s.getMeasurement)(e))],["margin-top",e=>(0,i.measureToString)((0,s.getMeasurement)(e))],["text-indent",e=>(0,i.measureToString)((0,s.getMeasurement)(e))],["font-family",e=>e],["vertical-align",e=>(0,i.measureToString)((0,s.getMeasurement)(e))]]),u=/\s+/g,d=/[\r\n]+/g,f=/\r\n?/g;function mapStyle(e,t,a){const n=Object.create(null);if(!e)return n;const o=Object.create(null);for(const[t,a]of e.split(";").map((e=>e.split(":",2)))){const e=h.get(t);if(""===e)continue;let r=a;e&&(r="string"==typeof e?e:e(a,o));t.endsWith("scale")?n.transform?n.transform=`${n[t]} ${r}`:n.transform=r:n[t.replaceAll(/-([a-zA-Z])/g,((e,t)=>t.toUpperCase()))]=r}n.fontFamily&&(0,i.setFontFamily)({typeface:n.fontFamily,weight:n.fontWeight||"normal",posture:n.fontStyle||"normal",size:o.fontSize||0},t,t[r.$globalData].fontFinder,n);if(a&&n.verticalAlign&&"0px"!==n.verticalAlign&&n.fontSize){const e=.583,t=.333,a=(0,s.getMeasurement)(n.fontSize);n.fontSize=(0,i.measureToString)(a*e);n.verticalAlign=(0,i.measureToString)(Math.sign((0,s.getMeasurement)(n.verticalAlign))*a*t)}a&&n.fontSize&&(n.fontSize=`calc(${n.fontSize} * var(--scale-factor))`);(0,i.fixTextIndent)(n);return n}const g=new Set(["body","html"]);class XhtmlObject extends r.XmlObject{constructor(e,t){super(o,t);this[c]=!1;this.style=e.style||""}[r.$clean](e){super[r.$clean](e);this.style=function checkStyle(e){return e.style?e.style.trim().split(/\s*;\s*/).filter((e=>!!e)).map((e=>e.split(/\s*:\s*/,2))).filter((([t,a])=>{"font-family"===t&&e[r.$globalData].usedTypefaces.add(a);return l.has(t)})).map((e=>e.join(":"))).join(";"):""}(this)}[r.$acceptWhitespace](){return!g.has(this[r.$nodeName])}[r.$onText](e,t=!1){if(t)this[c]=!0;else{e=e.replace(d,"");this.style.includes("xfa-spacerun:yes")||(e=e.replace(u," "))}e&&(this[r.$content]+=e)}[r.$pushGlyphs](e,t=!0){const a=Object.create(null),n={top:NaN,bottom:NaN,left:NaN,right:NaN};let i=null;for(const[e,t]of this.style.split(";").map((e=>e.split(":",2))))switch(e){case"font-family":a.typeface=(0,s.stripQuotes)(t);break;case"font-size":a.size=(0,s.getMeasurement)(t);break;case"font-weight":a.weight=t;break;case"font-style":a.posture=t;break;case"letter-spacing":a.letterSpacing=(0,s.getMeasurement)(t);break;case"margin":const e=t.split(/ \t/).map((e=>(0,s.getMeasurement)(e)));switch(e.length){case 1:n.top=n.bottom=n.left=n.right=e[0];break;case 2:n.top=n.bottom=e[0];n.left=n.right=e[1];break;case 3:n.top=e[0];n.bottom=e[2];n.left=n.right=e[1];break;case 4:n.top=e[0];n.left=e[1];n.bottom=e[2];n.right=e[3]}break;case"margin-top":n.top=(0,s.getMeasurement)(t);break;case"margin-bottom":n.bottom=(0,s.getMeasurement)(t);break;case"margin-left":n.left=(0,s.getMeasurement)(t);break;case"margin-right":n.right=(0,s.getMeasurement)(t);break;case"line-height":i=(0,s.getMeasurement)(t)}e.pushData(a,n,i);if(this[r.$content])e.addString(this[r.$content]);else for(const t of this[r.$getChildren]())"#text"!==t[r.$nodeName]?t[r.$pushGlyphs](e):e.addString(t[r.$content]);t&&e.popFont()}[r.$toHTML](e){const t=[];this[r.$extra]={children:t};this[r.$childrenToHTML]({});if(0===t.length&&!this[r.$content])return s.HTMLResult.EMPTY;let a;a=this[c]?this[r.$content]?this[r.$content].replace(f,"\n"):void 0:this[r.$content]||void 0;return s.HTMLResult.success({name:this[r.$nodeName],attributes:{href:this.href,style:mapStyle(this.style,this,this[c])},children:t,value:a})}}class A extends XhtmlObject{constructor(e){super(e,"a");this.href=(0,i.fixURL)(e.href)||""}}class B extends XhtmlObject{constructor(e){super(e,"b")}[r.$pushGlyphs](e){e.pushFont({weight:"bold"});super[r.$pushGlyphs](e);e.popFont()}}class Body extends XhtmlObject{constructor(e){super(e,"body")}[r.$toHTML](e){const t=super[r.$toHTML](e),{html:a}=t;if(!a)return s.HTMLResult.EMPTY;a.name="div";a.attributes.class=["xfaRich"];return t}}class Br extends XhtmlObject{constructor(e){super(e,"br")}[r.$text](){return"\n"}[r.$pushGlyphs](e){e.addString("\n")}[r.$toHTML](e){return s.HTMLResult.success({name:"br"})}}class Html extends XhtmlObject{constructor(e){super(e,"html")}[r.$toHTML](e){const t=[];this[r.$extra]={children:t};this[r.$childrenToHTML]({});if(0===t.length)return s.HTMLResult.success({name:"div",attributes:{class:["xfaRich"],style:{}},value:this[r.$content]||""});if(1===t.length){const e=t[0];if(e.attributes&&e.attributes.class.includes("xfaRich"))return s.HTMLResult.success(e)}return s.HTMLResult.success({name:"div",attributes:{class:["xfaRich"],style:{}},children:t})}}class I extends XhtmlObject{constructor(e){super(e,"i")}[r.$pushGlyphs](e){e.pushFont({posture:"italic"});super[r.$pushGlyphs](e);e.popFont()}}class Li extends XhtmlObject{constructor(e){super(e,"li")}}class Ol extends XhtmlObject{constructor(e){super(e,"ol")}}class P extends XhtmlObject{constructor(e){super(e,"p")}[r.$pushGlyphs](e){super[r.$pushGlyphs](e,!1);e.addString("\n");e.addPara();e.popFont()}[r.$text](){return this[r.$getParent]()[r.$getChildren]().at(-1)===this?super[r.$text]():super[r.$text]()+"\n"}}class Span extends XhtmlObject{constructor(e){super(e,"span")}}class Sub extends XhtmlObject{constructor(e){super(e,"sub")}}class Sup extends XhtmlObject{constructor(e){super(e,"sup")}}class Ul extends XhtmlObject{constructor(e){super(e,"ul")}}class XhtmlNamespace{static[n.$buildXFAObject](e,t){if(XhtmlNamespace.hasOwnProperty(e))return XhtmlNamespace[e](t)}static a(e){return new A(e)}static b(e){return new B(e)}static body(e){return new Body(e)}static br(e){return new Br(e)}static html(e){return new Html(e)}static i(e){return new I(e)}static li(e){return new Li(e)}static ol(e){return new Ol(e)}static p(e){return new P(e)}static span(e){return new Span(e)}static sub(e){return new Sub(e)}static sup(e){return new Sup(e)}static ul(e){return new Ul(e)}}t.XhtmlNamespace=XhtmlNamespace},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.UnknownNamespace=void 0;var r=a(77),n=a(75);class UnknownNamespace{constructor(e){this.namespaceId=e}[r.$buildXFAObject](e,t){return new n.XmlObject(this.namespaceId,e,t)}}t.UnknownNamespace=UnknownNamespace},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.DatasetReader=void 0;var r=a(2),n=a(3),i=a(64);function decodeString(e){try{return(0,r.stringToUTF8String)(e)}catch(t){(0,r.warn)(`UTF-8 decoding failed: "${t}".`);return e}}class DatasetXMLParser extends i.SimpleXMLParser{constructor(e){super(e);this.node=null}onEndElement(e){const t=super.onEndElement(e);if(t&&"xfa:datasets"===e){this.node=t;throw new Error("Aborting DatasetXMLParser.")}}}t.DatasetReader=class DatasetReader{constructor(e){if(e.datasets)this.node=new i.SimpleXMLParser({hasAttributes:!0}).parseFromString(e.datasets).documentElement;else{const t=new DatasetXMLParser({hasAttributes:!0});try{t.parseFromString(e["xdp:xdp"])}catch(e){}this.node=t.node}}getValue(e){if(!this.node||!e)return"";const t=this.node.searchNode((0,n.parseXFAPath)(e),0);if(!t)return"";const a=t.firstChild;return a&&"value"===a.nodeName?t.children.map((e=>decodeString(e.textContent))):decodeString(t.textContent)}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.XRef=void 0;var r=a(2),n=a(4),i=a(15),s=a(3),o=a(5),c=a(65);t.XRef=class XRef{constructor(e,t){this.stream=e;this.pdfManager=t;this.entries=[];this.xrefstms=Object.create(null);this._cacheMap=new Map;this._pendingRefs=new n.RefSet;this._newPersistentRefNum=null;this._newTemporaryRefNum=null}getNewPersistentRef(e){null===this._newPersistentRefNum&&(this._newPersistentRefNum=this.entries.length||1);const t=this._newPersistentRefNum++;this._cacheMap.set(t,e);return n.Ref.get(t,0)}getNewTemporaryRef(){null===this._newTemporaryRefNum&&(this._newTemporaryRefNum=this.entries.length||1);return n.Ref.get(this._newTemporaryRefNum++,0)}resetNewTemporaryRef(){this._newTemporaryRefNum=null}setStartXRef(e){this.startXRefQueue=[e]}parse(e=!1){let t,a,i;if(e){(0,r.warn)("Indexing all PDF objects");t=this.indexObjects()}else t=this.readXRef();t.assignXref(this);this.trailer=t;try{a=t.get("Encrypt")}catch(e){if(e instanceof s.MissingDataException)throw e;(0,r.warn)(`XRef.parse - Invalid "Encrypt" reference: "${e}".`)}if(a instanceof n.Dict){const e=t.get("ID"),r=e&&e.length?e[0]:"";a.suppressEncryption=!0;this.encrypt=new c.CipherTransformFactory(a,r,this.pdfManager.password)}try{i=t.get("Root")}catch(e){if(e instanceof s.MissingDataException)throw e;(0,r.warn)(`XRef.parse - Invalid "Root" reference: "${e}".`)}if(i instanceof n.Dict)try{if(i.get("Pages")instanceof n.Dict){this.root=i;return}}catch(e){if(e instanceof s.MissingDataException)throw e;(0,r.warn)(`XRef.parse - Invalid "Pages" reference: "${e}".`)}if(!e)throw new s.XRefParseException;throw new r.InvalidPDFException("Invalid Root reference.")}processXRefTable(e){"tableState"in this||(this.tableState={entryNum:0,streamPos:e.lexer.stream.pos,parserBuf1:e.buf1,parserBuf2:e.buf2});const t=this.readXRefTable(e);if(!(0,n.isCmd)(t,"trailer"))throw new r.FormatError("Invalid XRef table: could not find trailer dictionary");let a=e.getObj();a instanceof n.Dict||!a.dict||(a=a.dict);if(!(a instanceof n.Dict))throw new r.FormatError("Invalid XRef table: could not parse trailer dictionary");delete this.tableState;return a}readXRefTable(e){const t=e.lexer.stream,a=this.tableState;t.pos=a.streamPos;e.buf1=a.parserBuf1;e.buf2=a.parserBuf2;let i;for(;;){if(!("firstEntryNum"in a)||!("entryCount"in a)){if((0,n.isCmd)(i=e.getObj(),"trailer"))break;a.firstEntryNum=i;a.entryCount=e.getObj()}let s=a.firstEntryNum;const o=a.entryCount;if(!Number.isInteger(s)||!Number.isInteger(o))throw new r.FormatError("Invalid XRef table: wrong types in subsection header");for(let i=a.entryNum;i<o;i++){a.streamPos=t.pos;a.entryNum=i;a.parserBuf1=e.buf1;a.parserBuf2=e.buf2;const c={};c.offset=e.getObj();c.gen=e.getObj();const l=e.getObj();if(l instanceof n.Cmd)switch(l.cmd){case"f":c.free=!0;break;case"n":c.uncompressed=!0}if(!Number.isInteger(c.offset)||!Number.isInteger(c.gen)||!c.free&&!c.uncompressed)throw new r.FormatError(`Invalid entry in XRef subsection: ${s}, ${o}`);0===i&&c.free&&1===s&&(s=0);this.entries[i+s]||(this.entries[i+s]=c)}a.entryNum=0;a.streamPos=t.pos;a.parserBuf1=e.buf1;a.parserBuf2=e.buf2;delete a.firstEntryNum;delete a.entryCount}if(this.entries[0]&&!this.entries[0].free)throw new r.FormatError("Invalid XRef table: unexpected first object");return i}processXRefStream(e){if(!("streamState"in this)){const t=e.dict,a=t.get("W");let r=t.get("Index");r||(r=[0,t.get("Size")]);this.streamState={entryRanges:r,byteWidths:a,entryNum:0,streamPos:e.pos}}this.readXRefStream(e);delete this.streamState;return e.dict}readXRefStream(e){const t=this.streamState;e.pos=t.streamPos;const[a,n,i]=t.byteWidths,s=t.entryRanges;for(;s.length>0;){const[o,c]=s;if(!Number.isInteger(o)||!Number.isInteger(c))throw new r.FormatError(`Invalid XRef range fields: ${o}, ${c}`);if(!Number.isInteger(a)||!Number.isInteger(n)||!Number.isInteger(i))throw new r.FormatError(`Invalid XRef entry fields length: ${o}, ${c}`);for(let s=t.entryNum;s<c;++s){t.entryNum=s;t.streamPos=e.pos;let c=0,l=0,h=0;for(let t=0;t<a;++t){const t=e.getByte();if(-1===t)throw new r.FormatError("Invalid XRef byteWidths 'type'.");c=c<<8|t}0===a&&(c=1);for(let t=0;t<n;++t){const t=e.getByte();if(-1===t)throw new r.FormatError("Invalid XRef byteWidths 'offset'.");l=l<<8|t}for(let t=0;t<i;++t){const t=e.getByte();if(-1===t)throw new r.FormatError("Invalid XRef byteWidths 'generation'.");h=h<<8|t}const u={};u.offset=l;u.gen=h;switch(c){case 0:u.free=!0;break;case 1:u.uncompressed=!0;break;case 2:break;default:throw new r.FormatError(`Invalid XRef entry type: ${c}`)}this.entries[o+s]||(this.entries[o+s]=u)}t.entryNum=0;t.streamPos=e.pos;s.splice(0,2)}}indexObjects(){const e=10,t=13,a=60;function readToken(r,n){let i="",s=r[n];for(;s!==e&&s!==t&&s!==a&&!(++n>=r.length);){i+=String.fromCharCode(s);s=r[n]}return i}function skipUntil(e,t,a){const r=a.length,n=e.length;let i=0;for(;t<n;){let n=0;for(;n<r&&e[t+n]===a[n];)++n;if(n>=r)break;t++;i++}return i}const o=/\b(endobj|\d+\s+\d+\s+obj|xref|trailer)\b/g,c=/\b(startxref|\d+\s+\d+\s+obj)\b/g,l=/^(\d+)\s+(\d+)\s+obj\b/,h=new Uint8Array([116,114,97,105,108,101,114]),u=new Uint8Array([115,116,97,114,116,120,114,101,102]),d=new Uint8Array([47,88,82,101,102]);this.entries.length=0;this._cacheMap.clear();const f=this.stream;f.pos=0;const g=f.getBytes(),p=(0,r.bytesToString)(g),m=g.length;let b=f.start;const y=[],w=[];for(;b<m;){let a=g[b];if(9===a||a===e||a===t||32===a){++b;continue}if(37===a){do{++b;if(b>=m)break;a=g[b]}while(a!==e&&a!==t);continue}const n=readToken(g,b);let S;if(n.startsWith("xref")&&(4===n.length||/\s/.test(n[4]))){b+=skipUntil(g,b,h);y.push(b);b+=skipUntil(g,b,u)}else if(S=l.exec(n)){const e=0|S[1],t=0|S[2],a=b+n.length;let c,l=!1;if(this.entries[e]){if(this.entries[e].gen===t)try{new i.Parser({lexer:new i.Lexer(f.makeSubStream(a))}).getObj();l=!0}catch(e){e instanceof s.ParserEOFException?(0,r.warn)(`indexObjects -- checking object (${n}): "${e}".`):l=!0}}else l=!0;l&&(this.entries[e]={offset:b-f.start,gen:t,uncompressed:!0});o.lastIndex=a;const h=o.exec(p);if(h){c=o.lastIndex+1-b;if("endobj"!==h[1]){(0,r.warn)(`indexObjects: Found "${h[1]}" inside of another "obj", caused by missing "endobj" -- trying to recover.`);c-=h[1].length+1}}else c=m-b;const u=g.subarray(b,b+c),y=skipUntil(u,0,d);if(y<c&&u[y+5]<64){w.push(b-f.start);this.xrefstms[b-f.start]=1}b+=c}else if(n.startsWith("trailer")&&(7===n.length||/\s/.test(n[7]))){y.push(b);const e=b+n.length;let t;c.lastIndex=e;const a=c.exec(p);if(a){t=c.lastIndex+1-b;if("startxref"!==a[1]){(0,r.warn)(`indexObjects: Found "${a[1]}" after "trailer", caused by missing "startxref" -- trying to recover.`);t-=a[1].length+1}}else t=m-b;b+=t}else b+=n.length+1}for(const e of w){this.startXRefQueue.push(e);this.readXRef(!0)}const S=[];let x,C,k=!1;for(const e of y){f.pos=e;const t=new i.Parser({lexer:new i.Lexer(f),xref:this,allowStreams:!0,recoveryMode:!0}),a=t.getObj();if(!(0,n.isCmd)(a,"trailer"))continue;const r=t.getObj();if(r instanceof n.Dict){S.push(r);r.has("Encrypt")&&(k=!0)}}for(const e of[...S,"genFallback",...S]){if("genFallback"===e){if(!C)break;this._generationFallback=!0;continue}let t=!1;try{const a=e.get("Root");if(!(a instanceof n.Dict))continue;const r=a.get("Pages");if(!(r instanceof n.Dict))continue;const i=r.get("Count");Number.isInteger(i)&&(t=!0)}catch(e){C=e;continue}if(t&&(!k||e.has("Encrypt"))&&e.has("ID"))return e;x=e}if(x)return x;if(this.topDict)return this.topDict;throw new r.InvalidPDFException("Invalid PDF structure.")}readXRef(e=!1){const t=this.stream,a=new Set;for(;this.startXRefQueue.length;){try{const e=this.startXRefQueue[0];if(a.has(e)){(0,r.warn)("readXRef - skipping XRef table since it was already parsed.");this.startXRefQueue.shift();continue}a.add(e);t.pos=e+t.start;const s=new i.Parser({lexer:new i.Lexer(t),xref:this,allowStreams:!0});let c,l=s.getObj();if((0,n.isCmd)(l,"xref")){c=this.processXRefTable(s);this.topDict||(this.topDict=c);l=c.get("XRefStm");if(Number.isInteger(l)){const e=l;if(!(e in this.xrefstms)){this.xrefstms[e]=1;this.startXRefQueue.push(e)}}}else{if(!Number.isInteger(l))throw new r.FormatError("Invalid XRef stream header");if(!(Number.isInteger(s.getObj())&&(0,n.isCmd)(s.getObj(),"obj")&&(l=s.getObj())instanceof o.BaseStream))throw new r.FormatError("Invalid XRef stream");c=this.processXRefStream(l);this.topDict||(this.topDict=c);if(!c)throw new r.FormatError("Failed to read XRef stream")}l=c.get("Prev");Number.isInteger(l)?this.startXRefQueue.push(l):l instanceof n.Ref&&this.startXRefQueue.push(l.num)}catch(e){if(e instanceof s.MissingDataException)throw e;(0,r.info)("(while reading XRef): "+e)}this.startXRefQueue.shift()}if(this.topDict)return this.topDict;if(!e)throw new s.XRefParseException}getEntry(e){const t=this.entries[e];return t&&!t.free&&t.offset?t:null}fetchIfRef(e,t=!1){return e instanceof n.Ref?this.fetch(e,t):e}fetch(e,t=!1){if(!(e instanceof n.Ref))throw new Error("ref object is not a reference");const a=e.num,i=this._cacheMap.get(a);if(void 0!==i){i instanceof n.Dict&&!i.objId&&(i.objId=e.toString());return i}let s=this.getEntry(a);if(null===s){this._cacheMap.set(a,s);return s}if(this._pendingRefs.has(e)){this._pendingRefs.remove(e);(0,r.warn)(`Ignoring circular reference: ${e}.`);return n.CIRCULAR_REF}this._pendingRefs.put(e);try{s=s.uncompressed?this.fetchUncompressed(e,s,t):this.fetchCompressed(e,s,t);this._pendingRefs.remove(e)}catch(t){this._pendingRefs.remove(e);throw t}s instanceof n.Dict?s.objId=e.toString():s instanceof o.BaseStream&&(s.dict.objId=e.toString());return s}fetchUncompressed(e,t,a=!1){const c=e.gen;let l=e.num;if(t.gen!==c){const i=`Inconsistent generation in XRef: ${e}`;if(this._generationFallback&&t.gen<c){(0,r.warn)(i);return this.fetchUncompressed(n.Ref.get(l,t.gen),t,a)}throw new s.XRefEntryException(i)}const h=this.stream.makeSubStream(t.offset+this.stream.start),u=new i.Parser({lexer:new i.Lexer(h),xref:this,allowStreams:!0}),d=u.getObj(),f=u.getObj(),g=u.getObj();if(d!==l||f!==c||!(g instanceof n.Cmd))throw new s.XRefEntryException(`Bad (uncompressed) XRef entry: ${e}`);if("obj"!==g.cmd){if(g.cmd.startsWith("obj")){l=parseInt(g.cmd.substring(3),10);if(!Number.isNaN(l))return l}throw new s.XRefEntryException(`Bad (uncompressed) XRef entry: ${e}`)}(t=this.encrypt&&!a?u.getObj(this.encrypt.createCipherTransform(l,c)):u.getObj())instanceof o.BaseStream||this._cacheMap.set(l,t);return t}fetchCompressed(e,t,a=!1){const c=t.offset,l=this.fetch(n.Ref.get(c,0));if(!(l instanceof o.BaseStream))throw new r.FormatError("bad ObjStm stream");const h=l.dict.get("First"),u=l.dict.get("N");if(!Number.isInteger(h)||!Number.isInteger(u))throw new r.FormatError("invalid first and n parameters for ObjStm stream");let d=new i.Parser({lexer:new i.Lexer(l),xref:this,allowStreams:!0});const f=new Array(u),g=new Array(u);for(let e=0;e<u;++e){const t=d.getObj();if(!Number.isInteger(t))throw new r.FormatError(`invalid object number in the ObjStm stream: ${t}`);const a=d.getObj();if(!Number.isInteger(a))throw new r.FormatError(`invalid object offset in the ObjStm stream: ${a}`);f[e]=t;g[e]=a}const p=(l.start||0)+h,m=new Array(u);for(let e=0;e<u;++e){const t=e<u-1?g[e+1]-g[e]:void 0;if(t<0)throw new r.FormatError("Invalid offset in the ObjStm stream.");d=new i.Parser({lexer:new i.Lexer(l.makeSubStream(p+g[e],t,l.dict)),xref:this,allowStreams:!0});const a=d.getObj();m[e]=a;if(a instanceof o.BaseStream)continue;const n=f[e],s=this.entries[n];s&&s.offset===c&&s.gen===e&&this._cacheMap.set(n,a)}if(void 0===(t=m[t.gen]))throw new s.XRefEntryException(`Bad (compressed) XRef entry: ${e}`);return t}async fetchIfRefAsync(e,t){return e instanceof n.Ref?this.fetchAsync(e,t):e}async fetchAsync(e,t){try{return this.fetch(e,t)}catch(a){if(!(a instanceof s.MissingDataException))throw a;await this.pdfManager.requestRange(a.begin,a.end);return this.fetchAsync(e,t)}}getCatalogObj(){return this.root}}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.isNodeJS=void 0;const a=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type);t.isNodeJS=a},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.MessageHandler=void 0;var r=a(2);const n=1,i=2,s=1,o=2,c=3,l=4,h=5,u=6,d=7,f=8;function wrapReason(e){e instanceof Error||"object"==typeof e&&null!==e||(0,r.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.');switch(e.name){case"AbortException":return new r.AbortException(e.message);case"MissingPDFException":return new r.MissingPDFException(e.message);case"PasswordException":return new r.PasswordException(e.message,e.code);case"UnexpectedResponseException":return new r.UnexpectedResponseException(e.message,e.status);case"UnknownErrorException":return new r.UnknownErrorException(e.message,e.details);default:return new r.UnknownErrorException(e.message,e.toString())}}t.MessageHandler=class MessageHandler{constructor(e,t,a){this.sourceName=e;this.targetName=t;this.comObj=a;this.callbackId=1;this.streamId=1;this.streamSinks=Object.create(null);this.streamControllers=Object.create(null);this.callbackCapabilities=Object.create(null);this.actionHandler=Object.create(null);this._onComObjOnMessage=e=>{const t=e.data;if(t.targetName!==this.sourceName)return;if(t.stream){this._processStreamMessage(t);return}if(t.callback){const e=t.callbackId,a=this.callbackCapabilities[e];if(!a)throw new Error(`Cannot resolve callback ${e}`);delete this.callbackCapabilities[e];if(t.callback===n)a.resolve(t.data);else{if(t.callback!==i)throw new Error("Unexpected callback case");a.reject(wrapReason(t.reason))}return}const r=this.actionHandler[t.action];if(!r)throw new Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){const e=this.sourceName,s=t.sourceName;new Promise((function(e){e(r(t.data))})).then((function(r){a.postMessage({sourceName:e,targetName:s,callback:n,callbackId:t.callbackId,data:r})}),(function(r){a.postMessage({sourceName:e,targetName:s,callback:i,callbackId:t.callbackId,reason:wrapReason(r)})}))}else t.streamId?this._createStreamSink(t):r(t.data)};a.addEventListener("message",this._onComObjOnMessage)}on(e,t){const a=this.actionHandler;if(a[e])throw new Error(`There is already an actionName called "${e}"`);a[e]=t}send(e,t,a){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},a)}sendWithPromise(e,t,a){const n=this.callbackId++,i=(0,r.createPromiseCapability)();this.callbackCapabilities[n]=i;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:n,data:t},a)}catch(e){i.reject(e)}return i.promise}sendWithStream(e,t,a,n){const i=this.streamId++,o=this.sourceName,c=this.targetName,l=this.comObj;return new ReadableStream({start:a=>{const s=(0,r.createPromiseCapability)();this.streamControllers[i]={controller:a,startCall:s,pullCall:null,cancelCall:null,isClosed:!1};l.postMessage({sourceName:o,targetName:c,action:e,streamId:i,data:t,desiredSize:a.desiredSize},n);return s.promise},pull:e=>{const t=(0,r.createPromiseCapability)();this.streamControllers[i].pullCall=t;l.postMessage({sourceName:o,targetName:c,stream:u,streamId:i,desiredSize:e.desiredSize});return t.promise},cancel:e=>{(0,r.assert)(e instanceof Error,"cancel must have a valid reason");const t=(0,r.createPromiseCapability)();this.streamControllers[i].cancelCall=t;this.streamControllers[i].isClosed=!0;l.postMessage({sourceName:o,targetName:c,stream:s,streamId:i,reason:wrapReason(e)});return t.promise}},a)}_createStreamSink(e){const t=e.streamId,a=this.sourceName,n=e.sourceName,i=this.comObj,s=this,o=this.actionHandler[e.action],u={enqueue(e,s=1,o){if(this.isCancelled)return;const c=this.desiredSize;this.desiredSize-=s;if(c>0&&this.desiredSize<=0){this.sinkCapability=(0,r.createPromiseCapability)();this.ready=this.sinkCapability.promise}i.postMessage({sourceName:a,targetName:n,stream:l,streamId:t,chunk:e},o)},close(){if(!this.isCancelled){this.isCancelled=!0;i.postMessage({sourceName:a,targetName:n,stream:c,streamId:t});delete s.streamSinks[t]}},error(e){(0,r.assert)(e instanceof Error,"error must have a valid reason");if(!this.isCancelled){this.isCancelled=!0;i.postMessage({sourceName:a,targetName:n,stream:h,streamId:t,reason:wrapReason(e)})}},sinkCapability:(0,r.createPromiseCapability)(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};u.sinkCapability.resolve();u.ready=u.sinkCapability.promise;this.streamSinks[t]=u;new Promise((function(t){t(o(e.data,u))})).then((function(){i.postMessage({sourceName:a,targetName:n,stream:f,streamId:t,success:!0})}),(function(e){i.postMessage({sourceName:a,targetName:n,stream:f,streamId:t,reason:wrapReason(e)})}))}_processStreamMessage(e){const t=e.streamId,a=this.sourceName,n=e.sourceName,i=this.comObj,g=this.streamControllers[t],p=this.streamSinks[t];switch(e.stream){case f:e.success?g.startCall.resolve():g.startCall.reject(wrapReason(e.reason));break;case d:e.success?g.pullCall.resolve():g.pullCall.reject(wrapReason(e.reason));break;case u:if(!p){i.postMessage({sourceName:a,targetName:n,stream:d,streamId:t,success:!0});break}p.desiredSize<=0&&e.desiredSize>0&&p.sinkCapability.resolve();p.desiredSize=e.desiredSize;new Promise((function(e){e(p.onPull&&p.onPull())})).then((function(){i.postMessage({sourceName:a,targetName:n,stream:d,streamId:t,success:!0})}),(function(e){i.postMessage({sourceName:a,targetName:n,stream:d,streamId:t,reason:wrapReason(e)})}));break;case l:(0,r.assert)(g,"enqueue should have stream controller");if(g.isClosed)break;g.controller.enqueue(e.chunk);break;case c:(0,r.assert)(g,"close should have stream controller");if(g.isClosed)break;g.isClosed=!0;g.controller.close();this._deleteStreamController(g,t);break;case h:(0,r.assert)(g,"error should have stream controller");g.controller.error(wrapReason(e.reason));this._deleteStreamController(g,t);break;case o:e.success?g.cancelCall.resolve():g.cancelCall.reject(wrapReason(e.reason));this._deleteStreamController(g,t);break;case s:if(!p)break;new Promise((function(t){t(p.onCancel&&p.onCancel(wrapReason(e.reason)))})).then((function(){i.postMessage({sourceName:a,targetName:n,stream:o,streamId:t,success:!0})}),(function(e){i.postMessage({sourceName:a,targetName:n,stream:o,streamId:t,reason:wrapReason(e)})}));p.sinkCapability.reject(wrapReason(e.reason));p.isCancelled=!0;delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}}async _deleteStreamController(e,t){await Promise.allSettled([e.startCall&&e.startCall.promise,e.pullCall&&e.pullCall.promise,e.cancelCall&&e.cancelCall.promise]);delete this.streamControllers[t]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.PDFWorkerStream=void 0;var r=a(2);t.PDFWorkerStream=class PDFWorkerStream{constructor(e){this._msgHandler=e;this._contentLength=null;this._fullRequestReader=null;this._rangeRequestReaders=[]}getFullReader(){(0,r.assert)(!this._fullRequestReader,"PDFWorkerStream.getFullReader can only be called once.");this._fullRequestReader=new PDFWorkerStreamReader(this._msgHandler);return this._fullRequestReader}getRangeReader(e,t){const a=new PDFWorkerStreamRangeReader(e,t,this._msgHandler);this._rangeRequestReaders.push(a);return a}cancelAllRequests(e){this._fullRequestReader&&this._fullRequestReader.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}};class PDFWorkerStreamReader{constructor(e){this._msgHandler=e;this.onProgress=null;this._contentLength=null;this._isRangeSupported=!1;this._isStreamingSupported=!1;const t=this._msgHandler.sendWithStream("GetReader");this._reader=t.getReader();this._headersReady=this._msgHandler.sendWithPromise("ReaderHeadersReady").then((e=>{this._isStreamingSupported=e.isStreamingSupported;this._isRangeSupported=e.isRangeSupported;this._contentLength=e.contentLength}))}get headersReady(){return this._headersReady}get contentLength(){return this._contentLength}get isStreamingSupported(){return this._isStreamingSupported}get isRangeSupported(){return this._isRangeSupported}async read(){const{value:e,done:t}=await this._reader.read();return t?{value:void 0,done:!0}:{value:e.buffer,done:!1}}cancel(e){this._reader.cancel(e)}}class PDFWorkerStreamRangeReader{constructor(e,t,a){this._msgHandler=a;this.onProgress=null;const r=this._msgHandler.sendWithStream("GetRangeReader",{begin:e,end:t});this._reader=r.getReader()}get isStreamingSupported(){return!1}async read(){const{value:e,done:t}=await this._reader.read();return t?{value:void 0,done:!0}:{value:e.buffer,done:!1}}cancel(e){this._reader.cancel(e)}}}],t={};function __w_pdfjs_require__(a){var r=t[a];if(void 0!==r)return r.exports;var n=t[a]={exports:{}};e[a](n,n.exports,__w_pdfjs_require__);return n.exports}__w_pdfjs_require__.d=(e,t)=>{for(var a in t)__w_pdfjs_require__.o(t,a)&&!__w_pdfjs_require__.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})};__w_pdfjs_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);__w_pdfjs_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});Object.defineProperty(e,"__esModule",{value:!0})};var a={};(()=>{var e=a;Object.defineProperty(e,"__esModule",{value:!0});Object.defineProperty(e,"WorkerMessageHandler",{enumerable:!0,get:function(){return t.WorkerMessageHandler}});var t=__w_pdfjs_require__(1)})();return a})())); \ No newline at end of file
diff --git a/vhosts/blog/public/posts/2021-03-05/my-first-post/index.html b/vhosts/blog/public/posts/2021-03-05/my-first-post/index.html
new file mode 100644
index 00000000..d0e38c41
--- /dev/null
+++ b/vhosts/blog/public/posts/2021-03-05/my-first-post/index.html
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2021 nsfisis">
+ <meta name="description" content="これはテスト投稿です。これはテスト投稿です。これはテスト投稿です。">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>My First Post | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ <link rel="stylesheet" href="/hl.css?h=340e65ffd5c17713efc9107c06304f7b">
+ </head>
+ <body class="single">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <article class="post-single">
+ <header class="post-header">
+ <h1 class="post-title">My First Post</h1>
+ </header>
+ <div class="post-content">
+ <section>
+ <h2 id="changelog">更新履歴</h2>
+ <ol>
+ <li class="revision">
+ <time datetime="2021-03-05">2021-03-05</time>: 公開
+ </li>
+ </ol>
+ </section>
+ <section id="section--test">
+ <h2><a href="#section--test">Test</a></h2>
+ <p>
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ </p>
+ </section>
+ </div>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/posts/2021-03-30/phperkaigi-2021/index.html b/vhosts/blog/public/posts/2021-03-30/phperkaigi-2021/index.html
new file mode 100644
index 00000000..dbdd4de1
--- /dev/null
+++ b/vhosts/blog/public/posts/2021-03-30/phperkaigi-2021/index.html
@@ -0,0 +1,1031 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2021 nsfisis">
+ <meta name="description" content="2021-03-26 から 2021-03-28 にかけて開催された、PHPerKaigi 2021 に参加した。">
+ <meta name="keywords" content="カンファレンス,PHP,PHPerKaigi">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>PHPerKaigi 2021 | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ <link rel="stylesheet" href="/hl.css?h=340e65ffd5c17713efc9107c06304f7b">
+ </head>
+ <body class="single">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <article class="post-single">
+ <header class="post-header">
+ <h1 class="post-title">PHPerKaigi 2021</h1>
+ <ul class="post-tags">
+ <li class="tag">
+ <a href="/tags/conference/">カンファレンス</a>
+ </li>
+ <li class="tag">
+ <a href="/tags/php/">PHP</a>
+ </li>
+ <li class="tag">
+ <a href="/tags/phperkaigi/">PHPerKaigi</a>
+ </li>
+ </ul>
+ </header>
+ <div class="post-content">
+ <section>
+ <h2 id="changelog">更新履歴</h2>
+ <ol>
+ <li class="revision">
+ <time datetime="2021-03-30">2021-03-30</time>: 公開
+ </li>
+ </ol>
+ </section>
+ <section id="section--report">
+ <h2><a href="#section--report">PHPerKaigi 2021 参加レポ</a></h2>
+ <p>
+ 2021-03-26 から 2021-03-28 にかけて開催された、 <a href="https://phperkaigi.jp/2021/">PHPerKaigi 2021</a> に一般参加者として参加した。 弊社 <a href="https://www.dgcircus.com/">デジタルサーカス株式会社</a> (今年1月から勤務) はダイヤモンドスポンサーとなっており、スポンサー枠のチケットを使わせていただいた。
+ </p>
+
+ <p>
+ このようなカンファレンスには初めて参加するのでかねてより心待ちにしていたのだが、生憎2日目から体調を崩してしまい、この記事も途中までとなっている。まだ見ていないセッションも多いが、ひとまず現時点での参加レポを書いておく。
+ </p>
+
+ <p>
+ 発表はトラック A、B に分かれていたのだが、今回はすべて A トラックを視聴している (切り替えるのが面倒だっただけ)。
+ </p>
+
+ <section id="section--report-legend">
+ <h3><a href="#section--report-legend">凡例</a></h3>
+ <blockquote>
+ <p>
+ 発表・スライドのメモ (引用ではない)
+ </p>
+ </blockquote>
+
+ <p>
+ 感想など
+ </p>
+ </section>
+
+ <section id="section--report--day-0">
+ <h3><a href="#section--report--day-0">Day 0 前夜祭 (2021/03/27)</a></h3>
+ <section id="section--report--day-0--1730-a">
+ <h4><a href="#section--report--day-0--1730-a">17:30 [A]</a></h4>
+ <p>
+ PHP で AWS Lambda
+ </p>
+
+ <blockquote>
+ <p>
+ Rails のプロジェクトを PHPer のメンバのみでメンテ →他のメンバもわかる PHP にリプレースを検討
+ </p>
+
+ <ul>
+ <li>
+ サーバレス
+ </li>
+
+ <li>
+ サーバ・インフラの管理が不要
+ </li>
+
+ <li>
+ アプリケーションコードの知識だけで保守可能
+ </li>
+ </ul>
+
+ <p>
+ ゼロベースで作れる案件が (Railsの件とは別に) あるため、そちらで試験的に導入?
+ </p>
+
+ <p>
+ AWSの学習 AWS のドキュメント DevelopersIO
+ </p>
+
+ <p>
+ AWS Lambda のカスタムランタイムで PHP を動かす
+ </p>
+
+ <p>
+ サーバのセットアップや維持管理を気にしなくて良い サーバーレスで PHP を動かすツールがすでにある サーバーレス構築はすんなり
+ </p>
+
+ <p>
+ 今は Laravel がルーティングしている Laravel Livewire を Lambda に載せられないか? デプロイ方法は? バッチ処理は? (Lambda は 15分の制限)
+ </p>
+
+ <p>
+ Lambda でコンテナイメージがサポートされるように
+ </p>
+
+ <p>
+ 抽象化されたもの「だけ」しか知らないよりも具象の理解は助けになる
+ </p>
+ </blockquote>
+
+ <p>
+ AWS Lambda のような Function as a Service はマイクロサービス化における一つの到達点に思えるのだが、これを使って実際に web サービスを作る具体的なイメージがまだ見えない (注: すべて for me として書いている)。
+ </p>
+
+ <p>
+ PHP on AWS Lambda があれだけ簡単に動かせるのには驚いた。
+ </p>
+
+ <p>
+ 勝手に AWS Lambda だとフットプリントの軽さが求められそう (= PHP + Laravel などでは動かなさそう) だという先入観を持っていたのだが、この発表のデモによればそうでもないらしい。
+ </p>
+ </section>
+
+ <section id="section--report--day-0--1810-a">
+ <h4><a href="#section--report--day-0--1810-a">18:10 [A]</a></h4>
+ <p>
+ 大規模サイトの SEO
+ </p>
+
+ <blockquote>
+ <p>
+ 大規模サイト (100万ページ以上) Google の基準
+ </p>
+
+ <p>
+ クロールバジェットを意識したSEO
+ </p>
+
+ <p>
+ 大規模サイトでコンテンツが中頻度 (1回/週) で更新 OR 中規模サイト (10,000以上) でコンテンツが目まぐるしく変更される これを満たさないなら、クロールバジェットを考えなくてもいい
+ </p>
+
+ <p>
+ サーチコンソール 「カバレッジ」の「除外」 多すぎるのは問題→クロールバジェットを浪費している
+ </p>
+
+ <ul>
+ <li>
+ クエリの順番を決める
+ </li>
+
+ <li>
+ 空の値のルールを決めておく
+ </li>
+
+ <li>
+ リダイレクトすればインデックスはうまくいく
+ </li>
+
+ <li>
+ リンクが存在する限りクロールはされる
+ </li>
+ </ul>
+
+ <p>
+ リニューアル前のURL
+ </p>
+
+ <p>
+ インデックスは移行される リンクのURLが存在する限り、別のURLとしてクロールされる リダイレクトされるとはいえ、リニューアル前のURLは移行した方が良い リニューアルで無視されるようになったパラメータも注意
+ </p>
+
+ <p>
+ robotes.txt で拒否しているのにクロールされる 一時的に拒否を外して 404 や 301 を読ませる 内部リンクを確認する JS でのリンクに書き換え
+ </p>
+
+ <p>
+ クエリパラメータからURLのパスに <code>/tokyo?area=HOGE</code> → <code>/tokyo/HOGE</code>
+ </p>
+
+ <p>
+ URL 設計だいじ
+ </p>
+ </blockquote>
+
+ <p>
+ SEO (Search Engine Optimization) は大して知らないので新鮮な話が多かった。その分語れることも少ない……。
+ </p>
+ </section>
+
+ <section id="section--report--day-0--1850-a">
+ <h4><a href="#section--report--day-0--1850-a">18:50 [A]</a></h4>
+ <blockquote>
+ <p>
+ 知覚可能 操作可能 理解可能 堅牢 ちゃんとしたHTMLを書く (閉じタグ・入れ子構造など)
+ </p>
+
+ <ul>
+ <li>
+ 標準の HTML を適切に使う
+ </li>
+
+ <li>
+ WAI-ARIA
+ </li>
+
+ <li>
+ キーボードフレンドリー
+ </li>
+
+ <li>
+ マシンフレンドリー
+ </li>
+
+ <li>
+ SEOフレンドリー
+ </li>
+ </ul>
+
+ <p>
+ button タグ →キーボード h1 タグ →スクリーンリーダー・クローラ a タグ
+ </p>
+
+ <p>
+ WAI-ARIA HTML では表現できないセマンティクスを追加する
+ </p>
+
+ <ul>
+ <li>
+ ロール
+ <ul>
+ <li>
+ 何をするのか?
+ </li>
+
+ <li>
+ ユーザーアクションによって変化しない
+ </li>
+ </ul>
+ </li>
+
+ <li>
+ プロパティ
+ <ul>
+ <li>
+ 関連づけられたデータ
+ </li>
+ </ul>
+ </li>
+
+ <li>
+ ステート
+ <ul>
+ <li>
+ 現在の状態
+ </li>
+ </ul>
+ </li>
+ </ul>
+
+ <p>
+ まずは標準の HTML 要素で解決する 何でもかんでも WAI-ARIA を使えばいいというものではない
+ </p>
+
+ <p>
+ マウスホバーでツールチップが出てくるが、キーボード操作では出てこない
+ </p>
+
+ <p>
+ VoiceOver
+ </p>
+
+ <p>
+ 全ての属性を使う必要はない あくまでアクセシビリティを上げるための方法の一つにすぎない
+ </p>
+ </blockquote>
+
+ <p>
+ つい最近 WAI-ARIA についての記事を読んだばかりだったので個人的にタイムリーな話題だった。(あまりこの言葉を使いたくないのだが) いわゆる「健常者」にとって、こうした問題を普段の生活の中で意識するのは難しい。だからこそ情報へのアンテナは張っておくようにしたい。
+ </p>
+ </section>
+
+ <section id="section--report--day-0--1930-a">
+ <h4><a href="#section--report--day-0--1930-a">19:30 [A]</a></h4>
+ <p>
+ PHP で FUSE
+ </p>
+
+ <p>
+ 個人的に楽しみだった発表。
+ </p>
+
+ <blockquote>
+ <p>
+ VFS (virtual filesystem) vs 具体的なファイルシステム
+ </p>
+
+ <p>
+ 最適な実装方法は状況により異なる
+ </p>
+
+ <p>
+ アプリケーションに見せるAPIは変えずに実装を隠蔽する→VFS
+ </p>
+
+ <p>
+ カーネルのプログラムを作るのは難しい * 権限がデカすぎる * システム全体がクラッシュ * セキュリティリスク * 開発サイクルを回しづらい * ネイティブコードにコンパイルされる言語である必要がある
+ </p>
+
+ <p>
+ Filesystem in USEr space (FUSE)
+ </p>
+
+ <ul>
+ <li>
+ 特定の C の関数を呼ぶことで filesystem が作れる
+ </li>
+
+ <li>
+ FFI を持つ言語なら FUSE が使える
+ </li>
+ </ul>
+
+ <p>
+ SSHFS / s3fs / Docker Desktop
+ </p>
+
+ <p>
+ Linux 以外でも使える
+ </p>
+
+ <ul>
+ <li>
+ dokany (on Windows)
+ </li>
+
+ <li>
+ osxfuse
+ </li>
+ </ul>
+
+ <p>
+ VFS: システムコールが呼ばれると、ファイルシステムによってコール FUSE: カーネル空間からユーザ空間へ通信
+ </p>
+
+ <p>
+ 高レベルなラッパで型をつける
+ </p>
+
+ <p>
+ PHP 以外では Wordpress を FUSE にマウントする実装がある (C, Python など)
+ </p>
+
+ <ul>
+ <li>
+ grep できる
+ </li>
+
+ <li>
+ sed できる
+ </li>
+
+ <li>
+ 編集できる
+ </li>
+ </ul>
+ </blockquote>
+
+ <p>
+ 期待通りの興味深い発表だった。FUSE 自体も今回の発表で知ったのだが、これ本体の実装を見るのも面白そうだ。 この発表を聞きながらファイルシステムにマウントできそうなものを考えていたのだが、およそ木構造をしているものすべてと言えそうだ (ハンマーしか持っていないと云々)。何かできそうだがなかなか思いつかない。
+ </p>
+ </section>
+ </section>
+
+ <section id="section--report--day-1">
+ <h3><a href="#section--report--day-1">Day 1 (2021/03/27)</a></h3>
+ <section id="section--report--day-1--1050-a">
+ <h4><a href="#section--report--day-1--1050-a">10:50 [A]</a></h4>
+ <p>
+ ATDD
+ </p>
+
+ <blockquote>
+ <ul>
+ <li>
+ ユーザーストーリー
+ </li>
+
+ <li>
+ ユニットテスト
+ </li>
+
+ <li>
+ CI/CD
+ </li>
+ </ul>
+
+ <p>
+ ユーザストーリーの受け入れ条件が曖昧になりがち デグレチェックがユニットレベルでは収まらない場合、手動で同じシナリオをテストしている
+ </p>
+
+ <p>
+ Q2の強化 アジャイルテストの4象限
+ </p>
+
+ <p>
+ 技術面/ビジネス面 開発チーム支援(コーディング前・コーディング中)/製品批評(コーディング後)
+ </p>
+
+ <ul>
+ <li>
+ Q1: 技術面 &amp; チーム支援
+ <ul>
+ <li>
+ TDD
+ </li>
+
+ <li>
+ ユニットテストなど
+ </li>
+ </ul>
+ </li>
+
+ <li>
+ Q2: ビジネス面 &amp; チーム支援
+ <ul>
+ <li>
+ ATDD
+ </li>
+
+ <li>
+ ビジネス面の受け入れテストで駆動する
+ </li>
+ </ul>
+ </li>
+ </ul>
+
+ <p>
+ Agile Alliance ユーザストーリーのスキルレベルを高める
+ </p>
+
+ <p>
+ テストピラミッド
+ </p>
+
+ <ul>
+ <li>
+ UI Tests
+ </li>
+
+ <li>
+ Service Tests
+ </li>
+
+ <li>
+ Unit Tests
+ </li>
+
+ <li>
+ 異なる粒度のテストを書く
+ </li>
+
+ <li>
+ 高レベルになるほど、持つべきテストは少なくなる
+ <ul>
+ <li>
+ ピラミッド型になる
+ </li>
+ </ul>
+ </li>
+ </ul>
+
+ <p>
+ 高レベルテストが多すぎる→アイスクリームコーン アンチパターン
+ </p>
+
+ <p>
+ ATDD (Acceptance TDD) API経由・UI経由での高レベルテスト E2E test
+ </p>
+
+ <p>
+ ストーリ受け入れテスト
+ </p>
+
+ <p>
+ 入れ子のフィードバックループ ATDD(外側) と TDD(内側)
+ </p>
+
+ <p>
+ 外部品質・内部品質
+ </p>
+
+ <p>
+ バーティカルスライスのデリバリー
+ </p>
+
+ <ul>
+ <li>
+ cucumber
+ </li>
+
+ <li>
+ gauge
+ </li>
+
+ <li>
+ behat
+ </li>
+ </ul>
+
+ <p>
+ ユビキタス言語 手動テストもspecに書く 自動化は可能だがコスパが悪い 失敗することがわかっているテスト(レッドテスト)はCIから外す 失敗時の原因究明が難しい 饒舌なエラーメッセージ 状況のスナップショット
+ </p>
+
+ <p>
+ Continuous Testing
+ </p>
+ </blockquote>
+
+ <p>
+ User Acceptance Test (UAT) くらいの規模になると個人開発・趣味開発では触れない領域なので、大いに勉強になった。スライドに添付されている資料が相当に充実していたので、これを読むのが本番といった様相すら感じる。 高レベルテストの自動化は現在のプロジェクトでも感じており、自動化のチャンスは伺っている。とはいえセッションでも指摘されているように自動化することにコストがかかりすぎる領域があるのも事実で、そのバランスが難しい。
+ </p>
+ </section>
+
+ <section id="section--report--day-1--1150-a">
+ <h4><a href="#section--report--day-1--1150-a">11:50 [A]</a></h4>
+ <p>
+ 型解析を用いたリファクタリング
+ </p>
+
+ <p>
+ 型のある世界で生きてきた身として大いに楽しみにしていた発表。
+ </p>
+
+ <blockquote>
+ <ul>
+ <li>
+ PHPStan
+ </li>
+
+ <li>
+ Phan
+ </li>
+
+ <li>
+ Psalm
+ </li>
+ </ul>
+
+ <p>
+ autoload も認識できる bootstrapFiles
+ </p>
+
+ <p>
+ 編集箇所と利用箇所を CI でチェック ルールレベルを徐々に引き上げていく 警告が多すぎると見落としてしまう・無視されやすくなる
+ </p>
+
+ <p>
+ 型がついていないことによるエラーが多い
+ </p>
+
+ <p>
+ 型よりも詳細な検査 <code>Util_Assert::min</code>
+ </p>
+
+ <p>
+ SQL を静的解析 placeholder の型付け
+ </p>
+
+ <p>
+ 警告レベルを低いレベルから導入 タイプヒントを積極的に書いていく PHPStan の拡張を追加する
+ </p>
+ </blockquote>
+
+ <p>
+ 昨今、動的型付き言語での型宣言・型アノテーション・型ヒントの導入が相次いでいる。長らく静的型付き言語を書いてきた私からすると、ようやく気づいたかといったところだが、ともかく型を導入する言語が増えてきた。 今のプロジェクトでも新しく追加するコードには型をつけるよう努めているが、どうしても古いコードには型がついていない。個人的には型のないコードに対してどう型を自動的に付けるかという点に興味があり、その点で Ruby の typeprof には注目している。
+ </p>
+ </section>
+
+ <section id="section--report--day-1--1230-a">
+ <h4><a href="#section--report--day-1--1230-a">12:30 [A]</a></h4>
+ <p>
+ 昼食をとっていた。事前に何か食料を買っておくべきだった。
+ </p>
+ </section>
+
+ <section id="section--report--day-1--1310-a">
+ <h4><a href="#section--report--day-1--1310-a">13:10 [A]</a></h4>
+ <p>
+ Documentation as Code
+ </p>
+
+ <p>
+ この発表も以前から非常に楽しみにしていた。
+ </p>
+
+ <blockquote>
+ <p>
+ 開発開始までのオーバーヘッド 新規にチームにジョイン 担当範囲外の機能を理解 オンボーディングのコスト
+ </p>
+
+ <p>
+ PHPerKaigi 2020 で発表あり
+ </p>
+
+ <p>
+ 継続的にシステムの理解を助けるドキュメント
+ </p>
+
+ <p>
+ 継続的ドキュメンテーション システムとドキュメントの乖離
+ </p>
+
+ <p>
+ 書いてあることが間違っている・足りない * 徐々にずれていく * システムの更新タイミングとドキュメントの更新タイミングに差がある
+ </p>
+
+ <p>
+ システムとドキュメントは対応関係がある * 間違ったドキュメント * 存在しないドキュメント
+ </p>
+
+ <p>
+ システムとドキュメントの乖離を定量化する 継続的に システムの更新に近いタイミングで ドキュメントを更新し続ける
+ </p>
+
+ <p>
+ Documentation as Code
+ </p>
+
+ <p>
+ コードと同じツールでドキュメントを書く * issue tracker * vcs * plain text markup * automation
+ </p>
+
+ <p>
+ 開発者 システム ドキュメント 構造化データ ソフトウェア
+ </p>
+
+ <p>
+ システムから構造化データを抽出する PHPDoc OpenAPI
+ </p>
+
+ <p>
+ ビュー 関心ごとに合わせてアーキテクチャを一つ以上の側面(断面)で説明する
+ </p>
+
+ <p>
+ ビューの単位でドキュメントに
+ </p>
+
+ <p>
+ スタックトレースからのドキュメント生成
+ </p>
+ </blockquote>
+
+ <p>
+ ドキュメントの管理は現プロジェクトでも課題と感じている。作られた当初は正しくても、実態と乖離していくのを止めるのは困難を極める。全体的に興味深い発表だったが、特にスタックトレースからのドキュメント生成というアイデアに惹かれるものを感じた。スタックトレースという実態と不可分な (乖離しない) 情報を起点にするのは理にかなっている。問題はトレースをいつ、どう取るかだろうか。それを自動化しなければ、実態との乖離が避けられないだろう。
+ </p>
+ </section>
+
+ <section id="section--report--day-1--1410-a">
+ <h4><a href="#section--report--day-1--1410-a">14:10 [A]</a></h4>
+ <p>
+ cookie による session 管理
+ </p>
+
+ <p>
+ 全体的に基本的な話だったので特に触れない。Cookie やセッションの話としては非常に分かりやすくまとめられていたので、知らない人が学ぶにはいい教材だろう。
+ </p>
+ </section>
+
+ <section id="section--report--day-1--1450-a">
+ <h4><a href="#section--report--day-1--1450-a">14:50 [A]</a></h4>
+ <p>
+ PHP のエラーと例外
+ </p>
+
+ <blockquote>
+ <p>
+ エラー PHPエンジンがエラーを通知する 例外 プログラムが投げる
+ </p>
+
+ <p>
+ PHP7-8とエラー
+ </p>
+
+ <p>
+ PHPエンジンのエラーの一部が に変換されるようになった → try-catch で捕捉できる
+ </p>
+
+ <p>
+ は例外とは異なる
+ </p>
+
+ <p>
+ PHP8 でエラーレベルの引き上げ
+ </p>
+
+ <ul>
+ <li>
+ 捕捉すべきもの
+ <ul>
+ <li>
+ recoverable
+ </li>
+ </ul>
+ </li>
+
+ <li>
+ 捕捉すべきでないもの
+ <ul>
+ <li>
+ unrecoverable
+ </li>
+
+ <li>
+ 開発時に対処できるもの
+ </li>
+ </ul>
+ </li>
+ </ul>
+
+ <p>
+ 例外 * 捕捉して事後処理 * 捕捉せず(or 捕捉した上で)さらに上に是非を問う
+ </p>
+
+ <p>
+ 開発段階で例外を把握し、ハンドリングを考えておく
+ </p>
+
+ <p>
+ と
+ </p>
+
+ <p>
+ はキャッチすべきでない
+ </p>
+
+ <ul>
+ <li>
+ <p>
+ </p>
+
+ <ul>
+ <li>
+ 本番で起きてはいけない
+ </li>
+ </ul>
+ </li>
+
+ <li>
+ <p>
+ </p>
+
+ <ul>
+ <li>
+ 本番で起きてはいけない →生じないのだから捕捉もしない
+ </li>
+ </ul>
+ </li>
+
+ <li>
+ <p>
+ </p>
+
+ <ul>
+ <li>
+ 起こるかもしれないので本番環境でも考慮する
+ </li>
+ </ul>
+ </li>
+ </ul>
+
+ <p>
+ 捕捉して対応するのではなく、未然に防ぐ
+ </p>
+
+ <p>
+ 独自例外を使う を投げてしまうと、 catch ()せざるを得ない →catch 範囲が広すぎる
+ </p>
+
+ <p>
+ SPL の例外を使う
+ </p>
+
+ <p>
+ 例外翻訳 上位のレイヤが下位のレイヤの例外を捕捉し、上位レイヤのAPIに「翻訳」する 下位レイヤの知識に依存させない
+ </p>
+
+ <p>
+ @throws 捕捉してほしい例外を書き連ねておく
+ </p>
+
+ <p>
+ 呼び出しもとに負わせたい責任
+ </p>
+ </blockquote>
+
+ <p>
+ PHP を学んでいる途中の私としては、今まさに聞きたい発表だった (現時点で PHP を書き始めてから 4ヶ月ほどになる)。
+ </p>
+
+ <p>
+ 個人的に例外やエラーを最もうまく扱っているのは Go、Swift、Rust、Haskell などのエラーを「値として」扱う言語だと思っている。try-catch は通常の処理フローを完全に壊してしまう上、構文としても重すぎる。値としてのエラー通知は C言語時代への回帰ともいえるが、その頃と異なるのはエラーを暗黙のうちに握り潰すことがないということだ。これらの言語は型を持っており、静的に検証ができる (C のそれはまともな型付けではない。念のため)。
+ </p>
+
+ <p>
+ PHP のように、すでに例外が言語システムに根ざしている言語ではどうすればよいか。この場合も同じく静的検証の力を借りることになるだろう。
+ </p>
+ </section>
+
+ <section id="section--report--day-1--1530-a">
+ <h4><a href="#section--report--day-1--1530-a">15:30 [A]</a></h4>
+ <p>
+ Laravel のメール認証
+ </p>
+
+ <p>
+ Laravel の知識がない私にはまったくついていけなかった。また、個人的にタイトルがややミスリーディングに感じた。
+ </p>
+ </section>
+
+ <section id="section--report--day-1--1610-a">
+ <h4><a href="#section--report--day-1--1610-a">16:10 [A]</a></h4>
+ <p>
+ gRPC
+ </p>
+
+ <blockquote>
+ <p>
+ Unary RPCs Server streaming RPCs Client streaming RPCs Bidirectional streaming RPCs
+ </p>
+
+ <p>
+ Protobuf
+ </p>
+
+ <p>
+ 実装とAPIが乖離しにくい 自動生成 複数言語でも相互に使える
+ </p>
+
+ <p>
+ マイクロサービスのサービス通信 スマホアプリ ゲームサーバ
+ </p>
+
+ <p>
+ PHP では?
+ </p>
+
+ <p>
+ PHP ではストリーミングが難しい リクエストごとにプロセスが使い捨て
+ </p>
+
+ <p>
+ PHP ではgRPCのクライアントしか対応していない
+ </p>
+
+ <p>
+ gRPC-Web ブラウザで扱うためのJSライブラリ+プロトコル
+ </p>
+
+ <p>
+ HTTP/1.1 でも使える Unary RPC と Server streaming RPC のみ
+ </p>
+
+ <p>
+ Envoy Nginx などで相互に gRPC と gRPC-Web で変換
+ </p>
+
+ <p>
+ Amp イベント駆動な並行処理のフレームワーク
+ </p>
+
+ <p>
+ HTTP/2 対応
+ </p>
+
+ <p>
+ C#のgRPC-Webが楽
+ </p>
+ </blockquote>
+
+ <p>
+ (発表の中でもまさに同じことをおっしゃっていたが) PHP 以外の方が向いているだろう、というのが第一の感想である。gRPC はそれ自体というよりも Protobuf というエコシステムに乗れることのメリットが大きいと感じる。そのエコシステムにうまく乗れない時点で、うーんという感じ。
+ </p>
+ </section>
+
+ <section id="section--report--day-1--1650-a">
+ <h4><a href="#section--report--day-1--1650-a">16:50 [A]</a></h4>
+ <p>
+ アーキテクチャテスト
+ </p>
+
+ <blockquote>
+ <p>
+ Independent Core Layer Pattern
+ </p>
+
+ <p>
+ 開発初期のアーキテクチャが崩れる アーキテクチャ観点のコードレビューができない
+ </p>
+
+ <p>
+ どこにクラスを置けばよいか? ドキュメントがない
+ </p>
+
+ <p>
+ アーキテクチャ設計に関する知識が属人化・暗黙知化
+ </p>
+
+ <p>
+ ガイドライン * 最初にルールを決めるのは簡単 * ルール通り作り始めるのも簡単 * →維持するのが難しい、人が決めたものゆえ壊れやすい
+ </p>
+
+ <p>
+ PHP の特性 * クラスは public * 可視性の制御が public / protected / private のみ * 依存関係の制御が困難
+ </p>
+
+ <p>
+ アーキテクチャテスト クラスの依存関係や実装ルールをコードとして表現し、自動テスト化する
+ </p>
+
+ <ul>
+ <li>
+ deptrac
+ </li>
+
+ <li>
+ phpat
+ </li>
+ </ul>
+
+ <p>
+ Independent Core Layer Pattern
+ </p>
+
+ <p>
+ アーキテクチャテストの失敗 * 実装誤り * or アーキテクチャが適切でない * 開発の過程でフィードバックしていく
+ </p>
+
+ <p>
+ モジュラーモノリス→マイクロサービスへ
+ </p>
+ </blockquote>
+ </section>
+ </section>
+
+ <section id="section--report--day-2">
+ <h3><a href="#section--report--day-2">Day 2 (2021/03/28)</a></h3>
+ <p>
+ 冒頭に書いた通り、2日目から体調が悪くまともに聴けていない。途中までは頭痛を我慢しつつ見ていたのだが、まともに入ってこなかった。
+ </p>
+
+ <p>
+ 残念ではあるが、いずれにせよ見られていない発表は他にもあるので、今週末にでもまとめて見ようと思う。
+ </p>
+ </section>
+
+ <section id="section--report--comments">
+ <h3><a href="#section--report--comments">全体の感想</a></h3>
+ <p>
+ Day 2 にほとんど参加できなかったのは残念だが、イベント自体は大変楽しく、また興味深いものであった。自分がまったく知らない領域の話を聞けるのはこうしたイベントならではだと感じる。オンライン開催ゆえ現地に行く必要がなく、気軽に参加できたのも (特に初参加者として) 嬉しいポイントだった。
+ </p>
+
+ <p>
+ 今回、雑談/登壇者への質問等向けに Discord サーバもあったのだが、こちらは参加こそしたものの ROM のままになってしまった。発表に1ウィンドウ、メモを書くのに1ウィンドウ、Discord 表示に 1ウィンドウで私にはもう脳のリソースとディスプレイのスペースが追いつかなかった (さらにいうと Zoom でアンカンファレンスもやっていたようだ。こちらはまったく参加していない)。
+ </p>
+
+ <p>
+ 1つ個人的な反省点としては、一つ一つのセッションを真剣に聞き過ぎたというものがある。もっと適当に聞いておけばよかった。これだけだと大変語弊があるのだが、言い方を変えると、Discord しかりアンカンファレンスしかり「このイベントのこの瞬間にしかないコンテンツ」に触れずに、後から見返せる発表やスライドに注力してしまった、ということだ。発表の詳細な見直しはあとからできるのだから、今しかできないことを考えるべきだった。 まあ初カンファレンスだし、とお茶を濁しておこう。
+ </p>
+
+ <p>
+ さて、カンファレンスで一つ気になったことがある。それは、Discord という書き込み場所が増えたことでニコ生のコメントの流量が吸い取られてしまったのではないか、という点だ。ニコニコだけ見ていると過疎っているかのように見えた発表も、Discord の方では盛り上がっている、というのを何度か見かけた。ニコニコのコメント方式は盛り上がりを如実に反映するが、逆もまたしかり。Discord があったこと自体はプラスだったと思うが、この点はマイナスだったのではないかと感じる。
+ </p>
+
+ <p>
+ <hr>
+ </hr>
+ </p>
+
+ <p>
+ 最後になりましたが、毎年の PHPerKaigi 開催にご尽力されている皆様、スピーカーの皆様、楽しい3日間でした。ありがとうございました! (ずっと常体で書いてしまったのでいきなり仏頂面から笑顔になったようで気持ち悪い)
+ </p>
+
+ <p>
+ ではまた来年。
+ </p>
+ </section>
+ </section>
+ </div>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/posts/2021-10-02/cpp-you-can-use-keywords-in-attributes/index.html b/vhosts/blog/public/posts/2021-10-02/cpp-you-can-use-keywords-in-attributes/index.html
new file mode 100644
index 00000000..75ba6ea9
--- /dev/null
+++ b/vhosts/blog/public/posts/2021-10-02/cpp-you-can-use-keywords-in-attributes/index.html
@@ -0,0 +1,200 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2021 nsfisis">
+ <meta name="description" content="C++ の属性構文の属性名には、キーワードが使える。ネタ記事。">
+ <meta name="keywords" content="C++,C++ 17">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>【C++】 属性構文の属性名にはキーワードが使える | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ <link rel="stylesheet" href="/hl.css?h=340e65ffd5c17713efc9107c06304f7b">
+ </head>
+ <body class="single">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <article class="post-single">
+ <header class="post-header">
+ <h1 class="post-title">【C++】 属性構文の属性名にはキーワードが使える</h1>
+ <ul class="post-tags">
+ <li class="tag">
+ <a href="/tags/cpp/">C++</a>
+ </li>
+ <li class="tag">
+ <a href="/tags/cpp17/">C++ 17</a>
+ </li>
+ </ul>
+ </header>
+ <div class="post-content">
+ <section>
+ <h2 id="changelog">更新履歴</h2>
+ <ol>
+ <li class="revision">
+ <time datetime="2021-10-02">2021-10-02</time>: Qiita から移植
+ </li>
+ </ol>
+ </section>
+ <div class="admonition">
+ <div class="admonition-label">
+ NOTE
+ </div>
+ <div class="admonition-content">
+ この記事は Qiita から移植してきたものです。 元 URL: <a href="https://qiita.com/nsfisis/items/94090937bcf860cfa93b">https://qiita.com/nsfisis/items/94090937bcf860cfa93b</a>
+ </div>
+ </div>
+
+ <p>
+ タイトル落ち。まずはこのコードを見て欲しい。
+ </p>
+
+ <pre class="highlight" language="cpp" linenumbering="unnumbered"><code class="highlight"><span class="hljs-meta">#<span class="hljs-keyword">include</span> <span class="hljs-string">&lt;iostream&gt;</span></span>
+
+[[<span class="hljs-keyword">alignas</span>]] [[<span class="hljs-keyword">alignof</span>]] [[<span class="hljs-keyword">and</span>]] [[<span class="hljs-keyword">and_eq</span>]] [[<span class="hljs-keyword">asm</span>]] [[<span class="hljs-keyword">auto</span>]] [[<span class="hljs-keyword">bitand</span>]]
+[[<span class="hljs-keyword">bitor</span>]] [[<span class="hljs-type">bool</span>]] [[<span class="hljs-keyword">break</span>]] [[<span class="hljs-keyword">case</span>]] [[<span class="hljs-keyword">catch</span>]] [[<span class="hljs-type">char</span>]] [[<span class="hljs-type">char16_t</span>]]
+[[<span class="hljs-type">char32_t</span>]] [[<span class="hljs-keyword">class</span>]] [[<span class="hljs-keyword">compl</span>]] [[<span class="hljs-type">const</span>]] [[<span class="hljs-keyword">const_cast</span>]] [[<span class="hljs-keyword">constexpr</span>]]
+[[<span class="hljs-keyword">continue</span>]] [[<span class="hljs-keyword">decltype</span>]] [[<span class="hljs-keyword">default</span>]] [[<span class="hljs-keyword">delete</span>]] [[<span class="hljs-keyword">do</span>]] [[<span class="hljs-type">double</span>]]
+[[<span class="hljs-keyword">dynamic_cast</span>]] [[<span class="hljs-keyword">else</span>]] [[<span class="hljs-keyword">enum</span>]] [[<span class="hljs-keyword">explicit</span>]] [[<span class="hljs-keyword">export</span>]] [[<span class="hljs-keyword">extern</span>]] [[<span class="hljs-literal">false</span>]]
+[[<span class="hljs-keyword">final</span>]] [[<span class="hljs-type">float</span>]] [[<span class="hljs-keyword">for</span>]] [[<span class="hljs-keyword">friend</span>]] [[<span class="hljs-keyword">goto</span>]] [[<span class="hljs-keyword">if</span>]] [[<span class="hljs-keyword">inline</span>]] [[<span class="hljs-type">int</span>]]
+[[<span class="hljs-type">long</span>]] [[<span class="hljs-keyword">mutable</span>]] [[<span class="hljs-keyword">namespace</span>]] [[<span class="hljs-keyword">new</span>]] [[<span class="hljs-keyword">noexcept</span>]] [[<span class="hljs-keyword">not</span>]] [[<span class="hljs-keyword">not_eq</span>]]
+[[<span class="hljs-literal">nullptr</span>]] [[<span class="hljs-keyword">operator</span>]] [[<span class="hljs-keyword">or</span>]] [[<span class="hljs-keyword">or_eq</span>]] [[<span class="hljs-keyword">override</span>]] [[<span class="hljs-keyword">private</span>]]
+[[<span class="hljs-keyword">protected</span>]] [[<span class="hljs-keyword">public</span>]] [[<span class="hljs-keyword">register</span>]] [[<span class="hljs-keyword">reinterpret_cast</span>]] [[<span class="hljs-keyword">return</span>]] [[<span class="hljs-type">short</span>]]
+[[<span class="hljs-type">signed</span>]] [[<span class="hljs-keyword">sizeof</span>]] [[<span class="hljs-type">static</span>]] [[<span class="hljs-keyword">static_assert</span>]] [[<span class="hljs-keyword">static_cast</span>]] [[<span class="hljs-keyword">struct</span>]]
+[[<span class="hljs-keyword">switch</span>]] [[<span class="hljs-keyword">template</span>]] [[<span class="hljs-keyword">this</span>]] [[<span class="hljs-keyword">thread_local</span>]] [[<span class="hljs-keyword">throw</span>]] [[<span class="hljs-literal">true</span>]] [[<span class="hljs-keyword">try</span>]]
+[[<span class="hljs-keyword">typedef</span>]] [[<span class="hljs-keyword">typeid</span>]] [[<span class="hljs-keyword">typename</span>]] [[<span class="hljs-keyword">union</span>]] [[<span class="hljs-type">unsigned</span>]]
+[[<span class="hljs-keyword">virtual</span>]] [[<span class="hljs-type">void</span>]] [[<span class="hljs-keyword">volatile</span>]] [[<span class="hljs-type">wchar_t</span>]] [[<span class="hljs-keyword">while</span>]] [[<span class="hljs-keyword">xor</span>]] [[<span class="hljs-keyword">xor_eq</span>]]
+<span class="hljs-comment">// [[using]]</span>
+<span class="hljs-type">int</span> <span class="hljs-built_in">main</span>() {
+ std::cout &lt;&lt; <span class="hljs-string">&quot;Hello, World!&quot;</span> &lt;&lt; std::endl;
+}</code></pre>
+
+ <blockquote>
+ <p>
+ コンパイラのバージョン $ clang++ –version Apple clang version 11.0.0 (clang-1100.0.33.8) Target: x86_64-apple-darwin19.6.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
+ </p>
+
+ <p>
+ コンパイルコマンド (C17指定) $ clang –std=c++17 hoge.cpp
+ </p>
+ </blockquote>
+
+ <p>
+ この記事から得られるものはこれ以上ないので以下は蛇足になる。
+ </p>
+
+ <p>
+ 別件で cppreference.com の <a href="https://en.cppreference.com/w/cpp/language/identifiers">identifier のページ</a> を読んでいた時、次の文が目に止まった。
+ </p>
+
+ <blockquote>
+ <ul>
+ <li>
+ the identifiers that are keywords cannot be used for other purposes;
+ <ul>
+ <li>
+ The only place they can be used as non-keywords is in an attribute-token. (e.g. [[private]] is a valid attribute) (since C++11)
+ </li>
+ </ul>
+ </li>
+ </ul>
+ </blockquote>
+
+ <p>
+ キーワードでも属性として指定する場合は非キーワードとして使えるらしい。 実際にやってみる。
+ </p>
+
+ <p>
+ 同サイトの <a href="https://en.cppreference.com/w/cpp/keyword">keywords のページ</a> から一覧を拝借し、上のコードが出来上がった (C++17 においてキーワードでないものなど、一部省いている)。 大量の警告 (unknown attribute `〇〇&apos; ignored) がコンパイラから出力されるが、コンパイルできる。
+ </p>
+
+ <p>
+ 上のコードでは <code>[[using]]</code> をコメントアウトしているが、これは <code>using</code> キーワードのみ属性構文の中で意味を持つからであり、このコメントアウトを外すとコンパイルに失敗する。
+ </p>
+
+ <pre class="highlight" language="cpp" linenumbering="unnumbered"><code class="highlight"><span class="hljs-comment">// using の例</span>
+[[<span class="hljs-keyword">using</span> foo: attr1, attr2]] <span class="hljs-type">int</span> x; <span class="hljs-comment">// [[foo::attr1, foo::attr2]] の糖衣構文</span></code></pre>
+
+ <p>
+ C++17 の仕様も見てみる (正確には標準化前のドラフト)。
+ </p>
+
+ <p>
+ 引用元: <a href="https://timsong-cpp.github.io/cppwp/n4659/dcl.attr#grammar-4">https://timsong-cpp.github.io/cppwp/n4659/dcl.attr#grammar-4</a>
+ </p>
+
+ <blockquote>
+ <p>
+ If a keyword or an alternative token that satisfies the syntactic requirements of an identifier is contained in an attribute-token, it is considered an identifier.
+ </p>
+ </blockquote>
+
+ <p>
+ 「<code>identifier</code> の構文上の要件を満たすキーワードまたは代替トークンが <code>attribute-token</code> に含まれている場合、<code>identifier</code> とみなされる」とある。どうやら間違いないようだ。
+ </p>
+
+ <p>
+ ところで、代替トークン (alternative token) とは <code>and</code> (<code>&amp;</code>) や <code>bitor</code> (<code>|</code>) などのことだが、<code>identifier</code> の構文上の要件を満たさないような代替トークンなどあるのか? 疑問に思って調べたところ、代替トークンという語にはダイグラフも含まれるらしい (参考: <a href="https://timsong-cpp.github.io/cppwp/n4659/lex.digraph">同ドラフト</a>)
+ </p>
+
+ <ul>
+ <li>
+ <code>&lt;%</code> → <code>{</code>
+ </li>
+
+ <li>
+ <code>%&gt;</code> → <code>}</code>
+ </li>
+
+ <li>
+ <code>&lt;:</code> → <code>[</code>
+ </li>
+
+ <li>
+ <code>:&gt;</code> → <code>]</code>
+ </li>
+
+ <li>
+ <code>%:</code> → <code>#</code>
+ </li>
+
+ <li>
+ <code>%:%:</code> → <code>##</code>
+ </li>
+ </ul>
+
+ <p>
+ 「<code>identifier</code> の構文上の要件を満たさないような代替トークン」はこれらが当てはまると思われる。
+ </p>
+
+ <p>
+ 調べた感想: 字句解析器か構文解析器が辛そう
+ </p>
+ </div>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/posts/2021-10-02/python-unbound-local-error/index.html b/vhosts/blog/public/posts/2021-10-02/python-unbound-local-error/index.html
new file mode 100644
index 00000000..105b946b
--- /dev/null
+++ b/vhosts/blog/public/posts/2021-10-02/python-unbound-local-error/index.html
@@ -0,0 +1,130 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2021 nsfisis">
+ <meta name="description" content="Python における UnboundLocalError の理由と対処法。">
+ <meta name="keywords" content="Python,Python 3">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>【Python】 クロージャとUnboundLocalError: local variable &apos;x&apos; referenced before assignment | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ <link rel="stylesheet" href="/hl.css?h=340e65ffd5c17713efc9107c06304f7b">
+ </head>
+ <body class="single">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <article class="post-single">
+ <header class="post-header">
+ <h1 class="post-title">【Python】 クロージャとUnboundLocalError: local variable &apos;x&apos; referenced before assignment</h1>
+ <ul class="post-tags">
+ <li class="tag">
+ <a href="/tags/python/">Python</a>
+ </li>
+ <li class="tag">
+ <a href="/tags/python3/">Python 3</a>
+ </li>
+ </ul>
+ </header>
+ <div class="post-content">
+ <section>
+ <h2 id="changelog">更新履歴</h2>
+ <ol>
+ <li class="revision">
+ <time datetime="2021-10-02">2021-10-02</time>: Qiita から移植
+ </li>
+ </ol>
+ </section>
+ <div class="admonition">
+ <div class="admonition-label">
+ NOTE
+ </div>
+ <div class="admonition-content">
+ この記事は Qiita から移植してきたものです。 元 URL: <a href="https://qiita.com/nsfisis/items/5d733703afcb35bbf399">https://qiita.com/nsfisis/items/5d733703afcb35bbf399</a>
+ </div>
+ </div>
+
+ <p>
+ 本記事は Python 3.7.6 の動作結果を元にして書かれている。
+ </p>
+
+ <p>
+ Python でクロージャを作ろうと、次のようなコードを書いた。
+ </p>
+
+ <pre class="highlight" language="python" linenumbering="unnumbered"><code class="highlight"><span class="hljs-keyword">def</span> <span class="hljs-title function_">f</span>():
+ x = <span class="hljs-number">0</span>
+ <span class="hljs-keyword">def</span> <span class="hljs-title function_">g</span>():
+ x += <span class="hljs-number">1</span>
+ g()
+
+f()</code></pre>
+
+ <p>
+ 関数 <code>g</code> から 関数 <code>f</code> のスコープ内で定義された変数 <code>x</code> を参照し、それに 1 を足そうとしている。 これを実行すると <code>x += 1</code> の箇所でエラーが発生する。
+ </p>
+
+ <blockquote>
+ <p>
+ UnboundLocalError: local variable `x&apos; referenced before assignment
+ </p>
+ </blockquote>
+
+ <p>
+ local変数 <code>x</code> が代入前に参照された、とある。これは、<code>f</code> の <code>x</code> を参照するのではなく、新しく別の変数を <code>g</code> 内に作ってしまっているため。 前述のコードを宣言と代入を便宜上分けて書き直すと次のようになる。<code>var</code> を変数宣言のための構文として擬似的に利用している。
+ </p>
+
+ <pre class="highlight" language="python" linenumbering="unnumbered"><code class="highlight"><span class="hljs-comment"># 注: var は正しい Python の文法ではない。上記参照のこと</span>
+<span class="hljs-keyword">def</span> <span class="hljs-title function_">f</span>():
+ var x <span class="hljs-comment"># f の local変数 &#x27;x&#x27; を宣言</span>
+ x = <span class="hljs-number">0</span> <span class="hljs-comment"># x に 0 を代入</span>
+ <span class="hljs-keyword">def</span> <span class="hljs-title function_">g</span>(): <span class="hljs-comment"># f の内部関数 g を定義</span>
+ var x <span class="hljs-comment"># g の local変数 &#x27;x&#x27; を宣言</span>
+ <span class="hljs-comment"># たまたま f にも同じ名前の変数があるが、それとは別の変数</span>
+ x += <span class="hljs-number">1</span> <span class="hljs-comment"># x に 1 を加算 (x = x + 1 の糖衣構文)</span>
+ <span class="hljs-comment"># 加算する前の値を参照しようとするが、まだ代入されていないためエラー</span>
+ g()</code></pre>
+
+ <p>
+ 当初の意図を表現するには、次のように書けばよい。
+ </p>
+
+ <pre class="highlight" language="python" linenumbering="unnumbered"><code class="highlight"><span class="hljs-keyword">def</span> <span class="hljs-title function_">f</span>():
+ x = <span class="hljs-number">0</span>
+ <span class="hljs-keyword">def</span> <span class="hljs-title function_">g</span>():
+ <span class="hljs-keyword">nonlocal</span> x <span class="hljs-comment">## (*)</span>
+ x += <span class="hljs-number">1</span>
+ g()</code></pre>
+
+ <p>
+ <code>(*)</code> のように、<code>nonlocal</code> を追加する。これにより一つ外側のスコープ (<code>g</code> の一つ外側 = <code>f</code>) で定義されている <code>x</code> を探しに行くようになる。
+ </p>
+ </div>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/posts/2021-10-02/ruby-detect-running-implementation/index.html b/vhosts/blog/public/posts/2021-10-02/ruby-detect-running-implementation/index.html
new file mode 100644
index 00000000..d9f9e79f
--- /dev/null
+++ b/vhosts/blog/public/posts/2021-10-02/ruby-detect-running-implementation/index.html
@@ -0,0 +1,217 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2021 nsfisis">
+ <meta name="description" content="Ruby には複数の実装があるが、自身を実行している処理系の種類をスクリプト上からどのように判定すればよいだろうか。">
+ <meta name="keywords" content="Ruby">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>【Ruby】 自身を実行している処理系の種類を判定する | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ <link rel="stylesheet" href="/hl.css?h=340e65ffd5c17713efc9107c06304f7b">
+ </head>
+ <body class="single">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <article class="post-single">
+ <header class="post-header">
+ <h1 class="post-title">【Ruby】 自身を実行している処理系の種類を判定する</h1>
+ <ul class="post-tags">
+ <li class="tag">
+ <a href="/tags/ruby/">Ruby</a>
+ </li>
+ </ul>
+ </header>
+ <div class="post-content">
+ <section>
+ <h2 id="changelog">更新履歴</h2>
+ <ol>
+ <li class="revision">
+ <time datetime="2021-10-02">2021-10-02</time>: Qiita から移植
+ </li>
+ </ol>
+ </section>
+ <div class="admonition">
+ <div class="admonition-label">
+ NOTE
+ </div>
+ <div class="admonition-content">
+ この記事は Qiita から移植してきたものです。 元 URL: <a href="https://qiita.com/nsfisis/items/74d7ffeeebc51b20d791">https://qiita.com/nsfisis/items/74d7ffeeebc51b20d791</a>
+ </div>
+ </div>
+
+ <p>
+ Ruby という言語には複数の実装があるが、それらをスクリプト上からどのようにして programmatically に見分ければよいだろうか。
+ </p>
+
+ <p>
+ <code>Object</code> クラスに定義されている <code>RUBY_ENGINE</code> という定数がこの用途に使える。
+ </p>
+
+ <p>
+ 参考: <a href="https://docs.ruby-lang.org/ja/latest/method/Object/c/RUBY_ENGINE.html">Object::RUBY_ENGINE</a>
+ </p>
+
+ <p>
+ 上記ページの例から引用する:
+ </p>
+
+ <pre class="highlight" language="shell-session" linenumbering="unnumbered"><code>$ ruby-1.9.1 -ve &apos;p RUBY_ENGINE&apos;
+ruby 1.9.1p0 (2009-03-04 revision 22762) [x86_64-linux]
+&quot;ruby&quot;
+$ jruby -ve &apos;p RUBY_ENGINE&apos;
+jruby 1.2.0 (ruby 1.8.6 patchlevel 287) (2009-03-16 rev 9419) [i386-java]
+&quot;jruby&quot;</code></pre>
+
+ <p>
+ それぞれの処理系がどのような値を返すかだが、stack overflow に良い質問と回答があった。
+ </p>
+
+ <p>
+ <a href="https://stackoverflow.com/a/9894232">What values for RUBY_ENGINE correspond to which Ruby implementations?</a> より引用:
+ </p>
+
+ <blockquote>
+ <table>
+ <thead>
+ <tr>
+ <td>
+ RUBY_ENGINE
+ </td>
+
+ <td>
+ Implementation
+ </td>
+ </tr>
+ </thead>
+
+ <tbody>
+ <tr>
+ <td>
+ &lt;undefined&gt;
+ </td>
+
+ <td>
+ MRI &lt; 1.9
+ </td>
+ </tr>
+
+ <tr>
+ <td>
+ `ruby&apos;
+ </td>
+
+ <td>
+ MRI &gt;= 1.9 or REE
+ </td>
+ </tr>
+
+ <tr>
+ <td>
+ `jruby&apos;
+ </td>
+
+ <td>
+ JRuby
+ </td>
+ </tr>
+
+ <tr>
+ <td>
+ `macruby&apos;
+ </td>
+
+ <td>
+ MacRuby
+ </td>
+ </tr>
+
+ <tr>
+ <td>
+ `rbx&apos;
+ </td>
+
+ <td>
+ Rubinius
+ </td>
+ </tr>
+
+ <tr>
+ <td>
+ `maglev&apos;
+ </td>
+
+ <td>
+ MagLev
+ </td>
+ </tr>
+
+ <tr>
+ <td>
+ `ironruby&apos;
+ </td>
+
+ <td>
+ IronRuby
+ </td>
+ </tr>
+
+ <tr>
+ <td>
+ `cardinal&apos;
+ </td>
+
+ <td>
+ Cardinal
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </blockquote>
+
+ <p>
+ なお、この質問・回答は 2014年になされたものであり、値は変わっている可能性がある。MRI (aka CRuby) については執筆時現在 (2020/12/8) も <code>&apos;ruby&apos;</code> が返ってくることを確認済み。
+ </p>
+
+ <p>
+ この表にない主要な処理系として、https://mruby.org[mruby] は <code>&apos;mruby&apos;</code> を返す。
+ </p>
+
+ <p>
+ <a href="https://github.com/mruby/mruby/blob/ed29d74bfd95362eaeb946fcf7e865d80346b62b/include/mruby/version.h#L32-L35">mruby 該当部分のソース</a> より引用:
+ </p>
+
+ <pre class="highlight" language="c" linenumbering="unnumbered"><code class="highlight"><span class="hljs-comment">/*
+* Ruby engine.
+*/</span>
+<span class="hljs-meta">#<span class="hljs-keyword">define</span> MRUBY_RUBY_ENGINE <span class="hljs-string">&quot;mruby&quot;</span></span></code></pre>
+ </div>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/posts/2021-10-02/ruby-then-keyword-and-case-in/index.html b/vhosts/blog/public/posts/2021-10-02/ruby-then-keyword-and-case-in/index.html
new file mode 100644
index 00000000..fcd653e2
--- /dev/null
+++ b/vhosts/blog/public/posts/2021-10-02/ruby-then-keyword-and-case-in/index.html
@@ -0,0 +1,290 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2021 nsfisis">
+ <meta name="description" content="Ruby 3.0 で追加される case in 構文と、then キーワードについて。">
+ <meta name="keywords" content="Ruby,Ruby 3">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>【Ruby】 then キーワードと case in | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ <link rel="stylesheet" href="/hl.css?h=340e65ffd5c17713efc9107c06304f7b">
+ </head>
+ <body class="single">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <article class="post-single">
+ <header class="post-header">
+ <h1 class="post-title">【Ruby】 then キーワードと case in</h1>
+ <ul class="post-tags">
+ <li class="tag">
+ <a href="/tags/ruby/">Ruby</a>
+ </li>
+ <li class="tag">
+ <a href="/tags/ruby3/">Ruby 3</a>
+ </li>
+ </ul>
+ </header>
+ <div class="post-content">
+ <section>
+ <h2 id="changelog">更新履歴</h2>
+ <ol>
+ <li class="revision">
+ <time datetime="2021-10-02">2021-10-02</time>: Qiita から移植
+ </li>
+ </ol>
+ </section>
+ <div class="admonition">
+ <div class="admonition-label">
+ NOTE
+ </div>
+ <div class="admonition-content">
+ この記事は Qiita から移植してきたものです。 元 URL: <a href="https://qiita.com/nsfisis/items/787a8cf888a304497223">https://qiita.com/nsfisis/items/787a8cf888a304497223</a>
+ </div>
+ </div>
+
+ <section id="section--tl-dr">
+ <h2><a href="#section--tl-dr">TL; DR</a></h2>
+ <p>
+ <code>case</code> - <code>in</code> によるパターンマッチング構文でも、<code>case</code> - <code>when</code> と同じように <code>then</code> が使える (場合によっては使う必要がある)。
+ </p>
+ </section>
+
+ <section id="section--what-is-then-keyword">
+ <h2><a href="#section--what-is-then-keyword"><code>then</code> とは</a></h2>
+ <p>
+ 使われることは稀だが、Ruby では <code>then</code> がキーワードになっている。次のように使う:
+ </p>
+
+ <pre class="highlight" language="ruby" linenumbering="unnumbered"><code class="highlight"><span class="hljs-keyword">if</span> cond <span class="hljs-keyword">then</span>
+ puts <span class="hljs-string">&quot;Y&quot;</span>
+<span class="hljs-keyword">else</span>
+ puts <span class="hljs-string">&quot;N&quot;</span>
+<span class="hljs-keyword">end</span></code></pre>
+
+ <p>
+ このキーワードが現れうる場所はいくつかあり、<code>if</code>、<code>unless</code>、<code>rescue</code>、<code>case</code> 構文がそれに当たる。 上記のように、何か条件を書いた後 <code>then</code> を置き、式がそこで終了していることを示すマーカーとして機能する。
+ </p>
+
+ <pre class="highlight" language="ruby" linenumbering="unnumbered"><code class="highlight"><span class="hljs-comment"># Example:</span>
+
+<span class="hljs-keyword">if</span> x <span class="hljs-keyword">then</span>
+ a
+<span class="hljs-keyword">end</span>
+
+<span class="hljs-keyword">unless</span> x <span class="hljs-keyword">then</span>
+ a
+<span class="hljs-keyword">end</span>
+
+<span class="hljs-keyword">begin</span>
+ a
+<span class="hljs-keyword">rescue</span> <span class="hljs-keyword">then</span>
+ b
+<span class="hljs-keyword">end</span>
+
+<span class="hljs-keyword">case</span> x
+<span class="hljs-keyword">when</span> p <span class="hljs-keyword">then</span>
+ a
+<span class="hljs-keyword">end</span></code></pre>
+ </section>
+
+ <section id="section--why-then-is-usually-unnecessary">
+ <h2><a href="#section--why-then-is-usually-unnecessary">なぜ普段は書かなくてもよいのか</a></h2>
+ <p>
+ 普通 Ruby のコードで <code>then</code> を書くことはない。なぜか。次のコードを実行してみるとわかる。
+ </p>
+
+ <pre class="highlight" language="ruby" linenumbering="unnumbered"><code class="highlight"><span class="hljs-keyword">if</span> <span class="hljs-literal">true</span> puts <span class="hljs-string">&#x27;Hello, World!&#x27;</span> <span class="hljs-keyword">end</span></code></pre>
+
+ <p>
+ 次のような構文エラーが出力される。
+ </p>
+
+ <pre class="highlight monospaced"><code>20:1: syntax error, unexpected local variable or method, expecting `then&apos; or &apos;;&apos; or &apos;\n&apos;
+if true puts &apos;Hello, World!&apos; end
+ ^~~~
+20:1: syntax error, unexpected `end&apos;, expecting end-of-input
+...f true puts &apos;Hello, World!&apos; end</code></pre>
+
+ <p>
+ 二つ目のメッセージは無視して一つ目を読むと、<code>then</code> か <code>;</code> か改行が来るはずのところ変数だかメソッドだかが現れたことによりエラーとなっているようだ。
+ </p>
+
+ <p>
+ ポイントは改行が <code>then</code> (や <code>;</code>) の代わりとなることである。<code>true</code> の後に改行を入れてみる。
+ </p>
+
+ <pre class="highlight" language="ruby" linenumbering="unnumbered"><code class="highlight"><span class="hljs-keyword">if</span> <span class="hljs-literal">true</span>
+puts <span class="hljs-string">&#x27;Hello, World!&#x27;</span> <span class="hljs-keyword">end</span></code></pre>
+
+ <p>
+ 無事 Hello, World! と出力されるようになった。
+ </p>
+ </section>
+
+ <section id="section--why-then-or-linebreak-is-needed">
+ <h2><a href="#section--why-then-or-linebreak-is-needed">なぜ <code>then</code> や <code>;</code> や改行が必要か</a></h2>
+ <p>
+ なぜ <code>then</code> や <code>;</code> や改行 (以下 「<code>then</code> 等」) が必要なのだろうか。次の例を見てほしい:
+ </p>
+
+ <pre class="highlight" language="ruby" linenumbering="unnumbered"><code class="highlight"><span class="hljs-keyword">if</span> a b <span class="hljs-keyword">end</span></code></pre>
+
+ <p>
+ <code>then</code> も <code>;</code> も改行もないのでエラーになるが、これは条件式がどこまで続いているのかわからないためだ。 この例は二通りに解釈できる。
+ </p>
+
+ <pre class="highlight" language="ruby" linenumbering="unnumbered"><code class="highlight"><span class="hljs-comment"># a という変数かメソッドの評価結果が truthy なら b という変数かメソッドを評価</span>
+<span class="hljs-keyword">if</span> a <span class="hljs-keyword">then</span>
+b
+<span class="hljs-keyword">end</span></code></pre>
+
+ <pre class="highlight" language="ruby" linenumbering="unnumbered"><code class="highlight"><span class="hljs-comment"># a というメソッドに b という変数かメソッドの評価結果を渡して呼び出し、</span>
+<span class="hljs-comment"># その結果が truthy なら何もしない</span>
+<span class="hljs-keyword">if</span> a(b) <span class="hljs-keyword">then</span>
+<span class="hljs-keyword">end</span></code></pre>
+
+ <p>
+ <code>then</code> 等はこの曖昧性を排除するためにあり、条件式は <code>if</code> から <code>then</code> 等までの間にある、ということを明確にする。 C系の <code>if</code> 後に来る <code>(</code>/<code>)</code> や、Python の <code>:</code>、Rust/Go/Swift などの <code>{</code> も同じ役割を持つ。
+ </p>
+
+ <p>
+ Ruby の場合、プログラマーが書きやすいよう改行でもって <code>then</code> が代用できるので、ほとんどの場合 <code>then</code> は必要ない。
+ </p>
+ </section>
+
+ <section id="section--then-in-case-in">
+ <h2><a href="#section--then-in-case-in"><code>case</code> - <code>in</code> における <code>then</code></a></h2>
+ <p>
+ ようやく本題にたどり着いた。来る Ruby 3.0 では <code>case</code> と <code>in</code> キーワードを使ったパターンマッチングの構文が入る予定である。この構文でもパターン部との区切りとして <code>then</code> 等が必要になる。 (現在の) Ruby には formal な形式での文法仕様は存在しないので、yacc の定義ファイルを参照した (yacc の説明は省略)。
+ </p>
+
+ <p>
+ <a href="https://github.com/ruby/ruby/blob/221ca0f8281d39f0dfdfe13b2448875384bbf735/parse.y#L3961-L3986">https://github.com/ruby/ruby/blob/221ca0f8281d39f0dfdfe13b2448875384bbf735/parse.y#L3961-L3986</a>
+ </p>
+
+ <pre class="highlight" language="yacc" linenumbering="unnumbered"><code>p_case_body : keyword_in
+{
+ SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
+ p-&gt;command_start = FALSE;
+ $&lt;ctxt&gt;1 = p-&gt;ctxt;
+ p-&gt;ctxt.in_kwarg = 1;
+ $&lt;tbl&gt;$ = push_pvtbl(p);
+}
+{
+ $&lt;tbl&gt;$ = push_pktbl(p);
+}
+p_top_expr then
+{
+ pop_pktbl(p, $&lt;tbl&gt;3);
+ pop_pvtbl(p, $&lt;tbl&gt;2);
+ p-&gt;ctxt.in_kwarg = $&lt;ctxt&gt;1.in_kwarg;
+}
+compstmt
+p_cases
+{
+ /*%%%*/
+ $$ = NEW_IN($4, $7, $8, &amp;@$);
+ /*% %*/
+ /*% ripper: in!($4, $7, escape_Qundef($8)) %*/
+}
+;</code></pre>
+
+ <p>
+ 簡略版:
+ </p>
+
+ <pre class="highlight" language="yacc" linenumbering="unnumbered"><code>p_case_body : keyword_in p_top_expr then compstmt p_cases
+;</code></pre>
+
+ <p>
+ ここで、<code>keyword_in</code> は文字通り <code>in</code>、<code>p_top_expr</code> はいわゆるパターン、<code>then</code> は <code>then</code> キーワードのことではなく、この記事で <code>then</code> 等と呼んでいるもの、つまり <code>then</code> キーワード、<code>;</code>、改行のいずれかである。
+ </p>
+
+ <p>
+ これにより、<code>case</code> - <code>when</code> による従来の構文と同じように、<code>then</code> 等をパターンの後ろに挿入すればよいことがわかった。つまり次の3通りのいずれかになる:
+ </p>
+
+ <pre class="highlight" language="ruby" linenumbering="unnumbered"><code class="highlight"><span class="hljs-keyword">case</span> x
+<span class="hljs-keyword">in</span> <span class="hljs-number">1</span> <span class="hljs-keyword">then</span> a
+<span class="hljs-keyword">in</span> <span class="hljs-number">2</span> <span class="hljs-keyword">then</span> b
+<span class="hljs-keyword">in</span> <span class="hljs-number">3</span> <span class="hljs-keyword">then</span> c
+<span class="hljs-keyword">end</span>
+
+<span class="hljs-keyword">case</span> x
+<span class="hljs-keyword">in</span> <span class="hljs-number">1</span>
+ a
+<span class="hljs-keyword">in</span> <span class="hljs-number">2</span>
+ b
+<span class="hljs-keyword">in</span> <span class="hljs-number">3</span>
+ c
+<span class="hljs-keyword">end</span>
+
+<span class="hljs-keyword">case</span> x
+<span class="hljs-keyword">in</span> <span class="hljs-number">1</span>; a
+<span class="hljs-keyword">in</span> <span class="hljs-number">2</span>; b
+<span class="hljs-keyword">in</span> <span class="hljs-number">3</span>; c
+<span class="hljs-keyword">end</span></code></pre>
+
+ <p>
+ ところで、<code>p_top_expr</code> には <code>if</code> による guard clause が書けるので、その場合は <code>if</code> - <code>then</code> と似たような見た目になる。
+ </p>
+
+ <pre class="highlight" language="ruby" linenumbering="unnumbered"><code class="highlight"><span class="hljs-keyword">case</span> x
+<span class="hljs-keyword">in</span> <span class="hljs-number">0</span> <span class="hljs-keyword">then</span> a
+<span class="hljs-keyword">in</span> n <span class="hljs-keyword">if</span> n &lt; <span class="hljs-number">0</span> <span class="hljs-keyword">then</span> b
+<span class="hljs-keyword">in</span> n <span class="hljs-keyword">then</span> c
+<span class="hljs-keyword">end</span></code></pre>
+ </section>
+
+ <section id="section--outro">
+ <h2><a href="#section--outro">まとめ</a></h2>
+ <ul>
+ <li>
+ <code>if</code> や <code>case</code> の条件の後ろには <code>then</code>、<code>;</code>、改行のいずれかが必要
+ <ul>
+ <li>
+ 通常は改行しておけばよい
+ </li>
+ </ul>
+ </li>
+
+ <li>
+ 3.0 で入る予定の <code>case</code> - <code>in</code> でも <code>then</code> 等が必要になる
+ </li>
+
+ <li>
+ Ruby の構文を正確に知るには (現状) <code>parse.y</code> を直接読めばよい
+ </li>
+ </ul>
+ </section>
+ </div>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/posts/2021-10-02/rust-where-are-primitive-types-from/index.html b/vhosts/blog/public/posts/2021-10-02/rust-where-are-primitive-types-from/index.html
new file mode 100644
index 00000000..7509e3a0
--- /dev/null
+++ b/vhosts/blog/public/posts/2021-10-02/rust-where-are-primitive-types-from/index.html
@@ -0,0 +1,258 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2021 nsfisis">
+ <meta name="description" content="Rust のプリミティブ型は予約語ではなく普通の識別子である。どのようにこれが名前解決されるのかを調べた。">
+ <meta name="keywords" content="Rust">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>Rust のプリミティブ型はどこからやって来るか | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ <link rel="stylesheet" href="/hl.css?h=340e65ffd5c17713efc9107c06304f7b">
+ </head>
+ <body class="single">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <article class="post-single">
+ <header class="post-header">
+ <h1 class="post-title">Rust のプリミティブ型はどこからやって来るか</h1>
+ <ul class="post-tags">
+ <li class="tag">
+ <a href="/tags/rust/">Rust</a>
+ </li>
+ </ul>
+ </header>
+ <div class="post-content">
+ <section>
+ <h2 id="changelog">更新履歴</h2>
+ <ol>
+ <li class="revision">
+ <time datetime="2021-10-02">2021-10-02</time>: Qiita から移植
+ </li>
+ </ol>
+ </section>
+ <div class="admonition">
+ <div class="admonition-label">
+ NOTE
+ </div>
+ <div class="admonition-content">
+ この記事は Qiita から移植してきたものです。 元 URL: <a href="https://qiita.com/nsfisis/items/9a429432258bbcd6c565">https://qiita.com/nsfisis/items/9a429432258bbcd6c565</a>
+ </div>
+ </div>
+
+ <section id="section--intro">
+ <h2><a href="#section--intro">前置き</a></h2>
+ <p>
+ Rust において、プリミティブ型の名前は予約語でない。したがって、次のコードは合法である。
+ </p>
+
+ <pre class="highlight" language="rust" linenumbering="unnumbered"><code class="highlight"><span class="hljs-meta">#![allow(non_camel_case_types)]</span>
+<span class="hljs-meta">#![allow(dead_code)]</span>
+
+<span class="hljs-keyword">struct</span> <span class="hljs-title class_">bool</span>;
+<span class="hljs-keyword">struct</span> <span class="hljs-title class_">char</span>;
+<span class="hljs-keyword">struct</span> <span class="hljs-title class_">i8</span>;
+<span class="hljs-keyword">struct</span> <span class="hljs-title class_">i16</span>;
+<span class="hljs-keyword">struct</span> <span class="hljs-title class_">i32</span>;
+<span class="hljs-keyword">struct</span> <span class="hljs-title class_">i64</span>;
+<span class="hljs-keyword">struct</span> <span class="hljs-title class_">i128</span>;
+<span class="hljs-keyword">struct</span> <span class="hljs-title class_">isize</span>;
+<span class="hljs-keyword">struct</span> <span class="hljs-title class_">u8</span>;
+<span class="hljs-keyword">struct</span> <span class="hljs-title class_">u16</span>;
+<span class="hljs-keyword">struct</span> <span class="hljs-title class_">u32</span>;
+<span class="hljs-keyword">struct</span> <span class="hljs-title class_">u64</span>;
+<span class="hljs-keyword">struct</span> <span class="hljs-title class_">u128</span>;
+<span class="hljs-keyword">struct</span> <span class="hljs-title class_">usize</span>;
+<span class="hljs-keyword">struct</span> <span class="hljs-title class_">f32</span>;
+<span class="hljs-keyword">struct</span> <span class="hljs-title class_">f64</span>;
+<span class="hljs-keyword">struct</span> <span class="hljs-title class_">str</span>;</code></pre>
+
+ <p>
+ では、普段単に <code>bool</code> と書いたとき、この <code>bool</code> は一体どこから来ているのか。rustc のソースを追ってみた。
+ </p>
+
+ <blockquote>
+ <p>
+ 前提知識: 一般的なコンパイラの構造、用語。<code>rustc</code> そのものの知識は不要 (というよりも筆者自身がよく知らない)
+ </p>
+ </blockquote>
+ </section>
+
+ <section id="section--code-reading">
+ <h2><a href="#section--code-reading">調査</a></h2>
+ <p>
+ 調査に使用したソース (調査時点での最新 master)
+ </p>
+
+ <p>
+ <a href="https://github.com/rust-lang/rust/tree/511ed9f2356af365ad8affe046b3dd33f7ac3c98">https://github.com/rust-lang/rust/tree/511ed9f2356af365ad8affe046b3dd33f7ac3c98</a>
+ </p>
+
+ <p>
+ どのようにして調べるか。rustc の構造には詳しくないため、すぐに当たりをつけるのは難しい。
+ </p>
+
+ <p>
+ 大雑把な構造としては、<code>compiler</code> フォルダ以下に <code>rustc_*</code> という名前のクレートが数十個入っている。これがどうやら <code>rustc</code> コマンドの実装部のようだ。
+ </p>
+
+ <p>
+ <code>rustc</code> はセルフホストされている (= <code>rustc</code> 自身が Rust で書かれている) ので、<code>bool</code> や <code>char</code> などで適当に検索をかけてもノイズが多すぎて話にならない。 しかし、お誂え向きなことに <code>i128</code>/<code>u128</code> というコンパイラ自身が使うことがなさそうな型が存在するのでこれを使って <code>git grep</code> してみる。
+ </p>
+
+ <pre class="highlight monospaced"><code>$ git grep &quot;\bi128\b&quot; | wc # i128
+165 1069 15790
+
+$ git grep &quot;\bu128\b&quot; | wc # u128
+293 2127 26667
+
+$ git grep &quot;\bbool\b&quot; | wc # cf. bool の結果
+3563 23577 294659</code></pre>
+
+ <p>
+ 165 程度であれば探すことができそうだ。今回は、クレート名を見ておおよその当たりをつけた。
+ </p>
+
+ <pre class="highlight monospaced"><code>$ git grep &quot;\bi128\b&quot;
+...
+rustc_resolve/src/lib.rs: table.insert(sym::i128, Int(IntTy::I128));
+...</code></pre>
+
+ <p>
+ <code>rustc_resolve</code> というのはいかにも名前解決を担いそうなクレート名である。該当箇所を見てみる。
+ </p>
+
+ <pre class="highlight" language="rust" linenumbering="unnumbered"><code class="highlight"><span class="hljs-comment">/// Interns the names of the primitive types.</span>
+<span class="hljs-comment">///</span>
+<span class="hljs-comment">/// All other types are defined somewhere and possibly imported, but the primitive ones need</span>
+<span class="hljs-comment">/// special handling, since they have no place of origin.</span>
+<span class="hljs-keyword">struct</span> <span class="hljs-title class_">PrimitiveTypeTable</span> {
+ primitive_types: FxHashMap&lt;Symbol, PrimTy&gt;,
+}
+
+<span class="hljs-keyword">impl</span> <span class="hljs-title class_">PrimitiveTypeTable</span> {
+ <span class="hljs-keyword">fn</span> <span class="hljs-title function_">new</span>() <span class="hljs-punctuation">-&gt;</span> PrimitiveTypeTable {
+ <span class="hljs-keyword">let</span> <span class="hljs-keyword">mut </span><span class="hljs-variable">table</span> = FxHashMap::<span class="hljs-title function_ invoke__">default</span>();
+
+ table.<span class="hljs-title function_ invoke__">insert</span>(sym::<span class="hljs-type">bool</span>, Bool);
+ table.<span class="hljs-title function_ invoke__">insert</span>(sym::<span class="hljs-type">char</span>, Char);
+ table.<span class="hljs-title function_ invoke__">insert</span>(sym::<span class="hljs-type">f32</span>, <span class="hljs-title function_ invoke__">Float</span>(FloatTy::F32));
+ table.<span class="hljs-title function_ invoke__">insert</span>(sym::<span class="hljs-type">f64</span>, <span class="hljs-title function_ invoke__">Float</span>(FloatTy::F64));
+ table.<span class="hljs-title function_ invoke__">insert</span>(sym::<span class="hljs-type">isize</span>, <span class="hljs-title function_ invoke__">Int</span>(IntTy::Isize));
+ table.<span class="hljs-title function_ invoke__">insert</span>(sym::<span class="hljs-type">i8</span>, <span class="hljs-title function_ invoke__">Int</span>(IntTy::I8));
+ table.<span class="hljs-title function_ invoke__">insert</span>(sym::<span class="hljs-type">i16</span>, <span class="hljs-title function_ invoke__">Int</span>(IntTy::I16));
+ table.<span class="hljs-title function_ invoke__">insert</span>(sym::<span class="hljs-type">i32</span>, <span class="hljs-title function_ invoke__">Int</span>(IntTy::I32));
+ table.<span class="hljs-title function_ invoke__">insert</span>(sym::<span class="hljs-type">i64</span>, <span class="hljs-title function_ invoke__">Int</span>(IntTy::I64));
+ table.<span class="hljs-title function_ invoke__">insert</span>(sym::<span class="hljs-type">i128</span>, <span class="hljs-title function_ invoke__">Int</span>(IntTy::I128));
+ table.<span class="hljs-title function_ invoke__">insert</span>(sym::<span class="hljs-type">str</span>, Str);
+ table.<span class="hljs-title function_ invoke__">insert</span>(sym::<span class="hljs-type">usize</span>, <span class="hljs-title function_ invoke__">Uint</span>(UintTy::Usize));
+ table.<span class="hljs-title function_ invoke__">insert</span>(sym::<span class="hljs-type">u8</span>, <span class="hljs-title function_ invoke__">Uint</span>(UintTy::U8));
+ table.<span class="hljs-title function_ invoke__">insert</span>(sym::<span class="hljs-type">u16</span>, <span class="hljs-title function_ invoke__">Uint</span>(UintTy::U16));
+ table.<span class="hljs-title function_ invoke__">insert</span>(sym::<span class="hljs-type">u32</span>, <span class="hljs-title function_ invoke__">Uint</span>(UintTy::U32));
+ table.<span class="hljs-title function_ invoke__">insert</span>(sym::<span class="hljs-type">u64</span>, <span class="hljs-title function_ invoke__">Uint</span>(UintTy::U64));
+ table.<span class="hljs-title function_ invoke__">insert</span>(sym::<span class="hljs-type">u128</span>, <span class="hljs-title function_ invoke__">Uint</span>(UintTy::U128));
+ <span class="hljs-keyword">Self</span> { primitive_types: table }
+ }
+}</code></pre>
+
+ <p>
+ これは初めに列挙したプリミティブ型の一覧と一致している。doc comment にも、
+ </p>
+
+ <blockquote>
+ <p>
+ All other types are defined somewhere and possibly imported, but the primitive ones need special handling, since they have no place of origin.
+ </p>
+ </blockquote>
+
+ <p>
+ とある。次はこの struct の使用箇所を追う。追うと言っても使われている箇所は次の一箇所しかない。なお説明に不要な箇所は大きく削っている。
+ </p>
+
+ <pre class="highlight" language="rust" linenumbering="unnumbered"><code class="highlight"><span class="hljs-comment">/// This resolves the identifier `ident` in the namespace `ns` in the current lexical scope.</span>
+<span class="hljs-comment">/// (略)</span>
+<span class="hljs-keyword">fn</span> <span class="hljs-title function_">resolve_ident_in_lexical_scope</span>(
+ &amp;<span class="hljs-keyword">mut</span> <span class="hljs-keyword">self</span>,
+ <span class="hljs-keyword">mut</span> ident: Ident,
+ ns: Namespace,
+ <span class="hljs-comment">// (略)</span>
+) <span class="hljs-punctuation">-&gt;</span> <span class="hljs-type">Option</span>&lt;LexicalScopeBinding&lt;<span class="hljs-symbol">&#x27;a</span>&gt;&gt; {
+ <span class="hljs-comment">// (略)</span>
+
+ <span class="hljs-keyword">if</span> ns == TypeNS {
+ <span class="hljs-keyword">if</span> <span class="hljs-keyword">let</span> <span class="hljs-variable">Some</span>(prim_ty) = <span class="hljs-keyword">self</span>.primitive_type_table.primitive_types.<span class="hljs-title function_ invoke__">get</span>(&amp;ident.name) {
+ <span class="hljs-keyword">let</span> <span class="hljs-variable">binding</span> =
+ (Res::<span class="hljs-title function_ invoke__">PrimTy</span>(*prim_ty), ty::Visibility::Public, DUMMY_SP, ExpnId::<span class="hljs-title function_ invoke__">root</span>())
+ .<span class="hljs-title function_ invoke__">to_name_binding</span>(<span class="hljs-keyword">self</span>.arenas);
+ <span class="hljs-keyword">return</span> <span class="hljs-title function_ invoke__">Some</span>(LexicalScopeBinding::<span class="hljs-title function_ invoke__">Item</span>(binding));
+ }
+ }
+
+ <span class="hljs-literal">None</span>
+}</code></pre>
+
+ <p>
+ 関数名や doc comment が示している通り、この関数は識別子 (identifier, ident) を現在のレキシカルスコープ内で解決 (resolve) する。 <code>if ns == TypeNS</code> のブロック内では、<code>primitive_type_table</code> (上記の <code>PrimitiveTypeTable::new()</code> で作られた変数) に含まれている識別子 (<code>bool</code>、<code>i32</code> など) かどうか判定し、そうであればそれに紐づけられたプリミティブ型を返している。
+ </p>
+
+ <p>
+ なお、<code>ns</code> は「名前空間」を示す変数である。Rust における名前空間はC言語におけるそれとほとんど同じで、今探している名前が関数名/変数名なのか型なのかマクロなのかを区別している。この <code>if</code> は、プリミティブ型に解決されるのは型を探しているときだけだ、と言っている。
+ </p>
+
+ <p>
+ 重要なのは、これが <code>resolve_ident_in_lexical_scope()</code> の最後に書かれている点である。つまり、最初に挙げたプリミティブ型の識別子は、「名前解決の最終段階で」、「他に同名の型が見つかっていなければ」プリミティブ型として解決される。
+ </p>
+
+ <p>
+ 動作がわかったところで、例として次のコードを考える。
+ </p>
+
+ <pre class="highlight" language="rust" linenumbering="unnumbered"><code class="highlight"><span class="hljs-meta">#![allow(non_camel_case_types)]</span>
+
+<span class="hljs-keyword">struct</span> <span class="hljs-title class_">bool</span>;
+
+<span class="hljs-keyword">fn</span> <span class="hljs-title function_">main</span>() {
+ <span class="hljs-keyword">let</span> <span class="hljs-variable">_</span>: <span class="hljs-type">bool</span> = <span class="hljs-type">bool</span>;
+}</code></pre>
+
+ <p>
+ ここで <code>main()</code> の <code>bool</code> は <code>struct bool</code> として解決される。なぜなら、プリミティブ型の判定をする前に <code>bool</code> という名前の別の型が見つかるからだ。
+ </p>
+ </section>
+
+ <section id="section--outro">
+ <h2><a href="#section--outro">まとめ</a></h2>
+ <p>
+ Rust のプリミティブ型は予約語ではない。名前解決の最終段階で特別扱いされ、他に同名の型が見つかっていなければ対応するプリミティブ型に解決される。
+ </p>
+ </section>
+ </div>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/posts/2021-10-02/vim-difference-between-autocmd-bufwrite-and-bufwritepre/index.html b/vhosts/blog/public/posts/2021-10-02/vim-difference-between-autocmd-bufwrite-and-bufwritepre/index.html
new file mode 100644
index 00000000..ea874004
--- /dev/null
+++ b/vhosts/blog/public/posts/2021-10-02/vim-difference-between-autocmd-bufwrite-and-bufwritepre/index.html
@@ -0,0 +1,224 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2021 nsfisis">
+ <meta name="description" content="Vim の autocmd events における BufWrite/BufWritePre がどう違うのかを調べた結果、違いはないことがわかった。">
+ <meta name="keywords" content="Vim">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>【Vim】 autocmd events の BufWrite/BufWritePre の違い | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ <link rel="stylesheet" href="/hl.css?h=340e65ffd5c17713efc9107c06304f7b">
+ </head>
+ <body class="single">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <article class="post-single">
+ <header class="post-header">
+ <h1 class="post-title">【Vim】 autocmd events の BufWrite/BufWritePre の違い</h1>
+ <ul class="post-tags">
+ <li class="tag">
+ <a href="/tags/vim/">Vim</a>
+ </li>
+ </ul>
+ </header>
+ <div class="post-content">
+ <section>
+ <h2 id="changelog">更新履歴</h2>
+ <ol>
+ <li class="revision">
+ <time datetime="2021-10-02">2021-10-02</time>: Qiita から移植
+ </li>
+ </ol>
+ </section>
+ <div class="admonition">
+ <div class="admonition-label">
+ NOTE
+ </div>
+ <div class="admonition-content">
+ この記事は Qiita から移植してきたものです。 元 URL: <a href="https://qiita.com/nsfisis/items/79ab4db8564032de0b25">https://qiita.com/nsfisis/items/79ab4db8564032de0b25</a>
+ </div>
+ </div>
+
+ <section id="section--tl-dr">
+ <h2><a href="#section--tl-dr">TL; DR</a></h2>
+ <p>
+ 違いはない。ただのエイリアス。
+ </p>
+ </section>
+
+ <section id="section--code-reading">
+ <h2><a href="#section--code-reading">調査記録</a></h2>
+ <p>
+ Vim の autocmd events には似通った名前のものがいくつかある。大抵は <code>:help</code> に説明があるが、この記事のタイトルにある2つを含めた以下のイベントには、その違いについて説明がない。
+ </p>
+
+ <ul>
+ <li>
+ <code>BufRead</code>/<code>BufReadPost</code>
+ </li>
+
+ <li>
+ <code>BufWrite</code>/<code>BufWritePre</code>
+ </li>
+
+ <li>
+ <code>BufAdd</code>/<code>BufCreate</code>
+ </li>
+ </ul>
+
+ <p>
+ このうち、<code>BufAdd</code>/<code>BufCreate</code> に関しては、<code>:help BufCreate</code> に
+ </p>
+
+ <blockquote>
+ <p>
+ The BufCreate event is for historic reasons.
+ </p>
+ </blockquote>
+
+ <p>
+ とあり、おそらくは <code>BufAdd</code> のエイリアスであろうということがわかる。他の2組も同様ではないかと予想されるが、確認のため vim と neovim のソースコードを調査した。
+ </p>
+
+ <blockquote>
+ <p>
+ ソースコードへのリンク <a href="https://github.com/vim/vim/tree/8e6be34338f13a6a625f19bcef82019c9adc65f2">vim (調査時点での master branch)</a> <a href="https://github.com/neovim/neovim/tree/71d4f5851f068eeb432af34850dddda8cc1c71e3">neovim (上に同じ)</a>
+ </p>
+ </blockquote>
+
+ <section id="section--code-reading--vim">
+ <h3><a href="#section--code-reading--vim">vim のソースコード</a></h3>
+ <p>
+ 以下は、autocmd events の名前と内部で使われている整数値とのマッピングを定義している箇所である。見ての通り、上でエイリアスではないかと述べた3組には、それぞれ同じ内部値が使われている。
+ </p>
+
+ <p>
+ <a href="https://github.com/vim/vim/blob/8e6be34338f13a6a625f19bcef82019c9adc65f2/src/autocmd.c#L85-L86">https://github.com/vim/vim/blob/8e6be34338f13a6a625f19bcef82019c9adc65f2/src/autocmd.c#L85-L86</a>
+ </p>
+
+ <pre class="highlight" language="c" linenumbering="unnumbered"><code class="highlight">{<span class="hljs-string">&quot;BufAdd&quot;</span>, EVENT_BUFADD},
+{<span class="hljs-string">&quot;BufCreate&quot;</span>, EVENT_BUFADD},</code></pre>
+
+ <p>
+ <a href="https://github.com/vim/vim/blob/8e6be34338f13a6a625f19bcef82019c9adc65f2/src/autocmd.c#L95-L97">https://github.com/vim/vim/blob/8e6be34338f13a6a625f19bcef82019c9adc65f2/src/autocmd.c#L95-L97</a>
+ </p>
+
+ <pre class="highlight" language="c" linenumbering="unnumbered"><code class="highlight">{<span class="hljs-string">&quot;BufRead&quot;</span>, EVENT_BUFREADPOST},
+{<span class="hljs-string">&quot;BufReadCmd&quot;</span>, EVENT_BUFREADCMD},
+{<span class="hljs-string">&quot;BufReadPost&quot;</span>, EVENT_BUFREADPOST},</code></pre>
+
+ <p>
+ <a href="https://github.com/vim/vim/blob/8e6be34338f13a6a625f19bcef82019c9adc65f2/src/autocmd.c#L103-L105">https://github.com/vim/vim/blob/8e6be34338f13a6a625f19bcef82019c9adc65f2/src/autocmd.c#L103-L105</a>
+ </p>
+
+ <pre class="highlight" language="c" linenumbering="unnumbered"><code class="highlight">{<span class="hljs-string">&quot;BufWrite&quot;</span>, EVENT_BUFWRITEPRE},
+{<span class="hljs-string">&quot;BufWritePost&quot;</span>, EVENT_BUFWRITEPOST},
+{<span class="hljs-string">&quot;BufWritePre&quot;</span>, EVENT_BUFWRITEPRE},</code></pre>
+ </section>
+
+ <section id="section--code-reading--neovim">
+ <h3><a href="#section--code-reading--neovim">neovim のソースコード</a></h3>
+ <p>
+ neovim の場合でも同様のマッピングが定義されているが、こちらの場合は Lua で書かれている。以下にある通り、はっきり <code>aliases</code> と書かれている。
+ </p>
+
+ <p>
+ <a href="https://github.com/neovim/neovim/blob/71d4f5851f068eeb432af34850dddda8cc1c71e3/src/nvim/auevents.lua#L119-L124">https://github.com/neovim/neovim/blob/71d4f5851f068eeb432af34850dddda8cc1c71e3/src/nvim/auevents.lua#L119-L124</a>
+ </p>
+
+ <pre class="highlight" language="lua" linenumbering="unnumbered"><code class="highlight">aliases = {
+BufCreate = <span class="hljs-string">&#x27;BufAdd&#x27;</span>,
+BufRead = <span class="hljs-string">&#x27;BufReadPost&#x27;</span>,
+BufWrite = <span class="hljs-string">&#x27;BufWritePre&#x27;</span>,
+FileEncoding = <span class="hljs-string">&#x27;EncodingChanged&#x27;</span>,
+},</code></pre>
+
+ <p>
+ ところで、上では取り上げなかった <code>FileEncoding</code> だが、これは <code>:help FileEncoding</code> にしっかりと書いてある。
+ </p>
+
+ <pre class="highlight monospaced"><code> *FileEncoding*
+FileEncoding Obsolete. It still works and is equivalent
+ to |EncodingChanged|.</code></pre>
+ </section>
+ </section>
+
+ <section id="section--outro">
+ <h2><a href="#section--outro">まとめ</a></h2>
+ <p>
+ 記事タイトルについて言えば、どちらも変わらないので好きな方を使えばよい。あえて言えば、次のようになるだろう。
+ </p>
+
+ <ul>
+ <li>
+ <code>BufAdd</code>/<code>BufCreate</code>
+ <ul>
+ <li>
+ → <code>BufCreate</code> は歴史的な理由により (&quot;for historic reasons&quot;) 存在しているため、新しい方 (<code>BufAdd</code>) を使う
+ </li>
+ </ul>
+ </li>
+
+ <li>
+ <code>BufRead</code>/<code>BufReadPost</code>
+ <ul>
+ <li>
+ → <code>BufReadPre</code> との対称性のため、あるいは <code>BufWritePost</code> との対称性のため <code>BufReadPost</code> を使う
+ </li>
+ </ul>
+ </li>
+
+ <li>
+ <code>BufWrite</code>/<code>BufWritePre</code>
+ <ul>
+ <li>
+ → <code>BufWritePost</code> との対称性のため、あるいは <code>BufReadPre</code> との対称性のため <code>BufWritePre</code> を使う
+ </li>
+ </ul>
+ </li>
+
+ <li>
+ <code>FileEncoding</code>/<code>EncodingChanged</code>
+ <ul>
+ <li>
+ → <code>FileEncoding</code> は <code>`Obsolete&apos;&apos; と明言されているので、`EncodingChanged</code> を使う
+ </li>
+ </ul>
+ </li>
+ </ul>
+
+ <p>
+ ところでこの調査で知ったのだが、<code>BufRead</code> と <code>BufWrite</code> は上にある通り発火するタイミングが「後」と「前」で対称性がない。可能なら <code>Pre</code>/<code>Post</code> 付きのものを使った方が分かりやすいだろう。
+ </p>
+ </section>
+ </div>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/posts/2021-10-02/vim-swap-order-of-selected-lines/index.html b/vhosts/blog/public/posts/2021-10-02/vim-swap-order-of-selected-lines/index.html
new file mode 100644
index 00000000..9ca04808
--- /dev/null
+++ b/vhosts/blog/public/posts/2021-10-02/vim-swap-order-of-selected-lines/index.html
@@ -0,0 +1,253 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2021 nsfisis">
+ <meta name="description" content="Vim で選択した行の順番を入れ替える方法。">
+ <meta name="keywords" content="Vim">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>Vimで選択した行の順番を入れ替える | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ <link rel="stylesheet" href="/hl.css?h=340e65ffd5c17713efc9107c06304f7b">
+ </head>
+ <body class="single">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <article class="post-single">
+ <header class="post-header">
+ <h1 class="post-title">Vimで選択した行の順番を入れ替える</h1>
+ <ul class="post-tags">
+ <li class="tag">
+ <a href="/tags/vim/">Vim</a>
+ </li>
+ </ul>
+ </header>
+ <div class="post-content">
+ <section>
+ <h2 id="changelog">更新履歴</h2>
+ <ol>
+ <li class="revision">
+ <time datetime="2021-10-02">2021-10-02</time>: Qiita から移植
+ </li>
+ </ol>
+ </section>
+ <div class="admonition">
+ <div class="admonition-label">
+ NOTE
+ </div>
+ <div class="admonition-content">
+ この記事は Qiita から移植してきたものです。 元 URL: <a href="https://qiita.com/nsfisis/items/4fefb361d9a693803520">https://qiita.com/nsfisis/items/4fefb361d9a693803520</a>
+ </div>
+ </div>
+
+ <section id="section--tl-dr">
+ <h2><a href="#section--tl-dr">TL; DR</a></h2>
+ <pre class="highlight" language="vim" linenumbering="unnumbered"><code class="highlight"><span class="hljs-comment">&quot; License: Public Domain</span>
+
+command! -bar -<span class="hljs-built_in">range</span>=%
+ \ Reverse
+ \ keeppatterns <span class="hljs-symbol">&lt;line1&gt;</span>,<span class="hljs-symbol">&lt;line2&gt;</span>g/^/<span class="hljs-keyword">m</span><span class="hljs-symbol">&lt;line1&gt;</span>-<span class="hljs-number">1</span></code></pre>
+ </section>
+
+ <section id="section--version">
+ <h2><a href="#section--version">バージョン情報</a></h2>
+ <p>
+ <code>:version</code> の一部
+ </p>
+
+ <blockquote>
+ <p>
+ VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Jan 26 2020 11:30:30) macOS version Included patches: 1-148 Huge version without GUI.
+ </p>
+ </blockquote>
+ </section>
+
+ <section id="section--existing-solution">
+ <h2><a href="#section--existing-solution">よく紹介されている手法</a></h2>
+ <section id="section--existing-solution--external-commands">
+ <h3><a href="#section--existing-solution--external-commands"><code>tac</code> / <code>tail</code></a></h3>
+ <p>
+ <code>tac</code> や <code>tail -r</code> などの外部コマンドを <code>!</code> を使って呼び出し、置き換える。
+ </p>
+
+ <blockquote>
+ <p>
+ :h v_!
+ </p>
+ </blockquote>
+
+ <p>
+ <code>tac</code> コマンドや <code>tail</code> の <code>-r</code> オプションは環境によって利用できないことがあり、複数の環境を行き来する場合に採用しづらい
+ </p>
+ </section>
+
+ <section id="section--existing-solution--global-command">
+ <h3><a href="#section--existing-solution--global-command"><code>:g/^/m0</code></a></h3>
+ <p>
+ こちらは外部コマンドに頼らず、Vim の機能のみを使う。<code>g</code> は <code>:global</code> コマンドの、<code>m</code> は <code>:move</code> コマンドの略
+ </p>
+
+ <p>
+ <code>:global</code> コマンドは <code>:[range]global/{pattern}/[command]</code> のように使い、<code>[range]</code> で指定された範囲の行のうち、<code>{pattern}</code> で指定された検索パターンにマッチする行に対して、順番に <code>[command]</code> で指定された Ex コマンドを呼び出す。
+ </p>
+
+ <blockquote>
+ <p>
+ :h :global
+ </p>
+ </blockquote>
+
+ <p>
+ <code>:move</code> コマンドは <code>[range]:move {address}</code> のように使い、<code>[range]</code> で指定された範囲の行を <code>{address}</code> で指定された位置に移動させる。
+ </p>
+
+ <blockquote>
+ <p>
+ :h :move
+ </p>
+ </blockquote>
+
+ <p>
+ <code>:g/^/m0</code> のように組み合わせると、「すべての行を1行ずつ 0行目(1行目の上)に動かす」という動きをする。これは確かに行の入れ替えになっている。
+ </p>
+
+ <p>
+ なお、<code>:g/^/m0</code> は全ての行を入れ替えるが、<code>:N,Mg/^/mN-1</code> とすることで N行目から M行目を処理範囲とするよう拡張できる。手でこれを入力するわけにはいかないので、次のようなコマンドを用意する。
+ </p>
+
+ <pre class="highlight" language="vim" linenumbering="unnumbered"><code class="highlight">command! -bar -<span class="hljs-built_in">range</span>=%
+ \ Reverse
+ \ <span class="hljs-symbol">&lt;line1&gt;</span>,<span class="hljs-symbol">&lt;line2&gt;</span>g/^/<span class="hljs-keyword">m</span><span class="hljs-symbol">&lt;line1&gt;</span>-<span class="hljs-number">1</span></code></pre>
+
+ <p>
+ これは望みの動作をするが、実際に実行してみると全行がハイライトされてしまう。次節で詳細を述べる。
+ </p>
+ </section>
+ </section>
+
+ <section id="section--problem-of-global-command">
+ <h2><a href="#section--problem-of-global-command"><code>:g/^/m0</code> の問題点</a></h2>
+ <p>
+ <code>:global</code> コマンドは各行に対してマッチングを行う際、現在の検索パターンを上書きしてしまう。<code>^</code> は行の先頭にマッチするため、結果として全ての行がハイライトされてしまう。<code>&apos;hlsearch&apos;</code> オプションを無効にしている場合その限りではないが、その場合でも直前の検索パターンが失われてしまうと <code>n</code> コマンドなどの際に不便である。
+ </p>
+
+ <blockquote>
+ <p>
+ :h @/
+ </p>
+ </blockquote>
+ </section>
+
+ <section id="section--solution">
+ <h2><a href="#section--solution">解決策</a></h2>
+ <blockquote>
+ <p>
+ [2020/9/28追記] より簡潔な方法を見つけたので次節に追記した
+ </p>
+ </blockquote>
+
+ <p>
+ 前述した <code>:Reverse</code> コマンドの定義を少し変えて、次のようにする:
+ </p>
+
+ <pre class="highlight" language="vim" linenumbering="unnumbered"><code class="highlight"><span class="hljs-keyword">function!</span> <span class="hljs-title">s</span>:reverse_lines<span class="hljs-params">(from, to)</span> abort
+ <span class="hljs-keyword">execute</span> <span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;%d,%dg/^/m%d&quot;</span>, <span class="hljs-variable">a:from</span>, <span class="hljs-variable">a:to</span>, <span class="hljs-variable">a:from</span> - <span class="hljs-number">1</span>)
+<span class="hljs-keyword">endfunction</span>
+
+command! -bar -<span class="hljs-built_in">range</span>=%
+ \ Reverse
+ \ <span class="hljs-keyword">call</span> <span class="hljs-symbol">&lt;SID&gt;</span>reverse_lines(<span class="hljs-symbol">&lt;line1&gt;</span>, <span class="hljs-symbol">&lt;line2&gt;</span>)</code></pre>
+
+ <p>
+ 実行しているコマンドが変わったわけではないが、関数呼び出しを経由するようにした。これだけで前述の問題が解決する。
+ </p>
+
+ <p>
+ この理由は、ユーザー定義関数を実行する際は検索パターンが一度保存され、実行が終了したあと復元されるため。結果として検索パターンが <code>^</code> で上書きされることがなくなる。
+ </p>
+
+ <p>
+ Vim のヘルプから該当箇所を引用する (強調は筆者による)。
+ </p>
+
+ <blockquote>
+ <p>
+ :h autocmd-searchpat
+ </p>
+
+ <p>
+ <em role="strong">Autocommands do not change the current search patterns.</em> Vim saves the current search patterns before executing autocommands then restores them after the autocommands finish. This means that autocommands do not affect the strings highlighted with the `hlsearch&apos; option.
+ </p>
+ </blockquote>
+
+ <p>
+ これは autocommand の実行に関しての記述だが、これと同じことがユーザー定義関数の実行時にも適用される。このことは <code>:nohlsearch</code> のヘルプにある。同じく該当箇所を引用する (強調は筆者による)。
+ </p>
+
+ <blockquote>
+ <p>
+ :h :nohlsearch
+ </p>
+
+ <p>
+ (略) This command doesn’t work in an autocommand, because the highlighting state is saved and restored when executing autocommands |autocmd-searchpat|. <em role="strong">Same thing for when invoking a user function.</em>
+ </p>
+ </blockquote>
+
+ <p>
+ この仕様により、<code>:g/^/m0</code> の呼び出しをユーザー定義関数に切り出すことで上述の問題を解決できる。
+ </p>
+ </section>
+
+ <section id="section--solution-revised">
+ <h2><a href="#section--solution-revised">解決策 (改訂版)</a></h2>
+ <blockquote>
+ <p>
+ [2020/9/28追記] より簡潔な方法を見つけたため追記する
+ </p>
+ </blockquote>
+
+ <pre class="highlight" language="vim" linenumbering="unnumbered"><code class="highlight">command! -bar -<span class="hljs-built_in">range</span>=%
+ \ Reverse
+ \ keeppatterns <span class="hljs-symbol">&lt;line1&gt;</span>,<span class="hljs-symbol">&lt;line2&gt;</span>g/^/<span class="hljs-keyword">m</span><span class="hljs-symbol">&lt;line1&gt;</span>-<span class="hljs-number">1</span></code></pre>
+
+ <p>
+ まさにこのための Exコマンド、<code>:keeppatterns</code> が存在する。<code>:keeppatterns {command}</code> のように使い、読んで字の如く、後ろに続く Exコマンドを「現在の検索パターンを保ったまま」実行する。はるかに分かりやすく意図を表現できる。
+ </p>
+
+ <blockquote>
+ <p>
+ :h :keeppatterns
+ </p>
+ </blockquote>
+ </section>
+ </div>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/posts/2022-04-09/phperkaigi-2022-tokens/index.html b/vhosts/blog/public/posts/2022-04-09/phperkaigi-2022-tokens/index.html
new file mode 100644
index 00000000..b19f038d
--- /dev/null
+++ b/vhosts/blog/public/posts/2022-04-09/phperkaigi-2022-tokens/index.html
@@ -0,0 +1,605 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2022 nsfisis">
+ <meta name="description" content="PHPerKaigi 2022 で私が作成した PHPer チャレンジ問題を解説する。">
+ <meta name="keywords" content="カンファレンス,PHP,PHPerKaigi">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>PHPerKaigi 2022 トークン問題の解説 | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ <link rel="stylesheet" href="/hl.css?h=340e65ffd5c17713efc9107c06304f7b">
+ </head>
+ <body class="single">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <article class="post-single">
+ <header class="post-header">
+ <h1 class="post-title">PHPerKaigi 2022 トークン問題の解説</h1>
+ <ul class="post-tags">
+ <li class="tag">
+ <a href="/tags/conference/">カンファレンス</a>
+ </li>
+ <li class="tag">
+ <a href="/tags/php/">PHP</a>
+ </li>
+ <li class="tag">
+ <a href="/tags/phperkaigi/">PHPerKaigi</a>
+ </li>
+ </ul>
+ </header>
+ <div class="post-content">
+ <section>
+ <h2 id="changelog">更新履歴</h2>
+ <ol>
+ <li class="revision">
+ <time datetime="2022-04-09">2022-04-09</time>: 公開
+ </li>
+ <li class="revision">
+ <time datetime="2022-04-16">2022-04-16</time>: 2問目、3問目の解説を追加、1問目に加筆
+ </li>
+ </ol>
+ </section>
+ <section id="section--intro">
+ <h2><a href="#section--intro">はじめに</a></h2>
+ <p>
+ 本日開始された <a href="https://phperkaigi.jp/2022/">PHPerKaigi 2022</a> の PHPer チャレンジにおいて、弊社 <a href="https://www.dgcircus.com/">デジタルサーカス株式会社</a> の問題を 3問作成した。この記事では、これらの問題の解説をおこなう。
+ </p>
+
+ <p>
+ リポジトリはこちら: <a href="https://github.com/nsfisis/PHPerKaigi2022-tokens">https://github.com/nsfisis/PHPerKaigi2022-tokens</a>
+ </p>
+ </section>
+
+ <section id="section--q1-brainfuck">
+ <h2><a href="#section--q1-brainfuck">第1問 brainf_ck.php</a></h2>
+ <p>
+ ソースコードはこちら。実行には PHP 8.1 以上が必要なので注意。
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight"><span class="hljs-meta">&lt;?php</span>
+
+<span class="hljs-keyword">declare</span>(strict_types=<span class="hljs-number">0O1</span>);
+
+<span class="hljs-keyword">namespace</span> <span class="hljs-title class_">Dgcircus</span>\<span class="hljs-title class_">PHPerKaigi</span>\<span class="hljs-title class_">Y2022</span>;
+
+<span class="hljs-comment">/**
+ * <span class="hljs-doctag">@todo</span>
+ * Run this program to acquire a PHPer token.
+ */</span>
+
+https:<span class="hljs-comment">//creativecommons.org/publicdomain/zero/1.0/</span>
+
+\<span class="hljs-title function_ invoke__">error_reporting</span>(~+!<span class="hljs-string">&#x27;We are hiring!&#x27;</span>);
+
+<span class="hljs-variable">$z</span> = <span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$f</span></span>) =&gt;</span> (<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$x</span></span>) =&gt;</span> <span class="hljs-variable">$f</span>(<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params">...<span class="hljs-variable">$xs</span></span>) =&gt;</span> <span class="hljs-variable">$x</span>(<span class="hljs-variable">$x</span>)(...<span class="hljs-variable">$xs</span>)))(<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$x</span></span>) =&gt;</span> <span class="hljs-variable">$f</span>(<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params">...<span class="hljs-variable">$xs</span></span>) =&gt;</span> <span class="hljs-variable">$x</span>(<span class="hljs-variable">$x</span>)(...<span class="hljs-variable">$xs</span>)));
+<span class="hljs-variable">$id</span> = \<span class="hljs-title function_ invoke__">spl_object_id</span>(...);
+<span class="hljs-variable">$put</span> = <span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$c</span></span>) =&gt;</span> \<span class="hljs-title function_ invoke__">printf</span>(<span class="hljs-string">&#x27;%c&#x27;</span>, <span class="hljs-variable">$c</span>);
+<span class="hljs-variable">$mm</span> = <span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$p</span>, <span class="hljs-variable">$n</span></span>) =&gt;</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">\ArrayObject</span>(\<span class="hljs-title function_ invoke__">array_fill</span>(+!![], <span class="hljs-variable">$n</span>, <span class="hljs-variable">$p</span>));
+
+$👉 = <span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$m</span>, <span class="hljs-variable">$p</span>, <span class="hljs-variable">$b</span>, <span class="hljs-variable">$e</span>, <span class="hljs-variable">$mp</span>, <span class="hljs-variable">$pc</span></span>) =&gt;</span> [++<span class="hljs-variable">$mp</span>, ++<span class="hljs-variable">$pc</span>];
+$👈 = <span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$m</span>, <span class="hljs-variable">$p</span>, <span class="hljs-variable">$b</span>, <span class="hljs-variable">$e</span>, <span class="hljs-variable">$mp</span>, <span class="hljs-variable">$pc</span></span>) =&gt;</span> [--<span class="hljs-variable">$mp</span>, ++<span class="hljs-variable">$pc</span>];
+$👍 = <span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$m</span>, <span class="hljs-variable">$p</span>, <span class="hljs-variable">$b</span>, <span class="hljs-variable">$e</span>, <span class="hljs-variable">$mp</span>, <span class="hljs-variable">$pc</span></span>) =&gt;</span> [<span class="hljs-variable">$mp</span>, ++<span class="hljs-variable">$pc</span>, ++<span class="hljs-variable">$m</span>[<span class="hljs-variable">$mp</span>]];
+$👎 = <span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$m</span>, <span class="hljs-variable">$p</span>, <span class="hljs-variable">$b</span>, <span class="hljs-variable">$e</span>, <span class="hljs-variable">$mp</span>, <span class="hljs-variable">$pc</span></span>) =&gt;</span> [<span class="hljs-variable">$mp</span>, ++<span class="hljs-variable">$pc</span>, --<span class="hljs-variable">$m</span>[<span class="hljs-variable">$mp</span>]];
+$📝 = <span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$m</span>, <span class="hljs-variable">$p</span>, <span class="hljs-variable">$b</span>, <span class="hljs-variable">$e</span>, <span class="hljs-variable">$mp</span>, <span class="hljs-variable">$pc</span></span>) =&gt;</span> [<span class="hljs-variable">$mp</span>, ++<span class="hljs-variable">$pc</span>, <span class="hljs-variable">$put</span>(<span class="hljs-variable">$m</span>[<span class="hljs-variable">$mp</span>])];
+$🤡 = <span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$m</span>, <span class="hljs-variable">$p</span>, <span class="hljs-variable">$b</span>, <span class="hljs-variable">$e</span>, <span class="hljs-variable">$mp</span>, <span class="hljs-variable">$pc</span></span>) =&gt;</span> <span class="hljs-keyword">match</span> (<span class="hljs-variable">$m</span>[<span class="hljs-variable">$mp</span>]) {
+ +!![] =&gt; [<span class="hljs-variable">$mp</span>, <span class="hljs-variable">$z</span>(<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$loop</span></span>) =&gt;</span> <span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$pc</span>, <span class="hljs-variable">$n</span></span>) =&gt;</span> <span class="hljs-keyword">match</span> (<span class="hljs-variable">$id</span>(<span class="hljs-variable">$p</span>[<span class="hljs-variable">$pc</span>])) {
+ <span class="hljs-variable">$b</span> =&gt; <span class="hljs-variable">$loop</span>(++<span class="hljs-variable">$pc</span>, ++<span class="hljs-variable">$n</span>),
+ <span class="hljs-variable">$e</span> =&gt; <span class="hljs-variable">$n</span> === +!![] ? ++<span class="hljs-variable">$pc</span> : <span class="hljs-variable">$loop</span>(++<span class="hljs-variable">$pc</span>, --<span class="hljs-variable">$n</span>),
+ <span class="hljs-keyword">default</span> =&gt; <span class="hljs-variable">$loop</span>(++<span class="hljs-variable">$pc</span>, <span class="hljs-variable">$n</span>),
+ })(<span class="hljs-variable">$pc</span>, -![])],
+ <span class="hljs-keyword">default</span> =&gt; [<span class="hljs-variable">$mp</span>, ++<span class="hljs-variable">$pc</span>],
+};
+$🎪 = <span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$m</span>, <span class="hljs-variable">$p</span>, <span class="hljs-variable">$b</span>, <span class="hljs-variable">$e</span>, <span class="hljs-variable">$mp</span>, <span class="hljs-variable">$pc</span></span>) =&gt;</span> <span class="hljs-keyword">match</span> (<span class="hljs-variable">$m</span>[<span class="hljs-variable">$mp</span>]) {
+ +!![] =&gt; [<span class="hljs-variable">$mp</span>, ++<span class="hljs-variable">$pc</span>],
+ <span class="hljs-keyword">default</span> =&gt; [<span class="hljs-variable">$mp</span>, <span class="hljs-variable">$z</span>(<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$loop</span></span>) =&gt;</span> <span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$pc</span>, <span class="hljs-variable">$n</span></span>) =&gt;</span> <span class="hljs-keyword">match</span> (<span class="hljs-variable">$id</span>(<span class="hljs-variable">$p</span>[<span class="hljs-variable">$pc</span>])) {
+ <span class="hljs-variable">$e</span> =&gt; <span class="hljs-variable">$loop</span>(--<span class="hljs-variable">$pc</span>, ++<span class="hljs-variable">$n</span>),
+ <span class="hljs-variable">$b</span> =&gt; <span class="hljs-variable">$n</span> === +!![] ? <span class="hljs-variable">$pc</span>+![] : <span class="hljs-variable">$loop</span>(--<span class="hljs-variable">$pc</span>, --<span class="hljs-variable">$n</span>),
+ <span class="hljs-keyword">default</span> =&gt; <span class="hljs-variable">$loop</span>(--<span class="hljs-variable">$pc</span>, <span class="hljs-variable">$n</span>),
+ })(<span class="hljs-variable">$pc</span>, -![])],
+};
+$🐘 = <span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$p</span></span>) =&gt;</span> <span class="hljs-variable">$z</span>(<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$loop</span></span>) =&gt;</span> <span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$m</span>, <span class="hljs-variable">$p</span>, <span class="hljs-variable">$b</span>, <span class="hljs-variable">$e</span>, <span class="hljs-variable">$mp</span>, <span class="hljs-variable">$pc</span></span>) =&gt;</span>
+ <span class="hljs-keyword">isset</span>(<span class="hljs-variable">$p</span>[<span class="hljs-variable">$pc</span>]) &amp;&amp; <span class="hljs-variable">$loop</span>(<span class="hljs-variable">$m</span>, <span class="hljs-variable">$p</span>, <span class="hljs-variable">$b</span>, <span class="hljs-variable">$e</span>, ...(<span class="hljs-variable">$p</span>[<span class="hljs-variable">$pc</span>](<span class="hljs-variable">$m</span>, <span class="hljs-variable">$p</span>, <span class="hljs-variable">$b</span>, <span class="hljs-variable">$e</span>, <span class="hljs-variable">$mp</span>, <span class="hljs-variable">$pc</span>)))
+)(<span class="hljs-variable">$mm</span>(+!![], +(![].![])), <span class="hljs-variable">$p</span>, <span class="hljs-variable">$id</span>($🤡), <span class="hljs-variable">$id</span>($🎪), +!![], +!![]);
+
+$🐘([
+ $👍, $👍, $👍, $👍, $👍, $👍, $👍, $👍, $👍, $👍,
+ $🤡,
+ $👉, $👍, $👍, $👍,
+ $👉, $👍, $👍, $👍, $👍, $👍,
+ $👉, $👍, $👍, $👍, $👍, $👍, $👍, $👍, $👍, $👍, $👍, $👍, $👍,
+ $👉, $👍, $👍, $👍, $👍, $👍, $👍, $👍, $👍, $👍, $👍,
+ $👈, $👈, $👈, $👈, $👎,
+ $🎪,
+ $👉, $👍, $👍, $👍, $👍, $👍, $📝,
+ $👎, $👎, $📝,
+ $👉, $👎, $👎, $👎, $📝,
+ $👉, $👎, $👎, $👎, $📝,
+ $👎, $👎, $📝,
+ $👎, $📝,
+ $👈, $📝,
+ $👉, $👉, $👎, $👎, $📝,
+ $👍, $👍, $👍, $👍, $👍, $👍, $👍, $📝,
+ $👈, $👎, $👎, $👎, $👎, $📝,
+ $👈, $📝,
+ $👉, $👍, $👍, $📝,
+ $👉, $👎, $📝,
+ $👈, $📝,
+]);</code></pre>
+
+ <p>
+ この問題は、単に適切なバージョンの PHP で動かせばトークンが得られる。
+ </p>
+
+ <section id="section--q1-brainfuck--commentary">
+ <h3><a href="#section--q1-brainfuck--commentary">解説</a></h3>
+ <section id="section--q1-brainfuck--commentary--emoji">
+ <h4><a href="#section--q1-brainfuck--commentary--emoji">絵文字</a></h4>
+ <p>
+ まず目につくのは大量の絵文字だろう。 PHP は識別子に使用できる文字の範囲が広く、絵文字も使うことができる。
+ </p>
+ </section>
+
+ <section id="section--q1-brainfuck--commentary--brainfuck">
+ <h4><a href="#section--q1-brainfuck--commentary--brainfuck">プログラム全体</a></h4>
+ <p>
+ Brainf*ck のインタプリタとプログラムになっている。 Brainf*ck とは、難解プログラミング言語のひとつであり、ここで説明するよりも Wikipedia の該当ページを読んだ方がよい。
+ </p>
+
+ <p>
+ <a href="https://ja.wikipedia.org/wiki/Brainfuck">https://ja.wikipedia.org/wiki/Brainfuck</a>
+ </p>
+
+ <p>
+ なお、brainf*ck プログラムを普通の書き方で書くと、次のようになる。
+ </p>
+
+ <pre class="highlight monospaced"><code>+ + + + + + + + + +
+[
+ &gt; + + +
+ &gt; + + + + +
+ &gt; + + + + + + + + + + + +
+ &gt; + + + + + + + + + +
+ &lt; &lt; &lt; &lt; -
+]
+&gt; + + + + + .
+- - .
+&gt; - - - .
+&gt; - - - .
+- - .
+- .
+&lt; .
+&gt; &gt; - - .
++ + + + + + + .
+&lt; - - - - .
+&lt; .
+&gt; + + .
+&gt; - .
+&lt; .</code></pre>
+
+ <p>
+ 実行結果はこちら: <a href="https://ideone.com/22VWmb">https://ideone.com/22VWmb</a>
+ </p>
+
+ <p>
+ それぞれの絵文字で表された関数が、各命令に対応している。
+ </p>
+
+ <ul>
+ <li>
+ <code>$👉</code>: <code>&gt;</code>
+ </li>
+
+ <li>
+ <code>$👈</code>: <code>&lt;</code>
+ </li>
+
+ <li>
+ <code>$👍</code>: <code>+</code>
+ </li>
+
+ <li>
+ <code>$👎</code>: <code>-</code>
+ </li>
+
+ <li>
+ <code>$📝</code>: <code>.</code>
+ </li>
+
+ <li>
+ <code>$🤡</code>: <code>[</code>
+ </li>
+
+ <li>
+ <code>$🎪</code>: <code>]</code>
+ </li>
+ </ul>
+
+ <p>
+ <code>,</code> (入力) に対応する関数はない (このプログラムでは使わないので用意していない)。
+ </p>
+
+ <p>
+ なお、<code>$🐘</code> はいわゆる main 関数であり、プログラムの実行部分である。
+ </p>
+ </section>
+
+ <section id="section--q1-brainfuck--commentary--emoji-selection">
+ <h4><a href="#section--q1-brainfuck--commentary--emoji-selection">絵文字の選択</a></h4>
+ <p>
+ おおよそ意味に合致するよう選んでいるが、<code>$🤡</code> と <code>$🎪</code> は弊社デジタルサーカスにちなんでいる。 また、<code>$🐘</code> は PHP のマスコットの象に由来する。
+ </p>
+ </section>
+
+ <section id="section--q1-brainfuck--commentary--strict-types">
+ <h4><a href="#section--q1-brainfuck--commentary--strict-types">strict_types</a></h4>
+ <p>
+ <code>declare</code> 文の <code>strict_types</code> に指定できるのは、<code>0</code> か <code>1</code> の数値リテラルだが、 <code>0x0</code> や <code>0b1</code> のような値も受け付ける。 今回は、PHP 8.1 から追加された、<code>0O</code> または <code>0o</code> から始まる八進数リテラルを使った。
+ </p>
+ </section>
+
+ <section id="section--q1-brainfuck--commentary--url">
+ <h4><a href="#section--q1-brainfuck--commentary--url">URL</a></h4>
+ <p>
+ ソースコードのライセンスを示したこの部分だが、
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight">https:<span class="hljs-comment">//creativecommons.org/publicdomain/zero/1.0/</span></code></pre>
+
+ <p>
+ 完全に合法な PHP のコードである。 <code>https:</code> 部分はラベル、<code>//</code> 以降は行コメントになっている。
+ </p>
+ </section>
+
+ <section id="section--q1-brainfuck--commentary--numbers">
+ <h4><a href="#section--q1-brainfuck--commentary--numbers">リテラルなしで数値を生成する</a></h4>
+ <p>
+ ソースコード中に、ほとんど数値リテラルが書かれていないことにお気づきだろうか。 PHP では、型変換を利用することで任意の整数を作り出すことができる。
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight"><span class="hljs-title function_ invoke__">assert</span>(<span class="hljs-number">0</span> === +!![]);
+<span class="hljs-title function_ invoke__">assert</span>(<span class="hljs-number">1</span> === +![]);
+<span class="hljs-title function_ invoke__">assert</span>(<span class="hljs-number">2</span> === ![]+![]);
+<span class="hljs-title function_ invoke__">assert</span>(<span class="hljs-number">3</span> === ![]+![]+![]);
+<span class="hljs-title function_ invoke__">assert</span>(<span class="hljs-number">10</span> === +(![].+!![]));</code></pre>
+
+ <p>
+ <code>[]</code> に <code>!</code> を適用すると <code>true</code> が返ってくる。それに <code>+</code> を適用すると、<code>bool</code> から <code>int</code> ヘの型変換が走り、<code>1</code> が生成される。<code>10</code> はさらにトリッキーだ。まず <code>1</code> と <code>0</code> を作り、<code>.</code> で文字列として結合する (<code>&apos;10&apos;</code>)。これに <code>+</code> を適用すると、<code>string</code> から <code>int</code> への型変換が走り、<code>10</code> が生まれる (コード量に頓着しないなら、<code>1</code> を 10 個足し合わせてももちろん 10 が作れる)。
+ </p>
+
+ <p>
+ また、<code>error_reporting</code> に指定しているのは <code>-1</code> である。 これは、<code>!</code> によって文字列を <code>false</code> にし、<code>+</code> によって <code>false</code> を <code>0</code> にし、さらにビット反転して <code>-1</code> にしている。
+ </p>
+ </section>
+
+ <section id="section--q1-brainfuck--commentary--conditionals">
+ <h4><a href="#section--q1-brainfuck--commentary--conditionals"><code>if</code> 文なしで条件分岐</a></h4>
+ <p>
+ 三項演算子ないし <code>match</code> 式を使うことで、<code>if</code> を一切書かずに条件分岐ができる。 また、<code>&amp;&amp;</code> / <code>||</code> も使えることがある。 遅延評価が不要なケースでは、<code>[$t, $f][$cond]</code> のような形で分岐することもできる。
+ </p>
+ </section>
+
+ <section id="section--q1-brainfuck--commentary--loops">
+ <h4><a href="#section--q1-brainfuck--commentary--loops"><code>while</code>、<code>for</code> 文なしでループ</a></h4>
+ <p>
+ 不動点コンビネータを使って無名再帰する (詳しい説明は省略する。これらの単語で検索してほしい)。 ここでは、一般に Z コンビネータとして知られるものを使った (<code>$z</code>)。
+ </p>
+
+ <p>
+ 実際のところ、<code>$🤡</code> や <code>$🎪</code>、<code>$🐘</code> は、一度 Scheme (Lisp の一種) で書いてから PHP に翻訳する形で記述した。
+ </p>
+
+ <p>
+ なお、PHP は末尾再帰の最適化をおこなわない (少なくとも今のところは) ので、 あまりに長い brainf*ck プログラムを書くとスタックオーバーフローする。
+ </p>
+ </section>
+ </section>
+ </section>
+
+ <section id="section--q2-riddle">
+ <h2><a href="#section--q2-riddle">第2問 riddle.php</a></h2>
+ <p>
+ ソースコードはこちら。実行には PHP 8.0 以上が必要なので注意。
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight"><span class="hljs-meta">&lt;?php</span>
+
+<span class="hljs-comment">/*********************************************************
+* This program displays a PHPer token. *
+* Guess &#x27;N&#x27;. *
+* *
+* Hints: *
+* - N itself has no special meaning, e.g., 42, 8128, *
+* it is selected at random. *
+* - Each element of $token represents a single letter. *
+* - One letter consists of 5x5 cells. *
+* - Remember, the output is a complete PHPer token. *
+* *
+* License: *
+* https://creativecommons.org/publicdomain/zero/1.0/ *
+*********************************************************/</span>
+<span class="hljs-keyword">const</span> <span class="hljs-variable constant_">N</span> = <span class="hljs-number">0</span> <span class="hljs-comment">/* Change it to your answer. */</span>;
+<span class="hljs-title function_ invoke__">assert</span>(<span class="hljs-number">0</span> &lt;= N &amp;&amp; N &lt;= <span class="hljs-number">0b11111_11111_11111_11111_11111</span>);
+
+<span class="hljs-variable">$token</span> = [
+<span class="hljs-number">0x14B499C</span>,
+<span class="hljs-number">0x0BE34CC</span>, <span class="hljs-number">0x01C9C69</span>,
+<span class="hljs-number">0x0ECA069</span>, <span class="hljs-number">0x01C2449</span>, <span class="hljs-number">0x0FDB166</span>, <span class="hljs-number">0x01C9C69</span>,
+<span class="hljs-number">0x01C1C66</span>, <span class="hljs-number">0x0FC1C47</span>, <span class="hljs-number">0x01C1C66</span>,
+<span class="hljs-number">0x10C5858</span>, <span class="hljs-number">0x1E4E3B8</span>, <span class="hljs-number">0x1A2F2F8</span>,
+];
+<span class="hljs-keyword">foreach</span> (<span class="hljs-variable">$token</span> <span class="hljs-keyword">as</span> <span class="hljs-variable">$x</span>) {
+<span class="hljs-variable">$x</span> = <span class="hljs-variable">$x</span> ^ N;
+
+<span class="hljs-variable">$x</span> = <span class="hljs-title function_ invoke__">sprintf</span>(<span class="hljs-string">&#x27;%025b&#x27;</span>, <span class="hljs-variable">$x</span>);
+<span class="hljs-variable">$x</span> = <span class="hljs-title function_ invoke__">str_replace</span>(<span class="hljs-attr">search</span>: [<span class="hljs-string">&#x27;0&#x27;</span>, <span class="hljs-string">&#x27;1&#x27;</span>], <span class="hljs-attr">replace</span>: [<span class="hljs-string">&#x27; &#x27;</span>, <span class="hljs-string">&#x27;#&#x27;</span>], <span class="hljs-attr">subject</span>: <span class="hljs-variable">$x</span>);
+<span class="hljs-variable">$x</span> = <span class="hljs-title function_ invoke__">implode</span>(<span class="hljs-string">&quot;\n&quot;</span>, <span class="hljs-title function_ invoke__">str_split</span>(<span class="hljs-variable">$x</span>, <span class="hljs-attr">length</span>: <span class="hljs-number">5</span>));
+<span class="hljs-keyword">echo</span> <span class="hljs-string">&quot;<span class="hljs-subst">{$x}</span>\n\n&quot;</span>;
+}</code></pre>
+
+ <p>
+ さて、この問題はさきほどのように単純に実行しただけでは、謎のブロックが表示されるだけでトークンは得られない。 トークンを得るためには、ソースコードを読み、定数 <code>N</code> を特定する必要がある。
+ </p>
+
+ <p>
+ ここでは、私の想定解を解説する。
+ </p>
+
+ <section id="section--q2-riddle--code-reading">
+ <h3><a href="#section--q2-riddle--code-reading">読解</a></h3>
+ <p>
+ まずはソースコードを読んでいく。
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight"><span class="hljs-variable">$token</span> = [
+<span class="hljs-comment">// 略</span>
+];</code></pre>
+
+ <p>
+ 数値からなる <code>$token</code> があり、各要素をループしている。
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight"><span class="hljs-variable">$x</span> = <span class="hljs-variable">$x</span> ^ N;</code></pre>
+
+ <p>
+ まずは排他的論理和 (xor) を取り、
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight"><span class="hljs-variable">$x</span> = <span class="hljs-title function_ invoke__">sprintf</span>(<span class="hljs-string">&#x27;%025b&#x27;</span>, <span class="hljs-variable">$x</span>);</code></pre>
+
+ <p>
+ 二進数に変換して、
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight"><span class="hljs-variable">$x</span> = <span class="hljs-title function_ invoke__">str_replace</span>(<span class="hljs-attr">search</span>: [<span class="hljs-string">&#x27;0&#x27;</span>, <span class="hljs-string">&#x27;1&#x27;</span>], <span class="hljs-attr">replace</span>: [<span class="hljs-string">&#x27; &#x27;</span>, <span class="hljs-string">&#x27;#&#x27;</span>], <span class="hljs-attr">subject</span>: <span class="hljs-variable">$x</span>);</code></pre>
+
+ <p>
+ 0 を空白に、1 を <code>#</code> にし、
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight"><span class="hljs-variable">$x</span> = <span class="hljs-title function_ invoke__">implode</span>(<span class="hljs-string">&quot;\n&quot;</span>, <span class="hljs-title function_ invoke__">str_split</span>(<span class="hljs-variable">$x</span>, <span class="hljs-attr">length</span>: <span class="hljs-number">5</span>));</code></pre>
+
+ <p>
+ 5文字ごとに区切ったあと、改行で結合している。
+ </p>
+ </section>
+
+ <section id="section--q2-riddle--hint">
+ <h3><a href="#section--q2-riddle--hint">ヒント</a></h3>
+ <p>
+ 次に、ソースコードに書いてあるヒントを読んでいく。
+ </p>
+
+ <ul>
+ <li>
+ <code>N</code> それ自体は、42 や 8128 といったような特別な意味を持たず、ランダムに決められている
+ </li>
+
+ <li>
+ <code>$token</code> の各要素は、1文字を表す
+ </li>
+
+ <li>
+ 1文字は 5x5 のセルからなる
+ </li>
+
+ <li>
+ 出力されるのは、完全な PHPer トークンである
+ </li>
+ </ul>
+
+ <p>
+ ここで、PHPer トークンは必ず <code>#</code> 記号から始まることを思いだすと、 <code>$token</code> の最初の数字 <code>0x14B499C</code> は、変換の結果 <code>#</code> になるのではないかと予想される (なお、このことは、リポジトリの README ファイルに追加ヒントとして書かれている)。
+ </p>
+ </section>
+
+ <section id="section--q2-riddle--solve">
+ <h3><a href="#section--q2-riddle--solve">解く</a></h3>
+ <p>
+ ここまでわかれば、あと一歩で解ける。すなわち、<code>0x14B499C</code> が <code>#</code> に変換されるような <code>N</code> を見つければよい。
+ </p>
+
+ <p>
+ <code>N</code> は高々
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight"><span class="hljs-title function_ invoke__">assert</span>(<span class="hljs-number">0</span> &lt;= N &amp;&amp; N &lt;= <span class="hljs-number">0b11111_11111_11111_11111_11111</span>);</code></pre>
+
+ <p>
+ なのでブルートフォースしてもよいが、ここではブルートフォースしない方法を紹介する。
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight"><span class="hljs-meta">&lt;?php</span>
+
+<span class="hljs-variable">$x</span> = <span class="hljs-number">0x14B499C</span>;
+
+<span class="hljs-variable">$x</span> = <span class="hljs-variable">$x</span> ^ N;
+
+<span class="hljs-variable">$x</span> = <span class="hljs-title function_ invoke__">sprintf</span>(<span class="hljs-string">&#x27;%025b&#x27;</span>, <span class="hljs-variable">$x</span>);
+<span class="hljs-variable">$x</span> = <span class="hljs-title function_ invoke__">str_replace</span>(<span class="hljs-attr">search</span>: [<span class="hljs-string">&#x27;0&#x27;</span>, <span class="hljs-string">&#x27;1&#x27;</span>], <span class="hljs-attr">replace</span>: [<span class="hljs-string">&#x27; &#x27;</span>, <span class="hljs-string">&#x27;#&#x27;</span>], <span class="hljs-attr">subject</span>: <span class="hljs-variable">$x</span>);
+<span class="hljs-variable">$x</span> = <span class="hljs-title function_ invoke__">implode</span>(<span class="hljs-string">&quot;\n&quot;</span>, <span class="hljs-title function_ invoke__">str_split</span>(<span class="hljs-variable">$x</span>, <span class="hljs-attr">length</span>: <span class="hljs-number">5</span>));
+
+<span class="hljs-title function_ invoke__">assert</span>(<span class="hljs-variable">$x</span> ===
+<span class="hljs-string">&quot; # # \n&quot;</span> .
+<span class="hljs-string">&quot;#####\n&quot;</span> .
+<span class="hljs-string">&quot; # # \n&quot;</span> .
+<span class="hljs-string">&quot;#####\n&quot;</span> .
+<span class="hljs-string">&quot; # # &quot;</span>);</code></pre>
+
+ <p>
+ この一連の変換に対する逆変換を考えると、次のようになる。
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight"><span class="hljs-meta">&lt;?php</span>
+
+<span class="hljs-variable">$x</span> =
+<span class="hljs-string">&quot; # # \n&quot;</span> .
+<span class="hljs-string">&quot;#####\n&quot;</span> .
+<span class="hljs-string">&quot; # # \n&quot;</span> .
+<span class="hljs-string">&quot;#####\n&quot;</span> .
+<span class="hljs-string">&quot; # # &quot;</span>;
+
+<span class="hljs-variable">$x</span> = <span class="hljs-title function_ invoke__">implode</span>(<span class="hljs-string">&#x27;&#x27;</span>, <span class="hljs-title function_ invoke__">explode</span>(<span class="hljs-string">&quot;\n&quot;</span>, <span class="hljs-variable">$x</span>));
+<span class="hljs-variable">$x</span> = <span class="hljs-title function_ invoke__">str_replace</span>(<span class="hljs-attr">search</span>: [<span class="hljs-string">&#x27; &#x27;</span>, <span class="hljs-string">&#x27;#&#x27;</span>], <span class="hljs-attr">replace</span>: [<span class="hljs-string">&#x27;0&#x27;</span>, <span class="hljs-string">&#x27;1&#x27;</span>], <span class="hljs-attr">subject</span>: <span class="hljs-variable">$x</span>);
+<span class="hljs-variable">$x</span> = <span class="hljs-title function_ invoke__">bindec</span>(<span class="hljs-variable">$x</span>);
+
+<span class="hljs-variable">$n</span> = <span class="hljs-variable">$x</span> ^ <span class="hljs-number">0x14B499C</span>;
+
+<span class="hljs-keyword">echo</span> <span class="hljs-string">&quot;N = <span class="hljs-subst">$n</span>\n&quot;</span>;</code></pre>
+
+ <p>
+ これを実行すると、<code>N</code> が得られる。
+ </p>
+ </section>
+ </section>
+
+ <section id="section--q3-toquine">
+ <h2><a href="#section--q3-toquine">第3問 toquine.php</a></h2>
+ <p>
+ ソースコードはこちら。
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight"><span class="hljs-meta">&lt;?php</span>
+
+<span class="hljs-comment">// License: https://creativecommons.org/publicdomain/zero/1.0/</span>
+<span class="hljs-comment">// This is a quine-like program to generate a PHPer token.</span>
+<span class="hljs-comment">// Execute it like this: php toquine.php | php | php | php | ...</span>
+
+<span class="hljs-variable">$s</span> = &lt;&lt;&lt;<span class="hljs-string">&#x27;Q&#x27;</span>
+<span class="hljs-meta">&lt;?</span>cuc
+<span class="hljs-comment">// Yvprafr: uggcf://perngvirpbzzbaf.bet/choyvpqbznva/mreb/1.0/</span>
+<span class="hljs-comment">// Guvf vf n dhvar-yvxr cebtenz gb trarengr n CUCre gbxra.</span>
+<span class="hljs-comment">// Rkrphgr vg yvxr guvf: cuc gbdhvar.cuc | cuc | cuc | cuc | ...</span>
+%f<span class="hljs-variable">$f</span> = %f;
+<span class="hljs-variable">$f</span> = <span class="hljs-title function_ invoke__">fge_ebg13</span>(<span class="hljs-variable">$f</span>); <span class="hljs-variable">$kf</span> = [
+%f,
+];
+<span class="hljs-variable">$g</span> = ahyy.snyfr; <span class="hljs-title function_ invoke__">sbe</span> (<span class="hljs-variable">$v</span> = <span class="hljs-number">0</span>; <span class="hljs-variable">$v</span> &lt;= <span class="hljs-title function_ invoke__">vagqvi</span>(__YVAR__-<span class="hljs-number">035</span>,<span class="hljs-number">6</span>); ++<span class="hljs-variable">$v</span>) <span class="hljs-title function_ invoke__">vs</span> (!<span class="hljs-title function_ invoke__">vffrg</span>(<span class="hljs-variable">$kf</span>[<span class="hljs-variable">$v</span>])) oernx; ryfr
+<span class="hljs-variable">$g</span> .= <span class="hljs-title function_ invoke__">vzcybqr</span>(<span class="hljs-string">&quot;\a&quot;</span>, <span class="hljs-title function_ invoke__">fge_fcyvg</span>(<span class="hljs-title function_ invoke__">fge_ercynpr</span>([<span class="hljs-string">&#x27;0&#x27;</span>,<span class="hljs-string">&#x27;1&#x27;</span>], [<span class="hljs-string">&#x27; &#x27;</span>,<span class="hljs-string">&#x27;##&#x27;</span>], <span class="hljs-title function_ invoke__">fcevags</span>(<span class="hljs-title function_ invoke__">pue</span>(<span class="hljs-number">37</span>) . <span class="hljs-string">&#x27;025o&#x27;</span>, <span class="hljs-variable">$kf</span>[<span class="hljs-variable">$v</span>])), <span class="hljs-number">012</span>)) . <span class="hljs-string">&quot;\a\a&quot;</span>;
+<span class="hljs-variable">$jf</span> = <span class="hljs-title function_ invoke__">neenl_znc</span>(<span class="hljs-title function_ invoke__">sa</span>(<span class="hljs-variable">$j</span>) =&gt; <span class="hljs-title function_ invoke__">vzcybqr</span>(<span class="hljs-string">&#x27;, &#x27;</span>, <span class="hljs-variable">$j</span>), <span class="hljs-title function_ invoke__">neenl_puhax</span>(<span class="hljs-title function_ invoke__">neenl_znc</span>(<span class="hljs-title function_ invoke__">sa</span>(<span class="hljs-variable">$k</span>) =&gt; <span class="hljs-title function_ invoke__">fcevags</span>(<span class="hljs-string">&#x27;0k&#x27;</span> . <span class="hljs-title function_ invoke__">pue</span>(<span class="hljs-number">37</span>) . <span class="hljs-string">&#x27;07K&#x27;</span>, <span class="hljs-variable">$k</span>), <span class="hljs-variable">$kf</span>), <span class="hljs-number">10</span>));
+<span class="hljs-title function_ invoke__">cevags</span>(<span class="hljs-variable">$f</span>, <span class="hljs-variable">$g</span>, <span class="hljs-title function_ invoke__">fge_ebg13</span>(<span class="hljs-string">&quot;&lt;&lt;&lt;&#x27;Q&#x27;\a<span class="hljs-subst">{$f}</span>\aQ&quot;</span>), <span class="hljs-title function_ invoke__">vzcybqr</span>(<span class="hljs-string">&quot;,\a&quot;</span>, <span class="hljs-variable">$jf</span>));
+Q;
+<span class="hljs-variable">$s</span> = <span class="hljs-title function_ invoke__">str_rot13</span>(<span class="hljs-variable">$s</span>); <span class="hljs-variable">$xs</span> = [
+<span class="hljs-number">0x0AFABEA</span>, <span class="hljs-number">0x1F294A7</span>, <span class="hljs-number">0x1F2109F</span>, <span class="hljs-number">0x1F294A7</span>, <span class="hljs-number">0x0002800</span>, <span class="hljs-number">0x1F2109F</span>, <span class="hljs-number">0x0117041</span>, <span class="hljs-number">0x1F294A7</span>, <span class="hljs-number">0x1FAD6B5</span>, <span class="hljs-number">0x1F295B7</span>,
+<span class="hljs-number">0x010FC21</span>, <span class="hljs-number">0x1FAD6B5</span>, <span class="hljs-number">0x1151151</span>, <span class="hljs-number">0x010FC21</span>, <span class="hljs-number">0x1F294A7</span>, <span class="hljs-number">0x1F295B7</span>, <span class="hljs-number">0x1FAD6B5</span>, <span class="hljs-number">0x1F294A7</span>, <span class="hljs-number">0x1F295B7</span>, <span class="hljs-number">0x1F8C63F</span>,
+<span class="hljs-number">0x1F8C631</span>, <span class="hljs-number">0x1FAD6B5</span>, <span class="hljs-number">0x17AD6BD</span>, <span class="hljs-number">0x17AD6BD</span>, <span class="hljs-number">0x1F8C63F</span>, <span class="hljs-number">0x1F295B7</span>,
+];
+<span class="hljs-variable">$t</span> = <span class="hljs-literal">null</span>.<span class="hljs-literal">false</span>; <span class="hljs-keyword">for</span> (<span class="hljs-variable">$i</span> = <span class="hljs-number">0</span>; <span class="hljs-variable">$i</span> &lt;= <span class="hljs-title function_ invoke__">intdiv</span>(<span class="hljs-keyword">__LINE__</span>-<span class="hljs-number">035</span>,<span class="hljs-number">6</span>); ++<span class="hljs-variable">$i</span>) <span class="hljs-keyword">if</span> (!<span class="hljs-keyword">isset</span>(<span class="hljs-variable">$xs</span>[<span class="hljs-variable">$i</span>])) <span class="hljs-keyword">break</span>; <span class="hljs-keyword">else</span>
+<span class="hljs-variable">$t</span> .= <span class="hljs-title function_ invoke__">implode</span>(<span class="hljs-string">&quot;\n&quot;</span>, <span class="hljs-title function_ invoke__">str_split</span>(<span class="hljs-title function_ invoke__">str_replace</span>([<span class="hljs-string">&#x27;0&#x27;</span>,<span class="hljs-string">&#x27;1&#x27;</span>], [<span class="hljs-string">&#x27; &#x27;</span>,<span class="hljs-string">&#x27;##&#x27;</span>], <span class="hljs-title function_ invoke__">sprintf</span>(<span class="hljs-title function_ invoke__">chr</span>(<span class="hljs-number">37</span>) . <span class="hljs-string">&#x27;025b&#x27;</span>, <span class="hljs-variable">$xs</span>[<span class="hljs-variable">$i</span>])), <span class="hljs-number">012</span>)) . <span class="hljs-string">&quot;\n\n&quot;</span>;
+<span class="hljs-variable">$ws</span> = <span class="hljs-title function_ invoke__">array_map</span>(fn(<span class="hljs-variable">$w</span>) =&gt; <span class="hljs-title function_ invoke__">implode</span>(<span class="hljs-string">&#x27;, &#x27;</span>, <span class="hljs-variable">$w</span>), <span class="hljs-title function_ invoke__">array_chunk</span>(<span class="hljs-title function_ invoke__">array_map</span>(fn(<span class="hljs-variable">$x</span>) =&gt; <span class="hljs-title function_ invoke__">sprintf</span>(<span class="hljs-string">&#x27;0x&#x27;</span> . <span class="hljs-title function_ invoke__">chr</span>(<span class="hljs-number">37</span>) . <span class="hljs-string">&#x27;07X&#x27;</span>, <span class="hljs-variable">$x</span>), <span class="hljs-variable">$xs</span>), <span class="hljs-number">10</span>));
+<span class="hljs-title function_ invoke__">printf</span>(<span class="hljs-variable">$s</span>, <span class="hljs-variable">$t</span>, <span class="hljs-title function_ invoke__">str_rot13</span>(<span class="hljs-string">&quot;&lt;&lt;&lt;&#x27;D&#x27;\n<span class="hljs-subst">{$s}</span>\nD&quot;</span>), <span class="hljs-title function_ invoke__">implode</span>(<span class="hljs-string">&quot;,\n&quot;</span>, <span class="hljs-variable">$ws</span>));</code></pre>
+
+ <p>
+ コメントにもあるとおり、次のようにして実行すれば答えがでてくる。
+ </p>
+
+ <pre class="highlight" language="shell-session" linenumbering="unnumbered"><code>$ php toquine.php | php | php | php | ...</code></pre>
+
+ <p>
+ 実際にはもう少しパイプで繋げなければならない。
+ </p>
+
+ <section id="section--q3-toquine--commentary">
+ <h3><a href="#section--q3-toquine--commentary">解説</a></h3>
+ <section id="section--q3-toquine--commentary--quine">
+ <h4><a href="#section--q3-toquine--commentary--quine">プログラム全体</a></h4>
+ <p>
+ コメントにもあるとおり、これは quine (風) のプログラムになっている。 Quine とは、自分のソースコードをそっくりそのまま出力するようなプログラムのことである。
+ </p>
+
+ <p>
+ このプログラムは、実行すると自身とほとんど同じプログラムを出力する。 異なるのはトークンになっている部分のみである。
+ </p>
+ </section>
+
+ <section id="section--q3-toquine--commentary--tokens">
+ <h4><a href="#section--q3-toquine--commentary--tokens">トークン</a></h4>
+ <p>
+ <code>$xs</code> がトークンに対応している。変換のロジックは <code>riddle.php</code> とほぼ同じなので省略する。
+ </p>
+ </section>
+
+ <section id="section--q3-toquine--commentary--states">
+ <h4><a href="#section--q3-toquine--commentary--states">状態保持</a></h4>
+ <p>
+ トークンの何文字目まで出力したかを、ソースコードを変えずに (quine なので) 覚えておく必要がある。 このプログラムでは、トークンが出力されるとソースコードがだんだんと長くなっていくのを利用して、<code><em>LINE</em></code> から情報を取得している。
+ </p>
+ </section>
+
+ <section id="section--q3-toquine--commentary--rot-13">
+ <h4><a href="#section--q3-toquine--commentary--rot-13">ROT 13</a></h4>
+ <p>
+ Quine は、素朴に書くとプログラムの一部が 2回記述されてしまう。 これがあまり美しくないので、<code>toquine.php</code> では、ROT 13 変換を使って難読化した。
+ </p>
+
+ <p>
+ それにしてもなぜこんなものが標準ライブラリに……。
+ </p>
+ </section>
+ </section>
+ </section>
+
+ <section id="section--outro">
+ <h2><a href="#section--outro">おわりに</a></h2>
+ <p>
+ 解いていただいたみなさん、また、難易度調整につきあっていただいた社内のみなさん、ありがとうございました。
+ </p>
+
+ <p>
+ 今回は直前に作りはじめたのもあり、3問だけかつ使い古されたネタばかりになってしまいましたが、 来年は 5問、より面白い問題を持っていきます。
+ </p>
+
+ <p>
+ 実はもう作りはじめているので、どうか来年もありますように……。
+ </p>
+ </section>
+ </div>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/posts/2022-04-24/term-banner-write-tool-showing-banner-in-terminal/index.html b/vhosts/blog/public/posts/2022-04-24/term-banner-write-tool-showing-banner-in-terminal/index.html
new file mode 100644
index 00000000..595fb462
--- /dev/null
+++ b/vhosts/blog/public/posts/2022-04-24/term-banner-write-tool-showing-banner-in-terminal/index.html
@@ -0,0 +1,166 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2022 nsfisis">
+ <meta name="description" content="ターミナルに任意の文字のバナーを表示するためのツールを Go で書いた。">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>term-banner: ターミナルにバナーを表示するツールを書いた | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ <link rel="stylesheet" href="/hl.css?h=340e65ffd5c17713efc9107c06304f7b">
+ </head>
+ <body class="single">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <article class="post-single">
+ <header class="post-header">
+ <h1 class="post-title">term-banner: ターミナルにバナーを表示するツールを書いた</h1>
+ </header>
+ <div class="post-content">
+ <section>
+ <h2 id="changelog">更新履歴</h2>
+ <ol>
+ <li class="revision">
+ <time datetime="2022-04-24">2022-04-24</time>: 公開
+ </li>
+ <li class="revision">
+ <time datetime="2022-04-27">2022-04-27</time>: -f オプションについて追記
+ </li>
+ </ol>
+ </section>
+ <section id="section--intro">
+ <h2><a href="#section--intro">はじめに</a></h2>
+ <p>
+ こんなものを作った。
+ </p>
+
+ <pre class="highlight monospaced"><code>$ term-banner &apos;Hello, World!&apos; &apos;こんにちは、&apos; &apos;世界!&apos;</code></pre>
+
+ <p>
+ image::https://raw.githubusercontent.com/nsfisis/term-banner/main/screenshot.png[term-banner のスクリーンショット]
+ </p>
+
+ <p>
+ コマンドライン引数として渡した文字列をターミナルに大きく表示する。
+ </p>
+
+ <p>
+ リポジトリはこちら: <a href="https://github.com/nsfisis/term-banner">https://github.com/nsfisis/term-banner</a>
+ </p>
+ </section>
+
+ <section id="section--motivation">
+ <h2><a href="#section--motivation">Motivation</a></h2>
+ <p>
+ 以前、https://github.com/nsfisis/big-clock-mode[big-clock-mode] という似たようなプログラムを書いた。 これは tmux の <code>:clock-mode</code> コマンドに着想を得たもので、<code>:clock-mode</code> よりも大きく現在時刻を表示する。
+ </p>
+
+ <p>
+ <code>big-clock-mode</code> を開発したのは、次のようなシチュエーションで使うためである。 弊社では現在リモートワークが基本だが、web 会議などで画面共有しているときに、休憩を挟んで特定の時刻から再開する、ということがある。 こういったケースで、画面上に現在の時刻を大きめに表示しておくと、モニタから離れても遠くから時刻がわかるので便利である。
+ </p>
+
+ <p>
+ それこそタイマアプリか何かを使えばいいのだが、ターミナルに棲むいきものとしては、住処から離れたくないわけだ。
+ </p>
+
+ <p>
+ しばらく便利に使っていたのだが、ひとつ不満点が出てきた。それは、再開する時刻がいつだったかを覚えておかなければならないということだ。 どこかにメモしておいてもいいが、せっかくなら現在時刻とともに表示させておきたい。
+ </p>
+
+ <p>
+ そんなわけで、「任意の文字列をターミナルに表示する」プログラムを書く運びとなった。 まあ、作らなくても探せばあると思うが、作りたいものは作りたいので知ったことではない。
+ </p>
+ </section>
+
+ <section id="section--program">
+ <h2><a href="#section--program">プログラム</a></h2>
+ <p>
+ 全体の流れは次のようになっている。
+ </p>
+
+ <ol numeration="arabic">
+ <li>
+ フォントファイルを読み込む
+ </li>
+
+ <li>
+ コマンドライン引数を Shift-JIS に変換する (フォントが Shift-JIS 基準で並んでいるため)
+ </li>
+
+ <li>
+ 1文字ずつレンダリングしていく
+ </li>
+ </ol>
+
+ <p>
+ <code>big-clock-mode</code> が Go 製なので、今回も Go で書いた。 PNG が標準ライブラリにあったり、Shift-JIS のエンコーディングが準標準ライブラリにあったりしたのは助かった。
+ </p>
+
+ <p>
+ フォントファイルは <code>go:embed</code> で実行ファイルに埋め込んでいるので、ビルド後はワンバイナリで動く。 仕事ではスクリプト言語ばかり書いているが、やはりコンパイル言語はいい。
+ </p>
+ </section>
+
+ <section id="section--font">
+ <h2><a href="#section--font">フォント</a></h2>
+ <p>
+ フリーの 8x8 ビットマップフォントである、https://littlelimit.net/misaki.htm[美咲フォント 2021-05-05a 版] を使わせていただいた。
+ </p>
+
+ <p>
+ はじめは自分でポチポチ打っていたのだが、「き」くらいまでやって挫折した。 同じく 8x8 で作っていたのだが、平仮名でさえも、この小さなキャンバスにはとても収められない。
+ </p>
+
+ <p>
+ 美咲フォントは、平仮名・片仮名に留まらず、JIS 第一・第二水準の漢字までサポートしている。 第二水準ともなると一生お目にかかることのない字の方が多いくらいだが、これをこの大きさで書くというのは、もはや芸術の域である。
+ </p>
+
+ <p>
+ さらに言うと、実のところ美咲フォントは実サイズ 7x7 で作られており、余白が設けられている。 これは、単純にそのまま並べても字間・行間を確保できるようにという配慮である。 おかげでコーディングまで楽になった。
+ </p>
+
+ <p>
+ ゴシック体と明朝体があったが、私の好みで明朝体の方にした。 ただ、ゴシック体の方が見やすい気がするので、フォントを選べるように後ほど拡張するかもしれない。
+ </p>
+
+ <p>
+ 2022-04-27 追記: <code>-f</code> オプションで選べるようにした。
+ </p>
+ </section>
+
+ <section id="section--outro">
+ <h2><a href="#section--outro">おわりに</a></h2>
+ <p>
+ あなたもターミナルに住んでみませんか?
+ </p>
+ </section>
+ </div>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/posts/2022-05-01/phperkaigi-2022/index.html b/vhosts/blog/public/posts/2022-05-01/phperkaigi-2022/index.html
new file mode 100644
index 00000000..173b20d3
--- /dev/null
+++ b/vhosts/blog/public/posts/2022-05-01/phperkaigi-2022/index.html
@@ -0,0 +1,268 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2022 nsfisis">
+ <meta name="description" content="2022-04-09 から 2022-04-11 にかけて開催された、PHPerKaigi 2022 に参加した。">
+ <meta name="keywords" content="カンファレンス,PHP,PHPerKaigi">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>PHPerKaigi 2022 | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ <link rel="stylesheet" href="/hl.css?h=340e65ffd5c17713efc9107c06304f7b">
+ </head>
+ <body class="single">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <article class="post-single">
+ <header class="post-header">
+ <h1 class="post-title">PHPerKaigi 2022</h1>
+ <ul class="post-tags">
+ <li class="tag">
+ <a href="/tags/conference/">カンファレンス</a>
+ </li>
+ <li class="tag">
+ <a href="/tags/php/">PHP</a>
+ </li>
+ <li class="tag">
+ <a href="/tags/phperkaigi/">PHPerKaigi</a>
+ </li>
+ </ul>
+ </header>
+ <div class="post-content">
+ <section>
+ <h2 id="changelog">更新履歴</h2>
+ <ol>
+ <li class="revision">
+ <time datetime="2022-05-01">2022-05-01</time>: 公開
+ </li>
+ </ol>
+ </section>
+ <section id="section--intro">
+ <h2><a href="#section--intro">はじめに</a></h2>
+ <p>
+ 2022-04-09 から 2022-04-11 にかけて開催された、<a href="https://phperkaigi.jp/2022/">PHPerKaigi 2022</a> に、 一般参加者として参加した。 弊社<a href="https://www.dgcircus.com/">デジタルサーカス株式会社</a>はダイヤモンドスポンサーとなっており、 スポンサー枠のチケットを使わせていただいた。
+ </p>
+
+ <p>
+ 昨年のレポートは<a href="/posts/2021-03-30/phperkaigi-2021">こちら</a>。
+ </p>
+ </section>
+
+ <section id="section--comments">
+ <h2><a href="#section--comments">感想</a></h2>
+ <section id="section--comments--great-sessions">
+ <h3><a href="#section--comments--great-sessions">厳選おすすめトーク</a></h3>
+ <p>
+ 多くの素晴らしいトークの中から、特におすすめのものを 5つ選んだ。 是非聞いてほしい。引用部分は、リンク先プロポーザルから引用している。
+ </p>
+
+ <p>
+ <a href="https://fortee.jp/phperkaigi-2022/proposal/ef8cf4ed-63fe-42f8-8145-b3e70054458b">予防に勝る防御なし - 堅牢なコードを導く様々な設計のヒント</a>
+ </p>
+
+ <blockquote>
+ <p>
+ PHP はバージョンを追う毎に型宣言、例外、表明、列挙型などの機能が大幅に強化され、堅牢なコードを書くための機能が充実してきました。それらの機能はどう使うと効果的なのでしょうか。
+ </p>
+
+ <p>
+ 本講演では PHP 8.1 をベースにして、誤りを想定してチェックするのではなく、そもそも誤りにくい設計とはどのようなものか、つまり「予防」の観点を軸足に、堅牢なコードを導くための様々な設計のヒントをご紹介します。
+ </p>
+ </blockquote>
+
+ <p>
+ <a href="https://fortee.jp/phperkaigi-2022/proposal/db00d49e-0dd6-453f-b54b-f731d112f10e">PHPのエラーを理解して適切なエラーハンドリングを学ぼう</a>
+ </p>
+
+ <blockquote>
+ <p>
+ PHPを使ってるとよく遭遇する Fatal error / Parse error / Warning / Notice 理解していますか?
+ <br>
+ これらのエラー文を理解することで、すぐにエラーの原因に気付き適切に対象できる様になります!
+ <br>
+ またそれらを理解した上でのエラーハンドリングを学びましょう。
+ </p>
+ </blockquote>
+
+ <p>
+ <a href="https://fortee.jp/phperkaigi-2022/proposal/4a7e3ded-9134-4919-955c-ec7bf4491c0d">エラー監視とテスト体制への改善作戦</a>
+ </p>
+
+ <blockquote>
+ <p>
+ 毎日流れてくるエラーに皆さんはどう向き合ってますか?
+ <br>
+ エラーを出さない事が一番ですが、完全に塞ぐ事は難しいと考えます。
+ <br>
+ サービス運用の中で本番環境から発生するエラー(サーバー・クライアントサイド・サードパーティ起因のエラー)への監視体制と、
+ <br>
+ エラー・バグ防御のためチームで行っているテストコード文化づくりの話をします。
+ </p>
+ </blockquote>
+
+ <p>
+ <a href="https://fortee.jp/phperkaigi-2022/proposal/6f47daf8-c78f-4fb1-9b99-e9656e6fe7f7">ISUCON11のPHP実装は、何を考え、どのようにして作られていたのか</a>
+ </p>
+
+ <blockquote>
+ <p>
+ 昨年開催されたISUCON11にて問題(参考実装)のPHPへの移植を担当させていただきました。
+ </p>
+
+ <p>
+ 最終的なソースコードこそシンプルなWebアプリケーションではありますが、その裏には
+ <br>
+ ・「(私の思う)良い設計」を実現するための意思決定
+ <br>
+ ・「ISUCONの問題」という位置付けに由来する取捨選択
+ <br>
+ ・移植中に遭遇したトラブルとその解決策
+ <br>
+ といった文脈や葛藤が存在しています。
+ </p>
+
+ <p>
+ 本発表はそれらを共有することで
+ <br>
+ ・PHPアプリケーションの設計、実装事例として役立ててもらう
+ <br>
+ ・ISUCONの言語移植に興味を持ってもらう
+ <br>
+ ・ISUCON問題移植の「実装や設計の練習をする教材」としての可能性を知ってもらう
+ <br>
+ ことを目的とします。
+ </p>
+ </blockquote>
+
+ <p>
+ <a href="https://fortee.jp/phperkaigi-2022/proposal/5a260e4e-542d-4d82-849d-ef3d6cb7c854">チームの仕事はまわっていたけど、メンバーはそれぞれモヤモヤを抱えていた話──40名の大規模開発チームで1on1ログを公開してみた</a>
+ </p>
+
+ <blockquote>
+ <p>
+ サイボウズの大企業向けグループウェアのGaroon(ガルーン)は、PHPで開発されている20年目の製品です。ガルーン開発チームは日本で40名、ベトナムで50名の計90名ほどのチームになっています。また、コロナ禍でフルリモートでの活動がこの2年ほど継続してきました。
+ </p>
+
+ <p>
+ フルリモートになっても仕事はまわっており、継続的にリリースはしていましたが、一方でお互いの考えていることや感じている問題意識が見えづらくなり、モヤモヤを抱えているメンバーが増えていました。
+ </p>
+
+ <p>
+ このセッションでは、そういう状況で私がチーム外からジョインし、聴き役に徹しながら見える化することで状況を改善していった取り組みを紹介します。同じように大きなチームやリモートワークで難しさを感じている人に、難しさの原因への気づきや取り組みへのヒントがあれば幸いです。
+ </p>
+ </blockquote>
+ </section>
+
+ <section id="section--comments--token-quizzes">
+ <h3><a href="#section--comments--token-quizzes">トークン問題の作成</a></h3>
+ <p>
+ 今回は、PHPer チャレンジ用に弊社のトークン問題を 3題作成した。 こちらについては<a href="/posts/2022-04-09/phperkaigi-2022-tokens">別途記事にしている</a>ので、そちらを参照されたい。
+ </p>
+ </section>
+
+ <section id="section--comments--phper-challenge">
+ <h3><a href="#section--comments--phper-challenge">PHPer チャレンジ</a></h3>
+ <p>
+ <a href="https://fortee.jp/phperkaigi-2022/challenge">1位</a>になった。
+ <br>
+ また、賞品として <a href="https://www.amazon.co.jp/dp/B08MQNJC9Z">Echo Show 15</a> をいただいた。
+ </p>
+ </section>
+
+ <section id="section--comments--conference">
+ <h3><a href="#section--comments--conference">カンファレンス全体への感想</a></h3>
+ <p>
+ <a href="/posts/2021-03-30/phperkaigi-2021">去年の参加レポ</a> では、こんなことを書いた。
+ </p>
+
+ <blockquote>
+ <p>
+ 1つ個人的な反省点としては、(中略) Discord しかりアンカンファレンスしかり「このイベントのこの瞬間にしかないコンテンツ」に触れずに、 後から見返せる発表やスライドに注力してしまった、ということだ。 発表の詳細な見直しはあとからできるのだから、今しかできないことを考えるべきだった。
+ <br>
+ まあ初カンファレンスだし、とお茶を濁しておこう。
+ </p>
+ </blockquote>
+
+ <p>
+ この反省を踏まえ、今年は積極的にほかの場 (公式の Discord サーバや、アンカンファレンス) にも参加した。
+ <br>
+ これにより、参加体験の質がはるかに向上した。特に Discord に関しては、登壇者ご本人による補足や、 質問への回答などがおこなわれる (ことが多い) ため、特別な理由のない限り、発言はしないまでも参加はしておいたほうが良いと思われる。
+ </p>
+
+ <p>
+ なお、アンカンファレンスについては、1日目の終わりに<a href="https://fortee.jp/phperkaigi-2022/unconference/view/d332797a-8921-4706-a7e2-ee72640c9b5e">トークン問題の解説放送</a>もおこなった。
+ </p>
+
+ <p>
+ また、今年はオフラインとオンラインのハイブリッド開催であったが、去年の全オンラインと比べて、オンライン参加の体験が落ちていなかったのは、特筆すべきであろう。 今年は 3回目のワクチン接種が間に合わなかったこともあり現地参加は見送ったのだが、来年は是非オフラインで参加したい。
+ </p>
+ </section>
+ </section>
+
+ <section id="section--next-year">
+ <h2><a href="#section--next-year">そして来年へ……?</a></h2>
+ <p>
+ PHPerKaigi 2023 があるかどうか存じ上げないが、あるとすれば、次の 4つを目標としたい。
+ </p>
+
+ <ul>
+ <li>
+ プロポーザルを出す
+ </li>
+
+ <li>
+ PHPer チャレンジのトークン問題を 5題作成する
+ </li>
+
+ <li>
+ 現地に行く
+ </li>
+
+ <li>
+ PHPer チャレンジで圧勝する
+ </li>
+ </ul>
+
+ <p>
+ <hr>
+ </hr>
+ </p>
+
+ <p>
+ 最後になりましたが、PHPerKaigi のスタッフ、スポンサー、スピーカーのみなさん、素敵な時間をありがとうございました。
+ </p>
+
+ <p>
+ ではまた来年。
+ </p>
+ </section>
+ </div>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/posts/2022-08-27/php-conference-okinawa-code-golf/index.html b/vhosts/blog/public/posts/2022-08-27/php-conference-okinawa-code-golf/index.html
new file mode 100644
index 00000000..2d311e7f
--- /dev/null
+++ b/vhosts/blog/public/posts/2022-08-27/php-conference-okinawa-code-golf/index.html
@@ -0,0 +1,192 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2022 nsfisis">
+ <meta name="description" content="PHP カンファレンス沖縄の懇親会 LT で出題されたコードゴルフの問題を解いてみた。">
+ <meta name="keywords" content="カンファレンス,PHP,PHP カンファレンス">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>PHP カンファレンス沖縄で出題されたコードゴルフの問題を解いてみた | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ <link rel="stylesheet" href="/hl.css?h=340e65ffd5c17713efc9107c06304f7b">
+ </head>
+ <body class="single">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <article class="post-single">
+ <header class="post-header">
+ <h1 class="post-title">PHP カンファレンス沖縄で出題されたコードゴルフの問題を解いてみた</h1>
+ <ul class="post-tags">
+ <li class="tag">
+ <a href="/tags/conference/">カンファレンス</a>
+ </li>
+ <li class="tag">
+ <a href="/tags/php/">PHP</a>
+ </li>
+ <li class="tag">
+ <a href="/tags/phpcon/">PHP カンファレンス</a>
+ </li>
+ </ul>
+ </header>
+ <div class="post-content">
+ <section>
+ <h2 id="changelog">更新履歴</h2>
+ <ol>
+ <li class="revision">
+ <time datetime="2022-08-27">2022-08-27</time>: 公開
+ </li>
+ </ol>
+ </section>
+ <section id="section--intro">
+ <h2><a href="#section--intro">はじめに</a></h2>
+ <p>
+ 本日 <a href="https://phpcon.okinawa.jp/">PHP カンファレンス沖縄 2022</a> が開催された (らしい)。
+ </p>
+
+ <p>
+ カンファレンスには参加できなかったものの、懇親会の LT で出題されたコードゴルフの問題が Twitter に流れてきたので、解いてみた。
+ </p>
+
+ <ul>
+ <li>
+ ツイート: <a href="https://twitter.com/m3m0r7/status/1563397620231712772">https://twitter.com/m3m0r7/status/1563397620231712772</a>
+ </li>
+
+ <li>
+ スライド: <a href="https://speakerdeck.com/memory1994/php-conference-okinawa-2022-extra?slide=3">https://speakerdeck.com/memory1994/php-conference-okinawa-2022-extra?slide=3</a>
+ </li>
+ </ul>
+ </section>
+
+ <section id="section--solution">
+ <h2><a href="#section--solution">解</a></h2>
+ <p>
+ 細かいレギュレーションは不明だったので、勝手に定めた。
+ </p>
+
+ <ul>
+ <li>
+ コマンドライン引数の第1引数で受けとる
+ </li>
+
+ <li>
+ 結果は標準出力に出す
+ </li>
+
+ <li>
+ コンマの直後にはスペースを1つ置く
+ </li>
+
+ <li>
+ 末尾コンマは禁止
+ </li>
+
+ <li>
+ 数字でないものは入ってこないものとする
+ </li>
+
+ <li>
+ 負数は入ってこないものとする
+ </li>
+ </ul>
+
+ <p>
+ 書いたものがこちら:
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight">[<span class="hljs-meta">&lt;?php</span> <span class="hljs-variable">$n</span>=<span class="hljs-variable">$argv</span>[<span class="hljs-number">1</span>];<span class="hljs-keyword">foreach</span>([<span class="hljs-number">1e4</span>,<span class="hljs-number">5e3</span>,<span class="hljs-number">2e3</span>,<span class="hljs-number">1e3</span>,<span class="hljs-number">500</span>,<span class="hljs-number">100</span>,<span class="hljs-number">50</span>,<span class="hljs-number">10</span>,<span class="hljs-number">5</span>,<span class="hljs-number">1</span>]<span class="hljs-keyword">as</span><span class="hljs-variable">$x</span>)<span class="hljs-keyword">for</span>(;<span class="hljs-variable">$n</span>&gt;=<span class="hljs-variable">$x</span>;<span class="hljs-variable">$n</span>-=<span class="hljs-variable">$x</span>)<span class="hljs-variable">$r</span>[]=<span class="hljs-variable">$x</span>;<span class="hljs-keyword">echo</span> <span class="hljs-title function_ invoke__">implode</span>(<span class="hljs-string">&#x27;, &#x27;</span>,<span class="hljs-variable">$r</span>??[]);<span class="hljs-meta">?&gt;</span>]</code></pre>
+
+ <p>
+ しめて 123 バイトとなった (末尾改行を含めずにカウント)。
+ </p>
+
+ <p>
+ こちらは改行とスペースを追加したバージョン:
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight">[<span class="hljs-meta">&lt;?php</span>
+
+<span class="hljs-variable">$n</span> = <span class="hljs-variable">$argv</span>[<span class="hljs-number">1</span>];
+<span class="hljs-keyword">foreach</span> ([<span class="hljs-number">1e4</span>, <span class="hljs-number">5e3</span>, <span class="hljs-number">2e3</span>, <span class="hljs-number">1e3</span>, <span class="hljs-number">500</span>, <span class="hljs-number">100</span>, <span class="hljs-number">50</span>, <span class="hljs-number">10</span>, <span class="hljs-number">5</span>, <span class="hljs-number">1</span>] <span class="hljs-keyword">as</span> <span class="hljs-variable">$x</span>)
+ <span class="hljs-keyword">for</span> (; <span class="hljs-variable">$n</span> &gt;= <span class="hljs-variable">$x</span>; <span class="hljs-variable">$n</span> -= <span class="hljs-variable">$x</span>)
+ <span class="hljs-variable">$r</span>[] = <span class="hljs-variable">$x</span>;
+<span class="hljs-keyword">echo</span> <span class="hljs-title function_ invoke__">implode</span>(<span class="hljs-string">&#x27;, &#x27;</span>, <span class="hljs-variable">$r</span> ?? []);
+
+<span class="hljs-meta">?&gt;</span>]</code></pre>
+ </section>
+
+ <section id="section--techniques">
+ <h2><a href="#section--techniques">使用したテクニック</a></h2>
+ <section id="section--techniques--exponential-notation">
+ <h3><a href="#section--techniques--exponential-notation">指数表記</a></h3>
+ <p>
+ 割と多くの言語のゴルフで使えるテクニック。 <code>e</code> を用いた指数表記で、大きな数を短く表す。 このコードでは <code>10000</code>、<code>5000</code>、<code>2000</code>、<code>1000</code> を指数表記している。
+ </p>
+ </section>
+
+ <section id="section--techniques--shorten-loop">
+ <h3><a href="#section--techniques--shorten-loop">foreach や for の中身を1つの文に</a></h3>
+ <p>
+ <code>foreach</code>、<code>for</code>、<code>if</code> などの後ろには、 通常 <code>{</code> を続けて複数の文を連ねるが、中身の文を1つにしてしまえば、<code>{</code> と <code>}</code> を省略できる。 C言語などでも使える。
+ </p>
+ </section>
+
+ <section id="section--techniques--omit-initialization">
+ <h3><a href="#section--techniques--omit-initialization">$r に初期値を入れない</a></h3>
+ <p>
+ PHP では、<code>$r[] = ......</code> のような配列の末尾に追加する式を実行したとき、 <code>$r</code> が未定義だった場合は <code>$r</code> を勝手に定義して空の配列で初期化してくれる。 これを利用すると、<code>$r = [];</code> のような初期化が不要になる。
+ </p>
+
+ <p>
+ ただし、プログラムに 0 が渡されるとループを一度も回らないので、<code>$r</code> が未定義になってしまい、 <code>implode()</code> に渡すところでエラーになる。 それを防ぐために <code>$r ?? []</code> を使っている。
+ </p>
+
+ <p>
+ もし 0 が渡されたケースを無視するなら、これが不要になるので 4 バイト縮む。
+ </p>
+ </section>
+
+ <section id="section--techniques--put-text-outside-php-tag">
+ <h3><a href="#section--techniques--put-text-outside-php-tag">PHP タグの外に文字列を置く</a></h3>
+ <p>
+ PHP では、<code>&lt;?php</code> <code>?&gt;</code> で囲われた部分の外側にある文字列は、そのまま出力される。 今回のケースでは、先頭と末尾に必ず <code>[</code> と <code>]</code> を出力するので、そのまま書いてやればよい。
+ </p>
+ </section>
+ </section>
+
+ <section id="section--outro">
+ <h2><a href="#section--outro">おわりに</a></h2>
+ <p>
+ 最後になりましたが、<a href="https://twitter.com/m3m0r7">めもりー</a>さん、楽しい問題をありがとうございました。
+ </p>
+ </section>
+ </div>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/posts/2022-08-31/support-for-communty-is-employee-benefits/index.html b/vhosts/blog/public/posts/2022-08-31/support-for-communty-is-employee-benefits/index.html
new file mode 100644
index 00000000..ae8cea42
--- /dev/null
+++ b/vhosts/blog/public/posts/2022-08-31/support-for-communty-is-employee-benefits/index.html
@@ -0,0 +1,116 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2022 nsfisis">
+ <meta name="description" content="先日、私の勤めるデジタルサーカス株式会社が、PHP Foundation へ寄付をおこないました。
+ 本件を社内でしつこく推進した1人として、推進の理由等を書き残しておきます。">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>弊社の PHP Foundation への寄付に寄せて | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ <link rel="stylesheet" href="/hl.css?h=340e65ffd5c17713efc9107c06304f7b">
+ </head>
+ <body class="single">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <article class="post-single">
+ <header class="post-header">
+ <h1 class="post-title">弊社の PHP Foundation への寄付に寄せて</h1>
+ </header>
+ <div class="post-content">
+ <section>
+ <h2 id="changelog">更新履歴</h2>
+ <ol>
+ <li class="revision">
+ <time datetime="2022-08-31">2022-08-31</time>: 公開
+ </li>
+ </ol>
+ </section>
+ <section id="section--intro">
+ <h2><a href="#section--intro">はじめに</a></h2>
+ <p>
+ <em role="strong">注: これは私個人の意見であり、所属する組織を代表するものではありません。</em>
+ </p>
+
+ <p>
+ 先日、私の勤める <a href="https://www.dgcircus.com/">デジタルサーカス株式会社</a> が <a href="https://opencollective.com/phpfoundation">PHP Foundation</a> へ $2,000 の寄付をおこないました。
+ </p>
+
+ <p>
+ 記事: <a href="https://www.dgcircus.com/news/581">https://www.dgcircus.com/news/581</a>
+ </p>
+
+ <p>
+ 本件を社内でしつこく推進した1人として、推進の理由等を書き残しておきます。
+ </p>
+ </section>
+
+ <section id="section--why">
+ <h2><a href="#section--why">なぜ?</a></h2>
+ <p>
+ 組織としての寄付理由は前掲した記事に譲るとして、ここでは、私が社内でこの件を推進した理由について書くことにします。
+ </p>
+
+ <p>
+ 当時の考えを端的にまとめた社内チャットの投稿があったので、それを引用します:
+ </p>
+
+ <blockquote>
+ <p>
+ 結局これを通したい (私の中での) 最大の理由が、「自分の勤める会社が、これをやる会社であってほしい」というのがあり、 ↑にしても、感情ベースの理由しか出せていないというのが説得力に欠けている理由なのだと思いますが、 寄付の報告が流れてきたり、OSS のフリーライドの話が流れてきたりするたびに、自尊心が毀損される、というか (これは大袈裟すぎる表現で、実際にはそこまで明確に傷ついているわけではありませんが)。
+ </p>
+
+ <p>
+ 追記: 「肩身が狭くなる」というのがより適切でした。
+ </p>
+ </blockquote>
+
+ <p>
+ ※文中の「↑にしても」は、ここに載せていない別の投稿を指しています。
+ </p>
+
+ <p>
+ OSS を金銭的に支援したり、技術カンファレンスへ協賛したり (あるいは <a href="https://twitter.com/tomzoh">CTO</a> がカンファレンスを年2で主催したり: <a href="https://iosdc.jp">iOSDC</a> <a href="https://phperkaigi.jp">PHPerKaigi</a>) といった行為は、コミュニティへの貢献であると同時に、社員に対する精神的福利厚生でもあると言えるでしょう (知らんけど)。 これらは、技術や技術者を大切にする組織である、ということの、対外的にも対内的にも強力なメッセージなのです。
+ </p>
+
+ <p>
+ 以上が、私が社内で寄付の件を進めた (かなり私的な) 理由です。
+ </p>
+ </section>
+
+ <section id="section--outro">
+ <h2><a href="#section--outro">おわりに</a></h2>
+ <p>
+ 最終的に社としての寄付まで漕ぎ着けられたのは、もちろん私の力ではなく役員の方々の決定によるものです。 この場を借りて感謝申し上げます。
+ </p>
+ </section>
+ </div>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/posts/2022-09-29/write-fizzbuzz-in-php-2-letters-per-line/index.html b/vhosts/blog/public/posts/2022-09-29/write-fizzbuzz-in-php-2-letters-per-line/index.html
new file mode 100644
index 00000000..f29cf154
--- /dev/null
+++ b/vhosts/blog/public/posts/2022-09-29/write-fizzbuzz-in-php-2-letters-per-line/index.html
@@ -0,0 +1,739 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2022 nsfisis">
+ <meta name="description" content="PHP で、fizzbuzz を書いた。ただし、1行あたりに使える文字数は2文字まで。">
+ <meta name="keywords" content="PHP">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>【PHP】 fizzbuzz を書く。1行あたり2文字で。 | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ <link rel="stylesheet" href="/hl.css?h=340e65ffd5c17713efc9107c06304f7b">
+ </head>
+ <body class="single">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <article class="post-single">
+ <header class="post-header">
+ <h1 class="post-title">【PHP】 fizzbuzz を書く。1行あたり2文字で。</h1>
+ <ul class="post-tags">
+ <li class="tag">
+ <a href="/tags/php/">PHP</a>
+ </li>
+ </ul>
+ </header>
+ <div class="post-content">
+ <section>
+ <h2 id="changelog">更新履歴</h2>
+ <ol>
+ <li class="revision">
+ <time datetime="2022-09-28">2022-09-28</time>: 公開
+ </li>
+ <li class="revision">
+ <time datetime="2022-09-29">2022-09-29</time>: 小さな文言の修正・変更
+ </li>
+ </ol>
+ </section>
+ <section id="section--intro">
+ <h2><a href="#section--intro">記事の構成について</a></h2>
+ <p>
+ この記事は、普通の fizzbuzz を徐々に変形して最終形にしていく、という構成で書かれている。 最終形を見てどのような仕組みで動いているのか解読してから解説を読みたい、というかたがいれば、 <a href="https://gist.github.com/nsfisis/04c227d5a419867472a0b23a83ad2919#file-fizzbuzz-php-2-letters-per-line-and-supports-php-8-x-without-warnings">このページ</a> にソースコードがあるので、そちらを先に見てほしい。
+ </p>
+ </section>
+
+ <section id="section--regulations">
+ <h2><a href="#section--regulations">レギュレーション</a></h2>
+ <p>
+ PHP で、次のような制約の下に fizzbuzz を書いた。
+ </p>
+
+ <ul>
+ <li>
+ 1行あたりの文字数は2文字までに収めること (ただし <code>&lt;?php</code> タグは除く)
+ <ul>
+ <li>
+ 厳密な定義: <code>&lt;?php</code> タグ以降のソースコードが、2 byte ごとにラインフィード (LF) で区切られること
+ </li>
+ </ul>
+ </li>
+
+ <li>
+ スペースやタブを使用しないこと
+ </li>
+
+ <li>
+ ループのアンロールをしないこと
+ <ul>
+ <li>
+ 100 回ループの代わりに 100 回コードをコピペ、というのは禁止
+ </li>
+ </ul>
+ </li>
+
+ <li>
+ PHP 7.4〜8.1 で動作すること
+ </li>
+
+ <li>
+ 実行時に Notice や Warning が出ないこと
+ </li>
+
+ <li>
+ 標準的なインストール構成の PHP で実現できること (デフォルトで有効になっていない拡張等を使わないこと)
+ </li>
+ </ul>
+
+ <p>
+ 備考: PHP には <code>short_open_tag</code> というオプションがあり、 これを有効にするとファイル冒頭の <code>&lt;?php</code> の代わりに <code>&lt;?</code> を使うことができ、文字どおり1行2文字で書ける。 ただ、このオプションはデフォルト off になっている環境が多いようなので、今回は使わないことにした。
+ </p>
+ </section>
+
+ <section id="section--problems">
+ <h2><a href="#section--problems">主な障害</a></h2>
+ <p>
+ 1行あたりの文字数など、適当に改行を挟めばいいだけではないのか?
+ </p>
+
+ <p>
+ 特に、C言語でこのような試みをおこなったことがあるかたならそう思うだろう。事実、Cでのこの制約はほとんど無意味に等しい。
+ </p>
+
+ <pre class="highlight" language="c" linenumbering="unnumbered"><code class="highlight">#\
+i\
+n\
+c\
+l\
+u\
+d\
+e\
+&lt;\
+s\
+t\
+d\
+i\
+o\
+.\
+h\
+&gt;\
+<span class="hljs-comment">/*
+*/</span>
+i\
+n\
+t\
+<span class="hljs-comment">/*
+*/</span>
+m\
+a\
+i\
+n(
+){
+f\
+o\
+r(
+i\
+n\
+t\
+<span class="hljs-comment">/*
+*/</span>
+i=
+<span class="hljs-number">1</span>;
+i&lt;
+<span class="hljs-number">1</span>\
+<span class="hljs-number">0</span>\
+<span class="hljs-number">0</span>;
+i\
++\
++)
+<span class="hljs-keyword">if</span>
+(i
+%\
+<span class="hljs-number">15</span>
+==
+<span class="hljs-number">0</span>)
+p\
+r\
+i\
+n\
+t\
+f(
+<span class="hljs-string">&quot;\
+F\
+i\
+z\
+z\
+B\
+u\
+z\
+z\
+%\
+c\
+&quot;</span>,
+<span class="hljs-number">10</span>
+);
+
+<span class="hljs-comment">/* あとは同じように普通のプログラムを変形するだけなので省略 */</span></code></pre>
+
+ <p>
+ バックスラッシュを使った行継続がトークンを区切らない、というのがポイントだ。
+ </p>
+
+ <p>
+ さて、PHP ではそもそもバックスラッシュを行継続に使うことができない。 これにより、「3文字以上からなるトークンが一切使えない」という制約が課される。 例えば、<code>echo</code> で出力することや、<code>for</code> でループすること、 <code>new</code> でインスタンスを生成することができない。 特に、出力は fizzbuzz をどんなアルゴリズムで実装しようとおこなわなければならないので、できないのは致命的である。
+ </p>
+
+ <p>
+ 当然、名前が3文字以上ある関数も使えない。なお、標準 PHP の範囲内において、名前が 2文字以下の関数は以下のとおりである:
+ </p>
+
+ <ul>
+ <li>
+ <code>_</code>: <code>gettext</code> のエイリアス
+ </li>
+
+ <li>
+ <code>dl</code>: 拡張モジュールをロードする
+ </li>
+
+ <li>
+ <code>pi</code>: 円周率を返す
+ </li>
+ </ul>
+
+ <p>
+ (環境によって多少は変わるかも)
+ </p>
+
+ <p>
+ 2文字の関数を定義しまくった拡張モジュールを用意しておいて <code>dl()</code> で読み込む行為は、レギュレーションで定めた
+ </p>
+
+ <blockquote>
+ <ul>
+ <li>
+ 標準的なインストール構成の PHP で実現できること (デフォルトで有効になっていない拡張等を使わないこと)
+ </li>
+ </ul>
+ </blockquote>
+
+ <p>
+ に反する (というより、「それだとおもしろくもなんともないので、このルールを足した」というのが正しい)。
+ </p>
+
+ <p>
+ また、2文字だと文字列がまともに書けないのも辛い。<code>&apos;&apos;</code> だけで2文字使うので、 「1文字の文字列リテラル」というものを書くことができない。PHP では文字列リテラル中に生の改行が書けるので
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight"><span class="hljs-variable">$a</span>
+=<span class="hljs-string">&#x27;
+a&#x27;</span>
+;;</code></pre>
+
+ <p>
+ とすると <code>$a</code> は <code>&quot;\na&quot;</code> になるのだが、余計な改行が入ってしまう。
+ </p>
+
+ <p>
+ これらの障害をどのように乗り越えるのか、次節から見ていく。
+ </p>
+ </section>
+
+ <section id="section--commentary">
+ <h2><a href="#section--commentary">解説</a></h2>
+ <section id="section--commentary--normal-fizzbuzz">
+ <h3><a href="#section--commentary--normal-fizzbuzz">普通の (?) fizzbuzz</a></h3>
+ <p>
+ まずは普通に書くとしよう。
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight"><span class="hljs-meta">&lt;?php</span>
+
+<span class="hljs-keyword">for</span> (<span class="hljs-variable">$i</span> = <span class="hljs-number">1</span>; <span class="hljs-variable">$i</span> &lt; <span class="hljs-number">100</span>; <span class="hljs-variable">$i</span>++) {
+ <span class="hljs-keyword">echo</span> ((<span class="hljs-variable">$i</span> % <span class="hljs-number">3</span> ? <span class="hljs-string">&#x27;&#x27;</span> : <span class="hljs-string">&#x27;Fizz&#x27;</span>) . (<span class="hljs-variable">$i</span> % <span class="hljs-number">5</span> ? <span class="hljs-string">&#x27;&#x27;</span> : <span class="hljs-string">&#x27;Buzz&#x27;</span>) ?: <span class="hljs-variable">$i</span>) . <span class="hljs-string">&quot;\n&quot;</span>;
+}</code></pre>
+
+ <p>
+ 素直に書いた fizzbuzz とは言い難いが、このくらいは普通だということにしておかないと、この先がやっていられないので許してほしい。
+ </p>
+ </section>
+
+ <section id="section--commentary--remove-keywords">
+ <h3><a href="#section--commentary--remove-keywords"><code>for</code> の排除</a></h3>
+ <p>
+ <code>for</code> は、3文字もある長いキーワードである。 こんなものは使えない。<code>array_</code> 系の関数を使って、適当に置き換えるとしよう。
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight"><span class="hljs-meta">&lt;?php</span>
+
+<span class="hljs-variable">$s</span> = <span class="hljs-title function_ invoke__">range</span>(<span class="hljs-number">1</span>, <span class="hljs-number">100</span>);
+<span class="hljs-title function_ invoke__">array_walk</span>(
+<span class="hljs-variable">$s</span>,
+fn(<span class="hljs-variable">$i</span>) =&gt;
+<span class="hljs-title function_ invoke__">printf</span>(((<span class="hljs-variable">$i</span> % <span class="hljs-number">3</span> ? <span class="hljs-string">&#x27;&#x27;</span> : <span class="hljs-string">&#x27;Fizz&#x27;</span>) . (<span class="hljs-variable">$i</span> % <span class="hljs-number">5</span> ? <span class="hljs-string">&#x27;&#x27;</span> : <span class="hljs-string">&#x27;Buzz&#x27;</span>) ?: <span class="hljs-variable">$i</span>) . <span class="hljs-string">&quot;\n&quot;</span>),
+);</code></pre>
+
+ <p>
+ <code>array_walk</code> や <code>range</code>、<code>printf</code> といった <code>for</code> よりも長いトークンが現れてしまったが、これは次節で直すことにする。 なお、<code>echo</code> は文 (statement) であり式 (expression) ではないので、式である <code>printf</code> に置き換えた。
+ </p>
+ </section>
+
+ <section id="section--commentary--shorten-function-invocation">
+ <h3><a href="#section--commentary--shorten-function-invocation">関数呼び出しの短縮</a></h3>
+ <p>
+ <code>range</code>、<code>array_walk</code>、<code>printf</code> は長すぎるのでどうにかせねばならない。 ここで、PHP の可変関数を使う。可変関数とは、関数名が文字列として入った変数を経由して、関数を呼び出す機能である。
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight"><span class="hljs-meta">&lt;?php</span>
+
+<span class="hljs-variable">$r</span> = <span class="hljs-string">&#x27;range&#x27;</span>;
+<span class="hljs-variable">$w</span> = <span class="hljs-string">&#x27;array_walk&#x27;</span>;
+<span class="hljs-variable">$p</span> = <span class="hljs-string">&#x27;printf&#x27;</span>;
+
+<span class="hljs-variable">$s</span> = <span class="hljs-variable">$r</span>(<span class="hljs-number">1</span>, <span class="hljs-number">100</span>);
+<span class="hljs-variable">$w</span>(
+<span class="hljs-variable">$s</span>,
+<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$i</span></span>) =&gt;</span>
+<span class="hljs-variable">$p</span>(((<span class="hljs-variable">$i</span> % <span class="hljs-number">3</span> ? <span class="hljs-string">&#x27;&#x27;</span> : <span class="hljs-string">&#x27;Fizz&#x27;</span>) . (<span class="hljs-variable">$i</span> % <span class="hljs-number">5</span> ? <span class="hljs-string">&#x27;&#x27;</span> : <span class="hljs-string">&#x27;Buzz&#x27;</span>) ?: <span class="hljs-variable">$i</span>) . <span class="hljs-string">&quot;\n&quot;</span>),
+);</code></pre>
+
+ <p>
+ これで関数を呼び出している所は短くなった。 では、<code>$r</code> や <code>$w</code> や <code>$p</code>、 また <code>&apos;Fizz&apos;</code> や <code>&apos;Buzz&apos;</code> はどうやって 1 行 2 文字に収めるのか。 次のテクニックへ移ろう。
+ </p>
+ </section>
+
+ <section id="section--commentary--incompatible-solution">
+ <h3><a href="#section--commentary--incompatible-solution">余談: PHP 8.x で動作しなくてもいいなら</a></h3>
+ <p>
+ 今回使ったテクニックを説明する前に、余談として、文字列リテラルの短縮法として今回採用しなかったものを紹介する。
+ </p>
+
+ <blockquote>
+ <ul>
+ <li>
+ PHP 7.4〜8.1 で動作すること
+ </li>
+ </ul>
+ </blockquote>
+
+ <p>
+ というルールがない場合、「未定義の定数が評価された場合、その定数の名前が値になる」という PHP 7.x までの仕様が利用できる。 例えば、 <code>Fizz</code> という文字列が欲しければ、次のようにする。
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight"><span class="hljs-variable">$f</span>
+=F
+.i
+.z
+.z
+;;</code></pre>
+
+ <p>
+ こうして簡単に文字列を作れる。 なお、この仕様は 7.x 時点でも警告を受けるので、<code>@</code> 演算子を使って抑制してやるとよい。
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight"><span class="hljs-variable">$f</span>
+=@
+F.
+@i
+.<span class="hljs-comment">#</span>
+@z
+.<span class="hljs-comment">#</span>
+@z
+;;</code></pre>
+
+ <p>
+ むしろ、このことがわかっていたからこそ PHP 8.x での動作を要件に課したところがある。
+ </p>
+ </section>
+
+ <section id="section--commentary--shorten-string-literals">
+ <h3><a href="#section--commentary--shorten-string-literals">文字列リテラルの短縮</a></h3>
+ <p>
+ 実際に使った手法の説明に移る。
+ </p>
+
+ <p>
+ ずばり、文字列同士のビット演算を使う。 PHP では、文字列同士でビット演算 (<code>&amp;</code>、<code>|</code>、<code>^</code>) をした場合、 文字列の各バイトごとに指定したビット演算がなされ、それを結合したものが演算結果となる。
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight"><span class="hljs-variable">$a</span> = <span class="hljs-string">&quot;12345&quot;</span>;
+<span class="hljs-variable">$b</span> = <span class="hljs-string">&quot;world&quot;</span>;
+
+<span class="hljs-comment">// $a ^ $b は次のコードと同じ</span>
+<span class="hljs-variable">$result</span> = <span class="hljs-string">&#x27;&#x27;</span>;
+<span class="hljs-keyword">for</span> (<span class="hljs-variable">$i</span> = <span class="hljs-number">0</span>; <span class="hljs-variable">$i</span> &lt; <span class="hljs-title function_ invoke__">min</span>(<span class="hljs-title function_ invoke__">strlen</span>(<span class="hljs-variable">$a</span>), <span class="hljs-title function_ invoke__">strlen</span>(<span class="hljs-variable">$b</span>)); <span class="hljs-variable">$i</span>++) {
+<span class="hljs-variable">$result</span> .= <span class="hljs-variable">$a</span>[<span class="hljs-variable">$i</span>] ^ <span class="hljs-variable">$b</span>[<span class="hljs-variable">$i</span>];
+}
+
+<span class="hljs-keyword">echo</span> <span class="hljs-variable">$result</span>;
+<span class="hljs-comment">// =&gt; F]AXQ</span></code></pre>
+
+ <p>
+ これを踏まえ、次のコードを見てみよう。
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight"><span class="hljs-variable">$x</span> = <span class="hljs-string">&quot;x\nOm\n&quot;</span>;
+<span class="hljs-variable">$y</span> = <span class="hljs-string">&quot;\nk!\no&quot;</span>;
+<span class="hljs-variable">$r</span> = <span class="hljs-variable">$x</span> ^ <span class="hljs-variable">$y</span>;
+<span class="hljs-keyword">echo</span> <span class="hljs-string">&quot;<span class="hljs-subst">$r</span>\n&quot;</span>;</code></pre>
+
+ <p>
+ 実行すると、<code>range</code> が表示される。 さて、PHP では文字列リテラル中に生の改行を直接書いてもよいのだった (「主な障害」の節を参照のこと)。 書きかえてみよう。
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight"><span class="hljs-variable">$x</span>
+=<span class="hljs-string">&#x27;x
+Om
+&#x27;</span>;
+<span class="hljs-variable">$y</span>
+=<span class="hljs-string">&#x27;
+k!
+o&#x27;</span>
+;
+
+<span class="hljs-variable">$r</span> = <span class="hljs-variable">$x</span> ^ <span class="hljs-variable">$y</span>;
+<span class="hljs-keyword">echo</span> <span class="hljs-string">&quot;<span class="hljs-subst">$r</span>\n&quot;</span>;</code></pre>
+
+ <p>
+ さらに <code>#</code> を使って適当に調整すると、次のようになる。
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight"><span class="hljs-variable">$x</span>
+=<span class="hljs-comment">#</span>
+<span class="hljs-string">&#x27;x
+Om
+&#x27;</span>;
+<span class="hljs-variable">$y</span>
+=<span class="hljs-string">&#x27;
+k!
+o&#x27;</span>
+;<span class="hljs-comment">#</span>
+<span class="hljs-variable">$r</span>
+=<span class="hljs-comment">#</span>
+<span class="hljs-variable">$x</span>
+^<span class="hljs-comment">#</span>
+<span class="hljs-variable">$y</span>
+;<span class="hljs-comment">#</span>
+
+<span class="hljs-keyword">echo</span> <span class="hljs-string">&quot;<span class="hljs-subst">$r</span>\n&quot;</span>;</code></pre>
+
+ <p>
+ 1行あたり2文字で、<code>range</code> という文字列を生成することに成功した。 他の必要な文字列にも、同様の処理をほどこす。
+ </p>
+
+ <p>
+ 備考: <code>Buzz</code> 中にある小文字の <code>u</code> は、このロジックだと non-printable な文字になってしまう。 ここまでのテクニックを駆使すれば回避するのはそう難しくないので、考えてみてほしい。
+ </p>
+ </section>
+ </section>
+
+ <section id="section--stretched-fizzbuzz">
+ <h2><a href="#section--stretched-fizzbuzz">完成系</a></h2>
+ <p>
+ 完成したものがこちら。
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight"><span class="hljs-meta">&lt;?php</span>
+
+<span class="hljs-variable">$x</span>
+=<span class="hljs-comment">#</span>
+<span class="hljs-string">&#x27;i
+S&#x27;</span>
+;;
+<span class="hljs-variable">$y</span>
+=<span class="hljs-string">&#x27;
+b!
+&#x27;</span>;
+<span class="hljs-variable">$c</span>
+=<span class="hljs-comment">#</span>
+<span class="hljs-variable">$x</span>
+^<span class="hljs-comment">#</span>
+<span class="hljs-variable">$y</span>
+;<span class="hljs-comment">#</span>
+<span class="hljs-variable">$x</span>
+=<span class="hljs-comment">#</span>
+<span class="hljs-string">&#x27;x
+Om
+&#x27;</span>;
+<span class="hljs-variable">$y</span>
+=<span class="hljs-string">&#x27;
+k!
+o&#x27;</span>
+;<span class="hljs-comment">#</span>
+<span class="hljs-variable">$r</span>
+=<span class="hljs-comment">#</span>
+<span class="hljs-variable">$x</span>
+^<span class="hljs-comment">#</span>
+<span class="hljs-variable">$y</span>
+;<span class="hljs-comment">#</span>
+<span class="hljs-variable">$x</span>
+=<span class="hljs-comment">#</span>
+<span class="hljs-string">&#x27;k
+Sk
+~}
+Ma
+&#x27;</span>;
+<span class="hljs-variable">$y</span>
+=<span class="hljs-string">&#x27;
+x!
+s!
+k!
+&#x27;</span>;
+<span class="hljs-variable">$w</span>
+=<span class="hljs-comment">#</span>
+<span class="hljs-variable">$x</span>
+^<span class="hljs-comment">#</span>
+<span class="hljs-variable">$y</span>
+;<span class="hljs-comment">#</span>
+<span class="hljs-variable">$x</span>
+=<span class="hljs-comment">#</span>
+<span class="hljs-string">&#x27;z
+Hd
+G&#x27;</span>
+;<span class="hljs-comment">#</span>
+<span class="hljs-variable">$y</span>
+=<span class="hljs-string">&#x27;
+x!
+~!
+&#x27;</span>;
+<span class="hljs-variable">$p</span>
+=<span class="hljs-comment">#</span>
+<span class="hljs-variable">$x</span>
+^<span class="hljs-comment">#</span>
+<span class="hljs-variable">$y</span>
+;<span class="hljs-comment">#</span>
+<span class="hljs-variable">$x</span>
+=<span class="hljs-comment">#</span>
+<span class="hljs-string">&#x27;L
+[p
+&#x27;</span>;
+<span class="hljs-variable">$y</span>
+=<span class="hljs-string">&#x27;
+c!
+&#x27;</span>;
+<span class="hljs-variable">$f</span>
+=<span class="hljs-comment">#</span>
+<span class="hljs-variable">$x</span>
+^<span class="hljs-comment">#</span>
+<span class="hljs-variable">$y</span>
+;<span class="hljs-comment">#</span>
+<span class="hljs-variable">$x</span>
+=<span class="hljs-comment">#</span>
+<span class="hljs-string">&#x27;H
+[p
+&#x27;</span>;
+<span class="hljs-variable">$y</span>
+=<span class="hljs-string">&#x27;
+_!
+&#x27;</span>;
+<span class="hljs-variable">$b</span>
+=<span class="hljs-comment">#</span>
+<span class="hljs-variable">$x</span>
+^<span class="hljs-comment">#</span>
+<span class="hljs-variable">$y</span>
+;<span class="hljs-comment">#</span>
+<span class="hljs-variable">$b</span>
+[<span class="hljs-number">1</span>
+]=
+<span class="hljs-variable">$c</span>
+(<span class="hljs-comment">#</span>
+<span class="hljs-number">13</span>
+*<span class="hljs-number">9</span>
+);
+<span class="hljs-variable">$s</span>
+=<span class="hljs-comment">#</span>
+<span class="hljs-variable">$r</span>
+(<span class="hljs-number">1</span>
+,(
+<span class="hljs-number">10</span>
+**
+<span class="hljs-number">2</span>)
+);
+<span class="hljs-variable">$w</span>
+(<span class="hljs-comment">#</span>
+<span class="hljs-variable">$s</span>
+,<span class="hljs-comment">#</span>
+<span class="hljs-function"><span class="hljs-keyword">fn</span>
+(<span class="hljs-params">#
+<span class="hljs-variable">$i</span>
+</span>)#
+=&gt;</span>
+<span class="hljs-variable">$p</span>
+((
+(<span class="hljs-comment">#</span>
+<span class="hljs-variable">$i</span>
+%<span class="hljs-number">3</span>
+?<span class="hljs-comment">#</span>
+<span class="hljs-string">&#x27;&#x27;</span>
+:<span class="hljs-comment">#</span>
+<span class="hljs-variable">$f</span>
+).
+(<span class="hljs-comment">#</span>
+<span class="hljs-variable">$i</span>
+%<span class="hljs-number">5</span>
+?<span class="hljs-comment">#</span>
+<span class="hljs-string">&#x27;&#x27;</span>
+:<span class="hljs-comment">#</span>
+<span class="hljs-variable">$b</span>
+)?
+:<span class="hljs-comment">#</span>
+<span class="hljs-variable">$i</span>
+)<span class="hljs-comment">#</span>
+.<span class="hljs-string">&#x27;
+&#x27;</span>)
+);</code></pre>
+ </section>
+
+ <section id="section--outro">
+ <h2><a href="#section--outro">感想など</a></h2>
+ <p>
+ PHP は、スクリプト言語の中だとシンタックスシュガーが少ない (体感)。 この挑戦は不可能に思われたが、PHP マニュアルとにらめっこしていたらなんとかなった。
+ </p>
+
+ <p>
+ みんなもプログラムを細長くしよう。
+ </p>
+ </section>
+
+ <section id="section--alternative-solution">
+ <h2><a href="#section--alternative-solution">余談2: 別解</a></h2>
+ <p>
+ PHP では、バッククォートを使ってシェルを呼び出せる。 これは <code>shell_exec</code> 関数と等価である。 さて、PHP ではバックスラッシュによる行継続が使えないと書いたが、シェルでは使える (当然だが、呼び出されるシェルに依存する。Bash なら大丈夫だろう。知らんけど)。
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight"><span class="hljs-meta">&lt;?php</span>
+
+<span class="hljs-title function_ invoke__">printf</span>(`
+e\
+c\
+h\
+o\
+\
+<span class="hljs-number">1</span>\
+<span class="hljs-number">2</span>\
+<span class="hljs-number">3</span>\
+`);</code></pre>
+
+ <p>
+ なお、ここでは簡単のため出力に <code>printf</code> をそのまま使っているが、 実際には <code>printf</code> という文字列を合成して可変関数で呼び出す。
+ </p>
+
+ <p>
+ ただし、これでは
+ </p>
+
+ <blockquote>
+ <ul>
+ <li>
+ スペースやタブを使用しないこと
+ </li>
+ </ul>
+ </blockquote>
+
+ <p>
+ に違反してしまう。スペースが使えないと引数とコマンドを区切れない。これは困った。
+ </p>
+
+ <p>
+ もうこれ以上は不可能だと思っていたのだが、この記事の執筆中に解決する方法を思いついたので載せておく。
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight"><span class="hljs-meta">&lt;?php</span>
+
+<span class="hljs-variable">$c</span> = <span class="hljs-string">&#x27;chr&#x27;</span>;
+
+${
+<span class="hljs-string">&#x27;_
+&#x27;</span>}
+=<span class="hljs-comment">#</span>
+<span class="hljs-variable">$c</span>
+(<span class="hljs-comment">#</span>
+<span class="hljs-number">32</span>
+).
+<span class="hljs-variable">$c</span>
+(<span class="hljs-comment">#</span>
+<span class="hljs-number">92</span>
+);
+
+<span class="hljs-title function_ invoke__">printf</span>(`
+e\
+c\
+h\
+o\
+${
+<span class="hljs-string">&#x27;_
+&#x27;</span>}
+<span class="hljs-number">1</span>\
+<span class="hljs-number">2</span>\
+<span class="hljs-number">3</span>\
+`);</code></pre>
+
+ <p>
+ 先程と同じく、<code>chr</code> や <code>printf</code> を生成する部分は長くなるので省いた。
+ </p>
+
+ <pre class="highlight monospaced"><code>${
+&apos;_
+&apos;}</code></pre>
+
+ <p>
+ は変数で、中にはスペースとエスケープが入っている (<code>chr(32) . chr(92)</code>)。 シェルに渡されている文字列は次のようになる。
+ </p>
+
+ <pre class="highlight monospaced"><code>e\
+c\
+h\
+o\
+\
+1\
+2\
+3\</code></pre>
+
+ <p>
+ これは、前掲したコマンドと同じだ。 かくして、スペースを陽に書かずにシェルをおおよそ自由に扱えるようになった。 Fizzbuzz のワンライナーくらいすぐ書けるだろうから、あとはなんとかなるだろう (試してないけど)。
+ </p>
+
+ <p>
+ ということでこれは別解ということにしておく。
+ </p>
+
+ <p>
+ ちなみに、PHP 8.2 からは、この記法で Warning が出るようになるようだ。
+ </p>
+
+ <pre class="highlight monospaced"><code>${
+&apos;_
+&apos;}</code></pre>
+
+ <p>
+ 最新版で警告が出るというのも美しくないので、私としては本編の解法を推す。
+ </p>
+ </section>
+ </div>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/posts/2022-10-23/phperkaigi-2023-unused-token-quiz-1/index.html b/vhosts/blog/public/posts/2022-10-23/phperkaigi-2023-unused-token-quiz-1/index.html
new file mode 100644
index 00000000..eaa210c5
--- /dev/null
+++ b/vhosts/blog/public/posts/2022-10-23/phperkaigi-2023-unused-token-quiz-1/index.html
@@ -0,0 +1,212 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2022 nsfisis">
+ <meta name="description" content="来年の PHPerKaigi 2023 でデジタルサーカス株式会社から出題予定のトークン問題のうち、ボツになった問題を公開する (その 1)。">
+ <meta name="keywords" content="PHP,PHPerKaigi">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>PHPerKaigi 2023: ボツになったトークン問題 その 1 | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ <link rel="stylesheet" href="/hl.css?h=340e65ffd5c17713efc9107c06304f7b">
+ </head>
+ <body class="single">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <article class="post-single">
+ <header class="post-header">
+ <h1 class="post-title">PHPerKaigi 2023: ボツになったトークン問題 その 1</h1>
+ <ul class="post-tags">
+ <li class="tag">
+ <a href="/tags/php/">PHP</a>
+ </li>
+ <li class="tag">
+ <a href="/tags/phperkaigi/">PHPerKaigi</a>
+ </li>
+ </ul>
+ </header>
+ <div class="post-content">
+ <section>
+ <h2 id="changelog">更新履歴</h2>
+ <ol>
+ <li class="revision">
+ <time datetime="2022-10-23">2022-10-23</time>: 公開
+ </li>
+ </ol>
+ </section>
+ <section id="section--intro">
+ <h2><a href="#section--intro">はじめに</a></h2>
+ <p>
+ 2023 年 3 月 23 日から 25 日にかけて開催予定 (記事執筆時点) の、 <a href="https://phperkaigi.jp/2023/">PHPerKaigi 2023</a> において、 昨年と同様に、弊社 <a href="https://www.dgcircus.com/">デジタルサーカス株式会社</a> から、 トークン問題を出題予定である。
+ </p>
+
+ <p>
+ 昨年のトークン問題の記事はこちら: <a href="/posts/2022-04-09/phperkaigi-2022-tokens">PHPerKaigi 2022 トークン問題の解説</a>
+ </p>
+
+ <p>
+ すでに 2023 年用の問題は作成済みであるが、その制作過程の中でいくつかボツ問ができた。 せっかくなので、PHPerKaigi 開催を待つ間に紹介しようと思う。
+ </p>
+
+ <p>
+ 10 月から 2 月まで、毎月 1 記事ずつ公開していく予定 (忘れていなければ)。
+ </p>
+ </section>
+
+ <section id="section--quiz">
+ <h2><a href="#section--quiz">問題</a></h2>
+ <p>
+ 注意: これはボツ問なので、得られたトークンを PHPerKaigi で入力してもポイントにはならない。
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight"><span class="hljs-meta">&lt;?php</span>
+
+$π = <span class="hljs-variable">$argv</span>[<span class="hljs-number">1</span>] ?? <span class="hljs-literal">null</span>;
+<span class="hljs-keyword">if</span> ($π === <span class="hljs-literal">null</span>) {
+ <span class="hljs-keyword">exit</span>(<span class="hljs-string">&#x27;No input.&#x27;</span>);
+}
+$π = <span class="hljs-title function_ invoke__">trim</span>($π);
+<span class="hljs-keyword">if</span> (!<span class="hljs-title function_ invoke__">is_numeric</span>($π)) {
+ <span class="hljs-keyword">exit</span>(<span class="hljs-string">&#x27;Invalid input.&#x27;</span>);
+}
+
+<span class="hljs-variable">$s</span> = <span class="hljs-title function_ invoke__">implode</span>(<span class="hljs-title function_ invoke__">array_map</span>(<span class="hljs-title function_ invoke__">chr</span>(...), <span class="hljs-title function_ invoke__">str_split</span>($π, <span class="hljs-number">2</span>)));
+
+<span class="hljs-title function_ invoke__">preg_match</span>(<span class="hljs-string">&#x27;/(\x23.+?) /&#x27;</span>, <span class="hljs-variable">$s</span>, <span class="hljs-variable">$m</span>);
+<span class="hljs-variable">$t</span> = <span class="hljs-variable">$m</span>[<span class="hljs-number">1</span>] ?? <span class="hljs-string">&#x27;&#x27;</span>;
+
+<span class="hljs-keyword">if</span> (<span class="hljs-title function_ invoke__">md5</span>(<span class="hljs-variable">$t</span>) === <span class="hljs-string">&#x27;056e831a4146bf123e8ea16613303d2e&#x27;</span>) {
+ <span class="hljs-keyword">echo</span> <span class="hljs-string">&quot;Token: <span class="hljs-subst">{$t}</span>\n&quot;</span>;
+} <span class="hljs-keyword">else</span> {
+ <span class="hljs-keyword">echo</span> <span class="hljs-string">&quot;Failed.\n&quot;</span>;
+}</code></pre>
+ </section>
+
+ <section id="section--how-to-obtain-token">
+ <h2><a href="#section--how-to-obtain-token">トークン入手方法</a></h2>
+ <p>
+ ソースを見るとわかるとおり、<code>$argv[1]</code> を参照している。 それを <code>$π</code> なる変数に代入しているので、円周率を渡してみる。
+ </p>
+
+ <pre class="highlight" language="shell-session" linenumbering="unnumbered"><code>$ php Q.php 3.14
+Failed.</code></pre>
+
+ <p>
+ 失敗してしまった。精度を上げてみる。
+ </p>
+
+ <pre class="highlight" language="shell-session" linenumbering="unnumbered"><code>$ php Q.php 3.1415
+Failed.</code></pre>
+
+ <p>
+ だめだった。これを成功するまで繰り返す。
+ </p>
+
+ <p>
+ 最初にトークンが得られるのは、小数点以下 16 桁目まで入力したときで、こうなる。
+ </p>
+
+ <pre class="highlight" language="shell-session" linenumbering="unnumbered"><code>$ php Q.php 3.1415926535897932
+Token: #YO</code></pre>
+
+ <p>
+ めでたくトークン「<code>#YO</code>」が手に入った。
+ </p>
+ </section>
+
+ <section id="section--commentary">
+ <h2><a href="#section--commentary">解説</a></h2>
+ <p>
+ 短いので頭から追っていく。
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight">$π = <span class="hljs-variable">$argv</span>[<span class="hljs-number">1</span>] ?? <span class="hljs-literal">null</span>;
+<span class="hljs-keyword">if</span> ($π === <span class="hljs-literal">null</span>) {
+ <span class="hljs-keyword">exit</span>(<span class="hljs-string">&#x27;No input.&#x27;</span>);
+}
+$π = <span class="hljs-title function_ invoke__">trim</span>($π);
+<span class="hljs-keyword">if</span> (!<span class="hljs-title function_ invoke__">is_numeric</span>($π)) {
+ <span class="hljs-keyword">exit</span>(<span class="hljs-string">&#x27;Invalid input.&#x27;</span>);
+}</code></pre>
+
+ <p>
+ 入力のバリデーション部分。数値のみ受け付ける。
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight"><span class="hljs-variable">$s</span> = <span class="hljs-title function_ invoke__">implode</span>(<span class="hljs-title function_ invoke__">array_map</span>(<span class="hljs-title function_ invoke__">chr</span>(...), <span class="hljs-title function_ invoke__">str_split</span>($π, <span class="hljs-number">2</span>)));</code></pre>
+
+ <p>
+ <code>$π</code> を 2 文字ごとに区切り (<code>str_split</code>)、 数値を ASCII コードと見做して文字に変換 (<code>chr</code>) して結合 (<code>implode</code>) している。
+ </p>
+
+ <p>
+ 例えば、<code>$π</code> が <code>&apos;656667&apos;</code> だったとすると、 <code>65</code>、<code>66</code>、<code>67</code> に対応した <code>&apos;A&apos;</code>、<code>&apos;B&apos;</code>、<code>&apos;C&apos;</code> へと変換され、<code>&apos;ABC&apos;</code> になる。
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight">$π = <span class="hljs-string">&#x27;656667&#x27;</span>;
+<span class="hljs-variable">$s</span> = <span class="hljs-title function_ invoke__">implode</span>(<span class="hljs-title function_ invoke__">array_map</span>(<span class="hljs-title function_ invoke__">chr</span>(...), <span class="hljs-title function_ invoke__">str_split</span>($π, <span class="hljs-number">2</span>)));
+<span class="hljs-keyword">echo</span> <span class="hljs-variable">$s</span>;
+<span class="hljs-comment">// =&gt; ABC</span></code></pre>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight"><span class="hljs-title function_ invoke__">preg_match</span>(<span class="hljs-string">&#x27;/(\x23.+?) /&#x27;</span>, <span class="hljs-variable">$s</span>, <span class="hljs-variable">$m</span>);
+<span class="hljs-variable">$t</span> = <span class="hljs-variable">$m</span>[<span class="hljs-number">1</span>] ?? <span class="hljs-string">&#x27;&#x27;</span>;</code></pre>
+
+ <p>
+ 正規表現でマッチングしている。<code>\x23</code> は <code>#</code> と同じであることに留意すると、 この正規表現は「<code>#</code> から始まる 2 以上の長さ (含 <code>#</code>) の文字列で、 最初に現れるスペースまで」にマッチする。つまりこれは、PHPerKaigi におけるトークンである。
+ </p>
+
+ <p>
+ なお、<code>#</code> を直接書いていないのは、<code>/#.+?) /</code> と書くと、 <code>#.+?)</code> という意図せぬトークンが登録されてしまうからである。
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight"><span class="hljs-keyword">if</span> (<span class="hljs-title function_ invoke__">md5</span>(<span class="hljs-variable">$t</span>) === <span class="hljs-string">&#x27;056e831a4146bf123e8ea16613303d2e&#x27;</span>) {
+ <span class="hljs-keyword">echo</span> <span class="hljs-string">&quot;Token: <span class="hljs-subst">{$t}</span>\n&quot;</span>;
+} <span class="hljs-keyword">else</span> {
+ <span class="hljs-keyword">echo</span> <span class="hljs-string">&quot;Failed.\n&quot;</span>;
+}</code></pre>
+
+ <p>
+ 最後にトークンのハッシュ値を見て、想定解かどうかを確認する。
+ </p>
+ </section>
+
+ <section id="section--outro">
+ <h2><a href="#section--outro">おわりに</a></h2>
+ <p>
+ 円周率を何桁も計算して ASCII コード経由で文字列化すれば、トークンっぽいものがどこかで出てくるのではないか、と考えて生まれた作品。
+ </p>
+
+ <p>
+ 最初は真面目に円周率の計算プログラムを組んでいたのだが、いざ動かしてみるとやけに浅いところにあったので驚いた (ちなみに、それでも <code>M_PI</code> や <code>pi()</code> では精度が足りない)。 見つけたときは狂喜したものの、冷静になってみると大して面白くなかったのでボツになった。 むしろ、100 万桁目くらいに埋まっていてくれたほうがよかったかもしれない。
+ </p>
+ </section>
+ </div>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/posts/2022-10-28/setup-server-for-this-site/index.html b/vhosts/blog/public/posts/2022-10-28/setup-server-for-this-site/index.html
new file mode 100644
index 00000000..20297c1b
--- /dev/null
+++ b/vhosts/blog/public/posts/2022-10-28/setup-server-for-this-site/index.html
@@ -0,0 +1,316 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2022 nsfisis">
+ <meta name="description" content="GitHub Pages でホストしていたこのサイトを VPS へ移行したので、そのときにやったことのメモ。99 % 自分用。">
+ <meta name="keywords" content="備忘録">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>【備忘録】 このサイト用の VPS をセットアップしたときのメモ | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ <link rel="stylesheet" href="/hl.css?h=340e65ffd5c17713efc9107c06304f7b">
+ </head>
+ <body class="single">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <article class="post-single">
+ <header class="post-header">
+ <h1 class="post-title">【備忘録】 このサイト用の VPS をセットアップしたときのメモ</h1>
+ <ul class="post-tags">
+ <li class="tag">
+ <a href="/tags/note-to-self/">備忘録</a>
+ </li>
+ </ul>
+ </header>
+ <div class="post-content">
+ <section>
+ <h2 id="changelog">更新履歴</h2>
+ <ol>
+ <li class="revision">
+ <time datetime="2022-10-28">2022-10-28</time>: 公開
+ </li>
+ <li class="revision">
+ <time datetime="2023-08-30">2023-08-30</time>: ssh_config に IdentitiesOnly yes を追加
+ </li>
+ </ol>
+ </section>
+ <section id="section--intro">
+ <h2><a href="#section--intro">はじめに</a></h2>
+ <p>
+ これまでこの blog は GitHub Pages でホストしていたのだが、先日 VPS に移行した。 そのときにおこなったサーバのセットアップ作業を書き残しておく。 99 % 自分用の備忘録。別のベンダに移したりしたくなったら見に来る。
+ </p>
+
+ <p>
+ 未来の自分へ: 特に自動化してないので、せいぜい苦しんでくれ。
+ </p>
+ </section>
+
+ <section id="section--vps">
+ <h2><a href="#section--vps">VPS</a></h2>
+ <p>
+ <a href="https://vps.sakura.ad.jp/">さくらの VPS</a> の 2 GB プラン。 そこまで真面目に選定していないので、困ったら移動するかも。
+ </p>
+ </section>
+
+ <section id="section--preparation">
+ <h2><a href="#section--preparation">事前準備</a></h2>
+ <section id="section--preparation--hostname">
+ <h3><a href="#section--preparation--hostname">サーバのホスト名を決める</a></h3>
+ <p>
+ モチベーションが上がるという効能がある。今回は藤原定家から取って <code>teika</code> にした。 たいていいつも源氏物語の帖か小倉百人一首の歌人から選んでいる。
+ </p>
+ </section>
+
+ <section id="section--preparation--ssh-key">
+ <h3><a href="#section--preparation--ssh-key">SSH の鍵生成</a></h3>
+ <p>
+ ローカルマシンで鍵を生成する。
+ </p>
+
+ <pre class="highlight" language="shell-session" linenumbering="unnumbered"><code>$ ssh-keygen -t ed25519 -b 521 -f ~/.ssh/teika.key
+$ ssh-keygen -t ed25519 -b 521 -f ~/.ssh/github2teika.key</code></pre>
+
+ <p>
+ <code>teika.key</code> はローカルからサーバへの接続用、<code>github2teika.key</code> は、 GitHub Actions からサーバへのデプロイ用。
+ </p>
+ </section>
+
+ <section id="section--preparation--ssh-config">
+ <h3><a href="#section--preparation--ssh-config">SSH の設定</a></h3>
+ <p>
+ <code>.ssh/config</code> に設定しておく。
+ </p>
+
+ <pre class="highlight" language="ssh_config" linenumbering="unnumbered"><code>Host teika
+ HostName **********
+ User **********
+ Port **********
+ IdentityFile ~/.ssh/teika.key
+ IdentitiesOnly yes</code></pre>
+ </section>
+ </section>
+
+ <section id="section--basic-setup">
+ <h2><a href="#section--basic-setup">基本のセットアップ</a></h2>
+ <section id="section--basic-setup--login">
+ <h3><a href="#section--basic-setup--login">SSH 接続</a></h3>
+ <p>
+ VPS 契約時に設定した管理者ユーザとパスワードを使ってログインする。
+ </p>
+ </section>
+
+ <section id="section--basic-setup--user">
+ <h3><a href="#section--basic-setup--user">ユーザを作成する</a></h3>
+ <p>
+ 管理者ユーザで作業すると危ないので、メインで使うユーザを作成する。 <code>sudo</code> グループに追加して <code>sudo</code> できるようにし、<code>su</code> で切り替え。
+ </p>
+
+ <pre class="highlight" language="shell-session" linenumbering="unnumbered"><code>$ sudo adduser **********
+$ sudo adduser ********** sudo
+$ su **********
+$ cd</code></pre>
+ </section>
+
+ <section id="section--basic-setup--hostname">
+ <h3><a href="#section--basic-setup--hostname">ホスト名を変える</a></h3>
+ <pre class="highlight" language="shell-session" linenumbering="unnumbered"><code>$ sudo hostname teika</code></pre>
+ </section>
+
+ <section id="section--basic-setup--public-key">
+ <h3><a href="#section--basic-setup--public-key">公開鍵を置く</a></h3>
+ <pre class="highlight" language="shell-session" linenumbering="unnumbered"><code>$ mkdir ~/.ssh
+$ chmod 700 ~/.ssh
+$ vi ~/.ssh/authorized_keys</code></pre>
+
+ <p>
+ <code>authorized_keys</code> には、ローカルで生成した <code>~/.ssh/teika.key.pub</code> と <code>~/.ssh/github2teika.key.pub</code> の内容をコピーする。
+ </p>
+ </section>
+
+ <section id="section--basic-setup--ssh-config">
+ <h3><a href="#section--basic-setup--ssh-config">SSH の設定</a></h3>
+ <p>
+ SSH の設定を変更し、少しでも安全にしておく。
+ </p>
+
+ <pre class="highlight" language="shell-session" linenumbering="unnumbered"><code>$ sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
+$ sudo vi /etc/ssh/sshd_config</code></pre>
+
+ <ul>
+ <li>
+ <code>Port</code> を変更
+ </li>
+
+ <li>
+ <code>PermitRootLogin</code> を <code>no</code> に
+ </li>
+
+ <li>
+ <code>PasswordAuthentication</code> を <code>no</code> に
+ </li>
+ </ul>
+
+ <p>
+ そして設定を反映。
+ </p>
+
+ <pre class="highlight" language="shell-session" linenumbering="unnumbered"><code>$ sudo systemctl restart sshd
+$ sudo systemctl status sshd</code></pre>
+ </section>
+
+ <section id="section--basic-setup--ssh-connect">
+ <h3><a href="#section--basic-setup--ssh-connect">SSH で接続確認</a></h3>
+ <p>
+ 今の SSH セッションは閉じずに、ターミナルを別途開いて疎通確認する。 セッションを閉じてしまうと、SSH の設定に不備があった場合に締め出しをくらう。
+ </p>
+
+ <pre class="highlight" language="shell-session" linenumbering="unnumbered"><code>$ ssh teika</code></pre>
+ </section>
+
+ <section id="section--basic-setup--close-ports">
+ <h3><a href="#section--basic-setup--close-ports">ポートの遮断</a></h3>
+ <p>
+ デフォルトの 22 番を閉じ、設定したポートだけ空ける。
+ </p>
+
+ <pre class="highlight" language="shell-session" linenumbering="unnumbered"><code>$ sudo ufw deny ssh
+$ sudo ufw allow *******
+$ sudo ufw enable
+$ sudo ufw reload
+$ sudo ufw status</code></pre>
+
+ <p>
+ ここでもう一度 SSH の接続確認を挟む。
+ </p>
+ </section>
+
+ <section id="section--basic-setup--ssh-key-for-github">
+ <h3><a href="#section--basic-setup--ssh-key-for-github">GitHub 用の SSH 鍵</a></h3>
+ <p>
+ GitHub に置いてある private リポジトリをサーバから clone したいので、SSH 鍵を生成して置いておく。
+ </p>
+
+ <pre class="highlight" language="shell-session" linenumbering="unnumbered"><code>$ ssh-keygen -t ed25519 -b 521 -f ~/.ssh/github.key
+$ cat ~/.ssh/github.key.pub</code></pre>
+
+ <p>
+ <a href="https://github.com/settings/ssh">GitHub の設定画面</a> から、この公開鍵を追加する。
+ </p>
+
+ <pre class="highlight" language="shell-session" linenumbering="unnumbered"><code>$ vi ~/.ssh/config</code></pre>
+
+ <p>
+ 設定はこう。
+ </p>
+
+ <pre class="highlight" language="ssh_config" linenumbering="unnumbered"><code>Host github.com
+ HostName github.com
+ User git
+ Port 22
+ IdentityFile ~/.ssh/github.key
+ IdentitiesOnly yes</code></pre>
+
+ <p>
+ 最後に接続できるか確認しておく。
+ </p>
+
+ <pre class="highlight" language="shell-session" linenumbering="unnumbered"><code>$ ssh -T github.com</code></pre>
+ </section>
+
+ <section id="section--basic-setup--upgrade-packages">
+ <h3><a href="#section--basic-setup--upgrade-packages">パッケージの更新</a></h3>
+ <pre class="highlight" language="shell-session" linenumbering="unnumbered"><code>$ sudo apt update
+$ sudo apt upgrade
+$ sudo apt update
+$ sudo apt upgrade
+$ sudo apt autoremove</code></pre>
+ </section>
+ </section>
+
+ <section id="section--site-hosting-setup">
+ <h2><a href="#section--site-hosting-setup">サイトホスティング用のセットアップ</a></h2>
+ <section id="section--site-hosting-setup--dns">
+ <h3><a href="#section--site-hosting-setup--dns">DNS に IP アドレスを登録する</a></h3>
+ <p>
+ このサーバは固定の IP アドレスがあるので、<code>A</code> レコードに直接入れるだけで済んだ。
+ </p>
+ </section>
+
+ <section id="section--site-hosting-setup--install-softwares">
+ <h3><a href="#section--site-hosting-setup--install-softwares">使うソフトウェアのインストール</a></h3>
+ <pre class="highlight" language="shell-session" linenumbering="unnumbered"><code>$ sudo apt install docker docker-compose git make</code></pre>
+ </section>
+
+ <section id="section--site-hosting-setup--docker">
+ <h3><a href="#section--site-hosting-setup--docker">メインユーザが Docker を使えるように</a></h3>
+ <pre class="highlight" language="shell-session" linenumbering="unnumbered"><code>$ sudo adduser ********** docker</code></pre>
+ </section>
+
+ <section id="section--site-hosting-setup--open-http-ports">
+ <h3><a href="#section--site-hosting-setup--open-http-ports">HTTP/HTTPS を通す</a></h3>
+ <p>
+ 80 番と 443 番を空ける。
+ </p>
+
+ <pre class="highlight" language="shell-session" linenumbering="unnumbered"><code>$ sudo ufw allow 80/tcp
+$ sudo ufw allow 443/tcp
+$ sudo ufw reload
+$ sudo ufw status</code></pre>
+ </section>
+
+ <section id="section--site-hosting-setup--clone-repositories">
+ <h3><a href="#section--site-hosting-setup--clone-repositories">リポジトリのクローン</a></h3>
+ <pre class="highlight" language="shell-session" linenumbering="unnumbered"><code>$ cd
+$ git clone git@github.com:nsfisis/nsfisis.dev.git
+$ cd nsfisis.dev
+$ git submodule update --init</code></pre>
+ </section>
+
+ <section id="section--site-hosting-setup--certbot">
+ <h3><a href="#section--site-hosting-setup--certbot">certbot で証明書取得</a></h3>
+ <pre class="highlight" language="shell-session" linenumbering="unnumbered"><code>$ docker-compose up -d acme-challenge
+$ make setup</code></pre>
+ </section>
+
+ <section id="section--site-hosting-setup--run-server">
+ <h3><a href="#section--site-hosting-setup--run-server">サーバを稼動させる</a></h3>
+ <pre class="highlight" language="shell-session" linenumbering="unnumbered"><code>$ make serve</code></pre>
+ </section>
+ </section>
+
+ <section id="section--outro">
+ <h2><a href="#section--outro">感想</a></h2>
+ <p>
+ (業務でなく) 個人だと数年ぶりのサーバセットアップで、これだけでも割と時間を食ってしまった。 とはいえ式年遷宮は楽しいので、これからも定期的にやっていきたい。 コンテナデプロイにしたい気持ちもあるのだが、色々実験したい関係上、本物のサーバも欲しくはある。 次の式年遷宮では、手順の一部だけでも自動化したいところ。
+ </p>
+ </section>
+ </div>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/posts/2022-11-19/phperkaigi-2023-unused-token-quiz-2/index.html b/vhosts/blog/public/posts/2022-11-19/phperkaigi-2023-unused-token-quiz-2/index.html
new file mode 100644
index 00000000..a870f0d4
--- /dev/null
+++ b/vhosts/blog/public/posts/2022-11-19/phperkaigi-2023-unused-token-quiz-2/index.html
@@ -0,0 +1,225 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2022 nsfisis">
+ <meta name="description" content="来年の PHPerKaigi 2023 でデジタルサーカス株式会社から出題予定のトークン問題のうち、ボツになった問題を公開する (その 2)。">
+ <meta name="keywords" content="PHP,PHPerKaigi">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>PHPerKaigi 2023: ボツになったトークン問題 その 2 | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ <link rel="stylesheet" href="/hl.css?h=340e65ffd5c17713efc9107c06304f7b">
+ </head>
+ <body class="single">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <article class="post-single">
+ <header class="post-header">
+ <h1 class="post-title">PHPerKaigi 2023: ボツになったトークン問題 その 2</h1>
+ <ul class="post-tags">
+ <li class="tag">
+ <a href="/tags/php/">PHP</a>
+ </li>
+ <li class="tag">
+ <a href="/tags/phperkaigi/">PHPerKaigi</a>
+ </li>
+ </ul>
+ </header>
+ <div class="post-content">
+ <section>
+ <h2 id="changelog">更新履歴</h2>
+ <ol>
+ <li class="revision">
+ <time datetime="2022-11-19">2022-11-19</time>: 公開
+ </li>
+ </ol>
+ </section>
+ <section id="section--intro">
+ <h2><a href="#section--intro">はじめに</a></h2>
+ <p>
+ 2023 年 3 月 23 日から 25 日にかけて開催予定 (記事執筆時点) の <a href="https://phperkaigi.jp/2023/">PHPerKaigi 2023</a> において、 昨年と同様に、弊社 <a href="https://www.dgcircus.com/">デジタルサーカス株式会社</a> からトークン問題を出題予定である。
+ </p>
+
+ <p>
+ 昨年のトークン問題の記事はこちら: <a href="/posts/2022-04-09/phperkaigi-2022-tokens/">PHPerKaigi 2022 トークン問題の解説</a>
+ </p>
+
+ <p>
+ すでに 2023 年用の問題は作成済みであるが、その制作過程の中でいくつかボツ問ができた。せっかくなので、PHPerKaigi 開催を待つ間に紹介しようと思う。
+ </p>
+
+ <p>
+ 10 月から 2 月まで、毎月 1 記事ずつ公開していく予定 (忘れていなければ)。
+ </p>
+
+ <p>
+ その 1 はこちら: <a href="/posts/2022-10-23/phperkaigi-2023-unused-token-quiz-1/">PHPerKaigi 2023: ボツになったトークン問題 その 1</a>
+ </p>
+ </section>
+
+ <section id="section--quiz">
+ <h2><a href="#section--quiz">問題</a></h2>
+ <p>
+ 注意: これはボツ問なので、得られたトークンを PHPerKaigi で入力してもポイントにはならない。
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight"><span class="hljs-meta">&lt;?php</span> <span class="hljs-title function_ invoke__">printf</span>((<span class="hljs-keyword">isset</span>(<span class="hljs-variable">$s</span>)?<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">trim</span>(<span class="hljs-variable">$s</span>,<span class="hljs-string">&quot;​&quot;</span>):<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">chr</span>(<span class="hljs-title function_ invoke__">strlen</span>(<span class="hljs-variable">$s</span>)/<span class="hljs-number">3</span>))(<span class="hljs-variable">$s</span>=<span class="hljs-string">&#x27;​&lt;?php printf((isset($s)?fn($s)=&gt;trim($s,&quot;​&quot;):fn($s)=&gt;chr(strlen($s)/3))($s=%s).&quot;\n&quot;,&quot;\x27$s\x27&quot;);?&gt;&#x27;</span>).<span class="hljs-string">&quot;\n&quot;</span>,<span class="hljs-string">&quot;\x27<span class="hljs-subst">$s</span>\x27&quot;</span>);<span class="hljs-meta">?&gt;</span>
+<span class="hljs-meta">&lt;?php</span> <span class="hljs-title function_ invoke__">printf</span>((<span class="hljs-keyword">isset</span>(<span class="hljs-variable">$s</span>)?<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">trim</span>(<span class="hljs-variable">$s</span>,<span class="hljs-string">&quot;​&quot;</span>):<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">chr</span>(<span class="hljs-title function_ invoke__">strlen</span>(<span class="hljs-variable">$s</span>)/<span class="hljs-number">3</span>))(<span class="hljs-variable">$s</span>=<span class="hljs-string">&#x27;​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&lt;?php printf((isset($s)?fn($s)=&gt;trim($s,&quot;​&quot;):fn($s)=&gt;chr(strlen($s)/3))($s=%s).&quot;\n&quot;,&quot;\x27$s\x27&quot;);?&gt;&#x27;</span>).<span class="hljs-string">&quot;\n&quot;</span>,<span class="hljs-string">&quot;\x27<span class="hljs-subst">$s</span>\x27&quot;</span>);<span class="hljs-meta">?&gt;</span>
+<span class="hljs-meta">&lt;?php</span> <span class="hljs-title function_ invoke__">printf</span>((<span class="hljs-keyword">isset</span>(<span class="hljs-variable">$s</span>)?<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">trim</span>(<span class="hljs-variable">$s</span>,<span class="hljs-string">&quot;​&quot;</span>):<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">chr</span>(<span class="hljs-title function_ invoke__">strlen</span>(<span class="hljs-variable">$s</span>)/<span class="hljs-number">3</span>))(<span class="hljs-variable">$s</span>=<span class="hljs-string">&#x27;​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&lt;?php printf((isset($s)?fn($s)=&gt;trim($s,&quot;​&quot;):fn($s)=&gt;chr(strlen($s)/3))($s=%s).&quot;\n&quot;,&quot;\x27$s\x27&quot;);?&gt;&#x27;</span>).<span class="hljs-string">&quot;\n&quot;</span>,<span class="hljs-string">&quot;\x27<span class="hljs-subst">$s</span>\x27&quot;</span>);<span class="hljs-meta">?&gt;</span>
+<span class="hljs-meta">&lt;?php</span> <span class="hljs-title function_ invoke__">printf</span>((<span class="hljs-keyword">isset</span>(<span class="hljs-variable">$s</span>)?<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">trim</span>(<span class="hljs-variable">$s</span>,<span class="hljs-string">&quot;​&quot;</span>):<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">chr</span>(<span class="hljs-title function_ invoke__">strlen</span>(<span class="hljs-variable">$s</span>)/<span class="hljs-number">3</span>))(<span class="hljs-variable">$s</span>=<span class="hljs-string">&#x27;​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&lt;?php printf((isset($s)?fn($s)=&gt;trim($s,&quot;​&quot;):fn($s)=&gt;chr(strlen($s)/3))($s=%s).&quot;\n&quot;,&quot;\x27$s\x27&quot;);?&gt;&#x27;</span>).<span class="hljs-string">&quot;\n&quot;</span>,<span class="hljs-string">&quot;\x27<span class="hljs-subst">$s</span>\x27&quot;</span>);<span class="hljs-meta">?&gt;</span>
+<span class="hljs-meta">&lt;?php</span> <span class="hljs-title function_ invoke__">printf</span>((<span class="hljs-keyword">isset</span>(<span class="hljs-variable">$s</span>)?<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">trim</span>(<span class="hljs-variable">$s</span>,<span class="hljs-string">&quot;​&quot;</span>):<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">chr</span>(<span class="hljs-title function_ invoke__">strlen</span>(<span class="hljs-variable">$s</span>)/<span class="hljs-number">3</span>))(<span class="hljs-variable">$s</span>=<span class="hljs-string">&#x27;​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&lt;?php printf((isset($s)?fn($s)=&gt;trim($s,&quot;​&quot;):fn($s)=&gt;chr(strlen($s)/3))($s=%s).&quot;\n&quot;,&quot;\x27$s\x27&quot;);?&gt;&#x27;</span>).<span class="hljs-string">&quot;\n&quot;</span>,<span class="hljs-string">&quot;\x27<span class="hljs-subst">$s</span>\x27&quot;</span>);<span class="hljs-meta">?&gt;</span>
+<span class="hljs-meta">&lt;?php</span> <span class="hljs-title function_ invoke__">printf</span>((<span class="hljs-keyword">isset</span>(<span class="hljs-variable">$s</span>)?<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">trim</span>(<span class="hljs-variable">$s</span>,<span class="hljs-string">&quot;​&quot;</span>):<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">chr</span>(<span class="hljs-title function_ invoke__">strlen</span>(<span class="hljs-variable">$s</span>)/<span class="hljs-number">3</span>))(<span class="hljs-variable">$s</span>=<span class="hljs-string">&#x27;​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&lt;?php printf((isset($s)?fn($s)=&gt;trim($s,&quot;​&quot;):fn($s)=&gt;chr(strlen($s)/3))($s=%s).&quot;\n&quot;,&quot;\x27$s\x27&quot;);?&gt;&#x27;</span>).<span class="hljs-string">&quot;\n&quot;</span>,<span class="hljs-string">&quot;\x27<span class="hljs-subst">$s</span>\x27&quot;</span>);<span class="hljs-meta">?&gt;</span>
+<span class="hljs-meta">&lt;?php</span> <span class="hljs-title function_ invoke__">printf</span>((<span class="hljs-keyword">isset</span>(<span class="hljs-variable">$s</span>)?<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">trim</span>(<span class="hljs-variable">$s</span>,<span class="hljs-string">&quot;​&quot;</span>):<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">chr</span>(<span class="hljs-title function_ invoke__">strlen</span>(<span class="hljs-variable">$s</span>)/<span class="hljs-number">3</span>))(<span class="hljs-variable">$s</span>=<span class="hljs-string">&#x27;​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&lt;?php printf((isset($s)?fn($s)=&gt;trim($s,&quot;​&quot;):fn($s)=&gt;chr(strlen($s)/3))($s=%s).&quot;\n&quot;,&quot;\x27$s\x27&quot;);?&gt;&#x27;</span>).<span class="hljs-string">&quot;\n&quot;</span>,<span class="hljs-string">&quot;\x27<span class="hljs-subst">$s</span>\x27&quot;</span>);<span class="hljs-meta">?&gt;</span>
+<span class="hljs-meta">&lt;?php</span> <span class="hljs-title function_ invoke__">printf</span>((<span class="hljs-keyword">isset</span>(<span class="hljs-variable">$s</span>)?<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">trim</span>(<span class="hljs-variable">$s</span>,<span class="hljs-string">&quot;​&quot;</span>):<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">chr</span>(<span class="hljs-title function_ invoke__">strlen</span>(<span class="hljs-variable">$s</span>)/<span class="hljs-number">3</span>))(<span class="hljs-variable">$s</span>=<span class="hljs-string">&#x27;​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&lt;?php printf((isset($s)?fn($s)=&gt;trim($s,&quot;​&quot;):fn($s)=&gt;chr(strlen($s)/3))($s=%s).&quot;\n&quot;,&quot;\x27$s\x27&quot;);?&gt;&#x27;</span>).<span class="hljs-string">&quot;\n&quot;</span>,<span class="hljs-string">&quot;\x27<span class="hljs-subst">$s</span>\x27&quot;</span>);<span class="hljs-meta">?&gt;</span>
+<span class="hljs-meta">&lt;?php</span> <span class="hljs-title function_ invoke__">printf</span>((<span class="hljs-keyword">isset</span>(<span class="hljs-variable">$s</span>)?<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">trim</span>(<span class="hljs-variable">$s</span>,<span class="hljs-string">&quot;​&quot;</span>):<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">chr</span>(<span class="hljs-title function_ invoke__">strlen</span>(<span class="hljs-variable">$s</span>)/<span class="hljs-number">3</span>))(<span class="hljs-variable">$s</span>=<span class="hljs-string">&#x27;​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&lt;?php printf((isset($s)?fn($s)=&gt;trim($s,&quot;​&quot;):fn($s)=&gt;chr(strlen($s)/3))($s=%s).&quot;\n&quot;,&quot;\x27$s\x27&quot;);?&gt;&#x27;</span>).<span class="hljs-string">&quot;\n&quot;</span>,<span class="hljs-string">&quot;\x27<span class="hljs-subst">$s</span>\x27&quot;</span>);<span class="hljs-meta">?&gt;</span>
+<span class="hljs-meta">&lt;?php</span> <span class="hljs-title function_ invoke__">printf</span>((<span class="hljs-keyword">isset</span>(<span class="hljs-variable">$s</span>)?<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">trim</span>(<span class="hljs-variable">$s</span>,<span class="hljs-string">&quot;​&quot;</span>):<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">chr</span>(<span class="hljs-title function_ invoke__">strlen</span>(<span class="hljs-variable">$s</span>)/<span class="hljs-number">3</span>))(<span class="hljs-variable">$s</span>=<span class="hljs-string">&#x27;​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&lt;?php printf((isset($s)?fn($s)=&gt;trim($s,&quot;​&quot;):fn($s)=&gt;chr(strlen($s)/3))($s=%s).&quot;\n&quot;,&quot;\x27$s\x27&quot;);?&gt;&#x27;</span>).<span class="hljs-string">&quot;\n&quot;</span>,<span class="hljs-string">&quot;\x27<span class="hljs-subst">$s</span>\x27&quot;</span>);<span class="hljs-meta">?&gt;</span></code></pre>
+
+ <p>
+ &quot;And Then There Were None&quot; (そして誰もいなくなった) と名付けた作品。変則 quine (自分自身と同じソースコードを出力するプログラム) になっている。
+ </p>
+ </section>
+
+ <section id="section--how-to-obtain-token">
+ <h2><a href="#section--how-to-obtain-token">トークン入手方法</a></h2>
+ <p>
+ 実行してみると、次のような出力が得られる。
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight"><span class="hljs-comment">#</span>
+<span class="hljs-meta">&lt;?php</span> <span class="hljs-title function_ invoke__">printf</span>((<span class="hljs-keyword">isset</span>(<span class="hljs-variable">$s</span>)?<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">trim</span>(<span class="hljs-variable">$s</span>,<span class="hljs-string">&quot;​&quot;</span>):<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">chr</span>(<span class="hljs-title function_ invoke__">strlen</span>(<span class="hljs-variable">$s</span>)/<span class="hljs-number">3</span>))(<span class="hljs-variable">$s</span>=<span class="hljs-string">&#x27;​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&lt;?php printf((isset($s)?fn($s)=&gt;trim($s,&quot;​&quot;):fn($s)=&gt;chr(strlen($s)/3))($s=%s).&quot;\n&quot;,&quot;\x27$s\x27&quot;);?&gt;&#x27;</span>).<span class="hljs-string">&quot;\n&quot;</span>,<span class="hljs-string">&quot;\x27<span class="hljs-subst">$s</span>\x27&quot;</span>);<span class="hljs-meta">?&gt;</span>
+<span class="hljs-meta">&lt;?php</span> <span class="hljs-title function_ invoke__">printf</span>((<span class="hljs-keyword">isset</span>(<span class="hljs-variable">$s</span>)?<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">trim</span>(<span class="hljs-variable">$s</span>,<span class="hljs-string">&quot;​&quot;</span>):<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">chr</span>(<span class="hljs-title function_ invoke__">strlen</span>(<span class="hljs-variable">$s</span>)/<span class="hljs-number">3</span>))(<span class="hljs-variable">$s</span>=<span class="hljs-string">&#x27;​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&lt;?php printf((isset($s)?fn($s)=&gt;trim($s,&quot;​&quot;):fn($s)=&gt;chr(strlen($s)/3))($s=%s).&quot;\n&quot;,&quot;\x27$s\x27&quot;);?&gt;&#x27;</span>).<span class="hljs-string">&quot;\n&quot;</span>,<span class="hljs-string">&quot;\x27<span class="hljs-subst">$s</span>\x27&quot;</span>);<span class="hljs-meta">?&gt;</span>
+<span class="hljs-meta">&lt;?php</span> <span class="hljs-title function_ invoke__">printf</span>((<span class="hljs-keyword">isset</span>(<span class="hljs-variable">$s</span>)?<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">trim</span>(<span class="hljs-variable">$s</span>,<span class="hljs-string">&quot;​&quot;</span>):<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">chr</span>(<span class="hljs-title function_ invoke__">strlen</span>(<span class="hljs-variable">$s</span>)/<span class="hljs-number">3</span>))(<span class="hljs-variable">$s</span>=<span class="hljs-string">&#x27;​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&lt;?php printf((isset($s)?fn($s)=&gt;trim($s,&quot;​&quot;):fn($s)=&gt;chr(strlen($s)/3))($s=%s).&quot;\n&quot;,&quot;\x27$s\x27&quot;);?&gt;&#x27;</span>).<span class="hljs-string">&quot;\n&quot;</span>,<span class="hljs-string">&quot;\x27<span class="hljs-subst">$s</span>\x27&quot;</span>);<span class="hljs-meta">?&gt;</span>
+<span class="hljs-meta">&lt;?php</span> <span class="hljs-title function_ invoke__">printf</span>((<span class="hljs-keyword">isset</span>(<span class="hljs-variable">$s</span>)?<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">trim</span>(<span class="hljs-variable">$s</span>,<span class="hljs-string">&quot;​&quot;</span>):<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">chr</span>(<span class="hljs-title function_ invoke__">strlen</span>(<span class="hljs-variable">$s</span>)/<span class="hljs-number">3</span>))(<span class="hljs-variable">$s</span>=<span class="hljs-string">&#x27;​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&lt;?php printf((isset($s)?fn($s)=&gt;trim($s,&quot;​&quot;):fn($s)=&gt;chr(strlen($s)/3))($s=%s).&quot;\n&quot;,&quot;\x27$s\x27&quot;);?&gt;&#x27;</span>).<span class="hljs-string">&quot;\n&quot;</span>,<span class="hljs-string">&quot;\x27<span class="hljs-subst">$s</span>\x27&quot;</span>);<span class="hljs-meta">?&gt;</span>
+<span class="hljs-meta">&lt;?php</span> <span class="hljs-title function_ invoke__">printf</span>((<span class="hljs-keyword">isset</span>(<span class="hljs-variable">$s</span>)?<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">trim</span>(<span class="hljs-variable">$s</span>,<span class="hljs-string">&quot;​&quot;</span>):<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">chr</span>(<span class="hljs-title function_ invoke__">strlen</span>(<span class="hljs-variable">$s</span>)/<span class="hljs-number">3</span>))(<span class="hljs-variable">$s</span>=<span class="hljs-string">&#x27;​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&lt;?php printf((isset($s)?fn($s)=&gt;trim($s,&quot;​&quot;):fn($s)=&gt;chr(strlen($s)/3))($s=%s).&quot;\n&quot;,&quot;\x27$s\x27&quot;);?&gt;&#x27;</span>).<span class="hljs-string">&quot;\n&quot;</span>,<span class="hljs-string">&quot;\x27<span class="hljs-subst">$s</span>\x27&quot;</span>);<span class="hljs-meta">?&gt;</span>
+<span class="hljs-meta">&lt;?php</span> <span class="hljs-title function_ invoke__">printf</span>((<span class="hljs-keyword">isset</span>(<span class="hljs-variable">$s</span>)?<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">trim</span>(<span class="hljs-variable">$s</span>,<span class="hljs-string">&quot;​&quot;</span>):<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">chr</span>(<span class="hljs-title function_ invoke__">strlen</span>(<span class="hljs-variable">$s</span>)/<span class="hljs-number">3</span>))(<span class="hljs-variable">$s</span>=<span class="hljs-string">&#x27;​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&lt;?php printf((isset($s)?fn($s)=&gt;trim($s,&quot;​&quot;):fn($s)=&gt;chr(strlen($s)/3))($s=%s).&quot;\n&quot;,&quot;\x27$s\x27&quot;);?&gt;&#x27;</span>).<span class="hljs-string">&quot;\n&quot;</span>,<span class="hljs-string">&quot;\x27<span class="hljs-subst">$s</span>\x27&quot;</span>);<span class="hljs-meta">?&gt;</span>
+<span class="hljs-meta">&lt;?php</span> <span class="hljs-title function_ invoke__">printf</span>((<span class="hljs-keyword">isset</span>(<span class="hljs-variable">$s</span>)?<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">trim</span>(<span class="hljs-variable">$s</span>,<span class="hljs-string">&quot;​&quot;</span>):<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">chr</span>(<span class="hljs-title function_ invoke__">strlen</span>(<span class="hljs-variable">$s</span>)/<span class="hljs-number">3</span>))(<span class="hljs-variable">$s</span>=<span class="hljs-string">&#x27;​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&lt;?php printf((isset($s)?fn($s)=&gt;trim($s,&quot;​&quot;):fn($s)=&gt;chr(strlen($s)/3))($s=%s).&quot;\n&quot;,&quot;\x27$s\x27&quot;);?&gt;&#x27;</span>).<span class="hljs-string">&quot;\n&quot;</span>,<span class="hljs-string">&quot;\x27<span class="hljs-subst">$s</span>\x27&quot;</span>);<span class="hljs-meta">?&gt;</span>
+<span class="hljs-meta">&lt;?php</span> <span class="hljs-title function_ invoke__">printf</span>((<span class="hljs-keyword">isset</span>(<span class="hljs-variable">$s</span>)?<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">trim</span>(<span class="hljs-variable">$s</span>,<span class="hljs-string">&quot;​&quot;</span>):<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">chr</span>(<span class="hljs-title function_ invoke__">strlen</span>(<span class="hljs-variable">$s</span>)/<span class="hljs-number">3</span>))(<span class="hljs-variable">$s</span>=<span class="hljs-string">&#x27;​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&lt;?php printf((isset($s)?fn($s)=&gt;trim($s,&quot;​&quot;):fn($s)=&gt;chr(strlen($s)/3))($s=%s).&quot;\n&quot;,&quot;\x27$s\x27&quot;);?&gt;&#x27;</span>).<span class="hljs-string">&quot;\n&quot;</span>,<span class="hljs-string">&quot;\x27<span class="hljs-subst">$s</span>\x27&quot;</span>);<span class="hljs-meta">?&gt;</span>
+<span class="hljs-meta">&lt;?php</span> <span class="hljs-title function_ invoke__">printf</span>((<span class="hljs-keyword">isset</span>(<span class="hljs-variable">$s</span>)?<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">trim</span>(<span class="hljs-variable">$s</span>,<span class="hljs-string">&quot;​&quot;</span>):<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">chr</span>(<span class="hljs-title function_ invoke__">strlen</span>(<span class="hljs-variable">$s</span>)/<span class="hljs-number">3</span>))(<span class="hljs-variable">$s</span>=<span class="hljs-string">&#x27;​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&lt;?php printf((isset($s)?fn($s)=&gt;trim($s,&quot;​&quot;):fn($s)=&gt;chr(strlen($s)/3))($s=%s).&quot;\n&quot;,&quot;\x27$s\x27&quot;);?&gt;&#x27;</span>).<span class="hljs-string">&quot;\n&quot;</span>,<span class="hljs-string">&quot;\x27<span class="hljs-subst">$s</span>\x27&quot;</span>);<span class="hljs-meta">?&gt;</span></code></pre>
+
+ <p>
+ 1 行目を除き、先ほどのコードとほぼ同じものが出てきた。もう一度実行してみる。
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight"><span class="hljs-comment">#</span>
+W
+<span class="hljs-meta">&lt;?php</span> <span class="hljs-title function_ invoke__">printf</span>((<span class="hljs-keyword">isset</span>(<span class="hljs-variable">$s</span>)?<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">trim</span>(<span class="hljs-variable">$s</span>,<span class="hljs-string">&quot;​&quot;</span>):<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">chr</span>(<span class="hljs-title function_ invoke__">strlen</span>(<span class="hljs-variable">$s</span>)/<span class="hljs-number">3</span>))(<span class="hljs-variable">$s</span>=<span class="hljs-string">&#x27;​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&lt;?php printf((isset($s)?fn($s)=&gt;trim($s,&quot;​&quot;):fn($s)=&gt;chr(strlen($s)/3))($s=%s).&quot;\n&quot;,&quot;\x27$s\x27&quot;);?&gt;&#x27;</span>).<span class="hljs-string">&quot;\n&quot;</span>,<span class="hljs-string">&quot;\x27<span class="hljs-subst">$s</span>\x27&quot;</span>);<span class="hljs-meta">?&gt;</span>
+<span class="hljs-meta">&lt;?php</span> <span class="hljs-title function_ invoke__">printf</span>((<span class="hljs-keyword">isset</span>(<span class="hljs-variable">$s</span>)?<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">trim</span>(<span class="hljs-variable">$s</span>,<span class="hljs-string">&quot;​&quot;</span>):<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">chr</span>(<span class="hljs-title function_ invoke__">strlen</span>(<span class="hljs-variable">$s</span>)/<span class="hljs-number">3</span>))(<span class="hljs-variable">$s</span>=<span class="hljs-string">&#x27;​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&lt;?php printf((isset($s)?fn($s)=&gt;trim($s,&quot;​&quot;):fn($s)=&gt;chr(strlen($s)/3))($s=%s).&quot;\n&quot;,&quot;\x27$s\x27&quot;);?&gt;&#x27;</span>).<span class="hljs-string">&quot;\n&quot;</span>,<span class="hljs-string">&quot;\x27<span class="hljs-subst">$s</span>\x27&quot;</span>);<span class="hljs-meta">?&gt;</span>
+<span class="hljs-meta">&lt;?php</span> <span class="hljs-title function_ invoke__">printf</span>((<span class="hljs-keyword">isset</span>(<span class="hljs-variable">$s</span>)?<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">trim</span>(<span class="hljs-variable">$s</span>,<span class="hljs-string">&quot;​&quot;</span>):<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">chr</span>(<span class="hljs-title function_ invoke__">strlen</span>(<span class="hljs-variable">$s</span>)/<span class="hljs-number">3</span>))(<span class="hljs-variable">$s</span>=<span class="hljs-string">&#x27;​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&lt;?php printf((isset($s)?fn($s)=&gt;trim($s,&quot;​&quot;):fn($s)=&gt;chr(strlen($s)/3))($s=%s).&quot;\n&quot;,&quot;\x27$s\x27&quot;);?&gt;&#x27;</span>).<span class="hljs-string">&quot;\n&quot;</span>,<span class="hljs-string">&quot;\x27<span class="hljs-subst">$s</span>\x27&quot;</span>);<span class="hljs-meta">?&gt;</span>
+<span class="hljs-meta">&lt;?php</span> <span class="hljs-title function_ invoke__">printf</span>((<span class="hljs-keyword">isset</span>(<span class="hljs-variable">$s</span>)?<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">trim</span>(<span class="hljs-variable">$s</span>,<span class="hljs-string">&quot;​&quot;</span>):<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">chr</span>(<span class="hljs-title function_ invoke__">strlen</span>(<span class="hljs-variable">$s</span>)/<span class="hljs-number">3</span>))(<span class="hljs-variable">$s</span>=<span class="hljs-string">&#x27;​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&lt;?php printf((isset($s)?fn($s)=&gt;trim($s,&quot;​&quot;):fn($s)=&gt;chr(strlen($s)/3))($s=%s).&quot;\n&quot;,&quot;\x27$s\x27&quot;);?&gt;&#x27;</span>).<span class="hljs-string">&quot;\n&quot;</span>,<span class="hljs-string">&quot;\x27<span class="hljs-subst">$s</span>\x27&quot;</span>);<span class="hljs-meta">?&gt;</span>
+<span class="hljs-meta">&lt;?php</span> <span class="hljs-title function_ invoke__">printf</span>((<span class="hljs-keyword">isset</span>(<span class="hljs-variable">$s</span>)?<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">trim</span>(<span class="hljs-variable">$s</span>,<span class="hljs-string">&quot;​&quot;</span>):<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">chr</span>(<span class="hljs-title function_ invoke__">strlen</span>(<span class="hljs-variable">$s</span>)/<span class="hljs-number">3</span>))(<span class="hljs-variable">$s</span>=<span class="hljs-string">&#x27;​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&lt;?php printf((isset($s)?fn($s)=&gt;trim($s,&quot;​&quot;):fn($s)=&gt;chr(strlen($s)/3))($s=%s).&quot;\n&quot;,&quot;\x27$s\x27&quot;);?&gt;&#x27;</span>).<span class="hljs-string">&quot;\n&quot;</span>,<span class="hljs-string">&quot;\x27<span class="hljs-subst">$s</span>\x27&quot;</span>);<span class="hljs-meta">?&gt;</span>
+<span class="hljs-meta">&lt;?php</span> <span class="hljs-title function_ invoke__">printf</span>((<span class="hljs-keyword">isset</span>(<span class="hljs-variable">$s</span>)?<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">trim</span>(<span class="hljs-variable">$s</span>,<span class="hljs-string">&quot;​&quot;</span>):<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">chr</span>(<span class="hljs-title function_ invoke__">strlen</span>(<span class="hljs-variable">$s</span>)/<span class="hljs-number">3</span>))(<span class="hljs-variable">$s</span>=<span class="hljs-string">&#x27;​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&lt;?php printf((isset($s)?fn($s)=&gt;trim($s,&quot;​&quot;):fn($s)=&gt;chr(strlen($s)/3))($s=%s).&quot;\n&quot;,&quot;\x27$s\x27&quot;);?&gt;&#x27;</span>).<span class="hljs-string">&quot;\n&quot;</span>,<span class="hljs-string">&quot;\x27<span class="hljs-subst">$s</span>\x27&quot;</span>);<span class="hljs-meta">?&gt;</span>
+<span class="hljs-meta">&lt;?php</span> <span class="hljs-title function_ invoke__">printf</span>((<span class="hljs-keyword">isset</span>(<span class="hljs-variable">$s</span>)?<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">trim</span>(<span class="hljs-variable">$s</span>,<span class="hljs-string">&quot;​&quot;</span>):<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">chr</span>(<span class="hljs-title function_ invoke__">strlen</span>(<span class="hljs-variable">$s</span>)/<span class="hljs-number">3</span>))(<span class="hljs-variable">$s</span>=<span class="hljs-string">&#x27;​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&lt;?php printf((isset($s)?fn($s)=&gt;trim($s,&quot;​&quot;):fn($s)=&gt;chr(strlen($s)/3))($s=%s).&quot;\n&quot;,&quot;\x27$s\x27&quot;);?&gt;&#x27;</span>).<span class="hljs-string">&quot;\n&quot;</span>,<span class="hljs-string">&quot;\x27<span class="hljs-subst">$s</span>\x27&quot;</span>);<span class="hljs-meta">?&gt;</span>
+<span class="hljs-meta">&lt;?php</span> <span class="hljs-title function_ invoke__">printf</span>((<span class="hljs-keyword">isset</span>(<span class="hljs-variable">$s</span>)?<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">trim</span>(<span class="hljs-variable">$s</span>,<span class="hljs-string">&quot;​&quot;</span>):<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">chr</span>(<span class="hljs-title function_ invoke__">strlen</span>(<span class="hljs-variable">$s</span>)/<span class="hljs-number">3</span>))(<span class="hljs-variable">$s</span>=<span class="hljs-string">&#x27;​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​&lt;?php printf((isset($s)?fn($s)=&gt;trim($s,&quot;​&quot;):fn($s)=&gt;chr(strlen($s)/3))($s=%s).&quot;\n&quot;,&quot;\x27$s\x27&quot;);?&gt;&#x27;</span>).<span class="hljs-string">&quot;\n&quot;</span>,<span class="hljs-string">&quot;\x27<span class="hljs-subst">$s</span>\x27&quot;</span>);<span class="hljs-meta">?&gt;</span></code></pre>
+
+ <p>
+ 今度は 2 行目が書き換えられた。すべての行が変化するまで繰り返すと次のようになる。
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight"><span class="hljs-comment">#</span>
+W
+E
+L
+O
+V
+E
+P
+H
+P</code></pre>
+
+ <p>
+ トークン「#WELOVEPHP」が手に入った。
+ </p>
+ </section>
+
+ <section id="section--commentary">
+ <h2><a href="#section--commentary">解説</a></h2>
+ <p>
+ 一見すると同じ行が 10 行並んでいるだけなのにも関わらず、なぜそれぞれの行で出力が変わるのか。ソースコードをコピーして、適当なエディタに貼り付けるとわかりやすい。
+ </p>
+
+ <p>
+ Vim で開くと次のようになる (1 行目を抜粋)。
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight"><span class="hljs-meta">&lt;?php</span> <span class="hljs-title function_ invoke__">printf</span>((<span class="hljs-keyword">isset</span>(<span class="hljs-variable">$s</span>)?<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">trim</span>(<span class="hljs-variable">$s</span>,<span class="hljs-string">&quot;&lt;200b&gt;&quot;</span>):<span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">chr</span>(<span class="hljs-title function_ invoke__">strlen</span>(<span class="hljs-variable">$s</span>)/<span class="hljs-number">3</span>))(<span class="hljs-variable">$s</span>=<span class="hljs-string">&#x27;&lt;200b&gt;&lt;?php printf((isset($s)?fn($s)=&gt;trim($s,&quot;&lt;200b&gt;&quot;):fn($s)=&gt;chr(strlen($s)/3))($s=%s).&quot;\n&quot;,&quot;\x27$s\x27&quot;);?&gt;&#x27;</span>).<span class="hljs-string">&quot;\n&quot;</span>,<span class="hljs-string">&quot;\x27<span class="hljs-subst">$s</span>\x27&quot;</span>);<span class="hljs-meta">?&gt;</span></code></pre>
+
+ <p>
+ <code>&lt;200b&gt;</code> と表示されているのは、Unicode の U+200b で、ゼロ幅スペースである。
+ </p>
+
+ <div class="admonition">
+ <div class="admonition-label">
+ NOTE
+ </div>
+ <div class="admonition-content">
+ <p>
+ エディタによっては、ゼロ幅スペースが見えないことがある。VSCode ではブラウザと同様に不可視だった。
+ </p>
+ </div>
+ </div>
+
+ <p>
+ 文字列リテラルの中にゼロ幅スペースを仕込むことで、見た目を変えずに情報をエンコードすることが可能となる。
+ </p>
+
+ <p>
+ 続いて、トークンへの変換ロジックを解析する。注目すべきはこの部分だ。以下、ゼロ幅スペースは Vim での表示に合わせて <code>&lt;200b&gt;</code> と記載する。
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight"><span class="hljs-function"><span class="hljs-keyword">fn</span>(<span class="hljs-params"><span class="hljs-variable">$s</span></span>)=&gt;</span><span class="hljs-title function_ invoke__">chr</span>(<span class="hljs-title function_ invoke__">strlen</span>(<span class="hljs-variable">$s</span>)/<span class="hljs-number">3</span>)</code></pre>
+
+ <p>
+ PHP の <code>strlen()</code> は文字列のバイト数を返す。1 行目の <code>$s</code> は以下の内容となっており、
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight"><span class="hljs-variable">$s</span>=<span class="hljs-string">&#x27;&lt;200b&gt;&lt;?php printf((isset($s)?fn($s)=&gt;trim($s,&quot;&lt;200b&gt;&quot;):fn($s)=&gt;chr(strlen($s)/3))($s=%s).&quot;\n&quot;,&quot;\x27$s\x27&quot;);?&gt;&#x27;</span></code></pre>
+
+ <p>
+ このソースコードは UTF-8 で書かれているので、105 バイトになる。それを 3 で割ると 35 となり、これは <code>#</code> の ASCII コードと一致する。他の行も、同様にしてゼロ幅スペースを詰めることで文字列長を調整し、トークンをエンコードしている。
+ </p>
+
+ <p>
+ デコード部以外の部分は、quine のための記述である。
+ </p>
+ </section>
+
+ <section id="section--outro">
+ <h2><a href="#section--outro">おわりに</a></h2>
+ <p>
+ <a href="https://blog.rust-lang.org/2021/11/01/cve-2021-42574.html">CVE-2021-42574</a> に着想を得た作品。この脆弱性は、Unicode の制御文字である left-to-right mark と right-to-left mark を利用し、ソースコードの実際の内容を欺く、というもの。簡単のためゼロ幅スペースを用いることとし、ついでに quine にもするとこうなった。
+ </p>
+
+ <p>
+ ボツになった理由は、ゼロ幅スペースを表示してくるエディタが想像以上に多かったため。「同じ行が並んでいるだけなのに出力が異なる」というアイデアの根幹を崩されてしまうので、この問題は不採用となった。
+ </p>
+ </section>
+ </div>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/posts/2023-01-10/phperkaigi-2023-unused-token-quiz-3/index.html b/vhosts/blog/public/posts/2023-01-10/phperkaigi-2023-unused-token-quiz-3/index.html
new file mode 100644
index 00000000..397f6ceb
--- /dev/null
+++ b/vhosts/blog/public/posts/2023-01-10/phperkaigi-2023-unused-token-quiz-3/index.html
@@ -0,0 +1,410 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2023 nsfisis">
+ <meta name="description" content="来年の PHPerKaigi 2023 でデジタルサーカス株式会社から出題予定のトークン問題のうち、ボツになった問題を公開する (その 3)。">
+ <meta name="keywords" content="PHP,PHPerKaigi">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>PHPerKaigi 2023: ボツになったトークン問題 その 3 | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ <link rel="stylesheet" href="/hl.css?h=340e65ffd5c17713efc9107c06304f7b">
+ </head>
+ <body class="single">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <article class="post-single">
+ <header class="post-header">
+ <h1 class="post-title">PHPerKaigi 2023: ボツになったトークン問題 その 3</h1>
+ <ul class="post-tags">
+ <li class="tag">
+ <a href="/tags/php/">PHP</a>
+ </li>
+ <li class="tag">
+ <a href="/tags/phperkaigi/">PHPerKaigi</a>
+ </li>
+ </ul>
+ </header>
+ <div class="post-content">
+ <section>
+ <h2 id="changelog">更新履歴</h2>
+ <ol>
+ <li class="revision">
+ <time datetime="2023-01-10">2023-01-10</time>: 公開
+ </li>
+ </ol>
+ </section>
+ <section id="section--intro">
+ <h2><a href="#section--intro">はじめに</a></h2>
+ <p>
+ 2023 年 3 月 23 日から 25 日にかけて開催予定 (記事執筆時点) の <a href="https://phperkaigi.jp/2023/">PHPerKaigi 2023</a> において、 昨年と同様に、弊社 <a href="https://www.dgcircus.com/">デジタルサーカス株式会社</a> からトークン問題を出題予定である。
+ </p>
+
+ <p>
+ 昨年のトークン問題の記事はこちら: <a href="/posts/2022-04-09/phperkaigi-2022-tokens/">PHPerKaigi 2022 トークン問題の解説</a>
+ </p>
+
+ <p>
+ すでに 2023 年用の問題は作成済みであるが、その制作過程の中でいくつかボツ問ができた。 せっかくなので、PHPerKaigi 開催を待つ間に紹介しようと思う。
+ </p>
+
+ <p>
+ 10 月から 2 月まで、毎月 1 記事ずつ公開していく予定 (忘れていなければ → 忘れていたので 12 月公開予定だった記事を今書いている)。
+ </p>
+
+ <ul>
+ <li>
+ その 1 はこちら: <a href="/posts/2022-10-23/phperkaigi-2023-unused-token-quiz-1/">PHPerKaigi 2023: ボツになったトークン問題 その 1</a>
+ </li>
+
+ <li>
+ その 2 はこちら: <a href="/posts/2022-11-19/phperkaigi-2023-unused-token-quiz-2/">PHPerKaigi 2023: ボツになったトークン問題 その 2</a>
+ </li>
+ </ul>
+ </section>
+
+ <section id="section--quiz">
+ <h2><a href="#section--quiz">問題</a></h2>
+ <p>
+ 注意: これはボツ問なので、得られたトークンを PHPerKaigi で入力してもポイントにはならない。
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight"><span class="hljs-meta">&lt;?php</span>
+<span class="hljs-keyword">try</span> {
+ <span class="hljs-title function_ invoke__">f</span>(<span class="hljs-title function_ invoke__">g</span>() / <span class="hljs-keyword">__LINE__</span>);
+} <span class="hljs-keyword">catch</span> (<span class="hljs-built_in">Throwable</span> <span class="hljs-variable">$e</span>) {
+ <span class="hljs-keyword">while</span> (<span class="hljs-variable">$e</span> = <span class="hljs-variable">$e</span>-&gt;<span class="hljs-title function_ invoke__">getPrevious</span>()) <span class="hljs-title function_ invoke__">printf</span>(<span class="hljs-string">&#x27;%c&#x27;</span>, <span class="hljs-variable">$e</span>-&gt;<span class="hljs-title function_ invoke__">getLine</span>() + <span class="hljs-number">23</span>);
+ <span class="hljs-keyword">echo</span> <span class="hljs-string">&quot;\n&quot;</span>;
+}
+<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">f</span>(<span class="hljs-params"><span class="hljs-keyword">int</span> <span class="hljs-variable">$i</span></span>) </span>{
+ <span class="hljs-keyword">if</span> (<span class="hljs-variable">$i</span> &lt; <span class="hljs-number">0</span>) <span class="hljs-title function_ invoke__">f</span>();
+ <span class="hljs-keyword">try</span> {
+ <span class="hljs-keyword">match</span> (<span class="hljs-variable">$i</span>) {
+ <span class="hljs-number">0</span> =&gt; <span class="hljs-number">0</span> / <span class="hljs-number">0</span>,
+
+
+
+ <span class="hljs-number">15</span>, <span class="hljs-number">36</span> =&gt; <span class="hljs-number">0</span> / <span class="hljs-number">0</span>,
+ <span class="hljs-number">14</span> =&gt; <span class="hljs-number">0</span> / <span class="hljs-number">0</span>,
+ <span class="hljs-number">37</span> =&gt; <span class="hljs-number">0</span> / <span class="hljs-number">0</span>,
+
+
+
+
+
+
+
+
+
+
+ <span class="hljs-number">6</span> =&gt; <span class="hljs-number">0</span> / <span class="hljs-number">0</span>,
+
+ <span class="hljs-number">5</span> =&gt; <span class="hljs-number">0</span> / <span class="hljs-number">0</span>,
+
+ <span class="hljs-number">22</span> =&gt; <span class="hljs-number">0</span> / <span class="hljs-number">0</span>,
+
+
+
+
+ <span class="hljs-number">34</span>, <span class="hljs-number">35</span> =&gt; <span class="hljs-number">0</span> / <span class="hljs-number">0</span>,
+
+
+
+
+
+
+
+
+ <span class="hljs-number">25</span> =&gt; <span class="hljs-number">0</span> / <span class="hljs-number">0</span>,
+ <span class="hljs-number">17</span>, <span class="hljs-number">21</span> =&gt; <span class="hljs-number">0</span> / <span class="hljs-number">0</span>,
+
+ <span class="hljs-number">24</span>, <span class="hljs-number">32</span> =&gt; <span class="hljs-number">0</span> / <span class="hljs-number">0</span>,
+
+
+
+
+
+
+
+ <span class="hljs-number">33</span> =&gt; <span class="hljs-number">0</span> / <span class="hljs-number">0</span>,
+
+ <span class="hljs-number">16</span> =&gt; <span class="hljs-number">0</span> / <span class="hljs-number">0</span>,
+
+
+ <span class="hljs-number">18</span> =&gt; <span class="hljs-number">0</span> / <span class="hljs-number">0</span>,
+
+
+
+
+
+
+
+
+ <span class="hljs-number">7</span> =&gt; <span class="hljs-number">0</span> / <span class="hljs-number">0</span>,
+
+ <span class="hljs-number">2</span> =&gt; <span class="hljs-number">0</span> / <span class="hljs-number">0</span>,
+ <span class="hljs-number">1</span>, <span class="hljs-number">20</span> =&gt; <span class="hljs-number">0</span> / <span class="hljs-number">0</span>,
+ <span class="hljs-number">10</span>, <span class="hljs-number">28</span> =&gt; <span class="hljs-number">0</span> / <span class="hljs-number">0</span>,
+ <span class="hljs-number">8</span>, <span class="hljs-number">12</span>, <span class="hljs-number">26</span> =&gt; <span class="hljs-number">0</span> / <span class="hljs-number">0</span>,
+ <span class="hljs-number">4</span>, <span class="hljs-number">9</span>, <span class="hljs-number">13</span> =&gt; <span class="hljs-number">0</span> / <span class="hljs-number">0</span>,
+
+
+
+
+
+ <span class="hljs-number">31</span> =&gt; <span class="hljs-number">0</span> / <span class="hljs-number">0</span>,
+
+ <span class="hljs-number">29</span> =&gt; <span class="hljs-number">0</span> / <span class="hljs-number">0</span>,
+
+ <span class="hljs-number">11</span> =&gt; <span class="hljs-number">0</span> / <span class="hljs-number">0</span>,
+
+
+
+ <span class="hljs-number">3</span>, <span class="hljs-number">19</span>, <span class="hljs-number">23</span> =&gt; <span class="hljs-number">0</span> / <span class="hljs-number">0</span>,
+
+
+ <span class="hljs-number">27</span> =&gt; <span class="hljs-number">0</span> / <span class="hljs-number">0</span>,
+
+ <span class="hljs-number">30</span> =&gt; <span class="hljs-number">0</span> / <span class="hljs-number">0</span>,
+ };
+ } <span class="hljs-keyword">finally</span> {
+ <span class="hljs-title function_ invoke__">f</span>(<span class="hljs-variable">$i</span> - <span class="hljs-number">1</span>);
+ }
+}
+
+
+
+
+
+
+
+<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">g</span>(<span class="hljs-params"></span>) </span>{
+ <span class="hljs-keyword">return</span> <span class="hljs-keyword">__LINE__</span>;
+}</code></pre>
+
+ <p>
+ &quot;Catchline&quot; と名付けた作品。実行するとトークン <code>#base64_decode(&apos;SGVsbG8sIFdvcmxkIQ==&apos;)</code> が得られる。
+ </p>
+
+ <p>
+ トークンは PHP の式になっていて、評価すると <code>Hello, World!</code> という文字列になる。PHPer チャレンジのトークンには空白を含められないという制約があるが、こういった形でトークンにすれば回避できる。
+ </p>
+ </section>
+
+ <section id="section--commentary">
+ <h2><a href="#section--commentary">解説</a></h2>
+ <section id="section--commentary--summary">
+ <h3><a href="#section--commentary--summary">概要</a></h3>
+ <p>
+ 例外が発生した行数にデータをエンコードし、それを <code>catch</code> で捕まえて表示している。
+ </p>
+ </section>
+
+ <section id="section--commentary--chain-of-exceptions">
+ <h3><a href="#section--commentary--chain-of-exceptions">例外オブジェクトの連鎖</a></h3>
+ <p>
+ <a href="https://www.php.net/class.Exception"><code>Exception</code></a> や <a href="https://www.php.net/class.Error"><code>Error</code></a> には <code>$previous</code> というプロパティがあり、コンストラクタの第3引数から渡すことができる。主に 2つの用法がある:
+ </p>
+
+ <ul>
+ <li>
+ エラーを処理している途中に起こった別のエラーに、元のエラー情報を含める
+ </li>
+
+ <li>
+ 内部エラーをラップして作られたエラーに、内部エラーの情報を含める
+ </li>
+ </ul>
+
+ <p>
+ このうち 1つ目のケースは、 <code>finally</code> 節の中でエラーを投げると PHP 処理系が勝手に <code>$previous</code> を設定してくれる。
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight"><span class="hljs-meta">&lt;?php</span>
+
+<span class="hljs-keyword">try</span> {
+ <span class="hljs-keyword">try</span> {
+ <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-built_in">Exception</span>(<span class="hljs-string">&quot;Error 1&quot;</span>);
+ } <span class="hljs-keyword">finally</span> {
+ <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-built_in">Exception</span>(<span class="hljs-string">&quot;Error 2&quot;</span>);
+ }
+} <span class="hljs-keyword">catch</span> (<span class="hljs-built_in">Exception</span> <span class="hljs-variable">$e</span>) {
+ <span class="hljs-keyword">echo</span> <span class="hljs-variable">$e</span>-&gt;<span class="hljs-title function_ invoke__">getMessage</span>() . PHP_EOL;
+ <span class="hljs-comment">// =&gt; Error 2</span>
+ <span class="hljs-keyword">echo</span> <span class="hljs-variable">$e</span>-&gt;<span class="hljs-title function_ invoke__">getPrevious</span>()-&gt;<span class="hljs-title function_ invoke__">getMessage</span>() . PHP_EOL;
+ <span class="hljs-comment">// =&gt; Error 1</span>
+}</code></pre>
+
+ <p>
+ この知識を元に、トークンの出力部を解析してみる。
+ </p>
+ </section>
+
+ <section id="section--commentary--output">
+ <h3><a href="#section--commentary--output">出力部の解析</a></h3>
+ <p>
+ 出力部をコメントや改行を追加して再掲する:
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight"><span class="hljs-meta">&lt;?php</span>
+<span class="hljs-keyword">try</span> {
+ <span class="hljs-title function_ invoke__">f</span>(<span class="hljs-title function_ invoke__">g</span>() / <span class="hljs-keyword">__LINE__</span>);
+} <span class="hljs-keyword">catch</span> (<span class="hljs-built_in">Throwable</span> <span class="hljs-variable">$e</span>) {
+ <span class="hljs-keyword">while</span> (<span class="hljs-variable">$e</span> = <span class="hljs-variable">$e</span>-&gt;<span class="hljs-title function_ invoke__">getPrevious</span>()) {
+ <span class="hljs-title function_ invoke__">printf</span>(<span class="hljs-string">&#x27;%c&#x27;</span>, <span class="hljs-variable">$e</span>-&gt;<span class="hljs-title function_ invoke__">getLine</span>() + <span class="hljs-number">23</span>);
+ }
+ <span class="hljs-keyword">echo</span> <span class="hljs-string">&quot;\n&quot;</span>;
+}</code></pre>
+
+ <p>
+ 出力をおこなう <code>catch</code> 節を見てみると、 <code>Throwable::getPrevious()</code> を呼び出してエラーチェインを辿り、 <code>Throwable::getLine()</code> でエラーが発生した行数を取得している。その行数に <code>23</code> なるマジックナンバーを足し、フォーマット指定子 <code>%c</code> で出力している。
+ </p>
+
+ <p>
+ フォーマット指定子 <code>%c</code> は、整数を ASCII コード<span></span> と見做して印字する。トークン <code>#base64_decode(&apos;SGVsbG8sIFdvcmxkIQ==&apos;)</code> の <code>b</code> であれば、ASCII コード <code>98</code> なので、75 行目で発生したエラー、
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight"><span class="hljs-number">1</span>, <span class="hljs-number">20</span> =&gt; <span class="hljs-number">0</span> / <span class="hljs-number">0</span>,</code></pre>
+
+ <p>
+ によって表現されている。エラーを起こす方法はいろいろと考えられるが、今回はゼロ除算を使った。
+ </p>
+
+ <p>
+ それでは、エラーチェインを作る箇所、関数 <code>f()</code> を見ていく。
+ </p>
+ </section>
+
+ <section id="section--commentary--data-construction">
+ <h3><a href="#section--commentary--data-construction">データ構成部の解析</a></h3>
+ <p>
+ <code>f()</code> の定義を再掲する (エラーオブジェクトの行数を利用しているので、一部分だけ抜き出すと値が変わることに注意):
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">f</span>(<span class="hljs-params"><span class="hljs-keyword">int</span> <span class="hljs-variable">$i</span></span>) </span>{
+ <span class="hljs-keyword">if</span> (<span class="hljs-variable">$i</span> &lt; <span class="hljs-number">0</span>) <span class="hljs-title function_ invoke__">f</span>();
+ <span class="hljs-keyword">try</span> {
+ <span class="hljs-keyword">match</span> (<span class="hljs-variable">$i</span>) {
+ <span class="hljs-number">0</span> =&gt; <span class="hljs-number">0</span> / <span class="hljs-number">0</span>, <span class="hljs-comment">// 12 行目</span>
+
+
+
+ <span class="hljs-number">15</span>, <span class="hljs-number">36</span> =&gt; <span class="hljs-number">0</span> / <span class="hljs-number">0</span>,
+ <span class="hljs-number">14</span> =&gt; <span class="hljs-number">0</span> / <span class="hljs-number">0</span>,
+ <span class="hljs-number">37</span> =&gt; <span class="hljs-number">0</span> / <span class="hljs-number">0</span>,
+
+ <span class="hljs-comment">// (略)</span>
+
+ <span class="hljs-number">30</span> =&gt; <span class="hljs-number">0</span> / <span class="hljs-number">0</span>, <span class="hljs-comment">// 97 行目</span>
+ };
+ } <span class="hljs-keyword">finally</span> {
+ <span class="hljs-title function_ invoke__">f</span>(<span class="hljs-variable">$i</span> - <span class="hljs-number">1</span>);
+ }
+}</code></pre>
+
+ <p>
+ 前述のように、 <code>finally</code> 節でエラーを投げると PHP 処理系が <code>$previous</code> を設定する。ここでは、エラーを繋げるために <code>f()</code> を再帰呼び出ししている。最初に <code>f()</code> を呼び出している箇所を確認すると、
+ </p>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight"><span class="hljs-meta">&lt;?php</span>
+<span class="hljs-keyword">try</span> {
+ <span class="hljs-title function_ invoke__">f</span>(<span class="hljs-title function_ invoke__">g</span>() / <span class="hljs-keyword">__LINE__</span>); <span class="hljs-comment">// 3 行目</span></code></pre>
+
+ <pre class="highlight" language="php" linenumbering="unnumbered"><code class="highlight"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">g</span>(<span class="hljs-params"></span>) </span>{
+ <span class="hljs-keyword">return</span> <span class="hljs-keyword">__LINE__</span>; <span class="hljs-comment">// 111 行目</span>
+}</code></pre>
+
+ <p>
+ <code>f()</code> には <code>111 / 3</code> で <code>37</code> が渡されることがわかる。そこから 1 ずつ減らして再帰呼び出ししていき、0 より小さくなったら <code>f()</code> を引数なしで呼び出す。引数の数が足りないと呼び出しに失敗するので、再帰はここで止まる。
+ </p>
+
+ <p>
+ エラーチェインは、最後に発生したエラーを先頭とした単方向連結リストになっているので、順に
+ </p>
+
+ <ol numeration="arabic">
+ <li>
+ <code>f()</code> の引数が足りないことによる呼び出し失敗
+ </li>
+
+ <li>
+ <code>f(0)</code> の呼び出しで発生したゼロ除算
+ </li>
+
+ <li>
+ <code>f(1)</code> の呼び出しで発生したゼロ除算
+ </li>
+
+ <li>
+ …
+ </li>
+
+ <li>
+ <code>f(37)</code> の呼び出しで発生したゼロ除算
+ </li>
+ </ol>
+
+ <p>
+ となっている。出力の際は <code>catch</code> したエラーの <code>getPrevious()</code> から処理を始めるので、1 番目の <code>f()</code> によるエラーは無視され、 <code>f(0)</code> によるエラー、 <code>f(1)</code> によるエラー、 <code>f(2)</code> によるエラー、と出力が進む。
+ </p>
+
+ <p>
+ <code>f()</code> に <code>0</code> を渡したときは 12 行目にある <code>match</code> の <code>0</code> でゼロ除算が起こるので、行数が 12 となったエラーが投げられる。出力部ではこれに 23 を足した数を ASCII コードとして表示しているのだった。 <code>12 + 23</code> は <code>35</code>、ASCII コードでは <code>#</code> である。これがトークンの 1文字目にあたる。
+ </p>
+ </section>
+ </section>
+
+ <section id="section--outro">
+ <h2><a href="#section--outro">おわりに</a></h2>
+ <p>
+ 「行数」というのはトークン文字列をデコードする対象として優れている。
+ </p>
+
+ <ul>
+ <li>
+ トークンの一部や全部が陽に現れない
+ </li>
+
+ <li>
+ <code>__LINE__</code> で容易に取得できる
+ </li>
+ </ul>
+
+ <p>
+ しかし、こういった「変な」プログラムを何度も読んだり書いたりしていると、 <code>__LINE__</code> を使うのはあまりにありきたりで退屈になる。では、他に行数を取得する手段はないか。こうして <code>Throwable</code> を思いつき、続けてエラーオブジェクトには <code>$previous</code> があることを思い出した。
+ </p>
+
+ <p>
+ 今回エラーを投げるのにゼロ除算を用いたのは、それがエラーを投げる最も短いコードだと考えたからである。もし 3バイト未満で <code>Throwable</code> なオブジェクトを投げる手段をご存じのかたがいらっしゃれば、ぜひご教示いただきたい。……と締める予定だったのだが、<code>0/0</code> のところを存在しない定数にすれば、簡単に 1バイトを達成できた。ゼロ除算している箇所はちょうど 26 箇所あるので、アルファベットにでもしておけば意味ありげで良かったかもしれない。
+ </p>
+ </section>
+ </div>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/posts/2023-03-10/rewrite-this-blog-generator/index.html b/vhosts/blog/public/posts/2023-03-10/rewrite-this-blog-generator/index.html
new file mode 100644
index 00000000..12a8664a
--- /dev/null
+++ b/vhosts/blog/public/posts/2023-03-10/rewrite-this-blog-generator/index.html
@@ -0,0 +1,166 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2023 nsfisis">
+ <meta name="description" content="このブログのジェネレータを書き直したので、やったことを書き記しておく。">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>このブログのジェネレータを書き直した | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ <link rel="stylesheet" href="/hl.css?h=340e65ffd5c17713efc9107c06304f7b">
+ </head>
+ <body class="single">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <article class="post-single">
+ <header class="post-header">
+ <h1 class="post-title">このブログのジェネレータを書き直した</h1>
+ </header>
+ <div class="post-content">
+ <section>
+ <h2 id="changelog">更新履歴</h2>
+ <ol>
+ <li class="revision">
+ <time datetime="2023-03-10">2023-03-10</time>: 公開
+ </li>
+ </ol>
+ </section>
+ <section id="section--intro">
+ <h2><a href="#section--intro">はじめに</a></h2>
+ <p>
+ このブログを構築するシステムを書き直したのは 2度目である。 元々立ち上げた当初は、静的サイトジェネレータである <a href="https://gohugo.io/">Hugo</a> を使っていた。 それを <a href="https://asciidoctor.org/">Asciidoctor</a> にいくつかのカスタムを加えた自前のジェネレータに移行したのが 2022年の11月ごろだ。 そして今回、スクラッチから書いた <a href="https://deno.land/">Deno</a> 製のジェネレータに移行した。
+ </p>
+
+ <p>
+ この記事では、移行の理由などを (主に将来の私へ向けて) 書き記しておく。
+ </p>
+ </section>
+
+ <section id="section--from-hugo-to-asciidoctor">
+ <h2><a href="#section--from-hugo-to-asciidoctor">Hugo から Asciidoctor へ</a></h2>
+ <p>
+ 最初に断っておくと、Hugo は大変に優れた静的サイトジェネレータである。移行の理由の大半は、自分でジェネレータを書きたかったからに他ならない。 実のところ、この記事を執筆している現在、自作ジェネレータは Hugo よりも機能が劣っている。 例えば、Hugo を使っていたころはサポートしていた RSS フィードの生成は、まだ実装できていない。
+ </p>
+
+ <p>
+ 移行先のフォーマットとして AsciiDoc を選んだのは、Markdown よりも表現力に優れるからである。Markdown は広く使われている軽量マークアップ言語だが、以下のような欠点を持つ。
+ </p>
+
+ <p>
+ <ul>
+ <li>
+ CommonMark では機能が貧弱である (例: 脚注、<code>id</code> 属性の付与)
+ </li>
+
+ <li>
+ 拡張記法に実装間で互換性がない
+ </li>
+
+ <li>
+ メタデータ (公開日など) を埋め込む統一された方法がない
+ </li>
+ </ul>
+ </p>
+
+ <p>
+ AsciiDoc は Markdown に比べると普及していないが、上記の欠点は克服している。
+ </p>
+
+ <p>
+ <ul>
+ <li>
+ ブログを書くのに十分な表現力がある
+ </li>
+
+ <li>
+ フォーマットを拡張するときの記法があらかじめ定められている
+ </li>
+
+ <li>
+ メタデータを埋め込む統一された方法がある
+ </li>
+ </ul>
+ </p>
+
+ <p>
+ なお、Hugo は AsciiDoc もサポートしているのだが、AsciiDoc を使う場合 Asciidoctor を別途インストールする必要があり、それならば最初から Asciidoctor でよかろうと移行を決めた。
+ </p>
+ </section>
+
+ <section id="section--from-asciidoctor-to-my-own-generator">
+ <h2><a href="#section--from-asciidoctor-to-my-own-generator">Asciidoctor から自前のジェネレータへ</a></h2>
+ <p>
+ AsciiDoc は良いフォーマットだが、私には 1点不満があった。それは、高い表現力を担保するために記号が使い倒されており、エスケープが難しいという点だ (具体例を挙げたいのだが、何だったか覚えていない)。これは、多種多様な記号類を入力する必要のある技術ブログにとっては辛い問題である。この問題を解決するため、
+ <ul>
+ <li>
+ 表現力が高く、
+ </li>
+
+ <li>
+ 文法が厳密であり、
+ </li>
+
+ <li>
+ 簡単に実装できる
+ </li>
+ </ul>
+ フォーマットが求められた。これに合致したのが、XML をベースとする <a href="https://docbook.org/">DocBook</a> (今回使っているのは、そのサブセットである <a href="https://tdg.docbook.org/tdg/sdocbook/5.1/">Simplified DocBook</a>) である。
+ </p>
+
+ <p>
+ 実は、AsciiDoc と DocBook はおおよそ互換性がある。AsciiDoc で書かれた文書は (ほぼ) 情報ロスなしに DocBook へ変換でき、逆もまたしかりである。 よって、DocBook には、AsciiDoc と同等の表現力がある。
+ </p>
+
+ <p>
+ XML の文法の厳密さについては、説明するまでもないだろう。また、単純な文法であることから実装が容易であり、事実上 Asciidoctor へロックインされる AsciiDoc とは異なり、さまざまな言語で多くのライブラリが存在する。
+ </p>
+
+ <p>
+ 今回は、XML のパース自体も自分で書いている (これは何となく書きたかったからであり、合理的な理由があるわけではない。実装はサボりまくっているので XML のコメントが使えないといった制限がある)。
+ </p>
+
+ <p>
+ XML という機械処理しやすいフォーマットを選ぶことには、機械的な変換や検査といった処理がおこないやすくなるといった利点もある。 欠点は軽量マークアップ言語と比べて冗長であることだが、書く際は補完などを用いるのでそれほど気にならない。 結局のところ、技術ブログの執筆を律速するのは調査と文章の記述であり、マークアップの手段は執筆時間に大した影響を与えない。
+ </p>
+ </section>
+
+ <section id="section--outro">
+ <h2><a href="#section--outro">おわりに</a></h2>
+ <p>
+ 2度のリライトを経て、記事のフォーマットとサイトジェネレータを上から下まで掌握した。 今後も改善のアイデアは多数あるので、じわじわと進めていきたいところだ。
+ </p>
+
+ <p>
+ 最後にもう一度書くのだが、Hugo は大変に優れた静的サイトジェネレータである。 無駄な拘りがなければこれを使うとよい。 私は無駄に拘ったので、ブログの記事を書く時間を潰してブログシステムを作ってしまった。
+ </p>
+ </section>
+ </div>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/posts/2023-04-01/implementation-of-minimal-png-image-encoder/index.html b/vhosts/blog/public/posts/2023-04-01/implementation-of-minimal-png-image-encoder/index.html
new file mode 100644
index 00000000..547191b9
--- /dev/null
+++ b/vhosts/blog/public/posts/2023-04-01/implementation-of-minimal-png-image-encoder/index.html
@@ -0,0 +1,745 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2023 nsfisis">
+ <meta name="description" content="PNG 画像として valid な範囲で最大限手抜きしたエンコーダを書く。">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>PNG 画像の最小構成エンコーダを実装する | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ <link rel="stylesheet" href="/hl.css?h=340e65ffd5c17713efc9107c06304f7b">
+ </head>
+ <body class="single">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <article class="post-single">
+ <header class="post-header">
+ <h1 class="post-title">PNG 画像の最小構成エンコーダを実装する</h1>
+ </header>
+ <div class="post-content">
+ <section>
+ <h2 id="changelog">更新履歴</h2>
+ <ol>
+ <li class="revision">
+ <time datetime="2023-04-01">2023-04-01</time>: 公開
+ </li>
+ </ol>
+ </section>
+ <section id="section--intro">
+ <h2><a href="#section--intro">はじめに</a></h2>
+ <p>
+ この記事では、PNG 画像として valid な範囲で最大限手抜きしたエンコーダを書く。 PNG 画像に対応したビューアであれば読み込めるが、圧縮効率については一切考えない。 また、実装には Go 言語を使うが、Go の標準ライブラリにあるさまざまなアルゴリズム (PNG 画像に関係する範囲だと、zlib や CRC32、Adler-32 など) は使わない。
+ </p>
+ </section>
+
+ <section id="section--basic-structure-of-png">
+ <h2><a href="#section--basic-structure-of-png">PNG ファイルの基本構造</a></h2>
+ <p>
+ PNG ファイルの基本構造は次のようになっている。
+ </p>
+
+ <ol>
+ <li>
+ PNG signature
+ </li>
+
+ <li>
+ IHDR chunk
+ </li>
+
+ <li>
+ 任意個の chunk
+ </li>
+
+ <li>
+ IEND chunk
+ </li>
+ </ol>
+
+ <p>
+ Chunk には画像データを入れる IDAT chunk、パレットデータを入れる PLTE chunk、テキストデータを入れる tEXt chunk などがあるが、 今回は最小構成ということで IDAT chunk (と IHDR chunk と IEND chunk) のみを用いる。
+ </p>
+
+ <p>
+ 次節で、それぞれの具体的な構造を確認しつつ実装していく。
+ </p>
+ </section>
+
+ <section id="section--implement-png-encoder">
+ <h2><a href="#section--implement-png-encoder">PNG のエンコーダを実装する</a></h2>
+ <p>
+ 以下のソースコードをベースにする。 今回 PNG のデコーダは扱わないので、読み込みには Go の標準ライブラリ <code>image/png</code> を用いる。
+ </p>
+
+ <pre class="highlight" language="go" linenumbering="unnumbered"><code class="highlight"><span class="hljs-keyword">package</span> main
+
+<span class="hljs-keyword">import</span> (
+ <span class="hljs-string">&quot;image&quot;</span>
+ _ <span class="hljs-string">&quot;image/png&quot;</span>
+ <span class="hljs-string">&quot;io&quot;</span>
+ <span class="hljs-string">&quot;os&quot;</span>
+)
+
+<span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {
+ inFile, err := os.Open(<span class="hljs-string">&quot;input.png&quot;</span>)
+ <span class="hljs-keyword">if</span> err != <span class="hljs-literal">nil</span> {
+ <span class="hljs-built_in">panic</span>(err)
+ }
+ <span class="hljs-keyword">defer</span> inFile.Close()
+
+ img, _, err := image.Decode(inFile)
+ <span class="hljs-keyword">if</span> err != <span class="hljs-literal">nil</span> {
+ <span class="hljs-built_in">panic</span>(err)
+ }
+
+ outFile, err := os.Create(<span class="hljs-string">&quot;output.png&quot;</span>)
+ <span class="hljs-keyword">if</span> err != <span class="hljs-literal">nil</span> {
+ <span class="hljs-built_in">panic</span>(err)
+ }
+ <span class="hljs-keyword">defer</span> outFile.Close()
+
+ writePng(outFile, img)
+}
+
+<span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">writePng</span><span class="hljs-params">(w io.Writer, img image.Image)</span></span> {
+ width := <span class="hljs-type">uint32</span>(img.Bounds().Dx())
+ height := <span class="hljs-type">uint32</span>(img.Bounds().Dy())
+ writeSignature(w)
+ writeChunkIhdr(w, width, height)
+ writeChunkIdat(w, width, height, img)
+ writeChunkIend(w)
+}</code></pre>
+
+ <p>
+ 以降は、<code>writeSignature</code> や <code>writeChunkIhdr</code> などを実装していく。
+ </p>
+
+ <section id="section--implement-png-encoder--png-signature">
+ <h3><a href="#section--implement-png-encoder--png-signature">PNG signature</a></h3>
+ <p>
+ PNG signature は、PNG 画像の先頭に固定で付与されるバイト列で、8 バイトからなる。
+ </p>
+
+ <ol>
+ <li>
+ 0x89
+ </li>
+
+ <li>
+ 0x50 (ASCII コードで「P」)
+ </li>
+
+ <li>
+ 0x4E (ASCII コードで「N」)
+ </li>
+
+ <li>
+ 0x47 (ASCII コードで「G」)
+ </li>
+
+ <li>
+ 0x0D (ASCII コードで CR)
+ </li>
+
+ <li>
+ 0x0A (ASCII コードで LF)
+ </li>
+
+ <li>
+ 0x1A (ASCII コードで EOF)
+ </li>
+
+ <li>
+ 0x0A (ASCII コードで LF)
+ </li>
+ </ol>
+
+ <p>
+ CRLF や LF は、送信中に改行コードの変換が誤っておこなわれていないかどうかを検知するのに使われる。
+ </p>
+
+ <p>
+ <code>writeSignature</code> の実装はこちら:
+ </p>
+
+ <pre class="highlight" language="go" linenumbering="unnumbered"><code class="highlight"><span class="hljs-keyword">import</span> <span class="hljs-string">&quot;encoding/binary&quot;</span>
+
+<span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">writeSignature</span><span class="hljs-params">(w io.Writer)</span></span> {
+ sig := [<span class="hljs-number">8</span>]<span class="hljs-type">uint8</span>{
+ <span class="hljs-number">0x89</span>,
+ <span class="hljs-number">0x50</span>, <span class="hljs-comment">// P</span>
+ <span class="hljs-number">0x4E</span>, <span class="hljs-comment">// N</span>
+ <span class="hljs-number">0x47</span>, <span class="hljs-comment">// G</span>
+ <span class="hljs-number">0x0D</span>, <span class="hljs-comment">// CR</span>
+ <span class="hljs-number">0x0A</span>, <span class="hljs-comment">// LF</span>
+ <span class="hljs-number">0x1A</span>, <span class="hljs-comment">// EOF (^Z)</span>
+ <span class="hljs-number">0x0A</span>, <span class="hljs-comment">// LF</span>
+ }
+ binary.Write(w, binary.BigEndian, sig)
+}</code></pre>
+
+ <p>
+ <code>encoding/binary</code> パッケージの <code>binary.Write</code> を使い、固定の 8 バイトを書き込む。
+ </p>
+ </section>
+
+ <section id="section--implement-png-encoder--structure-of-chunk">
+ <h3><a href="#section--implement-png-encoder--structure-of-chunk">Chunk の構造</a></h3>
+ <p>
+ IHDR chunk に進む前に、chunk 一般の構造を確認する。
+ </p>
+
+ <ol>
+ <li>
+ Length: chunk data のバイト長 (符号なし 4 バイト整数)
+ </li>
+
+ <li>
+ Chunk type: chunk の種類を示す 4 バイトからなる名前
+ </li>
+
+ <li>
+ Chunk data: 実際のデータ。0 バイトでもよい
+ </li>
+
+ <li>
+ CRC: chunk type と chunk data の CRC (符号なし 4 バイト整数)
+ </li>
+ </ol>
+
+ <p>
+ CRC (Cyclic Redundancy Check) は誤り検出符号の一種。Go 言語では <code>hash/crc32</code> パッケージにあるが、今回はこれも自前で実装する。PNG の仕様書に C 言語のサンプルコードが載っている (<a href="https://www.w3.org/TR/png/#D-CRCAppendix">D. Sample CRC implementation</a>) ので、これを Go に移植する。
+ </p>
+
+ <pre class="highlight" language="go" linenumbering="unnumbered"><code class="highlight"><span class="hljs-keyword">var</span> (
+ crcTable [<span class="hljs-number">256</span>]<span class="hljs-type">uint32</span>
+ crcTableComputed <span class="hljs-type">bool</span>
+)
+
+<span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">makeCrcTable</span><span class="hljs-params">()</span></span> {
+ <span class="hljs-keyword">for</span> n := <span class="hljs-number">0</span>; n &lt; <span class="hljs-number">256</span>; n++ {
+ c := <span class="hljs-type">uint32</span>(n)
+ <span class="hljs-keyword">for</span> k := <span class="hljs-number">0</span>; k &lt; <span class="hljs-number">8</span>; k++ {
+ <span class="hljs-keyword">if</span> (c &amp; <span class="hljs-number">1</span>) != <span class="hljs-number">0</span> {
+ c = <span class="hljs-number">0xEDB88320</span> ^ (c &gt;&gt; <span class="hljs-number">1</span>)
+ } <span class="hljs-keyword">else</span> {
+ c = c &gt;&gt; <span class="hljs-number">1</span>
+ }
+ }
+ crcTable[n] = c
+ }
+ crcTableComputed = <span class="hljs-literal">true</span>
+}
+
+<span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">updateCrc</span><span class="hljs-params">(crc <span class="hljs-type">uint32</span>, buf []<span class="hljs-type">byte</span>)</span></span> <span class="hljs-type">uint32</span> {
+ <span class="hljs-keyword">if</span> !crcTableComputed {
+ makeCrcTable()
+ }
+
+ c := crc
+ <span class="hljs-keyword">for</span> n := <span class="hljs-number">0</span>; n &lt; <span class="hljs-built_in">len</span>(buf); n++ {
+ c = crcTable[(c^<span class="hljs-type">uint32</span>(buf[n]))&amp;<span class="hljs-number">0xFF</span>] ^ (c &gt;&gt; <span class="hljs-number">8</span>)
+ }
+ <span class="hljs-keyword">return</span> c
+}
+
+<span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">crc</span><span class="hljs-params">(buf []<span class="hljs-type">byte</span>)</span></span> <span class="hljs-type">uint32</span> {
+ <span class="hljs-keyword">return</span> updateCrc(<span class="hljs-number">0xFFFFFFFF</span>, buf) ^ <span class="hljs-number">0xFFFFFFFF</span>
+}</code></pre>
+
+ <p>
+ できた <code>crc</code> 関数を使って、chunk 一般を書き込む関数も用意しておこう。
+ </p>
+
+ <pre class="highlight" language="go" linenumbering="unnumbered"><code class="highlight"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">writeChunk</span><span class="hljs-params">(w io.Writer, chunkType <span class="hljs-type">string</span>, data []<span class="hljs-type">byte</span>)</span></span> {
+ typeAndData := <span class="hljs-built_in">make</span>([]<span class="hljs-type">byte</span>, <span class="hljs-number">0</span>, <span class="hljs-built_in">len</span>(chunkType)+<span class="hljs-built_in">len</span>(data))
+ typeAndData = <span class="hljs-built_in">append</span>(typeAndData, []<span class="hljs-type">byte</span>(chunkType)...)
+ typeAndData = <span class="hljs-built_in">append</span>(typeAndData, data...)
+
+ binary.Write(w, binary.BigEndian, <span class="hljs-type">uint32</span>(<span class="hljs-built_in">len</span>(data)))
+ binary.Write(w, binary.BigEndian, typeAndData)
+ binary.Write(w, binary.BigEndian, crc(typeAndData))
+}</code></pre>
+
+ <p>
+ 仕様どおり、<code>chunkType</code> と <code>data</code> から CRC を計算し、<code>data</code> の長さと合わせて書き込んでいる。 PNG では基本的に big endian を使うことに注意する。
+ </p>
+
+ <p>
+ 準備ができたところで、具体的な chunk をエンコードしていく。
+ </p>
+ </section>
+
+ <section id="section--implement-png-encoder--ihdr-chunk">
+ <h3><a href="#section--implement-png-encoder--ihdr-chunk">IHDR chunk</a></h3>
+ <p>
+ IHDR chunk は最初に配置される chunk である。次のようなデータからなる。
+ </p>
+
+ <ol>
+ <li>
+ 画像の幅 (符号なし 4 バイト整数)
+ </li>
+
+ <li>
+ 画像の高さ (符号なし 4 バイト整数)
+ </li>
+
+ <li>
+ ビット深度 (符号なし 1 バイト整数)
+ <ul>
+ <li>
+ 1 色に使うビット数。1 ピクセルに 24 bit 使う truecolor 画像では 8 になる
+ </li>
+ </ul>
+ </li>
+
+ <li>
+ 色タイプ (符号なし 1 バイト整数)
+ <ul>
+ <li>
+ 0: グレースケール
+ </li>
+
+ <li>
+ 2: Truecolor (今回はこれに決め打ち)
+ </li>
+
+ <li>
+ 3: パレットのインデックス
+ </li>
+
+ <li>
+ 4: グレースケール + アルファ
+ </li>
+
+ <li>
+ 6: Truecolor + アルファ
+ </li>
+ </ul>
+ </li>
+
+ <li>
+ 圧縮方式 (符号なし 1 バイト整数)
+ <ul>
+ PNG の仕様書に 0 しか定義されていないので 0 で固定
+ </ul>
+ </li>
+
+ <li>
+ フィルタ方式 (符号なし 1 バイト整数)
+ <ul>
+ PNG の仕様書に 0 しか定義されていないので 0 で固定
+ </ul>
+ </li>
+
+ <li>
+ インターレース方式 (符号なし 1 バイト整数)
+ <ul>
+ 今回はインターレースしないので 0
+ </ul>
+ </li>
+ </ol>
+
+ <p>
+ 今回ほとんどのデータは決め打ちするので、データに応じて変わるのは width と height だけになる。コードは次のようになる。
+ </p>
+
+ <pre class="highlight" language="go" linenumbering="unnumbered"><code class="highlight"><span class="hljs-keyword">import</span> <span class="hljs-string">&quot;bytes&quot;</span>
+
+<span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">writeChunkIhdr</span><span class="hljs-params">(w io.Writer, width, height <span class="hljs-type">uint32</span>)</span></span> {
+ <span class="hljs-keyword">var</span> buf bytes.Buffer
+ binary.Write(&amp;buf, binary.BigEndian, width)
+ binary.Write(&amp;buf, binary.BigEndian, height)
+ binary.Write(&amp;buf, binary.BigEndian, <span class="hljs-type">uint8</span>(<span class="hljs-number">8</span>))
+ binary.Write(&amp;buf, binary.BigEndian, <span class="hljs-type">uint8</span>(<span class="hljs-number">2</span>))
+ binary.Write(&amp;buf, binary.BigEndian, <span class="hljs-type">uint8</span>(<span class="hljs-number">0</span>))
+ binary.Write(&amp;buf, binary.BigEndian, <span class="hljs-type">uint8</span>(<span class="hljs-number">0</span>))
+ binary.Write(&amp;buf, binary.BigEndian, <span class="hljs-type">uint8</span>(<span class="hljs-number">0</span>))
+
+ writeChunk(w, <span class="hljs-string">&quot;IHDR&quot;</span>, buf.Bytes())
+}</code></pre>
+ </section>
+
+ <section id="section--implement-png-encoder--idat-chunk">
+ <h3><a href="#section--implement-png-encoder--idat-chunk">IDAT chunk</a></h3>
+ <p>
+ IDAT chunk は、実際の画像データが格納された chunk である。IDAT chunk は deflate アルゴリズムにより圧縮され、zlib 形式で格納される。
+ </p>
+
+ <section id="section--implement-png-encoder--idat-chunk--zlib">
+ <h4><a href="#section--implement-png-encoder--idat-chunk--zlib">Zlib</a></h4>
+ <p>
+ まずは zlib について確認する。おおよそ次のような構造になっている。
+ </p>
+
+ <ol>
+ <li>
+ 固定で 0x78 (符号なし 1 バイト整数)
+ </li>
+
+ <li>
+ 固定で 0x01 (符号なし 1 バイト整数)
+ </li>
+
+ <li>
+ データ
+ </li>
+
+ <li>
+ データの Adler-32
+ </li>
+ </ol>
+
+ <p>
+ 最初の 2 バイトにも意味はあるが、PNG では固定で構わない。
+ </p>
+
+ <p>
+ Adler-32 も CRC と同じく誤り検出符号である。こちらも zlib の仕様書に C 言語でサンプルコードが記載されている (<a href="https://www.rfc-editor.org/rfc/rfc1950#section-9">9. Appendix: Sample code</a>) ので、Go に移植する。
+ </p>
+
+ <pre class="highlight" language="go" linenumbering="unnumbered"><code class="highlight"><span class="hljs-keyword">const</span> adler32Base = <span class="hljs-number">65521</span>
+
+<span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">updateAdler32</span><span class="hljs-params">(adler <span class="hljs-type">uint32</span>, buf []<span class="hljs-type">byte</span>)</span></span> <span class="hljs-type">uint32</span> {
+ s1 := adler &amp; <span class="hljs-number">0xFFFF</span>
+ s2 := (adler &gt;&gt; <span class="hljs-number">16</span>) &amp; <span class="hljs-number">0xFFFF</span>
+
+ <span class="hljs-keyword">for</span> n := <span class="hljs-number">0</span>; n &lt; <span class="hljs-built_in">len</span>(buf); n++ {
+ s1 = (s1 + <span class="hljs-type">uint32</span>(buf[n])) % adler32Base
+ s2 = (s2 + s1) % adler32Base
+ }
+ <span class="hljs-keyword">return</span> (s2 &lt;&lt; <span class="hljs-number">16</span>) + s1
+}
+
+<span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">adler32</span><span class="hljs-params">(buf []<span class="hljs-type">byte</span>)</span></span> <span class="hljs-type">uint32</span> {
+ <span class="hljs-keyword">return</span> updateAdler32(<span class="hljs-number">1</span>, buf)
+}</code></pre>
+
+ <p>
+ 「データ」の部分には圧縮したデータが入るのだが、真面目に deflate アルゴリズムを実装する必要はない。Zlib には無圧縮のデータブロックを格納することができるので、これを使う。本来は、データの圧縮効率の悪いランダムなデータをそのまま格納するためのものだが、今回は deflate の実装をサボるために使う。
+ </p>
+
+ <p>
+ 1 つの無圧縮ブロックには 65535 (2<sup>16</sup> - 1) バイトまで格納できる。それぞれのブロックは次のような構成になっている。
+ </p>
+
+ <ol>
+ <li>
+ 最終ブロックなら 1、そうでなければ 0 (符号なし 1 バイト整数)
+ </li>
+
+ <li>
+ ブロックのバイト長 (符号なし 2 バイト整数)
+ </li>
+
+ <li>
+ ブロックのバイト長の 1 の補数、あるいはビット反転 (符号なし 2 バイト整数)
+ </li>
+
+ <li>
+ データ (最大 65535 バイト)
+ </li>
+ </ol>
+
+ <p>
+ 実際にこの手抜き zlib を実装したものがこちら:
+ </p>
+
+ <pre class="highlight" language="go" linenumbering="unnumbered"><code class="highlight"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">encodeZlib</span><span class="hljs-params">(data []<span class="hljs-type">byte</span>)</span></span> []<span class="hljs-type">byte</span> {
+ <span class="hljs-keyword">var</span> buf bytes.Buffer
+
+ binary.Write(&amp;buf, binary.BigEndian, <span class="hljs-type">uint8</span>(<span class="hljs-number">0x78</span>))
+ binary.Write(&amp;buf, binary.BigEndian, <span class="hljs-type">uint8</span>(<span class="hljs-number">0x01</span>))
+ blockSize := <span class="hljs-number">65535</span>
+ isFinalBlock := <span class="hljs-literal">false</span>
+ <span class="hljs-keyword">for</span> i := <span class="hljs-number">0</span>; !isFinalBlock; i++ {
+ <span class="hljs-keyword">var</span> block []<span class="hljs-type">byte</span>
+ <span class="hljs-keyword">if</span> <span class="hljs-built_in">len</span>(data) &lt;= (i+<span class="hljs-number">1</span>)*blockSize {
+ block = data[i*blockSize:]
+ isFinalBlock = <span class="hljs-literal">true</span>
+ } <span class="hljs-keyword">else</span> {
+ block = data[i*blockSize : (i+<span class="hljs-number">1</span>)*blockSize]
+ }
+ binary.Write(&amp;buf, binary.BigEndian, isFinalBlock)
+ binary.Write(&amp;buf, binary.LittleEndian, <span class="hljs-type">uint16</span>(<span class="hljs-built_in">len</span>(block)))
+ binary.Write(&amp;buf, binary.LittleEndian, <span class="hljs-type">uint16</span>(^<span class="hljs-built_in">len</span>(block)))
+ binary.Write(&amp;buf, binary.LittleEndian, block)
+ }
+ binary.Write(&amp;buf, binary.BigEndian, adler32(data))
+
+ <span class="hljs-keyword">return</span> buf.Bytes()
+}</code></pre>
+ </section>
+
+ <section id="section--implement-png-encoder--idat-chunk--image-data">
+ <h4><a href="#section--implement-png-encoder--idat-chunk--image-data">画像データ</a></h4>
+ <p>
+ では次に、zlib 形式で格納するデータを用意する。PNG 画像は次のような順にスキャンする。 画像の左上のピクセルから同じ行を横にスキャンしていき、一番右まで到達したら次の行の左に向かう。 右下のピクセルまで行けば終わり。要は Z 字型に進んでいく。
+ </p>
+
+ <p>
+ また、それぞれの行の先頭には、圧縮のためのフィルタタイプを指定する。 ただ、今回はその実装を省略するために、常にフィルタ 0 (何も加工しない) を使う。
+ </p>
+
+ <p>
+ 先ほどの <code>encodeZlib</code> も使って実際に実装したものがこちら:
+ </p>
+
+ <pre class="highlight" language="go" linenumbering="unnumbered"><code class="highlight"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">writeChunkIdat</span><span class="hljs-params">(w io.Writer, width, height <span class="hljs-type">uint32</span>, img image.Image)</span></span> {
+ <span class="hljs-keyword">var</span> pixels bytes.Buffer
+ <span class="hljs-keyword">for</span> y := <span class="hljs-type">uint32</span>(<span class="hljs-number">0</span>); y &lt; height; y++ {
+ binary.Write(&amp;pixels, binary.BigEndian, <span class="hljs-type">uint8</span>(<span class="hljs-number">0</span>))
+ <span class="hljs-keyword">for</span> x := <span class="hljs-type">uint32</span>(<span class="hljs-number">0</span>); x &lt; width; x++ {
+ r, g, b, _ := img.At(<span class="hljs-type">int</span>(x), <span class="hljs-type">int</span>(y)).RGBA()
+ binary.Write(&amp;pixels, binary.BigEndian, <span class="hljs-type">uint8</span>(r))
+ binary.Write(&amp;pixels, binary.BigEndian, <span class="hljs-type">uint8</span>(g))
+ binary.Write(&amp;pixels, binary.BigEndian, <span class="hljs-type">uint8</span>(b))
+ }
+ }
+
+ writeChunk(w, <span class="hljs-string">&quot;IDAT&quot;</span>, encodeZlib(pixels.Bytes()))
+}</code></pre>
+ </section>
+ </section>
+
+ <section id="section--implement-png-encoder--iend-chunk">
+ <h3><a href="#section--implement-png-encoder--iend-chunk">IEND chunk</a></h3>
+ <p>
+ 最後に IEND chunk を書き込む。これは PNG 画像の最後に配置される chunk で、PNG のデコーダはこの chunk に出会うとそこでデコードを停止する。
+ </p>
+
+ <p>
+ 特に追加のデータはなく、必要なのは chunk type の <code>IEND</code> くらいなので実装は簡単:
+ </p>
+
+ <pre class="highlight" language="go" linenumbering="unnumbered"><code class="highlight"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">writeChunkIend</span><span class="hljs-params">(w io.Writer)</span></span> {
+ writeChunk(w, <span class="hljs-string">&quot;IEND&quot;</span>, <span class="hljs-literal">nil</span>)
+}</code></pre>
+ </section>
+ </section>
+
+ <section id="section--outro">
+ <h2><a href="#section--outro">おわりに</a></h2>
+ <p>
+ 最後に全ソースコードを再掲しておく。
+ </p>
+
+ <pre class="highlight" language="go" linenumbering="unnumbered"><code class="highlight"><span class="hljs-keyword">package</span> main
+
+<span class="hljs-keyword">import</span> (
+ <span class="hljs-string">&quot;bytes&quot;</span>
+ <span class="hljs-string">&quot;encoding/binary&quot;</span>
+ <span class="hljs-string">&quot;image&quot;</span>
+ _ <span class="hljs-string">&quot;image/png&quot;</span>
+ <span class="hljs-string">&quot;io&quot;</span>
+ <span class="hljs-string">&quot;os&quot;</span>
+)
+
+<span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {
+ inFile, err := os.Open(<span class="hljs-string">&quot;input.png&quot;</span>)
+ <span class="hljs-keyword">if</span> err != <span class="hljs-literal">nil</span> {
+ <span class="hljs-built_in">panic</span>(err)
+ }
+ <span class="hljs-keyword">defer</span> inFile.Close()
+
+ img, _, err := image.Decode(inFile)
+ <span class="hljs-keyword">if</span> err != <span class="hljs-literal">nil</span> {
+ <span class="hljs-built_in">panic</span>(err)
+ }
+
+ outFile, err := os.Create(<span class="hljs-string">&quot;output.png&quot;</span>)
+ <span class="hljs-keyword">if</span> err != <span class="hljs-literal">nil</span> {
+ <span class="hljs-built_in">panic</span>(err)
+ }
+ <span class="hljs-keyword">defer</span> outFile.Close()
+
+ writePng(outFile, img)
+}
+
+<span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">writePng</span><span class="hljs-params">(w io.Writer, img image.Image)</span></span> {
+ width := <span class="hljs-type">uint32</span>(img.Bounds().Dx())
+ height := <span class="hljs-type">uint32</span>(img.Bounds().Dy())
+ writeSignature(w)
+ writeChunkIhdr(w, width, height)
+ writeChunkIdat(w, width, height, img)
+ writeChunkIend(w)
+}
+
+<span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">writeSignature</span><span class="hljs-params">(w io.Writer)</span></span> {
+ sig := [<span class="hljs-number">8</span>]<span class="hljs-type">uint8</span>{
+ <span class="hljs-number">0x89</span>,
+ <span class="hljs-number">0x50</span>, <span class="hljs-comment">// P</span>
+ <span class="hljs-number">0x4E</span>, <span class="hljs-comment">// N</span>
+ <span class="hljs-number">0x47</span>, <span class="hljs-comment">// G</span>
+ <span class="hljs-number">0x0D</span>, <span class="hljs-comment">// CR</span>
+ <span class="hljs-number">0x0A</span>, <span class="hljs-comment">// LF</span>
+ <span class="hljs-number">0x1A</span>, <span class="hljs-comment">// EOF (^Z)</span>
+ <span class="hljs-number">0x0A</span>, <span class="hljs-comment">// LF</span>
+ }
+ binary.Write(w, binary.BigEndian, sig)
+}
+
+<span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">writeChunkIhdr</span><span class="hljs-params">(w io.Writer, width, height <span class="hljs-type">uint32</span>)</span></span> {
+ <span class="hljs-keyword">var</span> buf bytes.Buffer
+ binary.Write(&amp;buf, binary.BigEndian, width)
+ binary.Write(&amp;buf, binary.BigEndian, height)
+ binary.Write(&amp;buf, binary.BigEndian, <span class="hljs-type">uint8</span>(<span class="hljs-number">8</span>))
+ binary.Write(&amp;buf, binary.BigEndian, <span class="hljs-type">uint8</span>(<span class="hljs-number">2</span>))
+ binary.Write(&amp;buf, binary.BigEndian, <span class="hljs-type">uint8</span>(<span class="hljs-number">0</span>))
+ binary.Write(&amp;buf, binary.BigEndian, <span class="hljs-type">uint8</span>(<span class="hljs-number">0</span>))
+ binary.Write(&amp;buf, binary.BigEndian, <span class="hljs-type">uint8</span>(<span class="hljs-number">0</span>))
+
+ writeChunk(w, <span class="hljs-string">&quot;IHDR&quot;</span>, buf.Bytes())
+}
+
+<span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">writeChunkIdat</span><span class="hljs-params">(w io.Writer, width, height <span class="hljs-type">uint32</span>, img image.Image)</span></span> {
+ <span class="hljs-keyword">var</span> pixels bytes.Buffer
+ <span class="hljs-keyword">for</span> y := <span class="hljs-type">uint32</span>(<span class="hljs-number">0</span>); y &lt; height; y++ {
+ binary.Write(&amp;pixels, binary.BigEndian, <span class="hljs-type">uint8</span>(<span class="hljs-number">0</span>))
+ <span class="hljs-keyword">for</span> x := <span class="hljs-type">uint32</span>(<span class="hljs-number">0</span>); x &lt; width; x++ {
+ r, g, b, _ := img.At(<span class="hljs-type">int</span>(x), <span class="hljs-type">int</span>(y)).RGBA()
+ binary.Write(&amp;pixels, binary.BigEndian, <span class="hljs-type">uint8</span>(r))
+ binary.Write(&amp;pixels, binary.BigEndian, <span class="hljs-type">uint8</span>(g))
+ binary.Write(&amp;pixels, binary.BigEndian, <span class="hljs-type">uint8</span>(b))
+ }
+ }
+
+ writeChunk(w, <span class="hljs-string">&quot;IDAT&quot;</span>, encodeZlib(pixels.Bytes()))
+}
+
+<span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">encodeZlib</span><span class="hljs-params">(data []<span class="hljs-type">byte</span>)</span></span> []<span class="hljs-type">byte</span> {
+ <span class="hljs-keyword">var</span> buf bytes.Buffer
+
+ binary.Write(&amp;buf, binary.BigEndian, <span class="hljs-type">uint8</span>(<span class="hljs-number">0x78</span>))
+ binary.Write(&amp;buf, binary.BigEndian, <span class="hljs-type">uint8</span>(<span class="hljs-number">0x01</span>))
+ blockSize := <span class="hljs-number">65535</span>
+ isFinalBlock := <span class="hljs-literal">false</span>
+ <span class="hljs-keyword">for</span> i := <span class="hljs-number">0</span>; !isFinalBlock; i++ {
+ <span class="hljs-keyword">var</span> block []<span class="hljs-type">byte</span>
+ <span class="hljs-keyword">if</span> <span class="hljs-built_in">len</span>(data) &lt;= (i+<span class="hljs-number">1</span>)*blockSize {
+ block = data[i*blockSize:]
+ isFinalBlock = <span class="hljs-literal">true</span>
+ } <span class="hljs-keyword">else</span> {
+ block = data[i*blockSize : (i+<span class="hljs-number">1</span>)*blockSize]
+ }
+ binary.Write(&amp;buf, binary.BigEndian, isFinalBlock)
+ binary.Write(&amp;buf, binary.LittleEndian, <span class="hljs-type">uint16</span>(<span class="hljs-built_in">len</span>(block)))
+ binary.Write(&amp;buf, binary.LittleEndian, <span class="hljs-type">uint16</span>(^<span class="hljs-built_in">len</span>(block)))
+ binary.Write(&amp;buf, binary.LittleEndian, block)
+ }
+ binary.Write(&amp;buf, binary.BigEndian, adler32(data))
+
+ <span class="hljs-keyword">return</span> buf.Bytes()
+}
+
+<span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">writeChunkIend</span><span class="hljs-params">(w io.Writer)</span></span> {
+ writeChunk(w, <span class="hljs-string">&quot;IEND&quot;</span>, <span class="hljs-literal">nil</span>)
+}
+
+<span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">writeChunk</span><span class="hljs-params">(w io.Writer, chunkType <span class="hljs-type">string</span>, data []<span class="hljs-type">byte</span>)</span></span> {
+ typeAndData := <span class="hljs-built_in">make</span>([]<span class="hljs-type">byte</span>, <span class="hljs-number">0</span>, <span class="hljs-built_in">len</span>(chunkType)+<span class="hljs-built_in">len</span>(data))
+ typeAndData = <span class="hljs-built_in">append</span>(typeAndData, []<span class="hljs-type">byte</span>(chunkType)...)
+ typeAndData = <span class="hljs-built_in">append</span>(typeAndData, data...)
+
+ binary.Write(w, binary.BigEndian, <span class="hljs-type">uint32</span>(<span class="hljs-built_in">len</span>(data)))
+ binary.Write(w, binary.BigEndian, typeAndData)
+ binary.Write(w, binary.BigEndian, crc(typeAndData))
+}
+
+<span class="hljs-keyword">var</span> (
+ crcTable [<span class="hljs-number">256</span>]<span class="hljs-type">uint32</span>
+ crcTableComputed <span class="hljs-type">bool</span>
+)
+
+<span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">makeCrcTable</span><span class="hljs-params">()</span></span> {
+ <span class="hljs-keyword">for</span> n := <span class="hljs-number">0</span>; n &lt; <span class="hljs-number">256</span>; n++ {
+ c := <span class="hljs-type">uint32</span>(n)
+ <span class="hljs-keyword">for</span> k := <span class="hljs-number">0</span>; k &lt; <span class="hljs-number">8</span>; k++ {
+ <span class="hljs-keyword">if</span> (c &amp; <span class="hljs-number">1</span>) != <span class="hljs-number">0</span> {
+ c = <span class="hljs-number">0xEDB88320</span> ^ (c &gt;&gt; <span class="hljs-number">1</span>)
+ } <span class="hljs-keyword">else</span> {
+ c = c &gt;&gt; <span class="hljs-number">1</span>
+ }
+ }
+ crcTable[n] = c
+ }
+ crcTableComputed = <span class="hljs-literal">true</span>
+}
+
+<span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">updateCrc</span><span class="hljs-params">(crc <span class="hljs-type">uint32</span>, buf []<span class="hljs-type">byte</span>)</span></span> <span class="hljs-type">uint32</span> {
+ <span class="hljs-keyword">if</span> !crcTableComputed {
+ makeCrcTable()
+ }
+
+ c := crc
+ <span class="hljs-keyword">for</span> n := <span class="hljs-number">0</span>; n &lt; <span class="hljs-built_in">len</span>(buf); n++ {
+ c = crcTable[(c^<span class="hljs-type">uint32</span>(buf[n]))&amp;<span class="hljs-number">0xFF</span>] ^ (c &gt;&gt; <span class="hljs-number">8</span>)
+ }
+ <span class="hljs-keyword">return</span> c
+}
+
+<span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">crc</span><span class="hljs-params">(buf []<span class="hljs-type">byte</span>)</span></span> <span class="hljs-type">uint32</span> {
+ <span class="hljs-keyword">return</span> updateCrc(<span class="hljs-number">0xFFFFFFFF</span>, buf) ^ <span class="hljs-number">0xFFFFFFFF</span>
+}
+
+<span class="hljs-keyword">const</span> adler32Base = <span class="hljs-number">65521</span>
+
+<span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">updateAdler32</span><span class="hljs-params">(adler <span class="hljs-type">uint32</span>, buf []<span class="hljs-type">byte</span>)</span></span> <span class="hljs-type">uint32</span> {
+ s1 := adler &amp; <span class="hljs-number">0xFFFF</span>
+ s2 := (adler &gt;&gt; <span class="hljs-number">16</span>) &amp; <span class="hljs-number">0xFFFF</span>
+
+ <span class="hljs-keyword">for</span> n := <span class="hljs-number">0</span>; n &lt; <span class="hljs-built_in">len</span>(buf); n++ {
+ s1 = (s1 + <span class="hljs-type">uint32</span>(buf[n])) % adler32Base
+ s2 = (s2 + s1) % adler32Base
+ }
+ <span class="hljs-keyword">return</span> (s2 &lt;&lt; <span class="hljs-number">16</span>) + s1
+}
+
+<span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">adler32</span><span class="hljs-params">(buf []<span class="hljs-type">byte</span>)</span></span> <span class="hljs-type">uint32</span> {
+ <span class="hljs-keyword">return</span> updateAdler32(<span class="hljs-number">1</span>, buf)
+}</code></pre>
+ </section>
+
+ <section id="section--references">
+ <h2><a href="#section--references">参考</a></h2>
+ <ul>
+ <li>
+ <a href="https://www.w3.org/TR/png">Portable Network Graphics (PNG) Specification (Third Edition)</a>
+ </li>
+
+ <li>
+ <a href="https://www.rfc-editor.org/rfc/rfc1950">ZLIB Compressed Data Format Specification version 3.3</a>
+ </li>
+ </ul>
+ </section>
+ </div>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/posts/2023-04-04/phperkaigi-2023-report/index.html b/vhosts/blog/public/posts/2023-04-04/phperkaigi-2023-report/index.html
new file mode 100644
index 00000000..6350ee40
--- /dev/null
+++ b/vhosts/blog/public/posts/2023-04-04/phperkaigi-2023-report/index.html
@@ -0,0 +1,307 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2023 nsfisis">
+ <meta name="description" content="2023-03-23 から 2023-03-25 にかけて開催された、PHPerKaigi 2023 に参加した。">
+ <meta name="keywords" content="カンファレンス,PHP,PHPerKaigi">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>PHPerKaigi 2023 参加レポ | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ <link rel="stylesheet" href="/hl.css?h=340e65ffd5c17713efc9107c06304f7b">
+ </head>
+ <body class="single">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <article class="post-single">
+ <header class="post-header">
+ <h1 class="post-title">PHPerKaigi 2023 参加レポ</h1>
+ <ul class="post-tags">
+ <li class="tag">
+ <a href="/tags/conference/">カンファレンス</a>
+ </li>
+ <li class="tag">
+ <a href="/tags/php/">PHP</a>
+ </li>
+ <li class="tag">
+ <a href="/tags/phperkaigi/">PHPerKaigi</a>
+ </li>
+ </ul>
+ </header>
+ <div class="post-content">
+ <section>
+ <h2 id="changelog">更新履歴</h2>
+ <ol>
+ <li class="revision">
+ <time datetime="2023-04-04">2023-04-04</time>: 公開
+ </li>
+ <li class="revision">
+ <time datetime="2023-06-28">2023-06-28</time>: トークセッションの記事版の執筆を中止
+ </li>
+ </ol>
+ </section>
+ <section id="section--intro">
+ <h2><a href="#section--intro">はじめに</a></h2>
+ <p>
+ 2023-03-23 から 2023-03-25 にかけて開催された、<a href="https://phperkaigi.jp/2023/">PHPerKaigi 2023</a> に参加した。 今年は 2つのセッションのスピーカーとして、また、当日スタッフとして参加した。
+ </p>
+
+ <p>
+ 昨年、一昨年の参加レポはこちら:
+ </p>
+
+ <ul>
+ <li>
+ <a href="/posts/2022-05-01/phperkaigi-2022/">PHPerKaigi 2022</a>
+ </li>
+
+ <li>
+ <a href="/posts/2021-03-30/phperkaigi-2021/">PHPerKaigi 2021</a>
+ </li>
+ </ul>
+ </section>
+
+ <section id="section--as-speaker">
+ <h2><a href="#section--as-speaker">スピーカーとして</a></h2>
+ <p>
+ これまでとの最大の違いとして、今回はスピーカーとして登壇した。まずはそれについて書く。2つのセッションで登壇した。
+ </p>
+
+ <ul>
+ <li>
+ 詳説「参照」:PHP 処理系の実装から参照を理解する
+ <ul>
+ <li>
+ <a href="https://fortee.jp/phperkaigi-2023/proposal/95e4dd94-5fc7-40fe-9e1a-230e36404cbe">プロポーザル</a>
+ </li>
+
+ <li>
+ <a href="/slides/2023-03-24/phperkaigi-2023/">スライド</a>
+ </li>
+
+ <li>
+ 解説記事 (執筆中) → 追記: 記事版の執筆は諦めた
+ </li>
+ </ul>
+ </li>
+
+ <li>
+ PHPerチャレンジ解説セッション - デジタルサーカス株式会社
+ <ul>
+ <li>
+ <a href="https://fortee.jp/phperkaigi-2023/proposal/524c9dca-1d70-4b32-a939-9c73ffe5cb48">プロポーザル</a>
+ </li>
+
+ <li>
+ <a href="/slides/2023-03-25/phperkaigi-2023-tokens/">スライド</a>
+ </li>
+
+ <li>
+ 解説記事 (執筆中) → 追記: 記事版の執筆は諦めた
+ </li>
+ </ul>
+ </li>
+ </ul>
+
+ <p>
+ PHPer チャレンジの話については後述する。 参照については、PHP を書き始めた頃からずっと疑問に思っていたので、仕組みを理解する良い機会となった。
+ </p>
+ </section>
+
+ <section id="section--as-staff">
+ <h2><a href="#section--as-staff">当日スタッフとして</a></h2>
+ <p>
+ 今回はスピーカーのみならず当日スタッフとしても参加した。 カンファレンスのスタッフとしての参加は初めてだったが、初参加のスタッフでもスムーズに作業ができるような仕組みが整えられていた。
+ </p>
+
+ <p>
+ PHPerKaigi は一般参加者の目線でもよくできたカンファレンスだなあという印象だったのだが、よりその思いを強くした。 なんとスタッフにとってもよくできたカンファレンスなのである。
+ </p>
+
+ <p>
+ 反省点は私自身の最大 HP がまったく足りていなかったことで、次の機会には最後まで動けるようにしたいところである。
+ </p>
+ </section>
+
+ <section id="section--as-attendee">
+ <h2><a href="#section--as-attendee">参加者として</a></h2>
+ <section id="section--as-attendee--recommended-sessions">
+ <h3><a href="#section--as-attendee--recommended-sessions">おすすめセッション</a></h3>
+ <p>
+ 5つのセッションを厳選した。
+ </p>
+
+ <p>
+ <a href="https://fortee.jp/phperkaigi-2023/proposal/f7f2f18a-e6b0-47e4-ade0-e324f72428ae">ブラウザの向こう側で「200 OK」を返すまでに何が起きているのか調べてみた</a>
+ </p>
+
+ <p>
+ Web に関わるなら、バックエンドでもフロントエンドでも知っておいてほしい知識。 タイトルを見て「こんな話だろうな」と想像がつくレベルなら見なくてもいいかも。
+ </p>
+
+ <p>
+ <a href="https://fortee.jp/phperkaigi-2023/proposal/280706e0-7158-4237-8202-c9d64330b96f">PHPで学ぶ &quot;Cacheの距離&quot; の話</a>
+ </p>
+
+ <p>
+ これも上セッションと同様に、基礎を抑えられる良いセッション。
+ </p>
+
+ <p>
+ <a href="https://fortee.jp/phperkaigi-2023/proposal/ad3ba31c-0214-4557-a0df-3755db8ed8cc">防衛的 PHP: 多様性を生き抜くための PHP 入門</a>
+ </p>
+
+ <p>
+ 静的解析ツールの話。静的解析は PHP のみならず最近の動的言語の一大潮流なので、逃れられない。
+ </p>
+
+ <p>
+ <a href="https://fortee.jp/phperkaigi-2023/proposal/e00788a4-ef25-49ee-b254-9d2b53e19633">PHPの最高機能、配列を捨てよう!!</a>
+ </p>
+
+ <p>
+ 実はこれも上のセッションと同様の話。 PHP の静的解析ツールは配列にも (無理矢理) 型が付けられるものが多いが、実行時にも検査できるという点において専用のクラスを作る方が優れている。
+ </p>
+
+ <p>
+ <a href="https://fortee.jp/phperkaigi-2023/proposal/7e212cb2-be37-43e8-b6ee-5236d259fcbf">時間を気にせず普通にカンニングもしつつ ISUCON12 本選問題を PHP でやってみる</a>
+ </p>
+
+ <p>
+ 個人的に最も楽しみにしていたセッションであり、今回のモリアガリトーク賞 (盛り上がったセッションに運営側から贈られる賞) でもある。 ネタバレになるが、最終的に (Go で実装された) 本戦優勝スコアを超えている。
+ </p>
+ </section>
+
+ <section id="section--as-attendee--phper-challenge">
+ <h3><a href="#section--as-attendee--phper-challenge">PHPer チャレンジ</a></h3>
+ <p>
+ 昨年に引き続き、弊社デジタルサーカス株式会社からのトークン問題の作題を担当した。 また、今年はさらに作成した問題を解説するセッションにも登壇した。 今年のトークンは、昨年の PHPerKaigi 2022 が終わった段階から作り始め、約半年かけて制作した。
+ </p>
+
+ <p>
+ 問題の制作中は大変楽しかったが、まあやりすぎた。 いかに超絶技巧を凝らすかに注力してしまい、解く楽しさという観点を失ってしまったきらいがある。
+ </p>
+
+ <p>
+ (WIP: 解説ブログ記事執筆中。終わったらここにリンク)
+ </p>
+ </section>
+
+ <section id="section--as-attendee--random-thoughts">
+ <h3><a href="#section--as-attendee--random-thoughts">雑多な感想</a></h3>
+ <p>
+ なんかいろいろ。
+ </p>
+
+ <ul>
+ <li>
+ マカロンおいしかった
+ </li>
+
+ <li>
+ \ペチパー/
+ </li>
+
+ <li>
+ 名札便利
+ </li>
+
+ <li>
+ \ペチパー/
+ </li>
+
+ <li>
+ 傘袋便利
+ </li>
+
+ <li>
+ \ペチパー/
+ </li>
+
+ <li>
+ パーカーのデザイン良き
+ </li>
+ </ul>
+
+ <p>
+ (あとから見返して自分でもわけがわからなくなりそうなので書いておくと、会場に入場する際に名札をタッチすると小桜エツコさんの声で「ペチパー」という音声が流れるギミックがあった)
+ </p>
+ </section>
+ </section>
+
+ <section id="section--outro">
+ <h2><a href="#section--outro">おわりに</a></h2>
+ <p>
+ <a href="/posts/2022-05-01/phperkaigi-2022/#section--next-year">去年の参加レポ</a>では、来年の目標として次を挙げた。
+ </p>
+
+ <blockquote>
+ <ul>
+ <li>
+ プロポーザルを出す
+ </li>
+
+ <li>
+ PHPer チャレンジのトークン問題を 5題作成する
+ </li>
+
+ <li>
+ 現地に行く
+ </li>
+
+ <li>
+ PHPer チャレンジで圧勝する
+ </li>
+ </ul>
+ </blockquote>
+
+ <p>
+ プロポーザルに関しては採択されて登壇できたし、PHPer チャレンジは解説もおこなった。また、現地に行くだけでなく、当日スタッフとして参加した。 4つ目の PHPer チャレンジに関しては、今年は参加していない。 スタッフをやりながらだと入力する時間も探す時間も取れそうになかったのと、スタッフをやっている関係で少しだけ早く入手してしまうトークンがいくつか存在していたため。
+ </p>
+
+ <p>
+ カンファレンス全体の感想についてだが、大規模なカンファレンスにオフラインで参加するのは今回が初めてだったので、その話をしたい。
+ </p>
+
+ <p>
+ オンラインとオフラインだと体験が別物になる。そもそもが似て非なるものなのだ。 向き不向きはあるだろうが、オンラインしか参加したことのないという方は、一度現地参加してみてはいかがだろうか。
+ </p>
+
+ <p>
+ さて、参加レポは去年も一昨年もこの言葉で締め括っているので、今年もそれで終わろうと思う。
+ </p>
+
+ <p>
+ ではまた来年。
+ </p>
+ </section>
+ </div>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/posts/2023-06-25/phpconfuk-2023-report/index.html b/vhosts/blog/public/posts/2023-06-25/phpconfuk-2023-report/index.html
new file mode 100644
index 00000000..315816c1
--- /dev/null
+++ b/vhosts/blog/public/posts/2023-06-25/phpconfuk-2023-report/index.html
@@ -0,0 +1,161 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2023 nsfisis">
+ <meta name="description" content="2023-06-24 に開催された、PHP カンファレンス福岡に参加した。">
+ <meta name="keywords" content="カンファレンス,PHP,PHP カンファレンス福岡">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>PHP カンファレンス福岡 2023 参加レポ | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ <link rel="stylesheet" href="/hl.css?h=340e65ffd5c17713efc9107c06304f7b">
+ </head>
+ <body class="single">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <article class="post-single">
+ <header class="post-header">
+ <h1 class="post-title">PHP カンファレンス福岡 2023 参加レポ</h1>
+ <ul class="post-tags">
+ <li class="tag">
+ <a href="/tags/conference/">カンファレンス</a>
+ </li>
+ <li class="tag">
+ <a href="/tags/php/">PHP</a>
+ </li>
+ <li class="tag">
+ <a href="/tags/phpconfuk/">PHP カンファレンス福岡</a>
+ </li>
+ </ul>
+ </header>
+ <div class="post-content">
+ <section>
+ <h2 id="changelog">更新履歴</h2>
+ <ol>
+ <li class="revision">
+ <time datetime="2023-06-25">2023-06-25</time>: 公開
+ </li>
+ </ol>
+ </section>
+ <section id="section--intro">
+ <h2><a href="#section--intro">はじめに</a></h2>
+ <p>
+ 2023-06-24 に開催された、<a href="https://phpcon.fukuoka.jp/2023/">PHP カンファレンス福岡 2023</a>に参加した。 また、その前日に催された、<a href="https://connpass.com/event/282285/">非公式の前夜祭</a>にも参加した。 前夜祭では、15分の登壇もおこなった。<a href="/slides/2023-06-23/phpconfuk-2023-eve/">登壇の方の資料はこちら。</a>
+ </p>
+ </section>
+
+ <section id="section--sessions-thoughts">
+ <h2><a href="#section--sessions-thoughts">セッションの感想</a></h2>
+ <section id="section--sessions-thoughts--eve">
+ <h3><a href="#section--sessions-thoughts--eve">前夜祭</a></h3>
+ <p>
+ ※セッションの題名と発表者名は、<a href="https://connpass.com/event/282285/">前夜祭イベントの connpass ページ</a>から引用。
+ </p>
+
+ <ul>
+ <li>
+ スクラム(の一部)を導入してよくなったこと (asumikam さん)
+ <ul>
+ <li>
+ スクラムの「一部」を導入されたということでしたが、理想的な形で改善が進んでいるように見受けられました。 特に、ブランチ運用やデプロイ頻度、フィードバックサイクルに大きく変化が起きているのは驚くべき成果だと感じました。
+ </li>
+ </ul>
+ </li>
+
+ <li>
+ 地方の小さな勉強会を一番の活動舞台にする (tomio さん)
+ <ul>
+ <li>
+ すさまじいほどの「熱」を感じました。 私自身、最近になってカンファレンスや勉強会への参加・登壇を活発におこなうようになったことで、頷く点が多かったです。
+ </li>
+ </ul>
+ </li>
+ </ul>
+ </section>
+
+ <section id="section--sessions-thoughts--conference">
+ <h3><a href="#section--sessions-thoughts--conference">カンファレンス</a></h3>
+ <p>
+ ※セッションの題名と発表者名は、<a href="https://fortee.jp/phpconfukuoka-2023/proposal/accepted">カンファレンスの fortee ページ</a>から引用。
+ </p>
+
+ <ul>
+ <li>
+ <a href="https://fortee.jp/phpconfukuoka-2023/proposal/df5f06e8-900e-4e71-94d7-d0c3cc57a0ac">育成力 - エンジニアの才能を引き出す環境とチューターの立ち回り - (岡嵜 雄平 さん)</a>
+ <ul>
+ <li>
+ ちょうど弊チームに新規メンバがジョインしたばかりで、オンボーディングプロセスについて考えていたところの発表でした。 すぐにすべてを取り入れるというわけにはいきませんが、弊社での新人育成プロセスの改善につながるヒントをいくつか得られたと思います。
+ </li>
+ </ul>
+ </li>
+
+ <li>
+ オブジェクト指向は本当に必要か? (たなかひさてる さん、こいほげ さん)
+ <ul>
+ <li>
+ ※当日 D ホールでおこなわれたアンカンファレンスセッションのため、正式タイトル・リンクなし
+ </li>
+
+ <li>
+ 私自身、「オブジェクト指向」については色々と言いたいことがあるのですが、だいたいツイートしたこれとこれです。
+ <ul>
+ <li>
+ 「オブジェクト指向の話は、パラダイムの異なる複数の言語に触れているかどうかで見え方がまったく異なる印象がある。OOPはどうでもいいです (※個人の感想です)」 (<a href="https://twitter.com/nsfisis/status/1672502935983656960">Twitter のツイートへのリンク</a>)
+ </li>
+
+ <li>
+ 「OOPは現代の言語で考える意味はほぼない古いパラダイムだよという立場ですが、OOPについてあまり大っぴらに話してると色んなところから刺されそうなんですよね (Twitterは大っぴらじゃないんですか?)」 (<a href="https://twitter.com/nsfisis/status/1672504892244787201">Twitter のツイートへのリンク</a>)
+ </li>
+ </ul>
+ </li>
+ </ul>
+ </li>
+
+ <li>
+ <a href="https://fortee.jp/phpconfukuoka-2023/proposal/ae71f3a7-4c3c-4c87-8816-8426bcc8d325">その説明、コードコメントに書く?コミットメッセージに書く?プルリクエストに書く? (おかしょい/岡田正平 さん)</a>
+ <ul>
+ <li>
+ Twitter にもツイートしましたが、完全に自分の意見と一致していたので、とても共感できました。 今後は社内のコードレビュー時に、こちらの資料を貼りつけることにします。
+ </li>
+ </ul>
+ </li>
+ </ul>
+ </section>
+ </section>
+
+ <section id="section--outro">
+ <h2><a href="#section--outro">おわりに</a></h2>
+ <p>
+ 居住地域から離れた場所への遠征参加は初めてだったが、大変楽しい (しかも勉強にもなる!) 体験だった。 受け取った「熱」が冷める前に、自らの手を動かしていきたい。
+ </p>
+ </section>
+ </div>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/posts/index.html b/vhosts/blog/public/posts/index.html
new file mode 100644
index 00000000..acd16a6c
--- /dev/null
+++ b/vhosts/blog/public/posts/index.html
@@ -0,0 +1,389 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2021 nsfisis">
+ <meta name="description" content="投稿した記事の一覧">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>投稿一覧 | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ </head>
+ <body class="list">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <header class="page-header">
+ <h1>投稿一覧</h1>
+ </header>
+ <article class="post-entry">
+ <a href="/posts/2023-06-25/phpconfuk-2023-report/">
+ <header class="entry-header">
+ <h2>PHP カンファレンス福岡 2023 参加レポ</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ 2023-06-24 に開催された、PHP カンファレンス福岡に参加した。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-06-25">2023-06-25</time> 投稿
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2023-04-04/phperkaigi-2023-report/">
+ <header class="entry-header">
+ <h2>PHPerKaigi 2023 参加レポ</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ 2023-03-23 から 2023-03-25 にかけて開催された、PHPerKaigi 2023 に参加した。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-04-04">2023-04-04</time> 投稿、<time datetime="2023-06-28">2023-06-28</time> 更新
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2023-04-01/implementation-of-minimal-png-image-encoder/">
+ <header class="entry-header">
+ <h2>PNG 画像の最小構成エンコーダを実装する</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ PNG 画像として valid な範囲で最大限手抜きしたエンコーダを書く。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-04-01">2023-04-01</time> 投稿
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2023-03-10/rewrite-this-blog-generator/">
+ <header class="entry-header">
+ <h2>このブログのジェネレータを書き直した</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ このブログのジェネレータを書き直したので、やったことを書き記しておく。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-03-10">2023-03-10</time> 投稿
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2023-01-10/phperkaigi-2023-unused-token-quiz-3/">
+ <header class="entry-header">
+ <h2>PHPerKaigi 2023: ボツになったトークン問題 その 3</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ 来年の PHPerKaigi 2023 でデジタルサーカス株式会社から出題予定のトークン問題のうち、ボツになった問題を公開する (その 3)。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-01-10">2023-01-10</time> 投稿
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2022-11-19/phperkaigi-2023-unused-token-quiz-2/">
+ <header class="entry-header">
+ <h2>PHPerKaigi 2023: ボツになったトークン問題 その 2</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ 来年の PHPerKaigi 2023 でデジタルサーカス株式会社から出題予定のトークン問題のうち、ボツになった問題を公開する (その 2)。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2022-11-19">2022-11-19</time> 投稿
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2022-10-28/setup-server-for-this-site/">
+ <header class="entry-header">
+ <h2>【備忘録】 このサイト用の VPS をセットアップしたときのメモ</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ GitHub Pages でホストしていたこのサイトを VPS へ移行したので、そのときにやったことのメモ。99 % 自分用。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2022-10-28">2022-10-28</time> 投稿、<time datetime="2023-08-30">2023-08-30</time> 更新
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2022-10-23/phperkaigi-2023-unused-token-quiz-1/">
+ <header class="entry-header">
+ <h2>PHPerKaigi 2023: ボツになったトークン問題 その 1</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ 来年の PHPerKaigi 2023 でデジタルサーカス株式会社から出題予定のトークン問題のうち、ボツになった問題を公開する (その 1)。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2022-10-23">2022-10-23</time> 投稿
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2022-09-29/write-fizzbuzz-in-php-2-letters-per-line/">
+ <header class="entry-header">
+ <h2>【PHP】 fizzbuzz を書く。1行あたり2文字で。</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ PHP で、fizzbuzz を書いた。ただし、1行あたりに使える文字数は2文字まで。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2022-09-28">2022-09-28</time> 投稿、<time datetime="2022-09-29">2022-09-29</time> 更新
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2022-08-31/support-for-communty-is-employee-benefits/">
+ <header class="entry-header">
+ <h2>弊社の PHP Foundation への寄付に寄せて</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ 先日、私の勤めるデジタルサーカス株式会社が、PHP Foundation へ寄付をおこないました。 本件を社内でしつこく推進した1人として、推進の理由等を書き残しておきます。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2022-08-31">2022-08-31</time> 投稿
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2022-08-27/php-conference-okinawa-code-golf/">
+ <header class="entry-header">
+ <h2>PHP カンファレンス沖縄で出題されたコードゴルフの問題を解いてみた</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ PHP カンファレンス沖縄の懇親会 LT で出題されたコードゴルフの問題を解いてみた。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2022-08-27">2022-08-27</time> 投稿
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2022-05-01/phperkaigi-2022/">
+ <header class="entry-header">
+ <h2>PHPerKaigi 2022</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ 2022-04-09 から 2022-04-11 にかけて開催された、PHPerKaigi 2022 に参加した。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2022-05-01">2022-05-01</time> 投稿
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2022-04-24/term-banner-write-tool-showing-banner-in-terminal/">
+ <header class="entry-header">
+ <h2>term-banner: ターミナルにバナーを表示するツールを書いた</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ ターミナルに任意の文字のバナーを表示するためのツールを Go で書いた。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2022-04-24">2022-04-24</time> 投稿、<time datetime="2022-04-27">2022-04-27</time> 更新
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2022-04-09/phperkaigi-2022-tokens/">
+ <header class="entry-header">
+ <h2>PHPerKaigi 2022 トークン問題の解説</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ PHPerKaigi 2022 で私が作成した PHPer チャレンジ問題を解説する。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2022-04-09">2022-04-09</time> 投稿、<time datetime="2022-04-16">2022-04-16</time> 更新
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2021-10-02/cpp-you-can-use-keywords-in-attributes/">
+ <header class="entry-header">
+ <h2>【C++】 属性構文の属性名にはキーワードが使える</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ C++ の属性構文の属性名には、キーワードが使える。ネタ記事。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2021-10-02">2021-10-02</time> 投稿
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2021-10-02/python-unbound-local-error/">
+ <header class="entry-header">
+ <h2>【Python】 クロージャとUnboundLocalError: local variable &apos;x&apos; referenced before assignment</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ Python における UnboundLocalError の理由と対処法。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2021-10-02">2021-10-02</time> 投稿
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2021-10-02/ruby-detect-running-implementation/">
+ <header class="entry-header">
+ <h2>【Ruby】 自身を実行している処理系の種類を判定する</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ Ruby には複数の実装があるが、自身を実行している処理系の種類をスクリプト上からどのように判定すればよいだろうか。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2021-10-02">2021-10-02</time> 投稿
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2021-10-02/ruby-then-keyword-and-case-in/">
+ <header class="entry-header">
+ <h2>【Ruby】 then キーワードと case in</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ Ruby 3.0 で追加される case in 構文と、then キーワードについて。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2021-10-02">2021-10-02</time> 投稿
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2021-10-02/rust-where-are-primitive-types-from/">
+ <header class="entry-header">
+ <h2>Rust のプリミティブ型はどこからやって来るか</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ Rust のプリミティブ型は予約語ではなく普通の識別子である。どのようにこれが名前解決されるのかを調べた。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2021-10-02">2021-10-02</time> 投稿
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2021-10-02/vim-difference-between-autocmd-bufwrite-and-bufwritepre/">
+ <header class="entry-header">
+ <h2>【Vim】 autocmd events の BufWrite/BufWritePre の違い</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ Vim の autocmd events における BufWrite/BufWritePre がどう違うのかを調べた結果、違いはないことがわかった。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2021-10-02">2021-10-02</time> 投稿
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2021-10-02/vim-swap-order-of-selected-lines/">
+ <header class="entry-header">
+ <h2>Vimで選択した行の順番を入れ替える</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ Vim で選択した行の順番を入れ替える方法。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2021-10-02">2021-10-02</time> 投稿
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2021-03-30/phperkaigi-2021/">
+ <header class="entry-header">
+ <h2>PHPerKaigi 2021</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ 2021-03-26 から 2021-03-28 にかけて開催された、PHPerKaigi 2021 に参加した。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2021-03-30">2021-03-30</time> 投稿
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2021-03-05/my-first-post/">
+ <header class="entry-header">
+ <h2>My First Post</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ これはテスト投稿です。これはテスト投稿です。これはテスト投稿です。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2021-03-05">2021-03-05</time> 投稿
+ </footer>
+ </a>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/slide.js b/vhosts/blog/public/slide.js
new file mode 100644
index 00000000..77e49acc
--- /dev/null
+++ b/vhosts/blog/public/slide.js
@@ -0,0 +1,59 @@
+document.addEventListener("DOMContentLoaded", async () => {
+ const pdfjsLib = globalThis.pdfjsLib;
+ pdfjsLib.GlobalWorkerOptions.workerSrc = "https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.4.120/pdf.worker.min.js";
+
+ const canvas = document.getElementById("slide");
+ const ctx = canvas.getContext("2d");
+ const url = canvas.dataset.slideLink;
+
+ let pageNum = 1;
+ let pageNumPending = null;
+ let pageRendering = false;
+ let doc = null;
+
+ const renderPage = async (num) => {
+ pageRendering = true;
+ const page = await doc.getPage(num);
+
+ var viewport = page.getViewport({ scale: 1.0 });
+ canvas.height = viewport.height;
+ canvas.width = viewport.width;
+
+ // TODO: error handling
+ await page.render({
+ canvasContext: ctx,
+ viewport: viewport,
+ });
+
+ pageRendering = false;
+ if (pageNumPending !== null) {
+ renderPage(pageNumPending);
+ pageNumPending = null;
+ }
+ };
+
+ const queueRenderPage = (num) => {
+ if (pageRendering) {
+ pageNumPending = num;
+ } else {
+ renderPage(num);
+ }
+ };
+
+ const prev = document.getElementById("prev");
+ prev.addEventListener("click", () => {
+ if (pageNum <= 1) return;
+ pageNum--;
+ queueRenderPage(pageNum);
+ });
+ const next = document.getElementById("next");
+ next.addEventListener("click", () => {
+ if (pageNum >= doc.numPages) return;
+ pageNum++;
+ queueRenderPage(pageNum);
+ });
+
+ // TODO: error handling
+ doc = await pdfjsLib.getDocument(url).promise;
+ queueRenderPage(pageNum);
+});
diff --git a/vhosts/blog/public/slides/2023-01-18/phpstudy-tokyo-148/index.html b/vhosts/blog/public/slides/2023-01-18/phpstudy-tokyo-148/index.html
new file mode 100644
index 00000000..acda5560
--- /dev/null
+++ b/vhosts/blog/public/slides/2023-01-18/phpstudy-tokyo-148/index.html
@@ -0,0 +1,80 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2023 nsfisis">
+ <meta name="description" content="明日のあなたの役に立たない PHP コーディング技法~polyglot~">
+ <meta name="keywords" content="PHP,PHP 勉強会@東京">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>PHP 勉強会@東京 第148 回 (LT) | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ <link rel="stylesheet" href="/hl.css?h=340e65ffd5c17713efc9107c06304f7b">
+ </head>
+ <body class="single">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <article class="post-single">
+ <header class="post-header">
+ <h1 class="post-title">明日のあなたの役に立たない PHP コーディング技法~polyglot~</h1>
+ <ul class="post-tags">
+ <li class="tag">
+ <a href="/tags/php/">PHP</a>
+ </li>
+ <li class="tag">
+ <a href="/tags/phpstudy-tokyo/">PHP 勉強会@東京</a>
+ </li>
+ </ul>
+ </header>
+ <div class="post-content">
+ <section>
+ <h2 id="changelog">更新履歴</h2>
+ <ol>
+ <li class="revision">
+ <time datetime="2023-01-18">2023-01-18</time>: 登壇
+ </li>
+ </ol>
+ </section>
+ <canvas data-slide-link="/slides/2023-01-18/phpstudy-tokyo-148/slide.pdf" id="slide">
+ </canvas>
+ <div>
+ <button id="prev">
+ Prev
+ </button>
+ <button id="next">
+ Next
+ </button>
+ </div>
+ <script src="/pdf.min.js?h=68f61939cb81f9ae70a7ee2af2e9dcf8">
+ </script>
+ <script src="/slide.js?h=851ec3f450457f6c7117cdac62926bf3" type="module">
+ </script>
+ </div>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/slides/2023-01-18/phpstudy-tokyo-148/slide.pdf b/vhosts/blog/public/slides/2023-01-18/phpstudy-tokyo-148/slide.pdf
new file mode 100644
index 00000000..e50d08ef
--- /dev/null
+++ b/vhosts/blog/public/slides/2023-01-18/phpstudy-tokyo-148/slide.pdf
Binary files differ
diff --git a/vhosts/blog/public/slides/2023-02-15/phpstudy-tokyo-149/index.html b/vhosts/blog/public/slides/2023-02-15/phpstudy-tokyo-149/index.html
new file mode 100644
index 00000000..6d01fec2
--- /dev/null
+++ b/vhosts/blog/public/slides/2023-02-15/phpstudy-tokyo-149/index.html
@@ -0,0 +1,80 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2023 nsfisis">
+ <meta name="description" content="PHPerKaigi 2023 のトークン問題でボツにした問題を供養する">
+ <meta name="keywords" content="PHP,PHP 勉強会@東京">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>PHP 勉強会@東京 第149 回 (LT) | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ <link rel="stylesheet" href="/hl.css?h=340e65ffd5c17713efc9107c06304f7b">
+ </head>
+ <body class="single">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <article class="post-single">
+ <header class="post-header">
+ <h1 class="post-title">PHPerKaigi 2023 のトークン問題でボツにした問題を供養する</h1>
+ <ul class="post-tags">
+ <li class="tag">
+ <a href="/tags/php/">PHP</a>
+ </li>
+ <li class="tag">
+ <a href="/tags/phpstudy-tokyo/">PHP 勉強会@東京</a>
+ </li>
+ </ul>
+ </header>
+ <div class="post-content">
+ <section>
+ <h2 id="changelog">更新履歴</h2>
+ <ol>
+ <li class="revision">
+ <time datetime="2023-02-15">2023-02-15</time>: 登壇
+ </li>
+ </ol>
+ </section>
+ <canvas data-slide-link="/slides/2023-02-15/phpstudy-tokyo-149/slide.pdf" id="slide">
+ </canvas>
+ <div>
+ <button id="prev">
+ Prev
+ </button>
+ <button id="next">
+ Next
+ </button>
+ </div>
+ <script src="/pdf.min.js?h=68f61939cb81f9ae70a7ee2af2e9dcf8">
+ </script>
+ <script src="/slide.js?h=851ec3f450457f6c7117cdac62926bf3" type="module">
+ </script>
+ </div>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/slides/2023-02-15/phpstudy-tokyo-149/slide.pdf b/vhosts/blog/public/slides/2023-02-15/phpstudy-tokyo-149/slide.pdf
new file mode 100644
index 00000000..f51f6f81
--- /dev/null
+++ b/vhosts/blog/public/slides/2023-02-15/phpstudy-tokyo-149/slide.pdf
Binary files differ
diff --git a/vhosts/blog/public/slides/2023-03-15/phpstudy-tokyo-150/index.html b/vhosts/blog/public/slides/2023-03-15/phpstudy-tokyo-150/index.html
new file mode 100644
index 00000000..5f6fb5d4
--- /dev/null
+++ b/vhosts/blog/public/slides/2023-03-15/phpstudy-tokyo-150/index.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2023 nsfisis">
+ <meta name="description" content="明日のあなたの役に立たない PHP コーディング技法~細長い FizzBuzz を書く~">
+ <meta name="keywords" content="PHP,PHP 勉強会@東京">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>PHP 勉強会@東京 第150 回 (LT) | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ <link rel="stylesheet" href="/hl.css?h=340e65ffd5c17713efc9107c06304f7b">
+ </head>
+ <body class="single">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <article class="post-single">
+ <header class="post-header">
+ <h1 class="post-title">明日のあなたの役に立たない PHP コーディング技法~細長い FizzBuzz を書く~</h1>
+ <ul class="post-tags">
+ <li class="tag">
+ <a href="/tags/php/">PHP</a>
+ </li>
+ <li class="tag">
+ <a href="/tags/phpstudy-tokyo/">PHP 勉強会@東京</a>
+ </li>
+ </ul>
+ </header>
+ <div class="post-content">
+ <section>
+ <h2 id="changelog">更新履歴</h2>
+ <ol>
+ <li class="revision">
+ <time datetime="2023-03-15">2023-03-15</time>: 登壇
+ </li>
+ <li class="revision">
+ <time datetime="2023-03-18">2023-03-18</time>: 2文字以下の関数が他にもあったので修正
+ </li>
+ </ol>
+ </section>
+ <canvas data-slide-link="/slides/2023-03-15/phpstudy-tokyo-150/slide.pdf" id="slide">
+ </canvas>
+ <div>
+ <button id="prev">
+ Prev
+ </button>
+ <button id="next">
+ Next
+ </button>
+ </div>
+ <script src="/pdf.min.js?h=68f61939cb81f9ae70a7ee2af2e9dcf8">
+ </script>
+ <script src="/slide.js?h=851ec3f450457f6c7117cdac62926bf3" type="module">
+ </script>
+ </div>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/slides/2023-03-15/phpstudy-tokyo-150/slide.pdf b/vhosts/blog/public/slides/2023-03-15/phpstudy-tokyo-150/slide.pdf
new file mode 100644
index 00000000..fdc070c3
--- /dev/null
+++ b/vhosts/blog/public/slides/2023-03-15/phpstudy-tokyo-150/slide.pdf
Binary files differ
diff --git a/vhosts/blog/public/slides/2023-03-24/phperkaigi-2023/index.html b/vhosts/blog/public/slides/2023-03-24/phperkaigi-2023/index.html
new file mode 100644
index 00000000..324fa008
--- /dev/null
+++ b/vhosts/blog/public/slides/2023-03-24/phperkaigi-2023/index.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2023 nsfisis">
+ <meta name="description" content="詳説「参照」PHP の参照を完全に理解する">
+ <meta name="keywords" content="カンファレンス,PHP,PHPerKaigi">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>PHPerKaigi 2023 (レギュラートーク) | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ <link rel="stylesheet" href="/hl.css?h=340e65ffd5c17713efc9107c06304f7b">
+ </head>
+ <body class="single">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <article class="post-single">
+ <header class="post-header">
+ <h1 class="post-title">詳説「参照」PHP の参照を完全に理解する</h1>
+ <ul class="post-tags">
+ <li class="tag">
+ <a href="/tags/conference/">カンファレンス</a>
+ </li>
+ <li class="tag">
+ <a href="/tags/php/">PHP</a>
+ </li>
+ <li class="tag">
+ <a href="/tags/phperkaigi/">PHPerKaigi</a>
+ </li>
+ </ul>
+ </header>
+ <div class="post-content">
+ <section>
+ <h2 id="changelog">更新履歴</h2>
+ <ol>
+ <li class="revision">
+ <time datetime="2023-03-24">2023-03-24</time>: 登壇
+ </li>
+ </ol>
+ </section>
+ <canvas data-slide-link="/slides/2023-03-24/phperkaigi-2023/slide.pdf" id="slide">
+ </canvas>
+ <div>
+ <button id="prev">
+ Prev
+ </button>
+ <button id="next">
+ Next
+ </button>
+ </div>
+ <script src="/pdf.min.js?h=68f61939cb81f9ae70a7ee2af2e9dcf8">
+ </script>
+ <script src="/slide.js?h=851ec3f450457f6c7117cdac62926bf3" type="module">
+ </script>
+ </div>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/slides/2023-03-24/phperkaigi-2023/slide.pdf b/vhosts/blog/public/slides/2023-03-24/phperkaigi-2023/slide.pdf
new file mode 100644
index 00000000..6d3d9c39
--- /dev/null
+++ b/vhosts/blog/public/slides/2023-03-24/phperkaigi-2023/slide.pdf
Binary files differ
diff --git a/vhosts/blog/public/slides/2023-03-25/phperkaigi-2023-tokens/index.html b/vhosts/blog/public/slides/2023-03-25/phperkaigi-2023-tokens/index.html
new file mode 100644
index 00000000..a38ad016
--- /dev/null
+++ b/vhosts/blog/public/slides/2023-03-25/phperkaigi-2023-tokens/index.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2023 nsfisis">
+ <meta name="description" content="PHPer チャレンジ解説 (デジタルサーカス株式会社)">
+ <meta name="keywords" content="カンファレンス,PHP,PHPerKaigi">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>PHPerKaigi 2023 (トークン解説セッション) | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ <link rel="stylesheet" href="/hl.css?h=340e65ffd5c17713efc9107c06304f7b">
+ </head>
+ <body class="single">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <article class="post-single">
+ <header class="post-header">
+ <h1 class="post-title">PHPer チャレンジ解説 (デジタルサーカス株式会社)</h1>
+ <ul class="post-tags">
+ <li class="tag">
+ <a href="/tags/conference/">カンファレンス</a>
+ </li>
+ <li class="tag">
+ <a href="/tags/php/">PHP</a>
+ </li>
+ <li class="tag">
+ <a href="/tags/phperkaigi/">PHPerKaigi</a>
+ </li>
+ </ul>
+ </header>
+ <div class="post-content">
+ <section>
+ <h2 id="changelog">更新履歴</h2>
+ <ol>
+ <li class="revision">
+ <time datetime="2023-03-25">2023-03-25</time>: 登壇
+ </li>
+ </ol>
+ </section>
+ <canvas data-slide-link="/slides/2023-03-25/phperkaigi-2023-tokens/slide.pdf" id="slide">
+ </canvas>
+ <div>
+ <button id="prev">
+ Prev
+ </button>
+ <button id="next">
+ Next
+ </button>
+ </div>
+ <script src="/pdf.min.js?h=68f61939cb81f9ae70a7ee2af2e9dcf8">
+ </script>
+ <script src="/slide.js?h=851ec3f450457f6c7117cdac62926bf3" type="module">
+ </script>
+ </div>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/slides/2023-03-25/phperkaigi-2023-tokens/slide.pdf b/vhosts/blog/public/slides/2023-03-25/phperkaigi-2023-tokens/slide.pdf
new file mode 100644
index 00000000..1104b62b
--- /dev/null
+++ b/vhosts/blog/public/slides/2023-03-25/phperkaigi-2023-tokens/slide.pdf
Binary files differ
diff --git a/vhosts/blog/public/slides/2023-04-12/phpstudy-tokyo-151/index.html b/vhosts/blog/public/slides/2023-04-12/phpstudy-tokyo-151/index.html
new file mode 100644
index 00000000..23199817
--- /dev/null
+++ b/vhosts/blog/public/slides/2023-04-12/phpstudy-tokyo-151/index.html
@@ -0,0 +1,80 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2023 nsfisis">
+ <meta name="description" content="list でない array の末尾を探す">
+ <meta name="keywords" content="PHP,PHP 勉強会@東京">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>PHP 勉強会@東京 第151 回 (LT) | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ <link rel="stylesheet" href="/hl.css?h=340e65ffd5c17713efc9107c06304f7b">
+ </head>
+ <body class="single">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <article class="post-single">
+ <header class="post-header">
+ <h1 class="post-title">list でない array の末尾を探す</h1>
+ <ul class="post-tags">
+ <li class="tag">
+ <a href="/tags/php/">PHP</a>
+ </li>
+ <li class="tag">
+ <a href="/tags/phpstudy-tokyo/">PHP 勉強会@東京</a>
+ </li>
+ </ul>
+ </header>
+ <div class="post-content">
+ <section>
+ <h2 id="changelog">更新履歴</h2>
+ <ol>
+ <li class="revision">
+ <time datetime="2023-04-12">2023-04-12</time>: 登壇
+ </li>
+ </ol>
+ </section>
+ <canvas data-slide-link="/slides/2023-04-12/phpstudy-tokyo-151/slide.pdf" id="slide">
+ </canvas>
+ <div>
+ <button id="prev">
+ Prev
+ </button>
+ <button id="next">
+ Next
+ </button>
+ </div>
+ <script src="/pdf.min.js?h=68f61939cb81f9ae70a7ee2af2e9dcf8">
+ </script>
+ <script src="/slide.js?h=851ec3f450457f6c7117cdac62926bf3" type="module">
+ </script>
+ </div>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/slides/2023-04-12/phpstudy-tokyo-151/slide.pdf b/vhosts/blog/public/slides/2023-04-12/phpstudy-tokyo-151/slide.pdf
new file mode 100644
index 00000000..422d9b8f
--- /dev/null
+++ b/vhosts/blog/public/slides/2023-04-12/phpstudy-tokyo-151/slide.pdf
Binary files differ
diff --git a/vhosts/blog/public/slides/2023-06-21/phpstudy-tokyo-153/index.html b/vhosts/blog/public/slides/2023-06-21/phpstudy-tokyo-153/index.html
new file mode 100644
index 00000000..eb33481b
--- /dev/null
+++ b/vhosts/blog/public/slides/2023-06-21/phpstudy-tokyo-153/index.html
@@ -0,0 +1,80 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2023 nsfisis">
+ <meta name="description" content="テキストファイルの末尾には改行コードを入れよう">
+ <meta name="keywords" content="PHP,PHP 勉強会@東京">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>PHP 勉強会@東京 第153 回 (LT) | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ <link rel="stylesheet" href="/hl.css?h=340e65ffd5c17713efc9107c06304f7b">
+ </head>
+ <body class="single">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <article class="post-single">
+ <header class="post-header">
+ <h1 class="post-title">テキストファイルの末尾には改行コードを入れよう</h1>
+ <ul class="post-tags">
+ <li class="tag">
+ <a href="/tags/php/">PHP</a>
+ </li>
+ <li class="tag">
+ <a href="/tags/phpstudy-tokyo/">PHP 勉強会@東京</a>
+ </li>
+ </ul>
+ </header>
+ <div class="post-content">
+ <section>
+ <h2 id="changelog">更新履歴</h2>
+ <ol>
+ <li class="revision">
+ <time datetime="2023-06-21">2023-06-21</time>: 登壇
+ </li>
+ </ol>
+ </section>
+ <canvas data-slide-link="/slides/2023-06-21/phpstudy-tokyo-153/slide.pdf" id="slide">
+ </canvas>
+ <div>
+ <button id="prev">
+ Prev
+ </button>
+ <button id="next">
+ Next
+ </button>
+ </div>
+ <script src="/pdf.min.js?h=68f61939cb81f9ae70a7ee2af2e9dcf8">
+ </script>
+ <script src="/slide.js?h=851ec3f450457f6c7117cdac62926bf3" type="module">
+ </script>
+ </div>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/slides/2023-06-21/phpstudy-tokyo-153/slide.pdf b/vhosts/blog/public/slides/2023-06-21/phpstudy-tokyo-153/slide.pdf
new file mode 100644
index 00000000..53d14bac
--- /dev/null
+++ b/vhosts/blog/public/slides/2023-06-21/phpstudy-tokyo-153/slide.pdf
Binary files differ
diff --git a/vhosts/blog/public/slides/2023-06-23/phpconfuk-2023-eve/index.html b/vhosts/blog/public/slides/2023-06-23/phpconfuk-2023-eve/index.html
new file mode 100644
index 00000000..822043fc
--- /dev/null
+++ b/vhosts/blog/public/slides/2023-06-23/phpconfuk-2023-eve/index.html
@@ -0,0 +1,80 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2023 nsfisis">
+ <meta name="description" content="巨大なコードベースへ突撃するために">
+ <meta name="keywords" content="PHP,PHP カンファレンス福岡">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>PHP カンファレンス福岡 2023 前夜祭 (非公式) (レギュラートーク) | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ <link rel="stylesheet" href="/hl.css?h=340e65ffd5c17713efc9107c06304f7b">
+ </head>
+ <body class="single">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <article class="post-single">
+ <header class="post-header">
+ <h1 class="post-title">巨大なコードベースへ突撃するために</h1>
+ <ul class="post-tags">
+ <li class="tag">
+ <a href="/tags/php/">PHP</a>
+ </li>
+ <li class="tag">
+ <a href="/tags/phpconfuk/">PHP カンファレンス福岡</a>
+ </li>
+ </ul>
+ </header>
+ <div class="post-content">
+ <section>
+ <h2 id="changelog">更新履歴</h2>
+ <ol>
+ <li class="revision">
+ <time datetime="2023-06-23">2023-06-23</time>: 登壇
+ </li>
+ </ol>
+ </section>
+ <canvas data-slide-link="/slides/2023-06-23/phpconfuk-2023-eve/slide.pdf" id="slide">
+ </canvas>
+ <div>
+ <button id="prev">
+ Prev
+ </button>
+ <button id="next">
+ Next
+ </button>
+ </div>
+ <script src="/pdf.min.js?h=68f61939cb81f9ae70a7ee2af2e9dcf8">
+ </script>
+ <script src="/slide.js?h=851ec3f450457f6c7117cdac62926bf3" type="module">
+ </script>
+ </div>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/slides/2023-06-23/phpconfuk-2023-eve/slide.pdf b/vhosts/blog/public/slides/2023-06-23/phpconfuk-2023-eve/slide.pdf
new file mode 100644
index 00000000..648680e9
--- /dev/null
+++ b/vhosts/blog/public/slides/2023-06-23/phpconfuk-2023-eve/slide.pdf
Binary files differ
diff --git a/vhosts/blog/public/slides/2023-07-26/phpstudy-tokyo-154/index.html b/vhosts/blog/public/slides/2023-07-26/phpstudy-tokyo-154/index.html
new file mode 100644
index 00000000..36f560ee
--- /dev/null
+++ b/vhosts/blog/public/slides/2023-07-26/phpstudy-tokyo-154/index.html
@@ -0,0 +1,80 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2023 nsfisis">
+ <meta name="description" content="言語間で比較するエラーの通知と処理">
+ <meta name="keywords" content="PHP,PHP 勉強会@東京">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>PHP 勉強会@東京 第154 回 (レギュラートーク) | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ <link rel="stylesheet" href="/hl.css?h=340e65ffd5c17713efc9107c06304f7b">
+ </head>
+ <body class="single">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <article class="post-single">
+ <header class="post-header">
+ <h1 class="post-title">言語間で比較するエラーの通知と処理</h1>
+ <ul class="post-tags">
+ <li class="tag">
+ <a href="/tags/php/">PHP</a>
+ </li>
+ <li class="tag">
+ <a href="/tags/phpstudy-tokyo/">PHP 勉強会@東京</a>
+ </li>
+ </ul>
+ </header>
+ <div class="post-content">
+ <section>
+ <h2 id="changelog">更新履歴</h2>
+ <ol>
+ <li class="revision">
+ <time datetime="2023-07-26">2023-07-26</time>: 登壇
+ </li>
+ </ol>
+ </section>
+ <canvas data-slide-link="/slides/2023-07-26/phpstudy-tokyo-154/slide.pdf" id="slide">
+ </canvas>
+ <div>
+ <button id="prev">
+ Prev
+ </button>
+ <button id="next">
+ Next
+ </button>
+ </div>
+ <script src="/pdf.min.js?h=68f61939cb81f9ae70a7ee2af2e9dcf8">
+ </script>
+ <script src="/slide.js?h=851ec3f450457f6c7117cdac62926bf3" type="module">
+ </script>
+ </div>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/slides/2023-07-26/phpstudy-tokyo-154/slide.pdf b/vhosts/blog/public/slides/2023-07-26/phpstudy-tokyo-154/slide.pdf
new file mode 100644
index 00000000..e26c8d10
--- /dev/null
+++ b/vhosts/blog/public/slides/2023-07-26/phpstudy-tokyo-154/slide.pdf
Binary files differ
diff --git a/vhosts/blog/public/slides/2023-08-24/phpstudy-tokyo-155/index.html b/vhosts/blog/public/slides/2023-08-24/phpstudy-tokyo-155/index.html
new file mode 100644
index 00000000..19a3b048
--- /dev/null
+++ b/vhosts/blog/public/slides/2023-08-24/phpstudy-tokyo-155/index.html
@@ -0,0 +1,80 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2023 nsfisis">
+ <meta name="description" content="PHP 3.0 の処理系のソースを読んでみる">
+ <meta name="keywords" content="PHP,PHP 勉強会@東京">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>PHP 勉強会@東京 第155 回 (LT) | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ <link rel="stylesheet" href="/hl.css?h=340e65ffd5c17713efc9107c06304f7b">
+ </head>
+ <body class="single">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <article class="post-single">
+ <header class="post-header">
+ <h1 class="post-title">PHP 3.0 の処理系のソースを読んでみる</h1>
+ <ul class="post-tags">
+ <li class="tag">
+ <a href="/tags/php/">PHP</a>
+ </li>
+ <li class="tag">
+ <a href="/tags/phpstudy-tokyo/">PHP 勉強会@東京</a>
+ </li>
+ </ul>
+ </header>
+ <div class="post-content">
+ <section>
+ <h2 id="changelog">更新履歴</h2>
+ <ol>
+ <li class="revision">
+ <time datetime="2023-08-24">2023-08-24</time>: 登壇
+ </li>
+ </ol>
+ </section>
+ <canvas data-slide-link="/slides/2023-08-24/phpstudy-tokyo-155/slide.pdf" id="slide">
+ </canvas>
+ <div>
+ <button id="prev">
+ Prev
+ </button>
+ <button id="next">
+ Next
+ </button>
+ </div>
+ <script src="/pdf.min.js?h=68f61939cb81f9ae70a7ee2af2e9dcf8">
+ </script>
+ <script src="/slide.js?h=851ec3f450457f6c7117cdac62926bf3" type="module">
+ </script>
+ </div>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/slides/2023-08-24/phpstudy-tokyo-155/slide.pdf b/vhosts/blog/public/slides/2023-08-24/phpstudy-tokyo-155/slide.pdf
new file mode 100644
index 00000000..ead5c00d
--- /dev/null
+++ b/vhosts/blog/public/slides/2023-08-24/phpstudy-tokyo-155/slide.pdf
Binary files differ
diff --git a/vhosts/blog/public/slides/index.html b/vhosts/blog/public/slides/index.html
new file mode 100644
index 00000000..3db444fd
--- /dev/null
+++ b/vhosts/blog/public/slides/index.html
@@ -0,0 +1,194 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2021 nsfisis">
+ <meta name="description" content="登壇したイベントで使用したスライドの一覧">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>スライド一覧 | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ </head>
+ <body class="list">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <header class="page-header">
+ <h1>スライド一覧</h1>
+ </header>
+ <article class="post-entry">
+ <a href="/slides/2023-08-24/phpstudy-tokyo-155/">
+ <header class="entry-header">
+ <h2>登壇: PHP 勉強会@東京 第155 回 (LT)</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ PHP 3.0 の処理系のソースを読んでみる
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-08-24">2023-08-24</time> 登壇
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/slides/2023-07-26/phpstudy-tokyo-154/">
+ <header class="entry-header">
+ <h2>登壇: PHP 勉強会@東京 第154 回 (レギュラートーク)</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ 言語間で比較するエラーの通知と処理
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-07-26">2023-07-26</time> 登壇
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/slides/2023-06-23/phpconfuk-2023-eve/">
+ <header class="entry-header">
+ <h2>登壇: PHP カンファレンス福岡 2023 前夜祭 (非公式) (レギュラートーク)</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ 巨大なコードベースへ突撃するために
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-06-23">2023-06-23</time> 登壇
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/slides/2023-06-21/phpstudy-tokyo-153/">
+ <header class="entry-header">
+ <h2>登壇: PHP 勉強会@東京 第153 回 (LT)</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ テキストファイルの末尾には改行コードを入れよう
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-06-21">2023-06-21</time> 登壇
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/slides/2023-04-12/phpstudy-tokyo-151/">
+ <header class="entry-header">
+ <h2>登壇: PHP 勉強会@東京 第151 回 (LT)</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ list でない array の末尾を探す
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-04-12">2023-04-12</time> 登壇
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/slides/2023-03-25/phperkaigi-2023-tokens/">
+ <header class="entry-header">
+ <h2>登壇: PHPerKaigi 2023 (トークン解説セッション)</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ PHPer チャレンジ解説 (デジタルサーカス株式会社)
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-03-25">2023-03-25</time> 登壇
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/slides/2023-03-24/phperkaigi-2023/">
+ <header class="entry-header">
+ <h2>登壇: PHPerKaigi 2023 (レギュラートーク)</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ 詳説「参照」PHP の参照を完全に理解する
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-03-24">2023-03-24</time> 登壇
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/slides/2023-03-15/phpstudy-tokyo-150/">
+ <header class="entry-header">
+ <h2>登壇: PHP 勉強会@東京 第150 回 (LT)</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ 明日のあなたの役に立たない PHP コーディング技法~細長い FizzBuzz を書く~
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-03-15">2023-03-15</time> 登壇、<time datetime="2023-03-18">2023-03-18</time> 更新
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/slides/2023-02-15/phpstudy-tokyo-149/">
+ <header class="entry-header">
+ <h2>登壇: PHP 勉強会@東京 第149 回 (LT)</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ PHPerKaigi 2023 のトークン問題でボツにした問題を供養する
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-02-15">2023-02-15</time> 登壇
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/slides/2023-01-18/phpstudy-tokyo-148/">
+ <header class="entry-header">
+ <h2>登壇: PHP 勉強会@東京 第148 回 (LT)</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ 明日のあなたの役に立たない PHP コーディング技法~polyglot~
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-01-18">2023-01-18</time> 登壇
+ </footer>
+ </a>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/style.css b/vhosts/blog/public/style.css
new file mode 100644
index 00000000..8d7120af
--- /dev/null
+++ b/vhosts/blog/public/style.css
@@ -0,0 +1,269 @@
+html {
+ box-sizing: border-box;
+}
+
+*, *:before, *:after {
+ box-sizing: inherit;
+}
+
+body {
+ font-family: 'Yu Gothic', 'Meiryo', 'Noto Sans JP', sans-serif;
+ color: #000;
+ background-color: #fff;
+ line-height: 1.8;
+ height: 100vh;
+ margin: 0;
+ padding: 0;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+}
+
+header.header {
+ background-color: #f5f5f5;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 1rem 15%;
+ box-shadow: 0px 1px 5px rgba(0,0,0,0.1);
+}
+
+main {
+ max-width: 800px;
+ margin: 2rem auto;
+ flex-grow: 1;
+}
+
+body > footer {
+ background-color: #f5f5f5;
+ padding: 1rem 20%;
+ text-align: center;
+ box-shadow: 0px -1px 5px rgba(0,0,0,0.1);
+}
+
+nav {
+ font-size: 1.5rem;
+ padding: 0;
+ margin: 0;
+ width: 100%;
+}
+
+nav ul {
+ list-style-type: none;
+ padding: 0;
+ margin: 0;
+ display: flex;
+ flex-direction: row;
+}
+
+nav ul li {
+ margin: 0 1.2rem;
+}
+
+nav ul li:first-child {
+ font-weight: bold;
+ margin-right: auto;
+}
+
+nav ul li a {
+ border: none;
+ color: #000;
+}
+
+h1, h2, h3, h4, h5, h6 {
+ font-weight: bold;
+}
+
+p {
+ font-size: 1rem;
+ line-height: 1.8;
+ margin-bottom: 1.2rem;
+}
+
+a {
+ text-decoration: none;
+ color: #000;
+ border-bottom: 1px solid #000;
+}
+
+a:hover {
+ color: #666;
+}
+
+pre {
+ background-color: #f5f5f5;
+ padding: 1rem;
+ overflow-x: auto;
+ font-family: 'Courier New', Courier, monospace;
+ font-size: 0.9rem;
+}
+
+blockquote {
+ background-color: #f5f5f5;
+ border-left: 5px solid #555;
+ padding: 1rem;
+ margin: 1rem 0;
+}
+
+.tag {
+ display: inline-block;
+ background-color: #f5f5f5;
+ padding: 3px 8px;
+ border-radius: 5px;
+ font-size: 0.9rem;
+ margin-right: 5px;
+ margin-bottom: 5px;
+}
+
+.tag a {
+ border: none;
+}
+
+code {
+ background-color: #f5f5f5;
+ padding: 2px 5px;
+ font-family: 'Courier New', Courier, monospace;
+ font-size: 0.9rem;
+ border-radius: 3px;
+}
+
+pre code {
+ padding: 0;
+}
+
+li.revision {
+ list-style: inside;
+}
+
+h1 {
+ font-size: 2.2rem;
+}
+
+.post-content h2,
+.post-content h3,
+.post-content h4,
+.post-content h5,
+.post-content h6 {
+ border-bottom: 1px solid #555;
+ margin-bottom: 1.2rem;
+}
+
+.post-content h2 a,
+.post-content h3 a,
+.post-content h4 a,
+.post-content h5 a,
+.post-content h6 a {
+ border: none;
+}
+
+.post-content h2:before {
+ content: "#";
+ padding-right: 0.3rem;
+ color: #555;
+ font-weight: bold;
+}
+
+.post-content h3:before {
+ content: "##";
+ padding-right: 0.3rem;
+ color: #555;
+ font-weight: bold;
+}
+
+.post-content h4:before {
+ content: "###";
+ padding-right: 0.3rem;
+ color: #555;
+ font-weight: bold;
+}
+
+.post-content h5:before {
+ content: "####";
+ padding-right: 0.3rem;
+ color: #555;
+ font-weight: bold;
+}
+
+.post-content h6:before {
+ content: "#####";
+ padding-right: 0.3rem;
+ color: #555;
+ font-weight: bold;
+}
+
+.post-entry {
+ min-width: calc(min(800px, 100vw - 2rem));
+ background-color: #f5f5f5;
+ border-radius: 10px;
+ padding: 1.5rem;
+ margin: 2rem 0;
+ box-shadow: 0px 1px 5px rgba(0,0,0,0.1);
+}
+
+.post-entry header {
+ border: none;
+}
+
+.post-entry header h2 {
+ margin: 0;
+}
+
+.post-entry section {
+ color: #666;
+}
+
+.post-entry footer {
+ background-color: #f5f5f5;
+ padding: 0;
+ text-align: left;
+ color: #666;
+}
+
+.admonition {
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ background-color: #f5f5f5;
+ border: 1px solid #d1d1d1;
+ border-radius: 5px;
+ padding: 1rem;
+ margin: 1rem 0;
+ box-shadow: 0px 1px 5px rgba(0,0,0,0.1);
+}
+
+.admonition-label {
+ font-weight: bold;
+ color: #333;
+ margin-right: 1rem;
+}
+
+.admonition-content {
+ font-size: 1rem;
+}
+
+.not-found {
+ font-size: 8rem;
+ font-weight: bold;
+}
+
+@media screen and (max-width: 768px) {
+ main {
+ padding: 0 1rem;
+ }
+}
+
+@media screen and (max-width: 1200px) {
+ header.header {
+ padding: 1rem 0;
+ }
+
+ nav ul li:not(:first-child) {
+ display: none;
+ }
+}
+
+.my-icon {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
diff --git a/vhosts/blog/public/tags/conference/index.html b/vhosts/blog/public/tags/conference/index.html
new file mode 100644
index 00000000..ac414343
--- /dev/null
+++ b/vhosts/blog/public/tags/conference/index.html
@@ -0,0 +1,165 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2021 nsfisis">
+ <meta name="description" content="タグ「カンファレンス」のついた記事またはスライドの一覧">
+ <meta name="keywords" content="カンファレンス">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>タグ「カンファレンス」一覧 | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ </head>
+ <body class="list">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <header class="page-header">
+ <h1>タグ「カンファレンス」一覧</h1>
+ </header>
+ <article class="post-entry">
+ <a href="/posts/2023-06-25/phpconfuk-2023-report/">
+ <header class="entry-header">
+ <h2>PHP カンファレンス福岡 2023 参加レポ</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ 2023-06-24 に開催された、PHP カンファレンス福岡に参加した。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-06-25">2023-06-25</time> 投稿
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2023-04-04/phperkaigi-2023-report/">
+ <header class="entry-header">
+ <h2>PHPerKaigi 2023 参加レポ</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ 2023-03-23 から 2023-03-25 にかけて開催された、PHPerKaigi 2023 に参加した。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-04-04">2023-04-04</time> 投稿、<time datetime="2023-06-28">2023-06-28</time> 更新
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/slides/2023-03-25/phperkaigi-2023-tokens/">
+ <header class="entry-header">
+ <h2>登壇: PHPerKaigi 2023 (トークン解説セッション)</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ PHPer チャレンジ解説 (デジタルサーカス株式会社)
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-03-25">2023-03-25</time> 登壇
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/slides/2023-03-24/phperkaigi-2023/">
+ <header class="entry-header">
+ <h2>登壇: PHPerKaigi 2023 (レギュラートーク)</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ 詳説「参照」PHP の参照を完全に理解する
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-03-24">2023-03-24</time> 登壇
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2022-08-27/php-conference-okinawa-code-golf/">
+ <header class="entry-header">
+ <h2>PHP カンファレンス沖縄で出題されたコードゴルフの問題を解いてみた</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ PHP カンファレンス沖縄の懇親会 LT で出題されたコードゴルフの問題を解いてみた。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2022-08-27">2022-08-27</time> 投稿
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2022-05-01/phperkaigi-2022/">
+ <header class="entry-header">
+ <h2>PHPerKaigi 2022</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ 2022-04-09 から 2022-04-11 にかけて開催された、PHPerKaigi 2022 に参加した。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2022-05-01">2022-05-01</time> 投稿
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2022-04-09/phperkaigi-2022-tokens/">
+ <header class="entry-header">
+ <h2>PHPerKaigi 2022 トークン問題の解説</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ PHPerKaigi 2022 で私が作成した PHPer チャレンジ問題を解説する。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2022-04-09">2022-04-09</time> 投稿、<time datetime="2022-04-16">2022-04-16</time> 更新
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2021-03-30/phperkaigi-2021/">
+ <header class="entry-header">
+ <h2>PHPerKaigi 2021</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ 2021-03-26 から 2021-03-28 にかけて開催された、PHPerKaigi 2021 に参加した。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2021-03-30">2021-03-30</time> 投稿
+ </footer>
+ </a>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/tags/cpp/index.html b/vhosts/blog/public/tags/cpp/index.html
new file mode 100644
index 00000000..9a2ab96c
--- /dev/null
+++ b/vhosts/blog/public/tags/cpp/index.html
@@ -0,0 +1,60 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2021 nsfisis">
+ <meta name="description" content="タグ「C++」のついた記事またはスライドの一覧">
+ <meta name="keywords" content="C++">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>タグ「C++」一覧 | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ </head>
+ <body class="list">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <header class="page-header">
+ <h1>タグ「C++」一覧</h1>
+ </header>
+ <article class="post-entry">
+ <a href="/posts/2021-10-02/cpp-you-can-use-keywords-in-attributes/">
+ <header class="entry-header">
+ <h2>【C++】 属性構文の属性名にはキーワードが使える</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ C++ の属性構文の属性名には、キーワードが使える。ネタ記事。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2021-10-02">2021-10-02</time> 投稿
+ </footer>
+ </a>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/tags/cpp17/index.html b/vhosts/blog/public/tags/cpp17/index.html
new file mode 100644
index 00000000..e6501513
--- /dev/null
+++ b/vhosts/blog/public/tags/cpp17/index.html
@@ -0,0 +1,60 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2021 nsfisis">
+ <meta name="description" content="タグ「C++ 17」のついた記事またはスライドの一覧">
+ <meta name="keywords" content="C++ 17">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>タグ「C++ 17」一覧 | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ </head>
+ <body class="list">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <header class="page-header">
+ <h1>タグ「C++ 17」一覧</h1>
+ </header>
+ <article class="post-entry">
+ <a href="/posts/2021-10-02/cpp-you-can-use-keywords-in-attributes/">
+ <header class="entry-header">
+ <h2>【C++】 属性構文の属性名にはキーワードが使える</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ C++ の属性構文の属性名には、キーワードが使える。ネタ記事。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2021-10-02">2021-10-02</time> 投稿
+ </footer>
+ </a>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/tags/index.html b/vhosts/blog/public/tags/index.html
new file mode 100644
index 00000000..0fe5ba1b
--- /dev/null
+++ b/vhosts/blog/public/tags/index.html
@@ -0,0 +1,149 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2021 nsfisis">
+ <meta name="description" content="タグの一覧">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>タグ一覧 | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ </head>
+ <body class="list">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <header class="page-header">
+ <h1>タグ一覧</h1>
+ </header>
+ <article class="post-entry">
+ <a href="/tags/conference/">
+ <header class="entry-header">
+ <h2>カンファレンス</h2>
+ </header>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/tags/cpp/">
+ <header class="entry-header">
+ <h2>C++</h2>
+ </header>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/tags/cpp17/">
+ <header class="entry-header">
+ <h2>C++ 17</h2>
+ </header>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/tags/note-to-self/">
+ <header class="entry-header">
+ <h2>備忘録</h2>
+ </header>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/tags/php/">
+ <header class="entry-header">
+ <h2>PHP</h2>
+ </header>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/tags/phpcon/">
+ <header class="entry-header">
+ <h2>PHP カンファレンス</h2>
+ </header>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/tags/phpconfuk/">
+ <header class="entry-header">
+ <h2>PHP カンファレンス福岡</h2>
+ </header>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/tags/phperkaigi/">
+ <header class="entry-header">
+ <h2>PHPerKaigi</h2>
+ </header>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/tags/phpstudy-tokyo/">
+ <header class="entry-header">
+ <h2>PHP 勉強会@東京</h2>
+ </header>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/tags/python/">
+ <header class="entry-header">
+ <h2>Python</h2>
+ </header>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/tags/python3/">
+ <header class="entry-header">
+ <h2>Python 3</h2>
+ </header>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/tags/ruby/">
+ <header class="entry-header">
+ <h2>Ruby</h2>
+ </header>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/tags/ruby3/">
+ <header class="entry-header">
+ <h2>Ruby 3</h2>
+ </header>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/tags/rust/">
+ <header class="entry-header">
+ <h2>Rust</h2>
+ </header>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/tags/vim/">
+ <header class="entry-header">
+ <h2>Vim</h2>
+ </header>
+ </a>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/tags/note-to-self/index.html b/vhosts/blog/public/tags/note-to-self/index.html
new file mode 100644
index 00000000..07f907b3
--- /dev/null
+++ b/vhosts/blog/public/tags/note-to-self/index.html
@@ -0,0 +1,60 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2022 nsfisis">
+ <meta name="description" content="タグ「備忘録」のついた記事またはスライドの一覧">
+ <meta name="keywords" content="備忘録">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>タグ「備忘録」一覧 | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ </head>
+ <body class="list">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <header class="page-header">
+ <h1>タグ「備忘録」一覧</h1>
+ </header>
+ <article class="post-entry">
+ <a href="/posts/2022-10-28/setup-server-for-this-site/">
+ <header class="entry-header">
+ <h2>【備忘録】 このサイト用の VPS をセットアップしたときのメモ</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ GitHub Pages でホストしていたこのサイトを VPS へ移行したので、そのときにやったことのメモ。99 % 自分用。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2022-10-28">2022-10-28</time> 投稿、<time datetime="2023-08-30">2023-08-30</time> 更新
+ </footer>
+ </a>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/tags/php/index.html b/vhosts/blog/public/tags/php/index.html
new file mode 100644
index 00000000..3d217d70
--- /dev/null
+++ b/vhosts/blog/public/tags/php/index.html
@@ -0,0 +1,345 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2021 nsfisis">
+ <meta name="description" content="タグ「PHP」のついた記事またはスライドの一覧">
+ <meta name="keywords" content="PHP">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>タグ「PHP」一覧 | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ </head>
+ <body class="list">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <header class="page-header">
+ <h1>タグ「PHP」一覧</h1>
+ </header>
+ <article class="post-entry">
+ <a href="/slides/2023-08-24/phpstudy-tokyo-155/">
+ <header class="entry-header">
+ <h2>登壇: PHP 勉強会@東京 第155 回 (LT)</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ PHP 3.0 の処理系のソースを読んでみる
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-08-24">2023-08-24</time> 登壇
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/slides/2023-07-26/phpstudy-tokyo-154/">
+ <header class="entry-header">
+ <h2>登壇: PHP 勉強会@東京 第154 回 (レギュラートーク)</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ 言語間で比較するエラーの通知と処理
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-07-26">2023-07-26</time> 登壇
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2023-06-25/phpconfuk-2023-report/">
+ <header class="entry-header">
+ <h2>PHP カンファレンス福岡 2023 参加レポ</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ 2023-06-24 に開催された、PHP カンファレンス福岡に参加した。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-06-25">2023-06-25</time> 投稿
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/slides/2023-06-23/phpconfuk-2023-eve/">
+ <header class="entry-header">
+ <h2>登壇: PHP カンファレンス福岡 2023 前夜祭 (非公式) (レギュラートーク)</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ 巨大なコードベースへ突撃するために
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-06-23">2023-06-23</time> 登壇
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/slides/2023-06-21/phpstudy-tokyo-153/">
+ <header class="entry-header">
+ <h2>登壇: PHP 勉強会@東京 第153 回 (LT)</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ テキストファイルの末尾には改行コードを入れよう
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-06-21">2023-06-21</time> 登壇
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/slides/2023-04-12/phpstudy-tokyo-151/">
+ <header class="entry-header">
+ <h2>登壇: PHP 勉強会@東京 第151 回 (LT)</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ list でない array の末尾を探す
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-04-12">2023-04-12</time> 登壇
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2023-04-04/phperkaigi-2023-report/">
+ <header class="entry-header">
+ <h2>PHPerKaigi 2023 参加レポ</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ 2023-03-23 から 2023-03-25 にかけて開催された、PHPerKaigi 2023 に参加した。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-04-04">2023-04-04</time> 投稿、<time datetime="2023-06-28">2023-06-28</time> 更新
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/slides/2023-03-25/phperkaigi-2023-tokens/">
+ <header class="entry-header">
+ <h2>登壇: PHPerKaigi 2023 (トークン解説セッション)</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ PHPer チャレンジ解説 (デジタルサーカス株式会社)
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-03-25">2023-03-25</time> 登壇
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/slides/2023-03-24/phperkaigi-2023/">
+ <header class="entry-header">
+ <h2>登壇: PHPerKaigi 2023 (レギュラートーク)</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ 詳説「参照」PHP の参照を完全に理解する
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-03-24">2023-03-24</time> 登壇
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/slides/2023-03-15/phpstudy-tokyo-150/">
+ <header class="entry-header">
+ <h2>登壇: PHP 勉強会@東京 第150 回 (LT)</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ 明日のあなたの役に立たない PHP コーディング技法~細長い FizzBuzz を書く~
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-03-15">2023-03-15</time> 登壇、<time datetime="2023-03-18">2023-03-18</time> 更新
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/slides/2023-02-15/phpstudy-tokyo-149/">
+ <header class="entry-header">
+ <h2>登壇: PHP 勉強会@東京 第149 回 (LT)</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ PHPerKaigi 2023 のトークン問題でボツにした問題を供養する
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-02-15">2023-02-15</time> 登壇
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/slides/2023-01-18/phpstudy-tokyo-148/">
+ <header class="entry-header">
+ <h2>登壇: PHP 勉強会@東京 第148 回 (LT)</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ 明日のあなたの役に立たない PHP コーディング技法~polyglot~
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-01-18">2023-01-18</time> 登壇
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2023-01-10/phperkaigi-2023-unused-token-quiz-3/">
+ <header class="entry-header">
+ <h2>PHPerKaigi 2023: ボツになったトークン問題 その 3</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ 来年の PHPerKaigi 2023 でデジタルサーカス株式会社から出題予定のトークン問題のうち、ボツになった問題を公開する (その 3)。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-01-10">2023-01-10</time> 投稿
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2022-11-19/phperkaigi-2023-unused-token-quiz-2/">
+ <header class="entry-header">
+ <h2>PHPerKaigi 2023: ボツになったトークン問題 その 2</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ 来年の PHPerKaigi 2023 でデジタルサーカス株式会社から出題予定のトークン問題のうち、ボツになった問題を公開する (その 2)。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2022-11-19">2022-11-19</time> 投稿
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2022-10-23/phperkaigi-2023-unused-token-quiz-1/">
+ <header class="entry-header">
+ <h2>PHPerKaigi 2023: ボツになったトークン問題 その 1</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ 来年の PHPerKaigi 2023 でデジタルサーカス株式会社から出題予定のトークン問題のうち、ボツになった問題を公開する (その 1)。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2022-10-23">2022-10-23</time> 投稿
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2022-09-29/write-fizzbuzz-in-php-2-letters-per-line/">
+ <header class="entry-header">
+ <h2>【PHP】 fizzbuzz を書く。1行あたり2文字で。</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ PHP で、fizzbuzz を書いた。ただし、1行あたりに使える文字数は2文字まで。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2022-09-28">2022-09-28</time> 投稿、<time datetime="2022-09-29">2022-09-29</time> 更新
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2022-08-27/php-conference-okinawa-code-golf/">
+ <header class="entry-header">
+ <h2>PHP カンファレンス沖縄で出題されたコードゴルフの問題を解いてみた</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ PHP カンファレンス沖縄の懇親会 LT で出題されたコードゴルフの問題を解いてみた。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2022-08-27">2022-08-27</time> 投稿
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2022-05-01/phperkaigi-2022/">
+ <header class="entry-header">
+ <h2>PHPerKaigi 2022</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ 2022-04-09 から 2022-04-11 にかけて開催された、PHPerKaigi 2022 に参加した。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2022-05-01">2022-05-01</time> 投稿
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2022-04-09/phperkaigi-2022-tokens/">
+ <header class="entry-header">
+ <h2>PHPerKaigi 2022 トークン問題の解説</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ PHPerKaigi 2022 で私が作成した PHPer チャレンジ問題を解説する。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2022-04-09">2022-04-09</time> 投稿、<time datetime="2022-04-16">2022-04-16</time> 更新
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2021-03-30/phperkaigi-2021/">
+ <header class="entry-header">
+ <h2>PHPerKaigi 2021</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ 2021-03-26 から 2021-03-28 にかけて開催された、PHPerKaigi 2021 に参加した。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2021-03-30">2021-03-30</time> 投稿
+ </footer>
+ </a>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/tags/phpcon/index.html b/vhosts/blog/public/tags/phpcon/index.html
new file mode 100644
index 00000000..7d54b656
--- /dev/null
+++ b/vhosts/blog/public/tags/phpcon/index.html
@@ -0,0 +1,60 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2022 nsfisis">
+ <meta name="description" content="タグ「PHP カンファレンス」のついた記事またはスライドの一覧">
+ <meta name="keywords" content="PHP カンファレンス">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>タグ「PHP カンファレンス」一覧 | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ </head>
+ <body class="list">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <header class="page-header">
+ <h1>タグ「PHP カンファレンス」一覧</h1>
+ </header>
+ <article class="post-entry">
+ <a href="/posts/2022-08-27/php-conference-okinawa-code-golf/">
+ <header class="entry-header">
+ <h2>PHP カンファレンス沖縄で出題されたコードゴルフの問題を解いてみた</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ PHP カンファレンス沖縄の懇親会 LT で出題されたコードゴルフの問題を解いてみた。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2022-08-27">2022-08-27</time> 投稿
+ </footer>
+ </a>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/tags/phpconfuk/index.html b/vhosts/blog/public/tags/phpconfuk/index.html
new file mode 100644
index 00000000..574d2f93
--- /dev/null
+++ b/vhosts/blog/public/tags/phpconfuk/index.html
@@ -0,0 +1,75 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2023 nsfisis">
+ <meta name="description" content="タグ「PHP カンファレンス福岡」のついた記事またはスライドの一覧">
+ <meta name="keywords" content="PHP カンファレンス福岡">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>タグ「PHP カンファレンス福岡」一覧 | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ </head>
+ <body class="list">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <header class="page-header">
+ <h1>タグ「PHP カンファレンス福岡」一覧</h1>
+ </header>
+ <article class="post-entry">
+ <a href="/posts/2023-06-25/phpconfuk-2023-report/">
+ <header class="entry-header">
+ <h2>PHP カンファレンス福岡 2023 参加レポ</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ 2023-06-24 に開催された、PHP カンファレンス福岡に参加した。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-06-25">2023-06-25</time> 投稿
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/slides/2023-06-23/phpconfuk-2023-eve/">
+ <header class="entry-header">
+ <h2>登壇: PHP カンファレンス福岡 2023 前夜祭 (非公式) (レギュラートーク)</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ 巨大なコードベースへ突撃するために
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-06-23">2023-06-23</time> 登壇
+ </footer>
+ </a>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/tags/phperkaigi/index.html b/vhosts/blog/public/tags/phperkaigi/index.html
new file mode 100644
index 00000000..25375e60
--- /dev/null
+++ b/vhosts/blog/public/tags/phperkaigi/index.html
@@ -0,0 +1,180 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2021 nsfisis">
+ <meta name="description" content="タグ「PHPerKaigi」のついた記事またはスライドの一覧">
+ <meta name="keywords" content="PHPerKaigi">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>タグ「PHPerKaigi」一覧 | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ </head>
+ <body class="list">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <header class="page-header">
+ <h1>タグ「PHPerKaigi」一覧</h1>
+ </header>
+ <article class="post-entry">
+ <a href="/posts/2023-04-04/phperkaigi-2023-report/">
+ <header class="entry-header">
+ <h2>PHPerKaigi 2023 参加レポ</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ 2023-03-23 から 2023-03-25 にかけて開催された、PHPerKaigi 2023 に参加した。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-04-04">2023-04-04</time> 投稿、<time datetime="2023-06-28">2023-06-28</time> 更新
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/slides/2023-03-25/phperkaigi-2023-tokens/">
+ <header class="entry-header">
+ <h2>登壇: PHPerKaigi 2023 (トークン解説セッション)</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ PHPer チャレンジ解説 (デジタルサーカス株式会社)
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-03-25">2023-03-25</time> 登壇
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/slides/2023-03-24/phperkaigi-2023/">
+ <header class="entry-header">
+ <h2>登壇: PHPerKaigi 2023 (レギュラートーク)</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ 詳説「参照」PHP の参照を完全に理解する
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-03-24">2023-03-24</time> 登壇
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2023-01-10/phperkaigi-2023-unused-token-quiz-3/">
+ <header class="entry-header">
+ <h2>PHPerKaigi 2023: ボツになったトークン問題 その 3</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ 来年の PHPerKaigi 2023 でデジタルサーカス株式会社から出題予定のトークン問題のうち、ボツになった問題を公開する (その 3)。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-01-10">2023-01-10</time> 投稿
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2022-11-19/phperkaigi-2023-unused-token-quiz-2/">
+ <header class="entry-header">
+ <h2>PHPerKaigi 2023: ボツになったトークン問題 その 2</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ 来年の PHPerKaigi 2023 でデジタルサーカス株式会社から出題予定のトークン問題のうち、ボツになった問題を公開する (その 2)。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2022-11-19">2022-11-19</time> 投稿
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2022-10-23/phperkaigi-2023-unused-token-quiz-1/">
+ <header class="entry-header">
+ <h2>PHPerKaigi 2023: ボツになったトークン問題 その 1</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ 来年の PHPerKaigi 2023 でデジタルサーカス株式会社から出題予定のトークン問題のうち、ボツになった問題を公開する (その 1)。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2022-10-23">2022-10-23</time> 投稿
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2022-05-01/phperkaigi-2022/">
+ <header class="entry-header">
+ <h2>PHPerKaigi 2022</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ 2022-04-09 から 2022-04-11 にかけて開催された、PHPerKaigi 2022 に参加した。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2022-05-01">2022-05-01</time> 投稿
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2022-04-09/phperkaigi-2022-tokens/">
+ <header class="entry-header">
+ <h2>PHPerKaigi 2022 トークン問題の解説</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ PHPerKaigi 2022 で私が作成した PHPer チャレンジ問題を解説する。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2022-04-09">2022-04-09</time> 投稿、<time datetime="2022-04-16">2022-04-16</time> 更新
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2021-03-30/phperkaigi-2021/">
+ <header class="entry-header">
+ <h2>PHPerKaigi 2021</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ 2021-03-26 から 2021-03-28 にかけて開催された、PHPerKaigi 2021 に参加した。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2021-03-30">2021-03-30</time> 投稿
+ </footer>
+ </a>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/tags/phpstudy-tokyo/index.html b/vhosts/blog/public/tags/phpstudy-tokyo/index.html
new file mode 100644
index 00000000..ebbb0246
--- /dev/null
+++ b/vhosts/blog/public/tags/phpstudy-tokyo/index.html
@@ -0,0 +1,150 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2023 nsfisis">
+ <meta name="description" content="タグ「PHP 勉強会@東京」のついた記事またはスライドの一覧">
+ <meta name="keywords" content="PHP 勉強会@東京">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>タグ「PHP 勉強会@東京」一覧 | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ </head>
+ <body class="list">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <header class="page-header">
+ <h1>タグ「PHP 勉強会@東京」一覧</h1>
+ </header>
+ <article class="post-entry">
+ <a href="/slides/2023-08-24/phpstudy-tokyo-155/">
+ <header class="entry-header">
+ <h2>登壇: PHP 勉強会@東京 第155 回 (LT)</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ PHP 3.0 の処理系のソースを読んでみる
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-08-24">2023-08-24</time> 登壇
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/slides/2023-07-26/phpstudy-tokyo-154/">
+ <header class="entry-header">
+ <h2>登壇: PHP 勉強会@東京 第154 回 (レギュラートーク)</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ 言語間で比較するエラーの通知と処理
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-07-26">2023-07-26</time> 登壇
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/slides/2023-06-21/phpstudy-tokyo-153/">
+ <header class="entry-header">
+ <h2>登壇: PHP 勉強会@東京 第153 回 (LT)</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ テキストファイルの末尾には改行コードを入れよう
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-06-21">2023-06-21</time> 登壇
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/slides/2023-04-12/phpstudy-tokyo-151/">
+ <header class="entry-header">
+ <h2>登壇: PHP 勉強会@東京 第151 回 (LT)</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ list でない array の末尾を探す
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-04-12">2023-04-12</time> 登壇
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/slides/2023-03-15/phpstudy-tokyo-150/">
+ <header class="entry-header">
+ <h2>登壇: PHP 勉強会@東京 第150 回 (LT)</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ 明日のあなたの役に立たない PHP コーディング技法~細長い FizzBuzz を書く~
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-03-15">2023-03-15</time> 登壇、<time datetime="2023-03-18">2023-03-18</time> 更新
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/slides/2023-02-15/phpstudy-tokyo-149/">
+ <header class="entry-header">
+ <h2>登壇: PHP 勉強会@東京 第149 回 (LT)</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ PHPerKaigi 2023 のトークン問題でボツにした問題を供養する
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-02-15">2023-02-15</time> 登壇
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/slides/2023-01-18/phpstudy-tokyo-148/">
+ <header class="entry-header">
+ <h2>登壇: PHP 勉強会@東京 第148 回 (LT)</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ 明日のあなたの役に立たない PHP コーディング技法~polyglot~
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2023-01-18">2023-01-18</time> 登壇
+ </footer>
+ </a>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/tags/python/index.html b/vhosts/blog/public/tags/python/index.html
new file mode 100644
index 00000000..0a18db30
--- /dev/null
+++ b/vhosts/blog/public/tags/python/index.html
@@ -0,0 +1,60 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2021 nsfisis">
+ <meta name="description" content="タグ「Python」のついた記事またはスライドの一覧">
+ <meta name="keywords" content="Python">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>タグ「Python」一覧 | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ </head>
+ <body class="list">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <header class="page-header">
+ <h1>タグ「Python」一覧</h1>
+ </header>
+ <article class="post-entry">
+ <a href="/posts/2021-10-02/python-unbound-local-error/">
+ <header class="entry-header">
+ <h2>【Python】 クロージャとUnboundLocalError: local variable &apos;x&apos; referenced before assignment</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ Python における UnboundLocalError の理由と対処法。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2021-10-02">2021-10-02</time> 投稿
+ </footer>
+ </a>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/tags/python3/index.html b/vhosts/blog/public/tags/python3/index.html
new file mode 100644
index 00000000..7d5e8c9d
--- /dev/null
+++ b/vhosts/blog/public/tags/python3/index.html
@@ -0,0 +1,60 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2021 nsfisis">
+ <meta name="description" content="タグ「Python 3」のついた記事またはスライドの一覧">
+ <meta name="keywords" content="Python 3">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>タグ「Python 3」一覧 | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ </head>
+ <body class="list">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <header class="page-header">
+ <h1>タグ「Python 3」一覧</h1>
+ </header>
+ <article class="post-entry">
+ <a href="/posts/2021-10-02/python-unbound-local-error/">
+ <header class="entry-header">
+ <h2>【Python】 クロージャとUnboundLocalError: local variable &apos;x&apos; referenced before assignment</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ Python における UnboundLocalError の理由と対処法。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2021-10-02">2021-10-02</time> 投稿
+ </footer>
+ </a>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/tags/ruby/index.html b/vhosts/blog/public/tags/ruby/index.html
new file mode 100644
index 00000000..6cdf4c1d
--- /dev/null
+++ b/vhosts/blog/public/tags/ruby/index.html
@@ -0,0 +1,75 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2021 nsfisis">
+ <meta name="description" content="タグ「Ruby」のついた記事またはスライドの一覧">
+ <meta name="keywords" content="Ruby">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>タグ「Ruby」一覧 | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ </head>
+ <body class="list">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <header class="page-header">
+ <h1>タグ「Ruby」一覧</h1>
+ </header>
+ <article class="post-entry">
+ <a href="/posts/2021-10-02/ruby-detect-running-implementation/">
+ <header class="entry-header">
+ <h2>【Ruby】 自身を実行している処理系の種類を判定する</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ Ruby には複数の実装があるが、自身を実行している処理系の種類をスクリプト上からどのように判定すればよいだろうか。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2021-10-02">2021-10-02</time> 投稿
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2021-10-02/ruby-then-keyword-and-case-in/">
+ <header class="entry-header">
+ <h2>【Ruby】 then キーワードと case in</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ Ruby 3.0 で追加される case in 構文と、then キーワードについて。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2021-10-02">2021-10-02</time> 投稿
+ </footer>
+ </a>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/tags/ruby3/index.html b/vhosts/blog/public/tags/ruby3/index.html
new file mode 100644
index 00000000..91592d81
--- /dev/null
+++ b/vhosts/blog/public/tags/ruby3/index.html
@@ -0,0 +1,60 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2021 nsfisis">
+ <meta name="description" content="タグ「Ruby 3」のついた記事またはスライドの一覧">
+ <meta name="keywords" content="Ruby 3">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>タグ「Ruby 3」一覧 | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ </head>
+ <body class="list">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <header class="page-header">
+ <h1>タグ「Ruby 3」一覧</h1>
+ </header>
+ <article class="post-entry">
+ <a href="/posts/2021-10-02/ruby-then-keyword-and-case-in/">
+ <header class="entry-header">
+ <h2>【Ruby】 then キーワードと case in</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ Ruby 3.0 で追加される case in 構文と、then キーワードについて。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2021-10-02">2021-10-02</time> 投稿
+ </footer>
+ </a>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/tags/rust/index.html b/vhosts/blog/public/tags/rust/index.html
new file mode 100644
index 00000000..d8aacb40
--- /dev/null
+++ b/vhosts/blog/public/tags/rust/index.html
@@ -0,0 +1,60 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2021 nsfisis">
+ <meta name="description" content="タグ「Rust」のついた記事またはスライドの一覧">
+ <meta name="keywords" content="Rust">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>タグ「Rust」一覧 | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ </head>
+ <body class="list">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <header class="page-header">
+ <h1>タグ「Rust」一覧</h1>
+ </header>
+ <article class="post-entry">
+ <a href="/posts/2021-10-02/rust-where-are-primitive-types-from/">
+ <header class="entry-header">
+ <h2>Rust のプリミティブ型はどこからやって来るか</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ Rust のプリミティブ型は予約語ではなく普通の識別子である。どのようにこれが名前解決されるのかを調べた。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2021-10-02">2021-10-02</time> 投稿
+ </footer>
+ </a>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/public/tags/vim/index.html b/vhosts/blog/public/tags/vim/index.html
new file mode 100644
index 00000000..d8587ab4
--- /dev/null
+++ b/vhosts/blog/public/tags/vim/index.html
@@ -0,0 +1,75 @@
+<!DOCTYPE html>
+<html lang="ja-JP">
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="author" content="nsfisis">
+ <meta name="copyright" content="&copy; 2021 nsfisis">
+ <meta name="description" content="タグ「Vim」のついた記事またはスライドの一覧">
+ <meta name="keywords" content="Vim">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">
+ <title>タグ「Vim」一覧 | REPL: Rest-Eat-Program Loop</title>
+ <link rel="stylesheet" href="/style.css?h=37fff6a2f0eef473abde58e55f28ea69">
+ </head>
+ <body class="list">
+ <header class="header">
+ <nav class="nav">
+ <ul>
+ <li>
+ <a href="/">REPL: Rest-Eat-Program Loop</a>
+ </li>
+ <li>
+ <a href="/about/">About</a>
+ </li>
+ <li>
+ <a href="/posts/">Posts</a>
+ </li>
+ <li>
+ <a href="/slides/">Slides</a>
+ </li>
+ <li>
+ <a href="/tags/">Tags</a>
+ </li>
+ </ul>
+ </nav>
+ </header>
+ <main class="main">
+ <header class="page-header">
+ <h1>タグ「Vim」一覧</h1>
+ </header>
+ <article class="post-entry">
+ <a href="/posts/2021-10-02/vim-difference-between-autocmd-bufwrite-and-bufwritepre/">
+ <header class="entry-header">
+ <h2>【Vim】 autocmd events の BufWrite/BufWritePre の違い</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ Vim の autocmd events における BufWrite/BufWritePre がどう違うのかを調べた結果、違いはないことがわかった。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2021-10-02">2021-10-02</time> 投稿
+ </footer>
+ </a>
+ </article>
+ <article class="post-entry">
+ <a href="/posts/2021-10-02/vim-swap-order-of-selected-lines/">
+ <header class="entry-header">
+ <h2>Vimで選択した行の順番を入れ替える</h2>
+ </header>
+ <section class="entry-content">
+ <p>
+ Vim で選択した行の順番を入れ替える方法。
+ </p>
+ </section>
+ <footer class="entry-footer">
+ <time datetime="2021-10-02">2021-10-02</time> 投稿
+ </footer>
+ </a>
+ </article>
+ </main>
+ <footer class="footer">
+ &copy; 2021 nsfisis
+ </footer>
+ </body>
+</html>
diff --git a/vhosts/blog/static/favicon.svg b/vhosts/blog/static/favicon.svg
new file mode 100644
index 00000000..923d78b1
--- /dev/null
+++ b/vhosts/blog/static/favicon.svg
@@ -0,0 +1,61 @@
+<?xml version="1.0"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg
+ width="100" height="100" viewBox="0 0 100 100"
+ xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
+>
+ <defs>
+ <g id="favicon.l">
+ <line x1="50" y1="5" x2="50" y2="50" stroke="white" stroke-width="2"/>
+ <path d="M 50 10 L 46 5 L 54 5" fill="white"/>
+ <path d="M 50 30 L 47 50 L 53 50" fill="white"/>
+ </g>
+ <g id="favicon.s">
+ <rect x="0" y="0" width="10" height="10" fill-opacity="0.75"/>
+ </g>
+ </defs>
+ <circle cx="50" cy="50" r="50" fill="orange"/>
+
+ <circle cx="50" cy="50" r="45" fill="transparent" stroke="white" stroke-width="4"/>
+ <use xlink:href="#favicon.l" transform="rotate( 0, 50, 50)"/>
+ <use xlink:href="#favicon.l" transform="rotate( 36, 50, 50)"/>
+ <use xlink:href="#favicon.l" transform="rotate( 72, 50, 50)"/>
+ <use xlink:href="#favicon.l" transform="rotate(108, 50, 50)"/>
+ <use xlink:href="#favicon.l" transform="rotate(144, 50, 50)"/>
+ <use xlink:href="#favicon.l" transform="rotate(180, 50, 50)"/>
+ <use xlink:href="#favicon.l" transform="rotate(216, 50, 50)"/>
+ <use xlink:href="#favicon.l" transform="rotate(252, 50, 50)"/>
+ <use xlink:href="#favicon.l" transform="rotate(288, 50, 50)"/>
+ <use xlink:href="#favicon.l" transform="rotate(324, 50, 50)"/>
+
+ <use xlink:href="#favicon.s" x="50" y="0" fill="darkorange"/>
+ <use xlink:href="#favicon.s" x="50" y="20" fill="gold"/>
+ <use xlink:href="#favicon.s" x="50" y="30" fill="orange"/>
+ <use xlink:href="#favicon.s" x="50" y="70" fill="orange"/>
+ <use xlink:href="#favicon.s" x="50" y="90" fill="gold"/>
+ <use xlink:href="#favicon.s" x="60" y="10" fill="orange"/>
+ <use xlink:href="#favicon.s" x="60" y="20" fill="orange"/>
+ <use xlink:href="#favicon.s" x="60" y="30" fill="gold"/>
+ <use xlink:href="#favicon.s" x="60" y="50" fill="gold"/>
+ <use xlink:href="#favicon.s" x="60" y="70" fill="gold"/>
+ <use xlink:href="#favicon.s" x="60" y="80" fill="gold"/>
+ <use xlink:href="#favicon.s" x="70" y="0" fill="#ffcd72"/>
+ <use xlink:href="#favicon.s" x="70" y="10" fill="orange"/>
+ <use xlink:href="#favicon.s" x="70" y="20" fill="gold"/>
+ <use xlink:href="#favicon.s" x="70" y="30" fill="gold"/>
+ <use xlink:href="#favicon.s" x="70" y="70" fill="darkorange"/>
+ <use xlink:href="#favicon.s" x="70" y="90" fill="#ffcd72"/>
+ <use xlink:href="#favicon.s" x="80" y="10" fill="#ffd27f"/>
+ <use xlink:href="#favicon.s" x="80" y="20" fill="orange"/>
+ <use xlink:href="#favicon.s" x="80" y="40" fill="gold"/>
+ <use xlink:href="#favicon.s" x="80" y="60" fill="orange"/>
+ <use xlink:href="#favicon.s" x="80" y="70" fill="orange"/>
+ <use xlink:href="#favicon.s" x="80" y="80" fill="#ffd27f"/>
+ <use xlink:href="#favicon.s" x="90" y="30" fill="#ffc04c"/>
+ <use xlink:href="#favicon.s" x="90" y="40" fill="#ffa90c"/>
+ <use xlink:href="#favicon.s" x="90" y="60" fill="#ffc04c"/>
+ <use xlink:href="#favicon.s" x="90" y="70" fill="#ffe4b2"/>
+
+ <rect x="30" y="35" width="6" height="25" rx="2" ry="2" fill="black"/>
+ <rect x="64" y="35" width="6" height="25" rx="2" ry="2" fill="black"/>
+</svg>
diff --git a/vhosts/blog/static/hl.css b/vhosts/blog/static/hl.css
new file mode 100644
index 00000000..275239a7
--- /dev/null
+++ b/vhosts/blog/static/hl.css
@@ -0,0 +1,10 @@
+pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!
+ Theme: GitHub
+ Description: Light theme as seen on github.com
+ Author: github.com
+ Maintainer: @Hirse
+ Updated: 2021-05-15
+
+ Outdated base version: https://github.com/primer/github-syntax-light
+ Current colors taken from GitHub's CSS
+*/.hljs{color:#24292e;background:#fff}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#d73a49}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#6f42c1}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable{color:#005cc5}.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#032f62}.hljs-built_in,.hljs-symbol{color:#e36209}.hljs-code,.hljs-comment,.hljs-formula{color:#6a737d}.hljs-name,.hljs-quote,.hljs-selector-pseudo,.hljs-selector-tag{color:#22863a}.hljs-subst{color:#24292e}.hljs-section{color:#005cc5;font-weight:700}.hljs-bullet{color:#735c0f}.hljs-emphasis{color:#24292e;font-style:italic}.hljs-strong{color:#24292e;font-weight:700}.hljs-addition{color:#22863a;background-color:#f0fff4}.hljs-deletion{color:#b31d28;background-color:#ffeef0} \ No newline at end of file
diff --git a/vhosts/blog/static/my-icon.js b/vhosts/blog/static/my-icon.js
new file mode 100644
index 00000000..5b52ca3d
--- /dev/null
+++ b/vhosts/blog/static/my-icon.js
@@ -0,0 +1,121 @@
+const colorBackground = 'white';
+const color蜜柑の果実 = [255, 165, 0];
+const color蜜柑の内果皮 = [255, 255, 255];
+const color蜜柑のじょうのう = [255, 255, 255];
+const colorMosaic = [
+ [255, 165, 0],
+ [255, 140, 0],
+ [255, 215, 0],
+ [255, 205, 114],
+ [255, 210, 127],
+ [255, 192, 76],
+ [255, 169, 12],
+ [255, 228, 178],
+];
+const colorEye = [0, 0, 0];
+
+function setup() {
+ const container = document.getElementById("p5jsMyIcon");
+ const canvas = createCanvas(100, 100);
+ canvas.parent(container);
+
+ background(colorBackground);
+ frameRate(15);
+}
+
+function draw() {
+ if (4 <= frameCount % 15) {
+ return;
+ }
+
+ clear();
+
+ draw蜜柑();
+ applyMosaicEffect([10, 5, 2, 0][frameCount % 15]);
+ drawMosaic();
+ drawEyes();
+}
+
+function applyMosaicEffect(k) {
+ if (k === 0) {
+ return;
+ }
+
+ loadPixels();
+ noStroke();
+ const d = pixelDensity();
+ for (let y = 0; y < 100; y += k) {
+ for (let x = 50; x < 100; x += k) {
+ var r = 0, g = 0, b = 0;
+ for (let i = 0; i < k; i++) {
+ for (let j = 0; j < k; j++) {
+ const offset = 4 * d * ((y + i) * 100 * d + (x + j));
+ const r_ = pixels[offset];
+ const g_ = pixels[offset + 1];
+ const b_ = pixels[offset + 2];
+ const a_ = pixels[offset + 3];
+ r += a_ === 0 ? red(colorBackground) : r_;
+ g += a_ === 0 ? green(colorBackground) : g_;
+ b += a_ === 0 ? blue(colorBackground) : b_;
+ }
+ }
+ fill(r / k**2, g / k**2, b / k**2);
+ rect(x, y, k, k);
+ }
+ }
+}
+
+function draw蜜柑() {
+ // 果実、外果皮
+ fill(color蜜柑の果実);
+ noStroke();
+ ellipse(50, 50, 100, 100);
+
+ // 内果皮
+ noFill();
+ stroke(color蜜柑の内果皮);
+ strokeWeight(4);
+ ellipse(50, 50, 90, 90);
+
+ // じょうのう
+ stroke(color蜜柑のじょうのう);
+ strokeWeight(2);
+ for (let t = 0; t < 10; t++) {
+ push();
+ translate(50, 50);
+ rotate(t * PI / 5);
+ line(0, -45, 0, 0);
+ triangle(0, -40, -4, -45, 4, -45);
+ triangle(0, -20, -3, 0, 3, 0);
+ pop();
+ }
+}
+
+function drawMosaic() {
+ for (let dy = 0; dy < 10; dy++) {
+ for (let dx = 0; dx < 10; dx++) {
+ const y = dy * 10;
+ const x = dx * 10;
+ if (x < 50) {
+ continue;
+ }
+ if ((x - 45)**2 + (y - 45)**2 > 55**2) {
+ continue;
+ }
+ if (random() < 0.5) {
+ continue;
+ }
+ const [r, g, b] = random(colorMosaic);
+ noStroke();
+ fill(r, g, b, 192);
+ rect(x, y, 10, 10);
+ }
+ }
+}
+
+function drawEyes() {
+ noStroke();
+ fill(colorEye);
+ rect(30, 35, 6, 25, 2);
+ rect(64, 35, 6, 25, 2);
+}
diff --git a/vhosts/blog/static/p5.min.js b/vhosts/blog/static/p5.min.js
new file mode 100644
index 00000000..7a5b8275
--- /dev/null
+++ b/vhosts/blog/static/p5.min.js
@@ -0,0 +1,2 @@
+/*! p5.js v1.6.0 February 22, 2023 */
+!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).p5=e()}(function(){var s,t,r;return function o(n,s,i){function a(t,e){if(!s[t]){if(!n[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(l)return l(t,!0);throw(e=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",e}r=s[t]={exports:{}},n[t][0].call(r.exports,function(e){return a(n[t][1][e]||e)},r,r.exports,o,n,s,i)}return s[t].exports}for(var l="function"==typeof require&&require,e=0;e<i.length;e++)a(i[e]);return a}({1:[function(e,t,r){"use strict";r.byteLength=function(e){var e=c(e),t=e[0],e=e[1];return 3*(t+e)/4-e},r.toByteArray=function(e){var t,r,o=c(e),n=o[0],o=o[1],s=new u(function(e,t){return 3*(e+t)/4-t}(n,o)),i=0,a=0<o?n-4:n;for(r=0;r<a;r+=4)t=l[e.charCodeAt(r)]<<18|l[e.charCodeAt(r+1)]<<12|l[e.charCodeAt(r+2)]<<6|l[e.charCodeAt(r+3)],s[i++]=t>>16&255,s[i++]=t>>8&255,s[i++]=255&t;2===o&&(t=l[e.charCodeAt(r)]<<2|l[e.charCodeAt(r+1)]>>4,s[i++]=255&t);1===o&&(t=l[e.charCodeAt(r)]<<10|l[e.charCodeAt(r+1)]<<4|l[e.charCodeAt(r+2)]>>2,s[i++]=t>>8&255,s[i++]=255&t);return s},r.fromByteArray=function(e){for(var t,r=e.length,o=r%3,n=[],s=0,i=r-o;s<i;s+=16383)n.push(function(e,t,r){for(var o,n=[],s=t;s<r;s+=3)o=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),n.push(function(e){return a[e>>18&63]+a[e>>12&63]+a[e>>6&63]+a[63&e]}(o));return n.join("")}(e,s,i<s+16383?i:s+16383));1==o?(t=e[r-1],n.push(a[t>>2]+a[t<<4&63]+"==")):2==o&&(t=(e[r-2]<<8)+e[r-1],n.push(a[t>>10]+a[t>>4&63]+a[t<<2&63]+"="));return n.join("")};for(var a=[],l=[],u="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,s=o.length;n<s;++n)a[n]=o[n],l[o.charCodeAt(n)]=n;function c(e){var t=e.length;if(0<t%4)throw new Error("Invalid string. Length must be a multiple of 4");e=e.indexOf("="),t=(e=-1===e?t:e)===t?0:4-e%4;return[e,t]}l["-".charCodeAt(0)]=62,l["_".charCodeAt(0)]=63},{}],2:[function(e,t,r){},{}],3:[function(e,t,r){arguments[4][2][0].apply(r,arguments)},{dup:2}],4:[function(P,e,A){!function(d){"use strict";var S=P("base64-js"),s=P("ieee754"),e="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null,t=(A.Buffer=d,A.SlowBuffer=function(e){+e!=e&&(e=0);return d.alloc(+e)},A.INSPECT_MAX_BYTES=50,2147483647);function l(e){if(t<e)throw new RangeError('The value "'+e+'" is invalid for option "size"');e=new Uint8Array(e);return Object.setPrototypeOf(e,d.prototype),e}function d(e,t,r){if("number"!=typeof e)return o(e,t,r);if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return i(e)}function o(e,t,r){if("string"==typeof e){var o=e,n=t;if(d.isEncoding(n="string"==typeof n&&""!==n?n:"utf8"))return s=0|f(o,n),i=l(s),i=(o=i.write(o,n))!==s?i.slice(0,o):i;throw new TypeError("Unknown encoding: "+n)}if(ArrayBuffer.isView(e))return u(e);if(null!=e){if(O(e,ArrayBuffer)||e&&O(e.buffer,ArrayBuffer)){var s=e,o=t,i=r;if(o<0||s.byteLength<o)throw new RangeError('"offset" is outside of buffer bounds');if(s.byteLength<o+(i||0))throw new RangeError('"length" is outside of buffer bounds');return s=void 0===o&&void 0===i?new Uint8Array(s):void 0===i?new Uint8Array(s,o):new Uint8Array(s,o,i),Object.setPrototypeOf(s,d.prototype),s}if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return d.from(n,t,r);var a=function(e){{var t,r;if(d.isBuffer(e))return t=0|c(e.length),0!==(r=l(t)).length&&e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||k(e.length)?l(0):u(e);if("Buffer"===e.type&&Array.isArray(e.data))return u(e.data)}(e);if(a)return a;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return d.from(e[Symbol.toPrimitive]("string"),t,r)}throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function n(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function i(e){return n(e),l(e<0?0:0|c(e))}function u(e){for(var t=e.length<0?0:0|c(e.length),r=l(t),o=0;o<t;o+=1)r[o]=255&e[o];return r}function c(e){if(t<=e)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+t.toString(16)+" bytes");return 0|e}function f(e,t){if(d.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||O(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,o=2<arguments.length&&!0===arguments[2];if(!o&&0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return E(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return T(e).length;default:if(n)return o?-1:E(e).length;t=(""+t).toLowerCase(),n=!0}}function r(e,t,r){var o,n=!1;if((t=void 0===t||t<0?0:t)>this.length)return"";if((r=void 0===r||r>this.length?this.length:r)<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":var s=this,i=t,a=r,l=s.length;(!a||a<0||l<a)&&(a=l);for(var u="",c=i=!i||i<0?0:i;c<a;++c)u+=L[s[c]];return u;case"utf8":case"utf-8":return M(this,t,r);case"ascii":var d=this,l=t,f=r,h="";f=Math.min(d.length,f);for(var p=l;p<f;++p)h+=String.fromCharCode(127&d[p]);return h;case"latin1":case"binary":var m=this,i=t,y=r,g="";y=Math.min(m.length,y);for(var v=i;v<y;++v)g+=String.fromCharCode(m[v]);return g;case"base64":return b=this,o=r,0===(j=t)&&o===b.length?S.fromByteArray(b):S.fromByteArray(b.slice(j,o));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":for(var b=t,j=r,_=this.slice(b,j),x="",w=0;w<_.length;w+=2)x+=String.fromCharCode(_[w]+256*_[w+1]);return x;default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function a(e,t,r){var o=e[t];e[t]=e[r],e[r]=o}function h(e,t,r,o,n){if(0===e.length)return-1;if("string"==typeof r?(o=r,r=0):2147483647<r?r=2147483647:r<-2147483648&&(r=-2147483648),(r=(r=k(r=+r)?n?0:e.length-1:r)<0?e.length+r:r)>=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=d.from(t,o)),d.isBuffer(t))return 0===t.length?-1:p(e,t,r,o,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?(n?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(e,t,r):p(e,[t],r,o,n);throw new TypeError("val must be string, number or Buffer")}function p(e,t,r,o,n){var s=1,i=e.length,a=t.length;if(void 0!==o&&("ucs2"===(o=String(o).toLowerCase())||"ucs-2"===o||"utf16le"===o||"utf-16le"===o)){if(e.length<2||t.length<2)return-1;i/=s=2,a/=2,r/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(n)for(var u=-1,c=r;c<i;c++)if(l(e,c)===l(t,-1===u?0:c-u)){if(c-(u=-1===u?c:u)+1===a)return u*s}else-1!==u&&(c-=c-u),u=-1;else for(c=r=i<r+a?i-a:r;0<=c;c--){for(var d=!0,f=0;f<a;f++)if(l(e,c+f)!==l(t,f)){d=!1;break}if(d)return c}return-1}function y(e,t,r,o){return C(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,o)}function g(e,t,r,o){return C(function(e,t){for(var r,o,n=[],s=0;s<e.length&&!((t-=2)<0);++s)o=e.charCodeAt(s),r=o>>8,o=o%256,n.push(o),n.push(r);return n}(t,e.length-r),e,r,o)}function M(e,t,r){r=Math.min(e.length,r);for(var o=[],n=t;n<r;){var s,i,a,l,u=e[n],c=null,d=239<u?4:223<u?3:191<u?2:1;if(n+d<=r)switch(d){case 1:u<128&&(c=u);break;case 2:128==(192&(s=e[n+1]))&&127<(l=(31&u)<<6|63&s)&&(c=l);break;case 3:s=e[n+1],i=e[n+2],128==(192&s)&&128==(192&i)&&2047<(l=(15&u)<<12|(63&s)<<6|63&i)&&(l<55296||57343<l)&&(c=l);break;case 4:s=e[n+1],i=e[n+2],a=e[n+3],128==(192&s)&&128==(192&i)&&128==(192&a)&&65535<(l=(15&u)<<18|(63&s)<<12|(63&i)<<6|63&a)&&l<1114112&&(c=l)}null===c?(c=65533,d=1):65535<c&&(c-=65536,o.push(c>>>10&1023|55296),c=56320|1023&c),o.push(c),n+=d}var f=o,h=f.length;if(h<=v)return String.fromCharCode.apply(String,f);for(var p="",m=0;m<h;)p+=String.fromCharCode.apply(String,f.slice(m,m+=v));return p}A.kMaxLength=t,(d.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(d.prototype,"parent",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.buffer}}),Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&d[Symbol.species]===d&&Object.defineProperty(d,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),d.poolSize=8192,d.from=o,Object.setPrototypeOf(d.prototype,Uint8Array.prototype),Object.setPrototypeOf(d,Uint8Array),d.alloc=function(e,t,r){return t=t,r=r,n(e=e),!(e<=0)&&void 0!==t?"string"==typeof r?l(e).fill(t,r):l(e).fill(t):l(e)},d.allocUnsafe=i,d.allocUnsafeSlow=i,d.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==d.prototype},d.compare=function(e,t){if(O(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)),O(t,Uint8Array)&&(t=d.from(t,t.offset,t.byteLength)),!d.isBuffer(e)||!d.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,o=t.length,n=0,s=Math.min(r,o);n<s;++n)if(e[n]!==t[n]){r=e[n],o=t[n];break}return r<o?-1:o<r?1:0},d.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},d.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return d.alloc(0);if(void 0===t)for(n=t=0;n<e.length;++n)t+=e[n].length;for(var r=d.allocUnsafe(t),o=0,n=0;n<e.length;++n){var s=e[n];if(O(s,Uint8Array)&&(s=d.from(s)),!d.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,o),o+=s.length}return r},d.byteLength=f,d.prototype._isBuffer=!0,d.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)a(this,t,t+1);return this},d.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)a(this,t,t+3),a(this,t+1,t+2);return this},d.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)a(this,t,t+7),a(this,t+1,t+6),a(this,t+2,t+5),a(this,t+3,t+4);return this},d.prototype.toLocaleString=d.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?M(this,0,e):r.apply(this,arguments)},d.prototype.equals=function(e){if(d.isBuffer(e))return this===e||0===d.compare(this,e);throw new TypeError("Argument must be a Buffer")},d.prototype.inspect=function(){var e="",t=A.INSPECT_MAX_BYTES,e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim();return this.length>t&&(e+=" ... "),"<Buffer "+e+">"},e&&(d.prototype[e]=d.prototype.inspect),d.prototype.compare=function(e,t,r,o,n){if(O(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)),!d.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===r&&(r=e?e.length:0),void 0===o&&(o=0),void 0===n&&(n=this.length),(t=void 0===t?0:t)<0||r>e.length||o<0||n>this.length)throw new RangeError("out of range index");if(n<=o&&r<=t)return 0;if(n<=o)return-1;if(r<=t)return 1;if(this===e)return 0;for(var s=(n>>>=0)-(o>>>=0),i=(r>>>=0)-(t>>>=0),a=Math.min(s,i),l=this.slice(o,n),u=e.slice(t,r),c=0;c<a;++c)if(l[c]!==u[c]){s=l[c],i=u[c];break}return s<i?-1:i<s?1:0},d.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},d.prototype.indexOf=function(e,t,r){return h(this,e,t,r,!0)},d.prototype.lastIndexOf=function(e,t,r){return h(this,e,t,r,!1)},d.prototype.write=function(e,t,r,o){if(void 0===t)o="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)o=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===o&&(o="utf8")):(o=r,r=void 0)}var n=this.length-t;if((void 0===r||n<r)&&(r=n),0<e.length&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");o=o||"utf8";for(var s,i,a,l=!1;;)switch(o){case"hex":var u=this,c=e,d=t,f=r,h=(d=Number(d)||0,u.length-d);(!f||h<(f=Number(f)))&&(f=h),(h=c.length)/2<f&&(f=h/2);for(var p=0;p<f;++p){var m=parseInt(c.substr(2*p,2),16);if(k(m))return p;u[d+p]=m}return p;case"utf8":case"utf-8":return h=t,a=r,C(E(e,(i=this).length-h),i,h,a);case"ascii":return y(this,e,t,r);case"latin1":case"binary":return y(this,e,t,r);case"base64":return i=this,a=t,s=r,C(T(e),i,a,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return g(this,e,t,r);default:if(l)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),l=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var v=4096;function m(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(r<e+t)throw new RangeError("Trying to access beyond buffer length")}function b(e,t,r,o,n,s){if(!d.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(n<t||t<s)throw new RangeError('"value" argument is out of bounds');if(r+o>e.length)throw new RangeError("Index out of range")}function j(e,t,r,o){if(r+o>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function _(e,t,r,o,n){return t=+t,r>>>=0,n||j(e,0,r,4),s.write(e,t,r,o,23,4),r+4}function x(e,t,r,o,n){return t=+t,r>>>=0,n||j(e,0,r,8),s.write(e,t,r,o,52,8),r+8}d.prototype.slice=function(e,t){var r=this.length,r=((e=~~e)<0?(e+=r)<0&&(e=0):r<e&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):r<t&&(t=r),t<e&&(t=e),this.subarray(e,t));return Object.setPrototypeOf(r,d.prototype),r},d.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||m(e,t,this.length);for(var o=this[e],n=1,s=0;++s<t&&(n*=256);)o+=this[e+s]*n;return o},d.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||m(e,t,this.length);for(var o=this[e+--t],n=1;0<t&&(n*=256);)o+=this[e+--t]*n;return o},d.prototype.readUInt8=function(e,t){return e>>>=0,t||m(e,1,this.length),this[e]},d.prototype.readUInt16LE=function(e,t){return e>>>=0,t||m(e,2,this.length),this[e]|this[e+1]<<8},d.prototype.readUInt16BE=function(e,t){return e>>>=0,t||m(e,2,this.length),this[e]<<8|this[e+1]},d.prototype.readUInt32LE=function(e,t){return e>>>=0,t||m(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},d.prototype.readUInt32BE=function(e,t){return e>>>=0,t||m(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},d.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||m(e,t,this.length);for(var o=this[e],n=1,s=0;++s<t&&(n*=256);)o+=this[e+s]*n;return(n*=128)<=o&&(o-=Math.pow(2,8*t)),o},d.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||m(e,t,this.length);for(var o=t,n=1,s=this[e+--o];0<o&&(n*=256);)s+=this[e+--o]*n;return(n*=128)<=s&&(s-=Math.pow(2,8*t)),s},d.prototype.readInt8=function(e,t){return e>>>=0,t||m(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},d.prototype.readInt16LE=function(e,t){e>>>=0,t||m(e,2,this.length);t=this[e]|this[e+1]<<8;return 32768&t?4294901760|t:t},d.prototype.readInt16BE=function(e,t){e>>>=0,t||m(e,2,this.length);t=this[e+1]|this[e]<<8;return 32768&t?4294901760|t:t},d.prototype.readInt32LE=function(e,t){return e>>>=0,t||m(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},d.prototype.readInt32BE=function(e,t){return e>>>=0,t||m(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},d.prototype.readFloatLE=function(e,t){return e>>>=0,t||m(e,4,this.length),s.read(this,e,!0,23,4)},d.prototype.readFloatBE=function(e,t){return e>>>=0,t||m(e,4,this.length),s.read(this,e,!1,23,4)},d.prototype.readDoubleLE=function(e,t){return e>>>=0,t||m(e,8,this.length),s.read(this,e,!0,52,8)},d.prototype.readDoubleBE=function(e,t){return e>>>=0,t||m(e,8,this.length),s.read(this,e,!1,52,8)},d.prototype.writeUIntLE=function(e,t,r,o){e=+e,t>>>=0,r>>>=0,o||b(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,s=0;for(this[t]=255&e;++s<r&&(n*=256);)this[t+s]=e/n&255;return t+r},d.prototype.writeUIntBE=function(e,t,r,o){e=+e,t>>>=0,r>>>=0,o||b(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,s=1;for(this[t+n]=255&e;0<=--n&&(s*=256);)this[t+n]=e/s&255;return t+r},d.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,1,255,0),this[t]=255&e,t+1},d.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},d.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},d.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},d.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},d.prototype.writeIntLE=function(e,t,r,o){e=+e,t>>>=0,o||b(this,e,t,r,(o=Math.pow(2,8*r-1))-1,-o);var n=0,s=1,i=0;for(this[t]=255&e;++n<r&&(s*=256);)e<0&&0===i&&0!==this[t+n-1]&&(i=1),this[t+n]=(e/s>>0)-i&255;return t+r},d.prototype.writeIntBE=function(e,t,r,o){e=+e,t>>>=0,o||b(this,e,t,r,(o=Math.pow(2,8*r-1))-1,-o);var n=r-1,s=1,i=0;for(this[t+n]=255&e;0<=--n&&(s*=256);)e<0&&0===i&&0!==this[t+n+1]&&(i=1),this[t+n]=(e/s>>0)-i&255;return t+r},d.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,1,127,-128),this[t]=255&(e=e<0?255+e+1:e),t+1},d.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},d.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},d.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},d.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,4,2147483647,-2147483648),this[t]=(e=e<0?4294967295+e+1:e)>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},d.prototype.writeFloatLE=function(e,t,r){return _(this,e,t,!0,r)},d.prototype.writeFloatBE=function(e,t,r){return _(this,e,t,!1,r)},d.prototype.writeDoubleLE=function(e,t,r){return x(this,e,t,!0,r)},d.prototype.writeDoubleBE=function(e,t,r){return x(this,e,t,!1,r)},d.prototype.copy=function(e,t,r,o){if(!d.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,o||0===o||(o=this.length),t>=e.length&&(t=e.length),(o=0<o&&o<r?r:o)===r)return 0;if(0===e.length||0===this.length)return 0;if((t=t||0)<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length);var n=(o=e.length-t<o-r?e.length-t+r:o)-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,o);else if(this===e&&r<t&&t<o)for(var s=n-1;0<=s;--s)e[s+t]=this[s+r];else Uint8Array.prototype.set.call(e,this.subarray(r,o),t);return n},d.prototype.fill=function(e,t,r,o){if("string"==typeof e){if("string"==typeof t?(o=t,t=0,r=this.length):"string"==typeof r&&(o=r,r=this.length),void 0!==o&&"string"!=typeof o)throw new TypeError("encoding must be a string");if("string"==typeof o&&!d.isEncoding(o))throw new TypeError("Unknown encoding: "+o);var n;1===e.length&&(n=e.charCodeAt(0),("utf8"===o&&n<128||"latin1"===o)&&(e=n))}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");var s;if(!(r<=t))if(t>>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(s=t;s<r;++s)this[s]=e;else{var i=d.isBuffer(e)?e:d.from(e,o),a=i.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(s=0;s<r-t;++s)this[s+t]=i[s%a]}return this};var w=/[^+/0-9A-Za-z-_]/g;function E(e,t){t=t||1/0;for(var r,o=e.length,n=null,s=[],i=0;i<o;++i){if(55295<(r=e.charCodeAt(i))&&r<57344){if(!n){if(56319<r){-1<(t-=3)&&s.push(239,191,189);continue}if(i+1===o){-1<(t-=3)&&s.push(239,191,189);continue}n=r;continue}if(r<56320){-1<(t-=3)&&s.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&-1<(t-=3)&&s.push(239,191,189);if(n=null,r<128){if(--t<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function T(e){return S.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(w,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function C(e,t,r,o){for(var n=0;n<o&&!(n+r>=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function O(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function k(e){return e!=e}var L=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var o=16*r,n=0;n<16;++n)t[o+n]=e[r]+e[n];return t}()}.call(this,P("buffer").Buffer)},{"base64-js":1,buffer:4,ieee754:238}],5:[function(e,t,r){t.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},{}],6:[function(e,t,r){var o=e("../internals/is-object");t.exports=function(e){if(o(e)||null===e)return e;throw TypeError("Can't set "+String(e)+" as a prototype")}},{"../internals/is-object":74}],7:[function(e,t,r){var o=e("../internals/well-known-symbol"),n=e("../internals/object-create"),e=e("../internals/object-define-property"),s=o("unscopables"),i=Array.prototype;null==i[s]&&e.f(i,s,{configurable:!0,value:n(null)}),t.exports=function(e){i[s][e]=!0}},{"../internals/object-create":90,"../internals/object-define-property":92,"../internals/well-known-symbol":146}],8:[function(e,t,r){"use strict";var o=e("../internals/string-multibyte").charAt;t.exports=function(e,t,r){return t+(r?o(e,t).length:1)}},{"../internals/string-multibyte":123}],9:[function(e,t,r){t.exports=function(e,t,r){if(e instanceof t)return e;throw TypeError("Incorrect "+(r?r+" ":"")+"invocation")}},{}],10:[function(e,t,r){var o=e("../internals/is-object");t.exports=function(e){if(o(e))return e;throw TypeError(String(e)+" is not an object")}},{"../internals/is-object":74}],11:[function(e,t,r){t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},{}],12:[function(e,t,r){"use strict";function o(e){return l(e)&&u(E,c(e))}var n,s=e("../internals/array-buffer-native"),i=e("../internals/descriptors"),a=e("../internals/global"),l=e("../internals/is-object"),u=e("../internals/has"),c=e("../internals/classof"),d=e("../internals/create-non-enumerable-property"),f=e("../internals/redefine"),h=e("../internals/object-define-property").f,p=e("../internals/object-get-prototype-of"),m=e("../internals/object-set-prototype-of"),y=e("../internals/well-known-symbol"),e=e("../internals/uid"),g=a.Int8Array,v=g&&g.prototype,b=a.Uint8ClampedArray,b=b&&b.prototype,j=g&&p(g),_=v&&p(v),x=Object.prototype,w=x.isPrototypeOf,y=y("toStringTag"),S=e("TYPED_ARRAY_TAG"),M=s&&!!m&&"Opera"!==c(a.opera),e=!1,E={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8};for(n in E)a[n]||(M=!1);if((!M||"function"!=typeof j||j===Function.prototype)&&(j=function(){throw TypeError("Incorrect invocation")},M))for(n in E)a[n]&&m(a[n],j);if((!M||!_||_===x)&&(_=j.prototype,M))for(n in E)a[n]&&m(a[n].prototype,_);if(M&&p(b)!==_&&m(b,_),i&&!u(_,y))for(n in e=!0,h(_,y,{get:function(){return l(this)?this[S]:void 0}}),E)a[n]&&d(a[n],S,n);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:M,TYPED_ARRAY_TAG:e&&S,aTypedArray:function(e){if(o(e))return e;throw TypeError("Target is not a typed array")},aTypedArrayConstructor:function(e){if(m){if(w.call(j,e))return e}else for(var t in E)if(u(E,n)){t=a[t];if(t&&(e===t||w.call(t,e)))return e}throw TypeError("Target is not a typed array constructor")},exportTypedArrayMethod:function(e,t,r){if(i){if(r)for(var o in E){o=a[o];o&&u(o.prototype,e)&&delete o.prototype[e]}_[e]&&!r||f(_,e,!r&&M&&v[e]||t)}},exportTypedArrayStaticMethod:function(e,t,r){var o,n;if(i){if(m){if(r)for(o in E)(n=a[o])&&u(n,e)&&delete n[e];if(j[e]&&!r)return;try{return f(j,e,!r&&M&&g[e]||t)}catch(e){}}for(o in E)!(n=a[o])||n[e]&&!r||f(n,e,t)}},isView:function(e){e=c(e);return"DataView"===e||u(E,e)},isTypedArray:o,TypedArray:j,TypedArrayPrototype:_}},{"../internals/array-buffer-native":11,"../internals/classof":29,"../internals/create-non-enumerable-property":38,"../internals/descriptors":43,"../internals/global":59,"../internals/has":60,"../internals/is-object":74,"../internals/object-define-property":92,"../internals/object-get-prototype-of":97,"../internals/object-set-prototype-of":101,"../internals/redefine":108,"../internals/uid":143,"../internals/well-known-symbol":146}],13:[function(e,t,D){"use strict";function r(e){return[255&e]}function o(e){return[255&e,e>>8&255]}function n(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function s(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]}function i(e){return k(e,23,4)}function U(e){return k(e,52,8)}function a(e,t){H(e[w],t,{get:function(){return b(this)[t]}})}function l(e,t,r,o){if(r=m(r),e=b(e),r+t>e.byteLength)throw O(S);var n=b(e.buffer).bytes,r=r+e.byteOffset,e=n.slice(r,r+t);return o?e:e.reverse()}function u(e,t,r,o,n,s){if(r=m(r),e=b(e),r+t>e.byteLength)throw O(S);for(var i=b(e.buffer).bytes,a=r+e.byteOffset,l=o(+n),u=0;u<t;u++)i[a+u]=l[s?u:t-u-1]}var c=e("../internals/global"),d=e("../internals/descriptors"),N=e("../internals/array-buffer-native"),F=e("../internals/create-non-enumerable-property"),f=e("../internals/redefine-all"),h=e("../internals/fails"),p=e("../internals/an-instance"),B=e("../internals/to-integer"),G=e("../internals/to-length"),m=e("../internals/to-index"),y=e("../internals/ieee754"),V=e("../internals/object-get-prototype-of"),g=e("../internals/object-set-prototype-of"),z=e("../internals/object-get-own-property-names").f,H=e("../internals/object-define-property").f,W=e("../internals/array-fill"),v=e("../internals/set-to-string-tag"),e=e("../internals/internal-state"),b=e.get,j=e.set,_="ArrayBuffer",x="DataView",w="prototype",S="Wrong index",M=c[_],E=M,T=c[x],e=T&&T[w],C=Object.prototype,O=c.RangeError,k=y.pack,L=y.unpack;if(N){if(!h(function(){M(1)})||!h(function(){new M(-1)})||h(function(){return new M,new M(1.5),new M(NaN),M.name!=_})){for(var P,c=(E=function(e){return p(this,E),new M(m(e))})[w]=M[w],A=z(M),R=0;A.length>R;)(P=A[R++])in E||F(E,P,M[P]);c.constructor=E}g&&V(e)!==C&&g(e,C);var y=new T(new E(2)),I=e.setInt8;y.setInt8(0,2147483648),y.setInt8(1,2147483649),!y.getInt8(0)&&y.getInt8(1)||f(e,{setInt8:function(e,t){I.call(this,e,t<<24>>24)},setUint8:function(e,t){I.call(this,e,t<<24>>24)}},{unsafe:!0})}else E=function(e){p(this,E,_);e=m(e);j(this,{bytes:W.call(new Array(e),0),byteLength:e}),d||(this.byteLength=e)},T=function(e,t,r){p(this,T,x),p(e,E,x);var o=b(e).byteLength,t=B(t);if(t<0||o<t)throw O("Wrong offset");if(o<t+(r=void 0===r?o-t:G(r)))throw O("Wrong length");j(this,{buffer:e,byteLength:r,byteOffset:t}),d||(this.buffer=e,this.byteLength=r,this.byteOffset=t)},d&&(a(E,"byteLength"),a(T,"buffer"),a(T,"byteLength"),a(T,"byteOffset")),f(T[w],{getInt8:function(e){return l(this,1,e)[0]<<24>>24},getUint8:function(e){return l(this,1,e)[0]},getInt16:function(e){e=l(this,2,e,1<arguments.length?arguments[1]:void 0);return(e[1]<<8|e[0])<<16>>16},getUint16:function(e){e=l(this,2,e,1<arguments.length?arguments[1]:void 0);return e[1]<<8|e[0]},getInt32:function(e){return s(l(this,4,e,1<arguments.length?arguments[1]:void 0))},getUint32:function(e){return s(l(this,4,e,1<arguments.length?arguments[1]:void 0))>>>0},getFloat32:function(e){return L(l(this,4,e,1<arguments.length?arguments[1]:void 0),23)},getFloat64:function(e){return L(l(this,8,e,1<arguments.length?arguments[1]:void 0),52)},setInt8:function(e,t){u(this,1,e,r,t)},setUint8:function(e,t){u(this,1,e,r,t)},setInt16:function(e,t){u(this,2,e,o,t,2<arguments.length?arguments[2]:void 0)},setUint16:function(e,t){u(this,2,e,o,t,2<arguments.length?arguments[2]:void 0)},setInt32:function(e,t){u(this,4,e,n,t,2<arguments.length?arguments[2]:void 0)},setUint32:function(e,t){u(this,4,e,n,t,2<arguments.length?arguments[2]:void 0)},setFloat32:function(e,t){u(this,4,e,i,t,2<arguments.length?arguments[2]:void 0)},setFloat64:function(e,t){u(this,8,e,U,t,2<arguments.length?arguments[2]:void 0)}});v(E,_),v(T,x),t.exports={ArrayBuffer:E,DataView:T}},{"../internals/an-instance":9,"../internals/array-buffer-native":11,"../internals/array-fill":15,"../internals/create-non-enumerable-property":38,"../internals/descriptors":43,"../internals/fails":51,"../internals/global":59,"../internals/ieee754":65,"../internals/internal-state":70,"../internals/object-define-property":92,"../internals/object-get-own-property-names":95,"../internals/object-get-prototype-of":97,"../internals/object-set-prototype-of":101,"../internals/redefine-all":107,"../internals/set-to-string-tag":117,"../internals/to-index":131,"../internals/to-integer":133,"../internals/to-length":134}],14:[function(e,t,r){"use strict";var l=e("../internals/to-object"),u=e("../internals/to-absolute-index"),c=e("../internals/to-length"),d=Math.min;t.exports=[].copyWithin||function(e,t){var r=l(this),o=c(r.length),n=u(e,o),s=u(t,o),e=2<arguments.length?arguments[2]:void 0,i=d((void 0===e?o:u(e,o))-s,o-n),a=1;for(s<n&&n<s+i&&(a=-1,s+=i-1,n+=i-1);0<i--;)s in r?r[n]=r[s]:delete r[n],n+=a,s+=a;return r}},{"../internals/to-absolute-index":130,"../internals/to-length":134,"../internals/to-object":135}],15:[function(e,t,r){"use strict";var i=e("../internals/to-object"),a=e("../internals/to-absolute-index"),l=e("../internals/to-length");t.exports=function(e){for(var t=i(this),r=l(t.length),o=arguments.length,n=a(1<o?arguments[1]:void 0,r),o=2<o?arguments[2]:void 0,s=void 0===o?r:a(o,r);n<s;)t[n++]=e;return t}},{"../internals/to-absolute-index":130,"../internals/to-length":134,"../internals/to-object":135}],16:[function(e,t,r){"use strict";var o=e("../internals/array-iteration").forEach,n=e("../internals/array-method-is-strict"),e=e("../internals/array-method-uses-to-length"),n=n("forEach"),e=e("forEach");t.exports=n&&e?[].forEach:function(e){return o(this,e,1<arguments.length?arguments[1]:void 0)}},{"../internals/array-iteration":19,"../internals/array-method-is-strict":22,"../internals/array-method-uses-to-length":23}],17:[function(e,t,r){"use strict";var h=e("../internals/function-bind-context"),p=e("../internals/to-object"),m=e("../internals/call-with-safe-iteration-closing"),y=e("../internals/is-array-iterator-method"),g=e("../internals/to-length"),v=e("../internals/create-property"),b=e("../internals/get-iterator-method");t.exports=function(e){var t,r,o,n,s,i,a=p(e),e="function"==typeof this?this:Array,l=arguments.length,u=1<l?arguments[1]:void 0,c=void 0!==u,d=b(a),f=0;if(c&&(u=h(u,2<l?arguments[2]:void 0,2)),null==d||e==Array&&y(d))for(r=new e(t=g(a.length));f<t;f++)i=c?u(a[f],f):a[f],v(r,f,i);else for(s=(n=d.call(a)).next,r=new e;!(o=s.call(n)).done;f++)i=c?m(n,u,[o.value,f],!0):o.value,v(r,f,i);return r.length=f,r}},{"../internals/call-with-safe-iteration-closing":26,"../internals/create-property":40,"../internals/function-bind-context":54,"../internals/get-iterator-method":57,"../internals/is-array-iterator-method":71,"../internals/to-length":134,"../internals/to-object":135}],18:[function(e,t,r){function o(a){return function(e,t,r){var o,n=l(e),s=u(n.length),i=c(r,s);if(a&&t!=t){for(;i<s;)if((o=n[i++])!=o)return!0}else for(;i<s;i++)if((a||i in n)&&n[i]===t)return a||i||0;return!a&&-1}}var l=e("../internals/to-indexed-object"),u=e("../internals/to-length"),c=e("../internals/to-absolute-index");t.exports={includes:o(!0),indexOf:o(!1)}},{"../internals/to-absolute-index":130,"../internals/to-indexed-object":132,"../internals/to-length":134}],19:[function(e,t,r){function o(f){var h=1==f,p=2==f,m=3==f,y=4==f,g=6==f,v=5==f||g;return function(e,t,r,o){for(var n,s,i=_(e),a=j(i),l=b(t,r,3),u=x(a.length),c=0,t=o||w,d=h?t(e,u):p?t(e,0):void 0;c<u;c++)if((v||c in a)&&(s=l(n=a[c],c,i),f))if(h)d[c]=s;else if(s)switch(f){case 3:return!0;case 5:return n;case 6:return c;case 2:S.call(d,n)}else if(y)return!1;return g?-1:m||y?y:d}}var b=e("../internals/function-bind-context"),j=e("../internals/indexed-object"),_=e("../internals/to-object"),x=e("../internals/to-length"),w=e("../internals/array-species-create"),S=[].push;t.exports={forEach:o(0),map:o(1),filter:o(2),some:o(3),every:o(4),find:o(5),findIndex:o(6)}},{"../internals/array-species-create":25,"../internals/function-bind-context":54,"../internals/indexed-object":66,"../internals/to-length":134,"../internals/to-object":135}],20:[function(e,t,r){"use strict";var n=e("../internals/to-indexed-object"),s=e("../internals/to-integer"),i=e("../internals/to-length"),o=e("../internals/array-method-is-strict"),e=e("../internals/array-method-uses-to-length"),a=Math.min,l=[].lastIndexOf,u=!!l&&1/[1].lastIndexOf(1,-0)<0,o=o("lastIndexOf"),e=e("indexOf",{ACCESSORS:!0,1:0});t.exports=u||!o||!e?function(e){if(u)return l.apply(this,arguments)||0;var t=n(this),r=i(t.length),o=r-1;for((o=1<arguments.length?a(o,s(arguments[1])):o)<0&&(o=r+o);0<=o;o--)if(o in t&&t[o]===e)return o||0;return-1}:l},{"../internals/array-method-is-strict":22,"../internals/array-method-uses-to-length":23,"../internals/to-indexed-object":132,"../internals/to-integer":133,"../internals/to-length":134}],21:[function(e,t,r){var o=e("../internals/fails"),n=e("../internals/well-known-symbol"),s=e("../internals/engine-v8-version"),i=n("species");t.exports=function(t){return 51<=s||!o(function(){var e=[];return(e.constructor={})[i]=function(){return{foo:1}},1!==e[t](Boolean).foo})}},{"../internals/engine-v8-version":48,"../internals/fails":51,"../internals/well-known-symbol":146}],22:[function(e,t,r){"use strict";var o=e("../internals/fails");t.exports=function(e,t){var r=[][e];return!!r&&o(function(){r.call(null,t||function(){throw 1},1)})}},{"../internals/fails":51}],23:[function(e,t,r){function i(e){throw e}var a=e("../internals/descriptors"),l=e("../internals/fails"),u=e("../internals/has"),c=Object.defineProperty,d={};t.exports=function(e,t){var r,o,n,s;return u(d,e)?d[e]:(r=[][e],o=!!u(t=t||{},"ACCESSORS")&&t.ACCESSORS,n=u(t,0)?t[0]:i,s=u(t,1)?t[1]:void 0,d[e]=!!r&&!l(function(){if(o&&!a)return!0;var e={length:-1};o?c(e,1,{enumerable:!0,get:i}):e[1]=1,r.call(e,n,s)}))}},{"../internals/descriptors":43,"../internals/fails":51,"../internals/has":60}],24:[function(e,t,r){function o(u){return function(e,t,r,o){c(t);var n=d(e),s=f(n),i=h(n.length),a=u?i-1:0,l=u?-1:1;if(r<2)for(;;){if(a in s){o=s[a],a+=l;break}if(a+=l,u?a<0:i<=a)throw TypeError("Reduce of empty array with no initial value")}for(;u?0<=a:a<i;a+=l)a in s&&(o=t(o,s[a],a,n));return o}}var c=e("../internals/a-function"),d=e("../internals/to-object"),f=e("../internals/indexed-object"),h=e("../internals/to-length");t.exports={left:o(!1),right:o(!0)}},{"../internals/a-function":5,"../internals/indexed-object":66,"../internals/to-length":134,"../internals/to-object":135}],25:[function(e,t,r){var o=e("../internals/is-object"),n=e("../internals/is-array"),s=e("../internals/well-known-symbol")("species");t.exports=function(e,t){var r;return new(void 0===(r=n(e)&&("function"==typeof(r=e.constructor)&&(r===Array||n(r.prototype))||o(r)&&null===(r=r[s]))?void 0:r)?Array:r)(0===t?0:t)}},{"../internals/is-array":72,"../internals/is-object":74,"../internals/well-known-symbol":146}],26:[function(e,t,r){var n=e("../internals/an-object");t.exports=function(t,e,r,o){try{return o?e(n(r)[0],r[1]):e(r)}catch(e){o=t.return;throw void 0!==o&&n(o.call(t)),e}}},{"../internals/an-object":10}],27:[function(e,t,r){var n=e("../internals/well-known-symbol")("iterator"),s=!1;try{var o=0,i={next:function(){return{done:!!o++}},return:function(){s=!0}};i[n]=function(){return this},Array.from(i,function(){throw 2})}catch(e){}t.exports=function(e,t){if(!t&&!s)return!1;var r=!1;try{var o={};o[n]=function(){return{next:function(){return{done:r=!0}}}},e(o)}catch(e){}return r}},{"../internals/well-known-symbol":146}],28:[function(e,t,r){var o={}.toString;t.exports=function(e){return o.call(e).slice(8,-1)}},{}],29:[function(e,t,r){var o=e("../internals/to-string-tag-support"),n=e("../internals/classof-raw"),s=e("../internals/well-known-symbol")("toStringTag"),i="Arguments"==n(function(){return arguments}());t.exports=o?n:function(e){var t;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(t=function(e,t){try{return e[t]}catch(e){}}(e=Object(e),s))?t:i?n(e):"Object"==(t=n(e))&&"function"==typeof e.callee?"Arguments":t}},{"../internals/classof-raw":28,"../internals/to-string-tag-support":139,"../internals/well-known-symbol":146}],30:[function(e,t,r){"use strict";var u=e("../internals/object-define-property").f,c=e("../internals/object-create"),d=e("../internals/redefine-all"),f=e("../internals/function-bind-context"),h=e("../internals/an-instance"),p=e("../internals/iterate"),i=e("../internals/define-iterator"),a=e("../internals/set-species"),m=e("../internals/descriptors"),y=e("../internals/internal-metadata").fastKey,e=e("../internals/internal-state"),g=e.set,v=e.getterFor;t.exports={getConstructor:function(e,r,o,n){function s(e,t,r){var o,n=l(e),s=i(e,t);return s?s.value=r:(n.last=s={index:o=y(t,!0),key:t,value:r,previous:t=n.last,next:void 0,removed:!1},n.first||(n.first=s),t&&(t.next=s),m?n.size++:e.size++,"F"!==o&&(n.index[o]=s)),e}function i(e,t){var r,e=l(e),o=y(t);if("F"!==o)return e.index[o];for(r=e.first;r;r=r.next)if(r.key==t)return r}var a=e(function(e,t){h(e,a,r),g(e,{type:r,index:c(null),first:void 0,last:void 0,size:0}),m||(e.size=0),null!=t&&p(t,e[n],e,o)}),l=v(r);return d(a.prototype,{clear:function(){for(var e=l(this),t=e.index,r=e.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete t[r.index],r=r.next;e.first=e.last=void 0,m?e.size=0:this.size=0},delete:function(e){var t,r,o=l(this),e=i(this,e);return e&&(t=e.next,r=e.previous,delete o.index[e.index],e.removed=!0,r&&(r.next=t),t&&(t.previous=r),o.first==e&&(o.first=t),o.last==e&&(o.last=r),m?o.size--:this.size--),!!e},forEach:function(e){for(var t,r=l(this),o=f(e,1<arguments.length?arguments[1]:void 0,3);t=t?t.next:r.first;)for(o(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!i(this,e)}}),d(a.prototype,o?{get:function(e){e=i(this,e);return e&&e.value},set:function(e,t){return s(this,0===e?0:e,t)}}:{add:function(e){return s(this,e=0===e?0:e,e)}}),m&&u(a.prototype,"size",{get:function(){return l(this).size}}),a},setStrong:function(e,t,r){var o=t+" Iterator",n=v(t),s=v(o);i(e,t,function(e,t){g(this,{type:o,target:e,state:n(e),kind:t,last:void 0})},function(){for(var e=s(this),t=e.kind,r=e.last;r&&r.removed;)r=r.previous;return e.target&&(e.last=r=r?r.next:e.state.first)?"keys"==t?{value:r.key,done:!1}:"values"==t?{value:r.value,done:!1}:{value:[r.key,r.value],done:!1}:{value:e.target=void 0,done:!0}},r?"entries":"values",!r,!0),a(t)}}},{"../internals/an-instance":9,"../internals/define-iterator":41,"../internals/descriptors":43,"../internals/function-bind-context":54,"../internals/internal-metadata":69,"../internals/internal-state":70,"../internals/iterate":77,"../internals/object-create":90,"../internals/object-define-property":92,"../internals/redefine-all":107,"../internals/set-species":116}],31:[function(e,t,r){"use strict";function l(e){return e.frozen||(e.frozen=new o)}function o(){this.entries=[]}function n(e,t){return i(e.entries,function(e){return e[0]===t})}var u=e("../internals/redefine-all"),c=e("../internals/internal-metadata").getWeakData,d=e("../internals/an-object"),f=e("../internals/is-object"),h=e("../internals/an-instance"),p=e("../internals/iterate"),s=e("../internals/array-iteration"),m=e("../internals/has"),e=e("../internals/internal-state"),y=e.set,g=e.getterFor,i=s.find,a=s.findIndex,v=0;o.prototype={get:function(e){e=n(this,e);if(e)return e[1]},has:function(e){return!!n(this,e)},set:function(e,t){var r=n(this,e);r?r[1]=t:this.entries.push([e,t])},delete:function(t){var e=a(this.entries,function(e){return e[0]===t});return~e&&this.entries.splice(e,1),!!~e}},t.exports={getConstructor:function(e,r,o,n){function s(e,t,r){var o=a(e),n=c(d(t),!0);return!0===n?l(o).set(t,r):n[o.id]=r,e}var i=e(function(e,t){h(e,i,r),y(e,{type:r,id:v++,frozen:void 0}),null!=t&&p(t,e[n],e,o)}),a=g(r);return u(i.prototype,{delete:function(e){var t,r=a(this);return!!f(e)&&(!0===(t=c(e))?l(r).delete(e):t&&m(t,r.id)&&delete t[r.id])},has:function(e){var t,r=a(this);return!!f(e)&&(!0===(t=c(e))?l(r).has(e):t&&m(t,r.id))}}),u(i.prototype,o?{get:function(e){var t,r=a(this);if(f(e))return!0===(t=c(e))?l(r).get(e):t?t[r.id]:void 0},set:function(e,t){return s(this,e,t)}}:{add:function(e){return s(this,e,!0)}}),i}}},{"../internals/an-instance":9,"../internals/an-object":10,"../internals/array-iteration":19,"../internals/has":60,"../internals/internal-metadata":69,"../internals/internal-state":70,"../internals/is-object":74,"../internals/iterate":77,"../internals/redefine-all":107}],32:[function(e,t,r){"use strict";var y=e("../internals/export"),g=e("../internals/global"),v=e("../internals/is-forced"),b=e("../internals/redefine"),j=e("../internals/internal-metadata"),_=e("../internals/iterate"),x=e("../internals/an-instance"),w=e("../internals/is-object"),S=e("../internals/fails"),M=e("../internals/check-correctness-of-iteration"),E=e("../internals/set-to-string-tag"),T=e("../internals/inherit-if-required");t.exports=function(r,e,t){function o(e){var r=h[e];b(h,e,"add"==e?function(e){return r.call(this,0===e?0:e),this}:"delete"==e?function(e){return!(c&&!w(e))&&r.call(this,0===e?0:e)}:"get"==e?function(e){return c&&!w(e)?void 0:r.call(this,0===e?0:e)}:"has"==e?function(e){return!(c&&!w(e))&&r.call(this,0===e?0:e)}:function(e,t){return r.call(this,0===e?0:e,t),this})}var n,s,i,a,l,u=-1!==r.indexOf("Map"),c=-1!==r.indexOf("Weak"),d=u?"set":"add",f=g[r],h=f&&f.prototype,p=f,m={};return v(r,"function"!=typeof f||!(c||h.forEach&&!S(function(){(new f).entries().next()})))?(p=t.getConstructor(e,r,u,d),j.REQUIRED=!0):v(r,!0)&&(s=(n=new p)[d](c?{}:-0,1)!=n,i=S(function(){n.has(1)}),a=M(function(e){new f(e)}),l=!c&&S(function(){for(var e=new f,t=5;t--;)e[d](t,t);return!e.has(-0)}),a||(((p=e(function(e,t){x(e,p,r);e=T(new f,e,p);return null!=t&&_(t,e[d],e,u),e})).prototype=h).constructor=p),(i||l)&&(o("delete"),o("has"),u&&o("get")),(l||s)&&o(d),c&&h.clear&&delete h.clear),m[r]=p,y({global:!0,forced:p!=f},m),E(p,r),c||t.setStrong(p,r,u),p}},{"../internals/an-instance":9,"../internals/check-correctness-of-iteration":27,"../internals/export":50,"../internals/fails":51,"../internals/global":59,"../internals/inherit-if-required":67,"../internals/internal-metadata":69,"../internals/is-forced":73,"../internals/is-object":74,"../internals/iterate":77,"../internals/redefine":108,"../internals/set-to-string-tag":117}],33:[function(e,t,r){var a=e("../internals/has"),l=e("../internals/own-keys"),u=e("../internals/object-get-own-property-descriptor"),c=e("../internals/object-define-property");t.exports=function(e,t){for(var r=l(t),o=c.f,n=u.f,s=0;s<r.length;s++){var i=r[s];a(e,i)||o(e,i,n(t,i))}}},{"../internals/has":60,"../internals/object-define-property":92,"../internals/object-get-own-property-descriptor":93,"../internals/own-keys":103}],34:[function(e,t,r){var o=e("../internals/well-known-symbol")("match");t.exports=function(t){var r=/./;try{"/./"[t](r)}catch(e){try{return r[o]=!1,"/./"[t](r)}catch(e){}}return!1}},{"../internals/well-known-symbol":146}],35:[function(e,t,r){e=e("../internals/fails");t.exports=!e(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})},{"../internals/fails":51}],36:[function(e,t,r){var s=e("../internals/require-object-coercible"),i=/"/g;t.exports=function(e,t,r,o){var e=String(s(e)),n="<"+t;return""!==r&&(n+=" "+r+'="'+String(o).replace(i,"&quot;")+'"'),n+">"+e+"</"+t+">"}},{"../internals/require-object-coercible":113}],37:[function(e,t,r){"use strict";function o(){return this}var n=e("../internals/iterators-core").IteratorPrototype,s=e("../internals/object-create"),i=e("../internals/create-property-descriptor"),a=e("../internals/set-to-string-tag"),l=e("../internals/iterators");t.exports=function(e,t,r){t+=" Iterator";return e.prototype=s(n,{next:i(1,r)}),a(e,t,!1,!0),l[t]=o,e}},{"../internals/create-property-descriptor":39,"../internals/iterators":79,"../internals/iterators-core":78,"../internals/object-create":90,"../internals/set-to-string-tag":117}],38:[function(e,t,r){var o=e("../internals/descriptors"),n=e("../internals/object-define-property"),s=e("../internals/create-property-descriptor");t.exports=o?function(e,t,r){return n.f(e,t,s(1,r))}:function(e,t,r){return e[t]=r,e}},{"../internals/create-property-descriptor":39,"../internals/descriptors":43,"../internals/object-define-property":92}],39:[function(e,t,r){t.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},{}],40:[function(e,t,r){"use strict";var o=e("../internals/to-primitive"),n=e("../internals/object-define-property"),s=e("../internals/create-property-descriptor");t.exports=function(e,t,r){t=o(t);t in e?n.f(e,t,s(0,r)):e[t]=r}},{"../internals/create-property-descriptor":39,"../internals/object-define-property":92,"../internals/to-primitive":138}],41:[function(e,t,r){"use strict";function m(){return this}var y=e("../internals/export"),g=e("../internals/create-iterator-constructor"),v=e("../internals/object-get-prototype-of"),b=e("../internals/object-set-prototype-of"),j=e("../internals/set-to-string-tag"),_=e("../internals/create-non-enumerable-property"),x=e("../internals/redefine"),o=e("../internals/well-known-symbol"),w=e("../internals/is-pure"),S=e("../internals/iterators"),e=e("../internals/iterators-core"),M=e.IteratorPrototype,E=e.BUGGY_SAFARI_ITERATORS,T=o("iterator"),C="values",O="entries";t.exports=function(e,t,r,o,n,s,i){g(r,t,o);function a(e){if(e===n&&h)return h;if(!E&&e in d)return d[e];switch(e){case"keys":case C:case O:return function(){return new r(this,e)}}return function(){return new r(this)}}var l,u,o=t+" Iterator",c=!1,d=e.prototype,f=d[T]||d["@@iterator"]||n&&d[n],h=!E&&f||a(n),p="Array"==t&&d.entries||f;if(p&&(p=v(p.call(new e)),M!==Object.prototype&&p.next&&(w||v(p)===M||(b?b(p,M):"function"!=typeof p[T]&&_(p,T,m)),j(p,o,!0,!0),w&&(S[o]=m))),n==C&&f&&f.name!==C&&(c=!0,h=function(){return f.call(this)}),w&&!i||d[T]===h||_(d,T,h),S[t]=h,n)if(l={values:a(C),keys:s?h:a("keys"),entries:a(O)},i)for(u in l)!E&&!c&&u in d||x(d,u,l[u]);else y({target:t,proto:!0,forced:E||c},l);return l}},{"../internals/create-iterator-constructor":37,"../internals/create-non-enumerable-property":38,"../internals/export":50,"../internals/is-pure":75,"../internals/iterators":79,"../internals/iterators-core":78,"../internals/object-get-prototype-of":97,"../internals/object-set-prototype-of":101,"../internals/redefine":108,"../internals/set-to-string-tag":117,"../internals/well-known-symbol":146}],42:[function(e,t,r){var o=e("../internals/path"),n=e("../internals/has"),s=e("../internals/well-known-symbol-wrapped"),i=e("../internals/object-define-property").f;t.exports=function(e){var t=o.Symbol||(o.Symbol={});n(t,e)||i(t,e,{value:s.f(e)})}},{"../internals/has":60,"../internals/object-define-property":92,"../internals/path":104,"../internals/well-known-symbol-wrapped":145}],43:[function(e,t,r){e=e("../internals/fails");t.exports=!e(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})},{"../internals/fails":51}],44:[function(e,t,r){var o=e("../internals/global"),e=e("../internals/is-object"),n=o.document,s=e(n)&&e(n.createElement);t.exports=function(e){return s?n.createElement(e):{}}},{"../internals/global":59,"../internals/is-object":74}],45:[function(e,t,r){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},{}],46:[function(e,t,r){e=e("../internals/engine-user-agent");t.exports=/(iphone|ipod|ipad).*applewebkit/i.test(e)},{"../internals/engine-user-agent":47}],47:[function(e,t,r){e=e("../internals/get-built-in");t.exports=e("navigator","userAgent")||""},{"../internals/get-built-in":56}],48:[function(e,t,r){var o,n,s=e("../internals/global"),e=e("../internals/engine-user-agent"),s=s.process,s=s&&s.versions,s=s&&s.v8;s?n=(o=s.split("."))[0]+o[1]:e&&(!(o=e.match(/Edge\/(\d+)/))||74<=o[1])&&(o=e.match(/Chrome\/(\d+)/))&&(n=o[1]),t.exports=n&&+n},{"../internals/engine-user-agent":47,"../internals/global":59}],49:[function(e,t,r){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},{}],50:[function(e,t,r){var u=e("../internals/global"),c=e("../internals/object-get-own-property-descriptor").f,d=e("../internals/create-non-enumerable-property"),f=e("../internals/redefine"),h=e("../internals/set-global"),p=e("../internals/copy-constructor-properties"),m=e("../internals/is-forced");t.exports=function(e,t){var r,o,n,s=e.target,i=e.global,a=e.stat,l=i?u:a?u[s]||h(s,{}):(u[s]||{}).prototype;if(l)for(r in t){if(o=t[r],n=e.noTargetGet?(n=c(l,r))&&n.value:l[r],!m(i?r:s+(a?".":"#")+r,e.forced)&&void 0!==n){if(typeof o==typeof n)continue;p(o,n)}(e.sham||n&&n.sham)&&d(o,"sham",!0),f(l,r,o,e)}}},{"../internals/copy-constructor-properties":33,"../internals/create-non-enumerable-property":38,"../internals/global":59,"../internals/is-forced":73,"../internals/object-get-own-property-descriptor":93,"../internals/redefine":108,"../internals/set-global":115}],51:[function(e,t,r){t.exports=function(e){try{return!!e()}catch(e){return!0}}},{}],52:[function(e,t,r){"use strict";e("../modules/es.regexp.exec");var u=e("../internals/redefine"),c=e("../internals/fails"),d=e("../internals/well-known-symbol"),f=e("../internals/regexp-exec"),h=e("../internals/create-non-enumerable-property"),p=d("species"),m=!c(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}),y="$0"==="a".replace(/./,"$0"),e=d("replace"),g=!!/./[e]&&""===/./[e]("a","$0"),v=!c(function(){var e=/(?:)/,t=e.exec,e=(e.exec=function(){return t.apply(this,arguments)},"ab".split(e));return 2!==e.length||"a"!==e[0]||"b"!==e[1]});t.exports=function(r,e,t,o){var s,n,i=d(r),a=!c(function(){var e={};return e[i]=function(){return 7},7!=""[r](e)}),l=a&&!c(function(){var e=!1,t=/a/;return"split"===r&&((t={constructor:{}}).constructor[p]=function(){return t},t.flags="",t[i]=/./[i]),t.exec=function(){return e=!0,null},t[i](""),!e});a&&l&&("replace"!==r||m&&y&&!g)&&("split"!==r||v)||(s=/./[i],t=(l=t(i,""[r],function(e,t,r,o,n){return t.exec===f?a&&!n?{done:!0,value:s.call(t,r,o)}:{done:!0,value:e.call(r,t,o)}:{done:!1}},{REPLACE_KEEPS_$0:y,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:g}))[0],n=l[1],u(String.prototype,r,t),u(RegExp.prototype,i,2==e?function(e,t){return n.call(e,this,t)}:function(e){return n.call(e,this)})),o&&h(RegExp.prototype[i],"sham",!0)}},{"../internals/create-non-enumerable-property":38,"../internals/fails":51,"../internals/redefine":108,"../internals/regexp-exec":110,"../internals/well-known-symbol":146,"../modules/es.regexp.exec":181}],53:[function(e,t,r){e=e("../internals/fails");t.exports=!e(function(){return Object.isExtensible(Object.preventExtensions({}))})},{"../internals/fails":51}],54:[function(e,t,r){var s=e("../internals/a-function");t.exports=function(o,n,e){if(s(o),void 0===n)return o;switch(e){case 0:return function(){return o.call(n)};case 1:return function(e){return o.call(n,e)};case 2:return function(e,t){return o.call(n,e,t)};case 3:return function(e,t,r){return o.call(n,e,t,r)}}return function(){return o.apply(n,arguments)}}},{"../internals/a-function":5}],55:[function(e,t,r){"use strict";var o=e("../internals/a-function"),n=e("../internals/is-object"),c=[].slice,d={};t.exports=Function.bind||function(i){var a=o(this),l=c.call(arguments,1),u=function(){var e=l.concat(c.call(arguments));if(this instanceof u){var t=a,r=e.length,o=e;if(!(r in d)){for(var n=[],s=0;s<r;s++)n[s]="a["+s+"]";d[r]=Function("C,a","return new C("+n.join(",")+")")}return d[r](t,o)}return a.apply(i,e)};return n(a.prototype)&&(u.prototype=a.prototype),u}},{"../internals/a-function":5,"../internals/is-object":74}],56:[function(e,t,r){function o(e){return"function"==typeof e?e:void 0}var n=e("../internals/path"),s=e("../internals/global");t.exports=function(e,t){return arguments.length<2?o(n[e])||o(s[e]):n[e]&&n[e][t]||s[e]&&s[e][t]}},{"../internals/global":59,"../internals/path":104}],57:[function(e,t,r){var o=e("../internals/classof"),n=e("../internals/iterators"),s=e("../internals/well-known-symbol")("iterator");t.exports=function(e){if(null!=e)return e[s]||e["@@iterator"]||n[o(e)]}},{"../internals/classof":29,"../internals/iterators":79,"../internals/well-known-symbol":146}],58:[function(e,t,r){var o=e("../internals/an-object"),n=e("../internals/get-iterator-method");t.exports=function(e){var t=n(e);if("function"!=typeof t)throw TypeError(String(e)+" is not iterable");return o(t.call(e))}},{"../internals/an-object":10,"../internals/get-iterator-method":57}],59:[function(e,r,t){!function(e){function t(e){return e&&e.Math==Math&&e}r.exports=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof e&&e)||Function("return this")()}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],60:[function(e,t,r){var o={}.hasOwnProperty;t.exports=function(e,t){return o.call(e,t)}},{}],61:[function(e,t,r){t.exports={}},{}],62:[function(e,t,r){var o=e("../internals/global");t.exports=function(e,t){var r=o.console;r&&r.error&&(1===arguments.length?r.error(e):r.error(e,t))}},{"../internals/global":59}],63:[function(e,t,r){e=e("../internals/get-built-in");t.exports=e("document","documentElement")},{"../internals/get-built-in":56}],64:[function(e,t,r){var o=e("../internals/descriptors"),n=e("../internals/fails"),s=e("../internals/document-create-element");t.exports=!o&&!n(function(){return 7!=Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a})},{"../internals/descriptors":43,"../internals/document-create-element":44,"../internals/fails":51}],65:[function(e,t,r){var f=Math.abs,h=Math.pow,p=Math.floor,m=Math.log,y=Math.LN2;t.exports={pack:function(e,t,r){var o,n,s,i=new Array(r),a=8*r-t-1,r=(1<<a)-1,l=r>>1,u=23===t?h(2,-24)-h(2,-77):0,c=e<0||0===e&&1/e<0?1:0,d=0;for((e=f(e))!=e||e===1/0?(n=e!=e?1:0,o=r):(o=p(m(e)/y),e*(s=h(2,-o))<1&&(o--,s*=2),2<=(e+=1<=o+l?u/s:u*h(2,1-l))*s&&(o++,s/=2),r<=o+l?(n=0,o=r):1<=o+l?(n=(e*s-1)*h(2,t),o+=l):(n=e*h(2,l-1)*h(2,t),o=0));8<=t;i[d++]=255&n,n/=256,t-=8);for(o=o<<t|n,a+=t;0<a;i[d++]=255&o,o/=256,a-=8);return i[--d]|=128*c,i},unpack:function(e,t){var r,o=e.length,n=8*o-t-1,s=(1<<n)-1,i=s>>1,a=n-7,l=o-1,n=e[l--],u=127&n;for(n>>=7;0<a;u=256*u+e[l],l--,a-=8);for(r=u&(1<<-a)-1,u>>=-a,a+=t;0<a;r=256*r+e[l],l--,a-=8);if(0===u)u=1-i;else{if(u===s)return r?NaN:n?-1/0:1/0;r+=h(2,t),u-=i}return(n?-1:1)*r*h(2,u-t)}}},{}],66:[function(e,t,r){var o=e("../internals/fails"),n=e("../internals/classof-raw"),s="".split;t.exports=o(function(){return!Object("z").propertyIsEnumerable(0)})?function(e){return"String"==n(e)?s.call(e,""):Object(e)}:Object},{"../internals/classof-raw":28,"../internals/fails":51}],67:[function(e,t,r){var o=e("../internals/is-object"),n=e("../internals/object-set-prototype-of");t.exports=function(e,t,r){return n&&"function"==typeof(t=t.constructor)&&t!==r&&o(t=t.prototype)&&t!==r.prototype&&n(e,t),e}},{"../internals/is-object":74,"../internals/object-set-prototype-of":101}],68:[function(e,t,r){var e=e("../internals/shared-store"),o=Function.toString;"function"!=typeof e.inspectSource&&(e.inspectSource=function(e){return o.call(e)}),t.exports=e.inspectSource},{"../internals/shared-store":119}],69:[function(e,t,r){function o(e){a(e,c,{value:{objectID:"O"+ ++d,weakData:{}}})}var n=e("../internals/hidden-keys"),s=e("../internals/is-object"),i=e("../internals/has"),a=e("../internals/object-define-property").f,l=e("../internals/uid"),u=e("../internals/freezing"),c=l("meta"),d=0,f=Object.isExtensible||function(){return!0},h=t.exports={REQUIRED:!1,fastKey:function(e,t){if(!s(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!i(e,c)){if(!f(e))return"F";if(!t)return"E";o(e)}return e[c].objectID},getWeakData:function(e,t){if(!i(e,c)){if(!f(e))return!0;if(!t)return!1;o(e)}return e[c].weakData},onFreeze:function(e){return u&&h.REQUIRED&&f(e)&&!i(e,c)&&o(e),e}};n[c]=!0},{"../internals/freezing":53,"../internals/has":60,"../internals/hidden-keys":61,"../internals/is-object":74,"../internals/object-define-property":92,"../internals/uid":143}],70:[function(e,t,r){var o,n,s,i,a,l,u,c,d=e("../internals/native-weak-map"),f=e("../internals/global"),h=e("../internals/is-object"),p=e("../internals/create-non-enumerable-property"),m=e("../internals/has"),y=e("../internals/shared-key"),e=e("../internals/hidden-keys"),f=f.WeakMap;u=d?(o=new f,n=o.get,s=o.has,i=o.set,a=function(e,t){return i.call(o,e,t),t},l=function(e){return n.call(o,e)||{}},function(e){return s.call(o,e)}):(e[c=y("state")]=!0,a=function(e,t){return p(e,c,t),t},l=function(e){return m(e,c)?e[c]:{}},function(e){return m(e,c)}),t.exports={set:a,get:l,has:u,enforce:function(e){return u(e)?l(e):a(e,{})},getterFor:function(t){return function(e){if(h(e)&&(e=l(e)).type===t)return e;throw TypeError("Incompatible receiver, "+t+" required")}}}},{"../internals/create-non-enumerable-property":38,"../internals/global":59,"../internals/has":60,"../internals/hidden-keys":61,"../internals/is-object":74,"../internals/native-weak-map":85,"../internals/shared-key":118}],71:[function(e,t,r){var o=e("../internals/well-known-symbol"),n=e("../internals/iterators"),s=o("iterator"),i=Array.prototype;t.exports=function(e){return void 0!==e&&(n.Array===e||i[s]===e)}},{"../internals/iterators":79,"../internals/well-known-symbol":146}],72:[function(e,t,r){var o=e("../internals/classof-raw");t.exports=Array.isArray||function(e){return"Array"==o(e)}},{"../internals/classof-raw":28}],73:[function(e,t,r){function o(e,t){return(e=a[i(e)])==u||e!=l&&("function"==typeof t?n(t):!!t)}var n=e("../internals/fails"),s=/#|\.prototype\./,i=o.normalize=function(e){return String(e).replace(s,".").toLowerCase()},a=o.data={},l=o.NATIVE="N",u=o.POLYFILL="P";t.exports=o},{"../internals/fails":51}],74:[function(e,t,r){t.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},{}],75:[function(e,t,r){t.exports=!1},{}],76:[function(e,t,r){var o=e("../internals/is-object"),n=e("../internals/classof-raw"),s=e("../internals/well-known-symbol")("match");t.exports=function(e){var t;return o(e)&&(void 0!==(t=e[s])?!!t:"RegExp"==n(e))}},{"../internals/classof-raw":28,"../internals/is-object":74,"../internals/well-known-symbol":146}],77:[function(e,t,r){function f(e,t){this.stopped=e,this.result=t}var h=e("../internals/an-object"),p=e("../internals/is-array-iterator-method"),m=e("../internals/to-length"),y=e("../internals/function-bind-context"),g=e("../internals/get-iterator-method"),v=e("../internals/call-with-safe-iteration-closing");(t.exports=function(e,t,r,o,n){var s,i,a,l,u,c,d=y(t,r,o?2:1);if(n)s=e;else{if("function"!=typeof(t=g(e)))throw TypeError("Target is not iterable");if(p(t)){for(i=0,a=m(e.length);i<a;i++)if((l=o?d(h(c=e[i])[0],c[1]):d(e[i]))&&l instanceof f)return l;return new f(!1)}s=t.call(e)}for(u=s.next;!(c=u.call(s)).done;)if("object"==typeof(l=v(s,d,c.value,o))&&l&&l instanceof f)return l;return new f(!1)}).stop=function(e){return new f(!0,e)}},{"../internals/an-object":10,"../internals/call-with-safe-iteration-closing":26,"../internals/function-bind-context":54,"../internals/get-iterator-method":57,"../internals/is-array-iterator-method":71,"../internals/to-length":134}],78:[function(e,t,r){"use strict";var o,n,s=e("../internals/object-get-prototype-of"),i=e("../internals/create-non-enumerable-property"),a=e("../internals/has"),l=e("../internals/well-known-symbol"),e=e("../internals/is-pure"),l=l("iterator"),u=!1;[].keys&&("next"in(n=[].keys())?(s=s(s(n)))!==Object.prototype&&(o=s):u=!0),null==o&&(o={}),e||a(o,l)||i(o,l,function(){return this}),t.exports={IteratorPrototype:o,BUGGY_SAFARI_ITERATORS:u}},{"../internals/create-non-enumerable-property":38,"../internals/has":60,"../internals/is-pure":75,"../internals/object-get-prototype-of":97,"../internals/well-known-symbol":146}],79:[function(e,t,r){t.exports={}},{}],80:[function(e,t,r){t.exports=Math.sign||function(e){return 0==(e=+e)||e!=e?e:e<0?-1:1}},{}],81:[function(e,t,r){var o,n,s,i,a,l,u,c,d=e("../internals/global"),f=e("../internals/object-get-own-property-descriptor").f,h=e("../internals/classof-raw"),p=e("../internals/task").set,e=e("../internals/engine-is-ios"),m=d.MutationObserver||d.WebKitMutationObserver,y=d.process,g=d.Promise,v="process"==h(y),h=f(d,"queueMicrotask"),f=h&&h.value;f||(o=function(){var e,t;for(v&&(e=y.domain)&&e.exit();n;){t=n.fn,n=n.next;try{t()}catch(e){throw n?i():s=void 0,e}}s=void 0,e&&e.enter()},i=v?function(){y.nextTick(o)}:m&&!e?(a=!0,l=document.createTextNode(""),new m(o).observe(l,{characterData:!0}),function(){l.data=a=!a}):g&&g.resolve?(u=g.resolve(void 0),c=u.then,function(){c.call(u,o)}):function(){p.call(d,o)}),t.exports=f||function(e){e={fn:e,next:void 0};s&&(s.next=e),n||(n=e,i()),s=e}},{"../internals/classof-raw":28,"../internals/engine-is-ios":46,"../internals/global":59,"../internals/object-get-own-property-descriptor":93,"../internals/task":128}],82:[function(e,t,r){e=e("../internals/global");t.exports=e.Promise},{"../internals/global":59}],83:[function(e,t,r){e=e("../internals/fails");t.exports=!!Object.getOwnPropertySymbols&&!e(function(){return!String(Symbol())})},{"../internals/fails":51}],84:[function(e,t,r){var o=e("../internals/fails"),n=e("../internals/well-known-symbol"),s=e("../internals/is-pure"),i=n("iterator");t.exports=!o(function(){var e=new URL("b?a=1&b=2&c=3","http://a"),r=e.searchParams,o="";return e.pathname="c%20d",r.forEach(function(e,t){r.delete("b"),o+=t+e}),s&&!e.toJSON||!r.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==r.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!r[i]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==o||"x"!==new URL("http://x",void 0).host})},{"../internals/fails":51,"../internals/is-pure":75,"../internals/well-known-symbol":146}],85:[function(e,t,r){var o=e("../internals/global"),e=e("../internals/inspect-source"),o=o.WeakMap;t.exports="function"==typeof o&&/native code/.test(e(o))},{"../internals/global":59,"../internals/inspect-source":68}],86:[function(e,t,r){"use strict";function o(e){var r,o;this.promise=new e(function(e,t){if(void 0!==r||void 0!==o)throw TypeError("Bad Promise constructor");r=e,o=t}),this.resolve=n(r),this.reject=n(o)}var n=e("../internals/a-function");t.exports.f=function(e){return new o(e)}},{"../internals/a-function":5}],87:[function(e,t,r){var o=e("../internals/is-regexp");t.exports=function(e){if(o(e))throw TypeError("The method doesn't accept regular expressions");return e}},{"../internals/is-regexp":76}],88:[function(e,t,r){var o=e("../internals/global").isFinite;t.exports=Number.isFinite||function(e){return"number"==typeof e&&o(e)}},{"../internals/global":59}],89:[function(e,t,r){"use strict";var f=e("../internals/descriptors"),o=e("../internals/fails"),h=e("../internals/object-keys"),p=e("../internals/object-get-own-property-symbols"),m=e("../internals/object-property-is-enumerable"),y=e("../internals/to-object"),g=e("../internals/indexed-object"),n=Object.assign,s=Object.defineProperty;t.exports=!n||o(function(){var e,t,r,o;return!(!f||1===n({b:1},n(s({},"a",{enumerable:!0,get:function(){s(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)||(t={},o="abcdefghijklmnopqrst",(e={})[r=Symbol()]=7,o.split("").forEach(function(e){t[e]=e}),7!=n({},e)[r]||h(n({},t)).join("")!=o)})?function(e,t){for(var r=y(e),o=arguments.length,n=1,s=p.f,i=m.f;n<o;)for(var a,l=g(arguments[n++]),u=s?h(l).concat(s(l)):h(l),c=u.length,d=0;d<c;)a=u[d++],f&&!i.call(l,a)||(r[a]=l[a]);return r}:n},{"../internals/descriptors":43,"../internals/fails":51,"../internals/indexed-object":66,"../internals/object-get-own-property-symbols":96,"../internals/object-keys":99,"../internals/object-property-is-enumerable":100,"../internals/to-object":135}],90:[function(e,t,r){function o(){}var n,s=e("../internals/an-object"),i=e("../internals/object-define-properties"),a=e("../internals/enum-bug-keys"),l=e("../internals/hidden-keys"),u=e("../internals/html"),c=e("../internals/document-create-element"),e=e("../internals/shared-key"),d="prototype",f="script",h=e("IE_PROTO"),p=function(e){return"<"+f+">"+e+"</"+f+">"},m=function(){try{n=document.domain&&new ActiveXObject("htmlfile")}catch(e){}m=n?((e=n).write(p("")),e.close(),t=e.parentWindow.Object,e=null,t):(e=c("iframe"),t="java"+f+":",e.style.display="none",u.appendChild(e),e.src=String(t),(t=e.contentWindow.document).open(),t.write(p("document.F=Object")),t.close(),t.F);for(var e,t,r=a.length;r--;)delete m[d][a[r]];return m()};l[h]=!0,t.exports=Object.create||function(e,t){var r;return null!==e?(o[d]=s(e),r=new o,o[d]=null,r[h]=e):r=m(),void 0===t?r:i(r,t)}},{"../internals/an-object":10,"../internals/document-create-element":44,"../internals/enum-bug-keys":49,"../internals/hidden-keys":61,"../internals/html":63,"../internals/object-define-properties":91,"../internals/shared-key":118}],91:[function(e,t,r){var o=e("../internals/descriptors"),i=e("../internals/object-define-property"),a=e("../internals/an-object"),l=e("../internals/object-keys");t.exports=o?Object.defineProperties:function(e,t){a(e);for(var r,o=l(t),n=o.length,s=0;s<n;)i.f(e,r=o[s++],t[r]);return e}},{"../internals/an-object":10,"../internals/descriptors":43,"../internals/object-define-property":92,"../internals/object-keys":99}],92:[function(e,t,r){var o=e("../internals/descriptors"),n=e("../internals/ie8-dom-define"),s=e("../internals/an-object"),i=e("../internals/to-primitive"),a=Object.defineProperty;r.f=o?a:function(e,t,r){if(s(e),t=i(t,!0),s(r),n)try{return a(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},{"../internals/an-object":10,"../internals/descriptors":43,"../internals/ie8-dom-define":64,"../internals/to-primitive":138}],93:[function(e,t,r){var o=e("../internals/descriptors"),n=e("../internals/object-property-is-enumerable"),s=e("../internals/create-property-descriptor"),i=e("../internals/to-indexed-object"),a=e("../internals/to-primitive"),l=e("../internals/has"),u=e("../internals/ie8-dom-define"),c=Object.getOwnPropertyDescriptor;r.f=o?c:function(e,t){if(e=i(e),t=a(t,!0),u)try{return c(e,t)}catch(e){}if(l(e,t))return s(!n.f.call(e,t),e[t])}},{"../internals/create-property-descriptor":39,"../internals/descriptors":43,"../internals/has":60,"../internals/ie8-dom-define":64,"../internals/object-property-is-enumerable":100,"../internals/to-indexed-object":132,"../internals/to-primitive":138}],94:[function(e,t,r){var o=e("../internals/to-indexed-object"),n=e("../internals/object-get-own-property-names").f,s={}.toString,i="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(e){if(!i||"[object Window]"!=s.call(e))return n(o(e));try{return n(e)}catch(e){return i.slice()}}},{"../internals/object-get-own-property-names":95,"../internals/to-indexed-object":132}],95:[function(e,t,r){var o=e("../internals/object-keys-internal"),n=e("../internals/enum-bug-keys").concat("length","prototype");r.f=Object.getOwnPropertyNames||function(e){return o(e,n)}},{"../internals/enum-bug-keys":49,"../internals/object-keys-internal":98}],96:[function(e,t,r){r.f=Object.getOwnPropertySymbols},{}],97:[function(e,t,r){var o=e("../internals/has"),n=e("../internals/to-object"),s=e("../internals/shared-key"),e=e("../internals/correct-prototype-getter"),i=s("IE_PROTO"),a=Object.prototype;t.exports=e?Object.getPrototypeOf:function(e){return e=n(e),o(e,i)?e[i]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},{"../internals/correct-prototype-getter":35,"../internals/has":60,"../internals/shared-key":118,"../internals/to-object":135}],98:[function(e,t,r){var i=e("../internals/has"),a=e("../internals/to-indexed-object"),l=e("../internals/array-includes").indexOf,u=e("../internals/hidden-keys");t.exports=function(e,t){var r,o=a(e),n=0,s=[];for(r in o)!i(u,r)&&i(o,r)&&s.push(r);for(;t.length>n;)!i(o,r=t[n++])||~l(s,r)||s.push(r);return s}},{"../internals/array-includes":18,"../internals/has":60,"../internals/hidden-keys":61,"../internals/to-indexed-object":132}],99:[function(e,t,r){var o=e("../internals/object-keys-internal"),n=e("../internals/enum-bug-keys");t.exports=Object.keys||function(e){return o(e,n)}},{"../internals/enum-bug-keys":49,"../internals/object-keys-internal":98}],100:[function(e,t,r){"use strict";var o={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,s=n&&!o.call({1:2},1);r.f=s?function(e){e=n(this,e);return!!e&&e.enumerable}:o},{}],101:[function(e,t,r){var n=e("../internals/an-object"),s=e("../internals/a-possible-prototype");t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var r,o=!1,e={};try{(r=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(e,[]),o=e instanceof Array}catch(e){}return function(e,t){return n(e),s(t),o?r.call(e,t):e.__proto__=t,e}}():void 0)},{"../internals/a-possible-prototype":6,"../internals/an-object":10}],102:[function(e,t,r){"use strict";var o=e("../internals/to-string-tag-support"),n=e("../internals/classof");t.exports=o?{}.toString:function(){return"[object "+n(this)+"]"}},{"../internals/classof":29,"../internals/to-string-tag-support":139}],103:[function(e,t,r){var o=e("../internals/get-built-in"),n=e("../internals/object-get-own-property-names"),s=e("../internals/object-get-own-property-symbols"),i=e("../internals/an-object");t.exports=o("Reflect","ownKeys")||function(e){var t=n.f(i(e)),r=s.f;return r?t.concat(r(e)):t}},{"../internals/an-object":10,"../internals/get-built-in":56,"../internals/object-get-own-property-names":95,"../internals/object-get-own-property-symbols":96}],104:[function(e,t,r){e=e("../internals/global");t.exports=e},{"../internals/global":59}],105:[function(e,t,r){t.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},{}],106:[function(e,t,r){var o=e("../internals/an-object"),n=e("../internals/is-object"),s=e("../internals/new-promise-capability");t.exports=function(e,t){return o(e),n(t)&&t.constructor===e?t:((0,(e=s.f(e)).resolve)(t),e.promise)}},{"../internals/an-object":10,"../internals/is-object":74,"../internals/new-promise-capability":86}],107:[function(e,t,r){var n=e("../internals/redefine");t.exports=function(e,t,r){for(var o in t)n(e,o,t[o],r);return e}},{"../internals/redefine":108}],108:[function(e,t,r){var i=e("../internals/global"),a=e("../internals/create-non-enumerable-property"),l=e("../internals/has"),u=e("../internals/set-global"),o=e("../internals/inspect-source"),e=e("../internals/internal-state"),n=e.get,c=e.enforce,d=String(String).split("String");(t.exports=function(e,t,r,o){var n=!!o&&!!o.unsafe,s=!!o&&!!o.enumerable,o=!!o&&!!o.noTargetGet;"function"==typeof r&&("string"!=typeof t||l(r,"name")||a(r,"name",t),c(r).source=d.join("string"==typeof t?t:"")),e===i?s?e[t]=r:u(t,r):(n?!o&&e[t]&&(s=!0):delete e[t],s?e[t]=r:a(e,t,r))})(Function.prototype,"toString",function(){return"function"==typeof this&&n(this).source||o(this)})},{"../internals/create-non-enumerable-property":38,"../internals/global":59,"../internals/has":60,"../internals/inspect-source":68,"../internals/internal-state":70,"../internals/set-global":115}],109:[function(e,t,r){var o=e("./classof-raw"),n=e("./regexp-exec");t.exports=function(e,t){var r=e.exec;if("function"==typeof r){r=r.call(e,t);if("object"!=typeof r)throw TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==o(e))throw TypeError("RegExp#exec called on incompatible receiver");return n.call(e,t)}},{"./classof-raw":28,"./regexp-exec":110}],110:[function(e,t,r){"use strict";var o,n,d=e("./regexp-flags"),e=e("./regexp-sticky-helpers"),f=RegExp.prototype.exec,h=String.prototype.replace,s=f,p=(o=/a/,n=/b*/g,f.call(o,"a"),f.call(n,"a"),0!==o.lastIndex||0!==n.lastIndex),m=e.UNSUPPORTED_Y||e.BROKEN_CARET,y=void 0!==/()??/.exec("")[1];t.exports=s=p||y||m?function(e){var t,r,o,n,s=this,i=m&&s.sticky,a=d.call(s),l=s.source,u=0,c=e;return i&&(-1===(a=a.replace("y","")).indexOf("g")&&(a+="g"),c=String(e).slice(s.lastIndex),0<s.lastIndex&&(!s.multiline||s.multiline&&"\n"!==e[s.lastIndex-1])&&(l="(?: "+l+")",c=" "+c,u++),r=new RegExp("^(?:"+l+")",a)),y&&(r=new RegExp("^"+l+"$(?!\\s)",a)),p&&(t=s.lastIndex),o=f.call(i?r:s,c),i?o?(o.input=o.input.slice(u),o[0]=o[0].slice(u),o.index=s.lastIndex,s.lastIndex+=o[0].length):s.lastIndex=0:p&&o&&(s.lastIndex=s.global?o.index+o[0].length:t),y&&o&&1<o.length&&h.call(o[0],r,function(){for(n=1;n<arguments.length-2;n++)void 0===arguments[n]&&(o[n]=void 0)}),o}:s},{"./regexp-flags":111,"./regexp-sticky-helpers":112}],111:[function(e,t,r){"use strict";var o=e("../internals/an-object");t.exports=function(){var e=o(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},{"../internals/an-object":10}],112:[function(e,t,r){"use strict";e=e("./fails");function o(e,t){return RegExp(e,t)}r.UNSUPPORTED_Y=e(function(){var e=o("a","y");return e.lastIndex=2,null!=e.exec("abcd")}),r.BROKEN_CARET=e(function(){var e=o("^r","gy");return e.lastIndex=2,null!=e.exec("str")})},{"./fails":51}],113:[function(e,t,r){t.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},{}],114:[function(e,t,r){t.exports=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}},{}],115:[function(e,t,r){var o=e("../internals/global"),n=e("../internals/create-non-enumerable-property");t.exports=function(t,r){try{n(o,t,r)}catch(e){o[t]=r}return r}},{"../internals/create-non-enumerable-property":38,"../internals/global":59}],116:[function(e,t,r){"use strict";var o=e("../internals/get-built-in"),n=e("../internals/object-define-property"),s=e("../internals/well-known-symbol"),i=e("../internals/descriptors"),a=s("species");t.exports=function(e){var e=o(e),t=n.f;i&&e&&!e[a]&&t(e,a,{configurable:!0,get:function(){return this}})}},{"../internals/descriptors":43,"../internals/get-built-in":56,"../internals/object-define-property":92,"../internals/well-known-symbol":146}],117:[function(e,t,r){var o=e("../internals/object-define-property").f,n=e("../internals/has"),s=e("../internals/well-known-symbol")("toStringTag");t.exports=function(e,t,r){e&&!n(e=r?e:e.prototype,s)&&o(e,s,{configurable:!0,value:t})}},{"../internals/has":60,"../internals/object-define-property":92,"../internals/well-known-symbol":146}],118:[function(e,t,r){var o=e("../internals/shared"),n=e("../internals/uid"),s=o("keys");t.exports=function(e){return s[e]||(s[e]=n(e))}},{"../internals/shared":120,"../internals/uid":143}],119:[function(e,t,r){var o=e("../internals/global"),e=e("../internals/set-global"),n="__core-js_shared__",o=o[n]||e(n,{});t.exports=o},{"../internals/global":59,"../internals/set-global":115}],120:[function(e,t,r){var o=e("../internals/is-pure"),n=e("../internals/shared-store");(t.exports=function(e,t){return n[e]||(n[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.6.5",mode:o?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},{"../internals/is-pure":75,"../internals/shared-store":119}],121:[function(e,t,r){var o=e("../internals/an-object"),n=e("../internals/a-function"),s=e("../internals/well-known-symbol")("species");t.exports=function(e,t){var e=o(e).constructor;return void 0===e||null==(e=o(e)[s])?t:n(e)}},{"../internals/a-function":5,"../internals/an-object":10,"../internals/well-known-symbol":146}],122:[function(e,t,r){var o=e("../internals/fails");t.exports=function(t){return o(function(){var e=""[t]('"');return e!==e.toLowerCase()||3<e.split('"').length})}},{"../internals/fails":51}],123:[function(e,t,r){function o(n){return function(e,t){var r,e=String(i(e)),t=s(t),o=e.length;return t<0||o<=t?n?"":void 0:(r=e.charCodeAt(t))<55296||56319<r||t+1===o||(o=e.charCodeAt(t+1))<56320||57343<o?n?e.charAt(t):r:n?e.slice(t,t+2):o-56320+(r-55296<<10)+65536}}var s=e("../internals/to-integer"),i=e("../internals/require-object-coercible");t.exports={codeAt:o(!1),charAt:o(!0)}},{"../internals/require-object-coercible":113,"../internals/to-integer":133}],124:[function(e,t,r){"use strict";function g(e){return e+22+75*(e<26)}function s(e){var t,r=[],o=(e=function(e){for(var t=[],r=0,o=e.length;r<o;){var n,s=e.charCodeAt(r++);55296<=s&&s<=56319&&r<o?56320==(64512&(n=e.charCodeAt(r++)))?t.push(((1023&s)<<10)+(1023&n)+65536):(t.push(s),r--):t.push(s)}return t}(e)).length,n=128,s=0,i=72;for(c=0;c<e.length;c++)(t=e[c])<128&&r.push(E(t));var a=r.length,l=a;for(a&&r.push("-");l<o;){for(var u=v,c=0;c<e.length;c++)n<=(t=e[c])&&t<u&&(u=t);var d=l+1;if(u-n>M((v-s)/d))throw RangeError(w);for(s+=(u-n)*d,n=u,c=0;c<e.length;c++){if((t=e[c])<n&&++s>v)throw RangeError(w);if(t==n){for(var f=s,h=b;;h+=b){var p=h<=i?1:i+j<=h?j:h-i;if(f<p)break;var m=f-p,y=b-p;r.push(E(g(p+m%y))),f=M(m/y)}r.push(E(g(f))),i=function(e,t,r){var o=0;for(e=r?M(e/x):e>>1,e+=M(e/t);S*j>>1<e;o+=b)e=M(e/S);return M(o+(S+1)*e/(e+_))}(s,d,l==a),s=0,++l}}++s,++n}return r.join("")}var v=2147483647,b=36,j=26,_=38,x=700,i=/[^\0-\u007E]/,a=/[.\u3002\uFF0E\uFF61]/g,w="Overflow: input needs wider integers to process",S=b-1,M=Math.floor,E=String.fromCharCode;t.exports=function(e){for(var t,r=[],o=e.toLowerCase().replace(a,".").split("."),n=0;n<o.length;n++)t=o[n],r.push(i.test(t)?"xn--"+s(t):t);return r.join(".")}},{}],125:[function(e,t,r){"use strict";var n=e("../internals/to-integer"),s=e("../internals/require-object-coercible");t.exports="".repeat||function(e){var t=String(s(this)),r="",o=n(e);if(o<0||o==1/0)throw RangeError("Wrong number of repetitions");for(;0<o;(o>>>=1)&&(t+=t))1&o&&(r+=t);return r}},{"../internals/require-object-coercible":113,"../internals/to-integer":133}],126:[function(e,t,r){var o=e("../internals/fails"),n=e("../internals/whitespaces");t.exports=function(e){return o(function(){return!!n[e]()||"​…᠎"!="​…᠎"[e]()||n[e].name!==e})}},{"../internals/fails":51,"../internals/whitespaces":147}],127:[function(e,t,r){function o(t){return function(e){e=String(n(e));return 1&t&&(e=e.replace(s,"")),e=2&t?e.replace(i,""):e}}var n=e("../internals/require-object-coercible"),e="["+e("../internals/whitespaces")+"]",s=RegExp("^"+e+e+"*"),i=RegExp(e+e+"*$");t.exports={start:o(1),end:o(2),trim:o(3)}},{"../internals/require-object-coercible":113,"../internals/whitespaces":147}],128:[function(e,t,r){function o(e){return function(){x(e)}}function n(e){x(e.data)}function s(e){a.postMessage(e+"",h.protocol+"//"+h.host)}var i,a=e("../internals/global"),l=e("../internals/fails"),u=e("../internals/classof-raw"),c=e("../internals/function-bind-context"),d=e("../internals/html"),f=e("../internals/document-create-element"),e=e("../internals/engine-is-ios"),h=a.location,p=a.setImmediate,m=a.clearImmediate,y=a.process,g=a.MessageChannel,v=a.Dispatch,b=0,j={},_="onreadystatechange",x=function(e){var t;j.hasOwnProperty(e)&&(t=j[e],delete j[e],t())};p&&m||(p=function(e){for(var t=[],r=1;r<arguments.length;)t.push(arguments[r++]);return j[++b]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},i(b),b},m=function(e){delete j[e]},"process"==u(y)?i=function(e){y.nextTick(o(e))}:v&&v.now?i=function(e){v.now(o(e))}:g&&!e?(e=(u=new g).port2,u.port1.onmessage=n,i=c(e.postMessage,e,1)):!a.addEventListener||"function"!=typeof postMessage||a.importScripts||l(s)||"file:"===h.protocol?i=_ in f("script")?function(e){d.appendChild(f("script"))[_]=function(){d.removeChild(this),x(e)}}:function(e){setTimeout(o(e),0)}:(i=s,a.addEventListener("message",n,!1))),t.exports={set:p,clear:m}},{"../internals/classof-raw":28,"../internals/document-create-element":44,"../internals/engine-is-ios":46,"../internals/fails":51,"../internals/function-bind-context":54,"../internals/global":59,"../internals/html":63}],129:[function(e,t,r){var o=e("../internals/classof-raw");t.exports=function(e){if("number"!=typeof e&&"Number"!=o(e))throw TypeError("Incorrect invocation");return+e}},{"../internals/classof-raw":28}],130:[function(e,t,r){var o=e("../internals/to-integer"),n=Math.max,s=Math.min;t.exports=function(e,t){e=o(e);return e<0?n(e+t,0):s(e,t)}},{"../internals/to-integer":133}],131:[function(e,t,r){var o=e("../internals/to-integer"),n=e("../internals/to-length");t.exports=function(e){if(void 0===e)return 0;var e=o(e),t=n(e);if(e!==t)throw RangeError("Wrong length or index");return t}},{"../internals/to-integer":133,"../internals/to-length":134}],132:[function(e,t,r){var o=e("../internals/indexed-object"),n=e("../internals/require-object-coercible");t.exports=function(e){return o(n(e))}},{"../internals/indexed-object":66,"../internals/require-object-coercible":113}],133:[function(e,t,r){var o=Math.ceil,n=Math.floor;t.exports=function(e){return isNaN(e=+e)?0:(0<e?n:o)(e)}},{}],134:[function(e,t,r){var o=e("../internals/to-integer"),n=Math.min;t.exports=function(e){return 0<e?n(o(e),9007199254740991):0}},{"../internals/to-integer":133}],135:[function(e,t,r){var o=e("../internals/require-object-coercible");t.exports=function(e){return Object(o(e))}},{"../internals/require-object-coercible":113}],136:[function(e,t,r){var o=e("../internals/to-positive-integer");t.exports=function(e,t){e=o(e);if(e%t)throw RangeError("Wrong offset");return e}},{"../internals/to-positive-integer":137}],137:[function(e,t,r){var o=e("../internals/to-integer");t.exports=function(e){e=o(e);if(e<0)throw RangeError("The argument can't be less than 0");return e}},{"../internals/to-integer":133}],138:[function(e,t,r){var n=e("../internals/is-object");t.exports=function(e,t){if(!n(e))return e;var r,o;if(t&&"function"==typeof(r=e.toString)&&!n(o=r.call(e))||"function"==typeof(r=e.valueOf)&&!n(o=r.call(e))||!t&&"function"==typeof(r=e.toString)&&!n(o=r.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},{"../internals/is-object":74}],139:[function(e,t,r){var o={};o[e("../internals/well-known-symbol")("toStringTag")]="z",t.exports="[object z]"===String(o)},{"../internals/well-known-symbol":146}],140:[function(e,t,D){"use strict";function h(e,t){for(var r=0,o=t.length,n=new(Q(e))(o);r<o;)n[r]=t[r++];return n}function r(e,t){E(e,t,{get:function(){return M(this)[t]}})}function p(e){return e instanceof C||"ArrayBuffer"==(e=B(e))||"SharedArrayBuffer"==e}function o(e,t){return A(e)&&"symbol"!=typeof t&&t in e&&String(+t)==String(t)}function n(e,t){return o(e,t=d(t,!0))?N(2,e[t]):X(e,t)}function s(e,t,r){return!(o(e,t=d(t,!0))&&b(r)&&f(r,"value"))||f(r,"get")||f(r,"set")||r.configurable||f(r,"writable")&&!r.writable||f(r,"enumerable")&&!r.enumerable?E(e,t,r):(e[t]=r.value,e)}var a=e("../internals/export"),l=e("../internals/global"),i=e("../internals/descriptors"),U=e("../internals/typed-array-constructors-require-wrappers"),u=e("../internals/array-buffer-view-core"),c=e("../internals/array-buffer"),m=e("../internals/an-instance"),N=e("../internals/create-property-descriptor"),y=e("../internals/create-non-enumerable-property"),F=e("../internals/to-length"),g=e("../internals/to-index"),v=e("../internals/to-offset"),d=e("../internals/to-primitive"),f=e("../internals/has"),B=e("../internals/classof"),b=e("../internals/is-object"),G=e("../internals/object-create"),j=e("../internals/object-set-prototype-of"),V=e("../internals/object-get-own-property-names").f,_=e("../internals/typed-array-from"),z=e("../internals/array-iteration").forEach,H=e("../internals/set-species"),x=e("../internals/object-define-property"),w=e("../internals/object-get-own-property-descriptor"),S=e("../internals/internal-state"),W=e("../internals/inherit-if-required"),M=S.get,q=S.set,E=x.f,X=w.f,Y=Math.round,T=l.RangeError,C=c.ArrayBuffer,Z=c.DataView,O=u.NATIVE_ARRAY_BUFFER_VIEWS,k=u.TYPED_ARRAY_TAG,L=u.TypedArray,P=u.TypedArrayPrototype,Q=u.aTypedArrayConstructor,A=u.isTypedArray,R="BYTES_PER_ELEMENT",I="Wrong length";i?(O||(w.f=n,x.f=s,r(P,"buffer"),r(P,"byteOffset"),r(P,"byteLength"),r(P,"length")),a({target:"Object",stat:!0,forced:!O},{getOwnPropertyDescriptor:n,defineProperty:s}),t.exports=function(e,t,n){function u(e,o){E(e,o,{get:function(){var e=this,t=o;return(e=M(e)).view[r](t*c+e.byteOffset,!0)},set:function(e){var t=this,r=o;t=M(t),n&&(e=(e=Y(e))<0?0:255<e?255:255&e),t.view[s](r*c+t.byteOffset,e,!0)},enumerable:!0})}var c=e.match(/\d+$/)[0]/8,d=e+(n?"Clamped":"")+"Array",r="get"+e,s="set"+e,i=l[d],f=i,e=f&&f.prototype,o={};O?U&&(f=t(function(e,t,r,o){return m(e,f,d),W(b(t)?p(t)?void 0!==o?new i(t,v(r,c),o):void 0!==r?new i(t,v(r,c)):new i(t):A(t)?h(f,t):_.call(f,t):new i(g(t)),e,f)}),j&&j(f,L),z(V(i),function(e){e in f||y(f,e,i[e])}),f.prototype=e):(f=t(function(e,t,r,o){m(e,f,d);var n,s,i=0,a=0;if(b(t)){if(!p(t))return A(t)?h(f,t):_.call(f,t);var l=t,a=v(r,c),r=t.byteLength;if(void 0===o){if(r%c)throw T(I);if((n=r-a)<0)throw T(I)}else if(r<(n=F(o)*c)+a)throw T(I);s=n/c}else s=g(t),l=new C(n=s*c);for(q(e,{buffer:l,byteOffset:a,byteLength:n,length:s,view:new Z(l)});i<s;)u(e,i++)}),j&&j(f,L),e=f.prototype=G(P)),e.constructor!==f&&y(e,"constructor",f),k&&y(e,k,d),o[d]=f,a({global:!0,forced:f!=i,sham:!O},o),R in f||y(f,R,c),R in e||y(e,R,c),H(d)}):t.exports=function(){}},{"../internals/an-instance":9,"../internals/array-buffer":13,"../internals/array-buffer-view-core":12,"../internals/array-iteration":19,"../internals/classof":29,"../internals/create-non-enumerable-property":38,"../internals/create-property-descriptor":39,"../internals/descriptors":43,"../internals/export":50,"../internals/global":59,"../internals/has":60,"../internals/inherit-if-required":67,"../internals/internal-state":70,"../internals/is-object":74,"../internals/object-create":90,"../internals/object-define-property":92,"../internals/object-get-own-property-descriptor":93,"../internals/object-get-own-property-names":95,"../internals/object-set-prototype-of":101,"../internals/set-species":116,"../internals/to-index":131,"../internals/to-length":134,"../internals/to-offset":136,"../internals/to-primitive":138,"../internals/typed-array-constructors-require-wrappers":141,"../internals/typed-array-from":142}],141:[function(e,t,r){var o=e("../internals/global"),n=e("../internals/fails"),s=e("../internals/check-correctness-of-iteration"),e=e("../internals/array-buffer-view-core").NATIVE_ARRAY_BUFFER_VIEWS,i=o.ArrayBuffer,a=o.Int8Array;t.exports=!e||!n(function(){a(1)})||!n(function(){new a(-1)})||!s(function(e){new a,new a(null),new a(1.5),new a(e)},!0)||n(function(){return 1!==new a(new i(2),1,void 0).length})},{"../internals/array-buffer-view-core":12,"../internals/check-correctness-of-iteration":27,"../internals/fails":51,"../internals/global":59}],142:[function(e,t,r){var f=e("../internals/to-object"),h=e("../internals/to-length"),p=e("../internals/get-iterator-method"),m=e("../internals/is-array-iterator-method"),y=e("../internals/function-bind-context"),g=e("../internals/array-buffer-view-core").aTypedArrayConstructor;t.exports=function(e){var t,r,o,n,s,i,a=f(e),l=arguments.length,u=1<l?arguments[1]:void 0,c=void 0!==u,d=p(a);if(null!=d&&!m(d))for(i=(s=d.call(a)).next,a=[];!(n=i.call(s)).done;)a.push(n.value);for(c&&2<l&&(u=y(u,arguments[2],2)),r=h(a.length),o=new(g(this))(r),t=0;t<r;t++)o[t]=c?u(a[t],t):a[t];return o}},{"../internals/array-buffer-view-core":12,"../internals/function-bind-context":54,"../internals/get-iterator-method":57,"../internals/is-array-iterator-method":71,"../internals/to-length":134,"../internals/to-object":135}],143:[function(e,t,r){var o=0,n=Math.random();t.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++o+n).toString(36)}},{}],144:[function(e,t,r){e=e("../internals/native-symbol");t.exports=e&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},{"../internals/native-symbol":83}],145:[function(e,t,r){e=e("../internals/well-known-symbol");r.f=e},{"../internals/well-known-symbol":146}],146:[function(e,t,r){var o=e("../internals/global"),n=e("../internals/shared"),s=e("../internals/has"),i=e("../internals/uid"),a=e("../internals/native-symbol"),e=e("../internals/use-symbol-as-uid"),l=n("wks"),u=o.Symbol,c=e?u:u&&u.withoutSetter||i;t.exports=function(e){return s(l,e)||(a&&s(u,e)?l[e]=u[e]:l[e]=c("Symbol."+e)),l[e]}},{"../internals/global":59,"../internals/has":60,"../internals/native-symbol":83,"../internals/shared":120,"../internals/uid":143,"../internals/use-symbol-as-uid":144}],147:[function(e,t,r){t.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},{}],148:[function(e,t,r){"use strict";var o=e("../internals/export"),n=e("../internals/global"),s=e("../internals/array-buffer"),e=e("../internals/set-species"),i="ArrayBuffer",s=s[i];o({global:!0,forced:n[i]!==s},{ArrayBuffer:s}),e(i)},{"../internals/array-buffer":13,"../internals/export":50,"../internals/global":59,"../internals/set-species":116}],149:[function(e,t,r){"use strict";var o=e("../internals/export"),n=e("../internals/fails"),d=e("../internals/is-array"),f=e("../internals/is-object"),h=e("../internals/to-object"),p=e("../internals/to-length"),m=e("../internals/create-property"),y=e("../internals/array-species-create"),s=e("../internals/array-method-has-species-support"),i=e("../internals/well-known-symbol"),e=e("../internals/engine-v8-version"),g=i("isConcatSpreadable"),v=9007199254740991,b="Maximum allowed index exceeded",i=51<=e||!n(function(){var e=[];return e[g]=!1,e.concat()[0]!==e}),e=s("concat");o({target:"Array",proto:!0,forced:!i||!e},{concat:function(e){for(var t,r,o,n,s,i=h(this),a=y(i,0),l=0,u=-1,c=arguments.length;u<c;u++)if(s=void 0,!f(n=o=-1===u?i:arguments[u])||(void 0!==(s=n[g])?!s:!d(n))){if(v<=l)throw TypeError(b);m(a,l++,o)}else{if(r=p(o.length),v<l+r)throw TypeError(b);for(t=0;t<r;t++,l++)t in o&&m(a,l,o[t])}return a.length=l,a}})},{"../internals/array-method-has-species-support":21,"../internals/array-species-create":25,"../internals/create-property":40,"../internals/engine-v8-version":48,"../internals/export":50,"../internals/fails":51,"../internals/is-array":72,"../internals/is-object":74,"../internals/to-length":134,"../internals/to-object":135,"../internals/well-known-symbol":146}],150:[function(e,t,r){var o=e("../internals/export"),n=e("../internals/array-copy-within"),e=e("../internals/add-to-unscopables");o({target:"Array",proto:!0},{copyWithin:n}),e("copyWithin")},{"../internals/add-to-unscopables":7,"../internals/array-copy-within":14,"../internals/export":50}],151:[function(e,t,r){"use strict";var o=e("../internals/export"),n=e("../internals/array-iteration").every,s=e("../internals/array-method-is-strict"),e=e("../internals/array-method-uses-to-length"),s=s("every"),e=e("every");o({target:"Array",proto:!0,forced:!s||!e},{every:function(e){return n(this,e,1<arguments.length?arguments[1]:void 0)}})},{"../internals/array-iteration":19,"../internals/array-method-is-strict":22,"../internals/array-method-uses-to-length":23,"../internals/export":50}],152:[function(e,t,r){var o=e("../internals/export"),n=e("../internals/array-fill"),e=e("../internals/add-to-unscopables");o({target:"Array",proto:!0},{fill:n}),e("fill")},{"../internals/add-to-unscopables":7,"../internals/array-fill":15,"../internals/export":50}],153:[function(e,t,r){"use strict";var o=e("../internals/export"),n=e("../internals/array-iteration").filter,s=e("../internals/array-method-has-species-support"),e=e("../internals/array-method-uses-to-length"),s=s("filter"),e=e("filter");o({target:"Array",proto:!0,forced:!s||!e},{filter:function(e){return n(this,e,1<arguments.length?arguments[1]:void 0)}})},{"../internals/array-iteration":19,"../internals/array-method-has-species-support":21,"../internals/array-method-uses-to-length":23,"../internals/export":50}],154:[function(e,t,r){"use strict";var o=e("../internals/export"),e=e("../internals/array-for-each");o({target:"Array",proto:!0,forced:[].forEach!=e},{forEach:e})},{"../internals/array-for-each":16,"../internals/export":50}],155:[function(e,t,r){var o=e("../internals/export"),n=e("../internals/array-from");o({target:"Array",stat:!0,forced:!e("../internals/check-correctness-of-iteration")(function(e){Array.from(e)})},{from:n})},{"../internals/array-from":17,"../internals/check-correctness-of-iteration":27,"../internals/export":50}],156:[function(e,t,r){"use strict";var o=e("../internals/export"),n=e("../internals/array-includes").includes,s=e("../internals/add-to-unscopables");o({target:"Array",proto:!0,forced:!e("../internals/array-method-uses-to-length")("indexOf",{ACCESSORS:!0,1:0})},{includes:function(e){return n(this,e,1<arguments.length?arguments[1]:void 0)}}),s("includes")},{"../internals/add-to-unscopables":7,"../internals/array-includes":18,"../internals/array-method-uses-to-length":23,"../internals/export":50}],157:[function(e,t,r){"use strict";var o=e("../internals/export"),n=e("../internals/array-includes").indexOf,s=e("../internals/array-method-is-strict"),e=e("../internals/array-method-uses-to-length"),i=[].indexOf,a=!!i&&1/[1].indexOf(1,-0)<0,s=s("indexOf"),e=e("indexOf",{ACCESSORS:!0,1:0});o({target:"Array",proto:!0,forced:a||!s||!e},{indexOf:function(e){return a?i.apply(this,arguments)||0:n(this,e,1<arguments.length?arguments[1]:void 0)}})},{"../internals/array-includes":18,"../internals/array-method-is-strict":22,"../internals/array-method-uses-to-length":23,"../internals/export":50}],158:[function(e,t,r){"use strict";var o=e("../internals/to-indexed-object"),n=e("../internals/add-to-unscopables"),s=e("../internals/iterators"),i=e("../internals/internal-state"),e=e("../internals/define-iterator"),a="Array Iterator",l=i.set,u=i.getterFor(a);t.exports=e(Array,"Array",function(e,t){l(this,{type:a,target:o(e),index:0,kind:t})},function(){var e=u(this),t=e.target,r=e.kind,o=e.index++;return!t||o>=t.length?{value:e.target=void 0,done:!0}:"keys"==r?{value:o,done:!1}:"values"==r?{value:t[o],done:!1}:{value:[o,t[o]],done:!1}},"values"),s.Arguments=s.Array,n("keys"),n("values"),n("entries")},{"../internals/add-to-unscopables":7,"../internals/define-iterator":41,"../internals/internal-state":70,"../internals/iterators":79,"../internals/to-indexed-object":132}],159:[function(e,t,r){"use strict";var o=e("../internals/export"),n=e("../internals/indexed-object"),s=e("../internals/to-indexed-object"),e=e("../internals/array-method-is-strict"),i=[].join,n=n!=Object,e=e("join",",");o({target:"Array",proto:!0,forced:n||!e},{join:function(e){return i.call(s(this),void 0===e?",":e)}})},{"../internals/array-method-is-strict":22,"../internals/export":50,"../internals/indexed-object":66,"../internals/to-indexed-object":132}],160:[function(e,t,r){var o=e("../internals/export"),e=e("../internals/array-last-index-of");o({target:"Array",proto:!0,forced:e!==[].lastIndexOf},{lastIndexOf:e})},{"../internals/array-last-index-of":20,"../internals/export":50}],161:[function(e,t,r){"use strict";var o=e("../internals/export"),n=e("../internals/array-iteration").map,s=e("../internals/array-method-has-species-support"),e=e("../internals/array-method-uses-to-length"),s=s("map"),e=e("map");o({target:"Array",proto:!0,forced:!s||!e},{map:function(e){return n(this,e,1<arguments.length?arguments[1]:void 0)}})},{"../internals/array-iteration":19,"../internals/array-method-has-species-support":21,"../internals/array-method-uses-to-length":23,"../internals/export":50}],162:[function(e,t,r){"use strict";var o=e("../internals/export"),u=e("../internals/is-object"),c=e("../internals/is-array"),d=e("../internals/to-absolute-index"),f=e("../internals/to-length"),h=e("../internals/to-indexed-object"),p=e("../internals/create-property"),n=e("../internals/well-known-symbol"),s=e("../internals/array-method-has-species-support"),e=e("../internals/array-method-uses-to-length"),s=s("slice"),e=e("slice",{ACCESSORS:!0,0:0,1:2}),m=n("species"),y=[].slice,g=Math.max;o({target:"Array",proto:!0,forced:!s||!e},{slice:function(e,t){var r,o,n,s=h(this),i=f(s.length),a=d(e,i),l=d(void 0===t?i:t,i);if(c(s)&&((r="function"==typeof(r=s.constructor)&&(r===Array||c(r.prototype))||u(r)&&null===(r=r[m])?void 0:r)===Array||void 0===r))return y.call(s,a,l);for(o=new(void 0===r?Array:r)(g(l-a,0)),n=0;a<l;a++,n++)a in s&&p(o,n,s[a]);return o.length=n,o}})},{"../internals/array-method-has-species-support":21,"../internals/array-method-uses-to-length":23,"../internals/create-property":40,"../internals/export":50,"../internals/is-array":72,"../internals/is-object":74,"../internals/to-absolute-index":130,"../internals/to-indexed-object":132,"../internals/to-length":134,"../internals/well-known-symbol":146}],163:[function(e,t,r){"use strict";var o=e("../internals/export"),n=e("../internals/array-iteration").some,s=e("../internals/array-method-is-strict"),e=e("../internals/array-method-uses-to-length"),s=s("some"),e=e("some");o({target:"Array",proto:!0,forced:!s||!e},{some:function(e){return n(this,e,1<arguments.length?arguments[1]:void 0)}})},{"../internals/array-iteration":19,"../internals/array-method-is-strict":22,"../internals/array-method-uses-to-length":23,"../internals/export":50}],164:[function(e,t,r){"use strict";var o=e("../internals/export"),d=e("../internals/to-absolute-index"),f=e("../internals/to-integer"),h=e("../internals/to-length"),p=e("../internals/to-object"),m=e("../internals/array-species-create"),y=e("../internals/create-property"),n=e("../internals/array-method-has-species-support"),e=e("../internals/array-method-uses-to-length"),n=n("splice"),e=e("splice",{ACCESSORS:!0,0:0,1:2}),g=Math.max,v=Math.min;o({target:"Array",proto:!0,forced:!n||!e},{splice:function(e,t){var r,o,n,s,i,a,l=p(this),u=h(l.length),c=d(e,u),e=arguments.length;if(0===e?r=o=0:o=1===e?(r=0,u-c):(r=e-2,v(g(f(t),0),u-c)),9007199254740991<u+r-o)throw TypeError("Maximum allowed length exceeded");for(n=m(l,o),s=0;s<o;s++)(i=c+s)in l&&y(n,s,l[i]);if(r<(n.length=o)){for(s=c;s<u-o;s++)a=s+r,(i=s+o)in l?l[a]=l[i]:delete l[a];for(s=u;u-o+r<s;s--)delete l[s-1]}else if(o<r)for(s=u-o;c<s;s--)a=s+r-1,(i=s+o-1)in l?l[a]=l[i]:delete l[a];for(s=0;s<r;s++)l[s+c]=arguments[s+2];return l.length=u-o+r,n}})},{"../internals/array-method-has-species-support":21,"../internals/array-method-uses-to-length":23,"../internals/array-species-create":25,"../internals/create-property":40,"../internals/export":50,"../internals/to-absolute-index":130,"../internals/to-integer":133,"../internals/to-length":134,"../internals/to-object":135}],165:[function(e,t,r){var o=e("../internals/descriptors"),e=e("../internals/object-define-property").f,n=Function.prototype,s=n.toString,i=/^\s*function ([^ (]*)/;!o||"name"in n||e(n,"name",{configurable:!0,get:function(){try{return s.call(this).match(i)[1]}catch(e){return""}}})},{"../internals/descriptors":43,"../internals/object-define-property":92}],166:[function(e,t,r){"use strict";var o=e("../internals/collection"),e=e("../internals/collection-strong");t.exports=o("Map",function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},e)},{"../internals/collection":32,"../internals/collection-strong":30}],167:[function(e,t,r){var e=e("../internals/export"),o=Math.hypot,l=Math.abs,u=Math.sqrt;e({target:"Math",stat:!0,forced:!!o&&o(1/0,NaN)!==1/0},{hypot:function(e,t){for(var r,o,n=0,s=0,i=arguments.length,a=0;s<i;)a<(r=l(arguments[s++]))?(n=n*(o=a/r)*o+1,a=r):n+=0<r?(o=r/a)*o:r;return a===1/0?1/0:a*u(n)}})},{"../internals/export":50}],168:[function(e,t,r){e("../internals/export")({target:"Math",stat:!0},{sign:e("../internals/math-sign")})},{"../internals/export":50,"../internals/math-sign":80}],169:[function(e,t,r){"use strict";function o(e){var t,r,o,n,s,i,a,l=d(e,!1);if("string"==typeof l&&2<l.length)if(43===(e=(l=g(l)).charCodeAt(0))||45===e){if(88===(t=l.charCodeAt(2))||120===t)return NaN}else if(48===e){switch(l.charCodeAt(1)){case 66:case 98:r=2,o=49;break;case 79:case 111:r=8,o=55;break;default:return+l}for(s=(n=l.slice(2)).length,i=0;i<s;i++)if((a=n.charCodeAt(i))<48||o<a)return NaN;return parseInt(n,r)}return+l}var n=e("../internals/descriptors"),s=e("../internals/global"),i=e("../internals/is-forced"),a=e("../internals/redefine"),l=e("../internals/has"),u=e("../internals/classof-raw"),c=e("../internals/inherit-if-required"),d=e("../internals/to-primitive"),f=e("../internals/fails"),h=e("../internals/object-create"),p=e("../internals/object-get-own-property-names").f,m=e("../internals/object-get-own-property-descriptor").f,y=e("../internals/object-define-property").f,g=e("../internals/string-trim").trim,v="Number",b=s[v],j=b.prototype,_=u(h(j))==v;if(i(v,!b(" 0o1")||!b("0b1")||b("+0x1"))){for(var x,w=function(e){var e=arguments.length<1?0:e,t=this;return t instanceof w&&(_?f(function(){j.valueOf.call(t)}):u(t)!=v)?c(new b(o(e)),t,w):o(e)},S=n?p(b):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),M=0;S.length>M;M++)l(b,x=S[M])&&!l(w,x)&&y(w,x,m(b,x));(w.prototype=j).constructor=w,a(s,v,w)}},{"../internals/classof-raw":28,"../internals/descriptors":43,"../internals/fails":51,"../internals/global":59,"../internals/has":60,"../internals/inherit-if-required":67,"../internals/is-forced":73,"../internals/object-create":90,"../internals/object-define-property":92,"../internals/object-get-own-property-descriptor":93,"../internals/object-get-own-property-names":95,"../internals/redefine":108,"../internals/string-trim":127,"../internals/to-primitive":138}],170:[function(e,t,r){e("../internals/export")({target:"Number",stat:!0},{isFinite:e("../internals/number-is-finite")})},{"../internals/export":50,"../internals/number-is-finite":88}],171:[function(e,t,r){"use strict";function c(e,t,r){return 0===t?r:t%2==1?c(e,t-1,r*e):c(e*e,t/2,r)}var o=e("../internals/export"),d=e("../internals/to-integer"),f=e("../internals/this-number-value"),h=e("../internals/string-repeat"),e=e("../internals/fails"),n=1..toFixed,p=Math.floor;o({target:"Number",proto:!0,forced:n&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==0xde0b6b3a7640080.toFixed(0))||!e(function(){n.call({})})},{toFixed:function(e){function t(e,t){for(var r=-1,o=t;++r<6;)o+=e*a[r],a[r]=o%1e7,o=p(o/1e7)}function r(e){for(var t=6,r=0;0<=--t;)r+=a[t],a[t]=p(r/e),r=r%e*1e7}function o(){for(var e,t=6,r="";0<=--t;)""===r&&0!==t&&0===a[t]||(e=String(a[t]),r=""===r?e:r+h.call("0",7-e.length)+e);return r}var n,s,i=f(this),e=d(e),a=[0,0,0,0,0,0],l="",u="0";if(e<0||20<e)throw RangeError("Incorrect fraction digits");if(i!=i)return"NaN";if(i<=-1e21||1e21<=i)return String(i);if(i<0&&(l="-",i=-i),1e-21<i)if(i=(n=function(e){for(var t=0,r=e;4096<=r;)t+=12,r/=4096;for(;2<=r;)t+=1,r/=2;return t}(i*c(2,69,1))-69)<0?i*c(2,-n,1):i/c(2,n,1),i*=4503599627370496,0<(n=52-n)){for(t(0,i),s=e;7<=s;)t(1e7,0),s-=7;for(t(c(10,s,1),0),s=n-1;23<=s;)r(1<<23),s-=23;r(1<<s),t(1,1),r(2),u=o()}else t(0,i),t(1<<-n,0),u=o()+h.call("0",e);return u=0<e?l+((i=u.length)<=e?"0."+h.call("0",e-i)+u:u.slice(0,i-e)+"."+u.slice(i-e)):l+u}})},{"../internals/export":50,"../internals/fails":51,"../internals/string-repeat":125,"../internals/this-number-value":129,"../internals/to-integer":133}],172:[function(e,t,r){var o=e("../internals/export"),e=e("../internals/object-assign");o({target:"Object",stat:!0,forced:Object.assign!==e},{assign:e})},{"../internals/export":50,"../internals/object-assign":89}],173:[function(e,t,r){var o=e("../internals/export"),n=e("../internals/fails"),s=e("../internals/to-indexed-object"),i=e("../internals/object-get-own-property-descriptor").f,e=e("../internals/descriptors"),n=n(function(){i(1)});o({target:"Object",stat:!0,forced:!e||n,sham:!e},{getOwnPropertyDescriptor:function(e,t){return i(s(e),t)}})},{"../internals/descriptors":43,"../internals/export":50,"../internals/fails":51,"../internals/object-get-own-property-descriptor":93,"../internals/to-indexed-object":132}],174:[function(e,t,r){var o=e("../internals/export"),n=e("../internals/fails"),e=e("../internals/object-get-own-property-names-external").f;o({target:"Object",stat:!0,forced:n(function(){return!Object.getOwnPropertyNames(1)})},{getOwnPropertyNames:e})},{"../internals/export":50,"../internals/fails":51,"../internals/object-get-own-property-names-external":94}],175:[function(e,t,r){var o=e("../internals/export"),n=e("../internals/fails"),s=e("../internals/to-object"),i=e("../internals/object-get-prototype-of"),e=e("../internals/correct-prototype-getter");o({target:"Object",stat:!0,forced:n(function(){i(1)}),sham:!e},{getPrototypeOf:function(e){return i(s(e))}})},{"../internals/correct-prototype-getter":35,"../internals/export":50,"../internals/fails":51,"../internals/object-get-prototype-of":97,"../internals/to-object":135}],176:[function(e,t,r){var o=e("../internals/export"),n=e("../internals/to-object"),s=e("../internals/object-keys");o({target:"Object",stat:!0,forced:e("../internals/fails")(function(){s(1)})},{keys:function(e){return s(n(e))}})},{"../internals/export":50,"../internals/fails":51,"../internals/object-keys":99,"../internals/to-object":135}],177:[function(e,t,r){var o=e("../internals/to-string-tag-support"),n=e("../internals/redefine"),e=e("../internals/object-to-string");o||n(Object.prototype,"toString",e,{unsafe:!0})},{"../internals/object-to-string":102,"../internals/redefine":108,"../internals/to-string-tag-support":139}],178:[function(e,D,U){"use strict";var r,t,o,n,s=e("../internals/export"),i=e("../internals/is-pure"),g=e("../internals/global"),a=e("../internals/get-built-in"),l=e("../internals/native-promise-constructor"),N=e("../internals/redefine"),F=e("../internals/redefine-all"),B=e("../internals/set-to-string-tag"),G=e("../internals/set-species"),V=e("../internals/is-object"),c=e("../internals/a-function"),z=e("../internals/an-instance"),H=e("../internals/classof-raw"),W=e("../internals/inspect-source"),d=e("../internals/iterate"),q=e("../internals/check-correctness-of-iteration"),X=e("../internals/species-constructor"),v=e("../internals/task").set,u=e("../internals/microtask"),f=e("../internals/promise-resolve"),Y=e("../internals/host-report-errors"),h=e("../internals/new-promise-capability"),b=e("../internals/perform"),p=e("../internals/internal-state"),Z=e("../internals/is-forced"),m=e("../internals/well-known-symbol"),y=e("../internals/engine-v8-version"),Q=m("species"),j="Promise",_=p.get,J=p.set,K=p.getterFor(j),x=l,w=g.TypeError,S=g.document,M=g.process,E=a("fetch"),T=h.f,$=T,C="process"==H(M),ee=!!(S&&S.createEvent&&g.dispatchEvent),O="unhandledrejection",te="rejectionhandled",k=1,re=2,L=1,oe=2,e=Z(j,function(){var e,t;if(!(W(x)!==String(x))){if(66===y)return!0;if(!C&&"function"!=typeof PromiseRejectionEvent)return!0}return!(!i||x.prototype.finally)||!(51<=y&&/native code/.test(x))&&(t=function(e){e(function(){},function(){})},((e=x.resolve(1)).constructor={})[Q]=t,!(e.then(function(){})instanceof t))}),m=e||!q(function(e){x.all(e).catch(function(){})}),ne=function(e){var t;return!(!V(e)||"function"!=typeof(t=e.then))&&t},P=function(h,p,m){var y;p.notified||(p.notified=!0,y=p.reactions,u(function(){for(var r,o,e=p.value,t=p.state==k,n=0;y.length>n;){var s,i,a,l=y[n++],u=t?l.ok:l.fail,c=l.resolve,d=l.reject,f=l.domain;try{u?(t||(p.rejection===oe&&function(e,t){v.call(g,function(){if(C)M.emit("rejectionHandled",e);else se(te,e,t.value)})}(h,p),p.rejection=L),!0===u?s=e:(f&&f.enter(),s=u(e),f&&(f.exit(),a=!0)),s===l.promise?d(w("Promise-chain cycle")):(i=ne(s))?i.call(s,c,d):c(s)):d(e)}catch(e){f&&!a&&f.exit(),d(e)}}p.reactions=[],p.notified=!1,m&&!p.rejection&&(r=h,o=p,v.call(g,function(){var e=o.value,t=ie(o);if(t&&(t=b(function(){C?M.emit("unhandledRejection",e,r):se(O,r,e)}),o.rejection=C||ie(o)?oe:L,t.error))throw t.value}))}))},se=function(e,t,r){var o;ee?((o=S.createEvent("Event")).promise=t,o.reason=r,o.initEvent(e,!1,!0),g.dispatchEvent(o)):o={promise:t,reason:r},(t=g["on"+e])?t(o):e===O&&Y("Unhandled promise rejection",r)},ie=function(e){return e.rejection!==L&&!e.parent},A=function(t,r,o,n){return function(e){t(r,o,e,n)}},R=function(e,t,r,o){t.done||(t.done=!0,(t=o?o:t).value=r,t.state=re,P(e,t,!0))},I=function(r,o,e,t){if(!o.done){o.done=!0,t&&(o=t);try{if(r===e)throw w("Promise can't be resolved itself");var n=ne(e);n?u(function(){var t={done:!1};try{n.call(e,A(I,r,t,o),A(R,r,t,o))}catch(e){R(r,t,e,o)}}):(o.value=e,o.state=k,P(r,o,!1))}catch(e){R(r,{done:!1},e,o)}}};e&&(x=function(e){z(this,x,j),c(e),r.call(this);var t=_(this);try{e(A(I,this,t),A(R,this,t))}catch(e){R(this,t,e)}},(r=function(e){J(this,{type:j,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=F(x.prototype,{then:function(e,t){var r=K(this),o=T(X(this,x));return o.ok="function"!=typeof e||e,o.fail="function"==typeof t&&t,o.domain=C?M.domain:void 0,r.parent=!0,r.reactions.push(o),0!=r.state&&P(this,r,!1),o.promise},catch:function(e){return this.then(void 0,e)}}),t=function(){var e=new r,t=_(e);this.promise=e,this.resolve=A(I,e,t),this.reject=A(R,e,t)},h.f=T=function(e){return e===x||e===o?new t:$(e)},i||"function"!=typeof l||(n=l.prototype.then,N(l.prototype,"then",function(e,t){var r=this;return new x(function(e,t){n.call(r,e,t)}).then(e,t)},{unsafe:!0}),"function"==typeof E&&s({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return f(x,E.apply(g,arguments))}}))),s({global:!0,wrap:!0,forced:e},{Promise:x}),B(x,j,!1,!0),G(j),o=a(j),s({target:j,stat:!0,forced:e},{reject:function(e){var t=T(this);return t.reject.call(void 0,e),t.promise}}),s({target:j,stat:!0,forced:i||e},{resolve:function(e){return f(i&&this===o?x:this,e)}}),s({target:j,stat:!0,forced:m},{all:function(e){var a=this,t=T(a),l=t.resolve,u=t.reject,r=b(function(){var o=c(a.resolve),n=[],s=0,i=1;d(e,function(e){var t=s++,r=!1;n.push(void 0),i++,o.call(a,e).then(function(e){r||(r=!0,n[t]=e,--i||l(n))},u)}),--i||l(n)});return r.error&&u(r.value),t.promise},race:function(e){var r=this,o=T(r),n=o.reject,t=b(function(){var t=c(r.resolve);d(e,function(e){t.call(r,e).then(o.resolve,n)})});return t.error&&n(t.value),o.promise}})},{"../internals/a-function":5,"../internals/an-instance":9,"../internals/check-correctness-of-iteration":27,"../internals/classof-raw":28,"../internals/engine-v8-version":48,"../internals/export":50,"../internals/get-built-in":56,"../internals/global":59,"../internals/host-report-errors":62,"../internals/inspect-source":68,"../internals/internal-state":70,"../internals/is-forced":73,"../internals/is-object":74,"../internals/is-pure":75,"../internals/iterate":77,"../internals/microtask":81,"../internals/native-promise-constructor":82,"../internals/new-promise-capability":86,"../internals/perform":105,"../internals/promise-resolve":106,"../internals/redefine":108,"../internals/redefine-all":107,"../internals/set-species":116,"../internals/set-to-string-tag":117,"../internals/species-constructor":121,"../internals/task":128,"../internals/well-known-symbol":146}],179:[function(e,t,r){var o=e("../internals/export"),n=e("../internals/get-built-in"),s=e("../internals/a-function"),i=e("../internals/an-object"),a=e("../internals/is-object"),l=e("../internals/object-create"),u=e("../internals/function-bind"),e=e("../internals/fails"),c=n("Reflect","construct"),d=e(function(){function e(){}return!(c(function(){},[],e)instanceof e)}),f=!e(function(){c(function(){})}),n=d||f;o({target:"Reflect",stat:!0,forced:n,sham:n},{construct:function(e,t){s(e),i(t);var r=arguments.length<3?e:s(arguments[2]);if(f&&!d)return c(e,t,r);if(e==r){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var o=[null];return o.push.apply(o,t),new(u.apply(e,o))}o=r.prototype,r=l(a(o)?o:Object.prototype),o=Function.apply.call(e,r,t);return a(o)?o:r}})},{"../internals/a-function":5,"../internals/an-object":10,"../internals/export":50,"../internals/fails":51,"../internals/function-bind":55,"../internals/get-built-in":56,"../internals/is-object":74,"../internals/object-create":90}],180:[function(e,t,r){var o=e("../internals/descriptors"),n=e("../internals/global"),s=e("../internals/is-forced"),i=e("../internals/inherit-if-required"),a=e("../internals/object-define-property").f,l=e("../internals/object-get-own-property-names").f,u=e("../internals/is-regexp"),c=e("../internals/regexp-flags"),d=e("../internals/regexp-sticky-helpers"),f=e("../internals/redefine"),h=e("../internals/fails"),p=e("../internals/internal-state").set,m=e("../internals/set-species"),y=e("../internals/well-known-symbol")("match"),g=n.RegExp,v=g.prototype,b=/a/g,j=/a/g,_=new g(b)!==b,x=d.UNSUPPORTED_Y;if(o&&s("RegExp",!_||x||h(function(){return j[y]=!1,g(b)!=b||g(j)==j||"/a/i"!=g(b,"i")}))){for(var w=function(e,t){var r,o=this instanceof w,n=u(e),s=void 0===t;if(!o&&n&&e.constructor===w&&s)return e;_?n&&!s&&(e=e.source):e instanceof w&&(s&&(t=c.call(e)),e=e.source),x&&(r=!!t&&-1<t.indexOf("y"))&&(t=t.replace(/y/g,""));n=i(_?new g(e,t):g(e,t),o?this:v,w);return x&&r&&p(n,{sticky:r}),n},S=l(g),M=0;S.length>M;)!function(t){t in w||a(w,t,{configurable:!0,get:function(){return g[t]},set:function(e){g[t]=e}})}(S[M++]);(v.constructor=w).prototype=v,f(n,"RegExp",w)}m("RegExp")},{"../internals/descriptors":43,"../internals/fails":51,"../internals/global":59,"../internals/inherit-if-required":67,"../internals/internal-state":70,"../internals/is-forced":73,"../internals/is-regexp":76,"../internals/object-define-property":92,"../internals/object-get-own-property-names":95,"../internals/redefine":108,"../internals/regexp-flags":111,"../internals/regexp-sticky-helpers":112,"../internals/set-species":116,"../internals/well-known-symbol":146}],181:[function(e,t,r){"use strict";var o=e("../internals/export"),e=e("../internals/regexp-exec");o({target:"RegExp",proto:!0,forced:/./.exec!==e},{exec:e})},{"../internals/export":50,"../internals/regexp-exec":110}],182:[function(e,t,r){"use strict";var o=e("../internals/redefine"),n=e("../internals/an-object"),s=e("../internals/fails"),i=e("../internals/regexp-flags"),e="toString",a=RegExp.prototype,l=a[e],s=s(function(){return"/a/b"!=l.call({source:"a",flags:"b"})}),u=l.name!=e;(s||u)&&o(RegExp.prototype,e,function(){var e=n(this),t=String(e.source),r=e.flags;return"/"+t+"/"+String(void 0===r&&e instanceof RegExp&&!("flags"in a)?i.call(e):r)},{unsafe:!0})},{"../internals/an-object":10,"../internals/fails":51,"../internals/redefine":108,"../internals/regexp-flags":111}],183:[function(e,t,r){"use strict";var o=e("../internals/collection"),e=e("../internals/collection-strong");t.exports=o("Set",function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},e)},{"../internals/collection":32,"../internals/collection-strong":30}],184:[function(e,t,r){"use strict";var o=e("../internals/export"),n=e("../internals/object-get-own-property-descriptor").f,s=e("../internals/to-length"),i=e("../internals/not-a-regexp"),a=e("../internals/require-object-coercible"),l=e("../internals/correct-is-regexp-logic"),e=e("../internals/is-pure"),u="".endsWith,c=Math.min,l=l("endsWith");o({target:"String",proto:!0,forced:!!(e||l||(!(o=n(String.prototype,"endsWith"))||o.writable))&&!l},{endsWith:function(e){var t=String(a(this)),r=(i(e),1<arguments.length?arguments[1]:void 0),o=s(t.length),r=void 0===r?o:c(s(r),o),o=String(e);return u?u.call(t,o,r):t.slice(r-o.length,r)===o}})},{"../internals/correct-is-regexp-logic":34,"../internals/export":50,"../internals/is-pure":75,"../internals/not-a-regexp":87,"../internals/object-get-own-property-descriptor":93,"../internals/require-object-coercible":113,"../internals/to-length":134}],185:[function(e,t,r){"use strict";var o=e("../internals/export"),n=e("../internals/not-a-regexp"),s=e("../internals/require-object-coercible");o({target:"String",proto:!0,forced:!e("../internals/correct-is-regexp-logic")("includes")},{includes:function(e){return!!~String(s(this)).indexOf(n(e),1<arguments.length?arguments[1]:void 0)}})},{"../internals/correct-is-regexp-logic":34,"../internals/export":50,"../internals/not-a-regexp":87,"../internals/require-object-coercible":113}],186:[function(e,t,r){"use strict";var o=e("../internals/string-multibyte").charAt,n=e("../internals/internal-state"),e=e("../internals/define-iterator"),s="String Iterator",i=n.set,a=n.getterFor(s);e(String,"String",function(e){i(this,{type:s,string:String(e),index:0})},function(){var e=a(this),t=e.string,r=e.index;return r>=t.length?{value:void 0,done:!0}:(t=o(t,r),e.index+=t.length,{value:t,done:!1})})},{"../internals/define-iterator":41,"../internals/internal-state":70,"../internals/string-multibyte":123}],187:[function(e,t,r){"use strict";var o=e("../internals/fix-regexp-well-known-symbol-logic"),c=e("../internals/an-object"),d=e("../internals/to-length"),n=e("../internals/require-object-coercible"),f=e("../internals/advance-string-index"),h=e("../internals/regexp-exec-abstract");o("match",1,function(o,l,u){return[function(e){var t=n(this),r=null==e?void 0:e[o];return void 0!==r?r.call(e,t):new RegExp(e)[o](String(t))},function(e){var t=u(l,e,this);if(t.done)return t.value;var r=c(e),o=String(this);if(!r.global)return h(r,o);for(var n=r.unicode,s=[],i=r.lastIndex=0;null!==(a=h(r,o));){var a=String(a[0]);""===(s[i]=a)&&(r.lastIndex=f(o,d(r.lastIndex),n)),i++}return 0===i?null:s}]})},{"../internals/advance-string-index":8,"../internals/an-object":10,"../internals/fix-regexp-well-known-symbol-logic":52,"../internals/regexp-exec-abstract":109,"../internals/require-object-coercible":113,"../internals/to-length":134}],188:[function(e,t,r){e("../internals/export")({target:"String",proto:!0},{repeat:e("../internals/string-repeat")})},{"../internals/export":50,"../internals/string-repeat":125}],189:[function(e,t,r){"use strict";var o=e("../internals/fix-regexp-well-known-symbol-logic"),M=e("../internals/an-object"),E=e("../internals/to-object"),T=e("../internals/to-length"),C=e("../internals/to-integer"),s=e("../internals/require-object-coercible"),O=e("../internals/advance-string-index"),k=e("../internals/regexp-exec-abstract"),L=Math.max,P=Math.min,A=Math.floor,R=/\$([$&'`]|\d\d?|<[^>]*>)/g,I=/\$([$&'`]|\d\d?)/g;o("replace",2,function(n,j,_,e){var x=e.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,w=e.REPLACE_KEEPS_$0,S=x?"$":"$0";return[function(e,t){var r=s(this),o=null==e?void 0:e[n];return void 0!==o?o.call(e,r,t):j.call(String(r),e,t)},function(e,t){if(!x&&w||"string"==typeof t&&-1===t.indexOf(S)){var r=_(j,e,this,t);if(r.done)return r.value}for(var o,n=M(e),s=String(this),i="function"==typeof t,a=(i||(t=String(t)),n.global),l=(a&&(o=n.unicode,n.lastIndex=0),[]);null!==(h=k(n,s))&&(l.push(h),a);)""===String(h[0])&&(n.lastIndex=O(s,T(n.lastIndex),o));for(var u,c="",d=0,f=0;f<l.length;f++){for(var h=l[f],p=String(h[0]),m=L(P(C(h.index),s.length),0),y=[],g=1;g<h.length;g++)y.push(void 0===(u=h[g])?u:String(u));var v=h.groups,b=i?(b=[p].concat(y,m,s),void 0!==v&&b.push(v),String(t.apply(void 0,b))):function(s,i,a,l,u,e){var c=a+s.length,d=l.length,t=I;void 0!==u&&(u=E(u),t=R);return j.call(e,t,function(e,t){var r;switch(t.charAt(0)){case"$":return"$";case"&":return s;case"`":return i.slice(0,a);case"'":return i.slice(c);case"<":r=u[t.slice(1,-1)];break;default:var o,n=+t;if(0==n)return e;if(d<n)return 0!==(o=A(n/10))&&o<=d?void 0===l[o-1]?t.charAt(1):l[o-1]+t.charAt(1):e;r=l[n-1]}return void 0===r?"":r})}(p,s,m,y,v,t);d<=m&&(c+=s.slice(d,m)+b,d=m+p.length)}return c+s.slice(d)}]})},{"../internals/advance-string-index":8,"../internals/an-object":10,"../internals/fix-regexp-well-known-symbol-logic":52,"../internals/regexp-exec-abstract":109,"../internals/require-object-coercible":113,"../internals/to-integer":133,"../internals/to-length":134,"../internals/to-object":135}],190:[function(e,t,r){"use strict";var o=e("../internals/fix-regexp-well-known-symbol-logic"),i=e("../internals/an-object"),a=e("../internals/require-object-coercible"),l=e("../internals/same-value"),u=e("../internals/regexp-exec-abstract");o("search",1,function(o,n,s){return[function(e){var t=a(this),r=null==e?void 0:e[o];return void 0!==r?r.call(e,t):new RegExp(e)[o](String(t))},function(e){var t,r=s(n,e,this);return r.done?r.value:(r=i(e),e=String(this),t=r.lastIndex,l(t,0)||(r.lastIndex=0),e=u(r,e),l(r.lastIndex,t)||(r.lastIndex=t),null===e?-1:e.index)}]})},{"../internals/an-object":10,"../internals/fix-regexp-well-known-symbol-logic":52,"../internals/regexp-exec-abstract":109,"../internals/require-object-coercible":113,"../internals/same-value":114}],191:[function(e,t,r){"use strict";var o=e("../internals/fix-regexp-well-known-symbol-logic"),c=e("../internals/is-regexp"),g=e("../internals/an-object"),d=e("../internals/require-object-coercible"),v=e("../internals/species-constructor"),b=e("../internals/advance-string-index"),j=e("../internals/to-length"),_=e("../internals/regexp-exec-abstract"),f=e("../internals/regexp-exec"),e=e("../internals/fails"),h=[].push,x=Math.min,w=4294967295,S=!e(function(){return!RegExp(w,"y")});o("split",2,function(n,p,m){var y="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||1<".".split(/()()/).length||"".split(/.?/).length?function(e,t){var r=String(d(this)),o=void 0===t?w:t>>>0;if(0==o)return[];if(void 0===e)return[r];if(!c(e))return p.call(r,e,o);for(var n,s,i,a=[],t=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),l=0,u=new RegExp(e.source,t+"g");(n=f.call(u,r))&&!(l<(s=u.lastIndex)&&(a.push(r.slice(l,n.index)),1<n.length&&n.index<r.length&&h.apply(a,n.slice(1)),i=n[0].length,l=s,a.length>=o));)u.lastIndex===n.index&&u.lastIndex++;return l===r.length?!i&&u.test("")||a.push(""):a.push(r.slice(l)),a.length>o?a.slice(0,o):a}:"0".split(void 0,0).length?function(e,t){return void 0===e&&0===t?[]:p.call(this,e,t)}:p;return[function(e,t){var r=d(this),o=null==e?void 0:e[n];return void 0!==o?o.call(e,r,t):y.call(String(r),e,t)},function(e,t){var r=m(y,e,this,t,y!==p);if(r.done)return r.value;var r=g(e),o=String(this),e=v(r,RegExp),n=r.unicode,s=(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.unicode?"u":"")+(S?"y":"g"),i=new e(S?r:"^(?:"+r.source+")",s),a=void 0===t?w:t>>>0;if(0==a)return[];if(0===o.length)return null===_(i,o)?[o]:[];for(var l=0,u=0,c=[];u<o.length;){i.lastIndex=S?u:0;var d,f=_(i,S?o:o.slice(u));if(null===f||(d=x(j(i.lastIndex+(S?0:u)),o.length))===l)u=b(o,u,n);else{if(c.push(o.slice(l,u)),c.length===a)return c;for(var h=1;h<=f.length-1;h++)if(c.push(f[h]),c.length===a)return c;u=l=d}}return c.push(o.slice(l)),c}]},!S)},{"../internals/advance-string-index":8,"../internals/an-object":10,"../internals/fails":51,"../internals/fix-regexp-well-known-symbol-logic":52,"../internals/is-regexp":76,"../internals/regexp-exec":110,"../internals/regexp-exec-abstract":109,"../internals/require-object-coercible":113,"../internals/species-constructor":121,"../internals/to-length":134}],192:[function(e,t,r){"use strict";var o=e("../internals/export"),n=e("../internals/create-html");o({target:"String",proto:!0,forced:e("../internals/string-html-forced")("sub")},{sub:function(){return n(this,"sub","","")}})},{"../internals/create-html":36,"../internals/export":50,"../internals/string-html-forced":122}],193:[function(e,t,r){"use strict";var o=e("../internals/export"),n=e("../internals/string-trim").trim;o({target:"String",proto:!0,forced:e("../internals/string-trim-forced")("trim")},{trim:function(){return n(this)}})},{"../internals/export":50,"../internals/string-trim":127,"../internals/string-trim-forced":126}],194:[function(e,t,r){"use strict";var o,n,s,i,a,l=e("../internals/export"),u=e("../internals/descriptors"),c=e("../internals/global"),d=e("../internals/has"),f=e("../internals/is-object"),h=e("../internals/object-define-property").f,e=e("../internals/copy-constructor-properties"),p=c.Symbol;!u||"function"!=typeof p||"description"in p.prototype&&void 0===p().description||(o={},e(n=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),t=this instanceof n?new p(e):void 0===e?p():p(e);return""===e&&(o[t]=!0),t},p),(c=n.prototype=p.prototype).constructor=n,s=c.toString,i="Symbol(test)"==String(p("test")),a=/^Symbol\((.*)\)[^)]+$/,h(c,"description",{configurable:!0,get:function(){var e=f(this)?this.valueOf():this,t=s.call(e);return d(o,e)?"":""===(e=i?t.slice(7,-1):t.replace(a,"$1"))?void 0:e}}),l({global:!0,forced:!0},{Symbol:n}))},{"../internals/copy-constructor-properties":33,"../internals/descriptors":43,"../internals/export":50,"../internals/global":59,"../internals/has":60,"../internals/is-object":74,"../internals/object-define-property":92}],195:[function(e,t,r){e("../internals/define-well-known-symbol")("iterator")},{"../internals/define-well-known-symbol":42}],196:[function(e,D,U){"use strict";function o(e,t){var r=E[e]=h(w[_]);return ie(r,{type:j,tag:e,description:t}),s||(r.description=t),r}function r(t,e){u(t);var r=c(e),e=q(r).concat(I(r));return v(e,function(e){s&&!R.call(r,e)||A(t,e,r[e])}),t}function t(e,t){var r,e=c(e),t=d(t,!0);if(e!==x||!l(E,t)||l(T,t))return!(r=le(e,t))||!l(E,t)||l(e,b)&&e[b][t]||(r.enumerable=!0),r}function N(e){var e=ue(c(e)),t=[];return v(e,function(e){l(E,e)||l(ee,e)||t.push(e)}),t}var n=e("../internals/export"),F=e("../internals/global"),B=e("../internals/get-built-in"),G=e("../internals/is-pure"),s=e("../internals/descriptors"),i=e("../internals/native-symbol"),V=e("../internals/use-symbol-as-uid"),a=e("../internals/fails"),l=e("../internals/has"),z=e("../internals/is-array"),H=e("../internals/is-object"),u=e("../internals/an-object"),W=e("../internals/to-object"),c=e("../internals/to-indexed-object"),d=e("../internals/to-primitive"),f=e("../internals/create-property-descriptor"),h=e("../internals/object-create"),q=e("../internals/object-keys"),X=e("../internals/object-get-own-property-names"),Y=e("../internals/object-get-own-property-names-external"),p=e("../internals/object-get-own-property-symbols"),Z=e("../internals/object-get-own-property-descriptor"),Q=e("../internals/object-define-property"),J=e("../internals/object-property-is-enumerable"),K=e("../internals/create-non-enumerable-property"),m=e("../internals/redefine"),y=e("../internals/shared"),$=e("../internals/shared-key"),ee=e("../internals/hidden-keys"),te=e("../internals/uid"),re=e("../internals/well-known-symbol"),oe=e("../internals/well-known-symbol-wrapped"),ne=e("../internals/define-well-known-symbol"),se=e("../internals/set-to-string-tag"),g=e("../internals/internal-state"),v=e("../internals/array-iteration").forEach,b=$("hidden"),j="Symbol",_="prototype",e=re("toPrimitive"),ie=g.set,ae=g.getterFor(j),x=Object[_],w=F.Symbol,S=B("JSON","stringify"),le=Z.f,M=Q.f,ue=Y.f,ce=J.f,E=y("symbols"),T=y("op-symbols"),C=y("string-to-symbol-registry"),O=y("symbol-to-string-registry"),$=y("wks"),g=F.QObject,k=!g||!g[_]||!g[_].findChild,L=s&&a(function(){return 7!=h(M({},"a",{get:function(){return M(this,"a",{value:7}).a}})).a})?function(e,t,r){var o=le(x,t);o&&delete x[t],M(e,t,r),o&&e!==x&&M(x,t,o)}:M,P=V?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof w},A=function(e,t,r){e===x&&A(T,t,r),u(e);t=d(t,!0);return u(r),(l(E,t)?(r.enumerable?(l(e,b)&&e[b][t]&&(e[b][t]=!1),r=h(r,{enumerable:f(0,!1)})):(l(e,b)||M(e,b,f(1,{})),e[b][t]=!0),L):M)(e,t,r)},R=function(e){var e=d(e,!0),t=ce.call(this,e);return!(this===x&&l(E,e)&&!l(T,e))&&(!(t||!l(this,e)||!l(E,e)||l(this,b)&&this[b][e])||t)},I=function(e){var t=e===x,e=ue(t?T:c(e)),r=[];return v(e,function(e){!l(E,e)||t&&!l(x,e)||r.push(E[e])}),r};i||(m((w=function(){if(this instanceof w)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,t=te(e),r=function(e){this===x&&r.call(T,e),l(this,b)&&l(this[b],t)&&(this[b][t]=!1),L(this,t,f(1,e))};return s&&k&&L(x,t,{configurable:!0,set:r}),o(t,e)})[_],"toString",function(){return ae(this).tag}),m(w,"withoutSetter",function(e){return o(te(e),e)}),J.f=R,Q.f=A,Z.f=t,X.f=Y.f=N,p.f=I,oe.f=function(e){return o(re(e),e)},s&&(M(w[_],"description",{configurable:!0,get:function(){return ae(this).description}}),G||m(x,"propertyIsEnumerable",R,{unsafe:!0}))),n({global:!0,wrap:!0,forced:!i,sham:!i},{Symbol:w}),v(q($),function(e){ne(e)}),n({target:j,stat:!0,forced:!i},{for:function(e){var t,e=String(e);return l(C,e)?C[e]:(t=w(e),C[e]=t,O[t]=e,t)},keyFor:function(e){if(!P(e))throw TypeError(e+" is not a symbol");if(l(O,e))return O[e]},useSetter:function(){k=!0},useSimple:function(){k=!1}}),n({target:"Object",stat:!0,forced:!i,sham:!s},{create:function(e,t){return void 0===t?h(e):r(h(e),t)},defineProperty:A,defineProperties:r,getOwnPropertyDescriptor:t}),n({target:"Object",stat:!0,forced:!i},{getOwnPropertyNames:N,getOwnPropertySymbols:I}),n({target:"Object",stat:!0,forced:a(function(){p.f(1)})},{getOwnPropertySymbols:function(e){return p.f(W(e))}}),S&&n({target:"JSON",stat:!0,forced:!i||a(function(){var e=w();return"[null]"!=S([e])||"{}"!=S({a:e})||"{}"!=S(Object(e))})},{stringify:function(e,t,r){for(var o,n=[e],s=1;s<arguments.length;)n.push(arguments[s++]);if((H(o=t)||void 0!==e)&&!P(e))return z(t)||(t=function(e,t){if("function"==typeof o&&(t=o.call(this,e,t)),!P(t))return t}),n[1]=t,S.apply(null,n)}}),w[_][e]||K(w[_],e,w[_].valueOf),se(w,j),ee[b]=!0},{"../internals/an-object":10,"../internals/array-iteration":19,"../internals/create-non-enumerable-property":38,"../internals/create-property-descriptor":39,"../internals/define-well-known-symbol":42,"../internals/descriptors":43,"../internals/export":50,"../internals/fails":51,"../internals/get-built-in":56,"../internals/global":59,"../internals/has":60,"../internals/hidden-keys":61,"../internals/internal-state":70,"../internals/is-array":72,"../internals/is-object":74,"../internals/is-pure":75,"../internals/native-symbol":83,"../internals/object-create":90,"../internals/object-define-property":92,"../internals/object-get-own-property-descriptor":93,"../internals/object-get-own-property-names":95,"../internals/object-get-own-property-names-external":94,"../internals/object-get-own-property-symbols":96,"../internals/object-keys":99,"../internals/object-property-is-enumerable":100,"../internals/redefine":108,"../internals/set-to-string-tag":117,"../internals/shared":120,"../internals/shared-key":118,"../internals/to-indexed-object":132,"../internals/to-object":135,"../internals/to-primitive":138,"../internals/uid":143,"../internals/use-symbol-as-uid":144,"../internals/well-known-symbol":146,"../internals/well-known-symbol-wrapped":145}],197:[function(e,t,r){"use strict";var o=e("../internals/array-buffer-view-core"),n=e("../internals/array-copy-within"),s=o.aTypedArray;(0,o.exportTypedArrayMethod)("copyWithin",function(e,t){return n.call(s(this),e,t,2<arguments.length?arguments[2]:void 0)})},{"../internals/array-buffer-view-core":12,"../internals/array-copy-within":14}],198:[function(e,t,r){"use strict";var o=e("../internals/array-buffer-view-core"),n=e("../internals/array-iteration").every,s=o.aTypedArray;(0,o.exportTypedArrayMethod)("every",function(e){return n(s(this),e,1<arguments.length?arguments[1]:void 0)})},{"../internals/array-buffer-view-core":12,"../internals/array-iteration":19}],199:[function(e,t,r){"use strict";var o=e("../internals/array-buffer-view-core"),n=e("../internals/array-fill"),s=o.aTypedArray;(0,o.exportTypedArrayMethod)("fill",function(e){return n.apply(s(this),arguments)})},{"../internals/array-buffer-view-core":12,"../internals/array-fill":15}],200:[function(e,t,r){"use strict";var o=e("../internals/array-buffer-view-core"),s=e("../internals/array-iteration").filter,i=e("../internals/species-constructor"),a=o.aTypedArray,l=o.aTypedArrayConstructor;(0,o.exportTypedArrayMethod)("filter",function(e){for(var t=s(a(this),e,1<arguments.length?arguments[1]:void 0),e=i(this,this.constructor),r=0,o=t.length,n=new(l(e))(o);r<o;)n[r]=t[r++];return n})},{"../internals/array-buffer-view-core":12,"../internals/array-iteration":19,"../internals/species-constructor":121}],201:[function(e,t,r){"use strict";var o=e("../internals/array-buffer-view-core"),n=e("../internals/array-iteration").findIndex,s=o.aTypedArray;(0,o.exportTypedArrayMethod)("findIndex",function(e){return n(s(this),e,1<arguments.length?arguments[1]:void 0)})},{"../internals/array-buffer-view-core":12,"../internals/array-iteration":19}],202:[function(e,t,r){"use strict";var o=e("../internals/array-buffer-view-core"),n=e("../internals/array-iteration").find,s=o.aTypedArray;(0,o.exportTypedArrayMethod)("find",function(e){return n(s(this),e,1<arguments.length?arguments[1]:void 0)})},{"../internals/array-buffer-view-core":12,"../internals/array-iteration":19}],203:[function(e,t,r){e("../internals/typed-array-constructor")("Float32",function(o){return function(e,t,r){return o(this,e,t,r)}})},{"../internals/typed-array-constructor":140}],204:[function(e,t,r){e("../internals/typed-array-constructor")("Float64",function(o){return function(e,t,r){return o(this,e,t,r)}})},{"../internals/typed-array-constructor":140}],205:[function(e,t,r){"use strict";var o=e("../internals/array-buffer-view-core"),n=e("../internals/array-iteration").forEach,s=o.aTypedArray;(0,o.exportTypedArrayMethod)("forEach",function(e){n(s(this),e,1<arguments.length?arguments[1]:void 0)})},{"../internals/array-buffer-view-core":12,"../internals/array-iteration":19}],206:[function(e,t,r){"use strict";var o=e("../internals/array-buffer-view-core"),n=e("../internals/array-includes").includes,s=o.aTypedArray;(0,o.exportTypedArrayMethod)("includes",function(e){return n(s(this),e,1<arguments.length?arguments[1]:void 0)})},{"../internals/array-buffer-view-core":12,"../internals/array-includes":18}],207:[function(e,t,r){"use strict";var o=e("../internals/array-buffer-view-core"),n=e("../internals/array-includes").indexOf,s=o.aTypedArray;(0,o.exportTypedArrayMethod)("indexOf",function(e){return n(s(this),e,1<arguments.length?arguments[1]:void 0)})},{"../internals/array-buffer-view-core":12,"../internals/array-includes":18}],208:[function(e,t,r){e("../internals/typed-array-constructor")("Int16",function(o){return function(e,t,r){return o(this,e,t,r)}})},{"../internals/typed-array-constructor":140}],209:[function(e,t,r){e("../internals/typed-array-constructor")("Int32",function(o){return function(e,t,r){return o(this,e,t,r)}})},{"../internals/typed-array-constructor":140}],210:[function(e,t,r){"use strict";function o(){return a.call(c(this))}var n=e("../internals/global"),s=e("../internals/array-buffer-view-core"),i=e("../modules/es.array.iterator"),e=e("../internals/well-known-symbol")("iterator"),n=n.Uint8Array,a=i.values,l=i.keys,u=i.entries,c=s.aTypedArray,i=s.exportTypedArrayMethod,s=n&&n.prototype[e],n=!!s&&("values"==s.name||null==s.name);i("entries",function(){return u.call(c(this))}),i("keys",function(){return l.call(c(this))}),i("values",o,!n),i(e,o,!n)},{"../internals/array-buffer-view-core":12,"../internals/global":59,"../internals/well-known-symbol":146,"../modules/es.array.iterator":158}],211:[function(e,t,r){"use strict";var e=e("../internals/array-buffer-view-core"),o=e.aTypedArray,e=e.exportTypedArrayMethod,n=[].join;e("join",function(e){return n.apply(o(this),arguments)})},{"../internals/array-buffer-view-core":12}],212:[function(e,t,r){"use strict";var o=e("../internals/array-buffer-view-core"),n=e("../internals/array-last-index-of"),s=o.aTypedArray;(0,o.exportTypedArrayMethod)("lastIndexOf",function(e){return n.apply(s(this),arguments)})},{"../internals/array-buffer-view-core":12,"../internals/array-last-index-of":20}],213:[function(e,t,r){"use strict";var o=e("../internals/array-buffer-view-core"),n=e("../internals/array-iteration").map,s=e("../internals/species-constructor"),i=o.aTypedArray,a=o.aTypedArrayConstructor;(0,o.exportTypedArrayMethod)("map",function(e){return n(i(this),e,1<arguments.length?arguments[1]:void 0,function(e,t){return new(a(s(e,e.constructor)))(t)})})},{"../internals/array-buffer-view-core":12,"../internals/array-iteration":19,"../internals/species-constructor":121}],214:[function(e,t,r){"use strict";var o=e("../internals/array-buffer-view-core"),n=e("../internals/array-reduce").right,s=o.aTypedArray;(0,o.exportTypedArrayMethod)("reduceRight",function(e){return n(s(this),e,arguments.length,1<arguments.length?arguments[1]:void 0)})},{"../internals/array-buffer-view-core":12,"../internals/array-reduce":24}],215:[function(e,t,r){"use strict";var o=e("../internals/array-buffer-view-core"),n=e("../internals/array-reduce").left,s=o.aTypedArray;(0,o.exportTypedArrayMethod)("reduce",function(e){return n(s(this),e,arguments.length,1<arguments.length?arguments[1]:void 0)})},{"../internals/array-buffer-view-core":12,"../internals/array-reduce":24}],216:[function(e,t,r){"use strict";var e=e("../internals/array-buffer-view-core"),n=e.aTypedArray,e=e.exportTypedArrayMethod,s=Math.floor;e("reverse",function(){for(var e,t=n(this).length,r=s(t/2),o=0;o<r;)e=this[o],this[o++]=this[--t],this[t]=e;return this})},{"../internals/array-buffer-view-core":12}],217:[function(e,t,r){"use strict";var o=e("../internals/array-buffer-view-core"),i=e("../internals/to-length"),a=e("../internals/to-offset"),l=e("../internals/to-object"),e=e("../internals/fails"),u=o.aTypedArray;(0,o.exportTypedArrayMethod)("set",function(e){u(this);var t=a(1<arguments.length?arguments[1]:void 0,1),r=this.length,o=l(e),n=i(o.length),s=0;if(r<n+t)throw RangeError("Wrong length");for(;s<n;)this[t+s]=o[s++]},e(function(){new Int8Array(1).set({})}))},{"../internals/array-buffer-view-core":12,"../internals/fails":51,"../internals/to-length":134,"../internals/to-object":135,"../internals/to-offset":136}],218:[function(e,t,r){"use strict";var o=e("../internals/array-buffer-view-core"),i=e("../internals/species-constructor"),e=e("../internals/fails"),a=o.aTypedArray,l=o.aTypedArrayConstructor,o=o.exportTypedArrayMethod,u=[].slice;o("slice",function(e,t){for(var r=u.call(a(this),e,t),e=i(this,this.constructor),o=0,n=r.length,s=new(l(e))(n);o<n;)s[o]=r[o++];return s},e(function(){new Int8Array(1).slice()}))},{"../internals/array-buffer-view-core":12,"../internals/fails":51,"../internals/species-constructor":121}],219:[function(e,t,r){"use strict";var o=e("../internals/array-buffer-view-core"),n=e("../internals/array-iteration").some,s=o.aTypedArray;(0,o.exportTypedArrayMethod)("some",function(e){return n(s(this),e,1<arguments.length?arguments[1]:void 0)})},{"../internals/array-buffer-view-core":12,"../internals/array-iteration":19}],220:[function(e,t,r){"use strict";var e=e("../internals/array-buffer-view-core"),o=e.aTypedArray,e=e.exportTypedArrayMethod,n=[].sort;e("sort",function(e){return n.call(o(this),e)})},{"../internals/array-buffer-view-core":12}],221:[function(e,t,r){"use strict";var o=e("../internals/array-buffer-view-core"),n=e("../internals/to-length"),s=e("../internals/to-absolute-index"),i=e("../internals/species-constructor"),a=o.aTypedArray;(0,o.exportTypedArrayMethod)("subarray",function(e,t){var r=a(this),o=r.length,e=s(e,o);return new(i(r,r.constructor))(r.buffer,r.byteOffset+e*r.BYTES_PER_ELEMENT,n((void 0===t?o:s(t,o))-e))})},{"../internals/array-buffer-view-core":12,"../internals/species-constructor":121,"../internals/to-absolute-index":130,"../internals/to-length":134}],222:[function(e,t,r){"use strict";var o=e("../internals/global"),n=e("../internals/array-buffer-view-core"),e=e("../internals/fails"),s=o.Int8Array,i=n.aTypedArray,o=n.exportTypedArrayMethod,a=[].toLocaleString,l=[].slice,u=!!s&&e(function(){a.call(new s(1))});o("toLocaleString",function(){return a.apply(u?l.call(i(this)):i(this),arguments)},e(function(){return[1,2].toLocaleString()!=new s([1,2]).toLocaleString()})||!e(function(){s.prototype.toLocaleString.call([1,2])}))},{"../internals/array-buffer-view-core":12,"../internals/fails":51,"../internals/global":59}],223:[function(e,t,r){"use strict";var o=e("../internals/array-buffer-view-core").exportTypedArrayMethod,n=e("../internals/fails"),e=e("../internals/global").Uint8Array,e=e&&e.prototype||{},s=[].toString,i=[].join,n=(n(function(){s.call({})})&&(s=function(){return i.call(this)}),e.toString!=s);o("toString",s,n)},{"../internals/array-buffer-view-core":12,"../internals/fails":51,"../internals/global":59}],224:[function(e,t,r){e("../internals/typed-array-constructor")("Uint16",function(o){return function(e,t,r){return o(this,e,t,r)}})},{"../internals/typed-array-constructor":140}],225:[function(e,t,r){e("../internals/typed-array-constructor")("Uint32",function(o){return function(e,t,r){return o(this,e,t,r)}})},{"../internals/typed-array-constructor":140}],226:[function(e,t,r){e("../internals/typed-array-constructor")("Uint8",function(o){return function(e,t,r){return o(this,e,t,r)}})},{"../internals/typed-array-constructor":140}],227:[function(e,t,r){e("../internals/typed-array-constructor")("Uint8",function(o){return function(e,t,r){return o(this,e,t,r)}},!0)},{"../internals/typed-array-constructor":140}],228:[function(e,t,r){"use strict";function o(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}var n,s,i,a,l,u=e("../internals/global"),c=e("../internals/redefine-all"),d=e("../internals/internal-metadata"),f=e("../internals/collection"),h=e("../internals/collection-weak"),p=e("../internals/is-object"),m=e("../internals/internal-state").enforce,e=e("../internals/native-weak-map"),u=!u.ActiveXObject&&"ActiveXObject"in u,y=Object.isExtensible,t=t.exports=f("WeakMap",o,h);e&&u&&(n=h.getConstructor(o,"WeakMap",!0),d.REQUIRED=!0,f=t.prototype,s=f.delete,i=f.has,a=f.get,l=f.set,c(f,{delete:function(e){var t;return p(e)&&!y(e)?((t=m(this)).frozen||(t.frozen=new n),s.call(this,e)||t.frozen.delete(e)):s.call(this,e)},has:function(e){var t;return p(e)&&!y(e)?((t=m(this)).frozen||(t.frozen=new n),i.call(this,e)||t.frozen.has(e)):i.call(this,e)},get:function(e){var t;return!p(e)||y(e)||((t=m(this)).frozen||(t.frozen=new n),i.call(this,e))?a.call(this,e):t.frozen.get(e)},set:function(e,t){var r;return!p(e)||y(e)||((r=m(this)).frozen||(r.frozen=new n),i.call(this,e))?l.call(this,e,t):r.frozen.set(e,t),this}}))},{"../internals/collection":32,"../internals/collection-weak":31,"../internals/global":59,"../internals/internal-metadata":69,"../internals/internal-state":70,"../internals/is-object":74,"../internals/native-weak-map":85,"../internals/redefine-all":107}],229:[function(e,t,r){var o,n=e("../internals/global"),s=e("../internals/dom-iterables"),i=e("../internals/array-for-each"),a=e("../internals/create-non-enumerable-property");for(o in s){var l=n[o],l=l&&l.prototype;if(l&&l.forEach!==i)try{a(l,"forEach",i)}catch(e){l.forEach=i}}},{"../internals/array-for-each":16,"../internals/create-non-enumerable-property":38,"../internals/dom-iterables":45,"../internals/global":59}],230:[function(e,t,r){var o,n=e("../internals/global"),s=e("../internals/dom-iterables"),i=e("../modules/es.array.iterator"),a=e("../internals/create-non-enumerable-property"),e=e("../internals/well-known-symbol"),l=e("iterator"),u=e("toStringTag"),c=i.values;for(o in s){var d=n[o],f=d&&d.prototype;if(f){if(f[l]!==c)try{a(f,l,c)}catch(e){f[l]=c}if(f[u]||a(f,u,o),s[o])for(var h in i)if(f[h]!==i[h])try{a(f,h,i[h])}catch(e){f[h]=i[h]}}}},{"../internals/create-non-enumerable-property":38,"../internals/dom-iterables":45,"../internals/global":59,"../internals/well-known-symbol":146,"../modules/es.array.iterator":158}],231:[function(e,t,D){"use strict";e("../modules/es.array.iterator");function n(t){try{return decodeURIComponent(t)}catch(e){return t}}function r(e){return B[e]}function s(e){return encodeURIComponent(e).replace(F,r)}function c(e){this.entries.length=0,R(this.entries,e)}function u(e,t){if(e<t)throw TypeError("Not enough arguments")}function d(){y(this,d,C);var e,t,r,o,n,s,i,a,l=0<arguments.length?arguments[0]:void 0,u=[];if(k(this,{type:C,entries:u,updateURL:function(){},updateSearchParams:c}),void 0!==l)if(_(l))if("function"==typeof(e=M(l)))for(r=(t=e.call(l)).next;!(o=r.call(t)).done;){if((s=(n=(o=S(j(o.value))).next).call(o)).done||(i=n.call(o)).done||!n.call(o).done)throw TypeError("Expected sequence with length 2");u.push({key:s.value+"",value:i.value+""})}else for(a in l)g(l,a)&&u.push({key:a,value:l[a]+""});else R(u,"string"==typeof l?"?"===l.charAt(0)?l.slice(1):l:l+"")}var o=e("../internals/export"),i=e("../internals/get-built-in"),a=e("../internals/native-url"),l=e("../internals/redefine"),f=e("../internals/redefine-all"),h=e("../internals/set-to-string-tag"),p=e("../internals/create-iterator-constructor"),m=e("../internals/internal-state"),y=e("../internals/an-instance"),g=e("../internals/has"),v=e("../internals/function-bind-context"),b=e("../internals/classof"),j=e("../internals/an-object"),_=e("../internals/is-object"),x=e("../internals/object-create"),w=e("../internals/create-property-descriptor"),S=e("../internals/get-iterator"),M=e("../internals/get-iterator-method"),e=e("../internals/well-known-symbol"),E=i("fetch"),T=i("Headers"),i=e("iterator"),C="URLSearchParams",O=C+"Iterator",k=m.set,L=m.getterFor(C),U=m.getterFor(O),N=/\+/g,P=Array(4),A=function(e){var t,r=e.replace(N," "),o=4;try{return decodeURIComponent(r)}catch(e){for(;o;)r=r.replace((t=o--,P[t-1]||(P[t-1]=RegExp("((?:%[\\da-f]{2}){"+t+"})","gi"))),n);return r}},F=/[!'()~]|%20/g,B={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},R=function(e,t){if(t)for(var r,o=t.split("&"),n=0;n<o.length;)(r=o[n++]).length&&(r=r.split("="),e.push({key:A(r.shift()),value:A(r.join("="))}))},I=p(function(e,t){k(this,{type:O,iterator:S(L(e).entries),kind:t})},"Iterator",function(){var e=U(this),t=e.kind,e=e.iterator.next(),r=e.value;return e.done||(e.value="keys"===t?r.key:"values"===t?r.value:[r.key,r.value]),e}),e=d.prototype;f(e,{append:function(e,t){u(arguments.length,2);var r=L(this);r.entries.push({key:e+"",value:t+""}),r.updateURL()},delete:function(e){u(arguments.length,1);for(var t=L(this),r=t.entries,o=e+"",n=0;n<r.length;)r[n].key===o?r.splice(n,1):n++;t.updateURL()},get:function(e){u(arguments.length,1);for(var t=L(this).entries,r=e+"",o=0;o<t.length;o++)if(t[o].key===r)return t[o].value;return null},getAll:function(e){u(arguments.length,1);for(var t=L(this).entries,r=e+"",o=[],n=0;n<t.length;n++)t[n].key===r&&o.push(t[n].value);return o},has:function(e){u(arguments.length,1);for(var t=L(this).entries,r=e+"",o=0;o<t.length;)if(t[o++].key===r)return!0;return!1},set:function(e,t){u(arguments.length,1);for(var r,o=L(this),n=o.entries,s=!1,i=e+"",a=t+"",l=0;l<n.length;l++)(r=n[l]).key===i&&(s?n.splice(l--,1):(s=!0,r.value=a));s||n.push({key:i,value:a}),o.updateURL()},sort:function(){for(var e,t,r=L(this),o=r.entries,n=o.slice(),s=o.length=0;s<n.length;s++){for(e=n[s],t=0;t<s;t++)if(o[t].key>e.key){o.splice(t,0,e);break}t===s&&o.push(e)}r.updateURL()},forEach:function(e){for(var t,r=L(this).entries,o=v(e,1<arguments.length?arguments[1]:void 0,3),n=0;n<r.length;)o((t=r[n++]).value,t.key,this)},keys:function(){return new I(this,"keys")},values:function(){return new I(this,"values")},entries:function(){return new I(this,"entries")}},{enumerable:!0}),l(e,i,e.entries),l(e,"toString",function(){for(var e,t=L(this).entries,r=[],o=0;o<t.length;)e=t[o++],r.push(s(e.key)+"="+s(e.value));return r.join("&")},{enumerable:!0}),h(d,C),o({global:!0,forced:!a},{URLSearchParams:d}),a||"function"!=typeof E||"function"!=typeof T||o({global:!0,enumerable:!0,forced:!0},{fetch:function(e){var t,r,o,e=[e];return 1<arguments.length&&(_(t=arguments[1])&&(r=t.body,b(r)===C&&((o=t.headers?new T(t.headers):new T).has("content-type")||o.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),t=x(t,{body:w(0,String(r)),headers:w(0,o)}))),e.push(t)),E.apply(this,e)}}),t.exports={URLSearchParams:d,getState:L}},{"../internals/an-instance":9,"../internals/an-object":10,"../internals/classof":29,"../internals/create-iterator-constructor":37,"../internals/create-property-descriptor":39,"../internals/export":50,"../internals/function-bind-context":54,"../internals/get-built-in":56,"../internals/get-iterator":58,"../internals/get-iterator-method":57,"../internals/has":60,"../internals/internal-state":70,"../internals/is-object":74,"../internals/native-url":84,"../internals/object-create":90,"../internals/redefine":108,"../internals/redefine-all":107,"../internals/set-to-string-tag":117,"../internals/well-known-symbol":146,"../modules/es.array.iterator":158}],232:[function(e,y,U){"use strict";e("../modules/es.string.iterator");function c(e){var t,r,o,n;if("number"==typeof e){for(t=[],r=0;r<4;r++)t.unshift(e%256),e=Y(e/256);return t.join(".")}if("object"!=typeof e)return e;for(t="",o=le(e),r=0;r<8;r++)n&&0===e[r]||(n=n&&!1,o===r?(t+=r?":":"::",n=!0):(t+=e[r].toString(16),r<7&&(t+=":")));return"["+t+"]"}function n(e){return!e.host||e.cannotBeABaseURL||"file"==e.scheme}function a(e,t,r,o){var n,s,i,a=r||me,l=0,u="",c=!1,d=!1,f=!1;for(r||(e.scheme="",e.username="",e.password="",e.host=null,e.port=null,e.path=[],e.query=null,e.fragment=null,e.cannotBeABaseURL=!1,t=t.replace(ie,"")),t=t.replace(ae,""),n=b(t);l<=n.length;){switch(s=n[l],a){case me:if(!s||!K.test(s)){if(r)return j;a=ge;continue}u+=s.toLowerCase(),a=ye;break;case ye:if(s&&($.test(s)||"+"==s||"-"==s||"."==s))u+=s.toLowerCase();else{if(":"!=s){if(r)return j;u="",a=ge,l=0;continue}if(r&&(C(e)!=v(T,u)||"file"==u&&(O(e)||null!==e.port)||"file"==e.scheme&&!e.host))return;if(e.scheme=u,r)return void(C(e)&&T[e.scheme]==e.port&&(e.port=null));u="","file"==e.scheme?a=Ee:C(e)&&o&&o.scheme==e.scheme?a=ve:C(e)?a=xe:"/"==n[l+1]?(a=be,l++):(e.cannotBeABaseURL=!0,e.path.push(""),a=Oe)}break;case ge:if(!o||o.cannotBeABaseURL&&"#"!=s)return j;if(o.cannotBeABaseURL&&"#"==s){e.scheme=o.scheme,e.path=o.path.slice(),e.query=o.query,e.fragment="",e.cannotBeABaseURL=!0,a=D;break}a="file"==o.scheme?Ee:je;continue;case ve:if("/"!=s||"/"!=n[l+1]){a=je;continue}a=L,l++;break;case be:if("/"==s){a=P;break}a=R;continue;case je:if(e.scheme=o.scheme,s==g)e.username=o.username,e.password=o.password,e.host=o.host,e.port=o.port,e.path=o.path.slice(),e.query=o.query;else if("/"==s||"\\"==s&&C(e))a=_e;else if("?"==s)e.username=o.username,e.password=o.password,e.host=o.host,e.port=o.port,e.path=o.path.slice(),e.query="",a=I;else{if("#"!=s){e.username=o.username,e.password=o.password,e.host=o.host,e.port=o.port,e.path=o.path.slice(),e.path.pop(),a=R;continue}e.username=o.username,e.password=o.password,e.host=o.host,e.port=o.port,e.path=o.path.slice(),e.query=o.query,e.fragment="",a=D}break;case _e:if(!C(e)||"/"!=s&&"\\"!=s){if("/"!=s){e.username=o.username,e.password=o.password,e.host=o.host,e.port=o.port,a=R;continue}a=P}else a=L;break;case xe:if(a=L,"/"!=s||"/"!=u.charAt(l+1))continue;l++;break;case L:if("/"==s||"\\"==s)break;a=P;continue;case P:if("@"==s){c&&(u="%40"+u);for(var c=!0,h=b(u),p=0;p<h.length;p++){var m=h[p];":"!=m||f?(m=E(m,M),f?e.password+=m:e.username+=m):f=!0}u=""}else if(s==g||"/"==s||"?"==s||"#"==s||"\\"==s&&C(e)){if(c&&""==u)return Q;l-=b(u).length+1,u="",a=we}else u+=s;break;case we:case Se:if(r&&"file"==e.scheme){a=Ce;continue}if(":"!=s||d){if(s==g||"/"==s||"?"==s||"#"==s||"\\"==s&&C(e)){if(C(e)&&""==u)return _;if(r&&""==u&&(O(e)||null!==e.port))return;if(i=w(e,u))return i;if(u="",a=A,r)return;continue}"["==s?d=!0:"]"==s&&(d=!1),u+=s}else{if(""==u)return _;if(i=w(e,u))return i;if(u="",a=Me,r==Se)return}break;case Me:if(!x.test(s)){if(s==g||"/"==s||"?"==s||"#"==s||"\\"==s&&C(e)||r){if(""!=u){var y=parseInt(u,10);if(65535<y)return J;e.port=C(e)&&y===T[e.scheme]?null:y,u=""}if(r)return;a=A;continue}return J}u+=s;break;case Ee:if(e.scheme="file","/"==s||"\\"==s)a=Te;else{if(!o||"file"!=o.scheme){a=R;continue}if(s==g)e.host=o.host,e.path=o.path.slice(),e.query=o.query;else if("?"==s)e.host=o.host,e.path=o.path.slice(),e.query="",a=I;else{if("#"!=s){de(n.slice(l).join(""))||(e.host=o.host,e.path=o.path.slice(),fe(e)),a=R;continue}e.host=o.host,e.path=o.path.slice(),e.query=o.query,e.fragment="",a=D}}break;case Te:if("/"==s||"\\"==s){a=Ce;break}o&&"file"==o.scheme&&!de(n.slice(l).join(""))&&(k(o.path[0],!0)?e.path.push(o.path[0]):e.host=o.host),a=R;continue;case Ce:if(s==g||"/"==s||"\\"==s||"?"==s||"#"==s){if(!r&&k(u))a=R;else{if(""==u){if(e.host="",r)return}else{if(i=w(e,u))return i;if("localhost"==e.host&&(e.host=""),r)return;u=""}a=A}continue}u+=s;break;case A:if(C(e)){if(a=R,"/"!=s&&"\\"!=s)continue}else if(r||"?"!=s)if(r||"#"!=s){if(s!=g&&(a=R,"/"!=s))continue}else e.fragment="",a=D;else e.query="",a=I;break;case R:if(s==g||"/"==s||"\\"==s&&C(e)||!r&&("?"==s||"#"==s)){if(pe(u)?(fe(e),"/"==s||"\\"==s&&C(e)||e.path.push("")):he(u)?"/"==s||"\\"==s&&C(e)||e.path.push(""):("file"==e.scheme&&!e.path.length&&k(u)&&(e.host&&(e.host=""),u=u.charAt(0)+":"),e.path.push(u)),u="","file"==e.scheme&&(s==g||"?"==s||"#"==s))for(;1<e.path.length&&""===e.path[0];)e.path.shift();"?"==s?(e.query="",a=I):"#"==s&&(e.fragment="",a=D)}else u+=E(s,ce);break;case Oe:"?"==s?(e.query="",a=I):"#"==s?(e.fragment="",a=D):s!=g&&(e.path[0]+=E(s,S));break;case I:r||"#"!=s?s!=g&&("'"==s&&C(e)?e.query+="%27":e.query+="#"==s?"%23":E(s,S)):(e.fragment="",a=D);break;case D:s!=g&&(e.fragment+=E(s,ue))}l++}}function l(e){var t,r,o=G(this,l,"URL"),n=1<arguments.length?arguments[1]:void 0,e=String(e),s=X(o,{type:"URL"});if(void 0!==n)if(n instanceof l)t=p(n);else if(r=a(t={},String(n)))throw TypeError(r);if(r=a(s,e,null,t))throw TypeError(r);var i=s.searchParams=new q;(n=h(i)).updateSearchParams(s.query),n.updateURL=function(){s.query=String(i)||null},u||(o.href=m.call(o),o.origin=ke.call(o),o.protocol=Le.call(o),o.username=Pe.call(o),o.password=Ae.call(o),o.host=Re.call(o),o.hostname=Ie.call(o),o.port=De.call(o),o.pathname=Ue.call(o),o.search=Ne.call(o),o.searchParams=Fe.call(o),o.hash=Be.call(o))}function t(e,t){return{get:e,set:t,configurable:!0,enumerable:!0}}var g,r,o,N=e("../internals/export"),u=e("../internals/descriptors"),F=e("../internals/native-url"),s=e("../internals/global"),B=e("../internals/object-define-properties"),i=e("../internals/redefine"),G=e("../internals/an-instance"),v=e("../internals/has"),d=e("../internals/object-assign"),b=e("../internals/array-from"),V=e("../internals/string-multibyte").codeAt,z=e("../internals/string-punycode-to-ascii"),H=e("../internals/set-to-string-tag"),W=e("../modules/web.url-search-params"),e=e("../internals/internal-state"),f=s.URL,q=W.URLSearchParams,h=W.getState,X=e.set,p=e.getterFor("URL"),Y=Math.floor,Z=Math.pow,Q="Invalid authority",j="Invalid scheme",_="Invalid host",J="Invalid port",K=/[A-Za-z]/,$=/[\d+-.A-Za-z]/,x=/\d/,ee=/^(0x|0X)/,te=/^[0-7]+$/,re=/^\d+$/,oe=/^[\dA-Fa-f]+$/,ne=/[\u0000\u0009\u000A\u000D #%/:?@[\\]]/,se=/[\u0000\u0009\u000A\u000D #/:?@[\\]]/,ie=/^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g,ae=/[\u0009\u000A\u000D]/g,w=function(e,t){var r,o,n;if("["==t.charAt(0))return"]"==t.charAt(t.length-1)&&(r=function(e){var t=[0,0,0,0,0,0,0,0],r=0,o=null,n=0,s,i,a,l,u,c,d,f=function(){return e.charAt(n)};if(f()==":"){if(e.charAt(1)!=":")return;n+=2;r++;o=r}while(f()){if(r==8)return;if(f()==":"){if(o!==null)return;n++;r++;o=r;continue}s=i=0;while(i<4&&oe.test(f())){s=s*16+parseInt(f(),16);n++;i++}if(f()=="."){if(i==0)return;n-=i;if(r>6)return;a=0;while(f()){l=null;if(a>0)if(f()=="."&&a<4)n++;else return;if(!x.test(f()))return;while(x.test(f())){u=parseInt(f(),10);if(l===null)l=u;else if(l==0)return;else l=l*10+u;if(l>255)return;n++}t[r]=t[r]*256+l;a++;if(a==2||a==4)r++}if(a!=4)return;break}else if(f()==":"){n++;if(!f())return}else if(f())return;t[r++]=s}if(o!==null){c=r-o;r=7;while(r!=0&&c>0){d=t[r];t[r--]=t[o+c-1];t[o+--c]=d}}else if(r!=8)return;return t}(t.slice(1,-1)))?void(e.host=r):_;if(C(e))return t=z(t),ne.test(t)||null===(r=function(e){var t=e.split("."),r,o,n,s,i,a,l;if(t.length&&t[t.length-1]=="")t.pop();if((r=t.length)>4)return e;for(o=[],n=0;n<r;n++){s=t[n];if(s=="")return e;i=10;if(s.length>1&&s.charAt(0)=="0"){i=ee.test(s)?16:8;s=s.slice(i==8?1:2)}if(s==="")a=0;else{if(!(i==10?re:i==8?te:oe).test(s))return e;a=parseInt(s,i)}o.push(a)}for(n=0;n<r;n++){a=o[n];if(n==r-1){if(a>=Z(256,5-r))return null}else if(a>255)return null}for(l=o.pop(),n=0;n<o.length;n++)l+=o[n]*Z(256,3-n);return l}(t))?_:void(e.host=r);if(se.test(t))return _;for(r="",o=b(t),n=0;n<o.length;n++)r+=E(o[n],S);e.host=r},le=function(e){for(var t=null,r=1,o=null,n=0,s=0;s<8;s++)0!==e[s]?(r<n&&(t=o,r=n),o=null,n=0):(null===o&&(o=s),++n);return r<n&&(t=o,r=n),t},S={},ue=d({},S,{" ":1,'"':1,"<":1,">":1,"`":1}),ce=d({},ue,{"#":1,"?":1,"{":1,"}":1}),M=d({},ce,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),E=function(e,t){var r=V(e,0);return 32<r&&r<127&&!v(t,e)?e:encodeURIComponent(e)},T={ftp:21,file:null,http:80,https:443,ws:80,wss:443},C=function(e){return v(T,e.scheme)},O=function(e){return""!=e.username||""!=e.password},k=function(e,t){return 2==e.length&&K.test(e.charAt(0))&&(":"==(e=e.charAt(1))||!t&&"|"==e)},de=function(e){return 1<e.length&&k(e.slice(0,2))&&(2==e.length||"/"===(e=e.charAt(2))||"\\"===e||"?"===e||"#"===e)},fe=function(e){var t=e.path,r=t.length;!r||"file"==e.scheme&&1==r&&k(t[0],!0)||t.pop()},he=function(e){return"."===e||"%2e"===e.toLowerCase()},pe=function(e){return".."===(e=e.toLowerCase())||"%2e."===e||".%2e"===e||"%2e%2e"===e},me={},ye={},ge={},ve={},be={},je={},_e={},xe={},L={},P={},we={},Se={},Me={},Ee={},Te={},Ce={},A={},R={},Oe={},I={},D={},s=l.prototype,m=function(){var e=p(this),t=e.scheme,r=e.username,o=e.password,n=e.host,s=e.port,i=e.path,a=e.query,l=e.fragment,u=t+":";return null!==n?(u+="//",O(e)&&(u+=r+(o?":"+o:"")+"@"),u+=c(n),null!==s&&(u+=":"+s)):"file"==t&&(u+="//"),u+=e.cannotBeABaseURL?i[0]:i.length?"/"+i.join("/"):"",null!==a&&(u+="?"+a),null!==l&&(u+="#"+l),u},ke=function(){var e=p(this),t=e.scheme,r=e.port;if("blob"==t)try{return new URL(t.path[0]).origin}catch(e){return"null"}return"file"!=t&&C(e)?t+"://"+c(e.host)+(null!==r?":"+r:""):"null"},Le=function(){return p(this).scheme+":"},Pe=function(){return p(this).username},Ae=function(){return p(this).password},Re=function(){var e=p(this),t=e.host,e=e.port;return null===t?"":null===e?c(t):c(t)+":"+e},Ie=function(){var e=p(this).host;return null===e?"":c(e)},De=function(){var e=p(this).port;return null===e?"":String(e)},Ue=function(){var e=p(this),t=e.path;return e.cannotBeABaseURL?t[0]:t.length?"/"+t.join("/"):""},Ne=function(){var e=p(this).query;return e?"?"+e:""},Fe=function(){return p(this).searchParams},Be=function(){var e=p(this).fragment;return e?"#"+e:""};u&&B(s,{href:t(m,function(e){var t=p(this),e=String(e),e=a(t,e);if(e)throw TypeError(e);h(t.searchParams).updateSearchParams(t.query)}),origin:t(ke),protocol:t(Le,function(e){var t=p(this);a(t,String(e)+":",me)}),username:t(Pe,function(e){var t=p(this),r=b(String(e));if(!n(t)){t.username="";for(var o=0;o<r.length;o++)t.username+=E(r[o],M)}}),password:t(Ae,function(e){var t=p(this),r=b(String(e));if(!n(t)){t.password="";for(var o=0;o<r.length;o++)t.password+=E(r[o],M)}}),host:t(Re,function(e){var t=p(this);t.cannotBeABaseURL||a(t,String(e),we)}),hostname:t(Ie,function(e){var t=p(this);t.cannotBeABaseURL||a(t,String(e),Se)}),port:t(De,function(e){var t=p(this);n(t)||(""==(e=String(e))?t.port=null:a(t,e,Me))}),pathname:t(Ue,function(e){var t=p(this);t.cannotBeABaseURL||(t.path=[],a(t,e+"",A))}),search:t(Ne,function(e){var t=p(this);""==(e=String(e))?t.query=null:("?"==e.charAt(0)&&(e=e.slice(1)),t.query="",a(t,e,I)),h(t.searchParams).updateSearchParams(t.query)}),searchParams:t(Fe),hash:t(Be,function(e){var t=p(this);""==(e=String(e))?t.fragment=null:("#"==e.charAt(0)&&(e=e.slice(1)),t.fragment="",a(t,e,D))})}),i(s,"toJSON",function(){return m.call(this)},{enumerable:!0}),i(s,"toString",function(){return m.call(this)},{enumerable:!0}),f&&(r=f.createObjectURL,o=f.revokeObjectURL,r&&i(l,"createObjectURL",function(e){return r.apply(f,arguments)}),o&&i(l,"revokeObjectURL",function(e){return o.apply(f,arguments)})),H(l,"URL"),N({global:!0,forced:!F,sham:!u},{URL:l})},{"../internals/an-instance":9,"../internals/array-from":17,"../internals/descriptors":43,"../internals/export":50,"../internals/global":59,"../internals/has":60,"../internals/internal-state":70,"../internals/native-url":84,"../internals/object-assign":89,"../internals/object-define-properties":91,"../internals/redefine":108,"../internals/set-to-string-tag":117,"../internals/string-multibyte":123,"../internals/string-punycode-to-ascii":124,"../modules/es.string.iterator":186,"../modules/web.url-search-params":231}],233:[function(e,t,r){"use strict";t.exports=e("./").polyfill()},{"./":234}],234:[function(V,r,o){!function(B,G){var e,t;e=this,t=function(){"use strict";function l(e){return"function"==typeof e}var r=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},o=0,t=void 0,n=void 0,i=function(e,t){d[o]=e,d[o+1]=t,2===(o+=2)&&(n?n(f):D())};var e="undefined"!=typeof window?window:void 0,s=e||{},s=s.MutationObserver||s.WebKitMutationObserver,a="undefined"==typeof self&&void 0!==B&&"[object process]"==={}.toString.call(B),u="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function c(){var e=setTimeout;return function(){return e(f,1)}}var d=new Array(1e3);function f(){for(var e=0;e<o;e+=2)(0,d[e])(d[e+1]),d[e]=void 0,d[e+1]=void 0;o=0}function h(){try{var e=Function("return this")().require("vertx");return void 0!==(t=e.runOnLoop||e.runOnContext)?function(){t(f)}:c()}catch(e){return c()}}var p,m,y,D=void 0;function g(e,t){var r,o=this,n=new this.constructor(j),s=(void 0===n[b]&&P(n),o._state);return s?(r=arguments[s-1],i(function(){return k(s,n,r,o._result)})):C(o,n,e,t),n}function v(e){var t;return e&&"object"==typeof e&&e.constructor===this?e:(M(t=new this(j),e),t)}var D=a?function(){return B.nextTick(f)}:s?(m=0,a=new s(f),y=document.createTextNode(""),a.observe(y,{characterData:!0}),function(){y.data=m=++m%2}):u?((p=new MessageChannel).port1.onmessage=f,function(){return p.port2.postMessage(0)}):(void 0===e&&"function"==typeof V?h:c)(),b=Math.random().toString(36).substring(2);function j(){}var _=void 0,x=1,w=2;function U(e,o,n){i(function(t){var r=!1,e=function(e,t,r,o){try{e.call(t,r,o)}catch(e){return e}}(n,o,function(e){r||(r=!0,(o!==e?M:E)(t,e))},function(e){r||(r=!0,T(t,e))},t._label);!r&&e&&(r=!0,T(t,e))},e)}function S(e,t,r){var o,n;t.constructor===e.constructor&&r===g&&t.constructor.resolve===v?(o=e,(n=t)._state===x?E(o,n._result):n._state===w?T(o,n._result):C(n,void 0,function(e){return M(o,e)},function(e){return T(o,e)})):void 0!==r&&l(r)?U(e,t,r):E(e,t)}function M(t,e){if(t===e)T(t,new TypeError("You cannot resolve a promise with itself"));else if(r=typeof e,null===e||"object"!=r&&"function"!=r)E(t,e);else{r=void 0;try{r=e.then}catch(e){return void T(t,e)}S(t,e,r)}var r}function N(e){e._onerror&&e._onerror(e._result),O(e)}function E(e,t){e._state===_&&(e._result=t,e._state=x,0!==e._subscribers.length&&i(O,e))}function T(e,t){e._state===_&&(e._state=w,e._result=t,i(N,e))}function C(e,t,r,o){var n=e._subscribers,s=n.length;e._onerror=null,n[s]=t,n[s+x]=r,n[s+w]=o,0===s&&e._state&&i(O,e)}function O(e){var t=e._subscribers,r=e._state;if(0!==t.length){for(var o,n=void 0,s=e._result,i=0;i<t.length;i+=3)o=t[i],n=t[i+r],o?k(r,o,n,s):n(s);e._subscribers.length=0}}function k(e,t,r,o){var n=l(r),s=void 0,i=void 0,a=!0;if(n){try{s=r(o)}catch(e){a=!1,i=e}if(t===s)return void T(t,new TypeError("A promises callback cannot return that same promise."))}else s=o;t._state===_&&(n&&a?M(t,s):!1===a?T(t,i):e===x?E(t,s):e===w&&T(t,s))}var L=0;function P(e){e[b]=L++,e._state=void 0,e._result=void 0,e._subscribers=[]}A.prototype._enumerate=function(e){for(var t=0;this._state===_&&t<e.length;t++)this._eachEntry(e[t],t)},A.prototype._eachEntry=function(t,e){var r=this._instanceConstructor,o=r.resolve;if(o===v){var n,s=void 0,i=void 0,a=!1;try{s=t.then}catch(e){a=!0,i=e}s===g&&t._state!==_?this._settledAt(t._state,e,t._result):"function"!=typeof s?(this._remaining--,this._result[e]=t):r===R?(n=new r(j),a?T(n,i):S(n,t,s),this._willSettleAt(n,e)):this._willSettleAt(new r(function(e){return e(t)}),e)}else this._willSettleAt(o(t),e)},A.prototype._settledAt=function(e,t,r){var o=this.promise;o._state===_&&(this._remaining--,e===w?T(o,r):this._result[t]=r),0===this._remaining&&E(o,this._result)},A.prototype._willSettleAt=function(e,t){var r=this;C(e,void 0,function(e){return r._settledAt(x,t,e)},function(e){return r._settledAt(w,t,e)})};var F=A;function A(e,t){this._instanceConstructor=e,this.promise=new e(j),this.promise[b]||P(this.promise),r(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0!==this.length&&(this.length=this.length||0,this._enumerate(t),0!==this._remaining)||E(this.promise,this._result)):T(this.promise,new Error("Array Methods must be provided an Array"))}I.prototype.catch=function(e){return this.then(null,e)},I.prototype.finally=function(t){var r=this.constructor;return l(t)?this.then(function(e){return r.resolve(t()).then(function(){return e})},function(e){return r.resolve(t()).then(function(){throw e})}):this.then(t,t)};var R=I;function I(e){if(this[b]=L++,this._result=this._state=void 0,this._subscribers=[],j!==e){if("function"!=typeof e)throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");if(!(this instanceof I))throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");var t=this;try{e(function(e){M(t,e)},function(e){T(t,e)})}catch(e){T(t,e)}}}return R.prototype.then=g,R.all=function(e){return new F(this,e).promise},R.race=function(n){var s=this;return r(n)?new s(function(e,t){for(var r=n.length,o=0;o<r;o++)s.resolve(n[o]).then(e,t)}):new s(function(e,t){return t(new TypeError("You must pass an array to race."))})},R.resolve=v,R.reject=function(e){var t=new this(j);return T(t,e),t},R._setScheduler=function(e){n=e},R._setAsap=function(e){i=e},R._asap=i,R.polyfill=function(){var e=void 0;if(void 0!==G)e=G;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var r=null;try{r=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===r&&!t.cast)return}e.Promise=R},R.Promise=R},"object"==typeof o&&void 0!==r?r.exports=t():"function"==typeof s&&s.amd?s(t):e.ES6Promise=t()}.call(this,V("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:243}],235:[function(e,t,r){var o,n;o=this,n=function(e,t){"use strict";var r=5e3,o="callback";function d(t){try{delete window[t]}catch(e){window[t]=void 0}}function f(e){e=document.getElementById(e);e&&document.getElementsByTagName("head")[0].removeChild(e)}t.exports=function(s){var i=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],a=s,l=i.timeout||r,u=i.jsonpCallback||o,c=void 0;return new Promise(function(t,e){var r=i.jsonpCallbackFunction||"jsonp_"+Date.now()+"_"+Math.ceil(1e5*Math.random()),o=u+"_"+r,n=(window[r]=function(e){t({ok:!0,json:function(){return Promise.resolve(e)}}),c&&clearTimeout(c),f(o),d(r)},a+=-1===a.indexOf("?")?"?":"&",document.createElement("script"));n.setAttribute("src",""+a+u+"="+r),i.charset&&n.setAttribute("charset",i.charset),n.id=o,document.getElementsByTagName("head")[0].appendChild(n),c=setTimeout(function(){e(new Error("JSONP request to "+s+" timed out")),d(r),f(o),window[r]=function(){d(r)}},l),n.onerror=function(){e(new Error("JSONP request to "+s+" failed")),d(r),f(o),c&&clearTimeout(c)}})}},"function"==typeof s&&s.amd?s(["exports","module"],n):void 0!==r&&void 0!==t?n(0,t):(n(n={exports:{}},n),o.fetchJsonp=n.exports)},{}],236:[function(e,t,r){var o=function(a){"use strict";var l,u,c,d,f,h,t,p,m,o,e;if(!(void 0===a||"undefined"!=typeof navigator&&/MSIE [1-9]\./.test(navigator.userAgent)))return e=a.document,l=function(){return a.URL||a.webkitURL||a},u=e.createElementNS("http://www.w3.org/1999/xhtml","a"),c="download"in u,d=/constructor/i.test(a.HTMLElement)||a.safari,f=/CriOS\/[\d]+/.test(navigator.userAgent),h=function(e){(a.setImmediate||a.setTimeout)(function(){throw e},0)},t=4e4,p=function(e){setTimeout(function(){"string"==typeof e?l().revokeObjectURL(e):e.remove()},t)},m=function(e){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([String.fromCharCode(65279),e],{type:e.type}):e},e=(o=function(e,r,t){t||(e=m(e));var o,n,s=this,t="application/octet-stream"===e.type,i=function(){for(var e=s,t="writestart progress write writeend".split(" "),r=void 0,o=(t=[].concat(t)).length;o--;){var n=e["on"+t[o]];if("function"==typeof n)try{n.call(e,r||e)}catch(e){h(e)}}};s.readyState=s.INIT,c?(o=l().createObjectURL(e),setTimeout(function(){var e,t;u.href=o,u.download=r,e=u,t=new MouseEvent("click"),e.dispatchEvent(t),i(),p(o),s.readyState=s.DONE})):(f||t&&d)&&a.FileReader?((n=new FileReader).onloadend=function(){var e=f?n.result:n.result.replace(/^data:[^;]*;/,"data:attachment/file;");a.open(e,"_blank")||(a.location.href=e),e=void 0,s.readyState=s.DONE,i()},n.readAsDataURL(e),s.readyState=s.INIT):(o=o||l().createObjectURL(e),!t&&a.open(o,"_blank")||(a.location.href=o),s.readyState=s.DONE,i(),p(o))}).prototype,"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(e,t,r){return t=t||e.name||"download",r||(e=m(e)),navigator.msSaveOrOpenBlob(e,t)}:(e.abort=function(){},e.readyState=e.INIT=0,e.WRITING=1,e.DONE=2,e.error=e.onwritestart=e.onprogress=e.onwrite=e.onabort=e.onerror=e.onwriteend=null,function(e,t,r){return new o(e,t||e.name||"download",r)})}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content);void 0!==t&&t.exports?t.exports.saveAs=o:null!=s&&null!==s.amd&&s("FileSaver.js",function(){return o})},{}],237:[function(e,t,r){var o,n=Object.defineProperty,s=(n(r,"__esModule",{value:!0}),r),i={GIFEncoder:()=>f,applyPalette:()=>function(e,t,r="rgb565"){if(!e||!e.buffer)throw new Error("quantize() expected RGBA Uint8Array data");if(!(e instanceof Uint8Array||e instanceof Uint8ClampedArray))throw new Error("quantize() expected RGBA Uint8Array data");if(256<t.length)throw new Error("applyPalette() only works with 256 colors or less");const o=new Uint32Array(e.buffer),n=o.length,s="rgb444"===r?4096:65536,i=new Uint8Array(n),a=new Array(s);if("rgba4444"===r)for(let e=0;e<n;e++){var l=o[e],u=l>>24&255,c=l>>16&255,d=l>>8&255,l=255&l,f=L(l,d,c,u),f=f in a?a[f]:a[f]=function(t,r,o,n,s){let i=0,a=1e100;for(let e=0;e<s.length;e++){var l,u=s[e],c=v(u[3]-n);c>a||(l=u[0],(c+=v(l-t))>a||(l=u[1],(c+=v(l-r))>a||(l=u[2],(c+=v(l-o))>a||(a=c,i=e))))}return i}(l,d,c,u,t);i[e]=f}else{const g="rgb444"===r?P:k;for(let e=0;e<n;e++){var h=o[e],p=h>>16&255,m=h>>8&255,h=255&h,y=g(h,m,p),y=y in a?a[y]:a[y]=function(t,r,o,n){let s=0,i=1e100;for(let e=0;e<n.length;e++){var a,l=n[e],u=v(l[0]-t);u>i||(a=l[1],(u+=v(a-r))>i||(a=l[2],(u+=v(a-o))>i||(i=u,s=e)))}return s}(h,m,p,t);i[e]=y}}return i},default:()=>h,nearestColor:()=>function(e,t,r=u){return e[l(e,t,r)]},nearestColorIndex:()=>l,nearestColorIndexWithDistance:()=>d,prequantize:()=>function(e,{roundRGB:r=5,roundAlpha:o=10,oneBitAlpha:n=null}={}){const s=new Uint32Array(e.buffer);for(let t=0;t<s.length;t++){var i=s[t];let e=i>>24&255;var a,l=i>>16&255,u=i>>8&255,i=255&i;e=c(e,o),n&&(a="number"==typeof n?n:127,e=e<=a?0:255),i=c(i,r),u=c(u,r),l=c(l,r),s[t]=e<<24|l<<16|u<<8|i<<0}},quantize:()=>function(e,t,r={}){var{format:o="rgb565",clearAlpha:n=!0,clearAlphaColor:s=0,clearAlphaThreshold:i=0,oneBitAlpha:a=!1}=r;if(!e||!e.buffer)throw new Error("quantize() expected RGBA Uint8Array data");if(!(e instanceof Uint8Array||e instanceof Uint8ClampedArray))throw new Error("quantize() expected RGBA Uint8Array data");e=new Uint32Array(e.buffer);let l=!1!==r.useSqrt;const u="rgba4444"===o,c=function(r,e){const t="rgb444"===e?4096:65536,o=new Array(t),n=r.length;if("rgba4444"===e)for(let t=0;t<n;++t){var s=r[t],i=s>>24&255,a=s>>16&255,l=s>>8&255,s=255&s,u=L(s,l,a,i);let e=u in o?o[u]:o[u]=D();e.rc+=s,e.gc+=l,e.bc+=a,e.ac+=i,e.cnt++}else if("rgb444"===e)for(let t=0;t<n;++t){var c=r[t],d=c>>16&255,f=c>>8&255,c=255&c,h=P(c,f,d);let e=h in o?o[h]:o[h]=D();e.rc+=c,e.gc+=f,e.bc+=d,e.cnt++}else for(let t=0;t<n;++t){var p=r[t],m=p>>16&255,y=p>>8&255,p=255&p,g=k(p,y,m);let e=g in o?o[g]:o[g]=D();e.rc+=p,e.gc+=y,e.bc+=m,e.cnt++}return o}(e,o),d=c.length,f=d-1,h=new Uint32Array(d+1);for(var p=0,m=0;m<d;++m){const O=c[m];null!=O&&(E=1/O.cnt,u&&(O.ac*=E),O.rc*=E,O.gc*=E,O.bc*=E,c[p++]=O)}R(t)/p<.022&&(l=!1);for(var y,g,v,m=0;m<p-1;++m)c[m].fw=m+1,c[m+1].bk=m,l&&(c[m].cnt=Math.sqrt(c[m].cnt));l&&(c[m].cnt=Math.sqrt(c[m].cnt));for(m=0;m<p;++m){I(c,m,!1);var b=c[m].err;for(g=++h[0];1<g&&(v=g>>1,!(c[y=h[v]].err<=b));g=v)h[g]=y;h[g]=m}var j,_=p-t;for(m=0;m<_;){for(;;){var x=h[1];if((j=c[x]).tm>=j.mtm&&c[j.nn].mtm<=j.tm)break;j.mtm==f?x=h[1]=h[h[0]--]:(I(c,x,!1),j.tm=m);b=c[x].err;for(g=1;(v=g+g)<=h[0]&&(v<h[0]&&c[h[v]].err>c[h[v+1]].err&&v++,!(b<=c[y=h[v]].err));g=v)h[g]=y;h[g]=x}var w=c[j.nn],S=j.cnt,M=w.cnt,E=1/(S+M);u&&(j.ac=E*(S*j.ac+M*w.ac)),j.rc=E*(S*j.rc+M*w.rc),j.gc=E*(S*j.gc+M*w.gc),j.bc=E*(S*j.bc+M*w.bc),j.cnt+=w.cnt,j.mtm=++m,c[w.bk].fw=w.fw,c[w.fw].bk=w.bk,w.mtm=f}let T=[];for(m=0;;0){let e=A(Math.round(c[m].rc),0,255),t=A(Math.round(c[m].gc),0,255),r=A(Math.round(c[m].bc),0,255),o=255;u&&(o=A(Math.round(c[m].ac),0,255),a&&(C="number"==typeof a?a:127,o=o<=C?0:255),n&&o<=i&&(e=t=r=s,o=0));var C=u?[e,t,r,o]:[e,t,r];if(function(t,r){for(let e=0;e<t.length;e++){var o=t[e],n=o[0]===r[0]&&o[1]===r[1]&&o[2]===r[2],o=!(4<=o.length&&4<=r.length)||o[3]===r[3];if(n&&o)return!0}return!1}(T,C)||T.push(C),0==(m=c[m].fw))break}return T},snapColorsToPalette:()=>function(r,o,e=5){if(r.length&&o.length){var n=r.map(e=>e.slice(0,3)),s=e*e,i=r[0].length;for(let t=0;t<o.length;t++){let e=o[t];e=e.length<i?[e[0],e[1],e[2],255]:e.length>i?e.slice(0,3):e.slice();var a=d(n,e.slice(0,3),u),l=a[0],a=a[1];0<a&&a<=s&&(r[l]=e)}}}};for(o in i)n(s,o,{get:i[o],enumerable:!0});var a={signature:"GIF",version:"89a",trailer:59,extensionIntroducer:33,applicationExtensionLabel:255,graphicControlExtensionLabel:249,imageSeparator:44,signatureSize:3,versionSize:3,globalColorTableFlagMask:128,colorResolutionMask:112,sortFlagMask:8,globalColorTableSizeMask:7,applicationIdentifierSize:8,applicationAuthCodeSize:3,disposalMethodMask:28,userInputFlagMask:2,transparentColorFlagMask:1,localColorTableFlagMask:128,interlaceFlagMask:64,idSortFlagMask:32,localColorTableSizeMask:7};function T(e=256){let n=0,s=new Uint8Array(e);return{get buffer(){return s.buffer},reset(){n=0},bytesView(){return s.subarray(0,n)},bytes(){return s.slice(0,n)},writeByte(e){i(n+1),s[n]=e,n++},writeBytes(t,r=0,o=t.length){i(n+o);for(let e=0;e<o;e++)s[n++]=t[e+r]},writeBytesView(e,t=0,r=e.byteLength){i(n+r),s.set(e.subarray(t,t+r),n),n+=r}};function i(e){var t=s.length;if(!(e<=t)){e=Math.max(e,t*(t<1048576?2:1.125)>>>0),0!=t&&(e=Math.max(e,256));const r=s;s=new Uint8Array(e),0<n&&s.set(r.subarray(0,n),0)}}}var C=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];var S=function(e,t,r,o,n=T(512),s=new Uint8Array(256),i=new Int32Array(5003),a=new Int32Array(5003)){var l=i.length,o=Math.max(2,o);s.fill(0),a.fill(0),i.fill(-1);let u=0,c=0;var d=o+1;const f=d;let h=!1,p=f,m=(1<<p)-1;var y=1<<d-1;const g=1+y;let v=2+y,b=0,j=r[0],_=0;for(let e=l;e<65536;e*=2)++_;_=8-_,n.writeByte(o),E(y);var x=r.length;for(let t=1;t<x;t++)e:{var w=r[t],S=(w<<12)+j;let e=w<<_^j;if(i[e]===S)j=a[e];else{for(var M=0===e?1:l-e;0<=i[e];)if((e-=M)<0&&(e+=l),i[e]===S){j=a[e];break e}E(j),j=w,v<4096?(a[e]=v++,i[e]=S):(i.fill(-1),v=2+y,h=!0,E(y))}}return E(j),E(g),n.writeByte(0),n.bytesView();function E(e){for(u&=C[c],0<c?u|=e<<c:u=e,c+=p;8<=c;)s[b++]=255&u,254<=b&&(n.writeByte(b),n.writeBytesView(s,0,b),b=0),u>>=8,c-=8;if((v>m||h)&&(h?(p=f,m=(1<<p)-1,h=!1):(++p,m=12===p?1<<p:(1<<p)-1)),e==g){for(;0<c;)s[b++]=255&u,254<=b&&(n.writeByte(b),n.writeBytesView(s,0,b),b=0),u>>=8,c-=8;0<b&&(n.writeByte(b),n.writeBytesView(s,0,b),b=0)}}};function k(e,t,r){return e<<8&63488|t<<2&992|r>>3}function L(e,t,r,o){return e>>4|240&t|(240&r)<<4|(240&o)<<8}function P(e,t,r){return e>>4<<8|240&t|r>>4}function A(e,t,r){return e<t?t:r<e?r:e}function R(e){return e*e}function I(e,t,r){var o=0,n=1e100;const s=e[t];for(var i=s.cnt,a=s.ac,l=s.rc,u=s.gc,c=s.bc,d=s.fw;0!=d;d=e[d].fw){var f,h=e[d],p=h.cnt,p=i*p/(i+p);n<=p||(f=0,r&&n<=(f+=p*R(h.ac-a))||n<=(f+=p*R(h.rc-l))||n<=(f+=p*R(h.gc-u))||n<=(f+=p*R(h.bc-c))||(n=f,o=d))}s.err=n,s.nn=o}function D(){return{ac:0,rc:0,gc:0,bc:0,cnt:0,nn:0,fw:0,bk:0,tm:0,mtm:0,err:0}}function u(e,t){for(var r=0,o=0;o<e.length;o++){var n=e[o]-t[o];r+=n*n}return r}function c(e,t){return 1<t?Math.round(e/t)*t:e}function v(e){return e*e}function l(t,r,o=u){let n=1/0,s=-1;for(let e=0;e<t.length;e++){var i=o(r,t[e]);i<n&&(n=i,s=e)}return s}function d(t,r,o=u){let n=1/0,s=-1;for(let e=0;e<t.length;e++){var i=o(r,t[e]);i<n&&(n=i,s=e)}return[s,n]}function f(e={}){const{initialCapacity:t=4096,auto:g=!0}=e,v=T(t);const b=new Uint8Array(256),j=new Int32Array(5003),_=new Int32Array(5003);let x=!1;return{reset(){v.reset(),x=!1},finish(){v.writeByte(a.trailer)},bytes(){return v.bytes()},bytesView(){return v.bytesView()},get buffer(){return v.buffer},get stream(){return v},writeHeader:w,writeFrame(e,t,r,o={}){var{transparent:n=!1,transparentIndex:s=0,delay:i=0,palette:a=null,repeat:l=0,colorDepth:u=8,dispose:c=-1}=o;let d=!1;if(g?x||(d=!0,w(),x=!0):d=Boolean(o.first),t=Math.max(0,Math.floor(t)),r=Math.max(0,Math.floor(r)),d){if(!a)throw new Error("First frame must include a { palette } option");var[o,f,h,p,m=8]=[v,t,r,a,u];p=U(p.length)-1,m=128|m-1<<4|p,E(o,f),E(o,h),o.writeBytes([m,0,0]),M(v,a),0<=l&&(p=v,f=l,p.writeByte(33),p.writeByte(255),p.writeByte(11),O(p,"NETSCAPE2.0"),p.writeByte(3),p.writeByte(1),E(p,f),p.writeByte(0))}var y,h=Math.round(i/10),o=v,m=c,l=h,f=n,p=s,i=(o.writeByte(33),o.writeByte(249),o.writeByte(4),p<0&&(p=0,f=!1),f=f?(y=1,2):y=0,0<=m&&(f=7&m),f<<=2,o.writeByte(0|f|y),E(o,l),o.writeByte(p||0),o.writeByte(0),Boolean(a)&&!d);c=v,n=t,s=r,y=i?a:null,c.writeByte(44),E(c,0),E(c,0),E(c,n),E(c,s),y?(n=U(y.length)-1,c.writeByte(128|n)):c.writeByte(0),i&&M(v,a),[l,o,s,n,c=8,i,a,e]=[v,e,t,r,u,b,j,_],S(s,n,o,c,l,i,a,e)}};function w(){O(v,"GIF89a")}}function M(r,o){var e=1<<U(o.length);for(let t=0;t<e;t++){let e=[0,0,0];t<o.length&&(e=o[t]),r.writeByte(e[0]),r.writeByte(e[1]),r.writeByte(e[2])}}function E(e,t){e.writeByte(255&t),e.writeByte(t>>8&255)}function O(e,t){for(var r=0;r<t.length;r++)e.writeByte(t.charCodeAt(r))}function U(e){return Math.max(Math.ceil(Math.log2(e)),1)}var h=f},{}],238:[function(e,t,r){r.read=function(e,t,r,o,n){var s,i,a=8*n-o-1,l=(1<<a)-1,u=l>>1,c=-7,d=r?n-1:0,f=r?-1:1,n=e[t+d];for(d+=f,s=n&(1<<-c)-1,n>>=-c,c+=a;0<c;s=256*s+e[t+d],d+=f,c-=8);for(i=s&(1<<-c)-1,s>>=-c,c+=o;0<c;i=256*i+e[t+d],d+=f,c-=8);if(0===s)s=1-u;else{if(s===l)return i?NaN:1/0*(n?-1:1);i+=Math.pow(2,o),s-=u}return(n?-1:1)*i*Math.pow(2,s-o)},r.write=function(e,t,r,o,n,s){var i,a,l=8*s-n-1,u=(1<<l)-1,c=u>>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,f=o?0:s-1,h=o?1:-1,s=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,i=u):(i=Math.floor(Math.log(t)/Math.LN2),t*(o=Math.pow(2,-i))<1&&(i--,o*=2),2<=(t+=1<=i+c?d/o:d*Math.pow(2,1-c))*o&&(i++,o/=2),u<=i+c?(a=0,i=u):1<=i+c?(a=(t*o-1)*Math.pow(2,n),i+=c):(a=t*Math.pow(2,c-1)*Math.pow(2,n),i=0));8<=n;e[r+f]=255&a,f+=h,a/=256,n-=8);for(i=i<<n|a,l+=n;0<l;e[r+f]=255&i,f+=h,i/=256,l-=8);e[r+f-h]|=128*s}},{}],239:[function(o,e,c){"use strict";var t;function y(e,t){return e.b===t.b&&e.a===t.a}function g(e,t){return e.b<t.b||e.b===t.b&&e.a<=t.a}function v(e,t,r){var o=t.b-e.b,n=r.b-t.b;return 0<o+n?o<n?t.a-e.a+o/(o+n)*(e.a-r.a):t.a-r.a+n/(o+n)*(r.a-e.a):0}function b(e,t,r){var o=t.b-e.b,n=r.b-t.b;return 0<o+n?(t.a-r.a)*o+(t.a-e.a)*n:0}function j(e,t){return e.a<t.a||e.a===t.a&&e.b<=t.b}function V(e,t,r){var o=t.a-e.a,n=r.a-t.a;return 0<o+n?o<n?t.b-e.b+o/(o+n)*(e.b-r.b):t.b-r.b+n/(o+n)*(r.b-e.b):0}function z(e,t,r){var o=t.a-e.a,n=r.a-t.a;return 0<o+n?(t.b-r.b)*o+(t.b-e.b)*n:0}function _(e,t,r,o){return(e=e<0?0:e)<=(r=r<0?0:r)?0===r?(t+o)/2:t+e/(e+r)*(o-t):o+r/(e+r)*(t-o)}function d(e){var t=s(e.b);return n(t,e.c),n(t.b,e.c),i(t,e.a),t}function x(e,t){var r=!1,o=!1;e!==t&&(t.a!==e.a&&(o=!0,E(t.a,e.a)),t.d!==e.d&&(r=!0,a(t.d,e.d)),M(t,e),o||(n(t,e.a),e.a.c=e),r||(i(t,e.d),e.d.a=e))}function m(e){var t=e.b,r=!1;e.d!==e.b.d&&(r=!0,a(e.d,e.b.d)),e.c===e?E(e.a,null):(e.b.d.a=e.b.e,e.a.c=e.c,M(e,e.b.e),r||i(e,e.d)),t.c===t?(E(t.a,null),a(t.d,null)):(e.d.a=t.b.e,t.a.c=t.c,M(t,t.b.e)),H(e)}function w(e){var t=s(e),r=t.b;return M(t,e.e),t.a=e.b.a,n(r,t.a),t.d=r.d=e.d,t=t.b,M(e.b,e.b.b.e),M(e.b,t),e.b.a=t.a,t.b.a.c=t.b,t.b.d=e.b.d,t.f=e.f,t.b.f=e.b.f,t}function S(e,t){var r=!1,o=s(e),n=o.b;return t.d!==e.d&&(r=!0,a(t.d,e.d)),M(o,e.e),M(n,t),o.a=e.b.a,n.a=t.a,o.d=n.d=e.d,e.d.a=n,r||i(o,e.d),o}function s(e){var t=new u,r=new u,o=e.b.h;return(((r.h=o).b.h=t).h=e).b.h=r,t.b=r,((t.c=t).e=r).b=t,(r.c=r).e=t}function M(e,t){var r=e.c,o=t.c;r.b.e=t,(o.b.e=e).c=o,t.c=r}function n(e,t){var r=t.f,o=new D(t,r);for(r.e=o,r=(t.f=o).c=e;r.a=o,(r=r.c)!==e;);}function i(e,t){var r=t.d,o=new te(t,r);for(r.b=o,(t.d=o).a=e,o.c=t.c,r=e;r.d=o,(r=r.e)!==e;);}function H(e){var t=e.h;e=e.b.h,(t.b.h=e).b.h=t}function E(e,t){for(var r=e.c,o=r;o.a=t,(o=o.c)!==r;);r=e.f,((o=e.e).f=r).e=o}function a(e,t){for(var r=e.a,o=r;o.d=t,(o=o.e)!==r;);r=e.d,((o=e.b).d=r).b=o}function W(e){var t=0;return Math.abs(e[1])>Math.abs(e[0])&&(t=1),t=Math.abs(e[2])>Math.abs(e[t])?2:t}function T(e,t){e.f+=t.f,e.b.f+=t.b.f}function f(e,t,r){return e=e.a,t=t.a,r=r.a,t.b.a===e?r.b.a===e?g(t.a,r.a)?b(r.b.a,t.a,r.a)<=0:0<=b(t.b.a,r.a,t.a):b(r.b.a,e,r.a)<=0:r.b.a===e?0<=b(t.b.a,e,t.a):(t=v(t.b.a,e,t.a),(e=v(r.b.a,e,r.a))<=t)}function C(e){e.a.i=null;var t=e.e;t.a.c=t.c,t.c.a=t.a,e.e=null}function O(e,t){m(e.a),e.c=!1,(e.a=t).i=e}function k(e){for(var t=e.a.a;(e=G(e)).a.a===t;);return e.c&&(O(e,t=S(B(e).a.b,e.a.e)),e=G(e)),e}function q(e,t,r){var o=new F;return o.a=r,o.e=p(e.f,t.e,o),r.i=o}function X(e,t){switch(e.s){case 100130:return 0!=(1&t);case 100131:return 0!==t;case 100132:return 0<t;case 100133:return t<0;case 100134:return 2<=t||t<=-2}return!1}function h(e){var t=e.a,r=t.d;r.c=e.d,r.a=t,C(e)}function L(e,t,r){for(t=(e=t).a;e!==r;){e.c=!1;var o=B(e),n=o.a;if(n.a!==t.a){if(!o.c){h(e);break}O(o,n=S(t.c.b,n.b))}t.c!==n&&(x(n.b.e,n),x(t,n)),h(e),t=o.a,e=o}return t}function P(e,t,r,o,n,s){for(var i=!0;q(e,t,r.b),(r=r.c)!==o;);for(null===n&&(n=B(t).a.b.c);(r=(o=B(t)).a.b).a===n.a;)r.c!==n&&(x(r.b.e,r),x(n.b.e,r)),o.f=t.f-r.f,o.d=X(e,o.f),t.b=!0,!i&&R(e,t)&&(T(r,n),C(t),m(n)),i=!1,t=o,n=r;t.b=!0,s&&J(e,t)}function Y(e,t,r,o,n){var s=[t.g[0],t.g[1],t.g[2]];t.d=null,t.d=e.o&&e.o(s,r,o,e.c)||null,null===t.d&&(n?e.n||(l(e,100156),e.n=!0):t.d=r[0])}function A(e,t,r){var o=[null,null,null,null];o[0]=t.a.d,o[1]=r.a.d,Y(e,t.a,o,[.5,.5,0,0],!1),x(t,r)}function Z(e,t,r,o,n){var s=Math.abs(t.b-e.b)+Math.abs(t.a-e.a),i=Math.abs(r.b-e.b)+Math.abs(r.a-e.a),a=n+1;o[n]=.5*i/(s+i),o[a]=.5*s/(s+i),e.g[0]+=o[n]*t.g[0]+o[a]*r.g[0],e.g[1]+=o[n]*t.g[1]+o[a]*r.g[1],e.g[2]+=o[n]*t.g[2]+o[a]*r.g[2]}function R(e,t){var r=B(t),o=t.a,n=r.a;if(g(o.a,n.a)){if(0<b(n.b.a,o.a,n.a))return;if(y(o.a,n.a)){if(o.a!==n.a){var r=e.e,s=o.a.h;if(0<=s){var i=(r=r.b).d,a=r.e,l=r.c,u=l[s];i[u]=i[r.a],(l[i[u]]=u)<=--r.a&&(u<=1||g(a[i[u>>1]],a[i[u]])?N:ue)(r,u),a[s]=null,l[s]=r.b,r.b=s}else for(r.c[-(s+1)]=null;0<r.a&&null===r.c[r.d[r.a-1]];)--r.a;A(e,n.b.e,o)}}else w(n.b),x(o,n.b.e),t.b=r.b=!0}else{if(b(o.b.a,n.a,o.a)<0)return;G(t).b=t.b=!0,w(o.b),x(n.b.e,o)}return 1}function Q(e,t){var r=B(t),o=t.a,n=r.a,s=o.a,i=n.a,a=o.b.a,l=n.b.a,u=new D;if(b(a,e.a,s),b(l,e.a,i),!(s===i||Math.min(s.a,a.a)>Math.max(i.a,l.a))){if(g(s,i)){if(0<b(l,s,i))return}else if(b(a,i,s)<0)return;var c,d,f=a,h=s,p=l,m=i;if(g(f,h)||(c=f,f=h,h=c),g(p,m)||(c=p,p=m,m=c),g(f,p)||(c=f,f=p,p=c,c=h,h=m,m=c),g(p,h)?g(h,m)?((c=v(f,p,h))+(d=v(p,h,m))<0&&(c=-c,d=-d),u.b=_(c,p.b,d,h.b)):((c=b(f,p,h))+(d=-b(f,m,h))<0&&(c=-c,d=-d),u.b=_(c,p.b,d,m.b)):u.b=(p.b+h.b)/2,j(f,h)||(c=f,f=h,h=c),j(p,m)||(c=p,p=m,m=c),j(f,p)||(c=f,f=p,p=c,c=h,h=m,m=c),j(p,h)?j(h,m)?((c=V(f,p,h))+(d=V(p,h,m))<0&&(c=-c,d=-d),u.a=_(c,p.a,d,h.a)):((c=z(f,p,h))+(d=-z(f,m,h))<0&&(c=-c,d=-d),u.a=_(c,p.a,d,m.a)):u.a=(p.a+h.a)/2,g(u,e.a)&&(u.b=e.a.b,u.a=e.a.a),f=g(s,i)?s:i,g(f,u)&&(u.b=f.b,u.a=f.a),y(u,s)||y(u,i))return R(e,t),0;if(!y(a,e.a)&&0<=b(a,e.a,u)||!y(l,e.a)&&b(l,e.a,u)<=0){if(l===e.a)w(o.b),x(n.b,o),o=B(t=k(t)).a,L(e,B(t),r),P(e,t,o.b.e,o,o,!0);else{if(a!==e.a)return 0<=b(a,e.a,u)&&(G(t).b=t.b=!0,w(o.b),o.a.b=e.a.b,o.a.a=e.a.a),void(b(l,e.a,u)<=0&&(t.b=r.b=!0,w(n.b),n.a.b=e.a.b,n.a.a=e.a.a));for(w(n.b),x(o.e,n.b.e),i=(s=r=t).a.b.a;(s=G(s)).a.b.a===i;);s=B(t=s).a.b.c,r.a=n.b.e,P(e,t,(n=L(e,r,null)).c,o.b.c,s,!0)}return 1}w(o.b),w(n.b),x(n.b.e,o),o.a.b=u.b,o.a.a=u.a,o.a.h=ne(e.e,o.a),o=o.a,n=[0,0,0,0],u=[s.d,a.d,i.d,l.d],o.g[0]=o.g[1]=o.g[2]=0,Z(o,s,a,n,0),Z(o,i,l,n,2),Y(e,o,u,n,!0),G(t).b=t.b=r.b=!0}}function J(e,t){for(var r=B(t);;){for(;r.b;)r=B(t=r);if(!t.b&&(null===(t=G(r=t))||!t.b))break;t.b=!1;var o=t.a,n=r.a;if(s=o.b.a!==n.b.a)e:{var s,i=B(s=t),a=s.a,l=i.a,u=void 0;if(g(a.b.a,l.b.a)){if(b(a.b.a,l.b.a,a.a)<0){s=!1;break e}G(s).b=s.b=!0,u=w(a),x(l.b,u),u.d.c=s.d}else{if(0<b(l.b.a,a.b.a,l.a)){s=!1;break e}s.b=i.b=!0,u=w(l),x(a.e,l.b),u.b.d.c=s.d}s=!0}if(s&&(r.c?(C(r),m(n),n=(r=B(t)).a):t.c&&(C(t),m(o),o=(t=G(r)).a)),o.a!==n.a)if(o.b.a===n.b.a||t.c||r.c||o.b.a!==e.a&&n.b.a!==e.a)R(e,t);else if(Q(e,t))break;o.a===n.a&&o.b.a===n.b.a&&(T(n,o),C(t),m(o),t=G(r))}}function K(e,t){var r=new F,o=d(e.b);o.a.b=4e150,o.a.a=t,o.b.a.b=-4e150,o.b.a.a=t,e.a=o.b.a,r.a=o,r.f=0,r.d=!1,r.c=!1,r.h=!0,r.b=!1,o=p(o=e.f,o.a,r),r.e=o}function $(e){this.a=new ee,this.b=e,this.c=f}function p(e,t,r){for(;null!==(t=t.c).b&&!e.c(e.b,t.b,r););return e=new ee(r,t.a,t),t.a.c=e,t.a=e}function ee(e,t,r){this.b=e||null,this.a=t||this,this.c=r||this}function r(){this.d=0,this.p=this.b=this.q=null,this.j=[0,0,0],this.s=100130,this.n=!1,this.o=this.a=this.e=this.f=null,this.m=!1,this.c=this.r=this.i=this.k=this.l=this.h=null}function I(e,t){if(e.d!==t)for(;e.d!==t;)if(e.d<t)switch(e.d){case 0:l(e,100151),e.u(null);break;case 1:l(e,100152),e.t()}else switch(e.d){case 2:l(e,100154),e.v();break;case 1:l(e,100153),e.w()}}function l(e,t){e.p&&e.p(t,e.c)}function te(e,t){this.b=e||this,this.d=t||this,this.a=null,this.c=!1}function u(){(this.h=this).i=this.d=this.a=this.e=this.c=this.b=null,this.f=0}function re(){this.c=new D,this.a=new te,this.b=new u,this.d=new u,this.b.b=this.d,this.d.b=this.b}function D(e,t){this.e=e||this,this.f=t||this,this.d=this.c=null,this.g=[0,0,0],this.h=this.a=this.b=0}function oe(){this.c=[],this.d=null,this.a=0,this.e=!1,this.b=new ie}function ne(e,t){var r,o,n;return e.e?(2*(o=++(r=e.b).a)>r.f&&(r.f*=2,r.c=ae(r.c,r.f+1)),0===r.b?n=o:(n=r.b,r.b=r.c[r.b]),r.e[n]=t,r.c[n]=o,r.d[o]=n,r.h&&ue(r,o),n):(r=e.a++,e.c[r]=t,-(r+1))}function se(e){if(0===e.a)return le(e.b);var t=e.c[e.d[e.a-1]];if(0!==e.b.a&&g(U(e.b),t))return le(e.b);for(;--e.a,0<e.a&&null===e.c[e.d[e.a-1]];);return t}function ie(){this.d=ae([0],33),this.e=[null,null],this.c=[0,0],this.a=0,this.f=32,this.b=0,this.h=!1,this.d[1]=1}function ae(e,t){for(var r=Array(t),o=0;o<e.length;o++)r[o]=e[o];for(;o<t;o++)r[o]=0;return r}function U(e){return e.e[e.d[1]]}function le(e){var t=e.d,r=e.e,o=e.c,n=t[1],s=r[n];return 0<e.a&&(t[1]=t[e.a],o[t[1]]=1,r[n]=null,o[n]=e.b,e.b=n,0<--e.a&&N(e,1)),s}function N(e,t){for(var r=e.d,o=e.e,n=e.c,s=t,i=r[s];;){var a=s<<1,l=(a<e.a&&g(o[r[a+1]],o[r[a]])&&(a+=1),r[a]);if(a>e.a||g(o[i],o[l])){n[r[s]=i]=s;break}n[r[s]=l]=s,s=a}}function ue(e,t){for(var r=e.d,o=e.e,n=e.c,s=t,i=r[s];;){var a=s>>1,l=r[a];if(0==a||g(o[l],o[i])){n[r[s]=i]=s;break}n[r[s]=l]=s,s=a}}function F(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function B(e){return e.e.c.b}function G(e){return e.e.a.b}(t=r.prototype).x=function(){I(this,0)},t.B=function(e,t){switch(e){case 100142:return;case 100140:switch(t){case 100130:case 100131:case 100132:case 100133:case 100134:return void(this.s=t)}break;case 100141:return void(this.m=!!t);default:return void l(this,100900)}l(this,100901)},t.y=function(e){switch(e){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:l(this,100900)}return!1},t.A=function(e,t,r){this.j[0]=e,this.j[1]=t,this.j[2]=r},t.z=function(e,t){var r=t||null;switch(e){case 100100:case 100106:this.h=r;break;case 100104:case 100110:this.l=r;break;case 100101:case 100107:this.k=r;break;case 100102:case 100108:this.i=r;break;case 100103:case 100109:this.p=r;break;case 100105:case 100111:this.o=r;break;case 100112:this.r=r;break;default:l(this,100900)}},t.C=function(e,t){var r=!1,o=[0,0,0];I(this,2);for(var n=0;n<3;++n){var s=e[n];s<-1e150&&(s=-1e150,r=!0),1e150<s&&(s=1e150,r=!0),o[n]=s}r&&l(this,100155),null===(r=this.q)?x(r=d(this.b),r.b):(w(r),r=r.e),r.a.d=t,r.a.g[0]=o[0],r.a.g[1]=o[1],r.a.g[2]=o[2],r.f=1,r.b.f=-1,this.q=r},t.u=function(e){I(this,0),this.d=1,this.b=new re,this.c=e},t.t=function(){I(this,1),this.d=2,this.q=null},t.v=function(){I(this,2),this.d=1},t.w=function(){I(this,1),this.d=0;var e,t,r=this.j[0],o=this.j[1],n=this.j[2],s=!1,i=[r,o,n];if(0===r&&0===o&&0===n){for(var o=[-2e150,-2e150,-2e150],a=[2e150,2e150,2e150],n=[],l=[],r=(s=this.b.c).e;r!==s;r=r.e)for(var u=0;u<3;++u){var c=r.g[u];c<a[u]&&(a[u]=c,l[u]=r),c>o[u]&&(o[u]=c,n[u]=r)}if(o[1]-a[1]>o[r=0]-a[0]&&(r=1),a[r=o[2]-a[2]>o[r]-a[r]?2:r]>=o[r])i[0]=0,i[1]=0,i[2]=1;else{for(a=l[r],n=n[r],l=[o=0,0,0],a=[a.g[0]-n.g[0],a.g[1]-n.g[1],a.g[2]-n.g[2]],u=[0,0,0],r=s.e;r!==s;r=r.e)u[0]=r.g[0]-n.g[0],u[1]=r.g[1]-n.g[1],u[2]=r.g[2]-n.g[2],l[0]=a[1]*u[2]-a[2]*u[1],l[1]=a[2]*u[0]-a[0]*u[2],l[2]=a[0]*u[1]-a[1]*u[0],o<(c=l[0]*l[0]+l[1]*l[1]+l[2]*l[2])&&(o=c,i[0]=l[0],i[1]=l[1],i[2]=l[2]);o<=0&&(i[0]=i[1]=i[2]=0,i[W(a)]=1)}s=!0}for(l=W(i),r=this.b.c,o=(l+1)%3,n=(l+2)%3,l=0<i[l]?1:-1,i=r.e;i!==r;i=i.e)i.b=i.g[o],i.a=l*i.g[n];if(s){for(i=0,r=(s=this.b.a).b;r!==s;r=r.b)if(!((o=r.a).f<=0))for(;i+=(o.a.b-o.b.a.b)*(o.a.a+o.b.a.a),(o=o.e)!==r.a;);if(i<0)for(s=(i=this.b.c).e;s!==i;s=s.e)s.a=-s.a}for(this.n=!1,i=this.b.b,r=i.h;r!==i;r=s)s=r.h,o=r.e,y(r.a,r.b.a)&&r.e.e!==r&&(A(this,o,r),m(r),o=(r=o).e),o.e===r&&(o!==r&&(o!==s&&o!==s.b||(s=s.h),m(o)),r!==s&&r!==s.b||(s=s.h),m(r));for(this.e=i=new oe,s=this.b.c,r=s.e;r!==s;r=r.e)r.h=ne(i,r);var d=i;d.d=[];for(var f=0;f<d.a;f++)d.d[f]=f;d.d.sort(function(r){return function(e,t){return g(r[e],r[t])?1:-1}}(d.c)),d.e=!0;for(var h=d.b,p=h.a;1<=p;--p)N(h,p);for(h.h=!0,this.f=new $(this),K(this,-4e150),K(this,4e150);null!==(i=se(this.e));){for(;;){e:if(0===(r=this.e).a)s=U(r.b);else if(s=r.c[r.d[r.a-1]],0!==r.b.a&&g(r=U(r.b),s)){s=r;break e}if(null===s||!y(s,i))break;s=se(this.e),A(this,i.c,s.c)}!function e(t,r){for(var o,n=(t.a=r).c;null===n.i;)if((n=n.c)===r.c){var n=t,s=r;(c=new F).a=s.c.b;for(var i=(a=n.f).a;null!==(i=i.a).b&&!a.c(a.b,c,i.b););var a,l,u=B(a=i.b),c=a.a,i=u.a;return void(0===b(c.b.a,s,c.a)?y((c=a.a).a,s)||y(c.b.a,s)||(w(c.b),a.c&&(m(c.c),a.c=!1),x(s.c,c),e(n,s)):(l=g(i.b.a,c.b.a)?a:u,u=void 0,a.d||l.c?(u=l===a?S(s.c.b,c.e):S(i.b.c.b,s.c).b,l.c?O(l,u):((a=q(c=n,a,u)).f=G(a).f+a.a.f,a.d=X(c,a.f)),e(n,s)):P(n,a,s.c,s.c,null,!0)))}a=(c=B(n=k(n.i))).a,(c=L(t,c,null)).c===a?(c=(a=c).c,i=B(n),u=n.a,l=i.a,o=!1,u.b.a!==l.b.a&&Q(t,n),y(u.a,t.a)&&(x(c.b.e,u),c=B(n=k(n)).a,L(t,B(n),i),o=!0),y(l.a,t.a)&&(x(a,l.b.e),a=L(t,i,null),o=!0),o?P(t,n,a.c,c,c,!0):(s=g(l.a,u.a)?l.b.e:u,P(t,n,s=S(a.c.b,s),s.c,s.c,!1),s.b.i.c=!0,J(t,n))):P(t,n,c.c,a,a,!0)}(this,i)}for(this.a=this.f.a.a.b.a.a,i=0;null!==(s=this.f.a.a.b);)s.h||++i,C(s);for(this.f=null,(i=this.e).b=null,i.d=null,this.e=i.c=null,i=this.b,r=i.a.b;r!==i.a;r=s)s=r.b,(r=r.a).e.e===r&&(T(r.c,r),m(r));if(!this.n){if(i=this.b,this.m)for(r=i.b.h;r!==i.b;r=s)s=r.h,r.b.d.c!==r.d.c?r.f=r.d.c?1:-1:m(r);else for(r=i.a.b;r!==i.a;r=s)if(s=r.b,r.c){for(r=r.a;g(r.b.a,r.a);r=r.c.b);for(;g(r.a,r.b.a);r=r.e);for(o=r.c.b,n=void 0;r.e!==o;)if(g(r.b.a,o.a)){for(;o.e!==r&&(g((t=o.e).b.a,t.a)||b(o.a,o.b.a,o.e.b.a)<=0);)o=(n=S(o.e,o)).b;o=o.c.b}else{for(;o.e!==r&&(g((e=r.c.b).a,e.b.a)||0<=b(r.b.a,r.a,r.c.b.a));)r=(n=S(r,r.c.b)).b;r=r.e}for(;o.e.e!==r;)n=S(o.e,o),o=n.b}if(this.h||this.i||this.k||this.l)if(this.m){for(s=(i=this.b).a.b;s!==i.a;s=s.b)if(s.c){for(this.h&&this.h(2,this.c),r=s.a;this.k&&this.k(r.a.d,this.c),(r=r.e)!==s.a;);this.i&&this.i(this.c)}}else{for(i=this.b,s=!!this.l,r=!1,o=-1,n=i.a.d;n!==i.a;n=n.d)if(n.c)for(r||(this.h&&this.h(4,this.c),r=!0),l=n.a;s&&(a=l.b.d.c?0:1,o!==a&&(o=a,this.l&&this.l(!!o,this.c))),this.k&&this.k(l.a.d,this.c),(l=l.e)!==n.a;);r&&this.i&&this.i(this.c)}if(this.r){for(i=this.b,r=i.a.b;r!==i.a;r=s)if(s=r.b,!r.c){for(n=(o=r.a).e,l=void 0;n=(l=n).e,(l.d=null)===l.b.d&&(l.c===l?E(l.a,null):(l.a.c=l.c,M(l,l.b.e)),(a=l.b).c===a?E(a.a,null):(a.a.c=a.c,M(a,a.b.e)),H(l)),l!==o;);o=r.d,((r=r.b).d=o).b=r}return this.r(this.b),void(this.c=this.b=null)}}this.b=this.c=null},this.libtess={GluTesselator:r,windingRule:{GLU_TESS_WINDING_ODD:100130,GLU_TESS_WINDING_NONZERO:100131,GLU_TESS_WINDING_POSITIVE:100132,GLU_TESS_WINDING_NEGATIVE:100133,GLU_TESS_WINDING_ABS_GEQ_TWO:100134},primitiveType:{GL_LINE_LOOP:2,GL_TRIANGLES:4,GL_TRIANGLE_STRIP:5,GL_TRIANGLE_FAN:6},errorType:{GLU_TESS_MISSING_BEGIN_POLYGON:100151,GLU_TESS_MISSING_END_POLYGON:100153,GLU_TESS_MISSING_BEGIN_CONTOUR:100152,GLU_TESS_MISSING_END_CONTOUR:100154,GLU_TESS_COORD_TOO_LARGE:100155,GLU_TESS_NEED_COMBINE_CALLBACK:100156},gluEnum:{GLU_TESS_MESH:100112,GLU_TESS_TOLERANCE:100142,GLU_TESS_WINDING_RULE:100140,GLU_TESS_BOUNDARY_ONLY:100141,GLU_INVALID_ENUM:100900,GLU_INVALID_VALUE:100901,GLU_TESS_BEGIN:100100,GLU_TESS_VERTEX:100101,GLU_TESS_END:100102,GLU_TESS_ERROR:100103,GLU_TESS_EDGE_FLAG:100104,GLU_TESS_COMBINE:100105,GLU_TESS_BEGIN_DATA:100106,GLU_TESS_VERTEX_DATA:100107,GLU_TESS_END_DATA:100108,GLU_TESS_ERROR_DATA:100109,GLU_TESS_EDGE_FLAG_DATA:100110,GLU_TESS_COMBINE_DATA:100111}},r.prototype.gluDeleteTess=r.prototype.x,r.prototype.gluTessProperty=r.prototype.B,r.prototype.gluGetTessProperty=r.prototype.y,r.prototype.gluTessNormal=r.prototype.A,r.prototype.gluTessCallback=r.prototype.z,r.prototype.gluTessVertex=r.prototype.C,r.prototype.gluTessBeginPolygon=r.prototype.u,r.prototype.gluTessBeginContour=r.prototype.t,r.prototype.gluTessEndContour=r.prototype.v,r.prototype.gluTessEndPolygon=r.prototype.w,void 0!==e&&(e.exports=this.libtess)},{}],240:[function(e,t,r){"use strict";function o(g,e,t,r){var v=0,o=void 0===(r=void 0===r?{}:r).loop?null:r.loop,b=void 0===r.palette?null:r.palette;if(e<=0||t<=0||65535<e||65535<t)throw new Error("Width/Height invalid.");function j(e){e=e.length;if(e<2||256<e||e&e-1)throw new Error("Invalid code/color length, must be power of 2 and 2 .. 256.");return e}g[v++]=71,g[v++]=73,g[v++]=70,g[v++]=56,g[v++]=57,g[v++]=97;var n=0,s=0;if(null!==b){for(var i=j(b);i>>=1;)++n;if(i=1<<n,--n,void 0!==r.background){if(i<=(s=r.background))throw new Error("Background index out of range.");if(0===s)throw new Error("Background index explicitly passed as 0.")}}if(g[v++]=255&e,g[v++]=e>>8&255,g[v++]=255&t,g[v++]=t>>8&255,g[v++]=(null!==b?128:0)|n,g[v++]=s,g[v++]=0,null!==b)for(var a=0,l=b.length;a<l;++a){var u=b[a];g[v++]=u>>16&255,g[v++]=u>>8&255,g[v++]=255&u}if(null!==o){if(o<0||65535<o)throw new Error("Loop count invalid.");g[v++]=33,g[v++]=255,g[v++]=11,g[v++]=78,g[v++]=69,g[v++]=84,g[v++]=83,g[v++]=67,g[v++]=65,g[v++]=80,g[v++]=69,g[v++]=50,g[v++]=46,g[v++]=48,g[v++]=3,g[v++]=1,g[v++]=255&o,g[v++]=o>>8&255,g[v++]=0}var _=!1;this.addFrame=function(e,t,r,o,n,s){if(!0===_&&(--v,_=!1),s=void 0===s?{}:s,e<0||t<0||65535<e||65535<t)throw new Error("x/y invalid.");if(r<=0||o<=0||65535<r||65535<o)throw new Error("Width/Height invalid.");if(n.length<r*o)throw new Error("Not enough pixels for the frame size.");var i=!0,a=s.palette;if(null==a&&(i=!1,a=b),null==a)throw new Error("Must supply either a local or global palette.");for(var l=j(a),u=0;l>>=1;)++u;var l=1<<u,c=void 0===s.delay?0:s.delay,d=void 0===s.disposal?0:s.disposal;if(d<0||3<d)throw new Error("Disposal out of range.");var f=!1,h=0;if(void 0!==s.transparent&&null!==s.transparent&&(f=!0,(h=s.transparent)<0||l<=h))throw new Error("Transparent color index.");if(0===d&&!f&&0===c||(g[v++]=33,g[v++]=249,g[v++]=4,g[v++]=d<<2|(!0===f?1:0),g[v++]=255&c,g[v++]=c>>8&255,g[v++]=h,g[v++]=0),g[v++]=44,g[v++]=255&e,g[v++]=e>>8&255,g[v++]=255&t,g[v++]=t>>8&255,g[v++]=255&r,g[v++]=r>>8&255,g[v++]=255&o,g[v++]=o>>8&255,g[v++]=!0===i?128|u-1:0,!0===i)for(var p=0,m=a.length;p<m;++p){var y=a[p];g[v++]=y>>16&255,g[v++]=y>>8&255,g[v++]=255&y}return v=function(t,r,e,o){t[r++]=e;var n=r++,s=1<<e,i=s-1,a=1+s,l=1+a,u=e+1,c=0,d=0;function f(e){for(;e<=c;)t[r++]=255&d,d>>=8,c-=8,r===n+256&&(t[n]=255,n=r++)}function h(e){d|=e<<c,c+=u,f(8)}var p=o[0]&i,m={};h(s);for(var y=1,g=o.length;y<g;++y){var v=o[y]&i,b=p<<8|v,j=m[b];if(void 0===j){for(d|=p<<c,c+=u;8<=c;)t[r++]=255&d,d>>=8,c-=8,r===n+256&&(t[n]=255,n=r++);4096===l?(h(s),l=1+a,u=e+1,m={}):(1<<u<=l&&++u,m[b]=l++),p=v}else p=j}h(p),h(a),f(1),n+1===r?t[n]=0:(t[n]=r-n-1,t[r++]=0);return r}(g,v,u<2?2:u,n)},this.end=function(){return!1===_&&(g[v++]=59,_=!0),v},this.getOutputBuffer=function(){return g},this.setOutputBuffer=function(e){g=e},this.getOutputBufferPosition=function(){return v},this.setOutputBufferPosition=function(e){v=e}}function E(e,t,r,o){for(var n=e[t++],s=1<<n,i=1+s,a=1+i,l=n+1,u=(1<<l)-1,c=0,d=0,f=0,h=e[t++],p=new Int32Array(4096),m=null;;){for(;c<16&&0!==h;)d|=e[t++]<<c,c+=8,1===h?h=e[t++]:--h;if(c<l)break;var y=d&u;if(d>>=l,c-=l,y==s)a=1+i,u=(1<<(l=n+1))-1,m=null;else{if(y==i)break;for(var g=y<a?y:m,v=0,b=g;s<b;)b=p[b]>>8,++v;var j=b;if(o<f+v+(g!==y?1:0))return void console.log("Warning, gif stream longer than expected.");r[f++]=j;var _=f+=v;for(g!==y&&(r[f++]=j),b=g;v--;)b=p[b],r[--_]=255&b,b>>=8;null!==m&&a<4096&&(p[a++]=m<<8|j,u+1<=a&&l<12&&(++l,u=u<<1|1)),m=y}}f!==o&&console.log("Warning, gif stream shorter than expected.")}try{r.GifWriter=o,r.GifReader=function(b){var e=0;if(71!==b[e++]||73!==b[e++]||70!==b[e++]||56!==b[e++]||56!=(b[e++]+1&253)||97!==b[e++])throw new Error("Invalid GIF 87a/89a header.");var j=b[e++]|b[e++]<<8,t=b[e++]|b[e++]<<8,r=b[e++],o=1<<1+(7&r),n=(b[e++],b[e++],null),s=null,i=(r>>7&&(n=e,e+=3*(s=o)),!0),a=[],l=0,u=null,c=0,d=null;for(this.width=j,this.height=t;i&&e<b.length;)switch(b[e++]){case 33:switch(b[e++]){case 255:if(11!==b[e]||78==b[e+1]&&69==b[e+2]&&84==b[e+3]&&83==b[e+4]&&67==b[e+5]&&65==b[e+6]&&80==b[e+7]&&69==b[e+8]&&50==b[e+9]&&46==b[e+10]&&48==b[e+11]&&3==b[e+12]&&1==b[e+13]&&0==b[e+16])e+=14,d=b[e++]|b[e++]<<8,e++;else for(e+=12;;){if(!(0<=(h=b[e++])))throw Error("Invalid block size");if(0===h)break;e+=h}break;case 249:if(4!==b[e++]||0!==b[e+4])throw new Error("Invalid graphics extension block.");var f=b[e++],l=b[e++]|b[e++]<<8,u=b[e++];0==(1&f)&&(u=null),c=f>>2&7,e++;break;case 254:for(;;){if(!(0<=(h=b[e++])))throw Error("Invalid block size");if(0===h)break;e+=h}break;default:throw new Error("Unknown graphic control label: 0x"+b[e-1].toString(16))}break;case 44:var h,p=b[e++]|b[e++]<<8,m=b[e++]|b[e++]<<8,y=b[e++]|b[e++]<<8,g=b[e++]|b[e++]<<8,v=b[e++],_=v>>6&1,x=1<<1+(7&v),w=n,S=s,M=!1,v=(v>>7&&(M=!0,w=e,e+=3*(S=x)),e);for(e++;;){if(!(0<=(h=b[e++])))throw Error("Invalid block size");if(0===h)break;e+=h}a.push({x:p,y:m,width:y,height:g,has_local_palette:M,palette_offset:w,palette_size:S,data_offset:v,data_length:e-v,transparent_index:u,interlaced:!!_,delay:l,disposal:c});break;case 59:i=!1;break;default:throw new Error("Unknown gif block: 0x"+b[e-1].toString(16))}this.numFrames=function(){return a.length},this.loopCount=function(){return d},this.frameInfo=function(e){if(e<0||e>=a.length)throw new Error("Frame index out of range.");return a[e]},this.decodeAndBlitFrameBGRA=function(e,t){for(var e=this.frameInfo(e),r=e.width*e.height,o=new Uint8Array(r),n=(E(b,e.data_offset,o,r),e.palette_offset),s=e.transparent_index,i=(null===s&&(s=256),e.width),a=j-i,l=i,u=4*(e.y*j+e.x),c=4*((e.y+e.height)*j+e.x),d=u,f=4*a,h=(!0===e.interlaced&&(f+=4*j*7),8),p=0,m=o.length;p<m;++p){var y,g,v=o[p];0===l&&(l=i,c<=(d+=f)&&(f=4*a+4*j*(h-1),d=u+(i+a)*(h<<1),h>>=1)),v===s?d+=4:(y=b[n+3*v],g=b[n+3*v+1],v=b[n+3*v+2],t[d++]=v,t[d++]=g,t[d++]=y,t[d++]=255),--l}},this.decodeAndBlitFrameRGBA=function(e,t){for(var e=this.frameInfo(e),r=e.width*e.height,o=new Uint8Array(r),n=(E(b,e.data_offset,o,r),e.palette_offset),s=e.transparent_index,i=(null===s&&(s=256),e.width),a=j-i,l=i,u=4*(e.y*j+e.x),c=4*((e.y+e.height)*j+e.x),d=u,f=4*a,h=(!0===e.interlaced&&(f+=4*j*7),8),p=0,m=o.length;p<m;++p){var y,g,v=o[p];0===l&&(l=i,c<=(d+=f)&&(f=4*a+4*j*(h-1),d=u+(i+a)*(h<<1),h>>=1)),v===s?d+=4:(y=b[n+3*v],g=b[n+3*v+1],v=b[n+3*v+2],t[d++]=y,t[d++]=g,t[d++]=v,t[d++]=255),--l}}}}catch(e){}},{}],241:[function(Pr,r,o){!function(Lr){var e,t;e=this,t=function(j){"use strict";function D(e){if(null==this)throw TypeError();var t,r=String(this),o=r.length,e=e?Number(e):0;if(!((e=e!=e?0:e)<0||o<=e))return 55296<=(t=r.charCodeAt(e))&&t<=56319&&e+1<o&&56320<=(o=r.charCodeAt(e+1))&&o<=57343?1024*(t-55296)+o-56320+65536:t}String.prototype.codePointAt||((U=function(){try{var e={},t=Object.defineProperty,r=t(e,e,e)&&t}catch(e){}return r}())?U(String.prototype,"codePointAt",{value:D,configurable:!0,writable:!0}):String.prototype.codePointAt=D);var U,N=0,F=-3;function B(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function G(e,t){this.source=e,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=t,this.destLen=0,this.ltree=new B,this.dtree=new B}var V=new B,z=new B,H=new Uint8Array(30),W=new Uint16Array(30),q=new Uint8Array(30),X=new Uint16Array(30),Y=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Z=new B,v=new Uint8Array(320);function Q(e,t,r,o){for(var n,s=0;s<r;++s)e[s]=0;for(s=0;s<30-r;++s)e[s+r]=s/r|0;for(n=o,s=0;s<30;++s)t[s]=n,n+=1<<e[s]}var J=new Uint16Array(16);function K(e,t,r,o){for(var n,s=0;s<16;++s)e.table[s]=0;for(s=0;s<o;++s)e.table[t[r+s]]++;for(s=n=e.table[0]=0;s<16;++s)J[s]=n,n+=e.table[s];for(s=0;s<o;++s)t[r+s]&&(e.trans[J[t[r+s]]++]=s)}function b(e,t,r){if(!t)return r;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var o=e.tag&65535>>>16-t;return e.tag>>>=t,e.bitcount-=t,o+r}function $(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;for(var r=0,o=0,n=0,s=e.tag;o=2*o+(1&s),s>>>=1,r+=t.table[++n],0<=(o-=t.table[n]););return e.tag=s,e.bitcount-=n,t.trans[r+o]}function ee(e,t,r){for(;;){var o=$(e,t);if(256===o)return N;if(o<256)e.dest[e.destLen++]=o;else for(var n,s=b(e,H[o-=257],W[o]),o=$(e,r),i=n=e.destLen-b(e,q[o],X[o]);i<n+s;++i)e.dest[e.destLen++]=e.dest[i]}}for(var e=V,te=z,t=0;t<7;++t)e.table[t]=0;for(e.table[7]=24,e.table[8]=152,e.table[9]=112,t=0;t<24;++t)e.trans[t]=256+t;for(t=0;t<144;++t)e.trans[24+t]=t;for(t=0;t<8;++t)e.trans[168+t]=280+t;for(t=0;t<112;++t)e.trans[176+t]=144+t;for(t=0;t<5;++t)te.table[t]=0;for(te.table[5]=32,t=0;t<32;++t)te.trans[t]=t;Q(H,W,4,3),Q(q,X,2,1),H[28]=0,W[28]=258;var re=function(e,t){var r,o,n,s=new G(e,t);do{switch(n=void 0,(o=s).bitcount--||(o.tag=o.source[o.sourceIndex++],o.bitcount=7),n=1&o.tag,o.tag>>>=1,o=n,b(s,2,0)){case 0:r=function(e){for(var t,r;8<e.bitcount;)e.sourceIndex--,e.bitcount-=8;if((t=256*e.source[e.sourceIndex+1]+e.source[e.sourceIndex])!==(65535&~(256*e.source[e.sourceIndex+3]+e.source[e.sourceIndex+2])))return F;for(e.sourceIndex+=4,r=t;r;--r)e.dest[e.destLen++]=e.source[e.sourceIndex++];return e.bitcount=0,N}(s);break;case 1:r=ee(s,V,z);break;case 2:y=m=p=g=i=h=f=d=c=u=l=a=void 0;for(var i,a=s,l=s.ltree,u=s.dtree,c=b(a,5,257),d=b(a,5,1),f=b(a,4,4),h=0;h<19;++h)v[h]=0;for(h=0;h<f;++h){var p=b(a,3,0);v[Y[h]]=p}for(K(Z,v,0,19),i=0;i<c+d;){var m=$(a,Z);switch(m){case 16:for(var y=v[i-1],g=b(a,2,3);g;--g)v[i++]=y;break;case 17:for(g=b(a,3,3);g;--g)v[i++]=0;break;case 18:for(g=b(a,7,11);g;--g)v[i++]=0;break;default:v[i++]=m}}K(l,v,0,c),K(u,v,c,d),r=ee(s,s.ltree,s.dtree);break;default:r=F}if(r!==N)throw new Error("Data error")}while(!o);return s.destLen<s.dest.length?"function"==typeof s.dest.slice?s.dest.slice(0,s.destLen):s.dest.subarray(0,s.destLen):s.dest};function g(e,t,r,o,n){return Math.pow(1-n,3)*e+3*Math.pow(1-n,2)*n*t+3*(1-n)*Math.pow(n,2)*r+Math.pow(n,3)*o}function a(){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN}function f(){this.commands=[],this.fill="black",this.stroke=null,this.strokeWidth=1}function oe(e){throw new Error(e)}function ne(e,t){e||oe(t)}a.prototype.isEmpty=function(){return isNaN(this.x1)||isNaN(this.y1)||isNaN(this.x2)||isNaN(this.y2)},a.prototype.addPoint=function(e,t){"number"==typeof e&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=e,this.x2=e),e<this.x1&&(this.x1=e),e>this.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),t<this.y1&&(this.y1=t),t>this.y2&&(this.y2=t))},a.prototype.addX=function(e){this.addPoint(e,null)},a.prototype.addY=function(e){this.addPoint(null,e)},a.prototype.addBezier=function(e,t,r,o,n,s,i,a){var l=[e,t],u=[r,o],c=[n,s],d=[i,a];this.addPoint(e,t),this.addPoint(i,a);for(var f=0;f<=1;f++){var h,p=6*l[f]-12*u[f]+6*c[f],m=-3*l[f]+9*u[f]-9*c[f]+3*d[f],y=3*u[f]-3*l[f];0==m?0==p||0<(h=-y/p)&&h<1&&(0===f&&this.addX(g(l[f],u[f],c[f],d[f],h)),1===f&&this.addY(g(l[f],u[f],c[f],d[f],h))):(h=Math.pow(p,2)-4*y*m)<0||(0<(y=(-p+Math.sqrt(h))/(2*m))&&y<1&&(0===f&&this.addX(g(l[f],u[f],c[f],d[f],y)),1===f&&this.addY(g(l[f],u[f],c[f],d[f],y))),0<(y=(-p-Math.sqrt(h))/(2*m))&&y<1&&(0===f&&this.addX(g(l[f],u[f],c[f],d[f],y)),1===f&&this.addY(g(l[f],u[f],c[f],d[f],y))))}},a.prototype.addQuad=function(e,t,r,o,n,s){r=e+2/3*(r-e),o=t+2/3*(o-t);this.addBezier(e,t,r,o,r+1/3*(n-e),o+1/3*(s-t),n,s)},f.prototype.moveTo=function(e,t){this.commands.push({type:"M",x:e,y:t})},f.prototype.lineTo=function(e,t){this.commands.push({type:"L",x:e,y:t})},f.prototype.curveTo=f.prototype.bezierCurveTo=function(e,t,r,o,n,s){this.commands.push({type:"C",x1:e,y1:t,x2:r,y2:o,x:n,y:s})},f.prototype.quadTo=f.prototype.quadraticCurveTo=function(e,t,r,o){this.commands.push({type:"Q",x1:e,y1:t,x:r,y:o})},f.prototype.close=f.prototype.closePath=function(){this.commands.push({type:"Z"})},f.prototype.extend=function(e){var t;if(e.commands)e=e.commands;else if(e instanceof a)return t=e,this.moveTo(t.x1,t.y1),this.lineTo(t.x2,t.y1),this.lineTo(t.x2,t.y2),this.lineTo(t.x1,t.y2),void this.close();Array.prototype.push.apply(this.commands,e)},f.prototype.getBoundingBox=function(){for(var e=new a,t=0,r=0,o=0,n=0,s=0;s<this.commands.length;s++){var i=this.commands[s];switch(i.type){case"M":e.addPoint(i.x,i.y),t=o=i.x,r=n=i.y;break;case"L":e.addPoint(i.x,i.y),o=i.x,n=i.y;break;case"Q":e.addQuad(o,n,i.x1,i.y1,i.x,i.y),o=i.x,n=i.y;break;case"C":e.addBezier(o,n,i.x1,i.y1,i.x2,i.y2,i.x,i.y),o=i.x,n=i.y;break;case"Z":o=t,n=r;break;default:throw new Error("Unexpected path command "+i.type)}}return e.isEmpty()&&e.addPoint(0,0),e},f.prototype.draw=function(e){e.beginPath();for(var t=0;t<this.commands.length;t+=1){var r=this.commands[t];"M"===r.type?e.moveTo(r.x,r.y):"L"===r.type?e.lineTo(r.x,r.y):"C"===r.type?e.bezierCurveTo(r.x1,r.y1,r.x2,r.y2,r.x,r.y):"Q"===r.type?e.quadraticCurveTo(r.x1,r.y1,r.x,r.y):"Z"===r.type&&e.closePath()}this.fill&&(e.fillStyle=this.fill,e.fill()),this.stroke&&(e.strokeStyle=this.stroke,e.lineWidth=this.strokeWidth,e.stroke())},f.prototype.toPathData=function(n){function e(){for(var e=arguments,t="",r=0;r<arguments.length;r+=1){var o=e[r];0<=o&&0<r&&(t+=" "),t+=(o=o,Math.round(o)===o?""+Math.round(o):o.toFixed(n))}return t}n=void 0!==n?n:2;for(var t="",r=0;r<this.commands.length;r+=1){var o=this.commands[r];"M"===o.type?t+="M"+e(o.x,o.y):"L"===o.type?t+="L"+e(o.x,o.y):"C"===o.type?t+="C"+e(o.x1,o.y1,o.x2,o.y2,o.x,o.y):"Q"===o.type?t+="Q"+e(o.x1,o.y1,o.x,o.y):"Z"===o.type&&(t+="Z")}return t},f.prototype.toSVG=function(e){var t=(t='<path d="')+this.toPathData(e)+'"';return this.fill&&"black"!==this.fill&&(null===this.fill?t+=' fill="none"':t+=' fill="'+this.fill+'"'),this.stroke&&(t+=' stroke="'+this.stroke+'" stroke-width="'+this.strokeWidth+'"'),t+="/>"},f.prototype.toDOMElement=function(e){var e=this.toPathData(e),t=document.createElementNS("http://www.w3.org/2000/svg","path");return t.setAttribute("d",e),t};var A={fail:oe,argument:ne,assert:ne},m={},w={},l={};function r(e){return function(){return e}}w.BYTE=function(e){return A.argument(0<=e&&e<=255,"Byte value should be between 0 and 255."),[e]},l.BYTE=r(1),w.CHAR=function(e){return[e.charCodeAt(0)]},l.CHAR=r(1),w.CHARARRAY=function(e){for(var t=[],r=0;r<e.length;r+=1)t[r]=e.charCodeAt(r);return t},l.CHARARRAY=function(e){return e.length},w.USHORT=function(e){return[e>>8&255,255&e]},l.USHORT=r(2),w.SHORT=function(e){return[(e=32768<=e?-(65536-e):e)>>8&255,255&e]},l.SHORT=r(2),w.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},l.UINT24=r(3),w.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},l.ULONG=r(4),w.LONG=function(e){return[(e=2147483648<=e?-(4294967296-e):e)>>24&255,e>>16&255,e>>8&255,255&e]},l.LONG=r(4),w.FIXED=w.ULONG,l.FIXED=l.ULONG,w.FWORD=w.SHORT,l.FWORD=l.SHORT,w.UFWORD=w.USHORT,l.UFWORD=l.USHORT,w.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},l.LONGDATETIME=r(8),w.TAG=function(e){return A.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},l.TAG=r(4),w.Card8=w.BYTE,l.Card8=l.BYTE,w.Card16=w.USHORT,l.Card16=l.USHORT,w.OffSize=w.BYTE,l.OffSize=l.BYTE,w.SID=w.USHORT,l.SID=l.USHORT,w.NUMBER=function(e){return-107<=e&&e<=107?[e+139]:108<=e&&e<=1131?[247+((e-=108)>>8),255&e]:-1131<=e&&e<=-108?[251+((e=-e-108)>>8),255&e]:-32768<=e&&e<=32767?w.NUMBER16(e):w.NUMBER32(e)},l.NUMBER=function(e){return w.NUMBER(e).length},w.NUMBER16=function(e){return[28,e>>8&255,255&e]},l.NUMBER16=r(3),w.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},l.NUMBER32=r(5),w.REAL=function(e){for(var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t),o=(r&&(r=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length)),t=(Math.round(e*r)/r).toString()),""),n=0,s=t.length;n<s;n+=1){var i=t[n];o+="e"===i?"-"===t[++n]?"c":"b":"."===i?"a":"-"===i?"e":i}for(var a=[30],l=0,u=(o+=1&o.length?"f":"ff").length;l<u;l+=2)a.push(parseInt(o.substr(l,2),16));return a},l.REAL=function(e){return w.REAL(e).length},w.NAME=w.CHARARRAY,l.NAME=l.CHARARRAY,w.STRING=w.CHARARRAY,l.STRING=l.CHARARRAY,m.UTF8=function(e,t,r){for(var o=[],n=r,s=0;s<n;s++,t+=1)o[s]=e.getUint8(t);return String.fromCharCode.apply(null,o)},m.UTF16=function(e,t,r){for(var o=[],n=r/2,s=0;s<n;s++,t+=2)o[s]=e.getUint16(t);return String.fromCharCode.apply(null,o)},w.UTF16=function(e){for(var t=[],r=0;r<e.length;r+=1){var o=e.charCodeAt(r);t[t.length]=o>>8&255,t[t.length]=255&o}return t},l.UTF16=function(e){return 2*e.length};var se,ie={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"},ae=(m.MACSTRING=function(e,t,r,o){var n=ie[o];if(void 0!==n){for(var s="",i=0;i<r;i++){var a=e.getUint8(t+i);s+=a<=127?String.fromCharCode(a):n[127&a]}return s}},"function"==typeof WeakMap&&new WeakMap);function le(e){return-128<=e&&e<=127}w.MACSTRING=function(e,t){var r=function(e){if(!se)for(var t in se={},ie)se[t]=new String(t);var r=se[e];if(void 0!==r){if(ae){var o=ae.get(r);if(void 0!==o)return o}var n=ie[e];if(void 0!==n){for(var s={},i=0;i<n.length;i++)s[n.charCodeAt(i)]=i+128;return ae&&ae.set(r,s),s}}}(t);if(void 0!==r){for(var o=[],n=0;n<e.length;n++){var s=e.charCodeAt(n);if(128<=s&&void 0===(s=r[s]))return;o[n]=s}return o}},l.MACSTRING=function(e,t){e=w.MACSTRING(e,t);return void 0!==e?e.length:0},w.VARDELTAS=function(e){for(var t=0,r=[];t<e.length;)var o=e[t],t=(0===o?function(e,t,r){for(var o=0,n=e.length;t<n&&o<64&&0===e[t];)++t,++o;return r.push(128|o-1),t}:-128<=o&&o<=127?function(e,t,r){for(var o=0,n=e.length,s=t;s<n&&o<64;){var i=e[s];if(!le(i))break;if(0===i&&s+1<n&&0===e[s+1])break;++s,++o}r.push(o-1);for(var a=t;a<s;++a)r.push(e[a]+256&255);return s}:function(e,t,r){for(var o=0,n=e.length,s=t;s<n&&o<64;){var i=e[s];if(0===i)break;if(le(i)&&s+1<n&&le(e[s+1]))break;++s,++o}r.push(64|o-1);for(var a=t;a<s;++a){var l=e[a];r.push(l+65536>>8&255,l+256&255)}return s})(e,t,r);return r},w.INDEX=function(e){for(var t=1,r=[t],o=[],n=0;n<e.length;n+=1){var s=w.OBJECT(e[n]);Array.prototype.push.apply(o,s),t+=s.length,r.push(t)}if(0===o.length)return[0,0];for(var i=[],a=1+Math.floor(Math.log(t)/Math.log(2))/8|0,l=[void 0,w.BYTE,w.USHORT,w.UINT24,w.ULONG][a],u=0;u<r.length;u+=1){var c=l(r[u]);Array.prototype.push.apply(i,c)}return Array.prototype.concat(w.Card16(e.length),w.OffSize(a),i,o)},l.INDEX=function(e){return w.INDEX(e).length},w.DICT=function(e){for(var t=[],r=Object.keys(e),o=r.length,n=0;n<o;n+=1){var s=parseInt(r[n],0),i=e[s];t=(t=t.concat(w.OPERAND(i.value,i.type))).concat(w.OPERATOR(s))}return t},l.DICT=function(e){return w.DICT(e).length},w.OPERATOR=function(e){return e<1200?[e]:[12,e-1200]},w.OPERAND=function(e,t){var r=[];if(Array.isArray(t))for(var o=0;o<t.length;o+=1)A.argument(e.length===t.length,"Not enough arguments given for type"+t),r=r.concat(w.OPERAND(e[o],t[o]));else if("SID"===t)r=r.concat(w.NUMBER(e));else if("offset"===t)r=r.concat(w.NUMBER32(e));else if("number"===t)r=r.concat(w.NUMBER(e));else{if("real"!==t)throw new Error("Unknown operand type "+t);r=r.concat(w.REAL(e))}return r},w.OP=w.BYTE,l.OP=l.BYTE;var ue="function"==typeof WeakMap&&new WeakMap;function n(e,t,r){for(var o=0;o<t.length;o+=1){var n=t[o];this[n.name]=n.value}if(this.tableName=e,this.fields=t,r)for(var s=Object.keys(r),i=0;i<s.length;i+=1){var a=s[i],l=r[a];void 0!==this[a]&&(this[a]=l)}}function ce(e,t,r){void 0===r&&(r=t.length);var o=new Array(t.length+1);o[0]={name:e+"Count",type:"USHORT",value:r};for(var n=0;n<t.length;n++)o[n+1]={name:e+n,type:"USHORT",value:t[n]};return o}function de(e,t,r){var o=t.length,n=new Array(o+1);n[0]={name:e+"Count",type:"USHORT",value:o};for(var s=0;s<o;s++)n[s+1]={name:e+s,type:"TABLE",value:r(t[s],s)};return n}function fe(e,t,r){var o=t.length,n=[];n[0]={name:e+"Count",type:"USHORT",value:o};for(var s=0;s<o;s++)n=n.concat(r(t[s],s));return n}function he(e){1===e.format?n.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:1}].concat(ce("glyph",e.glyphs))):A.assert(!1,"Can't create coverage table format 2 yet.")}function pe(e){n.call(this,"scriptListTable",fe("scriptRecord",e,function(e,t){var r=e.script,o=r.defaultLangSys;return A.assert(!!o,"Unable to write GSUB: script "+e.tag+" has no default language system."),[{name:"scriptTag"+t,type:"TAG",value:e.tag},{name:"script"+t,type:"TABLE",value:new n("scriptTable",[{name:"defaultLangSys",type:"TABLE",value:new n("defaultLangSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:o.reqFeatureIndex}].concat(ce("featureIndex",o.featureIndexes)))}].concat(fe("langSys",r.langSysRecords,function(e,t){var r=e.langSys;return[{name:"langSysTag"+t,type:"TAG",value:e.tag},{name:"langSys"+t,type:"TABLE",value:new n("langSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:r.reqFeatureIndex}].concat(ce("featureIndex",r.featureIndexes)))}]})))}]}))}function me(e){n.call(this,"featureListTable",fe("featureRecord",e,function(e,t){var r=e.feature;return[{name:"featureTag"+t,type:"TAG",value:e.tag},{name:"feature"+t,type:"TABLE",value:new n("featureTable",[{name:"featureParams",type:"USHORT",value:r.featureParams}].concat(ce("lookupListIndex",r.lookupListIndexes)))}]}))}function ye(e,r){n.call(this,"lookupListTable",de("lookup",e,function(e){var t=r[e.lookupType];return A.assert(!!t,"Unable to write GSUB lookup type "+e.lookupType+" tables."),new n("lookupTable",[{name:"lookupType",type:"USHORT",value:e.lookupType},{name:"lookupFlag",type:"USHORT",value:e.lookupFlag}].concat(de("subtable",e.subtables,t)))}))}w.CHARSTRING=function(e){if(ue){var t=ue.get(e);if(void 0!==t)return t}for(var r=[],o=e.length,n=0;n<o;n+=1)var s=e[n],r=r.concat(w[s.type](s.value));return ue&&ue.set(e,r),r},l.CHARSTRING=function(e){return w.CHARSTRING(e).length},w.OBJECT=function(e){var t=w[e.type];return A.argument(void 0!==t,"No encoding function for type "+e.type),t(e.value)},l.OBJECT=function(e){var t=l[e.type];return A.argument(void 0!==t,"No sizeOf function for type "+e.type),t(e.value)},w.TABLE=function(e){for(var t=[],r=e.fields.length,o=[],n=[],s=0;s<r;s+=1){var i=e.fields[s],a=w[i.type],l=(A.argument(void 0!==a,"No encoding function for field type "+i.type+" ("+i.name+")"),e[i.name]),a=a(l=void 0===l?i.value:l);"TABLE"===i.type?(n.push(t.length),t=t.concat([0,0]),o.push(a)):t=t.concat(a)}for(var u=0;u<o.length;u+=1){var c=n[u],d=t.length;A.argument(d<65536,"Table "+e.tableName+" too big."),t[c]=d>>8,t[c+1]=255&d,t=t.concat(o[u])}return t},l.TABLE=function(e){for(var t=0,r=e.fields.length,o=0;o<r;o+=1){var n=e.fields[o],s=l[n.type],i=(A.argument(void 0!==s,"No sizeOf function for field type "+n.type+" ("+n.name+")"),e[n.name]);t+=s(i=void 0===i?n.value:i),"TABLE"===n.type&&(t+=2)}return t},w.RECORD=w.TABLE,l.RECORD=l.TABLE,w.LITERAL=function(e){return e},l.LITERAL=function(e){return e.length},n.prototype.encode=function(){return w.TABLE(this)},n.prototype.sizeOf=function(){return l.TABLE(this)};var S={Table:n,Record:n,Coverage:(he.prototype=Object.create(n.prototype)).constructor=he,ScriptList:(pe.prototype=Object.create(n.prototype)).constructor=pe,FeatureList:(me.prototype=Object.create(n.prototype)).constructor=me,LookupList:(ye.prototype=Object.create(n.prototype)).constructor=ye,ushortList:ce,tableList:de,recordList:fe};function ge(e,t){return e.getUint8(t)}function ve(e,t){return e.getUint16(t,!1)}function be(e,t){return e.getUint32(t,!1)}function je(e,t){return e.getInt16(t,!1)+e.getUint16(t+2,!1)/65535}var _e={byte:1,uShort:2,short:2,uLong:4,fixed:4,longDateTime:8,tag:4};function u(e,t){this.data=e,this.offset=t,this.relativeOffset=0}u.prototype.parseByte=function(){var e=this.data.getUint8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},u.prototype.parseChar=function(){var e=this.data.getInt8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},u.prototype.parseCard8=u.prototype.parseByte,u.prototype.parseCard16=u.prototype.parseUShort=function(){var e=this.data.getUint16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},u.prototype.parseSID=u.prototype.parseUShort,u.prototype.parseOffset16=u.prototype.parseUShort,u.prototype.parseShort=function(){var e=this.data.getInt16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},u.prototype.parseF2Dot14=function(){var e=this.data.getInt16(this.offset+this.relativeOffset)/16384;return this.relativeOffset+=2,e},u.prototype.parseOffset32=u.prototype.parseULong=function(){var e=be(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},u.prototype.parseFixed=function(){var e=je(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},u.prototype.parseString=function(e){var t=this.data,r=this.offset+this.relativeOffset,o="";this.relativeOffset+=e;for(var n=0;n<e;n++)o+=String.fromCharCode(t.getUint8(r+n));return o},u.prototype.parseTag=function(){return this.parseString(4)},u.prototype.parseLongDateTime=function(){var e=be(this.data,this.offset+this.relativeOffset+4);return e-=2082844800,this.relativeOffset+=8,e},u.prototype.parseVersion=function(e){var t=ve(this.data,this.offset+this.relativeOffset),r=ve(this.data,this.offset+this.relativeOffset+2);return this.relativeOffset+=4,t+r/(e=void 0===e?4096:e)/10},u.prototype.skip=function(e,t){this.relativeOffset+=_e[e]*(t=void 0===t?1:t)},u.prototype.parseULongList=function(e){void 0===e&&(e=this.parseULong());for(var t=new Array(e),r=this.data,o=this.offset+this.relativeOffset,n=0;n<e;n++)t[n]=r.getUint32(o),o+=4;return this.relativeOffset+=4*e,t},u.prototype.parseOffset16List=u.prototype.parseUShortList=function(e){void 0===e&&(e=this.parseUShort());for(var t=new Array(e),r=this.data,o=this.offset+this.relativeOffset,n=0;n<e;n++)t[n]=r.getUint16(o),o+=2;return this.relativeOffset+=2*e,t},u.prototype.parseShortList=function(e){for(var t=new Array(e),r=this.data,o=this.offset+this.relativeOffset,n=0;n<e;n++)t[n]=r.getInt16(o),o+=2;return this.relativeOffset+=2*e,t},u.prototype.parseByteList=function(e){for(var t=new Array(e),r=this.data,o=this.offset+this.relativeOffset,n=0;n<e;n++)t[n]=r.getUint8(o++);return this.relativeOffset+=e,t},u.prototype.parseList=function(e,t){t||(t=e,e=this.parseUShort());for(var r=new Array(e),o=0;o<e;o++)r[o]=t.call(this);return r},u.prototype.parseList32=function(e,t){t||(t=e,e=this.parseULong());for(var r=new Array(e),o=0;o<e;o++)r[o]=t.call(this);return r},u.prototype.parseRecordList=function(e,t){t||(t=e,e=this.parseUShort());for(var r=new Array(e),o=Object.keys(t),n=0;n<e;n++){for(var s={},i=0;i<o.length;i++){var a=o[i],l=t[a];s[a]=l.call(this)}r[n]=s}return r},u.prototype.parseRecordList32=function(e,t){t||(t=e,e=this.parseULong());for(var r=new Array(e),o=Object.keys(t),n=0;n<e;n++){for(var s={},i=0;i<o.length;i++){var a=o[i],l=t[a];s[a]=l.call(this)}r[n]=s}return r},u.prototype.parseStruct=function(e){if("function"==typeof e)return e.call(this);for(var t=Object.keys(e),r={},o=0;o<t.length;o++){var n=t[o],s=e[n];r[n]=s.call(this)}return r},u.prototype.parseValueRecord=function(e){var t;if(0!==(e=void 0===e?this.parseUShort():e))return t={},1&e&&(t.xPlacement=this.parseShort()),2&e&&(t.yPlacement=this.parseShort()),4&e&&(t.xAdvance=this.parseShort()),8&e&&(t.yAdvance=this.parseShort()),16&e&&(t.xPlaDevice=void 0,this.parseShort()),32&e&&(t.yPlaDevice=void 0,this.parseShort()),64&e&&(t.xAdvDevice=void 0,this.parseShort()),128&e&&(t.yAdvDevice=void 0,this.parseShort()),t},u.prototype.parseValueRecordList=function(){for(var e=this.parseUShort(),t=this.parseUShort(),r=new Array(t),o=0;o<t;o++)r[o]=this.parseValueRecord(e);return r},u.prototype.parsePointer=function(e){var t=this.parseOffset16();if(0<t)return new u(this.data,this.offset+t).parseStruct(e)},u.prototype.parsePointer32=function(e){var t=this.parseOffset32();if(0<t)return new u(this.data,this.offset+t).parseStruct(e)},u.prototype.parseListOfLists=function(e){for(var t=this.parseOffset16List(),r=t.length,o=this.relativeOffset,n=new Array(r),s=0;s<r;s++){var i=t[s];if(0===i)n[s]=void 0;else if(this.relativeOffset=i,e){for(var a=this.parseOffset16List(),l=new Array(a.length),u=0;u<a.length;u++)this.relativeOffset=i+a[u],l[u]=e.call(this);n[s]=l}else n[s]=this.parseUShortList()}return this.relativeOffset=o,n},u.prototype.parseCoverage=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort(),r=this.parseUShort();if(1===t)return{format:1,glyphs:this.parseUShortList(r)};if(2!==t)throw new Error("0x"+e.toString(16)+": Coverage format must be 1 or 2.");for(var o=new Array(r),n=0;n<r;n++)o[n]={start:this.parseUShort(),end:this.parseUShort(),index:this.parseUShort()};return{format:2,ranges:o}},u.prototype.parseClassDef=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(1===t)return{format:1,startGlyph:this.parseUShort(),classes:this.parseUShortList()};if(2===t)return{format:2,ranges:this.parseRecordList({start:u.uShort,end:u.uShort,classId:u.uShort})};throw new Error("0x"+e.toString(16)+": ClassDef format must be 1 or 2.")},u.list=function(e,t){return function(){return this.parseList(e,t)}},u.list32=function(e,t){return function(){return this.parseList32(e,t)}},u.recordList=function(e,t){return function(){return this.parseRecordList(e,t)}},u.recordList32=function(e,t){return function(){return this.parseRecordList32(e,t)}},u.pointer=function(e){return function(){return this.parsePointer(e)}},u.pointer32=function(e){return function(){return this.parsePointer32(e)}},u.tag=u.prototype.parseTag,u.byte=u.prototype.parseByte,u.uShort=u.offset16=u.prototype.parseUShort,u.uShortList=u.prototype.parseUShortList,u.uLong=u.offset32=u.prototype.parseULong,u.uLongList=u.prototype.parseULongList,u.struct=u.prototype.parseStruct,u.coverage=u.prototype.parseCoverage,u.classDef=u.prototype.parseClassDef;var xe={reserved:u.uShort,reqFeatureIndex:u.uShort,featureIndexes:u.uShortList},R=(u.prototype.parseScriptList=function(){return this.parsePointer(u.recordList({tag:u.tag,script:u.pointer({defaultLangSys:u.pointer(xe),langSysRecords:u.recordList({tag:u.tag,langSys:u.pointer(xe)})})}))||[]},u.prototype.parseFeatureList=function(){return this.parsePointer(u.recordList({tag:u.tag,feature:u.pointer({featureParams:u.offset16,lookupListIndexes:u.uShortList})}))||[]},u.prototype.parseLookupList=function(o){return this.parsePointer(u.list(u.pointer(function(){var e=this.parseUShort(),t=(A.argument(1<=e&&e<=9,"GPOS/GSUB lookup type "+e+" unknown."),this.parseUShort()),r=16&t;return{lookupType:e,lookupFlag:t,subtables:this.parseList(u.pointer(o[e])),markFilteringSet:r?this.parseUShort():void 0}})))||[]},u.prototype.parseFeatureVariationsList=function(){return this.parsePointer32(function(){var e=this.parseUShort(),t=this.parseUShort();return A.argument(1===e&&t<1,"GPOS/GSUB feature variations table unknown."),this.parseRecordList32({conditionSetOffset:u.offset32,featureTableSubstitutionOffset:u.offset32})})||[]},{getByte:ge,getCard8:ge,getUShort:ve,getCard16:ve,getShort:function(e,t){return e.getInt16(t,!1)},getULong:be,getFixed:je,getTag:function(e,t){for(var r="",o=t;o<t+4;o+=1)r+=String.fromCharCode(e.getInt8(o));return r},getOffset:function(e,t,r){for(var o=0,n=0;n<r;n+=1)o=(o<<=8)+e.getUint8(t+n);return o},getBytes:function(e,t,r){for(var o=[],n=t;n<r;n+=1)o.push(e.getUint8(n));return o},bytesToString:function(e){for(var t="",r=0;r<e.length;r+=1)t+=String.fromCharCode(e[r]);return t},Parser:u});var we={parse:function(e,t){for(var r={},o=(r.version=R.getUShort(e,t),A.argument(0===r.version,"cmap table version should be 0."),r.numTables=R.getUShort(e,t+2),-1),n=r.numTables-1;0<=n;--n){var s=R.getUShort(e,t+4+8*n),i=R.getUShort(e,t+4+8*n+2);if(3===s&&(0===i||1===i||10===i)||0===s&&(0===i||1===i||2===i||3===i||4===i)){o=R.getULong(e,t+4+8*n+4);break}}if(-1===o)throw new Error("No valid cmap sub-tables found.");var a=new R.Parser(e,t+o);if(r.format=a.parseUShort(),12===r.format){var l,u=r,c=a;c.parseUShort(),u.length=c.parseULong(),u.language=c.parseULong(),u.groupCount=l=c.parseULong(),u.glyphIndexMap={};for(var d=0;d<l;d+=1)for(var f=c.parseULong(),h=c.parseULong(),p=c.parseULong(),m=f;m<=h;m+=1)u.glyphIndexMap[m]=p,p++}else{if(4!==r.format)throw new Error("Only format 4 and 12 cmap tables are supported (found format "+r.format+").");var y=r,g=e,v=t,b=o;y.length=a.parseUShort(),y.language=a.parseUShort(),y.segCount=j=a.parseUShort()>>1,a.skip("uShort",3),y.glyphIndexMap={};for(var j,_=new R.Parser(g,v+b+14),x=new R.Parser(g,v+b+16+2*j),w=new R.Parser(g,v+b+16+4*j),S=new R.Parser(g,v+b+16+6*j),M=v+b+16+8*j,E=0;E<j-1;E+=1)for(var T=void 0,C=_.parseUShort(),O=x.parseUShort(),k=w.parseShort(),L=S.parseUShort(),P=O;P<=C;P+=1)0!==L?(M=(M=S.offset+S.relativeOffset-2)+L+2*(P-O),0!==(T=R.getUShort(g,M))&&(T=T+k&65535)):T=P+k&65535,y.glyphIndexMap[P]=T}return r},make:function(e){for(var t=!0,r=e.length-1;0<r;--r)if(65535<e.get(r).unicode){console.log("Adding CMAP format 12 (needed!)"),t=!1;break}var o,n,s=[{name:"version",type:"USHORT",value:0},{name:"numTables",type:"USHORT",value:t?1:2},{name:"platformID",type:"USHORT",value:3},{name:"encodingID",type:"USHORT",value:1},{name:"offset",type:"ULONG",value:t?12:20}],i=(s=(s=t?s:s.concat([{name:"cmap12PlatformID",type:"USHORT",value:3},{name:"cmap12EncodingID",type:"USHORT",value:10},{name:"cmap12Offset",type:"ULONG",value:0}])).concat([{name:"format",type:"USHORT",value:4},{name:"cmap4Length",type:"USHORT",value:0},{name:"language",type:"USHORT",value:0},{name:"segCountX2",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]),new S.Table("cmap",s));for(i.segments=[],r=0;r<e.length;r+=1){for(var a=e.get(r),l=0;l<a.unicodes.length;l+=1)o=a.unicodes[l],n=r,i.segments.push({end:o,start:o,delta:-(o-n),offset:0,glyphIndex:n});i.segments=i.segments.sort(function(e,t){return e.start-t.start})}i.segments.push({end:65535,start:65535,delta:1,offset:0});var u=i.segments.length,c=0,d=[],f=[],h=[],p=[],m=[],y=[];for(r=0;r<u;r+=1){var g=i.segments[r];g.end<=65535&&g.start<=65535?(d=d.concat({name:"end_"+r,type:"USHORT",value:g.end}),f=f.concat({name:"start_"+r,type:"USHORT",value:g.start}),h=h.concat({name:"idDelta_"+r,type:"SHORT",value:g.delta}),p=p.concat({name:"idRangeOffset_"+r,type:"USHORT",value:g.offset}),void 0!==g.glyphId&&(m=m.concat({name:"glyph_"+r,type:"USHORT",value:g.glyphId}))):c+=1,t||void 0===g.glyphIndex||(y=(y=(y=y.concat({name:"cmap12Start_"+r,type:"ULONG",value:g.start})).concat({name:"cmap12End_"+r,type:"ULONG",value:g.end})).concat({name:"cmap12Glyph_"+r,type:"ULONG",value:g.glyphIndex}))}return i.segCountX2=2*(u-c),i.searchRange=2*Math.pow(2,Math.floor(Math.log(u-c)/Math.log(2))),i.entrySelector=Math.log(i.searchRange/2)/Math.log(2),i.rangeShift=i.segCountX2-i.searchRange,i.fields=i.fields.concat(d),i.fields.push({name:"reservedPad",type:"USHORT",value:0}),i.fields=i.fields.concat(f),i.fields=i.fields.concat(h),i.fields=i.fields.concat(p),i.fields=i.fields.concat(m),i.cmap4Length=14+2*d.length+2+2*f.length+2*h.length+2*p.length+2*m.length,t||(s=16+4*y.length,i.cmap12Offset=20+i.cmap4Length,i.fields=i.fields.concat([{name:"cmap12Format",type:"USHORT",value:12},{name:"cmap12Reserved",type:"USHORT",value:0},{name:"cmap12Length",type:"ULONG",value:s},{name:"cmap12Language",type:"ULONG",value:0},{name:"cmap12nGroups",type:"ULONG",value:y.length/3}]),i.fields=i.fields.concat(y)),i}},Se=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","266 ff","onedotenleader","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall","001.000","001.001","001.002","001.003","Black","Bold","Book","Light","Medium","Regular","Roman","Semibold"],Me=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","","endash","dagger","daggerdbl","periodcentered","","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","","questiondown","","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","","ring","cedilla","","hungarumlaut","ogonek","caron","emdash","","","","","","","","","","","","","","","","","AE","","ordfeminine","","","","","Lslash","Oslash","OE","ordmasculine","","","","","","ae","","","","dotlessi","","","lslash","oslash","oe","germandbls"],Ee=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","","asuperior","bsuperior","centsuperior","dsuperior","esuperior","","","isuperior","","","lsuperior","msuperior","nsuperior","osuperior","","","rsuperior","ssuperior","tsuperior","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdownsmall","centoldstyle","Lslashsmall","","","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","","Dotaccentsmall","","","Macronsmall","","","figuredash","hypheninferior","","","Ogoneksmall","Ringsmall","Cedillasmall","","","","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"],c=[".notdef",".null","nonmarkingreturn","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","nonbreakingspace","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron","Lslash","lslash","Scaron","scaron","Zcaron","zcaron","brokenbar","Eth","eth","Yacute","yacute","Thorn","thorn","minus","multiply","onesuperior","twosuperior","threesuperior","onehalf","onequarter","threequarters","franc","Gbreve","gbreve","Idotaccent","Scedilla","scedilla","Cacute","cacute","Ccaron","ccaron","dcroat"];function Te(e){this.font=e}function Ce(e){this.cmap=e}function Oe(e,t){this.encoding=e,this.charset=t}function ke(e){switch(e.version){case 1:this.names=c.slice();break;case 2:this.names=new Array(e.numberOfGlyphs);for(var t=0;t<e.numberOfGlyphs;t++)e.glyphNameIndex[t]<c.length?this.names[t]=c[e.glyphNameIndex[t]]:this.names[t]=e.names[e.glyphNameIndex[t]-c.length];break;case 2.5:this.names=new Array(e.numberOfGlyphs);for(var r=0;r<e.numberOfGlyphs;r++)this.names[r]=c[r+e.glyphNameIndex[r]];break;default:this.names=[]}}Te.prototype.charToGlyphIndex=function(e){var t=e.codePointAt(0),r=this.font.glyphs;if(r)for(var o=0;o<r.length;o+=1)for(var n=r.get(o),s=0;s<n.unicodes.length;s+=1)if(n.unicodes[s]===t)return o;return null},Ce.prototype.charToGlyphIndex=function(e){return this.cmap.glyphIndexMap[e.codePointAt(0)]||0},Oe.prototype.charToGlyphIndex=function(e){e=e.codePointAt(0),e=this.encoding[e];return this.charset.indexOf(e)},ke.prototype.nameToGlyphIndex=function(e){return this.names.indexOf(e)},ke.prototype.glyphIndexToName=function(e){return this.names[e]};var d={line:function(e,t,r,o,n){e.beginPath(),e.moveTo(t,r),e.lineTo(o,n),e.stroke()}};function h(e){this.bindConstructorValues(e)}function Le(t,e,r){Object.defineProperty(t,e,{get:function(){return t.path,t[r]},set:function(e){t[r]=e},enumerable:!0,configurable:!0})}function Pe(e,t){if(this.font=e,this.glyphs={},Array.isArray(t))for(var r=0;r<t.length;r++)this.glyphs[r]=t[r];this.length=t&&t.length||0}h.prototype.bindConstructorValues=function(e){var t;this.index=e.index||0,this.name=e.name||null,this.unicode=e.unicode||void 0,this.unicodes=e.unicodes||void 0!==e.unicode?[e.unicode]:[],e.xMin&&(this.xMin=e.xMin),e.yMin&&(this.yMin=e.yMin),e.xMax&&(this.xMax=e.xMax),e.yMax&&(this.yMax=e.yMax),e.advanceWidth&&(this.advanceWidth=e.advanceWidth),Object.defineProperty(this,"path",(e=e.path,t=e||new f,{configurable:!0,get:function(){return t="function"==typeof t?t():t},set:function(e){t=e}}))},h.prototype.addUnicode=function(e){0===this.unicodes.length&&(this.unicode=e),this.unicodes.push(e)},h.prototype.getBoundingBox=function(){return this.path.getBoundingBox()},h.prototype.getPath=function(e,t,r,o,n){e=void 0!==e?e:0,t=void 0!==t?t:0,r=void 0!==r?r:72;for(var s,i,a=(o=o||{}).xScale,l=o.yScale,u=((s=o.hinting&&n&&n.hinting?this.path&&n.hinting.exec(this,r):s)?(i=n.hinting.getCommands(s),e=Math.round(e),t=Math.round(t),a=l=1):(i=this.path.commands,o=1/this.path.unitsPerEm*r,void 0===a&&(a=o),void 0===l&&(l=o)),new f),c=0;c<i.length;c+=1){var d=i[c];"M"===d.type?u.moveTo(e+d.x*a,t+-d.y*l):"L"===d.type?u.lineTo(e+d.x*a,t+-d.y*l):"Q"===d.type?u.quadraticCurveTo(e+d.x1*a,t+-d.y1*l,e+d.x*a,t+-d.y*l):"C"===d.type?u.curveTo(e+d.x1*a,t+-d.y1*l,e+d.x2*a,t+-d.y2*l,e+d.x*a,t+-d.y*l):"Z"===d.type&&u.closePath()}return u},h.prototype.getContours=function(){if(void 0===this.points)return[];for(var e=[],t=[],r=0;r<this.points.length;r+=1){var o=this.points[r];t.push(o),o.lastPointOfContour&&(e.push(t),t=[])}return A.argument(0===t.length,"There are still points left in the current contour."),e},h.prototype.getMetrics=function(){for(var e=this.path.commands,t=[],r=[],o=0;o<e.length;o+=1){var n=e[o];"Z"!==n.type&&(t.push(n.x),r.push(n.y)),"Q"!==n.type&&"C"!==n.type||(t.push(n.x1),r.push(n.y1)),"C"===n.type&&(t.push(n.x2),r.push(n.y2))}var s={xMin:Math.min.apply(null,t),yMin:Math.min.apply(null,r),xMax:Math.max.apply(null,t),yMax:Math.max.apply(null,r),leftSideBearing:this.leftSideBearing};return isFinite(s.xMin)||(s.xMin=0),isFinite(s.xMax)||(s.xMax=this.advanceWidth),isFinite(s.yMin)||(s.yMin=0),isFinite(s.yMax)||(s.yMax=0),s.rightSideBearing=this.advanceWidth-s.leftSideBearing-(s.xMax-s.xMin),s},h.prototype.draw=function(e,t,r,o,n){this.getPath(t,r,o,n).draw(e)},h.prototype.drawPoints=function(i,e,t,r){function o(e,t,r,o){var n=2*Math.PI;i.beginPath();for(var s=0;s<e.length;s+=1)i.moveTo(t+e[s].x*o,r+e[s].y*o),i.arc(t+e[s].x*o,r+e[s].y*o,2,0,n,!1);i.closePath(),i.fill()}e=void 0!==e?e:0,t=void 0!==t?t:0;for(var r=1/this.path.unitsPerEm*(r=void 0!==r?r:24),n=[],s=[],a=this.path,l=0;l<a.commands.length;l+=1){var u=a.commands[l];void 0!==u.x&&n.push({x:u.x,y:-u.y}),void 0!==u.x1&&s.push({x:u.x1,y:-u.y1}),void 0!==u.x2&&s.push({x:u.x2,y:-u.y2})}i.fillStyle="blue",o(n,e,t,r),i.fillStyle="red",o(s,e,t,r)},h.prototype.drawMetrics=function(e,t,r,o){t=void 0!==t?t:0,r=void 0!==r?r:0,o=1/this.path.unitsPerEm*(o=void 0!==o?o:24),e.lineWidth=1,e.strokeStyle="black",d.line(e,t,-1e4,t,1e4),d.line(e,-1e4,r,1e4,r);var n=this.xMin||0,s=this.yMin||0,i=this.xMax||0,a=this.yMax||0,l=this.advanceWidth||0;e.strokeStyle="blue",d.line(e,t+n*o,-1e4,t+n*o,1e4),d.line(e,t+i*o,-1e4,t+i*o,1e4),d.line(e,-1e4,r+-s*o,1e4,r+-s*o),d.line(e,-1e4,r+-a*o,1e4,r+-a*o),e.strokeStyle="green",d.line(e,t+l*o,-1e4,t+l*o,1e4)},Pe.prototype.get=function(e){return"function"==typeof this.glyphs[e]&&(this.glyphs[e]=this.glyphs[e]()),this.glyphs[e]},Pe.prototype.push=function(e,t){this.glyphs[e]=t,this.length++};var p={GlyphSet:Pe,glyphLoader:function(e,t){return new h({index:t,font:e})},ttfGlyphLoader:function(r,e,o,n,s,i){return function(){var t=new h({index:e,font:r});return t.path=function(){o(t,n,s);var e=i(r.glyphs,t);return e.unitsPerEm=r.unitsPerEm,e},Le(t,"xMin","_xMin"),Le(t,"xMax","_xMax"),Le(t,"yMin","_yMin"),Le(t,"yMax","_yMax"),t}},cffGlyphLoader:function(r,e,o,n){return function(){var t=new h({index:e,font:r});return t.path=function(){var e=o(r,t,n);return e.unitsPerEm=r.unitsPerEm,e},t}}};function Ae(e){e=e.length<1240?107:e.length<33900?1131:32768;return e}function y(e,t,r){var o,n=[],s=[],i=R.getCard16(e,t);if(0!==i){for(var a=R.getByte(e,t+2),l=t+(i+1)*a+2,u=t+3,c=0;c<i+1;c+=1)n.push(R.getOffset(e,u,a)),u+=a;o=l+n[i]}else o=t+2;for(var d=0;d<n.length-1;d+=1){var f=R.getBytes(e,l+n[d],l+n[d+1]);r&&(f=r(f)),s.push(f)}return{objects:s,startOffset:t,endOffset:o}}function Re(e,t){if(28===t)return e.parseByte()<<8|e.parseByte();if(29===t)return e.parseByte()<<24|e.parseByte()<<16|e.parseByte()<<8|e.parseByte();if(30===t){for(var r=e,o="",n=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];;){var s=r.parseByte(),i=s>>4,s=15&s;if(15==i)break;if(o+=n[i],15==s)break;o+=n[s]}return parseFloat(o)}if(32<=t&&t<=246)return t-139;if(247<=t&&t<=250)return 256*(t-247)+e.parseByte()+108;if(251<=t&&t<=254)return 256*-(t-251)-e.parseByte()-108;throw new Error("Invalid b0 "+t)}function Ie(e,t,r){var o=new R.Parser(e,t=void 0!==t?t:0),n=[],s=[];for(r=void 0!==r?r:e.length;o.relativeOffset<r;){var i=o.parseByte();i<=21?(12===i&&(i=1200+o.parseByte()),n.push([i,s]),s=[]):s.push(Re(o,i))}for(var a=n,l={},u=0;u<a.length;u+=1){var c=a[u][0],d=a[u][1],f=void 0,f=1===d.length?d[0]:d;if(l.hasOwnProperty(c)&&!isNaN(l[c]))throw new Error("Object "+l+" already has key "+c);l[c]=f}return l}function De(e,t){return t=t<=390?Se[t]:e[t-391]}function Ue(e,t,r){for(var o,n={},s=0;s<t.length;s+=1){var i=t[s];if(Array.isArray(i.type)){var a=[];a.length=i.type.length;for(var l=0;l<i.type.length;l++)void 0===(o=void 0!==e[i.op]?e[i.op][l]:void 0)&&(o=void 0!==i.value&&void 0!==i.value[l]?i.value[l]:null),"SID"===i.type[l]&&(o=De(r,o)),a[l]=o;n[i.name]=a}else void 0===(o=e[i.op])&&(o=void 0!==i.value?i.value:null),"SID"===i.type&&(o=De(r,o)),n[i.name]=o}return n}var Ne=[{name:"version",op:0,type:"SID"},{name:"notice",op:1,type:"SID"},{name:"copyright",op:1200,type:"SID"},{name:"fullName",op:2,type:"SID"},{name:"familyName",op:3,type:"SID"},{name:"weight",op:4,type:"SID"},{name:"isFixedPitch",op:1201,type:"number",value:0},{name:"italicAngle",op:1202,type:"number",value:0},{name:"underlinePosition",op:1203,type:"number",value:-100},{name:"underlineThickness",op:1204,type:"number",value:50},{name:"paintType",op:1205,type:"number",value:0},{name:"charstringType",op:1206,type:"number",value:2},{name:"fontMatrix",op:1207,type:["real","real","real","real","real","real"],value:[.001,0,0,.001,0,0]},{name:"uniqueId",op:13,type:"number"},{name:"fontBBox",op:5,type:["number","number","number","number"],value:[0,0,0,0]},{name:"strokeWidth",op:1208,type:"number",value:0},{name:"xuid",op:14,type:[],value:null},{name:"charset",op:15,type:"offset",value:0},{name:"encoding",op:16,type:"offset",value:0},{name:"charStrings",op:17,type:"offset",value:0},{name:"private",op:18,type:["number","offset"],value:[0,0]},{name:"ros",op:1230,type:["SID","SID","number"]},{name:"cidFontVersion",op:1231,type:"number",value:0},{name:"cidFontRevision",op:1232,type:"number",value:0},{name:"cidFontType",op:1233,type:"number",value:0},{name:"cidCount",op:1234,type:"number",value:8720},{name:"uidBase",op:1235,type:"number"},{name:"fdArray",op:1236,type:"offset"},{name:"fdSelect",op:1237,type:"offset"},{name:"fontName",op:1238,type:"SID"}],Fe=[{name:"subrs",op:19,type:"offset",value:0},{name:"defaultWidthX",op:20,type:"number",value:0},{name:"nominalWidthX",op:21,type:"number",value:0}];function Be(e,t,r,o){return Ue(Ie(e,t,r),Fe,o)}function Ge(e,t,r,o){for(var n=[],s=0;s<r.length;s+=1){var i=new DataView(new Uint8Array(r[s]).buffer),i=(a=o,Ue(Ie(i,0,i.byteLength),Ne,a)),a=(i._subrs=[],i._subrsBias=0,i.private[0]),l=i.private[1];0!==a&&0!==l&&(a=Be(e,l+t,a,o),i._defaultWidthX=a.defaultWidthX,i._nominalWidthX=a.nominalWidthX,0!==a.subrs&&(l=y(e,l+a.subrs+t),i._subrs=l.objects,i._subrsBias=Ae(i._subrs)),i._privateDict=a),n.push(i)}return n}function Ve(y,g,e){var v,b,j,_,t,x,w,r,S,M=new f,E=[],T=0,C=!1,O=!1,k=0,L=0,P=(S=(y.isCIDFont?(t=y.tables.cff.topDict._fdSelect[g.index],t=y.tables.cff.topDict._fdArray[t],x=t._subrs,w=t._subrsBias,r=t._defaultWidthX,t):(x=y.tables.cff.topDict._subrs,w=y.tables.cff.topDict._subrsBias,r=y.tables.cff.topDict._defaultWidthX,y.tables.cff.topDict))._nominalWidthX,r);function A(e,t){O&&M.closePath(),M.moveTo(e,t),O=!0}function R(){E.length%2==0||C||(P=E.shift()+S),T+=E.length>>1,E.length=0,C=!0}return function e(t){for(var r,o,n,s,i,a,l,u,c,d,f,h,p=0;p<t.length;){var m=t[p];switch(p+=1,m){case 1:case 3:R();break;case 4:1<E.length&&!C&&(P=E.shift()+S,C=!0),L+=E.pop(),A(k,L);break;case 5:for(;0<E.length;)k+=E.shift(),L+=E.shift(),M.lineTo(k,L);break;case 6:for(;0<E.length&&(k+=E.shift(),M.lineTo(k,L),0!==E.length);)L+=E.shift(),M.lineTo(k,L);break;case 7:for(;0<E.length&&(L+=E.shift(),M.lineTo(k,L),0!==E.length);)k+=E.shift(),M.lineTo(k,L);break;case 8:for(;0<E.length;)v=k+E.shift(),b=L+E.shift(),j=v+E.shift(),_=b+E.shift(),k=j+E.shift(),L=_+E.shift(),M.curveTo(v,b,j,_,k,L);break;case 10:i=E.pop()+w,(a=x[i])&&e(a);break;case 11:return;case 12:switch(m=t[p],p+=1,m){case 35:v=k+E.shift(),b=L+E.shift(),j=v+E.shift(),_=b+E.shift(),l=j+E.shift(),u=_+E.shift(),c=l+E.shift(),d=u+E.shift(),f=c+E.shift(),h=d+E.shift(),k=f+E.shift(),L=h+E.shift(),E.shift(),M.curveTo(v,b,j,_,l,u),M.curveTo(c,d,f,h,k,L);break;case 34:v=k+E.shift(),b=L,j=v+E.shift(),_=b+E.shift(),l=j+E.shift(),u=_,c=l+E.shift(),d=_,f=c+E.shift(),h=L,k=f+E.shift(),M.curveTo(v,b,j,_,l,u),M.curveTo(c,d,f,h,k,L);break;case 36:v=k+E.shift(),b=L+E.shift(),j=v+E.shift(),_=b+E.shift(),l=j+E.shift(),u=_,c=l+E.shift(),d=_,f=c+E.shift(),h=d+E.shift(),k=f+E.shift(),M.curveTo(v,b,j,_,l,u),M.curveTo(c,d,f,h,k,L);break;case 37:v=k+E.shift(),b=L+E.shift(),j=v+E.shift(),_=b+E.shift(),l=j+E.shift(),u=_+E.shift(),c=l+E.shift(),d=u+E.shift(),f=c+E.shift(),h=d+E.shift(),Math.abs(f-k)>Math.abs(h-L)?k=f+E.shift():L=h+E.shift(),M.curveTo(v,b,j,_,l,u),M.curveTo(c,d,f,h,k,L);break;default:console.log("Glyph "+g.index+": unknown operator 1200"+m),E.length=0}break;case 14:0<E.length&&!C&&(P=E.shift()+S,C=!0),O&&(M.closePath(),O=!1);break;case 18:R();break;case 19:case 20:R(),p+=T+7>>3;break;case 21:2<E.length&&!C&&(P=E.shift()+S,C=!0),L+=E.pop(),A(k+=E.pop(),L);break;case 22:1<E.length&&!C&&(P=E.shift()+S,C=!0),A(k+=E.pop(),L);break;case 23:R();break;case 24:for(;2<E.length;)v=k+E.shift(),b=L+E.shift(),j=v+E.shift(),_=b+E.shift(),k=j+E.shift(),L=_+E.shift(),M.curveTo(v,b,j,_,k,L);k+=E.shift(),L+=E.shift(),M.lineTo(k,L);break;case 25:for(;6<E.length;)k+=E.shift(),L+=E.shift(),M.lineTo(k,L);v=k+E.shift(),b=L+E.shift(),j=v+E.shift(),_=b+E.shift(),k=j+E.shift(),L=_+E.shift(),M.curveTo(v,b,j,_,k,L);break;case 26:for(E.length%2&&(k+=E.shift());0<E.length;)v=k,b=L+E.shift(),j=v+E.shift(),_=b+E.shift(),k=j,L=_+E.shift(),M.curveTo(v,b,j,_,k,L);break;case 27:for(E.length%2&&(L+=E.shift());0<E.length;)v=k+E.shift(),b=L,j=v+E.shift(),_=b+E.shift(),k=j+E.shift(),L=_,M.curveTo(v,b,j,_,k,L);break;case 28:r=t[p],o=t[p+1],E.push((r<<24|o<<16)>>16),p+=2;break;case 29:i=E.pop()+y.gsubrsBias,(a=y.gsubrs[i])&&e(a);break;case 30:for(;0<E.length&&(v=k,b=L+E.shift(),j=v+E.shift(),_=b+E.shift(),k=j+E.shift(),L=_+(1===E.length?E.shift():0),M.curveTo(v,b,j,_,k,L),0!==E.length);)v=k+E.shift(),b=L,j=v+E.shift(),_=b+E.shift(),L=_+E.shift(),k=j+(1===E.length?E.shift():0),M.curveTo(v,b,j,_,k,L);break;case 31:for(;0<E.length&&(v=k+E.shift(),b=L,j=v+E.shift(),_=b+E.shift(),L=_+E.shift(),k=j+(1===E.length?E.shift():0),M.curveTo(v,b,j,_,k,L),0!==E.length);)v=k,b=L+E.shift(),j=v+E.shift(),_=b+E.shift(),k=j+E.shift(),L=_+(1===E.length?E.shift():0),M.curveTo(v,b,j,_,k,L);break;default:m<32?console.log("Glyph "+g.index+": unknown operator "+m):m<247?E.push(m-139):m<251?(r=t[p],p+=1,E.push(256*(m-247)+r+108)):m<255?(r=t[p],p+=1,E.push(256*-(m-251)-r-108)):(r=t[p],o=t[p+1],n=t[p+2],s=t[p+3],p+=4,E.push((r<<24|o<<16|n<<8|s)/65536))}}}(e),g.advanceWidth=P,M}function ze(e,t){var r,o=Se.indexOf(e);return 0<=o&&(r=o),0<=(o=t.indexOf(e))?r=o+Se.length:(r=Se.length+t.length,t.push(e)),r}function He(e,t,r){for(var o={},n=0;n<e.length;n+=1){var s=e[n],i=t[s.name];void 0===i||function e(t,r){if(t===r)return 1;if(Array.isArray(t)&&Array.isArray(r)&&t.length===r.length){for(var o=0;o<t.length;o+=1)if(!e(t[o],r[o]))return;return 1}}(i,s.value)||("SID"===s.type&&(i=ze(i,r)),o[s.op]={name:s.name,type:s.type,value:i})}return o}function We(e,t){var r=new S.Record("Top DICT",[{name:"dict",type:"DICT",value:{}}]);return r.dict=He(Ne,e,t),r}function qe(e){var t=new S.Record("Top DICT INDEX",[{name:"topDicts",type:"INDEX",value:[]}]);return t.topDicts=[{name:"topDict_0",type:"TABLE",value:e}],t}function Xe(e){for(var t=new S.Record("CharStrings INDEX",[{name:"charStrings",type:"INDEX",value:[]}]),r=0;r<e.length;r+=1){var o=e.get(r),n=function(e){for(var t=[],r=e.path,o=(t.push({name:"width",type:"NUMBER",value:e.advanceWidth}),0),n=0,s=0;s<r.commands.length;s+=1){var i,a,l,u,c=void 0,d=void 0,f=r.commands[s];"M"===(f="Q"===f.type?{type:"C",x:f.x,y:f.y,x1:1/3*o+2/3*f.x1,y1:1/3*n+2/3*f.y1,x2:1/3*f.x+2/3*f.x1,y2:1/3*f.y+2/3*f.y1}:f).type?(c=Math.round(f.x-o),d=Math.round(f.y-n),t.push({name:"dx",type:"NUMBER",value:c}),t.push({name:"dy",type:"NUMBER",value:d}),t.push({name:"rmoveto",type:"OP",value:21}),o=Math.round(f.x),n=Math.round(f.y)):"L"===f.type?(c=Math.round(f.x-o),d=Math.round(f.y-n),t.push({name:"dx",type:"NUMBER",value:c}),t.push({name:"dy",type:"NUMBER",value:d}),t.push({name:"rlineto",type:"OP",value:5}),o=Math.round(f.x),n=Math.round(f.y)):"C"===f.type&&(i=Math.round(f.x1-o),a=Math.round(f.y1-n),l=Math.round(f.x2-f.x1),u=Math.round(f.y2-f.y1),c=Math.round(f.x-f.x2),d=Math.round(f.y-f.y2),t.push({name:"dx1",type:"NUMBER",value:i}),t.push({name:"dy1",type:"NUMBER",value:a}),t.push({name:"dx2",type:"NUMBER",value:l}),t.push({name:"dy2",type:"NUMBER",value:u}),t.push({name:"dx",type:"NUMBER",value:c}),t.push({name:"dy",type:"NUMBER",value:d}),t.push({name:"rrcurveto",type:"OP",value:8}),o=Math.round(f.x),n=Math.round(f.y))}return t.push({name:"endchar",type:"OP",value:14}),t}(o);t.charStrings.push({name:o.name,type:"CHARSTRING",value:n})}return t}var Ye={parse:function(e,t,r){r.tables.cff={},o=e,n=t,(s={}).formatMajor=R.getCard8(o,n),s.formatMinor=R.getCard8(o,n+1),s.size=R.getCard8(o,n+2),s.offsetSize=R.getCard8(o,n+3),s.startOffset=n,s.endOffset=n+4;var o=y(e,s.endOffset,R.bytesToString),n=y(e,o.endOffset),s=y(e,n.endOffset,R.bytesToString),o=y(e,s.endOffset);if(r.gsubrs=o.objects,r.gsubrsBias=Ae(r.gsubrs),1!==(o=Ge(e,t,n.objects,s.objects)).length)throw new Error("CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = "+o.length);if(n=o[0],(r.tables.cff.topDict=n)._privateDict&&(r.defaultWidthX=n._privateDict.defaultWidthX,r.nominalWidthX=n._privateDict.nominalWidthX),void 0!==n.ros[0]&&void 0!==n.ros[1]&&(r.isCIDFont=!0),r.isCIDFont){var o=n.fdArray,i=n.fdSelect;if(0===o||0===i)throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");o=Ge(e,t,y(e,o+=t).objects,s.objects);n._fdArray=o,n._fdSelect=function(e,t,r,o){var n,s=[],i=new R.Parser(e,t);if(0===(e=i.parseCard8()))for(var a=0;a<r;a++){if(o<=(n=i.parseCard8()))throw new Error("CFF table CID Font FDSelect has bad FD index value "+n+" (FD count "+o+")");s.push(n)}else{if(3!==e)throw new Error("CFF Table CID Font FDSelect table has unsupported format "+e);var l,u=i.parseCard16(),c=i.parseCard16();if(0!==c)throw new Error("CFF Table CID Font FDSelect format 3 range has bad initial GID "+c);for(var d=0;d<u;d++){if(n=i.parseCard8(),l=i.parseCard16(),o<=n)throw new Error("CFF table CID Font FDSelect has bad FD index value "+n+" (FD count "+o+")");if(r<l)throw new Error("CFF Table CID Font FDSelect format 3 range has bad GID "+l);for(;c<l;c++)s.push(n);c=l}if(l!==r)throw new Error("CFF Table CID Font FDSelect format 3 range has bad final GID "+l)}return s}(e,i+=t,r.numGlyphs,o.length)}var i=t+n.private[1],o=Be(e,i,n.private[0],s.objects),a=(r.defaultWidthX=o.defaultWidthX,r.nominalWidthX=o.nominalWidthX,0!==o.subrs?(i=y(e,i+o.subrs),r.subrs=i.objects,r.subrsBias=Ae(r.subrs)):(r.subrs=[],r.subrsBias=0),y(e,t+n.charStrings)),o=(r.nGlyphs=a.objects.length,function(e,t,r,o){var n=new R.Parser(e,t),s=(--r,[".notdef"]);if(0===(e=n.parseCard8()))for(var i=0;i<r;i+=1)a=n.parseSID(),s.push(De(o,a));else if(1===e)for(;s.length<=r;)for(var a=n.parseSID(),l=n.parseCard8(),u=0;u<=l;u+=1)s.push(De(o,a)),a+=1;else{if(2!==e)throw new Error("Unknown charset format "+e);for(;s.length<=r;){a=n.parseSID(),l=n.parseCard16();for(var c=0;c<=l;c+=1)s.push(De(o,a)),a+=1}}return s}(e,t+n.charset,r.nGlyphs,s.objects));0===n.encoding?r.cffEncoding=new Oe(Me,o):1===n.encoding?r.cffEncoding=new Oe(Ee,o):r.cffEncoding=function(e,t,r){var o={},n=new R.Parser(e,t);if(0===(e=n.parseCard8()))for(var s=n.parseCard8(),i=0;i<s;i+=1)o[l=n.parseCard8()]=i;else{if(1!==e)throw new Error("Unknown encoding format "+e);for(var a=n.parseCard8(),l=1,u=0;u<a;u+=1)for(var c=n.parseCard8(),d=n.parseCard8(),f=c;f<=c+d;f+=1)o[f]=l,l+=1}return new Oe(o,r)}(e,t+n.encoding,o),r.encoding=r.encoding||r.cffEncoding,r.glyphs=new p.GlyphSet(r);for(var l=0;l<r.nGlyphs;l+=1){var u=a.objects[l];r.glyphs.push(l,p.cffGlyphLoader(r,l,Ve,u))}},make:function(e,t){for(var r,o=new S.Table("CFF ",[{name:"header",type:"RECORD"},{name:"nameIndex",type:"RECORD"},{name:"topDictIndex",type:"RECORD"},{name:"stringIndex",type:"RECORD"},{name:"globalSubrIndex",type:"RECORD"},{name:"charsets",type:"RECORD"},{name:"charStringsIndex",type:"RECORD"},{name:"privateDict",type:"RECORD"}]),n=1/t.unitsPerEm,n={version:t.version,fullName:t.fullName,familyName:t.familyName,weight:t.weightName,fontBBox:t.fontBBox||[0,0,0,0],fontMatrix:[n,0,0,n,0,0],charset:999,encoding:0,charStrings:999,private:[0,999]},s=[],i=1;i<e.length;i+=1)r=e.get(i),s.push(r.name);var a,l,u=[],t=(o.header=new S.Record("Header",[{name:"major",type:"Card8",value:1},{name:"minor",type:"Card8",value:0},{name:"hdrSize",type:"Card8",value:4},{name:"major",type:"Card8",value:1}]),o.nameIndex=function(e){var t=new S.Record("Name INDEX",[{name:"names",type:"INDEX",value:[]}]);t.names=[];for(var r=0;r<e.length;r+=1)t.names.push({name:"name_"+r,type:"NAME",value:e[r]});return t}([t.postScriptName]),We(n,u)),c=(o.topDictIndex=qe(t),o.globalSubrIndex=new S.Record("Global Subr INDEX",[{name:"subrs",type:"INDEX",value:[]}]),o.charsets=function(e,t){for(var r=new S.Record("Charsets",[{name:"format",type:"Card8",value:0}]),o=0;o<e.length;o+=1){var n=ze(e[o],t);r.fields.push({name:"glyph_"+o,type:"SID",value:n})}return r}(s,u),o.charStringsIndex=Xe(e),o.privateDict=(c={},a=u,(l=new S.Record("Private DICT",[{name:"dict",type:"DICT",value:{}}])).dict=He(Fe,c,a),l),o.stringIndex=function(e){var t=new S.Record("String INDEX",[{name:"strings",type:"INDEX",value:[]}]);t.strings=[];for(var r=0;r<e.length;r+=1)t.strings.push({name:"string_"+r,type:"STRING",value:e[r]});return t}(u),o.header.sizeOf()+o.nameIndex.sizeOf()+o.topDictIndex.sizeOf()+o.stringIndex.sizeOf()+o.globalSubrIndex.sizeOf());return n.charset=c,n.encoding=0,n.charStrings=n.charset+o.charsets.sizeOf(),n.private[1]=n.charStrings+o.charStringsIndex.sizeOf(),t=We(n,u),o.topDictIndex=qe(t),o}};var Ze={parse:function(e,t){var r={},e=new R.Parser(e,t);return r.version=e.parseVersion(),r.fontRevision=Math.round(1e3*e.parseFixed())/1e3,r.checkSumAdjustment=e.parseULong(),r.magicNumber=e.parseULong(),A.argument(1594834165===r.magicNumber,"Font header has wrong magic number."),r.flags=e.parseUShort(),r.unitsPerEm=e.parseUShort(),r.created=e.parseLongDateTime(),r.modified=e.parseLongDateTime(),r.xMin=e.parseShort(),r.yMin=e.parseShort(),r.xMax=e.parseShort(),r.yMax=e.parseShort(),r.macStyle=e.parseUShort(),r.lowestRecPPEM=e.parseUShort(),r.fontDirectionHint=e.parseShort(),r.indexToLocFormat=e.parseShort(),r.glyphDataFormat=e.parseShort(),r},make:function(e){var t=Math.round((new Date).getTime()/1e3)+2082844800,r=t;return e.createdTimestamp&&(r=e.createdTimestamp+2082844800),new S.Table("head",[{name:"version",type:"FIXED",value:65536},{name:"fontRevision",type:"FIXED",value:65536},{name:"checkSumAdjustment",type:"ULONG",value:0},{name:"magicNumber",type:"ULONG",value:1594834165},{name:"flags",type:"USHORT",value:0},{name:"unitsPerEm",type:"USHORT",value:1e3},{name:"created",type:"LONGDATETIME",value:r},{name:"modified",type:"LONGDATETIME",value:t},{name:"xMin",type:"SHORT",value:0},{name:"yMin",type:"SHORT",value:0},{name:"xMax",type:"SHORT",value:0},{name:"yMax",type:"SHORT",value:0},{name:"macStyle",type:"USHORT",value:0},{name:"lowestRecPPEM",type:"USHORT",value:0},{name:"fontDirectionHint",type:"SHORT",value:2},{name:"indexToLocFormat",type:"SHORT",value:0},{name:"glyphDataFormat",type:"SHORT",value:0}],e)}};var Qe={parse:function(e,t){var r={},e=new R.Parser(e,t);return r.version=e.parseVersion(),r.ascender=e.parseShort(),r.descender=e.parseShort(),r.lineGap=e.parseShort(),r.advanceWidthMax=e.parseUShort(),r.minLeftSideBearing=e.parseShort(),r.minRightSideBearing=e.parseShort(),r.xMaxExtent=e.parseShort(),r.caretSlopeRise=e.parseShort(),r.caretSlopeRun=e.parseShort(),r.caretOffset=e.parseShort(),e.relativeOffset+=8,r.metricDataFormat=e.parseShort(),r.numberOfHMetrics=e.parseUShort(),r},make:function(e){return new S.Table("hhea",[{name:"version",type:"FIXED",value:65536},{name:"ascender",type:"FWORD",value:0},{name:"descender",type:"FWORD",value:0},{name:"lineGap",type:"FWORD",value:0},{name:"advanceWidthMax",type:"UFWORD",value:0},{name:"minLeftSideBearing",type:"FWORD",value:0},{name:"minRightSideBearing",type:"FWORD",value:0},{name:"xMaxExtent",type:"FWORD",value:0},{name:"caretSlopeRise",type:"SHORT",value:1},{name:"caretSlopeRun",type:"SHORT",value:0},{name:"caretOffset",type:"SHORT",value:0},{name:"reserved1",type:"SHORT",value:0},{name:"reserved2",type:"SHORT",value:0},{name:"reserved3",type:"SHORT",value:0},{name:"reserved4",type:"SHORT",value:0},{name:"metricDataFormat",type:"SHORT",value:0},{name:"numberOfHMetrics",type:"USHORT",value:0}],e)}};var Je={parse:function(e,t,r,o,n){for(var s,i,a=new R.Parser(e,t),l=0;l<o;l+=1){l<r&&(s=a.parseUShort(),i=a.parseShort());var u=n.get(l);u.advanceWidth=s,u.leftSideBearing=i}},make:function(e){for(var t=new S.Table("hmtx",[]),r=0;r<e.length;r+=1){var o=e.get(r),n=o.advanceWidth||0,o=o.leftSideBearing||0;t.fields.push({name:"advanceWidth_"+r,type:"USHORT",value:n}),t.fields.push({name:"leftSideBearing_"+r,type:"SHORT",value:o})}return t}};var Ke={make:function(e){for(var t=new S.Table("ltag",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"numTags",type:"ULONG",value:e.length}]),r="",o=12+4*e.length,n=0;n<e.length;++n){var s=r.indexOf(e[n]);s<0&&(s=r.length,r+=e[n]),t.fields.push({name:"offset "+n,type:"USHORT",value:o+s}),t.fields.push({name:"length "+n,type:"USHORT",value:e[n].length})}return t.fields.push({name:"stringPool",type:"CHARARRAY",value:r}),t},parse:function(e,t){for(var r=new R.Parser(e,t),o=r.parseULong(),n=(A.argument(1===o,"Unsupported ltag table version."),r.skip("uLong",1),r.parseULong()),s=[],i=0;i<n;i++){for(var a="",l=t+r.parseUShort(),u=r.parseUShort(),c=l;c<l+u;++c)a+=String.fromCharCode(e.getInt8(c));s.push(a)}return s}};var $e={parse:function(e,t){var r={},e=new R.Parser(e,t);return r.version=e.parseVersion(),r.numGlyphs=e.parseUShort(),1===r.version&&(r.maxPoints=e.parseUShort(),r.maxContours=e.parseUShort(),r.maxCompositePoints=e.parseUShort(),r.maxCompositeContours=e.parseUShort(),r.maxZones=e.parseUShort(),r.maxTwilightPoints=e.parseUShort(),r.maxStorage=e.parseUShort(),r.maxFunctionDefs=e.parseUShort(),r.maxInstructionDefs=e.parseUShort(),r.maxStackElements=e.parseUShort(),r.maxSizeOfInstructions=e.parseUShort(),r.maxComponentElements=e.parseUShort(),r.maxComponentDepth=e.parseUShort()),r},make:function(e){return new S.Table("maxp",[{name:"version",type:"FIXED",value:20480},{name:"numGlyphs",type:"USHORT",value:e}])}},et=["copyright","fontFamily","fontSubfamily","uniqueID","fullName","version","postScriptName","trademark","manufacturer","designer","description","manufacturerURL","designerURL","license","licenseURL","reserved","preferredFamily","preferredSubfamily","compatibleFullName","sampleText","postScriptFindFontName","wwsFamily","wwsSubfamily"],tt={0:"en",1:"fr",2:"de",3:"it",4:"nl",5:"sv",6:"es",7:"da",8:"pt",9:"no",10:"he",11:"ja",12:"ar",13:"fi",14:"el",15:"is",16:"mt",17:"tr",18:"hr",19:"zh-Hant",20:"ur",21:"hi",22:"th",23:"ko",24:"lt",25:"pl",26:"hu",27:"es",28:"lv",29:"se",30:"fo",31:"fa",32:"ru",33:"zh",34:"nl-BE",35:"ga",36:"sq",37:"ro",38:"cz",39:"sk",40:"si",41:"yi",42:"sr",43:"mk",44:"bg",45:"uk",46:"be",47:"uz",48:"kk",49:"az-Cyrl",50:"az-Arab",51:"hy",52:"ka",53:"mo",54:"ky",55:"tg",56:"tk",57:"mn-CN",58:"mn",59:"ps",60:"ks",61:"ku",62:"sd",63:"bo",64:"ne",65:"sa",66:"mr",67:"bn",68:"as",69:"gu",70:"pa",71:"or",72:"ml",73:"kn",74:"ta",75:"te",76:"si",77:"my",78:"km",79:"lo",80:"vi",81:"id",82:"tl",83:"ms",84:"ms-Arab",85:"am",86:"ti",87:"om",88:"so",89:"sw",90:"rw",91:"rn",92:"ny",93:"mg",94:"eo",128:"cy",129:"eu",130:"ca",131:"la",132:"qu",133:"gn",134:"ay",135:"tt",136:"ug",137:"dz",138:"jv",139:"su",140:"gl",141:"af",142:"br",143:"iu",144:"gd",145:"gv",146:"ga",147:"to",148:"el-polyton",149:"kl",150:"az",151:"nn"},rt={0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,10:5,11:1,12:4,13:0,14:6,15:0,16:0,17:0,18:0,19:2,20:4,21:9,22:21,23:3,24:29,25:29,26:29,27:29,28:29,29:0,30:0,31:4,32:7,33:25,34:0,35:0,36:0,37:0,38:29,39:29,40:0,41:5,42:7,43:7,44:7,45:7,46:7,47:7,48:7,49:7,50:4,51:24,52:23,53:7,54:7,55:7,56:7,57:27,58:7,59:4,60:4,61:4,62:4,63:26,64:9,65:9,66:9,67:13,68:13,69:11,70:10,71:12,72:17,73:16,74:14,75:15,76:18,77:19,78:20,79:22,80:30,81:0,82:0,83:0,84:4,85:28,86:28,87:28,88:0,89:0,90:0,91:0,92:0,93:0,94:0,128:0,129:0,130:0,131:0,132:0,133:0,134:0,135:7,136:4,137:26,138:0,139:0,140:0,141:0,142:0,143:28,144:0,145:0,146:0,147:0,148:6,149:0,150:0,151:0},ot={1078:"af",1052:"sq",1156:"gsw",1118:"am",5121:"ar-DZ",15361:"ar-BH",3073:"ar",2049:"ar-IQ",11265:"ar-JO",13313:"ar-KW",12289:"ar-LB",4097:"ar-LY",6145:"ary",8193:"ar-OM",16385:"ar-QA",1025:"ar-SA",10241:"ar-SY",7169:"aeb",14337:"ar-AE",9217:"ar-YE",1067:"hy",1101:"as",2092:"az-Cyrl",1068:"az",1133:"ba",1069:"eu",1059:"be",2117:"bn",1093:"bn-IN",8218:"bs-Cyrl",5146:"bs",1150:"br",1026:"bg",1027:"ca",3076:"zh-HK",5124:"zh-MO",2052:"zh",4100:"zh-SG",1028:"zh-TW",1155:"co",1050:"hr",4122:"hr-BA",1029:"cs",1030:"da",1164:"prs",1125:"dv",2067:"nl-BE",1043:"nl",3081:"en-AU",10249:"en-BZ",4105:"en-CA",9225:"en-029",16393:"en-IN",6153:"en-IE",8201:"en-JM",17417:"en-MY",5129:"en-NZ",13321:"en-PH",18441:"en-SG",7177:"en-ZA",11273:"en-TT",2057:"en-GB",1033:"en",12297:"en-ZW",1061:"et",1080:"fo",1124:"fil",1035:"fi",2060:"fr-BE",3084:"fr-CA",1036:"fr",5132:"fr-LU",6156:"fr-MC",4108:"fr-CH",1122:"fy",1110:"gl",1079:"ka",3079:"de-AT",1031:"de",5127:"de-LI",4103:"de-LU",2055:"de-CH",1032:"el",1135:"kl",1095:"gu",1128:"ha",1037:"he",1081:"hi",1038:"hu",1039:"is",1136:"ig",1057:"id",1117:"iu",2141:"iu-Latn",2108:"ga",1076:"xh",1077:"zu",1040:"it",2064:"it-CH",1041:"ja",1099:"kn",1087:"kk",1107:"km",1158:"quc",1159:"rw",1089:"sw",1111:"kok",1042:"ko",1088:"ky",1108:"lo",1062:"lv",1063:"lt",2094:"dsb",1134:"lb",1071:"mk",2110:"ms-BN",1086:"ms",1100:"ml",1082:"mt",1153:"mi",1146:"arn",1102:"mr",1148:"moh",1104:"mn",2128:"mn-CN",1121:"ne",1044:"nb",2068:"nn",1154:"oc",1096:"or",1123:"ps",1045:"pl",1046:"pt",2070:"pt-PT",1094:"pa",1131:"qu-BO",2155:"qu-EC",3179:"qu",1048:"ro",1047:"rm",1049:"ru",9275:"smn",4155:"smj-NO",5179:"smj",3131:"se-FI",1083:"se",2107:"se-SE",8251:"sms",6203:"sma-NO",7227:"sms",1103:"sa",7194:"sr-Cyrl-BA",3098:"sr",6170:"sr-Latn-BA",2074:"sr-Latn",1132:"nso",1074:"tn",1115:"si",1051:"sk",1060:"sl",11274:"es-AR",16394:"es-BO",13322:"es-CL",9226:"es-CO",5130:"es-CR",7178:"es-DO",12298:"es-EC",17418:"es-SV",4106:"es-GT",18442:"es-HN",2058:"es-MX",19466:"es-NI",6154:"es-PA",15370:"es-PY",10250:"es-PE",20490:"es-PR",3082:"es",1034:"es",21514:"es-US",14346:"es-UY",8202:"es-VE",2077:"sv-FI",1053:"sv",1114:"syr",1064:"tg",2143:"tzm",1097:"ta",1092:"tt",1098:"te",1054:"th",1105:"bo",1055:"tr",1090:"tk",1152:"ug",1058:"uk",1070:"hsb",1056:"ur",2115:"uz-Cyrl",1091:"uz",1066:"vi",1106:"cy",1160:"wo",1157:"sah",1144:"ii",1130:"yo"};var nt="utf-16",st={0:"macintosh",1:"x-mac-japanese",2:"x-mac-chinesetrad",3:"x-mac-korean",6:"x-mac-greek",7:"x-mac-cyrillic",9:"x-mac-devanagai",10:"x-mac-gurmukhi",11:"x-mac-gujarati",12:"x-mac-oriya",13:"x-mac-bengali",14:"x-mac-tamil",15:"x-mac-telugu",16:"x-mac-kannada",17:"x-mac-malayalam",18:"x-mac-sinhalese",19:"x-mac-burmese",20:"x-mac-khmer",21:"x-mac-thai",22:"x-mac-lao",23:"x-mac-georgian",24:"x-mac-armenian",25:"x-mac-chinesesimp",26:"x-mac-tibetan",27:"x-mac-mongolian",28:"x-mac-ethiopic",29:"x-mac-ce",30:"x-mac-vietnamese",31:"x-mac-extarabic"},it={15:"x-mac-icelandic",17:"x-mac-turkish",18:"x-mac-croatian",24:"x-mac-ce",25:"x-mac-ce",26:"x-mac-ce",27:"x-mac-ce",28:"x-mac-ce",30:"x-mac-icelandic",37:"x-mac-romanian",38:"x-mac-ce",39:"x-mac-ce",40:"x-mac-ce",143:"x-mac-inuit",146:"x-mac-gaelic"};function at(e,t,r){switch(e){case 0:return nt;case 1:return it[r]||st[t];case 3:if(1===t||10===t)return nt}}function lt(e){var t,r={};for(t in e)r[e[t]]=parseInt(t);return r}function ut(e,t,r,o,n,s){return new S.Record("NameRecord",[{name:"platformID",type:"USHORT",value:e},{name:"encodingID",type:"USHORT",value:t},{name:"languageID",type:"USHORT",value:r},{name:"nameID",type:"USHORT",value:o},{name:"length",type:"USHORT",value:n},{name:"offset",type:"USHORT",value:s}])}function ct(e,t){if((r=function(e,t){var r=e.length,o=t.length-r+1;e:for(var n=0;n<o;n++)for(;n<o;n++){for(var s=0;s<r;s++)if(t[n+s]!==e[s])continue e;return n}return-1}(e,t))<0)for(var r=t.length,o=0,n=e.length;o<n;++o)t.push(e[o]);return r}var dt={parse:function(e,t,r){for(var o={},n=new R.Parser(e,t),t=n.parseUShort(),s=n.parseUShort(),i=n.offset+n.parseUShort(),a=0;a<s;a++){var l=n.parseUShort(),u=n.parseUShort(),c=n.parseUShort(),d=n.parseUShort(),d=et[d]||d,f=n.parseUShort(),h=n.parseUShort(),p=function(e,t,r){switch(e){case 0:if(65535===t)return"und";if(r)return r[t];break;case 1:return tt[t];case 3:return ot[t]}}(l,c,r),l=at(l,u,c);void 0!==l&&void 0!==p&&(u=void 0,(u=l===nt?m.UTF16(e,i+h,f):m.MACSTRING(e,i+h,f,l))&&((c=void 0===(c=o[d])?o[d]={}:c)[p]=u))}return 1===t&&n.parseUShort(),o},make:function(e,t){var r,o=[],n={},s=lt(et);for(r in e){var i=s[r];if(void 0===i&&(i=r),f=parseInt(i),isNaN(f))throw new Error('Name table entry "'+r+'" does not exist, see nameTableNames for complete list.');n[f]=e[r],o.push(f)}for(var a=lt(tt),l=lt(ot),u=[],c=[],d=0;d<o.length;d++){var f,h,p=n[f=o[d]];for(h in p){var m=p[h],y=1,g=a[h],v=rt[g],b=at(y,v,g),b=w.MACSTRING(m,b),j=(void 0===b&&(y=0,(g=t.indexOf(h))<0&&(g=t.length,t.push(h)),v=4,b=w.UTF16(m)),ct(b,c)),y=(u.push(ut(y,v,g,f,b.length,j)),l[h]);void 0!==y&&(g=ct(v=w.UTF16(m),c),u.push(ut(3,1,y,f,v.length,g)))}}u.sort(function(e,t){return e.platformID-t.platformID||e.encodingID-t.encodingID||e.languageID-t.languageID||e.nameID-t.nameID});for(var _=new S.Table("name",[{name:"format",type:"USHORT",value:0},{name:"count",type:"USHORT",value:u.length},{name:"stringOffset",type:"USHORT",value:6+12*u.length}]),x=0;x<u.length;x++)_.fields.push({name:"record_"+x,type:"RECORD",value:u[x]});return _.fields.push({name:"strings",type:"LITERAL",value:c}),_}},ft=[{begin:0,end:127},{begin:128,end:255},{begin:256,end:383},{begin:384,end:591},{begin:592,end:687},{begin:688,end:767},{begin:768,end:879},{begin:880,end:1023},{begin:11392,end:11519},{begin:1024,end:1279},{begin:1328,end:1423},{begin:1424,end:1535},{begin:42240,end:42559},{begin:1536,end:1791},{begin:1984,end:2047},{begin:2304,end:2431},{begin:2432,end:2559},{begin:2560,end:2687},{begin:2688,end:2815},{begin:2816,end:2943},{begin:2944,end:3071},{begin:3072,end:3199},{begin:3200,end:3327},{begin:3328,end:3455},{begin:3584,end:3711},{begin:3712,end:3839},{begin:4256,end:4351},{begin:6912,end:7039},{begin:4352,end:4607},{begin:7680,end:7935},{begin:7936,end:8191},{begin:8192,end:8303},{begin:8304,end:8351},{begin:8352,end:8399},{begin:8400,end:8447},{begin:8448,end:8527},{begin:8528,end:8591},{begin:8592,end:8703},{begin:8704,end:8959},{begin:8960,end:9215},{begin:9216,end:9279},{begin:9280,end:9311},{begin:9312,end:9471},{begin:9472,end:9599},{begin:9600,end:9631},{begin:9632,end:9727},{begin:9728,end:9983},{begin:9984,end:10175},{begin:12288,end:12351},{begin:12352,end:12447},{begin:12448,end:12543},{begin:12544,end:12591},{begin:12592,end:12687},{begin:43072,end:43135},{begin:12800,end:13055},{begin:13056,end:13311},{begin:44032,end:55215},{begin:55296,end:57343},{begin:67840,end:67871},{begin:19968,end:40959},{begin:57344,end:63743},{begin:12736,end:12783},{begin:64256,end:64335},{begin:64336,end:65023},{begin:65056,end:65071},{begin:65040,end:65055},{begin:65104,end:65135},{begin:65136,end:65279},{begin:65280,end:65519},{begin:65520,end:65535},{begin:3840,end:4095},{begin:1792,end:1871},{begin:1920,end:1983},{begin:3456,end:3583},{begin:4096,end:4255},{begin:4608,end:4991},{begin:5024,end:5119},{begin:5120,end:5759},{begin:5760,end:5791},{begin:5792,end:5887},{begin:6016,end:6143},{begin:6144,end:6319},{begin:10240,end:10495},{begin:40960,end:42127},{begin:5888,end:5919},{begin:66304,end:66351},{begin:66352,end:66383},{begin:66560,end:66639},{begin:118784,end:119039},{begin:119808,end:120831},{begin:1044480,end:1048573},{begin:65024,end:65039},{begin:917504,end:917631},{begin:6400,end:6479},{begin:6480,end:6527},{begin:6528,end:6623},{begin:6656,end:6687},{begin:11264,end:11359},{begin:11568,end:11647},{begin:19904,end:19967},{begin:43008,end:43055},{begin:65536,end:65663},{begin:65856,end:65935},{begin:66432,end:66463},{begin:66464,end:66527},{begin:66640,end:66687},{begin:66688,end:66735},{begin:67584,end:67647},{begin:68096,end:68191},{begin:119552,end:119647},{begin:73728,end:74751},{begin:119648,end:119679},{begin:7040,end:7103},{begin:7168,end:7247},{begin:7248,end:7295},{begin:43136,end:43231},{begin:43264,end:43311},{begin:43312,end:43359},{begin:43520,end:43615},{begin:65936,end:65999},{begin:66e3,end:66047},{begin:66208,end:66271},{begin:127024,end:127135}];var ht={parse:function(e,t){var r={},o=new R.Parser(e,t);r.version=o.parseUShort(),r.xAvgCharWidth=o.parseShort(),r.usWeightClass=o.parseUShort(),r.usWidthClass=o.parseUShort(),r.fsType=o.parseUShort(),r.ySubscriptXSize=o.parseShort(),r.ySubscriptYSize=o.parseShort(),r.ySubscriptXOffset=o.parseShort(),r.ySubscriptYOffset=o.parseShort(),r.ySuperscriptXSize=o.parseShort(),r.ySuperscriptYSize=o.parseShort(),r.ySuperscriptXOffset=o.parseShort(),r.ySuperscriptYOffset=o.parseShort(),r.yStrikeoutSize=o.parseShort(),r.yStrikeoutPosition=o.parseShort(),r.sFamilyClass=o.parseShort(),r.panose=[];for(var n=0;n<10;n++)r.panose[n]=o.parseByte();return r.ulUnicodeRange1=o.parseULong(),r.ulUnicodeRange2=o.parseULong(),r.ulUnicodeRange3=o.parseULong(),r.ulUnicodeRange4=o.parseULong(),r.achVendID=String.fromCharCode(o.parseByte(),o.parseByte(),o.parseByte(),o.parseByte()),r.fsSelection=o.parseUShort(),r.usFirstCharIndex=o.parseUShort(),r.usLastCharIndex=o.parseUShort(),r.sTypoAscender=o.parseShort(),r.sTypoDescender=o.parseShort(),r.sTypoLineGap=o.parseShort(),r.usWinAscent=o.parseUShort(),r.usWinDescent=o.parseUShort(),1<=r.version&&(r.ulCodePageRange1=o.parseULong(),r.ulCodePageRange2=o.parseULong()),2<=r.version&&(r.sxHeight=o.parseShort(),r.sCapHeight=o.parseShort(),r.usDefaultChar=o.parseUShort(),r.usBreakChar=o.parseUShort(),r.usMaxContent=o.parseUShort()),r},make:function(e){return new S.Table("OS/2",[{name:"version",type:"USHORT",value:3},{name:"xAvgCharWidth",type:"SHORT",value:0},{name:"usWeightClass",type:"USHORT",value:0},{name:"usWidthClass",type:"USHORT",value:0},{name:"fsType",type:"USHORT",value:0},{name:"ySubscriptXSize",type:"SHORT",value:650},{name:"ySubscriptYSize",type:"SHORT",value:699},{name:"ySubscriptXOffset",type:"SHORT",value:0},{name:"ySubscriptYOffset",type:"SHORT",value:140},{name:"ySuperscriptXSize",type:"SHORT",value:650},{name:"ySuperscriptYSize",type:"SHORT",value:699},{name:"ySuperscriptXOffset",type:"SHORT",value:0},{name:"ySuperscriptYOffset",type:"SHORT",value:479},{name:"yStrikeoutSize",type:"SHORT",value:49},{name:"yStrikeoutPosition",type:"SHORT",value:258},{name:"sFamilyClass",type:"SHORT",value:0},{name:"bFamilyType",type:"BYTE",value:0},{name:"bSerifStyle",type:"BYTE",value:0},{name:"bWeight",type:"BYTE",value:0},{name:"bProportion",type:"BYTE",value:0},{name:"bContrast",type:"BYTE",value:0},{name:"bStrokeVariation",type:"BYTE",value:0},{name:"bArmStyle",type:"BYTE",value:0},{name:"bLetterform",type:"BYTE",value:0},{name:"bMidline",type:"BYTE",value:0},{name:"bXHeight",type:"BYTE",value:0},{name:"ulUnicodeRange1",type:"ULONG",value:0},{name:"ulUnicodeRange2",type:"ULONG",value:0},{name:"ulUnicodeRange3",type:"ULONG",value:0},{name:"ulUnicodeRange4",type:"ULONG",value:0},{name:"achVendID",type:"CHARARRAY",value:"XXXX"},{name:"fsSelection",type:"USHORT",value:0},{name:"usFirstCharIndex",type:"USHORT",value:0},{name:"usLastCharIndex",type:"USHORT",value:0},{name:"sTypoAscender",type:"SHORT",value:0},{name:"sTypoDescender",type:"SHORT",value:0},{name:"sTypoLineGap",type:"SHORT",value:0},{name:"usWinAscent",type:"USHORT",value:0},{name:"usWinDescent",type:"USHORT",value:0},{name:"ulCodePageRange1",type:"ULONG",value:0},{name:"ulCodePageRange2",type:"ULONG",value:0},{name:"sxHeight",type:"SHORT",value:0},{name:"sCapHeight",type:"SHORT",value:0},{name:"usDefaultChar",type:"USHORT",value:0},{name:"usBreakChar",type:"USHORT",value:0},{name:"usMaxContext",type:"USHORT",value:0}],e)},unicodeRanges:ft,getUnicodeRange:function(e){for(var t=0;t<ft.length;t+=1){var r=ft[t];if(e>=r.begin&&e<r.end)return t}return-1}};var pt={parse:function(e,t){var r={},o=new R.Parser(e,t);switch(r.version=o.parseVersion(),r.italicAngle=o.parseFixed(),r.underlinePosition=o.parseShort(),r.underlineThickness=o.parseShort(),r.isFixedPitch=o.parseULong(),r.minMemType42=o.parseULong(),r.maxMemType42=o.parseULong(),r.minMemType1=o.parseULong(),r.maxMemType1=o.parseULong(),r.version){case 1:r.names=c.slice();break;case 2:r.numberOfGlyphs=o.parseUShort(),r.glyphNameIndex=new Array(r.numberOfGlyphs);for(var n=0;n<r.numberOfGlyphs;n++)r.glyphNameIndex[n]=o.parseUShort();r.names=[];for(var s,i=0;i<r.numberOfGlyphs;i++)r.glyphNameIndex[i]>=c.length&&(s=o.parseChar(),r.names.push(o.parseString(s)));break;case 2.5:r.numberOfGlyphs=o.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var a=0;a<r.numberOfGlyphs;a++)r.offset[a]=o.parseChar()}return r},make:function(){return new S.Table("post",[{name:"version",type:"FIXED",value:196608},{name:"italicAngle",type:"FIXED",value:0},{name:"underlinePosition",type:"FWORD",value:0},{name:"underlineThickness",type:"FWORD",value:0},{name:"isFixedPitch",type:"ULONG",value:0},{name:"minMemType42",type:"ULONG",value:0},{name:"maxMemType42",type:"ULONG",value:0},{name:"minMemType1",type:"ULONG",value:0},{name:"maxMemType1",type:"ULONG",value:0}])}},o=new Array(9),s=(o[1]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();return 1===t?{substFormat:1,coverage:this.parsePointer(u.coverage),deltaGlyphId:this.parseUShort()}:2===t?{substFormat:2,coverage:this.parsePointer(u.coverage),substitute:this.parseOffset16List()}:void A.assert(!1,"0x"+e.toString(16)+": lookup type 1 format must be 1 or 2.")},o[2]=function(){var e=this.parseUShort();return A.argument(1===e,"GSUB Multiple Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(u.coverage),sequences:this.parseListOfLists()}},o[3]=function(){var e=this.parseUShort();return A.argument(1===e,"GSUB Alternate Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(u.coverage),alternateSets:this.parseListOfLists()}},o[4]=function(){var e=this.parseUShort();return A.argument(1===e,"GSUB ligature table identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(u.coverage),ligatureSets:this.parseListOfLists(function(){return{ligGlyph:this.parseUShort(),components:this.parseUShortList(this.parseUShort()-1)}})}},{sequenceIndex:u.uShort,lookupListIndex:u.uShort});o[5]=function(){var e,t,r=this.offset+this.relativeOffset,o=this.parseUShort();return 1===o?{substFormat:o,coverage:this.parsePointer(u.coverage),ruleSets:this.parseListOfLists(function(){var e=this.parseUShort(),t=this.parseUShort();return{input:this.parseUShortList(e-1),lookupRecords:this.parseRecordList(t,s)}})}:2===o?{substFormat:o,coverage:this.parsePointer(u.coverage),classDef:this.parsePointer(u.classDef),classSets:this.parseListOfLists(function(){var e=this.parseUShort(),t=this.parseUShort();return{classes:this.parseUShortList(e-1),lookupRecords:this.parseRecordList(t,s)}})}:3===o?(e=this.parseUShort(),t=this.parseUShort(),{substFormat:o,coverages:this.parseList(e,u.pointer(u.coverage)),lookupRecords:this.parseRecordList(t,s)}):void A.assert(!1,"0x"+r.toString(16)+": lookup type 5 format must be 1, 2 or 3.")},o[6]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();return 1===t?{substFormat:1,coverage:this.parsePointer(u.coverage),chainRuleSets:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(s)}})}:2===t?{substFormat:2,coverage:this.parsePointer(u.coverage),backtrackClassDef:this.parsePointer(u.classDef),inputClassDef:this.parsePointer(u.classDef),lookaheadClassDef:this.parsePointer(u.classDef),chainClassSet:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(s)}})}:3===t?{substFormat:3,backtrackCoverage:this.parseList(u.pointer(u.coverage)),inputCoverage:this.parseList(u.pointer(u.coverage)),lookaheadCoverage:this.parseList(u.pointer(u.coverage)),lookupRecords:this.parseRecordList(s)}:void A.assert(!1,"0x"+e.toString(16)+": lookup type 6 format must be 1, 2 or 3.")},o[7]=function(){var e=this.parseUShort(),e=(A.argument(1===e,"GSUB Extension Substitution subtable identifier-format must be 1"),this.parseUShort()),t=new u(this.data,this.offset+this.parseULong());return{substFormat:1,lookupType:e,extension:o[e].call(t)}},o[8]=function(){var e=this.parseUShort();return A.argument(1===e,"GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(u.coverage),backtrackCoverage:this.parseList(u.pointer(u.coverage)),lookaheadCoverage:this.parseList(u.pointer(u.coverage)),substitutes:this.parseUShortList()}};var mt=new Array(9);mt[1]=function(e){return 1===e.substFormat?new S.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new S.Coverage(e.coverage)},{name:"deltaGlyphID",type:"USHORT",value:e.deltaGlyphId}]):new S.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:2},{name:"coverage",type:"TABLE",value:new S.Coverage(e.coverage)}].concat(S.ushortList("substitute",e.substitute)))},mt[3]=function(e){return A.assert(1===e.substFormat,"Lookup type 3 substFormat must be 1."),new S.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new S.Coverage(e.coverage)}].concat(S.tableList("altSet",e.alternateSets,function(e){return new S.Table("alternateSetTable",S.ushortList("alternate",e))})))},mt[4]=function(e){return A.assert(1===e.substFormat,"Lookup type 4 substFormat must be 1."),new S.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new S.Coverage(e.coverage)}].concat(S.tableList("ligSet",e.ligatureSets,function(e){return new S.Table("ligatureSetTable",S.tableList("ligature",e,function(e){return new S.Table("ligatureTable",[{name:"ligGlyph",type:"USHORT",value:e.ligGlyph}].concat(S.ushortList("component",e.components,e.components.length+1)))}))})))};var yt={parse:function(e,t){return t=(e=new u(e,t=t||0)).parseVersion(1),A.argument(1===t||1.1===t,"Unsupported GSUB table version."),1===t?{version:t,scripts:e.parseScriptList(),features:e.parseFeatureList(),lookups:e.parseLookupList(o)}:{version:t,scripts:e.parseScriptList(),features:e.parseFeatureList(),lookups:e.parseLookupList(o),variations:e.parseFeatureVariationsList()}},make:function(e){return new S.Table("GSUB",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new S.ScriptList(e.scripts)},{name:"features",type:"TABLE",value:new S.FeatureList(e.features)},{name:"lookups",type:"TABLE",value:new S.LookupList(e.lookups,mt)}])}};var gt={parse:function(e,t){for(var r=new R.Parser(e,t),o=r.parseULong(),n=(A.argument(1===o,"Unsupported META table version."),r.parseULong(),r.parseULong(),r.parseULong()),s={},i=0;i<n;i++){var a=r.parseTag(),l=r.parseULong(),u=r.parseULong(),l=m.UTF8(e,t+l,u);s[a]=l}return s},make:function(e){var t,r=Object.keys(e).length,o="",n=16+12*r,s=new S.Table("meta",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"offset",type:"ULONG",value:n},{name:"numTags",type:"ULONG",value:r}]);for(t in e){var i=o.length;o+=e[t],s.fields.push({name:"tag "+t,type:"TAG",value:t}),s.fields.push({name:"offset "+t,type:"ULONG",value:n+i}),s.fields.push({name:"length "+t,type:"ULONG",value:e[t].length})}return s.fields.push({name:"stringPool",type:"CHARARRAY",value:o}),s}};function vt(e){return Math.log(e)/Math.log(2)|0}function bt(e){for(;e.length%4!=0;)e.push(0);for(var t=0,r=0;r<e.length;r+=4)t+=(e[r]<<24)+(e[r+1]<<16)+(e[r+2]<<8)+e[r+3];return t%=Math.pow(2,32)}function jt(e,t,r,o){return new S.Record("Table Record",[{name:"tag",type:"TAG",value:void 0!==e?e:""},{name:"checkSum",type:"ULONG",value:void 0!==t?t:0},{name:"offset",type:"ULONG",value:void 0!==r?r:0},{name:"length",type:"ULONG",value:void 0!==o?o:0}])}function _t(e){for(var t=new S.Table("sfnt",[{name:"version",type:"TAG",value:"OTTO"},{name:"numTables",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]),r=(t.tables=e,t.numTables=e.length,Math.pow(2,vt(t.numTables))),o=(t.searchRange=16*r,t.entrySelector=vt(r),t.rangeShift=16*t.numTables-t.searchRange,[]),n=[],s=t.sizeOf()+jt().sizeOf()*t.numTables;s%4!=0;)s+=1,n.push({name:"padding",type:"BYTE",value:0});for(var i=0;i<e.length;i+=1){var a=e[i],l=(A.argument(4===a.tableName.length,"Table name"+a.tableName+" is invalid."),a.sizeOf()),u=jt(a.tableName,bt(a.encode()),s,l);for(o.push({name:u.tag+" Table Record",type:"RECORD",value:u}),n.push({name:a.tableName+" table",type:"RECORD",value:a}),s+=l,A.argument(!isNaN(s),"Something went wrong calculating the offset.");s%4!=0;)s+=1,n.push({name:"padding",type:"BYTE",value:0})}return o.sort(function(e,t){return e.value.tag>t.value.tag?1:-1}),t.fields=t.fields.concat(o),t.fields=t.fields.concat(n),t}function xt(e,t,r){for(var o=0;o<t.length;o+=1){var n=e.charToGlyphIndex(t[o]);if(0<n)return e.glyphs.get(n).getMetrics()}return r}var wt={make:_t,fontToTable:function(e){for(var t,r=[],o=[],n=[],s=[],i=[],a=[],l=[],u=0,c=0,d=0,f=0,h=0,p=0;p<e.glyphs.length;p+=1){var m=e.glyphs.get(p),y=0|m.unicode;if(isNaN(m.advanceWidth))throw new Error("Glyph "+m.name+" ("+p+"): advanceWidth is not a number.");(y<t||void 0===t)&&0<y&&(t=y),u<y&&(u=y);var y=ht.getUnicodeRange(y);if(y<32)c|=1<<y;else if(y<64)d|=1<<y-32;else if(y<96)f|=1<<y-64;else{if(!(y<123))throw new Error("Unicode ranges bits > 123 are reserved for internal usage");h|=1<<y-96}".notdef"!==m.name&&(y=m.getMetrics(),r.push(y.xMin),o.push(y.yMin),n.push(y.xMax),s.push(y.yMax),a.push(y.leftSideBearing),l.push(y.rightSideBearing),i.push(m.advanceWidth))}var g,v={xMin:Math.min.apply(null,r),yMin:Math.min.apply(null,o),xMax:Math.max.apply(null,n),yMax:Math.max.apply(null,s),advanceWidthMax:Math.max.apply(null,i),advanceWidthAvg:function(e){for(var t=0,r=0;r<e.length;r+=1)t+=e[r];return t/e.length}(i),minLeftSideBearing:Math.min.apply(null,a),maxLeftSideBearing:Math.max.apply(null,a),minRightSideBearing:Math.min.apply(null,l)},b=(v.ascender=e.ascender,v.descender=e.descender,Ze.make({flags:3,unitsPerEm:e.unitsPerEm,xMin:v.xMin,yMin:v.yMin,xMax:v.xMax,yMax:v.yMax,lowestRecPPEM:3,createdTimestamp:e.createdTimestamp})),j=Qe.make({ascender:v.ascender,descender:v.descender,advanceWidthMax:v.advanceWidthMax,minLeftSideBearing:v.minLeftSideBearing,minRightSideBearing:v.minRightSideBearing,xMaxExtent:v.maxLeftSideBearing+(v.xMax-v.xMin),numberOfHMetrics:e.glyphs.length}),_=$e.make(e.glyphs.length),x=ht.make({xAvgCharWidth:Math.round(v.advanceWidthAvg),usWeightClass:e.tables.os2.usWeightClass,usWidthClass:e.tables.os2.usWidthClass,usFirstCharIndex:t,usLastCharIndex:u,ulUnicodeRange1:c,ulUnicodeRange2:d,ulUnicodeRange3:f,ulUnicodeRange4:h,fsSelection:e.tables.os2.fsSelection,sTypoAscender:v.ascender,sTypoDescender:v.descender,sTypoLineGap:0,usWinAscent:v.yMax,usWinDescent:Math.abs(v.yMin),ulCodePageRange1:1,sxHeight:xt(e,"xyvw",{yMax:Math.round(v.ascender/2)}).yMax,sCapHeight:xt(e,"HIKLEFJMNTZBDPRAGOQSUVWXY",v).yMax,usDefaultChar:e.hasChar(" ")?32:0,usBreakChar:e.hasChar(" ")?32:0}),w=Je.make(e.glyphs),S=we.make(e.glyphs),M=e.getEnglishName("fontFamily"),E=e.getEnglishName("fontSubfamily"),T=M+" "+E,C=(C=e.getEnglishName("postScriptName"))||M.replace(/\s/g,"")+"-"+E,O={};for(g in e.names)O[g]=e.names[g];O.uniqueID||(O.uniqueID={en:e.getEnglishName("manufacturer")+":"+T}),O.postScriptName||(O.postScriptName={en:C}),O.preferredFamily||(O.preferredFamily=e.names.fontFamily),O.preferredSubfamily||(O.preferredSubfamily=e.names.fontSubfamily);var k=[],L=dt.make(O,k),k=0<k.length?Ke.make(k):void 0,P=pt.make(),T=Ye.make(e.glyphs,{version:e.getEnglishName("version"),fullName:T,familyName:M,weightName:E,postScriptName:C,unitsPerEm:e.unitsPerEm,fontBBox:[0,v.yMin,v.ascender,v.advanceWidthMax]}),M=e.metas&&0<Object.keys(e.metas).length?gt.make(e.metas):void 0,E=[b,j,_,x,L,S,P,T,w];k&&E.push(k),e.tables.gsub&&E.push(yt.make(e.tables.gsub)),M&&E.push(M);for(var D=bt((C=_t(E)).encode()),A=C.fields,R=!1,I=0;I<A.length;I+=1)if("head table"===A[I].name){A[I].value.checkSumAdjustment=2981146554-D,R=!0;break}if(R)return C;throw new Error("Could not find head table with checkSum to adjust.")},computeCheckSum:bt};function St(e,t){for(var r=0,o=e.length-1;r<=o;){var n=r+o>>>1,s=e[n].tag;if(s===t)return n;s<t?r=1+n:o=n-1}return-r-1}function Mt(e,t){for(var r=0,o=e.length-1;r<=o;){var n=r+o>>>1,s=e[n];if(s===t)return n;s<t?r=1+n:o=n-1}return-r-1}function Et(e,t){for(var r=0,o=e.length-1;r<=o;){var n,s=r+o>>>1,i=(n=e[s]).start;if(i===t)return n;i<t?r=1+s:o=s-1}if(0<r)return t>(n=e[r-1]).end?0:n}function Tt(e,t){this.font=e,this.tableName=t}function Ct(e){Tt.call(this,e,"gpos")}function i(e){Tt.call(this,e,"gsub")}function Ot(e,t,r){for(var o=e.subtables,n=0;n<o.length;n++){var s=o[n];if(s.substFormat===t)return s}if(r)return o.push(r),r}function kt(e){for(var t=new ArrayBuffer(e.length),r=new Uint8Array(t),o=0;o<e.length;++o)r[o]=e[o];return t}function _(e,t){if(!e)throw t}function Lt(e,t,r,o,n){var s=0<(t&o)?(s=e.parseByte(),r+(s=0==(t&n)?-s:s)):0<(t&n)?r:r+e.parseShort();return s}function Pt(e,t,r){var o,n=new R.Parser(t,r);if(e.numberOfContours=n.parseShort(),e._xMin=n.parseShort(),e._yMin=n.parseShort(),e._xMax=n.parseShort(),e._yMax=n.parseShort(),0<e.numberOfContours){for(var s=e.endPointIndices=[],i=0;i<e.numberOfContours;i+=1)s.push(n.parseUShort());e.instructionLength=n.parseUShort(),e.instructions=[];for(var a=0;a<e.instructionLength;a+=1)e.instructions.push(n.parseByte());for(var l=s[s.length-1]+1,u=[],c=0;c<l;c+=1)if(o=n.parseByte(),u.push(o),0<(8&o))for(var d=n.parseByte(),f=0;f<d;f+=1)u.push(o),c+=1;if(A.argument(u.length===l,"Bad flags."),0<s.length){var h,p=[];if(0<l){for(var m=0;m<l;m+=1)o=u[m],(h={}).onCurve=!!(1&o),h.lastPointOfContour=0<=s.indexOf(m),p.push(h);for(var y=0,g=0;g<l;g+=1)o=u[g],(h=p[g]).x=Lt(n,o,y,2,16),y=h.x;for(var v=0,b=0;b<l;b+=1)o=u[b],(h=p[b]).y=Lt(n,o,v,4,32),v=h.y}e.points=p}else e.points=[]}else if(0===e.numberOfContours)e.points=[];else{e.isComposite=!0,e.points=[],e.components=[];for(var j=!0;j;){u=n.parseUShort();var _={glyphIndex:n.parseUShort(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};0<(1&u)?0<(2&u)?(_.dx=n.parseShort(),_.dy=n.parseShort()):_.matchedPoints=[n.parseUShort(),n.parseUShort()]:0<(2&u)?(_.dx=n.parseChar(),_.dy=n.parseChar()):_.matchedPoints=[n.parseByte(),n.parseByte()],0<(8&u)?_.xScale=_.yScale=n.parseF2Dot14():0<(64&u)?(_.xScale=n.parseF2Dot14(),_.yScale=n.parseF2Dot14()):0<(128&u)&&(_.xScale=n.parseF2Dot14(),_.scale01=n.parseF2Dot14(),_.scale10=n.parseF2Dot14(),_.yScale=n.parseF2Dot14()),e.components.push(_),j=!!(32&u)}if(256&u){e.instructionLength=n.parseUShort(),e.instructions=[];for(var x=0;x<e.instructionLength;x+=1)e.instructions.push(n.parseByte())}}}function At(e,t){for(var r=[],o=0;o<e.length;o+=1){var n=e[o],n={x:t.xScale*n.x+t.scale01*n.y+t.dx,y:t.scale10*n.x+t.yScale*n.y+t.dy,onCurve:n.onCurve,lastPointOfContour:n.lastPointOfContour};r.push(n)}return r}function Rt(e){var t=new f;if(e)for(var r=function(e){for(var t=[],r=[],o=0;o<e.length;o+=1){var n=e[o];r.push(n),n.lastPointOfContour&&(t.push(r),r=[])}return A.argument(0===r.length,"There are still points left in the current contour."),t}(e),o=0;o<r.length;++o){var n,s=r[o],i=s[s.length-1],a=s[0];i.onCurve?t.moveTo(i.x,i.y):a.onCurve?t.moveTo(a.x,a.y):(n={x:.5*(i.x+a.x),y:.5*(i.y+a.y)},t.moveTo(n.x,n.y));for(var l=0;l<s.length;++l){var u,c=i,i=a,a=s[(l+1)%s.length];i.onCurve?t.lineTo(i.x,i.y):(u=a,c.onCurve||(i.x,c.x,i.y,c.y),a.onCurve||(u={x:.5*(i.x+a.x),y:.5*(i.y+a.y)}),t.quadraticCurveTo(i.x,i.y,u.x,u.y))}t.closePath()}return t}function It(e,t){if(t.isComposite)for(var r=0;r<t.components.length;r+=1){var o=t.components[r],n=e.get(o.glyphIndex);if(n.getPath(),n.points){var s=void 0;if(void 0===o.matchedPoints)s=At(n.points,o);else{if(o.matchedPoints[0]>t.points.length-1||o.matchedPoints[1]>n.points.length-1)throw Error("Matched points out of range in "+t.name);var i=t.points[o.matchedPoints[0]],a=n.points[o.matchedPoints[1]],o={xScale:o.xScale,scale01:o.scale01,scale10:o.scale10,yScale:o.yScale,dx:0,dy:0},a=At([a],o)[0];o.dx=i.x-a.x,o.dy=i.y-a.y,s=At(n.points,o)}t.points=t.points.concat(s)}}return Rt(t.points)}(Ct.prototype=Tt.prototype={searchTag:St,binSearch:Mt,getTable:function(e){var t=this.font.tables[this.tableName];return t=!t&&e?this.font.tables[this.tableName]=this.createDefaultTable():t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,r=0;r<e.scripts.length;r++){var o=e.scripts[r].tag;if("DFLT"===o)return o;"latn"===o&&(t=!0)}return t?"latn":void 0}},getScriptTable:function(e,t){var r,o=this.getTable(t);if(o)return r=o.scripts,0<=(o=St(o.scripts,e=e||"DFLT"))?r[o].script:t?(r.splice(-1-o,0,t={tag:e,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}}),t.script):void 0},getLangSysTable:function(e,t,r){var o,e=this.getScriptTable(e,r);if(e)return t&&"dflt"!==t&&"DFLT"!==t?0<=(o=St(e.langSysRecords,t))?e.langSysRecords[o].langSys:r?(e.langSysRecords.splice(-1-o,0,r={tag:t,langSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]}}),r.langSys):void 0:e.defaultLangSys},getFeatureTable:function(e,t,r,o){e=this.getLangSysTable(e,t,o);if(e){for(var n,s=e.featureIndexes,i=this.font.tables[this.tableName].features,a=0;a<s.length;a++)if((n=i[s[a]]).tag===r)return n.feature;if(o)return t=i.length,A.assert(0===t||r>=i[t-1].tag,"Features must be added in alphabetical order."),i.push(n={tag:r,feature:{params:0,lookupListIndexes:[]}}),s.push(t),n.feature}},getLookupTables:function(e,t,r,o,n){var e=this.getFeatureTable(e,t,r,n),s=[];if(e){for(var i,a=e.lookupListIndexes,l=this.font.tables[this.tableName].lookups,u=0;u<a.length;u++)(i=l[a[u]]).lookupType===o&&s.push(i);if(0===s.length&&n)return t=l.length,l.push(i={lookupType:o,lookupFlag:0,subtables:[],markFilteringSet:void 0}),a.push(t),[i]}return s},getGlyphClass:function(e,t){switch(e.format){case 1:return e.startGlyph<=t&&t<e.startGlyph+e.classes.length?e.classes[t-e.startGlyph]:0;case 2:var r=Et(e.ranges,t);return r?r.classId:0}},getCoverageIndex:function(e,t){switch(e.format){case 1:var r=Mt(e.glyphs,t);return 0<=r?r:-1;case 2:r=Et(e.ranges,t);return r?r.index+t-r.start:-1}},expandCoverage:function(e){if(1===e.format)return e.glyphs;for(var t=[],r=e.ranges,o=0;o<r.length;o++)for(var n=r[o],s=n.start,i=n.end,a=s;a<=i;a++)t.push(a);return t}}).init=function(){var e=this.getDefaultScriptName();this.defaultKerningTables=this.getKerningTables(e)},Ct.prototype.getKerningValue=function(e,t,r){for(var o=0;o<e.length;o++)for(var n=e[o].subtables,s=0;s<n.length;s++){var i=n[s],a=this.getCoverageIndex(i.coverage,t);if(!(a<0))switch(i.posFormat){case 1:for(var l=i.pairSets[a],u=0;u<l.length;u++){var c=l[u];if(c.secondGlyph===r)return c.value1&&c.value1.xAdvance||0}break;case 2:var d=this.getGlyphClass(i.classDef1,t),f=this.getGlyphClass(i.classDef2,r),d=i.classRecords[d][f];return d.value1&&d.value1.xAdvance||0}}return 0},Ct.prototype.getKerningTables=function(e,t){if(this.font.tables.gpos)return this.getLookupTables(e,t,"kern",2)},(i.prototype=Tt.prototype).createDefaultTable=function(){return{version:1,scripts:[{tag:"DFLT",script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}}],features:[],lookups:[]}},i.prototype.getSingle=function(e,t,r){for(var o=[],n=this.getLookupTables(t,r,e,1),s=0;s<n.length;s++)for(var i=n[s].subtables,a=0;a<i.length;a++){var l=i[a],u=this.expandCoverage(l.coverage),c=void 0;if(1===l.substFormat)for(var d=l.deltaGlyphId,c=0;c<u.length;c++){var f=u[c];o.push({sub:f,by:f+d})}else{var h=l.substitute;for(c=0;c<u.length;c++)o.push({sub:u[c],by:h[c]})}}return o},i.prototype.getAlternates=function(e,t,r){for(var o=[],n=this.getLookupTables(t,r,e,3),s=0;s<n.length;s++)for(var i=n[s].subtables,a=0;a<i.length;a++)for(var l=i[a],u=this.expandCoverage(l.coverage),c=l.alternateSets,d=0;d<u.length;d++)o.push({sub:u[d],by:c[d]});return o},i.prototype.getLigatures=function(e,t,r){for(var o=[],n=this.getLookupTables(t,r,e,4),s=0;s<n.length;s++)for(var i=n[s].subtables,a=0;a<i.length;a++)for(var l=i[a],u=this.expandCoverage(l.coverage),c=l.ligatureSets,d=0;d<u.length;d++)for(var f=u[d],h=c[d],p=0;p<h.length;p++){var m=h[p];o.push({sub:[f].concat(m.components),by:m.ligGlyph})}return o},i.prototype.addSingle=function(e,t,r,o){r=Ot(this.getLookupTables(r,o,e,1,!0)[0],2,{substFormat:2,coverage:{format:1,glyphs:[]},substitute:[]}),A.assert(1===r.coverage.format,"Ligature: unable to modify coverage table format "+r.coverage.format),o=t.sub,e=this.binSearch(r.coverage.glyphs,o);e<0&&(r.coverage.glyphs.splice(e=-1-e,0,o),r.substitute.splice(e,0,0)),r.substitute[e]=t.by},i.prototype.addAlternate=function(e,t,r,o){r=Ot(this.getLookupTables(r,o,e,3,!0)[0],1,{substFormat:1,coverage:{format:1,glyphs:[]},alternateSets:[]}),A.assert(1===r.coverage.format,"Ligature: unable to modify coverage table format "+r.coverage.format),o=t.sub,e=this.binSearch(r.coverage.glyphs,o);e<0&&(r.coverage.glyphs.splice(e=-1-e,0,o),r.alternateSets.splice(e,0,0)),r.alternateSets[e]=t.by},i.prototype.addLigature=function(e,t,r,o){var r=this.getLookupTables(r,o,e,4,!0)[0],o=r.subtables[0],e=(o||(r.subtables[0]=o={substFormat:1,coverage:{format:1,glyphs:[]},ligatureSets:[]}),A.assert(1===o.coverage.format,"Ligature: unable to modify coverage table format "+o.coverage.format),t.sub[0]),n=t.sub.slice(1),r={ligGlyph:t.by,components:n},t=this.binSearch(o.coverage.glyphs,e);if(0<=t){for(var s=o.ligatureSets[t],i=0;i<s.length;i++)if(function(e,t){var r=e.length;if(r===t.length){for(var o=0;o<r;o++)if(e[o]!==t[o])return;return 1}}(s[i].components,n))return;s.push(r)}else o.coverage.glyphs.splice(t=-1-t,0,e),o.ligatureSets.splice(t,0,[r])},i.prototype.getFeature=function(e,t,r){if(/ss\d\d/.test(e))return this.getSingle(e,t,r);switch(e){case"aalt":case"salt":return this.getSingle(e,t,r).concat(this.getAlternates(e,t,r));case"dlig":case"liga":case"rlig":return this.getLigatures(e,t,r)}},i.prototype.add=function(e,t,r,o){if(/ss\d\d/.test(e))return this.addSingle(e,t,r,o);switch(e){case"aalt":case"salt":return"number"==typeof t.by?this.addSingle(e,t,r,o):this.addAlternate(e,t,r,o);case"dlig":case"liga":case"rlig":return this.addLigature(e,t,r,o)}};var Dt={getPath:Rt,parse:function(e,t,r,o){for(var n=new p.GlyphSet(o),s=0;s<r.length-1;s+=1){var i=r[s];i!==r[s+1]?n.push(s,p.ttfGlyphLoader(o,s,Pt,e,t+i,It)):n.push(s,p.glyphLoader(o,s))}return n}};function Ut(e){this.font=e,this.getCommands=function(e){return Dt.getPath(e).commands},this._fpgmState=this._prepState=void 0,this._errorState=0}function Nt(e){return e}function Ft(e){return Math.sign(e)*Math.round(Math.abs(e))}function Bt(e){return Math.sign(e)*Math.round(Math.abs(2*e))/2}function Gt(e){return Math.sign(e)*(Math.round(Math.abs(e)+.5)-.5)}function Vt(e){return Math.sign(e)*Math.ceil(Math.abs(e))}function zt(e){return Math.sign(e)*Math.floor(Math.abs(e))}function Ht(e){var t=this.srPeriod,r=this.srPhase,o=1;return e<0&&(e=-e,o=-1),e+=this.srThreshold-r,e=Math.trunc(e/t)*t,(e+=r)<0?r*o:e*o}var x={x:1,y:0,axis:"x",distance:function(e,t,r,o){return(r?e.xo:e.x)-(o?t.xo:t.x)},interpolate:function(e,t,r,o){var n,s,i,a,l,u,c;if(!o||o===this)return n=e.xo-t.xo,s=e.xo-r.xo,l=t.x-t.xo,u=r.x-r.xo,0===(c=(i=Math.abs(n))+(a=Math.abs(s)))?void(e.x=e.xo+(l+u)/2):void(e.x=e.xo+(l*a+u*i)/c);n=o.distance(e,t,!0,!0),s=o.distance(e,r,!0,!0),l=o.distance(t,t,!1,!0),u=o.distance(r,r,!1,!0),0===(c=(i=Math.abs(n))+(a=Math.abs(s)))?x.setRelative(e,e,(l+u)/2,o,!0):x.setRelative(e,e,(l*a+u*i)/c,o,!0)},normalSlope:Number.NEGATIVE_INFINITY,setRelative:function(e,t,r,o,n){var s,i;o&&o!==this?(s=n?t.xo:t.x,i=n?t.yo:t.y,s+=r*o.x,i+=r*o.y,e.x=s+(e.y-i)/o.normalSlope):e.x=(n?t.xo:t.x)+r},slope:0,touch:function(e){e.xTouched=!0},touched:function(e){return e.xTouched},untouch:function(e){e.xTouched=!1}},M={x:0,y:1,axis:"y",distance:function(e,t,r,o){return(r?e.yo:e.y)-(o?t.yo:t.y)},interpolate:function(e,t,r,o){var n,s,i,a,l,u,c;if(!o||o===this)return n=e.yo-t.yo,s=e.yo-r.yo,l=t.y-t.yo,u=r.y-r.yo,0===(c=(i=Math.abs(n))+(a=Math.abs(s)))?void(e.y=e.yo+(l+u)/2):void(e.y=e.yo+(l*a+u*i)/c);n=o.distance(e,t,!0,!0),s=o.distance(e,r,!0,!0),l=o.distance(t,t,!1,!0),u=o.distance(r,r,!1,!0),0===(c=(i=Math.abs(n))+(a=Math.abs(s)))?M.setRelative(e,e,(l+u)/2,o,!0):M.setRelative(e,e,(l*a+u*i)/c,o,!0)},normalSlope:0,setRelative:function(e,t,r,o,n){var s,i;o&&o!==this?(s=n?t.xo:t.x,i=n?t.yo:t.y,s+=r*o.x,i+=r*o.y,e.y=i+o.normalSlope*(e.x-s)):e.y=(n?t.yo:t.y)+r},slope:Number.POSITIVE_INFINITY,touch:function(e){e.yTouched=!0},touched:function(e){return e.yTouched},untouch:function(e){e.yTouched=!1}};function Wt(e,t){this.x=e,this.y=t,this.axis=void 0,this.slope=t/e,this.normalSlope=-e/t,Object.freeze(this)}function qt(e,t){var r=Math.sqrt(e*e+t*t);return t/=r,1===(e/=r)&&0===t?x:0===e&&1===t?M:new Wt(e,t)}function E(e,t,r,o){this.x=this.xo=Math.round(64*e)/64,this.y=this.yo=Math.round(64*t)/64,this.lastPointOfContour=r,this.onCurve=o,this.prevPointOnContour=void 0,this.nextPointOnContour=void 0,this.xTouched=!1,this.yTouched=!1,Object.preventExtensions(this)}Object.freeze(x),Object.freeze(M),Wt.prototype.distance=function(e,t,r,o){return this.x*x.distance(e,t,r,o)+this.y*M.distance(e,t,r,o)},Wt.prototype.interpolate=function(e,t,r,o){var n=o.distance(e,t,!0,!0),s=o.distance(e,r,!0,!0),t=o.distance(t,t,!1,!0),r=o.distance(r,r,!1,!0),n=Math.abs(n),s=Math.abs(s),i=n+s;0===i?this.setRelative(e,e,(t+r)/2,o,!0):this.setRelative(e,e,(t*s+r*n)/i,o,!0)},Wt.prototype.setRelative=function(e,t,r,o,n){var s=n?t.xo:t.x,n=n?t.yo:t.y,t=s+r*(o=o||this).x,s=n+r*o.y,n=o.normalSlope,r=this.slope,o=e.x,i=e.y;e.x=(r*o-n*t+s-i)/(r-n),e.y=r*(e.x-o)+i},Wt.prototype.touch=function(e){e.xTouched=!0,e.yTouched=!0},E.prototype.nextTouched=function(e){for(var t=this.nextPointOnContour;!e.touched(t)&&t!==this;)t=t.nextPointOnContour;return t},E.prototype.prevTouched=function(e){for(var t=this.prevPointOnContour;!e.touched(t)&&t!==this;)t=t.prevPointOnContour;return t};var Xt=Object.freeze(new E(0,0)),Yt={cvCutIn:17/16,deltaBase:9,deltaShift:.125,loop:1,minDis:1,autoFlip:!0};function T(e,t){switch(this.env=e,this.stack=[],this.prog=t,e){case"glyf":this.zp0=this.zp1=this.zp2=1,this.rp0=this.rp1=this.rp2=0;case"prep":this.fv=this.pv=this.dpv=x,this.round=Ft}}function Zt(e){for(var t=e.tZone=new Array(e.gZone.length),r=0;r<t.length;r++)t[r]=new E(0,0)}function Qt(e,t){var r,o=e.prog,n=e.ip,s=1;do{if(88===(r=o[++n]))s++;else if(89===r)s--;else if(64===r)n+=o[n+1]+1;else if(65===r)n+=2*o[n+1]+1;else if(176<=r&&r<=183)n+=r-176+1;else if(184<=r&&r<=191)n+=2*(r-184+1);else if(t&&1===s&&27===r)break}while(0<s);e.ip=n}function Jt(e,t){j.DEBUG&&console.log(t.step,"SVTCA["+e.axis+"]"),t.fv=t.pv=t.dpv=e}function Kt(e,t){j.DEBUG&&console.log(t.step,"SPVTCA["+e.axis+"]"),t.pv=t.dpv=e}function $t(e,t){j.DEBUG&&console.log(t.step,"SFVTCA["+e.axis+"]"),t.fv=e}function er(e,t){var r,o=t.stack,n=o.pop(),o=o.pop(),s=t.z2[n],i=t.z1[o];j.DEBUG&&console.log("SPVTL["+e+"]",n,o),n=e?(r=s.y-i.y,i.x-s.x):(r=i.x-s.x,i.y-s.y),t.pv=t.dpv=qt(r,n)}function tr(e,t){var r,o=t.stack,n=o.pop(),o=o.pop(),s=t.z2[n],i=t.z1[o];j.DEBUG&&console.log("SFVTL["+e+"]",n,o),n=e?(r=s.y-i.y,i.x-s.x):(r=i.x-s.x,i.y-s.y),t.fv=qt(r,n)}function rr(e){j.DEBUG&&console.log(e.step,"POP[]"),e.stack.pop()}function or(e,t){var r=t.stack.pop(),o=t.z0[r],n=t.fv,s=t.pv,i=(j.DEBUG&&console.log(t.step,"MDAP["+e+"]",r),s.distance(o,Xt));e&&(i=t.round(i)),n.setRelative(o,Xt,i,s),n.touch(o),t.rp0=t.rp1=r}function nr(e,t){var r,o,n,s=t.z2,i=s.length-2;j.DEBUG&&console.log(t.step,"IUP["+e.axis+"]");for(var a=0;a<i;a++)r=s[a],e.touched(r)||(o=r.prevTouched(e))!==r&&(o===(n=r.nextTouched(e))&&e.setRelative(r,r,e.distance(o,o,!1,!0),e,!0),e.interpolate(r,o,n,e))}function sr(e,t){for(var r=t.stack,o=e?t.rp1:t.rp2,n=(e?t.z0:t.z1)[o],s=t.fv,i=t.pv,a=t.loop,l=t.z2;a--;){var u=r.pop(),c=l[u],d=i.distance(n,n,!1,!0);s.setRelative(c,c,d,i),s.touch(c),j.DEBUG&&console.log(t.step,(1<t.loop?"loop "+(t.loop-a)+": ":"")+"SHP["+(e?"rp1":"rp2")+"]",u)}t.loop=1}function ir(e,t){for(var r=t.stack,o=e?t.rp1:t.rp2,n=(e?t.z0:t.z1)[o],s=t.fv,i=t.pv,o=r.pop(),a=t.z2[t.contours[o]],l=a,u=(j.DEBUG&&console.log(t.step,"SHC["+e+"]",o),i.distance(n,n,!1,!0));l!==n&&s.setRelative(l,l,u,i),(l=l.nextPointOnContour)!==a;);}function ar(e,t){var r,o,n=t.stack,s=e?t.rp1:t.rp2,s=(e?t.z0:t.z1)[s],i=t.fv,a=t.pv,n=n.pop();switch(j.DEBUG&&console.log(t.step,"SHZ["+e+"]",n),n){case 0:r=t.tZone;break;case 1:r=t.gZone;break;default:throw new Error("Invalid zone")}for(var l=a.distance(s,s,!1,!0),u=r.length-2,c=0;c<u;c++)o=r[c],i.setRelative(o,o,l,a)}function lr(e,t){var r=t.stack,o=r.pop()/64,r=r.pop(),n=t.z1[r],s=t.z0[t.rp0],i=t.fv,a=t.pv;i.setRelative(n,s,o,a),i.touch(n),j.DEBUG&&console.log(t.step,"MSIRP["+e+"]",o,r),t.rp1=t.rp0,t.rp2=r,e&&(t.rp0=r)}function ur(e,t){var r=t.stack,o=r.pop(),r=r.pop(),n=t.z0[r],s=t.fv,i=t.pv,a=t.cvt[o],o=(j.DEBUG&&console.log(t.step,"MIAP["+e+"]",o,"(",a,")",r),i.distance(n,Xt));e&&(Math.abs(o-a)<t.cvCutIn&&(o=a),o=t.round(o)),s.setRelative(n,Xt,o,i),0===t.zp0&&(n.xo=n.x,n.yo=n.y),s.touch(n),t.rp0=t.rp1=r}function cr(e,t){var r=t.stack,o=r.pop(),n=t.z2[o];j.DEBUG&&console.log(t.step,"GC["+e+"]",o),r.push(64*t.dpv.distance(n,Xt,e,!1))}function dr(e,t){var r=t.stack,o=r.pop(),r=r.pop(),n=t.z1[o],s=t.z0[r],s=t.dpv.distance(s,n,e,e);j.DEBUG&&console.log(t.step,"MD["+e+"]",o,r,"->",s),t.stack.push(Math.round(64*s))}function fr(e,t){var r=t.stack,o=r.pop(),n=t.fv,s=t.pv,i=t.ppem,a=t.deltaBase+16*(e-1),l=t.deltaShift,u=t.z0;j.DEBUG&&console.log(t.step,"DELTAP["+e+"]",o,r);for(var c=0;c<o;c++){var d=r.pop(),f=r.pop();a+((240&f)>>4)===i&&(0<=(f=(15&f)-8)&&f++,j.DEBUG&&console.log(t.step,"DELTAPFIX",d,"by",f*l),d=u[d],n.setRelative(d,d,f*l,s))}}function hr(e,t){var r=t.stack,o=r.pop();j.DEBUG&&console.log(t.step,"ROUND[]"),r.push(64*t.round(o/64))}function pr(e,t){var r=t.stack,o=r.pop(),n=t.ppem,s=t.deltaBase+16*(e-1),i=t.deltaShift;j.DEBUG&&console.log(t.step,"DELTAC["+e+"]",o,r);for(var a=0;a<o;a++){var l=r.pop(),u=r.pop();s+((240&u)>>4)===n&&(0<=(u=(15&u)-8)&&u++,u=u*i,j.DEBUG&&console.log(t.step,"DELTACFIX",l,"by",u),t.cvt[l]+=u)}}function mr(e,t){var r,o=t.stack,n=o.pop(),o=o.pop(),s=t.z2[n],i=t.z1[o];j.DEBUG&&console.log(t.step,"SDPVTL["+e+"]",n,o),n=e?(r=s.y-i.y,i.x-s.x):(r=i.x-s.x,i.y-s.y),t.dpv=qt(r,n)}function C(e,t){var r=t.stack,o=t.prog,n=t.ip;j.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(var s=0;s<e;s++)r.push(o[++n]);t.ip=n}function O(e,t){var r=t.ip,o=t.prog,n=t.stack;j.DEBUG&&console.log(t.ip,"PUSHW["+e+"]");for(var s=0;s<e;s++){var i=o[++r]<<8|o[++r];32768&i&&(i=-(1+(65535^i))),n.push(i)}t.ip=r}function k(e,t,r,o,n,s){var i,a,l=s.stack,u=e&&l.pop(),l=l.pop(),c=s.rp0,c=s.z0[c],d=s.z1[l],f=s.minDis,h=s.fv,p=s.dpv,m=i=p.distance(d,c,!0,!0),y=0<=m?1:-1;m=Math.abs(m),e&&(a=s.cvt[u],o&&Math.abs(m-a)<s.cvCutIn&&(m=a)),r&&m<f&&(m=f),o&&(m=s.round(m)),h.setRelative(d,c,y*m,p),h.touch(d),j.DEBUG&&console.log(s.step,(e?"MIRP[":"MDRP[")+(t?"M":"m")+(r?">":"_")+(o?"R":"_")+(0===n?"Gr":1===n?"Bl":2===n?"Wh":"")+"]",e?u+"("+s.cvt[u]+","+a+")":"",l,"(d =",i,"->",y*m,")"),s.rp1=s.rp0,s.rp2=l,t&&(s.rp0=l)}Ut.prototype.exec=function(e,t){if("number"!=typeof t)throw new Error("Point size is not a number!");if(!(2<this._errorState)){var r=this.font,o=this._prepState;if(!o||o.ppem!==t){var n=this._fpgmState;if(!n){T.prototype=Yt,(n=this._fpgmState=new T("fpgm",r.tables.fpgm)).funcs=[],n.font=r,j.DEBUG&&(console.log("---EXEC FPGM---"),n.step=-1);try{vr(n)}catch(e){return console.log("Hinting error in FPGM:"+e),void(this._errorState=3)}}T.prototype=n,(o=this._prepState=new T("prep",r.tables.prep)).ppem=t;var s=r.tables.cvt;if(s)for(var i=o.cvt=new Array(s.length),a=t/r.unitsPerEm,l=0;l<s.length;l++)i[l]=s[l]*a;else o.cvt=[];j.DEBUG&&(console.log("---EXEC PREP---"),o.step=-1);try{vr(o)}catch(e){this._errorState<2&&console.log("Hinting error in PREP:"+e),this._errorState=2}}if(!(1<this._errorState))try{return yr(e,o)}catch(e){this._errorState<1&&(console.log("Hinting error:"+e),console.log("Note: further hinting errors are silenced")),this._errorState=1}}};var yr=function(e,t){var r=t.ppem/t.font.unitsPerEm,o=r,n=e.components;if(T.prototype=t,n){for(var s=t.font,i=[],a=[],l=0;l<n.length;l++){var u=n[l],c=s.glyphs.get(u.glyphIndex),d=new T("glyf",c.instructions);j.DEBUG&&(console.log("---EXEC COMP "+l+"---"),d.step=-1),gr(c,d,r,o);for(var f=Math.round(u.dx*r),h=Math.round(u.dy*o),p=d.gZone,m=d.contours,y=0;y<p.length;y++){var g=p[y];g.xTouched=g.yTouched=!1,g.xo=g.x=g.x+f,g.yo=g.y=g.y+h}var v=i.length;i.push.apply(i,p);for(var b=0;b<m.length;b++)a.push(m[b]+v)}e.instructions&&!d.inhibitGridFit&&((d=new T("glyf",e.instructions)).gZone=d.z0=d.z1=d.z2=i,d.contours=a,i.push(new E(0,0),new E(Math.round(e.advanceWidth*r),0)),j.DEBUG&&(console.log("---EXEC COMPOSITE---"),d.step=-1),vr(d),i.length-=2)}else d=new T("glyf",e.instructions),j.DEBUG&&(console.log("---EXEC GLYPH---"),d.step=-1),gr(e,d,r,o),i=d.gZone;return i},gr=function(e,t,r,o){for(var n,s,i,a=e.points||[],l=a.length,u=t.gZone=t.z0=t.z1=t.z2=[],c=t.contours=[],d=0;d<l;d++)n=a[d],u[d]=new E(n.x*r,n.y*o,n.lastPointOfContour,n.onCurve);for(var f=0;f<l;f++)n=u[f],s||(s=n,c.push(f)),n.lastPointOfContour?((n.nextPointOnContour=s).prevPointOnContour=n,s=void 0):(i=u[f+1],(n.nextPointOnContour=i).prevPointOnContour=n);if(!t.inhibitGridFit){if(j.DEBUG){console.log("PROCESSING GLYPH",t.stack);for(var h=0;h<l;h++)console.log(h,u[h].x,u[h].y)}if(u.push(new E(0,0),new E(Math.round(e.advanceWidth*r),0)),vr(t),u.length-=2,j.DEBUG){console.log("FINISHED GLYPH",t.stack);for(var p=0;p<l;p++)console.log(p,u[p].x,u[p].y)}}},vr=function(e){var t=e.prog;if(t){var r,o=t.length;for(e.ip=0;e.ip<o;e.ip++){if(j.DEBUG&&e.step++,!(r=br[t[e.ip]]))throw new Error("unknown instruction: 0x"+Number(t[e.ip]).toString(16));r(e)}}},br=[Jt.bind(void 0,M),Jt.bind(void 0,x),Kt.bind(void 0,M),Kt.bind(void 0,x),$t.bind(void 0,M),$t.bind(void 0,x),er.bind(void 0,0),er.bind(void 0,1),tr.bind(void 0,0),tr.bind(void 0,1),function(e){var t=(r=e.stack).pop(),r=r.pop();j.DEBUG&&console.log(e.step,"SPVFS[]",t,r),e.pv=e.dpv=qt(r,t)},function(e){var t=(r=e.stack).pop(),r=r.pop();j.DEBUG&&console.log(e.step,"SPVFS[]",t,r),e.fv=qt(r,t)},function(e){var t=e.stack,r=e.pv;j.DEBUG&&console.log(e.step,"GPV[]"),t.push(16384*r.x),t.push(16384*r.y)},function(e){var t=e.stack,r=e.fv;j.DEBUG&&console.log(e.step,"GFV[]"),t.push(16384*r.x),t.push(16384*r.y)},function(e){e.fv=e.pv,j.DEBUG&&console.log(e.step,"SFVTPV[]")},function(e){var t=(s=e.stack).pop(),r=s.pop(),o=s.pop(),n=s.pop(),s=s.pop(),i=e.z0,a=e.z1,l=i[t],i=i[r],u=a[o],a=a[n],e=e.z2[s],t=(j.DEBUG&&console.log("ISECT[], ",t,r,o,n,s),l.x),r=l.y,o=i.x,n=i.y,s=u.x,l=u.y,i=a.x,u=a.y,a=(t-o)*(l-u)-(r-n)*(s-i),c=t*n-r*o,d=s*u-l*i;e.x=(c*(s-i)-d*(t-o))/a,e.y=(c*(l-u)-d*(r-n))/a},function(e){e.rp0=e.stack.pop(),j.DEBUG&&console.log(e.step,"SRP0[]",e.rp0)},function(e){e.rp1=e.stack.pop(),j.DEBUG&&console.log(e.step,"SRP1[]",e.rp1)},function(e){e.rp2=e.stack.pop(),j.DEBUG&&console.log(e.step,"SRP2[]",e.rp2)},function(e){var t=e.stack.pop();switch(j.DEBUG&&console.log(e.step,"SZP0[]",t),e.zp0=t){case 0:e.tZone||Zt(e),e.z0=e.tZone;break;case 1:e.z0=e.gZone;break;default:throw new Error("Invalid zone pointer")}},function(e){var t=e.stack.pop();switch(j.DEBUG&&console.log(e.step,"SZP1[]",t),e.zp1=t){case 0:e.tZone||Zt(e),e.z1=e.tZone;break;case 1:e.z1=e.gZone;break;default:throw new Error("Invalid zone pointer")}},function(e){var t=e.stack.pop();switch(j.DEBUG&&console.log(e.step,"SZP2[]",t),e.zp2=t){case 0:e.tZone||Zt(e),e.z2=e.tZone;break;case 1:e.z2=e.gZone;break;default:throw new Error("Invalid zone pointer")}},function(e){var t=e.stack.pop();switch(j.DEBUG&&console.log(e.step,"SZPS[]",t),e.zp0=e.zp1=e.zp2=t){case 0:e.tZone||Zt(e),e.z0=e.z1=e.z2=e.tZone;break;case 1:e.z0=e.z1=e.z2=e.gZone;break;default:throw new Error("Invalid zone pointer")}},function(e){e.loop=e.stack.pop(),j.DEBUG&&console.log(e.step,"SLOOP[]",e.loop)},function(e){j.DEBUG&&console.log(e.step,"RTG[]"),e.round=Ft},function(e){j.DEBUG&&console.log(e.step,"RTHG[]"),e.round=Gt},function(e){var t=e.stack.pop();j.DEBUG&&console.log(e.step,"SMD[]",t),e.minDis=t/64},function(e){j.DEBUG&&console.log(e.step,"ELSE[]"),Qt(e,!1)},function(e){var t=e.stack.pop();j.DEBUG&&console.log(e.step,"JMPR[]",t),e.ip+=t-1},function(e){var t=e.stack.pop();j.DEBUG&&console.log(e.step,"SCVTCI[]",t),e.cvCutIn=t/64},void 0,void 0,function(e){var t=e.stack;j.DEBUG&&console.log(e.step,"DUP[]"),t.push(t[t.length-1])},rr,function(e){j.DEBUG&&console.log(e.step,"CLEAR[]"),e.stack.length=0},function(e){var t=e.stack,r=t.pop(),o=t.pop();j.DEBUG&&console.log(e.step,"SWAP[]"),t.push(r),t.push(o)},function(e){var t=e.stack;j.DEBUG&&console.log(e.step,"DEPTH[]"),t.push(t.length)},function(e){var t=e.stack,r=t.pop();j.DEBUG&&console.log(e.step,"CINDEX[]",r),t.push(t[t.length-r])},function(e){var t=e.stack,r=t.pop();j.DEBUG&&console.log(e.step,"MINDEX[]",r),t.push(t.splice(t.length-r,1)[0])},void 0,void 0,void 0,function(e){var t=(o=e.stack).pop(),r=o.pop(),o=(j.DEBUG&&console.log(e.step,"LOOPCALL[]",t,r),e.ip),n=e.prog;e.prog=e.funcs[t];for(var s=0;s<r;s++)vr(e),j.DEBUG&&console.log(++e.step,s+1<r?"next loopcall":"done loopcall",s);e.ip=o,e.prog=n},function(e){var t=e.stack.pop(),r=(j.DEBUG&&console.log(e.step,"CALL[]",t),e.ip),o=e.prog;e.prog=e.funcs[t],vr(e),e.ip=r,e.prog=o,j.DEBUG&&console.log(++e.step,"returning from",t)},function(e){if("fpgm"!==e.env)throw new Error("FDEF not allowed here");var t=e.stack,r=e.prog,o=e.ip,t=t.pop(),n=o;for(j.DEBUG&&console.log(e.step,"FDEF[]",t);45!==r[++o];);e.ip=o,e.funcs[t]=r.slice(n+1,o)},void 0,or.bind(void 0,0),or.bind(void 0,1),nr.bind(void 0,M),nr.bind(void 0,x),sr.bind(void 0,0),sr.bind(void 0,1),ir.bind(void 0,0),ir.bind(void 0,1),ar.bind(void 0,0),ar.bind(void 0,1),function(e){for(var t=e.stack,r=e.loop,o=e.fv,n=t.pop()/64,s=e.z2;r--;){var i=t.pop(),a=s[i];j.DEBUG&&console.log(e.step,(1<e.loop?"loop "+(e.loop-r)+": ":"")+"SHPIX[]",i,n),o.setRelative(a,a,n),o.touch(a)}e.loop=1},function(e){for(var t=e.stack,r=e.rp1,o=e.rp2,n=e.loop,s=e.z0[r],i=e.z1[o],a=e.fv,l=e.dpv,u=e.z2;n--;){var c=t.pop(),d=u[c];j.DEBUG&&console.log(e.step,(1<e.loop?"loop "+(e.loop-n)+": ":"")+"IP[]",c,r,"<->",o),a.interpolate(d,s,i,l),a.touch(d)}e.loop=1},lr.bind(void 0,0),lr.bind(void 0,1),function(e){for(var t=e.stack,r=e.rp0,o=e.z0[r],n=e.loop,s=e.fv,i=e.pv,a=e.z1;n--;){var l=t.pop(),u=a[l];j.DEBUG&&console.log(e.step,(1<e.loop?"loop "+(e.loop-n)+": ":"")+"ALIGNRP[]",l),s.setRelative(u,o,0,i),s.touch(u)}e.loop=1},function(e){j.DEBUG&&console.log(e.step,"RTDG[]"),e.round=Bt},ur.bind(void 0,0),ur.bind(void 0,1),function(e){var t=e.prog,r=e.ip,o=e.stack,n=t[++r];j.DEBUG&&console.log(e.step,"NPUSHB[]",n);for(var s=0;s<n;s++)o.push(t[++r]);e.ip=r},function(e){var t=e.ip,r=e.prog,o=e.stack,n=r[++t];j.DEBUG&&console.log(e.step,"NPUSHW[]",n);for(var s=0;s<n;s++){var i=r[++t]<<8|r[++t];32768&i&&(i=-(1+(65535^i))),o.push(i)}e.ip=t},function(e){var t=e.stack,r=(r=e.store)||(e.store=[]),o=t.pop(),t=t.pop();j.DEBUG&&console.log(e.step,"WS",o,t),r[t]=o},function(e){var t=e.stack,r=e.store,o=t.pop(),e=(j.DEBUG&&console.log(e.step,"RS",o),r&&r[o]||0);t.push(e)},function(e){var t=(r=e.stack).pop(),r=r.pop();j.DEBUG&&console.log(e.step,"WCVTP",t,r),e.cvt[r]=t/64},function(e){var t=e.stack,r=t.pop();j.DEBUG&&console.log(e.step,"RCVT",r),t.push(64*e.cvt[r])},cr.bind(void 0,0),cr.bind(void 0,1),void 0,dr.bind(void 0,0),dr.bind(void 0,1),function(e){j.DEBUG&&console.log(e.step,"MPPEM[]"),e.stack.push(e.ppem)},void 0,function(e){j.DEBUG&&console.log(e.step,"FLIPON[]"),e.autoFlip=!0},void 0,void 0,function(e){var t=e.stack,r=t.pop(),o=t.pop();j.DEBUG&&console.log(e.step,"LT[]",r,o),t.push(o<r?1:0)},function(e){var t=e.stack,r=t.pop(),o=t.pop();j.DEBUG&&console.log(e.step,"LTEQ[]",r,o),t.push(o<=r?1:0)},function(e){var t=e.stack,r=t.pop(),o=t.pop();j.DEBUG&&console.log(e.step,"GT[]",r,o),t.push(r<o?1:0)},function(e){var t=e.stack,r=t.pop(),o=t.pop();j.DEBUG&&console.log(e.step,"GTEQ[]",r,o),t.push(r<=o?1:0)},function(e){var t=e.stack,r=t.pop(),o=t.pop();j.DEBUG&&console.log(e.step,"EQ[]",r,o),t.push(r===o?1:0)},function(e){var t=e.stack,r=t.pop(),o=t.pop();j.DEBUG&&console.log(e.step,"NEQ[]",r,o),t.push(r!==o?1:0)},function(e){var t=e.stack,r=t.pop();j.DEBUG&&console.log(e.step,"ODD[]",r),t.push(Math.trunc(r)%2?1:0)},function(e){var t=e.stack,r=t.pop();j.DEBUG&&console.log(e.step,"EVEN[]",r),t.push(Math.trunc(r)%2?0:1)},function(e){var t=e.stack.pop();j.DEBUG&&console.log(e.step,"IF[]",t),t||(Qt(e,!0),j.DEBUG&&console.log(e.step,"EIF[]"))},function(e){j.DEBUG&&console.log(e.step,"EIF[]")},function(e){var t=e.stack,r=t.pop(),o=t.pop();j.DEBUG&&console.log(e.step,"AND[]",r,o),t.push(r&&o?1:0)},function(e){var t=e.stack,r=t.pop(),o=t.pop();j.DEBUG&&console.log(e.step,"OR[]",r,o),t.push(r||o?1:0)},function(e){var t=e.stack,r=t.pop();j.DEBUG&&console.log(e.step,"NOT[]",r),t.push(r?0:1)},fr.bind(void 0,1),function(e){var t=e.stack.pop();j.DEBUG&&console.log(e.step,"SDB[]",t),e.deltaBase=t},function(e){var t=e.stack.pop();j.DEBUG&&console.log(e.step,"SDS[]",t),e.deltaShift=Math.pow(.5,t)},function(e){var t=e.stack,r=t.pop(),o=t.pop();j.DEBUG&&console.log(e.step,"ADD[]",r,o),t.push(o+r)},function(e){var t=e.stack,r=t.pop(),o=t.pop();j.DEBUG&&console.log(e.step,"SUB[]",r,o),t.push(o-r)},function(e){var t=e.stack,r=t.pop(),o=t.pop();j.DEBUG&&console.log(e.step,"DIV[]",r,o),t.push(64*o/r)},function(e){var t=e.stack,r=t.pop(),o=t.pop();j.DEBUG&&console.log(e.step,"MUL[]",r,o),t.push(o*r/64)},function(e){var t=e.stack,r=t.pop();j.DEBUG&&console.log(e.step,"ABS[]",r),t.push(Math.abs(r))},function(e){var t=e.stack,r=t.pop();j.DEBUG&&console.log(e.step,"NEG[]",r),t.push(-r)},function(e){var t=e.stack,r=t.pop();j.DEBUG&&console.log(e.step,"FLOOR[]",r),t.push(64*Math.floor(r/64))},function(e){var t=e.stack,r=t.pop();j.DEBUG&&console.log(e.step,"CEILING[]",r),t.push(64*Math.ceil(r/64))},hr.bind(void 0,0),hr.bind(void 0,1),hr.bind(void 0,2),hr.bind(void 0,3),void 0,void 0,void 0,void 0,function(e){var t=(r=e.stack).pop(),r=r.pop();j.DEBUG&&console.log(e.step,"WCVTF[]",t,r),e.cvt[r]=t*e.ppem/e.font.unitsPerEm},fr.bind(void 0,2),fr.bind(void 0,3),pr.bind(void 0,1),pr.bind(void 0,2),pr.bind(void 0,3),function(e){var t,r=e.stack.pop();switch(j.DEBUG&&console.log(e.step,"SROUND[]",r),e.round=Ht,192&r){case 0:t=.5;break;case 64:t=1;break;case 128:t=2;break;default:throw new Error("invalid SROUND value")}switch(e.srPeriod=t,48&r){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*t;break;case 32:e.srPhase=.5*t;break;case 48:e.srPhase=.75*t;break;default:throw new Error("invalid SROUND value")}e.srThreshold=0===(r&=15)?0:(r/8-.5)*t},function(e){var t,r=e.stack.pop();switch(j.DEBUG&&console.log(e.step,"S45ROUND[]",r),e.round=Ht,192&r){case 0:t=Math.sqrt(2)/2;break;case 64:t=Math.sqrt(2);break;case 128:t=2*Math.sqrt(2);break;default:throw new Error("invalid S45ROUND value")}switch(e.srPeriod=t,48&r){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*t;break;case 32:e.srPhase=.5*t;break;case 48:e.srPhase=.75*t;break;default:throw new Error("invalid S45ROUND value")}e.srThreshold=0===(r&=15)?0:(r/8-.5)*t},void 0,void 0,function(e){j.DEBUG&&console.log(e.step,"ROFF[]"),e.round=Nt},void 0,function(e){j.DEBUG&&console.log(e.step,"RUTG[]"),e.round=Vt},function(e){j.DEBUG&&console.log(e.step,"RDTG[]"),e.round=zt},rr,rr,void 0,void 0,void 0,void 0,void 0,function(e){var t=e.stack.pop();j.DEBUG&&console.log(e.step,"SCANCTRL[]",t)},mr.bind(void 0,0),mr.bind(void 0,1),function(e){var t=e.stack,r=t.pop(),o=0;j.DEBUG&&console.log(e.step,"GETINFO[]",r),1&r&&(o=35),32&r&&(o|=4096),t.push(o)},void 0,function(e){var t=e.stack,r=t.pop(),o=t.pop(),n=t.pop();j.DEBUG&&console.log(e.step,"ROLL[]"),t.push(o),t.push(r),t.push(n)},function(e){var t=e.stack,r=t.pop(),o=t.pop();j.DEBUG&&console.log(e.step,"MAX[]",r,o),t.push(Math.max(o,r))},function(e){var t=e.stack,r=t.pop(),o=t.pop();j.DEBUG&&console.log(e.step,"MIN[]",r,o),t.push(Math.min(o,r))},function(e){var t=e.stack.pop();j.DEBUG&&console.log(e.step,"SCANTYPE[]",t)},function(e){var t=e.stack.pop(),r=e.stack.pop();switch(j.DEBUG&&console.log(e.step,"INSTCTRL[]",t,r),t){case 1:return void(e.inhibitGridFit=!!r);case 2:return void(e.ignoreCvt=!!r);default:throw new Error("invalid INSTCTRL[] selector")}},void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,C.bind(void 0,1),C.bind(void 0,2),C.bind(void 0,3),C.bind(void 0,4),C.bind(void 0,5),C.bind(void 0,6),C.bind(void 0,7),C.bind(void 0,8),O.bind(void 0,1),O.bind(void 0,2),O.bind(void 0,3),O.bind(void 0,4),O.bind(void 0,5),O.bind(void 0,6),O.bind(void 0,7),O.bind(void 0,8),k.bind(void 0,0,0,0,0,0),k.bind(void 0,0,0,0,0,1),k.bind(void 0,0,0,0,0,2),k.bind(void 0,0,0,0,0,3),k.bind(void 0,0,0,0,1,0),k.bind(void 0,0,0,0,1,1),k.bind(void 0,0,0,0,1,2),k.bind(void 0,0,0,0,1,3),k.bind(void 0,0,0,1,0,0),k.bind(void 0,0,0,1,0,1),k.bind(void 0,0,0,1,0,2),k.bind(void 0,0,0,1,0,3),k.bind(void 0,0,0,1,1,0),k.bind(void 0,0,0,1,1,1),k.bind(void 0,0,0,1,1,2),k.bind(void 0,0,0,1,1,3),k.bind(void 0,0,1,0,0,0),k.bind(void 0,0,1,0,0,1),k.bind(void 0,0,1,0,0,2),k.bind(void 0,0,1,0,0,3),k.bind(void 0,0,1,0,1,0),k.bind(void 0,0,1,0,1,1),k.bind(void 0,0,1,0,1,2),k.bind(void 0,0,1,0,1,3),k.bind(void 0,0,1,1,0,0),k.bind(void 0,0,1,1,0,1),k.bind(void 0,0,1,1,0,2),k.bind(void 0,0,1,1,0,3),k.bind(void 0,0,1,1,1,0),k.bind(void 0,0,1,1,1,1),k.bind(void 0,0,1,1,1,2),k.bind(void 0,0,1,1,1,3),k.bind(void 0,1,0,0,0,0),k.bind(void 0,1,0,0,0,1),k.bind(void 0,1,0,0,0,2),k.bind(void 0,1,0,0,0,3),k.bind(void 0,1,0,0,1,0),k.bind(void 0,1,0,0,1,1),k.bind(void 0,1,0,0,1,2),k.bind(void 0,1,0,0,1,3),k.bind(void 0,1,0,1,0,0),k.bind(void 0,1,0,1,0,1),k.bind(void 0,1,0,1,0,2),k.bind(void 0,1,0,1,0,3),k.bind(void 0,1,0,1,1,0),k.bind(void 0,1,0,1,1,1),k.bind(void 0,1,0,1,1,2),k.bind(void 0,1,0,1,1,3),k.bind(void 0,1,1,0,0,0),k.bind(void 0,1,1,0,0,1),k.bind(void 0,1,1,0,0,2),k.bind(void 0,1,1,0,0,3),k.bind(void 0,1,1,0,1,0),k.bind(void 0,1,1,0,1,1),k.bind(void 0,1,1,0,1,2),k.bind(void 0,1,1,0,1,3),k.bind(void 0,1,1,1,0,0),k.bind(void 0,1,1,1,0,1),k.bind(void 0,1,1,1,0,2),k.bind(void 0,1,1,1,0,3),k.bind(void 0,1,1,1,1,0),k.bind(void 0,1,1,1,1,1),k.bind(void 0,1,1,1,1,2),k.bind(void 0,1,1,1,1,3)],jr=Array.from||function(e){return e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]?|[^\uD800-\uDFFF]|./g)||[]};function L(e){(e=e||{}).empty||(_(e.familyName,"When creating a new Font object, familyName is required."),_(e.styleName,"When creating a new Font object, styleName is required."),_(e.unitsPerEm,"When creating a new Font object, unitsPerEm is required."),_(e.ascender,"When creating a new Font object, ascender is required."),_(e.descender,"When creating a new Font object, descender is required."),_(e.descender<0,"Descender should be negative (e.g. -512)."),this.names={fontFamily:{en:e.familyName||" "},fontSubfamily:{en:e.styleName||" "},fullName:{en:e.fullName||e.familyName+" "+e.styleName},postScriptName:{en:e.postScriptName||(e.familyName+e.styleName).replace(/\s/g,"")},designer:{en:e.designer||" "},designerURL:{en:e.designerURL||" "},manufacturer:{en:e.manufacturer||" "},manufacturerURL:{en:e.manufacturerURL||" "},license:{en:e.license||" "},licenseURL:{en:e.licenseURL||" "},version:{en:e.version||"Version 0.1"},description:{en:e.description||" "},copyright:{en:e.copyright||" "},trademark:{en:e.trademark||" "}},this.unitsPerEm=e.unitsPerEm||1e3,this.ascender=e.ascender,this.descender=e.descender,this.createdTimestamp=e.createdTimestamp,this.tables={os2:{usWeightClass:e.weightClass||this.usWeightClasses.MEDIUM,usWidthClass:e.widthClass||this.usWidthClasses.MEDIUM,fsSelection:e.fsSelection||this.fsSelectionValues.REGULAR}}),this.supported=!0,this.glyphs=new p.GlyphSet(this,e.glyphs||[]),this.encoding=new Te(this),this.position=new Ct(this),this.substitution=new i(this),this.tables=this.tables||{},Object.defineProperty(this,"hinting",{get:function(){return this._hinting||("truetype"===this.outlinesFormat?this._hinting=new Ut(this):void 0)}})}function _r(e,t){var r,o=JSON.stringify(e),n=256;for(r in t){var s=parseInt(r);if(s&&!(s<256)){if(JSON.stringify(t[r])===o)return s;n<=s&&(n=s+1)}}return t[n]=e,n}L.prototype.hasChar=function(e){return null!==this.encoding.charToGlyphIndex(e)},L.prototype.charToGlyphIndex=function(e){return this.encoding.charToGlyphIndex(e)},L.prototype.charToGlyph=function(e){e=this.charToGlyphIndex(e);return this.glyphs.get(e)||this.glyphs.get(0)},L.prototype.stringToGlyphs=function(e,t){t=t||this.defaultRenderOptions;for(var r=jr(e),o=[],n=0;n<r.length;n+=1){var s=r[n];o.push(this.charToGlyphIndex(s))}var i=o.length;if(t.features){var e=t.script||this.substitution.getDefaultScriptName(),a=[];t.features.liga&&(a=a.concat(this.substitution.getFeature("liga",e,t.language))),t.features.rlig&&(a=a.concat(this.substitution.getFeature("rlig",e,t.language)));for(var l=0;l<i;l+=1)for(var u=0;u<a.length;u++){for(var c=a[u],d=c.sub,f=d.length,h=0;h<f&&d[h]===o[l+h];)h++;h===f&&(o.splice(l,f,c.by),i=i-f+1)}}for(var p=new Array(i),m=this.glyphs.get(0),y=0;y<i;y+=1)p[y]=this.glyphs.get(o[y])||m;return p},L.prototype.nameToGlyphIndex=function(e){return this.glyphNames.nameToGlyphIndex(e)},L.prototype.nameToGlyph=function(e){e=this.nameToGlyphIndex(e);return this.glyphs.get(e)||this.glyphs.get(0)},L.prototype.glyphIndexToName=function(e){return this.glyphNames.glyphIndexToName?this.glyphNames.glyphIndexToName(e):""},L.prototype.getKerningValue=function(e,t){e=e.index||e,t=t.index||t;var r=this.position.defaultKerningTables;return r?this.position.getKerningValue(r,e,t):this.kerningPairs[e+","+t]||0},L.prototype.defaultRenderOptions={kerning:!0,features:{liga:!0,rlig:!0}},L.prototype.forEachGlyph=function(e,t,r,o,n,s){t=void 0!==t?t:0,r=void 0!==r?r:0,n=n||this.defaultRenderOptions;var i,a=1/this.unitsPerEm*(o=void 0!==o?o:72),l=this.stringToGlyphs(e,n);n.kerning&&(e=n.script||this.position.getDefaultScriptName(),i=this.position.getKerningTables(e,n.language));for(var u=0;u<l.length;u+=1){var c=l[u];s.call(this,c,t,r,o,n),c.advanceWidth&&(t+=c.advanceWidth*a),n.kerning&&u<l.length-1&&(t+=(i?this.position.getKerningValue(i,c.index,l[u+1].index):this.getKerningValue(c,l[u+1]))*a),n.letterSpacing?t+=n.letterSpacing*o:n.tracking&&(t+=n.tracking/1e3*o)}return t},L.prototype.getPath=function(e,t,r,o,n){var s=new f;return this.forEachGlyph(e,t,r,o,n,function(e,t,r,o){e=e.getPath(t,r,o,n,this);s.extend(e)}),s},L.prototype.getPaths=function(e,t,r,o,n){var s=[];return this.forEachGlyph(e,t,r,o,n,function(e,t,r,o){e=e.getPath(t,r,o,n,this);s.push(e)}),s},L.prototype.getAdvanceWidth=function(e,t,r){return this.forEachGlyph(e,0,0,t,r,function(){})},L.prototype.draw=function(e,t,r,o,n,s){this.getPath(t,r,o,n,s).draw(e)},L.prototype.drawPoints=function(n,e,t,r,o,s){this.forEachGlyph(e,t,r,o,s,function(e,t,r,o){e.drawPoints(n,t,r,o)})},L.prototype.drawMetrics=function(n,e,t,r,o,s){this.forEachGlyph(e,t,r,o,s,function(e,t,r,o){e.drawMetrics(n,t,r,o)})},L.prototype.getEnglishName=function(e){e=this.names[e];if(e)return e.en},L.prototype.validate=function(){var t=this;function e(e){e=t.getEnglishName(e);e&&e.trim().length}e("fontFamily"),e("weightName"),e("manufacturer"),e("copyright"),e("version"),this.unitsPerEm},L.prototype.toTables=function(){return wt.fontToTable(this)},L.prototype.toBuffer=function(){return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."),this.toArrayBuffer()},L.prototype.toArrayBuffer=function(){for(var e=this.toTables().encode(),t=new ArrayBuffer(e.length),r=new Uint8Array(t),o=0;o<e.length;o++)r[o]=e[o];return t},L.prototype.download=function(t){var e=this.getEnglishName("fontFamily"),r=this.getEnglishName("fontSubfamily"),o=(t=t||e.replace(/\s/g,"")+"-"+r+".otf",this.toArrayBuffer());"undefined"!=typeof window?(window.requestFileSystem=window.requestFileSystem||window.webkitRequestFileSystem,window.requestFileSystem(window.TEMPORARY,o.byteLength,function(e){e.root.getFile(t,{create:!0},function(r){r.createWriter(function(e){var t=new DataView(o),t=new Blob([t],{type:"font/opentype"});e.write(t),e.addEventListener("writeend",function(){location.href=r.toURL()},!1)})})},function(e){throw new Error(e.name+": "+e.message)})):(e=Pr("fs"),r=function(e){for(var t=new Lr(e.byteLength),r=new Uint8Array(e),o=0;o<t.length;++o)t[o]=r[o];return t}(o),e.writeFileSync(t,r))},L.prototype.fsSelectionValues={ITALIC:1,UNDERSCORE:2,NEGATIVE:4,OUTLINED:8,STRIKEOUT:16,BOLD:32,REGULAR:64,USER_TYPO_METRICS:128,WWS:256,OBLIQUE:512},L.prototype.usWidthClasses={ULTRA_CONDENSED:1,EXTRA_CONDENSED:2,CONDENSED:3,SEMI_CONDENSED:4,MEDIUM:5,SEMI_EXPANDED:6,EXPANDED:7,EXTRA_EXPANDED:8,ULTRA_EXPANDED:9},L.prototype.usWeightClasses={THIN:100,EXTRA_LIGHT:200,LIGHT:300,NORMAL:400,MEDIUM:500,SEMI_BOLD:600,BOLD:700,EXTRA_BOLD:800,BLACK:900};var xr={make:function(e,t){var r=new S.Table("fvar",[{name:"version",type:"ULONG",value:65536},{name:"offsetToData",type:"USHORT",value:0},{name:"countSizePairs",type:"USHORT",value:2},{name:"axisCount",type:"USHORT",value:e.axes.length},{name:"axisSize",type:"USHORT",value:20},{name:"instanceCount",type:"USHORT",value:e.instances.length},{name:"instanceSize",type:"USHORT",value:4+4*e.axes.length}]);r.offsetToData=r.sizeOf();for(var o,n,s,i=0;i<e.axes.length;i++)r.fields=r.fields.concat((o=i,n=e.axes[i],s=t,s=_r(n.name,t),[{name:"tag_"+o,type:"TAG",value:n.tag},{name:"minValue_"+o,type:"FIXED",value:n.minValue<<16},{name:"defaultValue_"+o,type:"FIXED",value:n.defaultValue<<16},{name:"maxValue_"+o,type:"FIXED",value:n.maxValue<<16},{name:"flags_"+o,type:"USHORT",value:0},{name:"nameID_"+o,type:"USHORT",value:s}]));for(var a=0;a<e.instances.length;a++)r.fields=r.fields.concat(function(e,t,r,o){for(var n=[{name:"nameID_"+e,type:"USHORT",value:_r(t.name,o)},{name:"flags_"+e,type:"USHORT",value:0}],s=0;s<r.length;++s){var i=r[s].tag;n.push({name:"axis_"+e+" "+i,type:"FIXED",value:t.coordinates[i]<<16})}return n}(a,e.instances[a],e.axes,t));return r},parse:function(e,t,r){for(var o,n,s,i,a=new R.Parser(e,t),l=a.parseULong(),u=(A.argument(65536===l,"Unsupported fvar table version."),a.parseOffset16()),c=(a.skip("uShort",1),a.parseUShort()),d=a.parseUShort(),f=a.parseUShort(),h=a.parseUShort(),p=[],m=0;m<c;m++)p.push((o=e,n=t+u+m*d,s=r,void 0,i={},o=new R.Parser(o,n),i.tag=o.parseTag(),i.minValue=o.parseFixed(),i.defaultValue=o.parseFixed(),i.maxValue=o.parseFixed(),o.skip("uShort",1),i.name=s[o.parseUShort()]||{},i));for(var y=[],g=t+u+c*d,v=0;v<f;v++)y.push(function(e,t,r,o){var n={},s=new R.Parser(e,t);n.name=o[s.parseUShort()]||{},s.skip("uShort",1),n.coordinates={};for(var i=0;i<r.length;++i)n.coordinates[r[i].tag]=s.parseFixed();return n}(e,g+v*h,p,r));return{axes:p,instances:y}}},P=new Array(10);P[1]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();return 1===t?{posFormat:1,coverage:this.parsePointer(u.coverage),value:this.parseValueRecord()}:2===t?{posFormat:2,coverage:this.parsePointer(u.coverage),values:this.parseValueRecordList()}:void A.assert(!1,"0x"+e.toString(16)+": GPOS lookup type 1 format must be 1 or 2.")},P[2]=function(){var e,t,r,o,n=this.offset+this.relativeOffset,s=this.parseUShort(),n=(A.assert(1===s||2===s,"0x"+n.toString(16)+": GPOS lookup type 2 format must be 1 or 2."),this.parsePointer(u.coverage)),i=this.parseUShort(),a=this.parseUShort();return 1===s?{posFormat:s,coverage:n,valueFormat1:i,valueFormat2:a,pairSets:this.parseList(u.pointer(u.list(function(){return{secondGlyph:this.parseUShort(),value1:this.parseValueRecord(i),value2:this.parseValueRecord(a)}})))}:2===s?(e=this.parsePointer(u.classDef),t=this.parsePointer(u.classDef),r=this.parseUShort(),o=this.parseUShort(),{posFormat:s,coverage:n,valueFormat1:i,valueFormat2:a,classDef1:e,classDef2:t,class1Count:r,class2Count:o,classRecords:this.parseList(r,u.list(o,function(){return{value1:this.parseValueRecord(i),value2:this.parseValueRecord(a)}}))}):void 0},P[3]=function(){return{error:"GPOS Lookup 3 not supported"}},P[4]=function(){return{error:"GPOS Lookup 4 not supported"}},P[5]=function(){return{error:"GPOS Lookup 5 not supported"}},P[6]=function(){return{error:"GPOS Lookup 6 not supported"}},P[7]=function(){return{error:"GPOS Lookup 7 not supported"}},P[8]=function(){return{error:"GPOS Lookup 8 not supported"}},P[9]=function(){return{error:"GPOS Lookup 9 not supported"}};var wr=new Array(10);var Sr={parse:function(e,t){return t=(e=new u(e,t=t||0)).parseVersion(1),A.argument(1===t||1.1===t,"Unsupported GPOS table version "+t),1===t?{version:t,scripts:e.parseScriptList(),features:e.parseFeatureList(),lookups:e.parseLookupList(P)}:{version:t,scripts:e.parseScriptList(),features:e.parseFeatureList(),lookups:e.parseLookupList(P),variations:e.parseFeatureVariationsList()}},make:function(e){return new S.Table("GPOS",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new S.ScriptList(e.scripts)},{name:"features",type:"TABLE",value:new S.FeatureList(e.features)},{name:"lookups",type:"TABLE",value:new S.LookupList(e.lookups,wr)}])}};var Mr={parse:function(e,t){if(e=new R.Parser(e,t),0===(t=e.parseUShort())){var r=e,o={},n=(r.skip("uShort"),r.parseUShort()),s=(A.argument(0===n,"Unsupported kern sub-table version."),r.skip("uShort",2),r.parseUShort());r.skip("uShort",3);for(var i=0;i<s;i+=1){var a=r.parseUShort(),l=r.parseUShort(),u=r.parseShort();o[a+","+l]=u}return o}if(1!==t)throw new Error("Unsupported kern table version ("+t+").");var c=e,d={},n=(c.skip("uShort"),1<c.parseULong()&&console.warn("Only the first kern subtable is supported."),c.skip("uLong"),255&c.parseUShort());if(c.skip("uShort"),0==n){var f=c.parseUShort();c.skip("uShort",3);for(var h=0;h<f;h+=1){var p=c.parseUShort(),m=c.parseUShort(),y=c.parseShort();d[p+","+m]=y}}return d}};var Er={parse:function(e,t,r,o){for(var n=new R.Parser(e,t),s=o?n.parseUShort:n.parseULong,i=[],a=0;a<r+1;a+=1){var l=s.call(n);o&&(l*=2),i.push(l)}return i}};function Tr(e,r){Pr("fs").readFile(e,function(e,t){if(e)return r(e.message);r(null,kt(t))})}function Cr(e,t){var r=new XMLHttpRequest;r.open("get",e,!0),r.responseType="arraybuffer",r.onload=function(){return r.response?t(null,r.response):t("Font could not be loaded: "+r.statusText)},r.onerror=function(){t("Font could not be loaded")},r.send()}function Or(e,t){for(var r=[],o=12,n=0;n<t;n+=1){var s=R.getTag(e,o),i=R.getULong(e,o+4),a=R.getULong(e,o+8),l=R.getULong(e,o+12);r.push({tag:s,checksum:i,offset:a,length:l,compression:!1}),o+=16}return r}function I(e,t){if("WOFF"!==t.compression)return{data:e,offset:t.offset};var e=new Uint8Array(e.buffer,t.offset+2,t.compressedLength-2),r=new Uint8Array(t.length);if(re(e,r),r.byteLength!==t.length)throw new Error("Decompression error: "+t.tag+" decompressed length doesn't match recorded length");return{data:new DataView(r.buffer,0),offset:0}}function kr(e){var t,r,o,n,s,i,a,l,u,c,d,f,h,p,m=new L({empty:!0}),y=new DataView(e,0),g=[],e=R.getTag(y,0);if(e===String.fromCharCode(0,1,0,0)||"true"===e||"typ1"===e)m.outlinesFormat="truetype",g=Or(y,o=R.getUShort(y,4));else if("OTTO"===e)m.outlinesFormat="cff",g=Or(y,o=R.getUShort(y,4));else{if("wOFF"!==e)throw new Error("Unsupported OpenType signature "+e);var v=R.getTag(y,4);if(v===String.fromCharCode(0,1,0,0))m.outlinesFormat="truetype";else{if("OTTO"!==v)throw new Error("Unsupported OpenType flavor "+e);m.outlinesFormat="cff"}g=function(e,t){for(var r=[],o=44,n=0;n<t;n+=1){var s=R.getTag(e,o),i=R.getULong(e,o+4),a=R.getULong(e,o+8),l=R.getULong(e,o+12),u=void 0,u=a<l&&"WOFF";r.push({tag:s,offset:i,compression:u,compressedLength:a,length:l}),o+=20}return r}(y,o=R.getUShort(y,12))}for(var b=0;b<o;b+=1){var j=g[b],_=void 0;switch(j.tag){case"cmap":_=I(y,j),m.tables.cmap=we.parse(_.data,_.offset),m.encoding=new Ce(m.tables.cmap);break;case"cvt ":_=I(y,j),p=new R.Parser(_.data,_.offset),m.tables.cvt=p.parseShortList(j.length/2);break;case"fvar":s=j;break;case"fpgm":_=I(y,j),p=new R.Parser(_.data,_.offset),m.tables.fpgm=p.parseByteList(j.length);break;case"head":_=I(y,j),m.tables.head=Ze.parse(_.data,_.offset),m.unitsPerEm=m.tables.head.unitsPerEm,t=m.tables.head.indexToLocFormat;break;case"hhea":_=I(y,j),m.tables.hhea=Qe.parse(_.data,_.offset),m.ascender=m.tables.hhea.ascender,m.descender=m.tables.hhea.descender,m.numberOfHMetrics=m.tables.hhea.numberOfHMetrics;break;case"hmtx":u=j;break;case"ltag":_=I(y,j),r=Ke.parse(_.data,_.offset);break;case"maxp":_=I(y,j),m.tables.maxp=$e.parse(_.data,_.offset),m.numGlyphs=m.tables.maxp.numGlyphs;break;case"name":f=j;break;case"OS/2":_=I(y,j),m.tables.os2=ht.parse(_.data,_.offset);break;case"post":_=I(y,j),m.tables.post=pt.parse(_.data,_.offset),m.glyphNames=new ke(m.tables.post);break;case"prep":_=I(y,j),p=new R.Parser(_.data,_.offset),m.tables.prep=p.parseByteList(j.length);break;case"glyf":i=j;break;case"loca":d=j;break;case"CFF ":n=j;break;case"kern":c=j;break;case"GPOS":a=j;break;case"GSUB":l=j;break;case"meta":h=j}}v=I(y,f);if(m.tables.name=dt.parse(v.data,v.offset,r),m.names=m.tables.name,i&&d){e=0===t,v=I(y,d),v=Er.parse(v.data,v.offset,m.numGlyphs,e),e=I(y,i);m.glyphs=Dt.parse(e.data,e.offset,v,m)}else{if(!n)throw new Error("Font doesn't contain TrueType or CFF outlines.");e=I(y,n);Ye.parse(e.data,e.offset,m)}for(var v=I(y,u),x=(Je.parse(v.data,v.offset,m.numberOfHMetrics,m.numGlyphs,m.glyphs),m),w=x.tables.cmap.glyphIndexMap,S=Object.keys(w),M=0;M<S.length;M+=1){var E,T=S[M],C=w[T];(E=x.glyphs.get(C)).addUnicode(parseInt(T))}for(var O=0;O<x.glyphs.length;O+=1)E=x.glyphs.get(O),x.cffEncoding?x.isCIDFont?E.name="gid"+O:E.name=x.cffEncoding.charset[O]:x.glyphNames.names&&(E.name=x.glyphNames.glyphIndexToName(O));return c?(e=I(y,c),m.kerningPairs=Mr.parse(e.data,e.offset)):m.kerningPairs={},a&&(v=I(y,a),m.tables.gpos=Sr.parse(v.data,v.offset),m.position.init()),l&&(e=I(y,l),m.tables.gsub=yt.parse(e.data,e.offset)),s&&(v=I(y,s),m.tables.fvar=xr.parse(v.data,v.offset,m.names)),h&&(e=I(y,h),m.tables.meta=gt.parse(e.data,e.offset),m.metas=m.tables.meta),m}j.Font=L,j.Glyph=h,j.Path=f,j.BoundingBox=a,j._parse=R,j.parse=kr,j.load=function(e,o){("undefined"==typeof window?Tr:Cr)(e,function(e,t){if(e)return o(e);var r;try{r=kr(t)}catch(e){return o(e,null)}return o(null,r)})},j.loadSync=function(e){return kr(kt(Pr("fs").readFileSync(e)))},Object.defineProperty(j,"__esModule",{value:!0})},"object"==typeof o&&void 0!==r?t(o):"function"==typeof s&&s.amd?s(["exports"],t):t(e.opentype={})}.call(this,Pr("buffer").Buffer)},{buffer:4,fs:2}],242:[function(e,t,u){!function(n){function s(e,t){for(var r=0,o=e.length-1;0<=o;o--){var n=e[o];"."===n?e.splice(o,1):".."===n?(e.splice(o,1),r++):r&&(e.splice(o,1),r--)}if(t)for(;r--;)e.unshift("..");return e}function i(e,t){if(e.filter)return e.filter(t);for(var r=[],o=0;o<e.length;o++)t(e[o],o,e)&&r.push(e[o]);return r}u.resolve=function(){for(var e="",t=!1,r=arguments.length-1;-1<=r&&!t;r--){var o=0<=r?arguments[r]:n.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(e=o+"/"+e,t="/"===o.charAt(0))}return(t?"/":"")+(e=s(i(e.split("/"),function(e){return!!e}),!t).join("/"))||"."},u.normalize=function(e){var t=u.isAbsolute(e),r="/"===o(e,-1);return(e=(e=s(i(e.split("/"),function(e){return!!e}),!t).join("/"))||t?e:".")&&r&&(e+="/"),(t?"/":"")+e},u.isAbsolute=function(e){return"/"===e.charAt(0)},u.join=function(){var e=Array.prototype.slice.call(arguments,0);return u.normalize(i(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},u.relative=function(e,t){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;0<=r&&""===e[r];r--);return r<t?[]:e.slice(t,r-t+1)}e=u.resolve(e).substr(1),t=u.resolve(t).substr(1);for(var o=r(e.split("/")),n=r(t.split("/")),s=Math.min(o.length,n.length),i=s,a=0;a<s;a++)if(o[a]!==n[a]){i=a;break}for(var l=[],a=i;a<o.length;a++)l.push("..");return(l=l.concat(n.slice(i))).join("/")},u.sep="/",u.delimiter=":",u.dirname=function(e){if("string"!=typeof e&&(e+=""),0===e.length)return".";for(var t=47===e.charCodeAt(0),r=-1,o=!0,n=e.length-1;1<=n;--n)if(47===e.charCodeAt(n)){if(!o){r=n;break}}else o=!1;return-1===r?t?"/":".":t&&1===r?"/":e.slice(0,r)},u.basename=function(e,t){e=function(e){"string"!=typeof e&&(e+="");for(var t=0,r=-1,o=!0,n=e.length-1;0<=n;--n)if(47===e.charCodeAt(n)){if(!o){t=n+1;break}}else-1===r&&(o=!1,r=n+1);return-1===r?"":e.slice(t,r)}(e);return e=t&&e.substr(-1*t.length)===t?e.substr(0,e.length-t.length):e},u.extname=function(e){"string"!=typeof e&&(e+="");for(var t=-1,r=0,o=-1,n=!0,s=0,i=e.length-1;0<=i;--i){var a=e.charCodeAt(i);if(47===a){if(n)continue;r=i+1;break}-1===o&&(n=!1,o=i+1),46===a?-1===t?t=i:1!==s&&(s=1):-1!==t&&(s=-1)}return-1===t||-1===o||0===s||1===s&&t===o-1&&t===r+1?"":e.slice(t,o)};var o="b"==="ab".substr(-1)?function(e,t,r){return e.substr(t,r)}:function(e,t,r){return t<0&&(t=e.length+t),e.substr(t,r)}}.call(this,e("_process"))},{_process:243}],243:[function(e,t,r){var o,n,t=t.exports={};function s(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}try{o="function"==typeof setTimeout?setTimeout:s}catch(e){o=s}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}function a(t){if(o===setTimeout)return setTimeout(t,0);if((o===s||!o)&&setTimeout)return(o=setTimeout)(t,0);try{return o(t,0)}catch(e){try{return o.call(null,t,0)}catch(e){return o.call(this,t,0)}}}var l,u=[],c=!1,d=-1;function f(){c&&l&&(c=!1,l.length?u=l.concat(u):d=-1,u.length&&h())}function h(){if(!c){for(var e=a(f),t=(c=!0,u.length);t;){for(l=u,u=[];++d<t;)l&&l[d].run();d=-1,t=u.length}l=null,c=!1,!function(t){if(n===clearTimeout)return clearTimeout(t);if((n===i||!n)&&clearTimeout)return(n=clearTimeout)(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function m(){}t.nextTick=function(e){var t=new Array(arguments.length-1);if(1<arguments.length)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new p(e,t)),1!==u.length||c||a(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={},t.on=m,t.addListener=m,t.once=m,t.off=m,t.removeListener=m,t.removeAllListeners=m,t.emit=m,t.prependListener=m,t.prependOnceListener=m,t.listeners=function(e){return[]},t.binding=function(e){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(e){throw new Error("process.chdir is not supported")},t.umask=function(){return 0}},{}],244:[function(e,t,r){t=function(s){"use strict";var l,e=Object.prototype,u=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",r=t.asyncIterator||"@@asyncIterator",n=t.toStringTag||"@@toStringTag";function i(e,t,r,o){var n,s,i,a,t=t&&t.prototype instanceof y?t:y,t=Object.create(t.prototype),o=new S(o||[]);return t._invoke=(n=e,s=r,i=o,a=d,function(e,t){if(a===h)throw new Error("Generator is already running");if(a===p){if("throw"===e)throw t;return E()}for(i.method=e,i.arg=t;;){var r=i.delegate;if(r){r=function e(t,r){var o=t.iterator[r.method];if(o===l){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=l,e(t,r),"throw"===r.method))return m;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}o=c(o,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,m;o=o.arg;if(!o)return r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m;{if(!o.done)return o;r[t.resultName]=o.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=l)}r.delegate=null;return m}(r,i);if(r){if(r===m)continue;return r}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(a===d)throw a=p,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);a=h;r=c(n,s,i);if("normal"===r.type){if(a=i.done?p:f,r.arg!==m)return{value:r.arg,done:i.done}}else"throw"===r.type&&(a=p,i.method="throw",i.arg=r.arg)}}),t}function c(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}s.wrap=i;var d="suspendedStart",f="suspendedYield",h="executing",p="completed",m={};function y(){}function a(){}function g(){}var t={},v=(t[o]=function(){return this},Object.getPrototypeOf),v=v&&v(v(M([]))),b=(v&&v!==e&&u.call(v,o)&&(t=v),g.prototype=y.prototype=Object.create(t));function j(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function _(i){var t;this._invoke=function(r,o){function e(){return new Promise(function(e,t){!function t(e,r,o,n){var s,e=c(i[e],i,r);if("throw"!==e.type)return(r=(s=e.arg).value)&&"object"==typeof r&&u.call(r,"__await")?Promise.resolve(r.__await).then(function(e){t("next",e,o,n)},function(e){t("throw",e,o,n)}):Promise.resolve(r).then(function(e){s.value=e,o(s)},function(e){return t("throw",e,o,n)});n(e.arg)}(r,o,e,t)})}return t=t?t.then(e,e):e()}}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function w(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function M(t){if(t){var r,e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return r=-1,(e=function e(){for(;++r<t.length;)if(u.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=l,e.done=!0,e}).next=e}return{next:E}}function E(){return{value:l,done:!0}}return(a.prototype=b.constructor=g).constructor=a,g[n]=a.displayName="GeneratorFunction",s.isGeneratorFunction=function(e){e="function"==typeof e&&e.constructor;return!!e&&(e===a||"GeneratorFunction"===(e.displayName||e.name))},s.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,n in e||(e[n]="GeneratorFunction")),e.prototype=Object.create(b),e},s.awrap=function(e){return{__await:e}},j(_.prototype),_.prototype[r]=function(){return this},s.AsyncIterator=_,s.async=function(e,t,r,o){var n=new _(i(e,t,r,o));return s.isGeneratorFunction(t)?n:n.next().then(function(e){return e.done?e.value:n.next()})},j(b),b[n]="Generator",b[o]=function(){return this},b.toString=function(){return"[object Generator]"},s.keys=function(r){var e,o=[];for(e in r)o.push(e);return o.reverse(),function e(){for(;o.length;){var t=o.pop();if(t in r)return e.value=t,e.done=!1,e}return e.done=!0,e}},s.values=M,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=l,this.done=!1,this.delegate=null,this.method="next",this.arg=l,this.tryEntries.forEach(w),!e)for(var t in this)"t"===t.charAt(0)&&u.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=l)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var o=this;function e(e,t){return s.type="throw",s.arg=r,o.next=e,t&&(o.method="next",o.arg=l),!!t}for(var t=this.tryEntries.length-1;0<=t;--t){var n=this.tryEntries[t],s=n.completion;if("root"===n.tryLoc)return e("end");if(n.tryLoc<=this.prev){var i=u.call(n,"catchLoc"),a=u.call(n,"finallyLoc");if(i&&a){if(this.prev<n.catchLoc)return e(n.catchLoc,!0);if(this.prev<n.finallyLoc)return e(n.finallyLoc)}else if(i){if(this.prev<n.catchLoc)return e(n.catchLoc,!0)}else{if(!a)throw new Error("try statement without catch or finally");if(this.prev<n.finallyLoc)return e(n.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;0<=r;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&u.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var n=o;break}}var s=(n=n&&("break"===e||"continue"===e)&&n.tryLoc<=t&&t<=n.finallyLoc?null:n)?n.completion:{};return s.type=e,s.arg=t,n?(this.method="next",this.next=n.finallyLoc,m):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),w(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var r,o,n=this.tryEntries[t];if(n.tryLoc===e)return"throw"===(r=n.completion).type&&(o=r.arg,w(n)),o}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:M(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=l),m}},s}("object"==typeof t?t.exports:{});try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}},{}],245:[function(e,t,r){!function(e){"use strict";var t,r,i,o,n,s,a,l,u,c;function d(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function f(e){return e="string"!=typeof e?String(e):e}function h(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return r&&(e[Symbol.iterator]=function(){return e}),e}function p(t){this.map={},t instanceof p?t.forEach(function(e,t){this.append(t,e)},this):Array.isArray(t)?t.forEach(function(e){this.append(e[0],e[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function m(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function y(r){return new Promise(function(e,t){r.onload=function(){e(r.result)},r.onerror=function(){t(r.error)}})}function g(e){var t=new FileReader,r=y(t);return t.readAsArrayBuffer(e),r}function v(e){var t;return e.slice?e.slice(0):((t=new Uint8Array(e.byteLength)).set(new Uint8Array(e)),t.buffer)}function b(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e)if("string"==typeof e)this._bodyText=e;else if(i&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(o&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(t&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(n&&i&&a(e))this._bodyArrayBuffer=v(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!n||!ArrayBuffer.prototype.isPrototypeOf(e)&&!l(e))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=v(e)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=m(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?m(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(g)}),this.text=function(){var e,t,r=m(this);if(r)return r;if(this._bodyBlob)return r=this._bodyBlob,e=new FileReader,t=y(e),e.readAsText(r),t;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),o=0;o<t.length;o++)r[o]=String.fromCharCode(t[o]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o&&(this.formData=function(){return this.text().then(_)}),this.json=function(){return this.text().then(JSON.parse)},this}function j(e,t){var r,o=(t=t||{}).body;if(e instanceof j){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new p(e.headers)),this.method=e.method,this.mode=e.mode,o||null==e._bodyInit||(o=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new p(t.headers)),this.method=(e=t.method||this.method||"GET",r=e.toUpperCase(),-1<u.indexOf(r)?r:e),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}function _(e){var r=new FormData;return e.trim().split("&").forEach(function(e){var t;e&&(t=(e=e.split("=")).shift().replace(/\+/g," "),e=e.join("=").replace(/\+/g," "),r.append(decodeURIComponent(t),decodeURIComponent(e)))}),r}function x(e,t){t=t||{},this.type="default",this.status=void 0===t.status?200:t.status,this.ok=200<=this.status&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new p(t.headers),this.url=t.url||"",this._initBody(e)}e.fetch||(t="URLSearchParams"in e,r="Symbol"in e&&"iterator"in Symbol,i="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),o="FormData"in e,(n="ArrayBuffer"in e)&&(s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],a=function(e){return e&&DataView.prototype.isPrototypeOf(e)},l=ArrayBuffer.isView||function(e){return e&&-1<s.indexOf(Object.prototype.toString.call(e))}),p.prototype.append=function(e,t){e=d(e),t=f(t);var r=this.map[e];this.map[e]=r?r+","+t:t},p.prototype.delete=function(e){delete this.map[d(e)]},p.prototype.get=function(e){return e=d(e),this.has(e)?this.map[e]:null},p.prototype.has=function(e){return this.map.hasOwnProperty(d(e))},p.prototype.set=function(e,t){this.map[d(e)]=f(t)},p.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},p.prototype.keys=function(){var r=[];return this.forEach(function(e,t){r.push(t)}),h(r)},p.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),h(t)},p.prototype.entries=function(){var r=[];return this.forEach(function(e,t){r.push([t,e])}),h(r)},r&&(p.prototype[Symbol.iterator]=p.prototype.entries),u=["DELETE","GET","HEAD","OPTIONS","POST","PUT"],j.prototype.clone=function(){return new j(this,{body:this._bodyInit})},b.call(j.prototype),b.call(x.prototype),x.prototype.clone=function(){return new x(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},x.error=function(){var e=new x(null,{status:0,statusText:""});return e.type="error",e},c=[301,302,303,307,308],x.redirect=function(e,t){if(-1===c.indexOf(t))throw new RangeError("Invalid status code");return new x(null,{status:t,headers:{location:e}})},e.Headers=p,e.Request=j,e.Response=x,e.fetch=function(r,s){return new Promise(function(o,e){var t=new j(r,s),n=new XMLHttpRequest;n.onload=function(){var r,e={status:n.status,statusText:n.statusText,headers:(e=n.getAllResponseHeaders()||"",r=new p,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(e){var e=e.split(":"),t=e.shift().trim();t&&(e=e.join(":").trim(),r.append(t,e))}),r)},t=(e.url="responseURL"in n?n.responseURL:e.headers.get("X-Request-URL"),"response"in n?n.response:n.responseText);o(new x(t,e))},n.onerror=function(){e(new TypeError("Network request failed"))},n.ontimeout=function(){e(new TypeError("Network request failed"))},n.open(t.method,t.url,!0),"include"===t.credentials?n.withCredentials=!0:"omit"===t.credentials&&(n.withCredentials=!1),"responseType"in n&&i&&(n.responseType="blob"),t.headers.forEach(function(e,t){n.setRequestHeader(t,e)}),n.send(void 0===t._bodyInit?null:t._bodyInit)})},e.fetch.polyfill=!0)}("undefined"!=typeof self?self:this)},{}],246:[function(e,t,r){"use strict";e("core-js/modules/es.function.name"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.split"),e("core-js/modules/es.function.name"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.split"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var l,o=n(e("../core/main")),u=n(e("../color/color_conversion"));function n(e){return e&&e.__esModule?e:{default:e}}var c=[{h:0,s:0,b:.8275,name:"gray"},{h:0,s:0,b:.8627,name:"gray"},{h:0,s:0,b:.7529,name:"gray"},{h:.0167,s:.1176,b:1,name:"light pink"}],d=[{h:0,s:0,b:0,name:"black"},{h:0,s:0,b:.5,name:"gray"},{h:0,s:0,b:1,name:"white"},{h:0,s:.5,b:.5,name:"dark maroon"},{h:0,s:.5,b:1,name:"salmon pink"},{h:0,s:1,b:0,name:"black"},{h:0,s:1,b:.5,name:"dark red"},{h:0,s:1,b:1,name:"red"},{h:5,s:0,b:1,name:"very light peach"},{h:5,s:.5,b:.5,name:"brown"},{h:5,s:.5,b:1,name:"peach"},{h:5,s:1,b:.5,name:"brick red"},{h:5,s:1,b:1,name:"crimson"},{h:10,s:0,b:1,name:"light peach"},{h:10,s:.5,b:.5,name:"brown"},{h:10,s:.5,b:1,name:"light orange"},{h:10,s:1,b:.5,name:"brown"},{h:10,s:1,b:1,name:"orange"},{h:15,s:0,b:1,name:"very light yellow"},{h:15,s:.5,b:.5,name:"olive green"},{h:15,s:.5,b:1,name:"light yellow"},{h:15,s:1,b:0,name:"dark olive green"},{h:15,s:1,b:.5,name:"olive green"},{h:15,s:1,b:1,name:"yellow"},{h:20,s:0,b:1,name:"very light yellow"},{h:20,s:.5,b:.5,name:"olive green"},{h:20,s:.5,b:1,name:"light yellow green"},{h:20,s:1,b:0,name:"dark olive green"},{h:20,s:1,b:.5,name:"dark yellow green"},{h:20,s:1,b:1,name:"yellow green"},{h:25,s:.5,b:.5,name:"dark yellow green"},{h:25,s:.5,b:1,name:"light green"},{h:25,s:1,b:.5,name:"dark green"},{h:25,s:1,b:1,name:"green"},{h:30,s:.5,b:1,name:"light green"},{h:30,s:1,b:.5,name:"dark green"},{h:30,s:1,b:1,name:"green"},{h:35,s:0,b:.5,name:"light green"},{h:35,s:0,b:1,name:"very light green"},{h:35,s:.5,b:.5,name:"dark green"},{h:35,s:.5,b:1,name:"light green"},{h:35,s:1,b:0,name:"very dark green"},{h:35,s:1,b:.5,name:"dark green"},{h:35,s:1,b:1,name:"green"},{h:40,s:0,b:1,name:"very light green"},{h:40,s:.5,b:.5,name:"dark green"},{h:40,s:.5,b:1,name:"light green"},{h:40,s:1,b:.5,name:"dark green"},{h:40,s:1,b:1,name:"green"},{h:45,s:.5,b:1,name:"light turquoise"},{h:45,s:1,b:.5,name:"dark turquoise"},{h:45,s:1,b:1,name:"turquoise"},{h:50,s:0,b:1,name:"light sky blue"},{h:50,s:.5,b:.5,name:"dark cyan"},{h:50,s:.5,b:1,name:"light cyan"},{h:50,s:1,b:.5,name:"dark cyan"},{h:50,s:1,b:1,name:"cyan"},{h:55,s:0,b:1,name:"light sky blue"},{h:55,s:.5,b:1,name:"light sky blue"},{h:55,s:1,b:.5,name:"dark blue"},{h:55,s:1,b:1,name:"sky blue"},{h:60,s:0,b:.5,name:"gray"},{h:60,s:0,b:1,name:"very light blue"},{h:60,s:.5,b:.5,name:"blue"},{h:60,s:.5,b:1,name:"light blue"},{h:60,s:1,b:.5,name:"navy blue"},{h:60,s:1,b:1,name:"blue"},{h:65,s:0,b:1,name:"lavender"},{h:65,s:.5,b:.5,name:"navy blue"},{h:65,s:.5,b:1,name:"light purple"},{h:65,s:1,b:.5,name:"dark navy blue"},{h:65,s:1,b:1,name:"blue"},{h:70,s:0,b:1,name:"lavender"},{h:70,s:.5,b:.5,name:"navy blue"},{h:70,s:.5,b:1,name:"lavender blue"},{h:70,s:1,b:.5,name:"dark navy blue"},{h:70,s:1,b:1,name:"blue"},{h:75,s:.5,b:1,name:"lavender"},{h:75,s:1,b:.5,name:"dark purple"},{h:75,s:1,b:1,name:"purple"},{h:80,s:.5,b:1,name:"pinkish purple"},{h:80,s:1,b:.5,name:"dark purple"},{h:80,s:1,b:1,name:"purple"},{h:85,s:0,b:1,name:"light pink"},{h:85,s:.5,b:.5,name:"purple"},{h:85,s:.5,b:1,name:"light fuchsia"},{h:85,s:1,b:.5,name:"dark fuchsia"},{h:85,s:1,b:1,name:"fuchsia"},{h:90,s:.5,b:.5,name:"dark fuchsia"},{h:90,s:.5,b:1,name:"hot pink"},{h:90,s:1,b:.5,name:"dark fuchsia"},{h:90,s:1,b:1,name:"fuchsia"},{h:95,s:0,b:1,name:"pink"},{h:95,s:.5,b:1,name:"light pink"},{h:95,s:1,b:.5,name:"dark magenta"},{h:95,s:1,b:1,name:"magenta"}];o.default.prototype._rgbColorName=function(e){var t,r,e=u.default._rgbaToHSBA(e),o=[(l=e)[0],e[1],e[2]];0!==o[0]&&(o[0]=Math.round(100*o[0]),(e=o[0].toString().split(""))[r=e.length-1]=parseInt(e[r]),e[r]<2.5?e[r]=0:2.5<=e[r]&&e[r]<7.5&&(e[r]=5),2===e.length?(e[0]=parseInt(e[0]),7.5<=e[r]&&(e[r]=0,e[0]=e[0]+1),o[0]=10*e[0]+e[1]):7.5<=e[r]?o[0]=10:o[0]=e[r]),o[2]=o[2]/255;for(var n=o.length-1;1<=n;n--)o[n]<=.25?o[n]=0:.25<o[n]&&o[n]<.75?o[n]=.5:o[n]=1;if(0===o[0]&&0===o[1]&&1===o[2]){for(var s=2;0<=s;s--)l[s]=Math.round(1e4*l[s])/1e4;for(var i=0;i<c.length;i++){if(c[i].h===l[0]&&c[i].s===l[1]&&c[i].b===l[2]){t=c[i].name;break}t="white"}}else for(var a=0;a<d.length;a++)if(d[a].h===o[0]&&d[a].s===o[1]&&d[a].b===o[2]){t=d[a].name;break}return t};e=o.default;r.default=e},{"../color/color_conversion":252,"../core/main":267,"core-js/modules/es.function.name":165,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.string.split":191}],247:[function(e,t,r){"use strict";e("core-js/modules/es.array.concat"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.ends-with"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.ends-with"),e("core-js/modules/es.string.replace"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var s=(e=e("../core/main"))&&e.__esModule?e:{default:e};var i="_Description",a="_fallbackDesc",l="_fallbackTable",u="_Label",c="_labelDesc",d="_labelTable";function f(e){if("label"===e||"fallback"===e)throw new Error("description should not be LABEL or FALLBACK");return e.endsWith(".")||e.endsWith(";")||e.endsWith(",")||e.endsWith("?")||e.endsWith("!")||(e+="."),e}s.default.prototype.describe=function(e,t){var r;s.default._validateParameters("describe",arguments),"string"==typeof e&&(r=this.canvas.id,e=f(e),this.dummyDOM||(this.dummyDOM=document.getElementById(r).parentNode),this.descriptions||(this.descriptions={}),this.descriptions.fallback?this.descriptions.fallback.innerHTML!==e&&(this.descriptions.fallback.innerHTML=e):this._describeHTML("fallback",e),t===this.LABEL&&(this.descriptions.label?this.descriptions.label.innerHTML!==e&&(this.descriptions.label.innerHTML=e):this._describeHTML("label",e)))},s.default.prototype.describeElement=function(e,t,r){var o,n;s.default._validateParameters("describeElement",arguments),"string"==typeof t&&"string"==typeof e&&(o=this.canvas.id,t=f(t),n=function(e){if("label"===e||"fallback"===e)throw new Error("element name should not be LABEL or FALLBACK");e.endsWith(".")||e.endsWith(";")||e.endsWith(",")?e=e.replace(/.$/,":"):e.endsWith(":")||(e+=":");return e}(e),e=e.replace(/[^a-zA-Z0-9]/g,""),n='<th scope="row">'.concat(n,"</th><td>").concat(t,"</td>"),this.dummyDOM||(this.dummyDOM=document.getElementById(o).parentNode),this.descriptions?this.descriptions.fallbackElements||(this.descriptions.fallbackElements={}):this.descriptions={fallbackElements:{}},this.descriptions.fallbackElements[e]?this.descriptions.fallbackElements[e].innerHTML!==n&&(this.descriptions.fallbackElements[e].innerHTML=n):this._describeElementHTML("fallback",e,n),r===this.LABEL&&(this.descriptions.labelElements||(this.descriptions.labelElements={}),this.descriptions.labelElements[e]?this.descriptions.labelElements[e].innerHTML!==n&&(this.descriptions.labelElements[e].innerHTML=n):this._describeElementHTML("label",e,n)))},s.default.prototype._describeHTML=function(e,t){var r,o=this.canvas.id;"fallback"===e?(this.dummyDOM.querySelector("#".concat(o+i))?this.dummyDOM.querySelector("#"+o+l).insertAdjacentHTML("beforebegin",'<p id="'.concat(o+a,'"></p>')):(r='<div id="'.concat(o).concat(i,'" role="region" aria-label="Canvas Description"><p id="').concat(o).concat(a,'"></p></div>'),this.dummyDOM.querySelector("#".concat(o,"accessibleOutput"))?this.dummyDOM.querySelector("#".concat(o,"accessibleOutput")).insertAdjacentHTML("beforebegin",r):this.dummyDOM.querySelector("#".concat(o)).innerHTML=r),this.descriptions.fallback=this.dummyDOM.querySelector("#".concat(o).concat(a)),this.descriptions.fallback.innerHTML=t):"label"===e&&(this.dummyDOM.querySelector("#".concat(o+u))?this.dummyDOM.querySelector("#".concat(o+d))&&this.dummyDOM.querySelector("#".concat(o+d)).insertAdjacentHTML("beforebegin",'<p id="'.concat(o).concat(c,'"></p>')):(r='<div id="'.concat(o).concat(u,'" class="p5Label"><p id="').concat(o).concat(c,'"></p></div>'),this.dummyDOM.querySelector("#".concat(o,"accessibleOutputLabel"))?this.dummyDOM.querySelector("#".concat(o,"accessibleOutputLabel")).insertAdjacentHTML("beforebegin",r):this.dummyDOM.querySelector("#"+o).insertAdjacentHTML("afterend",r)),this.descriptions.label=this.dummyDOM.querySelector("#"+o+c),this.descriptions.label.innerHTML=t)},s.default.prototype._describeElementHTML=function(e,t,r){var o,n=this.canvas.id;"fallback"===e?(this.dummyDOM.querySelector("#".concat(n+i))?this.dummyDOM.querySelector("#"+n+l)||this.dummyDOM.querySelector("#"+n+a).insertAdjacentHTML("afterend",'<table id="'.concat(n).concat(l,'"><caption>Canvas elements and their descriptions</caption></table>')):(o='<div id="'.concat(n).concat(i,'" role="region" aria-label="Canvas Description"><table id="').concat(n).concat(l,'"><caption>Canvas elements and their descriptions</caption></table></div>'),this.dummyDOM.querySelector("#".concat(n,"accessibleOutput"))?this.dummyDOM.querySelector("#".concat(n,"accessibleOutput")).insertAdjacentHTML("beforebegin",o):this.dummyDOM.querySelector("#"+n).innerHTML=o),(o=document.createElement("tr")).id=n+"_fte_"+t,this.dummyDOM.querySelector("#"+n+l).appendChild(o),this.descriptions.fallbackElements[t]=this.dummyDOM.querySelector("#".concat(n).concat("_fte_").concat(t)),this.descriptions.fallbackElements[t].innerHTML=r):"label"===e&&(this.dummyDOM.querySelector("#".concat(n+u))?this.dummyDOM.querySelector("#".concat(n+d))||this.dummyDOM.querySelector("#"+n+c).insertAdjacentHTML("afterend",'<table id="'.concat(n+d,'"></table>')):(o='<div id="'.concat(n).concat(u,'" class="p5Label"><table id="').concat(n).concat(d,'"></table></div>'),this.dummyDOM.querySelector("#".concat(n,"accessibleOutputLabel"))?this.dummyDOM.querySelector("#".concat(n,"accessibleOutputLabel")).insertAdjacentHTML("beforebegin",o):this.dummyDOM.querySelector("#"+n).insertAdjacentHTML("afterend",o)),(e=document.createElement("tr")).id=n+"_lte_"+t,this.dummyDOM.querySelector("#"+n+d).appendChild(e),this.descriptions.labelElements[t]=this.dummyDOM.querySelector("#".concat(n).concat("_lte_").concat(t)),this.descriptions.labelElements[t].innerHTML=r)};e=s.default;r.default=e},{"../core/main":267,"core-js/modules/es.array.concat":149,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.string.ends-with":184,"core-js/modules/es.string.replace":189}],248:[function(e,t,r){"use strict";e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.map"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;e=(e=e("../core/main"))&&e.__esModule?e:{default:e};e.default.prototype._updateGridOutput=function(e){var t,r,o,n;this.dummyDOM.querySelector("#".concat(e,"_summary"))&&(t=this._accessibleOutputs[e],o=function(e,t,r,o){t="".concat(t," canvas, ").concat(r," by ").concat(o," pixels, contains ").concat(e[0]);t=(1===e[0]?"".concat(t," shape: "):"".concat(t," shapes: ")).concat(e[1]);return t}((r=function(e,t){var r,o="",n="",s=0;for(r in t){var i,a=0;for(i in t[r]){var l='<li id="'.concat(e,"shape").concat(s,'">').concat(t[r][i].color," ").concat(r,",");"line"===r?l+=" location = ".concat(t[r][i].pos,", length = ").concat(t[r][i].length," pixels"):(l+=" location = ".concat(t[r][i].pos),"point"!==r&&(l+=", area = ".concat(t[r][i].area," %")),l+="</li>"),o+=l,a++,s++}n=1<a?"".concat(n," ").concat(a," ").concat(r,"s"):"".concat(n," ").concat(a," ").concat(r)}return{numShapes:[s,n],details:o}}(e,this.ingredients.shapes)).numShapes,this.ingredients.colors.background,this.width,this.height),n=function(e,t){var r,o,n,s=0,i="",a=Array.apply(null,Array(10)).map(function(){});for(r in a)a[r]=Array.apply(null,Array(10)).map(function(){});for(o in t)for(var l in t[o]){var u=void 0;u="line"!==o?'<a href="#'.concat(e,"shape").concat(s,'">').concat(t[o][l].color," ").concat(o,"</a>"):'<a href="#'.concat(e,"shape").concat(s,'">').concat(t[o][l].color," ").concat(o," midpoint</a>"),a[t[o][l].loc.locY][t[o][l].loc.locX]?a[t[o][l].loc.locY][t[o][l].loc.locX]=a[t[o][l].loc.locY][t[o][l].loc.locX]+" "+u:a[t[o][l].loc.locY][t[o][l].loc.locX]=u,s++}for(n in a){var c,d="<tr>";for(c in a[n])d+="<td>",void 0!==a[n][c]&&(d+=a[n][c]),d+="</td>";i=i+d+"</tr>"}return i}(e,this.ingredients.shapes),o!==t.summary.innerHTML&&(t.summary.innerHTML=o),n!==t.map.innerHTML&&(t.map.innerHTML=n),r.details!==t.shapeDetails.innerHTML&&(t.shapeDetails.innerHTML=r.details),this._accessibleOutputs[e]=t)};e=e.default;r.default=e},{"../core/main":267,"core-js/modules/es.array.concat":149,"core-js/modules/es.array.map":161}],249:[function(e,t,r){"use strict";e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.map"),e("core-js/modules/es.number.to-fixed"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.map"),e("core-js/modules/es.number.to-fixed"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(e=e("../core/main"))&&e.__esModule?e:{default:e};function l(e,t,r){return e[0]<.4*t?e[1]<.4*r?"top left":e[1]>.6*r?"bottom left":"mid left":e[0]>.6*t?e[1]<.4*r?"top right":e[1]>.6*r?"bottom right":"mid right":e[1]<.4*r?"top middle":e[1]>.6*r?"bottom middle":"middle"}function u(e,t,r){t=Math.floor(e[0]/t*10),e=Math.floor(e[1]/r*10);return 10===t&&(t-=1),10===e&&(e-=1),{locX:t,locY:e}}o.default.prototype.textOutput=function(e){o.default._validateParameters("textOutput",arguments),this._accessibleOutputs.text||(this._accessibleOutputs.text=!0,this._createOutput("textOutput","Fallback"),e===this.LABEL&&(this._accessibleOutputs.textLabel=!0,this._createOutput("textOutput","Label")))},o.default.prototype.gridOutput=function(e){o.default._validateParameters("gridOutput",arguments),this._accessibleOutputs.grid||(this._accessibleOutputs.grid=!0,this._createOutput("gridOutput","Fallback"),e===this.LABEL&&(this._accessibleOutputs.gridLabel=!0,this._createOutput("gridOutput","Label")))},o.default.prototype._addAccsOutput=function(){return this._accessibleOutputs||(this._accessibleOutputs={text:!1,grid:!1,textLabel:!1,gridLabel:!1}),this._accessibleOutputs.grid||this._accessibleOutputs.text},o.default.prototype._createOutput=function(e,t){var r,o,n,s=this.canvas.id,i=(this.ingredients||(this.ingredients={shapes:{},colors:{background:"white",fill:"white",stroke:"black"},pShapes:""}),this.dummyDOM||(this.dummyDOM=document.getElementById(s).parentNode),"");"Fallback"===t?(r=s+e,this.dummyDOM.querySelector("#".concat(o=s+"accessibleOutput"))||(this.dummyDOM.querySelector("#".concat(s,"_Description"))?this.dummyDOM.querySelector("#".concat(s,"_Description")).insertAdjacentHTML("afterend",'<div id="'.concat(o,'" role="region" aria-label="Canvas Outputs"></div>')):this.dummyDOM.querySelector("#".concat(s)).innerHTML='<div id="'.concat(o,'" role="region" aria-label="Canvas Outputs"></div>'))):"Label"===t&&(r=s+e+(i=t),this.dummyDOM.querySelector("#".concat(o=s+"accessibleOutput"+t))||(this.dummyDOM.querySelector("#".concat(s,"_Label"))?this.dummyDOM.querySelector("#".concat(s,"_Label")):this.dummyDOM.querySelector("#".concat(s))).insertAdjacentHTML("afterend",'<div id="'.concat(o,'"></div>'))),this._accessibleOutputs[r]={},"textOutput"===e?(i="#".concat(s,"gridOutput").concat(i),n='<div id="'.concat(r,'">Text Output<div id="').concat(r,'Summary" aria-label="text output summary"><p id="').concat(r,'_summary"></p><ul id="').concat(r,'_list"></ul></div><table id="').concat(r,'_shapeDetails" summary="text output shape details"></table></div>'),this.dummyDOM.querySelector(i)?this.dummyDOM.querySelector(i).insertAdjacentHTML("beforebegin",n):this.dummyDOM.querySelector("#".concat(o)).innerHTML=n,this._accessibleOutputs[r].list=this.dummyDOM.querySelector("#".concat(r,"_list"))):"gridOutput"===e&&(i="#".concat(s,"textOutput").concat(i),n='<div id="'.concat(r,'">Grid Output<p id="').concat(r,'_summary" aria-label="grid output summary"><table id="').concat(r,'_map" summary="grid output content"></table><ul id="').concat(r,'_shapeDetails" aria-label="grid output shape details"></ul></div>'),this.dummyDOM.querySelector(i)?this.dummyDOM.querySelector(i).insertAdjacentHTML("afterend",n):this.dummyDOM.querySelector("#".concat(o)).innerHTML=n,this._accessibleOutputs[r].map=this.dummyDOM.querySelector("#".concat(r,"_map"))),this._accessibleOutputs[r].shapeDetails=this.dummyDOM.querySelector("#".concat(r,"_shapeDetails")),this._accessibleOutputs[r].summary=this.dummyDOM.querySelector("#".concat(r,"_summary"))},o.default.prototype._updateAccsOutput=function(){var e=this.canvas.id;JSON.stringify(this.ingredients.shapes)!==this.ingredients.pShapes&&(this.ingredients.pShapes=JSON.stringify(this.ingredients.shapes),this._accessibleOutputs.text&&this._updateTextOutput(e+"textOutput"),this._accessibleOutputs.grid&&this._updateGridOutput(e+"gridOutput"),this._accessibleOutputs.textLabel&&this._updateTextOutput(e+"textOutputLabel"),this._accessibleOutputs.gridLabel&&this._updateGridOutput(e+"gridOutputLabel"))},o.default.prototype._accsBackground=function(e){this.ingredients.pShapes=JSON.stringify(this.ingredients.shapes),this.ingredients.shapes={},this.ingredients.colors.backgroundRGBA!==e&&(this.ingredients.colors.backgroundRGBA=e,this.ingredients.colors.background=this._rgbColorName(e))},o.default.prototype._accsCanvasColors=function(e,t){"fill"===e?this.ingredients.colors.fillRGBA!==t&&(this.ingredients.colors.fillRGBA=t,this.ingredients.colors.fill=this._rgbColorName(t)):"stroke"===e&&this.ingredients.colors.strokeRGBA!==t&&(this.ingredients.colors.strokeRGBA=t,this.ingredients.colors.stroke=this._rgbColorName(t))},o.default.prototype._accsOutput=function(e,t){"ellipse"===e&&t[2]===t[3]?e="circle":"rectangle"===e&&t[2]===t[3]&&(e="square");var r,o,n={},s=!0,i=function(e,t){var r;e="rectangle"===e||"ellipse"===e||"arc"===e||"circle"===e||"square"===e?(r=Math.round(t[0]+t[2]/2),Math.round(t[1]+t[3]/2)):"triangle"===e?(r=(t[0]+t[2]+t[4])/3,(t[1]+t[3]+t[5])/3):"quadrilateral"===e?(r=(t[0]+t[2]+t[4]+t[6])/4,(t[1]+t[3]+t[5]+t[7])/4):"line"===e?(r=(t[0]+t[2])/2,(t[1]+t[3])/2):(r=t[0],t[1]);return[r,e]}(e,t);if("line"===e?(n.color=this.ingredients.colors.stroke,n.length=Math.round(this.dist(t[0],t[1],t[2],t[3])),r=l([t[0],[1]],this.width,this.height),o=l([t[2],[3]],this.width,this.height),n.loc=u(i,this.width,this.height),n.pos=r===o?"at ".concat(r):"from ".concat(r," to ").concat(o)):("point"===e?n.color=this.ingredients.colors.stroke:(n.color=this.ingredients.colors.fill,n.area=function(e,t,r,o){var n=0;{var s,i,a,l,u,c,d;"arc"===e?(s=((t[5]-t[4])%(2*Math.PI)+2*Math.PI)%(2*Math.PI),n=s*t[2]*t[3]/8,"open"!==t[6]&&"chord"!==t[6]||(d=t[0],i=t[1],a=t[0]+t[2]/2*Math.cos(t[4]).toFixed(2),l=t[1]+t[3]/2*Math.sin(t[4]).toFixed(2),u=t[0]+t[2]/2*Math.cos(t[5]).toFixed(2),c=t[1]+t[3]/2*Math.sin(t[5]).toFixed(2),d=Math.abs(d*(l-c)+a*(c-i)+u*(i-l))/2,s>Math.PI?n+=d:n-=d)):"ellipse"===e||"circle"===e?n=3.14*t[2]/2*t[3]/2:"line"===e||"point"===e?n=0:"quadrilateral"===e?n=Math.abs((t[6]+t[0])*(t[7]-t[1])+(t[0]+t[2])*(t[1]-t[3])+(t[2]+t[4])*(t[3]-t[5])+(t[4]+t[6])*(t[5]-t[7]))/2:"rectangle"===e||"square"===e?n=t[2]*t[3]:"triangle"===e&&(n=Math.abs(t[0]*(t[3]-t[5])+t[2]*(t[5]-t[1])+t[4]*(t[1]-t[3]))/2)}return Math.round(100*n/(r*o))}(e,t,this.width,this.height)),n.pos=l(i,this.width,this.height),n.loc=u(i,this.width,this.height)),this.ingredients.shapes[e]){if(this.ingredients.shapes[e]!==[n]){for(var a in this.ingredients.shapes[e])JSON.stringify(this.ingredients.shapes[e][a])===JSON.stringify(n)&&(s=!1);!0===s&&this.ingredients.shapes[e].push(n)}}else this.ingredients.shapes[e]=[n]};e=o.default;r.default=e},{"../core/main":267,"core-js/modules/es.array.concat":149,"core-js/modules/es.array.fill":152,"core-js/modules/es.array.map":161,"core-js/modules/es.number.to-fixed":171}],250:[function(e,t,r){"use strict";e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.concat"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;e=(e=e("../core/main"))&&e.__esModule?e:{default:e};e.default.prototype._updateTextOutput=function(e){var t,r,o,n;this.dummyDOM.querySelector("#".concat(e,"_summary"))&&(t=this._accessibleOutputs[e],o=function(e,t,r,o){r="Your output is a, ".concat(r," by ").concat(o," pixels, ").concat(t," canvas containing the following");r=1===e?"".concat(r," shape:"):"".concat(r," ").concat(e," shapes:");return r}((r=function(e,t){var r,o="",n=0;for(r in t)for(var s in t[r]){var i='<li><a href="#'.concat(e,"shape").concat(n,'">').concat(t[r][s].color," ").concat(r,"</a>");"line"===r?i+=", ".concat(t[r][s].pos,", ").concat(t[r][s].length," pixels long.</li>"):(i+=", at ".concat(t[r][s].pos),"point"!==r&&(i+=", covering ".concat(t[r][s].area,"% of the canvas")),i+=".</li>"),o+=i,n++}return{numShapes:n,listShapes:o}}(e,this.ingredients.shapes)).numShapes,this.ingredients.colors.background,this.width,this.height),n=function(e,t){var r,o="",n=0;for(r in t)for(var s in t[r]){var i='<tr id="'.concat(e,"shape").concat(n,'"><th>').concat(t[r][s].color," ").concat(r,"</th>");"line"===r?i+="<td>location = ".concat(t[r][s].pos,"</td><td>length = ").concat(t[r][s].length," pixels</td></tr>"):(i+="<td>location = ".concat(t[r][s].pos,"</td>"),"point"!==r&&(i+="<td> area = ".concat(t[r][s].area,"%</td>")),i+="</tr>"),o+=i,n++}return o}(e,this.ingredients.shapes),o!==t.summary.innerHTML&&(t.summary.innerHTML=o),r.listShapes!==t.list.innerHTML&&(t.list.innerHTML=r.listShapes),n!==t.shapeDetails.innerHTML&&(t.shapeDetails.innerHTML=n),this._accessibleOutputs[e]=t)};e=e.default;r.default=e},{"../core/main":267,"core-js/modules/es.array.concat":149}],251:[function(e,t,r){"use strict";var o=(o=e("./core/main"))&&o.__esModule?o:{default:o};e("./core/constants"),e("./core/environment"),e("./core/friendly_errors/stacktrace"),e("./core/friendly_errors/validate_params"),e("./core/friendly_errors/file_errors"),e("./core/friendly_errors/fes_core"),e("./core/friendly_errors/sketch_reader"),e("./core/helpers"),e("./core/legacy"),e("./core/preload"),e("./core/p5.Element"),e("./core/p5.Graphics"),e("./core/p5.Renderer"),e("./core/p5.Renderer2D"),e("./core/rendering"),e("./core/shim"),e("./core/structure"),e("./core/transform"),e("./core/shape/2d_primitives"),e("./core/shape/attributes"),e("./core/shape/curves"),e("./core/shape/vertex"),e("./accessibility/outputs"),e("./accessibility/textOutput"),e("./accessibility/gridOutput"),e("./accessibility/color_namer"),e("./color/color_conversion"),e("./color/creating_reading"),e("./color/p5.Color"),e("./color/setting"),e("./data/p5.TypedDict"),e("./data/local_storage.js"),e("./dom/dom"),e("./accessibility/describe"),e("./events/acceleration"),e("./events/keyboard"),e("./events/mouse"),e("./events/touch"),e("./image/filters"),e("./image/image"),e("./image/loading_displaying"),e("./image/p5.Image"),e("./image/pixels"),e("./io/files"),e("./io/p5.Table"),e("./io/p5.TableRow"),e("./io/p5.XML"),e("./math/calculation"),e("./math/math"),e("./math/noise"),e("./math/p5.Vector"),e("./math/random"),e("./math/trigonometry"),e("./typography/attributes"),e("./typography/loading_displaying"),e("./typography/p5.Font"),e("./utilities/array_functions"),e("./utilities/conversion"),e("./utilities/string_functions"),e("./utilities/time_date"),e("./webgl/3d_primitives"),e("./webgl/interaction"),e("./webgl/light"),e("./webgl/loading"),e("./webgl/material"),e("./webgl/p5.Camera"),e("./webgl/p5.Geometry"),e("./webgl/p5.Matrix"),e("./webgl/p5.RendererGL.Immediate"),e("./webgl/p5.RendererGL"),e("./webgl/p5.RendererGL.Retained"),e("./webgl/p5.Shader"),e("./webgl/p5.RenderBuffer"),e("./webgl/p5.Texture"),e("./webgl/text"),e("./core/init"),t.exports=o.default},{"./accessibility/color_namer":246,"./accessibility/describe":247,"./accessibility/gridOutput":248,"./accessibility/outputs":249,"./accessibility/textOutput":250,"./color/color_conversion":252,"./color/creating_reading":253,"./color/p5.Color":254,"./color/setting":255,"./core/constants":256,"./core/environment":257,"./core/friendly_errors/fes_core":258,"./core/friendly_errors/file_errors":259,"./core/friendly_errors/sketch_reader":260,"./core/friendly_errors/stacktrace":261,"./core/friendly_errors/validate_params":262,"./core/helpers":263,"./core/init":264,"./core/legacy":266,"./core/main":267,"./core/p5.Element":268,"./core/p5.Graphics":269,"./core/p5.Renderer":270,"./core/p5.Renderer2D":271,"./core/preload":272,"./core/rendering":273,"./core/shape/2d_primitives":274,"./core/shape/attributes":275,"./core/shape/curves":276,"./core/shape/vertex":277,"./core/shim":278,"./core/structure":279,"./core/transform":280,"./data/local_storage.js":281,"./data/p5.TypedDict":282,"./dom/dom":283,"./events/acceleration":284,"./events/keyboard":285,"./events/mouse":286,"./events/touch":287,"./image/filters":288,"./image/image":289,"./image/loading_displaying":290,"./image/p5.Image":291,"./image/pixels":292,"./io/files":293,"./io/p5.Table":294,"./io/p5.TableRow":295,"./io/p5.XML":296,"./math/calculation":297,"./math/math":298,"./math/noise":299,"./math/p5.Vector":300,"./math/random":301,"./math/trigonometry":302,"./typography/attributes":303,"./typography/loading_displaying":304,"./typography/p5.Font":305,"./utilities/array_functions":306,"./utilities/conversion":307,"./utilities/string_functions":308,"./utilities/time_date":309,"./webgl/3d_primitives":310,"./webgl/interaction":311,"./webgl/light":312,"./webgl/loading":313,"./webgl/material":314,"./webgl/p5.Camera":315,"./webgl/p5.Geometry":316,"./webgl/p5.Matrix":317,"./webgl/p5.RenderBuffer":318,"./webgl/p5.RendererGL":321,"./webgl/p5.RendererGL.Immediate":319,"./webgl/p5.RendererGL.Retained":320,"./webgl/p5.Shader":322,"./webgl/p5.Texture":323,"./webgl/text":324}],252:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;e=(e=e("../core/main"))&&e.__esModule?e:{default:e};e.default.ColorConversion={},e.default.ColorConversion._hsbaToHSLA=function(e){var t=e[0],r=e[1],o=e[2],n=(2-r)*o/2;return 0!=n&&(1==n?r=0:n<.5?r/=2-r:r=r*o/(2-2*n)),[t,r,n,e[3]]},e.default.ColorConversion._hsbaToRGBA=function(e){var t,r,o,n,s,i=6*e[0],a=e[1],l=e[2];return 0===a?[l,l,l,e[3]]:(r=l*(1-a),o=l*(1-a*(i-(t=Math.floor(i)))),a=l*(1-a*(1+t-i)),i=1===t?(n=o,s=l,r):2===t?(n=r,s=l,a):3===t?(n=r,s=o,l):4===t?(n=a,s=r,l):5===t?(n=l,s=r,o):(n=l,s=a,r),[n,s,i,e[3]])},e.default.ColorConversion._hslaToHSBA=function(e){var t=e[0],r=e[1],o=e[2],n=o<.5?(1+r)*o:o+r-o*r;return[t,r=2*(n-o)/n,n,e[3]]},e.default.ColorConversion._hslaToRGBA=function(e){var t,r=6*e[0],o=e[1],n=e[2];return 0===o?[n,n,n,e[3]]:[(t=function(e,t,r){return e<0?e+=6:6<=e&&(e-=6),e<1?t+(r-t)*e:e<3?r:e<4?t+(r-t)*(4-e):t})(2+r,o=2*n-(n=n<.5?(1+o)*n:n+o-n*o),n),t(r,o,n),t(r-2,o,n),e[3]]},e.default.ColorConversion._rgbaToHSBA=function(e){var t,r,o=e[0],n=e[1],s=e[2],i=Math.max(o,n,s),a=i-Math.min(o,n,s);return 0==a?r=t=0:(r=a/i,o===i?t=(n-s)/a:n===i?t=2+(s-o)/a:s===i&&(t=4+(o-n)/a),t<0?t+=6:6<=t&&(t-=6)),[t/6,r,i,e[3]]},e.default.ColorConversion._rgbaToHSLA=function(e){var t,r,o=e[0],n=e[1],s=e[2],i=Math.max(o,n,s),a=Math.min(o,n,s),l=i+a,a=i-a;return 0==a?r=t=0:(r=l<1?a/l:a/(2-l),o===i?t=(n-s)/a:n===i?t=2+(s-o)/a:s===i&&(t=4+(o-n)/a),t<0?t+=6:6<=t&&(t-=6)),[t/6,r,l/2,e[3]]};e=e.default.ColorConversion;r.default=e},{"../core/main":267}],253:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.map"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.map"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var l=(n=e("../core/main"))&&n.__esModule?n:{default:n},u=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}e("./p5.Color"),e("../core/friendly_errors/validate_params"),e("../core/friendly_errors/file_errors"),e("../core/friendly_errors/fes_core"),l.default.prototype.alpha=function(e){return l.default._validateParameters("alpha",arguments),this.color(e)._getAlpha()},l.default.prototype.blue=function(e){return l.default._validateParameters("blue",arguments),this.color(e)._getBlue()},l.default.prototype.brightness=function(e){return l.default._validateParameters("brightness",arguments),this.color(e)._getBrightness()},l.default.prototype.color=function(){var e;return l.default._validateParameters("color",arguments),arguments[0]instanceof l.default.Color?arguments[0]:(e=arguments[0]instanceof Array?arguments[0]:arguments,new l.default.Color(this,e))},l.default.prototype.green=function(e){return l.default._validateParameters("green",arguments),this.color(e)._getGreen()},l.default.prototype.hue=function(e){return l.default._validateParameters("hue",arguments),this.color(e)._getHue()},l.default.prototype.lerpColor=function(e,t,r){l.default._validateParameters("lerpColor",arguments);var o,n,s,i=this._colorMode,a=this._colorMaxes;if(i===u.RGB)n=e.levels.map(function(e){return e/255}),s=t.levels.map(function(e){return e/255});else if(i===u.HSB)e._getBrightness(),t._getBrightness(),n=e.hsba,s=t.hsba;else{if(i!==u.HSL)throw new Error("".concat(i,"cannot be used for interpolation."));e._getLightness(),t._getLightness(),n=e.hsla,s=t.hsla}return r=Math.max(Math.min(r,1),0),void 0===this.lerp&&(this.lerp=function(e,t,r){return r*(t-e)+e}),e=this.lerp(n[0],s[0],r),t=this.lerp(n[1],s[1],r),o=this.lerp(n[2],s[2],r),n=this.lerp(n[3],s[3],r),e*=a[i][0],t*=a[i][1],o*=a[i][2],n*=a[i][3],this.color(e,t,o,n)},l.default.prototype.lightness=function(e){return l.default._validateParameters("lightness",arguments),this.color(e)._getLightness()},l.default.prototype.red=function(e){return l.default._validateParameters("red",arguments),this.color(e)._getRed()},l.default.prototype.saturation=function(e){return l.default._validateParameters("saturation",arguments),this.color(e)._getSaturation()};var n=l.default;r.default=n},{"../core/constants":256,"../core/friendly_errors/fes_core":258,"../core/friendly_errors/file_errors":259,"../core/friendly_errors/validate_params":262,"../core/main":267,"./p5.Color":254,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.map":161,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],254:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.trim"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.trim"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var c=n(e("../core/main")),d=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants")),f=n(e("./color_conversion"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}function n(e){return e&&e.__esModule?e:{default:e}}c.default.Color=function(e,t){if(this._storeModeAndMaxes(e._colorMode,e._colorMaxes),this.mode!==d.RGB&&this.mode!==d.HSL&&this.mode!==d.HSB)throw new Error("".concat(this.mode," is an invalid colorMode."));return this._array=c.default.Color._parseInputs.apply(this,t),this._calculateLevels(),this},c.default.Color.prototype.toString=function(e){var t=this.levels,r=this._array,o=r[3];switch(e){case"#rrggbb":return"#".concat(t[0]<16?"0".concat(t[0].toString(16)):t[0].toString(16),t[1]<16?"0".concat(t[1].toString(16)):t[1].toString(16),t[2]<16?"0".concat(t[2].toString(16)):t[2].toString(16));case"#rrggbbaa":return"#".concat(t[0]<16?"0".concat(t[0].toString(16)):t[0].toString(16),t[1]<16?"0".concat(t[1].toString(16)):t[1].toString(16),t[2]<16?"0".concat(t[2].toString(16)):t[2].toString(16),t[3]<16?"0".concat(t[3].toString(16)):t[3].toString(16));case"#rgb":return"#".concat(Math.round(15*r[0]).toString(16),Math.round(15*r[1]).toString(16),Math.round(15*r[2]).toString(16));case"#rgba":return"#".concat(Math.round(15*r[0]).toString(16),Math.round(15*r[1]).toString(16),Math.round(15*r[2]).toString(16),Math.round(15*r[3]).toString(16));case"rgb":return"rgb(".concat(t[0],", ",t[1],", ",t[2],")");case"rgb%":return"rgb(".concat((100*r[0]).toPrecision(3),"%, ",(100*r[1]).toPrecision(3),"%, ",(100*r[2]).toPrecision(3),"%)");case"rgba%":return"rgba(".concat((100*r[0]).toPrecision(3),"%, ",(100*r[1]).toPrecision(3),"%, ",(100*r[2]).toPrecision(3),"%, ",(100*r[3]).toPrecision(3),"%)");case"hsb":case"hsv":return this.hsba||(this.hsba=f.default._rgbaToHSBA(this._array)),"hsb(".concat(this.hsba[0]*this.maxes[d.HSB][0],", ",this.hsba[1]*this.maxes[d.HSB][1],", ",this.hsba[2]*this.maxes[d.HSB][2],")");case"hsb%":case"hsv%":return this.hsba||(this.hsba=f.default._rgbaToHSBA(this._array)),"hsb(".concat((100*this.hsba[0]).toPrecision(3),"%, ",(100*this.hsba[1]).toPrecision(3),"%, ",(100*this.hsba[2]).toPrecision(3),"%)");case"hsba":case"hsva":return this.hsba||(this.hsba=f.default._rgbaToHSBA(this._array)),"hsba(".concat(this.hsba[0]*this.maxes[d.HSB][0],", ",this.hsba[1]*this.maxes[d.HSB][1],", ",this.hsba[2]*this.maxes[d.HSB][2],", ",o,")");case"hsba%":case"hsva%":return this.hsba||(this.hsba=f.default._rgbaToHSBA(this._array)),"hsba(".concat((100*this.hsba[0]).toPrecision(3),"%, ",(100*this.hsba[1]).toPrecision(3),"%, ",(100*this.hsba[2]).toPrecision(3),"%, ",(100*o).toPrecision(3),"%)");case"hsl":return this.hsla||(this.hsla=f.default._rgbaToHSLA(this._array)),"hsl(".concat(this.hsla[0]*this.maxes[d.HSL][0],", ",this.hsla[1]*this.maxes[d.HSL][1],", ",this.hsla[2]*this.maxes[d.HSL][2],")");case"hsl%":return this.hsla||(this.hsla=f.default._rgbaToHSLA(this._array)),"hsl(".concat((100*this.hsla[0]).toPrecision(3),"%, ",(100*this.hsla[1]).toPrecision(3),"%, ",(100*this.hsla[2]).toPrecision(3),"%)");case"hsla":return this.hsla||(this.hsla=f.default._rgbaToHSLA(this._array)),"hsla(".concat(this.hsla[0]*this.maxes[d.HSL][0],", ",this.hsla[1]*this.maxes[d.HSL][1],", ",this.hsla[2]*this.maxes[d.HSL][2],", ",o,")");case"hsla%":return this.hsla||(this.hsla=f.default._rgbaToHSLA(this._array)),"hsl(".concat((100*this.hsla[0]).toPrecision(3),"%, ",(100*this.hsla[1]).toPrecision(3),"%, ",(100*this.hsla[2]).toPrecision(3),"%, ",(100*o).toPrecision(3),"%)");default:return"rgba(".concat(t[0],",",t[1],",",t[2],",",o,")")}},c.default.Color.prototype.setRed=function(e){this._array[0]=e/this.maxes[d.RGB][0],this._calculateLevels()},c.default.Color.prototype.setGreen=function(e){this._array[1]=e/this.maxes[d.RGB][1],this._calculateLevels()},c.default.Color.prototype.setBlue=function(e){this._array[2]=e/this.maxes[d.RGB][2],this._calculateLevels()},c.default.Color.prototype.setAlpha=function(e){this._array[3]=e/this.maxes[this.mode][3],this._calculateLevels()},c.default.Color.prototype._calculateLevels=function(){for(var e=this._array,t=this.levels=new Array(e.length),r=e.length-1;0<=r;--r)t[r]=Math.round(255*e[r]);this.hsla=null,this.hsba=null},c.default.Color.prototype._getAlpha=function(){return this._array[3]*this.maxes[this.mode][3]},c.default.Color.prototype._storeModeAndMaxes=function(e,t){this.mode=e,this.maxes=t},c.default.Color.prototype._getMode=function(){return this.mode},c.default.Color.prototype._getMaxes=function(){return this.maxes},c.default.Color.prototype._getBlue=function(){return this._array[2]*this.maxes[d.RGB][2]},c.default.Color.prototype._getBrightness=function(){return this.hsba||(this.hsba=f.default._rgbaToHSBA(this._array)),this.hsba[2]*this.maxes[d.HSB][2]},c.default.Color.prototype._getGreen=function(){return this._array[1]*this.maxes[d.RGB][1]},c.default.Color.prototype._getHue=function(){return this.mode===d.HSB?(this.hsba||(this.hsba=f.default._rgbaToHSBA(this._array)),this.hsba[0]*this.maxes[d.HSB][0]):(this.hsla||(this.hsla=f.default._rgbaToHSLA(this._array)),this.hsla[0]*this.maxes[d.HSL][0])},c.default.Color.prototype._getLightness=function(){return this.hsla||(this.hsla=f.default._rgbaToHSLA(this._array)),this.hsla[2]*this.maxes[d.HSL][2]},c.default.Color.prototype._getRed=function(){return this._array[0]*this.maxes[d.RGB][0]},c.default.Color.prototype._getSaturation=function(){return this.mode===d.HSB?(this.hsba||(this.hsba=f.default._rgbaToHSBA(this._array)),this.hsba[1]*this.maxes[d.HSB][1]):(this.hsla||(this.hsla=f.default._rgbaToHSLA(this._array)),this.hsla[1]*this.maxes[d.HSL][1])};var h={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},e=/\s*/,s=/(\d{1,3})/,l=/((?:\d+(?:\.\d+)?)|(?:\.\d+))/,u=new RegExp("".concat(l.source,"%")),p={HEX3:/^#([a-f0-9])([a-f0-9])([a-f0-9])$/i,HEX4:/^#([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])$/i,HEX6:/^#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/i,HEX8:/^#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/i,RGB:new RegExp(["^rgb\\(",s.source,",",s.source,",",s.source,"\\)$"].join(e.source),"i"),RGB_PERCENT:new RegExp(["^rgb\\(",u.source,",",u.source,",",u.source,"\\)$"].join(e.source),"i"),RGBA:new RegExp(["^rgba\\(",s.source,",",s.source,",",s.source,",",l.source,"\\)$"].join(e.source),"i"),RGBA_PERCENT:new RegExp(["^rgba\\(",u.source,",",u.source,",",u.source,",",l.source,"\\)$"].join(e.source),"i"),HSL:new RegExp(["^hsl\\(",s.source,",",u.source,",",u.source,"\\)$"].join(e.source),"i"),HSLA:new RegExp(["^hsla\\(",s.source,",",u.source,",",u.source,",",l.source,"\\)$"].join(e.source),"i"),HSB:new RegExp(["^hsb\\(",s.source,",",u.source,",",u.source,"\\)$"].join(e.source),"i"),HSBA:new RegExp(["^hsba\\(",s.source,",",u.source,",",u.source,",",l.source,"\\)$"].join(e.source),"i")},s=(c.default.Color._parseInputs=function(e,t,r,o){var n,s=arguments.length,i=this.mode,a=this.maxes[i],l=[];if(3<=s){for(l[0]=e/a[0],l[1]=t/a[1],l[2]=r/a[2],l[3]="number"==typeof o?o/a[3]:1,n=l.length-1;0<=n;--n){var u=l[n];u<0?l[n]=0:1<u&&(l[n]=1)}return i===d.HSL?f.default._hslaToRGBA(l):i===d.HSB?f.default._hsbaToRGBA(l):l}if(1===s&&"string"==typeof e){r=e.trim().toLowerCase();if(h[r])return c.default.Color._parseInputs.call(this,h[r]);if(p.HEX3.test(r))return(l=p.HEX3.exec(r).slice(1).map(function(e){return parseInt(e+e,16)/255}))[3]=1,l;if(p.HEX6.test(r))return(l=p.HEX6.exec(r).slice(1).map(function(e){return parseInt(e,16)/255}))[3]=1,l;if(p.HEX4.test(r))return l=p.HEX4.exec(r).slice(1).map(function(e){return parseInt(e+e,16)/255});if(p.HEX8.test(r))return l=p.HEX8.exec(r).slice(1).map(function(e){return parseInt(e,16)/255});if(p.RGB.test(r))return(l=p.RGB.exec(r).slice(1).map(function(e){return e/255}))[3]=1,l;if(p.RGB_PERCENT.test(r))return(l=p.RGB_PERCENT.exec(r).slice(1).map(function(e){return parseFloat(e)/100}))[3]=1,l;if(p.RGBA.test(r))return l=p.RGBA.exec(r).slice(1).map(function(e,t){return 3===t?parseFloat(e):e/255});if(p.RGBA_PERCENT.test(r))return l=p.RGBA_PERCENT.exec(r).slice(1).map(function(e,t){return 3===t?parseFloat(e):parseFloat(e)/100});if(p.HSL.test(r)?(l=p.HSL.exec(r).slice(1).map(function(e,t){return 0===t?parseInt(e,10)/360:parseInt(e,10)/100}))[3]=1:p.HSLA.test(r)&&(l=p.HSLA.exec(r).slice(1).map(function(e,t){return 0===t?parseInt(e,10)/360:3===t?parseFloat(e):parseInt(e,10)/100})),(l=l.map(function(e){return Math.max(Math.min(e,1),0)})).length)return f.default._hslaToRGBA(l);if(p.HSB.test(r)?(l=p.HSB.exec(r).slice(1).map(function(e,t){return 0===t?parseInt(e,10)/360:parseInt(e,10)/100}))[3]=1:p.HSBA.test(r)&&(l=p.HSBA.exec(r).slice(1).map(function(e,t){return 0===t?parseInt(e,10)/360:3===t?parseFloat(e):parseInt(e,10)/100})),l.length){for(n=l.length-1;0<=n;--n)l[n]=Math.max(Math.min(l[n],1),0);return f.default._hsbaToRGBA(l)}l=[1,1,1,1]}else{if(1!==s&&2!==s||"number"!=typeof e)throw new Error("".concat(arguments,"is not a valid color representation."));l[0]=e/a[2],l[1]=e/a[2],l[2]=e/a[2],l[3]="number"==typeof t?t/a[3]:1,l=l.map(function(e){return Math.max(Math.min(e,1),0)})}return l},c.default.Color);r.default=s},{"../core/constants":256,"../core/main":267,"./color_conversion":252,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.join":159,"core-js/modules/es.array.map":161,"core-js/modules/es.array.slice":162,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.constructor":180,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.string.iterator":186,"core-js/modules/es.string.trim":193,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],255:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.fill"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var s=(n=e("../core/main"))&&n.__esModule?n:{default:n},a=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants"));function l(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,l=function(){return e},e)}e("./p5.Color"),s.default.prototype.background=function(){var e;return(e=this._renderer).background.apply(e,arguments),this},s.default.prototype.clear=function(){return this._renderer.clear((arguments.length<=0?void 0:arguments[0])||0,(arguments.length<=1?void 0:arguments[1])||0,(arguments.length<=2?void 0:arguments[2])||0,(arguments.length<=3?void 0:arguments[3])||0),this},s.default.prototype.colorMode=function(e,t,r,o,n){return s.default._validateParameters("colorMode",arguments),e!==a.RGB&&e!==a.HSB&&e!==a.HSL||(this._colorMode=e,e=this._colorMaxes[e],2===arguments.length?(e[0]=t,e[1]=t,e[2]=t,e[3]=t):4===arguments.length?(e[0]=t,e[1]=r,e[2]=o):5===arguments.length&&(e[0]=t,e[1]=r,e[2]=o,e[3]=n)),this},s.default.prototype.fill=function(){var e;return this._renderer._setProperty("_fillSet",!0),this._renderer._setProperty("_doFill",!0),(e=this._renderer).fill.apply(e,arguments),this},s.default.prototype.noFill=function(){return this._renderer._setProperty("_doFill",!1),this},s.default.prototype.noStroke=function(){return this._renderer._setProperty("_doStroke",!1),this},s.default.prototype.stroke=function(){var e;return this._renderer._setProperty("_strokeSet",!0),this._renderer._setProperty("_doStroke",!0),(e=this._renderer).stroke.apply(e,arguments),this},s.default.prototype.erase=function(){return this._renderer.erase(0<arguments.length&&void 0!==arguments[0]?arguments[0]:255,1<arguments.length&&void 0!==arguments[1]?arguments[1]:255),this},s.default.prototype.noErase=function(){return this._renderer.noErase(),this};var n=s.default;r.default=n},{"../core/constants":256,"../core/main":267,"./p5.Color":254,"core-js/modules/es.array.fill":152,"core-js/modules/es.array.iterator":158,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],256:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.BEZIER=r.QUADRATIC=r.LINEAR=r._CTX_MIDDLE=r._DEFAULT_LEADMULT=r._DEFAULT_TEXT_FILL=r.WORD=r.CHAR=r.BOLDITALIC=r.BOLD=r.ITALIC=r.NORMAL=r.BLUR=r.ERODE=r.DILATE=r.POSTERIZE=r.INVERT=r.OPAQUE=r.GRAY=r.THRESHOLD=r.BURN=r.DODGE=r.SOFT_LIGHT=r.HARD_LIGHT=r.OVERLAY=r.REPLACE=r.SCREEN=r.MULTIPLY=r.EXCLUSION=r.SUBTRACT=r.DIFFERENCE=r.LIGHTEST=r.DARKEST=r.ADD=r.REMOVE=r.BLEND=r.UP_ARROW=r.TAB=r.SHIFT=r.RIGHT_ARROW=r.RETURN=r.OPTION=r.LEFT_ARROW=r.ESCAPE=r.ENTER=r.DOWN_ARROW=r.DELETE=r.CONTROL=r.BACKSPACE=r.ALT=r.AUTO=r.HSL=r.HSB=r.RGB=r.MITER=r.BEVEL=r.ROUND=r.SQUARE=r.PROJECT=r.PIE=r.CHORD=r.OPEN=r.CLOSE=r.TESS=r.QUAD_STRIP=r.QUADS=r.TRIANGLE_STRIP=r.TRIANGLE_FAN=r.TRIANGLES=r.LINE_LOOP=r.LINE_STRIP=r.LINES=r.POINTS=r.BASELINE=r.BOTTOM=r.TOP=r.CENTER=r.LEFT=r.RIGHT=r.RADIUS=r.CORNERS=r.CORNER=r.RAD_TO_DEG=r.DEG_TO_RAD=r.RADIANS=r.DEGREES=r.TWO_PI=r.TAU=r.QUARTER_PI=r.PI=r.HALF_PI=r.WAIT=r.TEXT=r.MOVE=r.HAND=r.CROSS=r.ARROW=r.WEBGL=r.P2D=r.VERSION=void 0,r.COVER=r.CONTAIN=r.FALLBACK=r.LABEL=r.AXES=r.GRID=r._DEFAULT_FILL=r._DEFAULT_STROKE=r.PORTRAIT=r.LANDSCAPE=r.MIRROR=r.CLAMP=r.REPEAT=r.NEAREST=r.IMAGE=r.IMMEDIATE=r.TEXTURE=r.FILL=r.STROKE=r.CURVE=void 0;var o=Math.PI,n=(r.VERSION="1.6.0",r.P2D="p2d",r.WEBGL="webgl",r.ARROW="default",r.CROSS="crosshair",r.HAND="pointer",r.MOVE="move",r.TEXT="text",r.WAIT="wait",o/2),n=(r.HALF_PI=n,o),n=(r.PI=n,o/4),n=(r.QUARTER_PI=n,2*o),n=(r.TAU=n,2*o),n=(r.TWO_PI=n,r.DEGREES="degrees",r.RADIANS="radians",o/180),n=(r.DEG_TO_RAD=n,180/o);r.RAD_TO_DEG=n,r.CORNER="corner",r.CORNERS="corners",r.RADIUS="radius",r.RIGHT="right",r.LEFT="left",r.CENTER="center",r.TOP="top",r.BOTTOM="bottom",r.BASELINE="alphabetic",r.POINTS=0,r.LINES=1,r.LINE_STRIP=3,r.LINE_LOOP=2,r.TRIANGLES=4,r.TRIANGLE_FAN=6,r.TRIANGLE_STRIP=5,r.QUADS="quads",r.QUAD_STRIP="quad_strip",r.TESS="tess",r.CLOSE="close",r.OPEN="open",r.CHORD="chord",r.PIE="pie",r.PROJECT="square",r.SQUARE="butt",r.ROUND="round",r.BEVEL="bevel",r.MITER="miter",r.RGB="rgb",r.HSB="hsb",r.HSL="hsl",r.AUTO="auto",r.ALT=18,r.BACKSPACE=8,r.CONTROL=17,r.DELETE=46,r.DOWN_ARROW=40,r.ENTER=13,r.ESCAPE=27,r.LEFT_ARROW=37,r.OPTION=18,r.RETURN=13,r.RIGHT_ARROW=39,r.SHIFT=16,r.TAB=9,r.UP_ARROW=38,r.BLEND="source-over",r.REMOVE="destination-out",r.ADD="lighter",r.DARKEST="darken",r.LIGHTEST="lighten",r.DIFFERENCE="difference",r.SUBTRACT="subtract",r.EXCLUSION="exclusion",r.MULTIPLY="multiply",r.SCREEN="screen",r.REPLACE="copy",r.OVERLAY="overlay",r.HARD_LIGHT="hard-light",r.SOFT_LIGHT="soft-light",r.DODGE="color-dodge",r.BURN="color-burn",r.THRESHOLD="threshold",r.GRAY="gray",r.OPAQUE="opaque",r.INVERT="invert",r.POSTERIZE="posterize",r.DILATE="dilate",r.ERODE="erode",r.BLUR="blur",r.NORMAL="normal",r.ITALIC="italic",r.BOLD="bold",r.BOLDITALIC="bold italic",r.CHAR="CHAR",r.WORD="WORD",r._DEFAULT_TEXT_FILL="#000000",r._DEFAULT_LEADMULT=1.25,r._CTX_MIDDLE="middle",r.LINEAR="linear",r.QUADRATIC="quadratic",r.BEZIER="bezier",r.CURVE="curve",r.STROKE="stroke",r.FILL="fill",r.TEXTURE="texture",r.IMMEDIATE="immediate",r.IMAGE="image",r.NEAREST="nearest",r.REPEAT="repeat",r.CLAMP="clamp",r.MIRROR="mirror",r.LANDSCAPE="landscape",r.PORTRAIT="portrait",r._DEFAULT_STROKE="#000000",r._DEFAULT_FILL="#FFFFFF",r.GRID="grid",r.AXES="axes",r.LABEL="label",r.FALLBACK="fallback",r.CONTAIN="contain";r.COVER="cover"},{}],257:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.search"),e("core-js/modules/es.string.split"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.search"),e("core-js/modules/es.string.split"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(s=e("./main"))&&s.__esModule?s:{default:s},s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("./constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}var l=[s.ARROW,s.CROSS,s.HAND,s.MOVE,s.TEXT,s.WAIT],u=(n.default.prototype._frameRate=0,n.default.prototype._lastFrameTime=window.performance.now(),n.default.prototype._targetFrameRate=60,window.print);function c(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth||0}function d(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight||0}n.default.prototype.print=function(){var e;arguments.length?(e=console).log.apply(e,arguments):u()},n.default.prototype.frameCount=0,n.default.prototype.deltaTime=0,n.default.prototype.focused=document.hasFocus(),n.default.prototype.cursor=function(e,t,r){var o,n="auto",s=this._curElement.elt;l.includes(e)?n=e:"string"==typeof e&&(o="",t&&r&&"number"==typeof t&&"number"==typeof r&&(o="".concat(t," ").concat(r)),n="http://"===e.substring(0,7)||"https://"===e.substring(0,8)||/\.(cur|jpg|jpeg|gif|png|CUR|JPG|JPEG|GIF|PNG)$/.test(e)?"url(".concat(e,") ").concat(o,", auto"):e),s.style.cursor=n},n.default.prototype.frameRate=function(e){return n.default._validateParameters("frameRate",arguments),"number"!=typeof e||e<0?this._frameRate:(this._setProperty("_targetFrameRate",e),0===e&&this._setProperty("_frameRate",e),this)},n.default.prototype.getFrameRate=function(){return this.frameRate()},n.default.prototype.setFrameRate=function(e){return this.frameRate(e)},n.default.prototype.getTargetFrameRate=function(){return this._targetFrameRate},n.default.prototype.noCursor=function(){this._curElement.elt.style.cursor="none"},n.default.prototype.displayWidth=screen.width,n.default.prototype.displayHeight=screen.height,n.default.prototype.windowWidth=c(),n.default.prototype.windowHeight=d(),n.default.prototype._onresize=function(e){this._setProperty("windowWidth",c()),this._setProperty("windowHeight",d());var t=this._isGlobal?window:this;"function"!=typeof t.windowResized||void 0===(t=t.windowResized(e))||t||e.preventDefault()},n.default.prototype.width=0,n.default.prototype.height=0,n.default.prototype.fullscreen=function(e){if(n.default._validateParameters("fullscreen",arguments),void 0===e)return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement;if(e){e=document.documentElement;if(!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled))throw new Error("Fullscreen not enabled in this browser.");e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.msRequestFullscreen&&e.msRequestFullscreen()}else document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen()},n.default.prototype.pixelDensity=function(e){var t;return n.default._validateParameters("pixelDensity",arguments),"number"==typeof e?(e!==this._pixelDensity&&(this._pixelDensity=e),(t=this).resizeCanvas(this.width,this.height,!0)):t=this._pixelDensity,t},n.default.prototype.displayDensity=function(){return window.devicePixelRatio},n.default.prototype.getURL=function(){return location.href},n.default.prototype.getURLPath=function(){return location.pathname.split("/").filter(function(e){return""!==e})},n.default.prototype.getURLParams=function(){for(var e,t=/[?&]([^&=]+)(?:[&=])([^&=]+)/gim,r={};null!=(e=t.exec(location.search));)e.index===t.lastIndex&&t.lastIndex++,r[e[1]]=e[2];return r};e=n.default;r.default=e},{"./constants":256,"./main":267,"core-js/modules/es.array.concat":149,"core-js/modules/es.array.filter":153,"core-js/modules/es.array.includes":156,"core-js/modules/es.array.iterator":158,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.string.includes":185,"core-js/modules/es.string.iterator":186,"core-js/modules/es.string.search":190,"core-js/modules/es.string.split":191,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],258:[function(r,e,t){"use strict";r("core-js/modules/es.symbol"),r("core-js/modules/es.symbol.description"),r("core-js/modules/es.symbol.iterator"),r("core-js/modules/es.array.concat"),r("core-js/modules/es.array.filter"),r("core-js/modules/es.array.for-each"),r("core-js/modules/es.array.includes"),r("core-js/modules/es.array.iterator"),r("core-js/modules/es.array.join"),r("core-js/modules/es.array.map"),r("core-js/modules/es.array.slice"),r("core-js/modules/es.array.some"),r("core-js/modules/es.function.name"),r("core-js/modules/es.object.assign"),r("core-js/modules/es.object.get-own-property-names"),r("core-js/modules/es.object.keys"),r("core-js/modules/es.object.to-string"),r("core-js/modules/es.regexp.constructor"),r("core-js/modules/es.regexp.exec"),r("core-js/modules/es.regexp.to-string"),r("core-js/modules/es.string.iterator"),r("core-js/modules/es.string.match"),r("core-js/modules/es.string.replace"),r("core-js/modules/es.string.search"),r("core-js/modules/es.string.split"),r("core-js/modules/web.dom-collections.for-each"),r("core-js/modules/web.dom-collections.iterator"),r("core-js/modules/es.symbol"),r("core-js/modules/es.symbol.description"),r("core-js/modules/es.symbol.iterator"),r("core-js/modules/es.array.concat"),r("core-js/modules/es.array.filter"),r("core-js/modules/es.array.for-each"),r("core-js/modules/es.array.includes"),r("core-js/modules/es.array.iterator"),r("core-js/modules/es.array.join"),r("core-js/modules/es.array.map"),r("core-js/modules/es.array.slice"),r("core-js/modules/es.array.some"),r("core-js/modules/es.function.name"),r("core-js/modules/es.object.assign"),r("core-js/modules/es.object.get-own-property-names"),r("core-js/modules/es.object.keys"),r("core-js/modules/es.object.to-string"),r("core-js/modules/es.regexp.constructor"),r("core-js/modules/es.regexp.exec"),r("core-js/modules/es.regexp.to-string"),r("core-js/modules/es.string.iterator"),r("core-js/modules/es.string.match"),r("core-js/modules/es.string.replace"),r("core-js/modules/es.string.search"),r("core-js/modules/es.string.split"),r("core-js/modules/web.dom-collections.for-each"),r("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=(l=r("../main"))&&l.__esModule?l:{default:l};r("../internationalization");function n(r,o){o=o||console.log.bind(console),s||i(),s.some(function(e){var t;if(r.message&&null!==r.message.match("\\W?".concat(e.name,"\\W")))return t="function"===e.type?"".concat(e.name,"()"):e.name,o("Did you just try to use p5.js's ".concat(t," ").concat(e.type,"? If so, you may want to move it into your sketch's setup() function.\n\nFor more details, see: ").concat(a)),!0})}var s=null,i=null,a=(o.default._friendlyError=o.default._checkForUserDefinedFunctions=o.default._fesErrorMonitor=function(){},s=null,"https://github.com/processing/p5.js/wiki/p5.js-overview#why-cant-i-assign-variables-using-p5-functions-and-variables-before-setup"),i=function(){function e(r){return Object.getOwnPropertyNames(r).filter(function(e){return"_"!==e[0]&&(!(e in t)&&(t[e]=!0))}).map(function(e){var t="function"==typeof r[e]?"function":e===e.toUpperCase()?"constant":"variable";return{name:e,type:t}})}var t={};(s=[].concat(e(o.default.prototype),e(r("../constants")))).sort(function(e,t){return t.name.length-e.name.length})},l=(o.default.prototype._helpForMisusedAtTopLevelCode=n,"complete"!==document.readyState&&(window.addEventListener("error",n,!1),window.addEventListener("load",function(){window.removeEventListener("error",n,!1)})),o.default);t.default=l},{"../constants":256,"../internationalization":265,"../main":267,"./browser_errors":void 0,"core-js/modules/es.array.concat":149,"core-js/modules/es.array.filter":153,"core-js/modules/es.array.for-each":154,"core-js/modules/es.array.includes":156,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.join":159,"core-js/modules/es.array.map":161,"core-js/modules/es.array.slice":162,"core-js/modules/es.array.some":163,"core-js/modules/es.function.name":165,"core-js/modules/es.object.assign":172,"core-js/modules/es.object.get-own-property-names":174,"core-js/modules/es.object.keys":176,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.constructor":180,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.string.iterator":186,"core-js/modules/es.string.match":187,"core-js/modules/es.string.replace":189,"core-js/modules/es.string.search":190,"core-js/modules/es.string.split":191,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/web.dom-collections.for-each":229,"core-js/modules/web.dom-collections.iterator":230}],259:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(o=e("../main"))&&o.__esModule?o:{default:o};e("../internationalization");o.default._friendlyFileLoadError=function(){};e=o.default;r.default=e},{"../internationalization":265,"../main":267}],260:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.trim"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.trim"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=k(e("../main")),s=e("../internationalization"),a=O(e("../constants")),l,u,c,d,f,h,p,m,y,g,v,b,j,_,x,w,S,M,E,T,I;function C(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,C=function(){return e},e)}function O(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=C();if(t&&t.has(e))return t.get(e);var r,o,n={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e)Object.prototype.hasOwnProperty.call(e,r)&&((o=s?Object.getOwnPropertyDescriptor(e,r):null)&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]);return n.default=e,t&&t.set(e,n),n}function k(e){return e&&e.__esModule?e:{default:e}}function D(e){return A(e)||P(e)||L()}function L(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function P(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function A(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}n.default._fesCodeReader=function(){};var R=n.default;r.default=R},{"../constants":256,"../internationalization":265,"../main":267,"core-js/modules/es.array.filter":153,"core-js/modules/es.array.for-each":154,"core-js/modules/es.array.from":155,"core-js/modules/es.array.includes":156,"core-js/modules/es.array.index-of":157,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.join":159,"core-js/modules/es.array.map":161,"core-js/modules/es.array.slice":162,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.keys":176,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.constructor":180,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.string.includes":185,"core-js/modules/es.string.iterator":186,"core-js/modules/es.string.match":187,"core-js/modules/es.string.split":191,"core-js/modules/es.string.trim":193,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.for-each":229,"core-js/modules/web.dom-collections.iterator":230}],261:[function(e,t,r){"use strict";e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;e=(e=e("../main"))&&e.__esModule?e:{default:e};function o(){var t=/(^|@)\S+:\d+/,r=/^\s*at .*(\S+:\d+|\(native\))/m,o=/^(eval@)?(\[native code])?$/;return{parse:function(e){return void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(r)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):void 0},extractLocation:function(e){return-1===e.indexOf(":")?[e]:[(e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,"")))[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(r)},this).map(function(e){var t=(e=-1<e.indexOf("(eval ")?e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""):e).replace(/^\s+/,"").replace(/\(eval code/g,"("),r=t.match(/ (\((.+):(\d+):(\d+)\)$)/),t=(t=r?t.replace(r[0],""):t).split(/\s+/).slice(1),r=this.extractLocation(r?r[1]:t.pop());return{functionName:t.join(" ")||void 0,fileName:-1<["eval","<anonymous>"].indexOf(r[0])?void 0:r[0],lineNumber:r[1],columnNumber:r[2],source:e}},this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter(function(e){return!e.match(o)},this).map(function(e){var t,r;return-1===(e=-1<e.indexOf(" > eval")?e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1"):e).indexOf("@")&&-1===e.indexOf(":")?{functionName:e}:{functionName:(r=e.match(t=/((.*".+"[^@]*)?[^@]*)(?:@)/))&&r[1]?r[1]:void 0,fileName:(r=this.extractLocation(e.replace(t,"")))[0],lineNumber:r[1],columnNumber:r[2],source:e}},this)},parseOpera:function(e){return!e.stacktrace||-1<e.message.indexOf("\n")&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),o=[],n=2,s=r.length;n<s;n+=2){var i=t.exec(r[n]);i&&o.push({fileName:i[2],lineNumber:i[1],source:r[n]})}return o},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),o=[],n=0,s=r.length;n<s;n+=2){var i=t.exec(r[n]);i&&o.push({functionName:i[3]||void 0,fileName:i[2],lineNumber:i[1],source:r[n]})}return o},parseOpera11:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(t)&&!e.match(/^Error created at/)},this).map(function(e){var t,r=e.split("@"),o=this.extractLocation(r.pop()),r=r.shift()||"";return{functionName:r.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,args:void 0===(t=r.match(/\(([^)]*)\)/)?r.replace(/^[^(]+\(([^)]*)\)$/,"$1"):t)||"[arguments not available]"===t?void 0:t.split(","),fileName:o[0],lineNumber:o[1],columnNumber:o[2],source:e}},this)}}}e.default._getErrorStackParser=function(){return new o};e=e.default;r.default=e},{"../main":267,"core-js/modules/es.array.filter":153,"core-js/modules/es.array.index-of":157,"core-js/modules/es.array.join":159,"core-js/modules/es.array.map":161,"core-js/modules/es.array.slice":162,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.string.match":187,"core-js/modules/es.string.replace":189,"core-js/modules/es.string.split":191}],262:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.last-index-of"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.function.name"),e("core-js/modules/es.map"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.get-prototype-of"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.reflect.construct"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.set"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.last-index-of"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.function.name"),e("core-js/modules/es.map"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.object.get-prototype-of"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.reflect.construct"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.set"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(n=e("../main"))&&n.__esModule?n:{default:n};(function(e){if(e&&e.__esModule)return;if(null===e||"object"!==a(e)&&"function"!=typeof e)return;var t=i();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o)})(e("../constants")),e("../internationalization");function i(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,i=function(){return e},e)}function a(e){return(a="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}n.default._validateParameters=n.default._clearValidateParamsCache=function(){};e=n.default;r.default=e},{"../../../docs/parameterData.json":void 0,"../constants":256,"../internationalization":265,"../main":267,"core-js/modules/es.array.concat":149,"core-js/modules/es.array.for-each":154,"core-js/modules/es.array.includes":156,"core-js/modules/es.array.index-of":157,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.join":159,"core-js/modules/es.array.last-index-of":160,"core-js/modules/es.array.map":161,"core-js/modules/es.array.slice":162,"core-js/modules/es.function.name":165,"core-js/modules/es.map":166,"core-js/modules/es.number.constructor":169,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.get-prototype-of":175,"core-js/modules/es.object.keys":176,"core-js/modules/es.object.to-string":177,"core-js/modules/es.reflect.construct":179,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.set":183,"core-js/modules/es.string.includes":185,"core-js/modules/es.string.iterator":186,"core-js/modules/es.string.split":191,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.for-each":229,"core-js/modules/web.dom-collections.iterator":230}],263:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("./constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}r.default={modeAdjust:function(e,t,r,o,n){return n===s.CORNER?{x:e,y:t,w:r,h:o}:n===s.CORNERS?{x:e,y:t,w:r-e,h:o-t}:n===s.RADIUS?{x:e-r,y:t-o,w:2*r,h:2*o}:n===s.CENTER?{x:e-.5*r,y:t-.5*o,w:r,h:o}:void 0}}},{"./constants":256,"core-js/modules/es.array.iterator":158,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],264:[function(e,t,r){"use strict";e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator");var o=(n=e("../core/main"))&&n.__esModule?n:{default:n};e("./internationalization");var n=Promise.resolve();Promise.all([new Promise(function(e,t){"complete"===document.readyState?e():window.addEventListener("load",e,!1)}),n]).then(function(){void 0!==window._setupDone?console.warn("p5.js seems to have been imported multiple times. Please remove the duplicate import"):window.mocha||(window.setup&&"function"==typeof window.setup||window.draw&&"function"==typeof window.draw)&&!o.default.instance&&new o.default})},{"../core/main":267,"./internationalization":265,"core-js/modules/es.array.iterator":158,"core-js/modules/es.object.to-string":177,"core-js/modules/es.promise":178,"core-js/modules/es.string.iterator":186,"core-js/modules/web.dom-collections.iterator":230}],265:[function(e,t,r){"use strict";e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.setTranslatorLanguage=r.currentTranslatorLanguage=r.availableTranslatorLanguages=r.initialize=r.translator=void 0;var n,s,o=a(e("i18next")),i=a(e("i18next-browser-languagedetector"));function a(e){return e&&e.__esModule?e:{default:e}}function l(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}var u=function(){function r(e,t){if(!(this instanceof r))throw new TypeError("Cannot call a class as a function");this.init(e,t)}var e,t,o;return e=r,(t=[{key:"fetchWithTimeout",value:function(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:2e3;return Promise.race([fetch(e,t),new Promise(function(e,t){return setTimeout(function(){return t(new Error("timeout"))},r)})])}},{key:"init",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};this.services=e,this.options=t}},{key:"read",value:function(e,t,r){var o=this.options.loadPath;e===this.options.fallback?r(null,n[e][t]):s.includes(e)?(o=this.services.interpolator.interpolate(o,{lng:e,ns:t}),this.loadUrl(o,r)):r("Not found",!1)}},{key:"loadUrl",value:function(t,r){this.fetchWithTimeout(t).then(function(e){if(e.ok)return e.json();throw new Error("failed loading ".concat(t))},function(){throw new Error("failed loading ".concat(t))}).then(function(e){return r(null,e)}).catch(r)}}])&&l(e.prototype,t),o&&l(e,o),r}();u.type="backend",r.translator=function(e,t){console.debug("p5.js translator called before translations were loaded"),o.default.t(e,t)},r.initialize=function(){return o.default.use(i.default).use(u).init({fallbackLng:"en",nestingPrefix:"$tr(",nestingSuffix:")",defaultNS:"translation",returnEmptyString:!1,interpolation:{escapeValue:!1},detection:{checkWhitelist:!1,order:["querystring","navigator","htmlTag","path","subdomain"],caches:[]},backend:{fallback:"en",loadPath:"https://cdn.jsdelivr.net/npm/p5/translations/{{lng}}/{{ns}}.json"},partialBundledLanguages:!0,resources:n}).then(function(e){r.translator=e},function(e){return console.debug("Translations failed to load (".concat(e,")"))})},r.availableTranslatorLanguages=function(){return o.default.languages},r.currentTranslatorLanguage=function(e){return o.default.language};r.setTranslatorLanguage=function(e){return o.default.changeLanguage(e||void 0,function(e){return console.debug("Translations failed to load (".concat(e,")"))})}},{"../../translations":void 0,"../../translations/dev":void 0,"core-js/modules/es.array.includes":156,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.join":159,"core-js/modules/es.array.slice":162,"core-js/modules/es.object.keys":176,"core-js/modules/es.object.to-string":177,"core-js/modules/es.promise":178,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.string.includes":185,"core-js/modules/es.string.iterator":186,"core-js/modules/es.string.split":191,"core-js/modules/web.dom-collections.iterator":230,i18next:3,"i18next-browser-languagedetector":3}],266:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;e=(e=e("./main"))&&e.__esModule?e:{default:e};e.default.prototype.pushStyle=function(){throw new Error("pushStyle() not used, see push()")},e.default.prototype.popStyle=function(){throw new Error("popStyle() not used, see pop()")},e.default.prototype.popMatrix=function(){throw new Error("popMatrix() not used, see pop()")},e.default.prototype.pushMatrix=function(){throw new Error("pushMatrix() not used, see push()")};e=e.default;r.default=e},{"./main":267}],267:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.get-own-property-names"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.get-own-property-names"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,e("./shim");var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("./constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}function s(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}var l,u=function(){function v(e,t,r){var d=this;if(!(this instanceof v))throw new TypeError("Cannot call a class as a function");this._setupDone=!1,this._preloadDone=!1,this._pixelDensity=Math.ceil(window.devicePixelRatio)||1,this._userNode=t,this._curElement=null,this._elements=[],this._glAttributes=null,this._requestAnimId=0,this._preloadCount=0,this._isGlobal=!1,this._loop=!0,this._initializeInstanceVariables(),this._defaultCanvasSize={width:100,height:100},this._events={mousemove:null,mousedown:null,mouseup:null,dragend:null,dragover:null,click:null,dblclick:null,mouseover:null,mouseout:null,keydown:null,keyup:null,keypress:null,touchstart:null,touchmove:null,touchend:null,resize:null,blur:null},this._millisStart=-1,this._recording=!1,this._lcg_random_state=null,this._gaussian_previous=!1,this._events.wheel=null,this._loadingScreenId="p5_loading",this._registeredMethods={};var t=Object.getOwnPropertyNames(v.prototype._registeredMethods),o=!0,n=!1,s=void 0;try{for(var i,a=t[Symbol.iterator]();!(o=(i=a.next()).done);o=!0){var l=i.value;this._registeredMethods[l]=v.prototype._registeredMethods[l].slice()}}catch(e){n=!0,s=e}finally{try{o||null==a.return||a.return()}finally{if(n)throw s}}window.DeviceOrientationEvent&&(this._events.deviceorientation=null),window.DeviceMotionEvent&&!window._isNodeWebkit&&(this._events.devicemotion=null),this._start=function(){d._userNode&&"string"==typeof d._userNode&&(d._userNode=document.getElementById(d._userNode));var e=d._isGlobal?window:d;if(e.preload){var t,r=document.getElementById(d._loadingScreenId),o=(r||((r=document.createElement("div")).innerHTML="Loading...",r.style.position="absolute",r.id=d._loadingScreenId,(d._userNode||document.body).appendChild(r)),d._preloadMethods);for(t in o){o[t]=o[t]||v;var n=o[t];n!==v.prototype&&n!==v||(d._isGlobal&&(window[t]=d._wrapPreload(d,t)),n=d),d._registeredPreloadMethods[t]=n[t],n[t]=d._wrapPreload(n,t)}e.preload(),d._runIfPreloadsAreDone()}else d._setup(),d._recording||d._draw()},this._runIfPreloadsAreDone=function(){var e,t=this._isGlobal?window:this;0===t._preloadCount&&((e=document.getElementById(t._loadingScreenId))&&e.parentNode.removeChild(e),this._setupDone||(this._lastTargetFrameTime=window.performance.now(),this._lastRealFrameTime=window.performance.now(),t._setup(),this._recording||t._draw()))},this._decrementPreload=function(){var e=this._isGlobal?window:this;e._preloadDone||"function"!=typeof e.preload||(e._setProperty("_preloadCount",e._preloadCount-1),e._runIfPreloadsAreDone())},this._wrapPreload=function(o,n){var s=this;return function(){s._incrementPreload();for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return s._registeredPreloadMethods[n].apply(o,t)}},this._incrementPreload=function(){var e=this._isGlobal?window:this;e._preloadDone||e._setProperty("_preloadCount",e._preloadCount+1)},this._setup=function(){d.createCanvas(d._defaultCanvasSize.width,d._defaultCanvasSize.height,"p2d");var e=d._isGlobal?window:d;if("function"==typeof e.preload)for(var t in d._preloadMethods)e[t]=d._preloadMethods[t][t],e[t]&&d&&(e[t]=e[t].bind(d));d._millisStart=window.performance.now(),e._preloadDone=!0,"function"==typeof e.setup&&e.setup();var r=document.getElementsByTagName("canvas"),o=!0,n=!1,s=void 0;try{for(var i,a=r[Symbol.iterator]();!(o=(i=a.next()).done);o=!0){var l=i.value;"true"===l.dataset.hidden&&(l.style.visibility="",delete l.dataset.hidden)}}catch(e){n=!0,s=e}finally{try{o||null==a.return||a.return()}finally{if(n)throw s}}d._lastTargetFrameTime=window.performance.now(),d._lastRealFrameTime=window.performance.now(),d._setupDone=!0,(d._accessibleOutputs.grid||d._accessibleOutputs.text)&&d._updateAccsOutput()},this._draw=function(){var e=window.performance.now(),t=e-d._lastTargetFrameTime,r=1e3/d._targetFrameRate;(!d._loop||r-5<=t)&&(d.redraw(),d._frameRate=1e3/(e-d._lastRealFrameTime),d.deltaTime=e-d._lastRealFrameTime,d._setProperty("deltaTime",d.deltaTime),d._lastTargetFrameTime=Math.max(d._lastTargetFrameTime+r,e),d._lastRealFrameTime=e,void 0!==d._updateMouseCoords&&(d._updateMouseCoords(),d._setProperty("movedX",0),d._setProperty("movedY",0))),d._loop&&(d._requestAnimId=window.requestAnimationFrame(d._draw))},this._setProperty=function(e,t){d[e]=t,d._isGlobal&&(window[e]=t)},this.remove=function(){var t=document.getElementById(d._loadingScreenId);if(t&&(t.parentNode.removeChild(t),d._incrementPreload()),d._curElement){for(var e in d._loop=!1,d._requestAnimId&&window.cancelAnimationFrame(d._requestAnimId),d._events)window.removeEventListener(e,d._events[e]);var r=!0,t=!1,o=void 0;try{for(var n,s=d._elements[Symbol.iterator]();!(r=(n=s.next()).done);r=!0){var i,a=n.value;for(i in a.elt&&a.elt.parentNode&&a.elt.parentNode.removeChild(a.elt),a._events)a.elt.removeEventListener(i,a._events[i])}}catch(e){t=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(t)throw o}}var l=d;d._registeredMethods.remove.forEach(function(e){void 0!==e&&e.call(l)})}if(d._isGlobal){for(var u in v.prototype)try{delete window[u]}catch(e){window[u]=void 0}for(var c in d)if(d.hasOwnProperty(c))try{delete window[c]}catch(e){window[c]=void 0}v.instance=null}},this._registeredMethods.init.forEach(function(e){void 0!==e&&e.call(this)},this),this._setupPromisePreloads();var u,c,f=this._createFriendlyGlobalFunctionBinder();if(e)e(this),v._checkForUserDefinedFunctions(this);else{for(var h in this._isGlobal=!0,v.instance=this,v.prototype)"function"==typeof v.prototype[h]?(u=h.substring(2),this._events.hasOwnProperty(u)||(Math.hasOwnProperty(h)&&Math[h]===v.prototype[h]?f(h,v.prototype[h]):f(h,v.prototype[h].bind(this)))):f(h,v.prototype[h]);for(var p in this)this.hasOwnProperty(p)&&f(p,this[p])}for(c in this._events){var m=this["_on".concat(c)];m&&(m=m.bind(this),window.addEventListener(c,m,{passive:!1}),this._events[c]=m)}function y(){d._setProperty("focused",!0)}function g(){d._setProperty("focused",!1)}window.addEventListener("focus",y),window.addEventListener("blur",g),this.registerMethod("remove",function(){window.removeEventListener("focus",y),window.removeEventListener("blur",g)}),"complete"===document.readyState?this._start():window.addEventListener("load",this._start.bind(this),!1)}var e,t,r;return e=v,(t=[{key:"_initializeInstanceVariables",value:function(){this._accessibleOutputs={text:!1,grid:!1,textLabel:!1,gridLabel:!1},this._styles=[],this._bezierDetail=20,this._curveDetail=20,this._colorMode=n.RGB,this._colorMaxes={rgb:[255,255,255,255],hsb:[360,100,100,1],hsl:[360,100,100,1]},this._downKeys={}}},{key:"registerPreloadMethod",value:function(e,t){v.prototype._preloadMethods.hasOwnProperty(e)||(v.prototype._preloadMethods[e]=t)}},{key:"registerMethod",value:function(e,t){var r=this||v.prototype;r._registeredMethods.hasOwnProperty(e)||(r._registeredMethods[e]=[]),r._registeredMethods[e].push(t)}},{key:"_createFriendlyGlobalFunctionBinder",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},r=e.globalObject||window;e.log||console.log.bind(console);return function(e,t){v.disableFriendlyErrors,r[e]=t}}}])&&s(e.prototype,t),r&&s(e,r),v}();for(l in u.instance=null,u.disableFriendlyErrors=!1,n)u.prototype[l]=n[l];u.VERSION=n.VERSION,u.prototype._preloadMethods={loadJSON:u.prototype,loadImage:u.prototype,loadStrings:u.prototype,loadXML:u.prototype,loadBytes:u.prototype,loadTable:u.prototype,loadFont:u.prototype,loadModel:u.prototype,loadShader:u.prototype},u.prototype._registeredMethods={init:[],pre:[],post:[],remove:[]},u.prototype._registeredPreloadMethods={},r.default=u},{"./constants":256,"./shim":278,"core-js/modules/es.array.for-each":154,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.slice":162,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.get-own-property-names":174,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.for-each":229,"core-js/modules/web.dom-collections.iterator":230}],268:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(e=e("./main"))&&e.__esModule?e:{default:e};o.default.Element=function(e,t){this.elt=e,this._pInst=this._pixelsState=t,this._events={},this.width=this.elt.offsetWidth,this.height=this.elt.offsetHeight},o.default.Element.prototype.parent=function(e){return void 0===e?this.elt.parentNode:("string"==typeof e?("#"===e[0]&&(e=e.substring(1)),e=document.getElementById(e)):e instanceof o.default.Element&&(e=e.elt),e.appendChild(this.elt),this)},o.default.Element.prototype.id=function(e){return void 0===e?this.elt.id:(this.elt.id=e,this.width=this.elt.offsetWidth,this.height=this.elt.offsetHeight,this)},o.default.Element.prototype.class=function(e){return void 0===e?this.elt.className:(this.elt.className=e,this)},o.default.Element.prototype.mousePressed=function(t){return o.default.Element._adjustListener("mousedown",function(e){return this._pInst._setProperty("mouseIsPressed",!0),this._pInst._setMouseButton(e),t.call(this,e)},this),this},o.default.Element.prototype.doubleClicked=function(e){return o.default.Element._adjustListener("dblclick",e,this),this},o.default.Element.prototype.mouseWheel=function(e){return o.default.Element._adjustListener("wheel",e,this),this},o.default.Element.prototype.mouseReleased=function(e){return o.default.Element._adjustListener("mouseup",e,this),this},o.default.Element.prototype.mouseClicked=function(e){return o.default.Element._adjustListener("click",e,this),this},o.default.Element.prototype.mouseMoved=function(e){return o.default.Element._adjustListener("mousemove",e,this),this},o.default.Element.prototype.mouseOver=function(e){return o.default.Element._adjustListener("mouseover",e,this),this},o.default.Element.prototype.mouseOut=function(e){return o.default.Element._adjustListener("mouseout",e,this),this},o.default.Element.prototype.touchStarted=function(e){return o.default.Element._adjustListener("touchstart",e,this),this},o.default.Element.prototype.touchMoved=function(e){return o.default.Element._adjustListener("touchmove",e,this),this},o.default.Element.prototype.touchEnded=function(e){return o.default.Element._adjustListener("touchend",e,this),this},o.default.Element.prototype.dragOver=function(e){return o.default.Element._adjustListener("dragover",e,this),this},o.default.Element.prototype.dragLeave=function(e){return o.default.Element._adjustListener("dragleave",e,this),this},o.default.Element._adjustListener=function(e,t,r){return!1===t?o.default.Element._detachListener(e,r):o.default.Element._attachListener(e,t,r),this},o.default.Element._attachListener=function(e,t,r){r._events[e]&&o.default.Element._detachListener(e,r);t=t.bind(r);r.elt.addEventListener(e,t,!1),r._events[e]=t},o.default.Element._detachListener=function(e,t){var r=t._events[e];t.elt.removeEventListener(e,r,!1),t._events[e]=null},o.default.Element.prototype._setProperty=function(e,t){this[e]=t};e=o.default.Element;r.default=e},{"./main":267}],269:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.splice"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.splice"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var s=(n=e("./main"))&&n.__esModule?n:{default:n},a=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("./constants"));function l(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,l=function(){return e},e)}s.default.Graphics=function(e,t,r,o){var n,r=r||a.P2D;for(n in this.canvas=document.createElement("canvas"),(o._userNode||document.body).appendChild(this.canvas),s.default.Element.call(this,this.canvas,o),s.default.prototype)this[n]||("function"==typeof s.default.prototype[n]?this[n]=s.default.prototype[n].bind(this):this[n]=s.default.prototype[n]);return s.default.prototype._initializeInstanceVariables.apply(this),this.width=e,this.height=t,this._pixelDensity=o._pixelDensity,r===a.WEBGL?this._renderer=new s.default.RendererGL(this.canvas,this,!1):this._renderer=new s.default.Renderer2D(this.canvas,this,!1),o._elements.push(this),Object.defineProperty(this,"deltaTime",{get:function(){return this._pInst.deltaTime}}),this._renderer.resize(e,t),this._renderer._applyDefaults(),this},s.default.Graphics.prototype=Object.create(s.default.Element.prototype),s.default.Graphics.prototype.reset=function(){this._renderer.resetMatrix(),this._renderer.isP3D&&this._renderer._update()},s.default.Graphics.prototype.remove=function(){this.elt.parentNode&&this.elt.parentNode.removeChild(this.elt);var e,t=this._pInst._elements.indexOf(this);for(e in-1!==t&&this._pInst._elements.splice(t,1),this._events)this.elt.removeEventListener(e,this._events[e])};var n=s.default.Graphics;r.default=n},{"./constants":256,"./main":267,"core-js/modules/es.array.index-of":157,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.splice":164,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],270:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.trim"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.trim"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var a=(n=e("./main"))&&n.__esModule?n:{default:n},L=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==l(e)&&"function"!=typeof e)return{default:e};var t=i();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants"));function i(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,i=function(){return e},e)}function l(e){return(l="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}function u(e){var t=0,r=0;if(e.offsetParent)for(;t+=e.offsetLeft,r+=e.offsetTop,e=e.offsetParent;);else t+=e.offsetLeft,r+=e.offsetTop;return[t,r]}a.default.Renderer=function(e,t,r){a.default.Element.call(this,e,t),this.canvas=e,this._pixelsState=t,r?(this._isMainCanvas=!0,this._pInst._setProperty("_curElement",this),this._pInst._setProperty("canvas",this.canvas),this._pInst._setProperty("width",this.width),this._pInst._setProperty("height",this.height)):(this.canvas.style.display="none",this._styles=[]),this._textSize=12,this._textLeading=15,this._textFont="sans-serif",this._textStyle=L.NORMAL,this._textAscent=null,this._textDescent=null,this._textAlign=L.LEFT,this._textBaseline=L.BASELINE,this._textWrap=L.WORD,this._rectMode=L.CORNER,this._ellipseMode=L.CENTER,this._curveTightness=0,this._imageMode=L.CORNER,this._tint=null,this._doStroke=!0,this._doFill=!0,this._strokeSet=!1,this._fillSet=!1,this._leadingSet=!1},a.default.Renderer.prototype=Object.create(a.default.Element.prototype),a.default.Renderer.prototype.push=function(){return{properties:{_doStroke:this._doStroke,_strokeSet:this._strokeSet,_doFill:this._doFill,_fillSet:this._fillSet,_tint:this._tint,_imageMode:this._imageMode,_rectMode:this._rectMode,_ellipseMode:this._ellipseMode,_textFont:this._textFont,_textLeading:this._textLeading,_leadingSet:this._leadingSet,_textSize:this._textSize,_textAlign:this._textAlign,_textBaseline:this._textBaseline,_textStyle:this._textStyle,_textWrap:this._textWrap}}},a.default.Renderer.prototype.pop=function(e){e.properties&&Object.assign(this,e.properties)},a.default.Renderer.prototype.resize=function(e,t){this.width=e,this.height=t,this.elt.width=e*this._pInst._pixelDensity,this.elt.height=t*this._pInst._pixelDensity,this.elt.style.width="".concat(e,"px"),this.elt.style.height="".concat(t,"px"),this._isMainCanvas&&(this._pInst._setProperty("width",this.width),this._pInst._setProperty("height",this.height))},a.default.Renderer.prototype.get=function(e,t,r,o){var n=this._pixelsState,s=n._pixelDensity,i=this.canvas;if(void 0===e&&void 0===t)e=t=0,r=n.width,o=n.height;else if(e*=s,t*=s,void 0===r&&void 0===o)return e<0||t<0||e>=i.width||t>=i.height?[0,0,0,0]:this._getPixel(e,t);n=new a.default.Image(r,o);return n.canvas.getContext("2d").drawImage(i,e,t,r*s,o*s,0,0,r,o),n},a.default.Renderer.prototype.textLeading=function(e){return"number"==typeof e?(this._setProperty("_leadingSet",!0),this._setProperty("_textLeading",e),this._pInst):this._textLeading},a.default.Renderer.prototype.textSize=function(e){return"number"==typeof e?(this._setProperty("_textSize",e),this._leadingSet||this._setProperty("_textLeading",e*L._DEFAULT_LEADMULT),this._applyTextProperties()):this._textSize},a.default.Renderer.prototype.textStyle=function(e){return e?(e!==L.NORMAL&&e!==L.ITALIC&&e!==L.BOLD&&e!==L.BOLDITALIC||this._setProperty("_textStyle",e),this._applyTextProperties()):this._textStyle},a.default.Renderer.prototype.textAscent=function(){return null===this._textAscent&&this._updateTextMetrics(),this._textAscent},a.default.Renderer.prototype.textDescent=function(){return null===this._textDescent&&this._updateTextMetrics(),this._textDescent},a.default.Renderer.prototype.textAlign=function(e,t){return void 0!==e?(this._setProperty("_textAlign",e),void 0!==t&&this._setProperty("_textBaseline",t),this._applyTextProperties()):{horizontal:this._textAlign,vertical:this._textBaseline}},a.default.Renderer.prototype.textWrap=function(e){return this._setProperty("_textWrap",e),this._textWrap},a.default.Renderer.prototype.text=function(e,t,r,o,n){var s,i,a,l,u=this._pInst,c=this._textWrap,d=Number.MAX_VALUE,f=r;if((this._doFill||this._doStroke)&&void 0!==e){if(s=(e=(e="string"!=typeof e?e.toString():e).replace(/(\t)/g," ")).split("\n"),void 0!==o){switch(this._rectMode===L.CENTER&&(t-=o/2),this._textAlign){case L.CENTER:t+=o/2;break;case L.RIGHT:t+=o}if(void 0!==n){this._rectMode===L.CENTER&&(r-=n/2,f-=n/2);var e=r,h=u.textAscent();switch(this._textBaseline){case L.BOTTOM:l=r+n,r=Math.max(l,r),f+=h;break;case L.CENTER:l=r+n/2,r=Math.max(l,r),f+=h/2}d=r+n-h,this._textBaseline===L.CENTER&&(d=e+n-h/2)}else{if(this._textBaseline===L.BOTTOM)return console.warn("textAlign(*, BOTTOM) requires x, y, width and height");if(this._textBaseline===L.CENTER)return console.warn("textAlign(*, CENTER) requires x, y, width and height")}if(c===L.WORD){for(var p=[],m=0;m<s.length;m++){for(var y="",g=s[m].split(" "),v=0;v<g.length;v++)i="".concat(y+g[v])+" ",y=o<(a=this.textWidth(i))&&0<y.length?(p.push(y),"".concat(g[v])+" "):i;p.push(y)}var b=0;this._textBaseline===L.CENTER?b=(p.length-1)*u.textLeading()/2:this._textBaseline===L.BOTTOM&&(b=(p.length-1)*u.textLeading());for(var j=0;j<s.length;j++){y="",g=s[j].split(" ");for(var _=0;_<g.length;_++)i="".concat(y+g[_])+" ",o<(a=this.textWidth(i))&&0<y.length?(this._renderText(u,y.trim(),t,r-b,d,f),y="".concat(g[_])+" ",r+=u.textLeading()):y=i;this._renderText(u,y.trim(),t,r-b,d,f),r+=u.textLeading()}}else{for(var x=[],w=0;w<s.length;w++)for(var S=s[w].split(y=""),M=0;M<S.length;M++)i="".concat(y+S[M]),(a=this.textWidth(i))<=o?y+=S[M]:o<a&&0<y.length&&(x.push(y),y="".concat(S[M]));x.push(y);var E=0;this._textBaseline===L.CENTER?E=(x.length-1)*u.textLeading()/2:this._textBaseline===L.BOTTOM&&(E=(x.length-1)*u.textLeading());for(var T=0;T<s.length;T++){S=s[T].split(y="");for(var C=0;C<S.length;C++)i="".concat(y+S[C]),(a=this.textWidth(i))<=o?y+=S[C]:o<a&&0<y.length&&(this._renderText(u,y.trim(),t,r-E,d,f),r+=u.textLeading(),y="".concat(S[C]))}this._renderText(u,y.trim(),t,r-E,d,f),r+=u.textLeading()}}else{var O=0;this._textBaseline===L.CENTER?O=(s.length-1)*u.textLeading()/2:this._textBaseline===L.BOTTOM&&(O=(s.length-1)*u.textLeading());for(var k=0;k<s.length;k++)this._renderText(u,s[k],t,r-O,d,f-O),r+=u.textLeading()}return u}},a.default.Renderer.prototype._applyDefaults=function(){return this},a.default.Renderer.prototype._isOpenType=function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this._textFont;return"object"===l(e)&&e.font&&e.font.supported},a.default.Renderer.prototype._updateTextMetrics=function(){var e,t,r,o,n,s;return this._isOpenType()?(this._setProperty("_textAscent",this._textFont._textAscent()),this._setProperty("_textDescent",this._textFont._textDescent())):((e=document.createElement("span")).style.fontFamily=this._textFont,e.style.fontSize="".concat(this._textSize,"px"),e.innerHTML="ABCjgq|",(s=document.createElement("div")).style.display="inline-block",s.style.width="1px",s.style.height="0px",o=((t=document.createElement("div")).appendChild(e),t.appendChild(s),t.style.height="0px",t.style.overflow="hidden",document.body.appendChild(t),s.style.verticalAlign="baseline",u(s)),n=u(e),r=o[1]-n[1],o=(s.style.verticalAlign="bottom",u(s)),n=u(e),s=o[1]-n[1]-r,document.body.removeChild(t),this._setProperty("_textAscent",r),this._setProperty("_textDescent",s)),this};var n=a.default.Renderer;r.default=n},{"../core/constants":256,"./main":267,"core-js/modules/es.array.iterator":158,"core-js/modules/es.number.constructor":169,"core-js/modules/es.object.assign":172,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.string.iterator":186,"core-js/modules/es.string.replace":189,"core-js/modules/es.string.split":191,"core-js/modules/es.string.trim":193,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],271:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.function.name"),e("core-js/modules/es.number.to-fixed"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.function.name"),e("core-js/modules/es.number.to-fixed"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var d=(n=e("./main"))&&n.__esModule?n:{default:n},p=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("./constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}e("./p5.Renderer");var h="rgba(0,0,0,0)",n=(d.default.Renderer2D=function(e,t,r){return d.default.Renderer.call(this,e,t,r),this.drawingContext=this.canvas.getContext("2d"),this._pInst._setProperty("drawingContext",this.drawingContext),this},d.default.Renderer2D.prototype=Object.create(d.default.Renderer.prototype),d.default.Renderer2D.prototype._applyDefaults=function(){this._cachedFillStyle=this._cachedStrokeStyle=void 0,this._cachedBlendMode=p.BLEND,this._setFill(p._DEFAULT_FILL),this._setStroke(p._DEFAULT_STROKE),this.drawingContext.lineCap=p.ROUND,this.drawingContext.font="normal 12px sans-serif"},d.default.Renderer2D.prototype.resize=function(e,t){d.default.Renderer.prototype.resize.call(this,e,t),this.drawingContext.scale(this._pInst._pixelDensity,this._pInst._pixelDensity)},d.default.Renderer2D.prototype.background=function(){var e,t;this.drawingContext.save(),this.resetMatrix(),(arguments.length<=0?void 0:arguments[0])instanceof d.default.Image?0<=(arguments.length<=1?void 0:arguments[1])?(e=arguments.length<=0?void 0:arguments[0],this.drawingContext.globalAlpha=(arguments.length<=1?void 0:arguments[1])/255,this._pInst.image(e,0,0,this.width,this.height)):this._pInst.image(arguments.length<=0?void 0:arguments[0],0,0,this.width,this.height):(e=this._getFill(),t=(t=this._pInst).color.apply(t,arguments),this._pInst._addAccsOutput()&&this._pInst._accsBackground(t.levels),t=t.toString(),this._setFill(t),this._isErasing&&this.blendMode(this._cachedBlendMode),this.drawingContext.fillRect(0,0,this.width,this.height),this._setFill(e),this._isErasing&&this._pInst.erase()),this.drawingContext.restore()},d.default.Renderer2D.prototype.clear=function(){this.drawingContext.save(),this.resetMatrix(),this.drawingContext.clearRect(0,0,this.width,this.height),this.drawingContext.restore()},d.default.Renderer2D.prototype.fill=function(){var e=(e=this._pInst).color.apply(e,arguments);this._setFill(e.toString()),this._pInst._addAccsOutput()&&this._pInst._accsCanvasColors("fill",e.levels)},d.default.Renderer2D.prototype.stroke=function(){var e=(e=this._pInst).color.apply(e,arguments);this._setStroke(e.toString()),this._pInst._addAccsOutput()&&this._pInst._accsCanvasColors("stroke",e.levels)},d.default.Renderer2D.prototype.erase=function(e,t){this._isErasing||(this._cachedFillStyle=this.drawingContext.fillStyle,e=this._pInst.color(255,e).toString(),this.drawingContext.fillStyle=e,this._cachedStrokeStyle=this.drawingContext.strokeStyle,e=this._pInst.color(255,t).toString(),this.drawingContext.strokeStyle=e,t=this._cachedBlendMode,this.blendMode(p.REMOVE),this._cachedBlendMode=t,this._isErasing=!0)},d.default.Renderer2D.prototype.noErase=function(){this._isErasing&&(this.drawingContext.fillStyle=this._cachedFillStyle,this.drawingContext.strokeStyle=this._cachedStrokeStyle,this.blendMode(this._cachedBlendMode),this._isErasing=!1)},d.default.Renderer2D.prototype.image=function(e,t,r,o,n,s,i,a,l){e.gifProperties&&e._animateGif(this._pInst);try{d.default.MediaElement&&e instanceof d.default.MediaElement&&e._ensureCanvas();var u=(u=this._tint&&e.canvas?this._getTintedImageCanvas(e):u)||e.canvas||e.elt,c=1;e.width&&0<e.width&&(c=u.width/e.width),this._isErasing&&this.blendMode(this._cachedBlendMode),this.drawingContext.drawImage(u,c*t,c*r,c*o,c*n,s,i,a,l),this._isErasing&&this._pInst.erase()}catch(e){if("NS_ERROR_NOT_AVAILABLE"!==e.name)throw e}},d.default.Renderer2D.prototype._getTintedImageCanvas=function(e){if(!e.canvas)return e;e.tintCanvas||(e.tintCanvas=document.createElement("canvas")),e.tintCanvas.width!==e.canvas.width&&(e.tintCanvas.width=e.canvas.width),e.tintCanvas.height!==e.canvas.height&&(e.tintCanvas.height=e.canvas.height);var t=e.tintCanvas.getContext("2d");return t.save(),t.clearRect(0,0,e.canvas.width,e.canvas.height),(this._tint[0]<255||this._tint[1]<255||this._tint[2]<255)&&(t.drawImage(e.canvas,0,0),t.globalCompositeOperation="luminosity",t.drawImage(e.canvas,0,0),t.globalCompositeOperation="color",t.drawImage(e.canvas,0,0),t.globalCompositeOperation="multiply",t.fillStyle="rgb(".concat(this._tint.slice(0,3).join(", "),")"),t.fillRect(0,0,e.canvas.width,e.canvas.height),t.globalCompositeOperation="destination-in"),t.globalAlpha=this._tint[3]/255,t.drawImage(e.canvas,0,0),t.restore(),e.tintCanvas},d.default.Renderer2D.prototype.blendMode=function(e){if(e===p.SUBTRACT)console.warn("blendMode(SUBTRACT) only works in WEBGL mode.");else{if(e!==p.BLEND&&e!==p.REMOVE&&e!==p.DARKEST&&e!==p.LIGHTEST&&e!==p.DIFFERENCE&&e!==p.MULTIPLY&&e!==p.EXCLUSION&&e!==p.SCREEN&&e!==p.REPLACE&&e!==p.OVERLAY&&e!==p.HARD_LIGHT&&e!==p.SOFT_LIGHT&&e!==p.DODGE&&e!==p.BURN&&e!==p.ADD)throw new Error("Mode ".concat(e," not recognized."));this._cachedBlendMode=e,this.drawingContext.globalCompositeOperation=e}},d.default.Renderer2D.prototype.blend=function(){for(var e=this.drawingContext.globalCompositeOperation,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];var n=r[r.length-1],s=Array.prototype.slice.call(r,0,r.length-1);this.drawingContext.globalCompositeOperation=n,d.default.prototype.copy.apply(this,s),this.drawingContext.globalCompositeOperation=e},d.default.Renderer2D.prototype._getPixel=function(e,t){e=this.drawingContext.getImageData(e,t,1,1).data;return[e[0],e[1],e[2],e[3]]},d.default.Renderer2D.prototype.loadPixels=function(){var e=this._pixelsState,t=e._pixelDensity,r=this.width*t,t=this.height*t,r=this.drawingContext.getImageData(0,0,r,t);e._setProperty("imageData",r),e._setProperty("pixels",r.data)},d.default.Renderer2D.prototype.set=function(e,t,r){e=Math.floor(e),t=Math.floor(t);var o=this._pixelsState;if(r instanceof d.default.Image)this.drawingContext.save(),this.drawingContext.setTransform(1,0,0,1,0,0),this.drawingContext.scale(o._pixelDensity,o._pixelDensity),this.drawingContext.clearRect(e,t,r.width,r.height),this.drawingContext.drawImage(r.canvas,e,t),this.drawingContext.restore();else{var n=0,s=0,i=0,a=0,l=4*(t*o._pixelDensity*(this.width*o._pixelDensity)+e*o._pixelDensity);if(o.imageData||o.loadPixels.call(o),"number"==typeof r)l<o.pixels.length&&(i=s=n=r,a=255);else if(r instanceof Array){if(r.length<4)throw new Error("pixel array must be of the form [R, G, B, A]");l<o.pixels.length&&(n=r[0],s=r[1],i=r[2],a=r[3])}else r instanceof d.default.Color&&l<o.pixels.length&&(n=r.levels[0],s=r.levels[1],i=r.levels[2],a=r.levels[3]);for(var u=0;u<o._pixelDensity;u++)for(var c=0;c<o._pixelDensity;c++)l=4*((t*o._pixelDensity+c)*this.width*o._pixelDensity+(e*o._pixelDensity+u)),o.pixels[l]=n,o.pixels[l+1]=s,o.pixels[l+2]=i,o.pixels[l+3]=a}},d.default.Renderer2D.prototype.updatePixels=function(e,t,r,o){var n=this._pixelsState,s=n._pixelDensity;void 0===e&&void 0===t&&void 0===r&&void 0===o&&(t=e=0,r=this.width,o=this.height),e*=s,t*=s,r*=s,o*=s,this.gifProperties&&(this.gifProperties.frames[this.gifProperties.displayIndex].image=n.imageData),this.drawingContext.putImageData(n.imageData,e,t,0,0,r,o)},d.default.Renderer2D.prototype._acuteArcToBezier=function(e,t){var r=t/2,o=Math.cos(r),n=Math.sin(r),s=1/Math.tan(r),r=e+r,i=Math.cos(r),r=Math.sin(r),a=(4-o)/3,n=n+(o-a)*s;return{ax:Math.cos(e).toFixed(7),ay:Math.sin(e).toFixed(7),bx:(a*i+n*r).toFixed(7),by:(a*r-n*i).toFixed(7),cx:(a*i-n*r).toFixed(7),cy:(a*r+n*i).toFixed(7),dx:Math.cos(e+t).toFixed(7),dy:Math.sin(e+t).toFixed(7)}},d.default.Renderer2D.prototype.arc=function(r,o,e,t,n,s,i){var a,l=this.drawingContext,u=e/2,c=t/2,d=[];for(r+=u,o+=c;1e-5<=s-n;)a=Math.min(s-n,p.HALF_PI),d.push(this._acuteArcToBezier(n,a)),n+=a;return this._doFill&&(l.beginPath(),d.forEach(function(e,t){0===t&&l.moveTo(r+e.ax*u,o+e.ay*c),l.bezierCurveTo(r+e.bx*u,o+e.by*c,r+e.cx*u,o+e.cy*c,r+e.dx*u,o+e.dy*c)}),i!==p.PIE&&null!=i||l.lineTo(r,o),l.closePath(),l.fill()),this._doStroke&&(l.beginPath(),d.forEach(function(e,t){0===t&&l.moveTo(r+e.ax*u,o+e.ay*c),l.bezierCurveTo(r+e.bx*u,o+e.by*c,r+e.cx*u,o+e.cy*c,r+e.dx*u,o+e.dy*c)}),i===p.PIE?(l.lineTo(r,o),l.closePath()):i===p.CHORD&&l.closePath(),l.stroke()),this},d.default.Renderer2D.prototype.ellipse=function(e){var t=this.drawingContext,r=this._doFill,o=this._doStroke,n=parseFloat(e[0]),s=parseFloat(e[1]),i=parseFloat(e[2]),e=parseFloat(e[3]);if(r&&!o){if(this._getFill()===h)return this}else if(!r&&o&&this._getStroke()===h)return this;var a=i/2*.5522847498,l=e/2*.5522847498,u=n+i,c=s+e,i=n+i/2,e=s+e/2;t.beginPath(),t.moveTo(n,e),t.bezierCurveTo(n,e-l,i-a,s,i,s),t.bezierCurveTo(i+a,s,u,e-l,u,e),t.bezierCurveTo(u,e+l,i+a,c,i,c),t.bezierCurveTo(i-a,c,n,e+l,n,e),r&&t.fill(),o&&t.stroke()},d.default.Renderer2D.prototype.line=function(e,t,r,o){var n=this.drawingContext;return this._doStroke&&this._getStroke()!==h&&(n.beginPath(),n.moveTo(e,t),n.lineTo(r,o),n.stroke()),this},d.default.Renderer2D.prototype.point=function(e,t){var r,o,n=this.drawingContext;return!this._doStroke||this._getStroke()===h?this:(r=this._getStroke(),o=this._getFill(),this._setFill(r),n.beginPath(),n.arc(e,t,n.lineWidth/2,0,p.TWO_PI,!1),n.fill(),void this._setFill(o))},d.default.Renderer2D.prototype.quad=function(e,t,r,o,n,s,i,a){var l=this.drawingContext,u=this._doFill,c=this._doStroke;if(u&&!c){if(this._getFill()===h)return this}else if(!u&&c&&this._getStroke()===h)return this;return l.beginPath(),l.moveTo(e,t),l.lineTo(r,o),l.lineTo(n,s),l.lineTo(i,a),l.closePath(),u&&l.fill(),c&&l.stroke(),this},d.default.Renderer2D.prototype.rect=function(e){var t,r,o=e[0],n=e[1],s=e[2],i=e[3],a=e[4],l=e[5],u=e[6],e=e[7],c=this.drawingContext,d=this._doFill,f=this._doStroke;if(d&&!f){if(this._getFill()===h)return this}else if(!d&&f&&this._getStroke()===h)return this;return c.beginPath(),void 0===a?c.rect(o,n,s,i):(void 0===l&&(l=a),void 0===u&&(u=l),void 0===e&&(e=u),f=(d=Math.abs(s))/2,r=(t=Math.abs(i))/2,t<2*(a=d<2*a?f:a)&&(a=r),t<2*(l=d<2*l?f:l)&&(l=r),t<2*(u=d<2*u?f:u)&&(u=r),t<2*(e=d<2*e?f:e)&&(e=r),c.beginPath(),c.moveTo(o+a,n),c.arcTo(o+s,n,o+s,n+i,l),c.arcTo(o+s,n+i,o,n+i,u),c.arcTo(o,n+i,o,n,e),c.arcTo(o,n,o+s,n,a),c.closePath()),this._doFill&&c.fill(),this._doStroke&&c.stroke(),this},d.default.Renderer2D.prototype.triangle=function(e){var t=this.drawingContext,r=this._doFill,o=this._doStroke,n=e[0],s=e[1],i=e[2],a=e[3],l=e[4],e=e[5];if(r&&!o){if(this._getFill()===h)return this}else if(!r&&o&&this._getStroke()===h)return this;t.beginPath(),t.moveTo(n,s),t.lineTo(i,a),t.lineTo(l,e),t.closePath(),r&&t.fill(),o&&t.stroke()},d.default.Renderer2D.prototype.endShape=function(e,t,r,o,n,s,i){if(0!==t.length&&(this._doStroke||this._doFill)){var a,l,u,c=e===p.CLOSE,d=(c&&!s&&t.push(t[0]),t.length);if(!r||i!==p.POLYGON&&null!==i)if(!o||i!==p.POLYGON&&null!==i)if(!n||i!==p.POLYGON&&null!==i)if(i===p.POINTS)for(l=0;l<d;l++)a=t[l],this._doStroke&&this._pInst.stroke(a[6]),this._pInst.point(a[0],a[1]);else if(i===p.LINES)for(l=0;l+1<d;l+=2)a=t[l],this._doStroke&&this._pInst.stroke(t[l+1][6]),this._pInst.line(a[0],a[1],t[l+1][0],t[l+1][1]);else if(i===p.TRIANGLES)for(l=0;l+2<d;l+=3)a=t[l],this.drawingContext.beginPath(),this.drawingContext.moveTo(a[0],a[1]),this.drawingContext.lineTo(t[l+1][0],t[l+1][1]),this.drawingContext.lineTo(t[l+2][0],t[l+2][1]),this.drawingContext.closePath(),this._doFill&&(this._pInst.fill(t[l+2][5]),this.drawingContext.fill()),this._doStroke&&(this._pInst.stroke(t[l+2][6]),this.drawingContext.stroke());else if(i===p.TRIANGLE_STRIP)for(l=0;l+1<d;l++)a=t[l],this.drawingContext.beginPath(),this.drawingContext.moveTo(t[l+1][0],t[l+1][1]),this.drawingContext.lineTo(a[0],a[1]),this._doStroke&&this._pInst.stroke(t[l+1][6]),this._doFill&&this._pInst.fill(t[l+1][5]),l+2<d&&(this.drawingContext.lineTo(t[l+2][0],t[l+2][1]),this._doStroke&&this._pInst.stroke(t[l+2][6]),this._doFill&&this._pInst.fill(t[l+2][5])),this._doFillStrokeClose(c);else if(i===p.TRIANGLE_FAN){if(2<d){for(this.drawingContext.beginPath(),l=2;l<d;l++)a=t[l],this.drawingContext.moveTo(t[0][0],t[0][1]),this.drawingContext.lineTo(t[l-1][0],t[l-1][1]),this.drawingContext.lineTo(a[0],a[1]),this.drawingContext.lineTo(t[0][0],t[0][1]),l<d-1&&(this._doFill&&a[5]!==t[l+1][5]||this._doStroke&&a[6]!==t[l+1][6])&&(this._doFill&&(this._pInst.fill(a[5]),this.drawingContext.fill(),this._pInst.fill(t[l+1][5])),this._doStroke&&(this._pInst.stroke(a[6]),this.drawingContext.stroke(),this._pInst.stroke(t[l+1][6])),this.drawingContext.closePath(),this.drawingContext.beginPath());this._doFillStrokeClose(c)}}else if(i===p.QUADS)for(l=0;l+3<d;l+=4){for(a=t[l],this.drawingContext.beginPath(),this.drawingContext.moveTo(a[0],a[1]),u=1;u<4;u++)this.drawingContext.lineTo(t[l+u][0],t[l+u][1]);this.drawingContext.lineTo(a[0],a[1]),this._doFill&&this._pInst.fill(t[l+3][5]),this._doStroke&&this._pInst.stroke(t[l+3][6]),this._doFillStrokeClose(c)}else if(i===p.QUAD_STRIP){if(3<d)for(l=0;l+1<d;l+=2)a=t[l],this.drawingContext.beginPath(),l+3<d?(this.drawingContext.moveTo(t[l+2][0],t[l+2][1]),this.drawingContext.lineTo(a[0],a[1]),this.drawingContext.lineTo(t[l+1][0],t[l+1][1]),this.drawingContext.lineTo(t[l+3][0],t[l+3][1]),this._doFill&&this._pInst.fill(t[l+3][5]),this._doStroke&&this._pInst.stroke(t[l+3][6])):(this.drawingContext.moveTo(a[0],a[1]),this.drawingContext.lineTo(t[l+1][0],t[l+1][1])),this._doFillStrokeClose(c)}else{for(this.drawingContext.beginPath(),this.drawingContext.moveTo(t[0][0],t[0][1]),l=1;l<d;l++)(a=t[l]).isVert&&(a.moveTo?this.drawingContext.moveTo(a[0],a[1]):this.drawingContext.lineTo(a[0],a[1]));this._doFillStrokeClose(c)}else{for(this.drawingContext.beginPath(),l=0;l<d;l++)t[l].isVert?t[l].moveTo?this.drawingContext.moveTo(t[l][0],t[l][1]):this.drawingContext.lineTo(t[l][0],t[l][1]):this.drawingContext.quadraticCurveTo(t[l][0],t[l][1],t[l][2],t[l][3]);this._doFillStrokeClose(c)}else{for(this.drawingContext.beginPath(),l=0;l<d;l++)t[l].isVert?t[l].moveTo?this.drawingContext.moveTo(t[l][0],t[l][1]):this.drawingContext.lineTo(t[l][0],t[l][1]):this.drawingContext.bezierCurveTo(t[l][0],t[l][1],t[l][2],t[l][3],t[l][4],t[l][5]);this._doFillStrokeClose(c)}else if(3<d){var f=[],h=1-this._curveTightness;for(this.drawingContext.beginPath(),this.drawingContext.moveTo(t[1][0],t[1][1]),l=1;l+2<d;l++)a=t[l],f[0]=[a[0],a[1]],f[1]=[a[0]+(h*t[l+1][0]-h*t[l-1][0])/6,a[1]+(h*t[l+1][1]-h*t[l-1][1])/6],f[2]=[t[l+1][0]+(h*t[l][0]-h*t[l+2][0])/6,t[l+1][1]+(h*t[l][1]-h*t[l+2][1])/6],f[3]=[t[l+1][0],t[l+1][1]],this.drawingContext.bezierCurveTo(f[1][0],f[1][1],f[2][0],f[2][1],f[3][0],f[3][1]);c&&this.drawingContext.lineTo(t[l+1][0],t[l+1][1]),this._doFillStrokeClose(c)}s=n=o=r=!1,c&&t.pop()}return this},d.default.Renderer2D.prototype.strokeCap=function(e){return e!==p.ROUND&&e!==p.SQUARE&&e!==p.PROJECT||(this.drawingContext.lineCap=e),this},d.default.Renderer2D.prototype.strokeJoin=function(e){return e!==p.ROUND&&e!==p.BEVEL&&e!==p.MITER||(this.drawingContext.lineJoin=e),this},d.default.Renderer2D.prototype.strokeWeight=function(e){return this.drawingContext.lineWidth=void 0===e||0===e?1e-4:e,this},d.default.Renderer2D.prototype._getFill=function(){return this._cachedFillStyle||(this._cachedFillStyle=this.drawingContext.fillStyle),this._cachedFillStyle},d.default.Renderer2D.prototype._setFill=function(e){e!==this._cachedFillStyle&&(this.drawingContext.fillStyle=e,this._cachedFillStyle=e)},d.default.Renderer2D.prototype._getStroke=function(){return this._cachedStrokeStyle||(this._cachedStrokeStyle=this.drawingContext.strokeStyle),this._cachedStrokeStyle},d.default.Renderer2D.prototype._setStroke=function(e){e!==this._cachedStrokeStyle&&(this.drawingContext.strokeStyle=e,this._cachedStrokeStyle=e)},d.default.Renderer2D.prototype.bezier=function(e,t,r,o,n,s,i,a){return this._pInst.beginShape(),this._pInst.vertex(e,t),this._pInst.bezierVertex(r,o,n,s,i,a),this._pInst.endShape(),this},d.default.Renderer2D.prototype.curve=function(e,t,r,o,n,s,i,a){return this._pInst.beginShape(),this._pInst.curveVertex(e,t),this._pInst.curveVertex(r,o),this._pInst.curveVertex(n,s),this._pInst.curveVertex(i,a),this._pInst.endShape(),this},d.default.Renderer2D.prototype._doFillStrokeClose=function(e){e&&this.drawingContext.closePath(),this._doFill&&this.drawingContext.fill(),this._doStroke&&this.drawingContext.stroke()},d.default.Renderer2D.prototype.applyMatrix=function(e,t,r,o,n,s){this.drawingContext.transform(e,t,r,o,n,s)},d.default.Renderer2D.prototype.resetMatrix=function(){return this.drawingContext.setTransform(1,0,0,1,0,0),this.drawingContext.scale(this._pInst._pixelDensity,this._pInst._pixelDensity),this},d.default.Renderer2D.prototype.rotate=function(e){this.drawingContext.rotate(e)},d.default.Renderer2D.prototype.scale=function(e,t){return this.drawingContext.scale(e,t),this},d.default.Renderer2D.prototype.translate=function(e,t){return e instanceof d.default.Vector&&(t=e.y,e=e.x),this.drawingContext.translate(e,t),this},d.default.Renderer2D.prototype.text=function(e,t,r,o,n){void 0!==o&&this.drawingContext.textBaseline===p.BASELINE&&(s=!0,this.drawingContext.textBaseline=p.TOP);var s,o=d.default.Renderer.prototype.text.apply(this,arguments);return s&&(this.drawingContext.textBaseline=p.BASELINE),o},d.default.Renderer2D.prototype._renderText=function(e,t,r,o,n,s){if(!(o<s||n<=o))return e.push(),this._isOpenType()?this._textFont._renderPath(t,r,o,{renderer:this}):(this._doStroke&&this._strokeSet&&this.drawingContext.strokeText(t,r,o),this._doFill&&(this._fillSet||this._setFill(p._DEFAULT_TEXT_FILL),this.drawingContext.fillText(t,r,o))),e.pop(),e},d.default.Renderer2D.prototype.textWidth=function(e){return this._isOpenType()?this._textFont._textWidth(e,this._textSize):this.drawingContext.measureText(e).width},d.default.Renderer2D.prototype._applyTextProperties=function(){var e,t=this._pInst;return this._setProperty("_textAscent",null),this._setProperty("_textDescent",null),e=this._textFont,this._isOpenType()&&(e=this._textFont.font.familyName,this._setProperty("_textStyle",this._textFont.font.styleName)),this.drawingContext.font="".concat(this._textStyle||"normal"," ").concat(this._textSize||12,"px ").concat(e||"sans-serif"),this.drawingContext.textAlign=this._textAlign,this._textBaseline===p.CENTER?this.drawingContext.textBaseline=p._CTX_MIDDLE:this.drawingContext.textBaseline=this._textBaseline,t},d.default.Renderer2D.prototype.push=function(){return this.drawingContext.save(),d.default.Renderer.prototype.push.apply(this)},d.default.Renderer2D.prototype.pop=function(e){this.drawingContext.restore(),this._cachedFillStyle=this.drawingContext.fillStyle,this._cachedStrokeStyle=this.drawingContext.strokeStyle,d.default.Renderer.prototype.pop.call(this,e)},d.default.Renderer2D);r.default=n},{"./constants":256,"./main":267,"./p5.Renderer":270,"core-js/modules/es.array.concat":149,"core-js/modules/es.array.fill":152,"core-js/modules/es.array.for-each":154,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.join":159,"core-js/modules/es.array.slice":162,"core-js/modules/es.function.name":165,"core-js/modules/es.number.to-fixed":171,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],272:[function(e,t,r){"use strict";e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator");var f=(e=e("./main"))&&e.__esModule?e:{default:e};f.default.prototype._promisePreloads=[];function s(){return{}}var h=!(f.default.prototype.registerPromisePreload=function(e){f.default.prototype._promisePreloads.push(e)});f.default.prototype._setupPromisePreloads=function(){var e=!0,t=!1,r=void 0;try{for(var o,n=this._promisePreloads[Symbol.iterator]();!(e=(o=n.next()).done);e=!0){var s=o.value,i=this,a=s.method,l=s.addCallbacks,u=s.legacyPreloadSetup,c=s.target||this,d=c[a].bind(c);if(c===f.default.prototype){if(h)continue;i=null,d=c[a]}c[a]=this._wrapPromisePreload(i,d,l),u&&(c[u.method]=this._legacyPreloadGenerator(i,u,c[a]))}}catch(e){t=!0,r=e}finally{try{e||null==n.return||n.return()}finally{if(t)throw r}}h=!0},f.default.prototype._wrapPromisePreload=function(e,l,u){var t=function(){for(var e=this,t=(this._incrementPreload(),null),r=null,o=arguments.length,n=new Array(o),s=0;s<o;s++)n[s]=arguments[s];if(u)for(var i=n.length-1;0<=i&&!r&&"function"==typeof n[i];i--)r=t,t=n.pop();var a=Promise.resolve(l.apply(this,n));return t&&a.then(t),r&&a.catch(r),a.then(function(){return e._decrementPreload()}),a};return t=e?t.bind(e):t};f.default.prototype._legacyPreloadGenerator=function(e,t,o){var n=t.createBaseObject||s,t=function(){var t=this,r=(this._incrementPreload(),n.apply(this,arguments));return o.apply(this,arguments).then(function(e){Object.assign(r,e),t._decrementPreload()}),r};return t=e?t.bind(e):t}},{"./main":267,"core-js/modules/es.array.iterator":158,"core-js/modules/es.object.assign":172,"core-js/modules/es.object.to-string":177,"core-js/modules/es.promise":178,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/web.dom-collections.iterator":230}],273:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var a=(n=e("./main"))&&n.__esModule?n:{default:n},l=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==u(e)&&"function"!=typeof e)return{default:e};var t=i();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("./constants"));function i(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,i=function(){return e},e)}function u(e){return(u="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("./p5.Graphics"),e("./p5.Renderer2D"),e("../webgl/p5.RendererGL");var c="defaultCanvas0",n=(a.default.prototype.createCanvas=function(e,t,r){a.default._validateParameters("createCanvas",arguments);var o,n,s,r=r||l.P2D;if(r===l.WEBGL)(n=document.getElementById(c))&&(n.parentNode.removeChild(n),o=this._renderer,this._elements=this._elements.filter(function(e){return e!==o})),(n=document.createElement("canvas")).id=c,n.classList.add("p5Canvas");else if(this._defaultGraphicsCreated)n=this.canvas;else{n=document.createElement("canvas");for(var i=0;document.getElementById("defaultCanvas".concat(i));)i++;c="defaultCanvas".concat(i),n.id=c,n.classList.add("p5Canvas")}return this._setupDone||(n.dataset.hidden=!0,n.style.visibility="hidden"),(this._userNode||(0===document.getElementsByTagName("main").length&&(s=document.createElement("main"),document.body.appendChild(s)),document.getElementsByTagName("main")[0])).appendChild(n),r===l.WEBGL?(this._setProperty("_renderer",new a.default.RendererGL(n,this,!0)),this._elements.push(this._renderer)):this._defaultGraphicsCreated||(this._setProperty("_renderer",new a.default.Renderer2D(n,this,!0)),this._defaultGraphicsCreated=!0,this._elements.push(this._renderer)),this._renderer.resize(e,t),this._renderer._applyDefaults(),this._renderer},a.default.prototype.resizeCanvas=function(e,t,r){if(a.default._validateParameters("resizeCanvas",arguments),this._renderer){var o,n,s={};for(o in this.drawingContext){var i=this.drawingContext[o];"object"!==u(i)&&"function"!=typeof i&&(s[o]=i)}for(n in this._renderer.resize(e,t),this.width=e,this.height=t,s)try{this.drawingContext[n]=s[n]}catch(e){}r||this.redraw()}this._addAccsOutput()&&this._updateAccsOutput()},a.default.prototype.noCanvas=function(){this.canvas&&this.canvas.parentNode.removeChild(this.canvas)},a.default.prototype.createGraphics=function(e,t,r){return a.default._validateParameters("createGraphics",arguments),new a.default.Graphics(e,t,r,this)},a.default.prototype.blendMode=function(e){a.default._validateParameters("blendMode",arguments),e===l.NORMAL&&(console.warn("NORMAL has been deprecated for use in blendMode. defaulting to BLEND instead."),e=l.BLEND),this._renderer.blendMode(e)},a.default);r.default=n},{"../webgl/p5.RendererGL":321,"./constants":256,"./main":267,"./p5.Graphics":269,"./p5.Renderer2D":271,"core-js/modules/es.array.filter":153,"core-js/modules/es.array.iterator":158,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],274:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.slice"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var l=n(e("../main")),a=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=c();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../constants")),u=n(e("../helpers"));function c(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,c=function(){return e},e)}function n(e){return e&&e.__esModule?e:{default:e}}e("../friendly_errors/fes_core"),e("../friendly_errors/file_errors"),e("../friendly_errors/validate_params"),l.default.prototype._normalizeArcAngles=function(e,t,r,o,n){var s;return e-=a.TWO_PI*Math.floor(e/a.TWO_PI),t-=a.TWO_PI*Math.floor(t/a.TWO_PI),s=Math.min(Math.abs(e-t),a.TWO_PI-Math.abs(e-t)),n&&(e=e<=a.HALF_PI?Math.atan(r/o*Math.tan(e)):e>a.HALF_PI&&e<=3*a.HALF_PI?Math.atan(r/o*Math.tan(e))+a.PI:Math.atan(r/o*Math.tan(e))+a.TWO_PI,t=t<=a.HALF_PI?Math.atan(r/o*Math.tan(t)):t>a.HALF_PI&&t<=3*a.HALF_PI?Math.atan(r/o*Math.tan(t))+a.PI:Math.atan(r/o*Math.tan(t))+a.TWO_PI),t<e&&(t+=a.TWO_PI),{start:e,stop:t,correspondToSamePoint:s<1e-5}},l.default.prototype.arc=function(e,t,r,o,n,s,i,a){return l.default._validateParameters("arc",arguments),(this._renderer._doStroke||this._renderer._doFill)&&n!==s&&(n=this._toRadians(n),s=this._toRadians(s),r=Math.abs(r),o=Math.abs(o),e=u.default.modeAdjust(e,t,r,o,this._renderer._ellipseMode),(t=this._normalizeArcAngles(n,s,e.w,e.h,!0)).correspondToSamePoint?this._renderer.ellipse([e.x,e.y,e.w,e.h,a]):(this._renderer.arc(e.x,e.y,e.w,e.h,t.start,t.stop,i,a),(this._accessibleOutputs.grid||this._accessibleOutputs.text)&&this._accsOutput("arc",[e.x,e.y,e.w,e.h,t.start,t.stop,i]))),this},l.default.prototype.ellipse=function(e,t,r,o,n){return l.default._validateParameters("ellipse",arguments),this._renderEllipse.apply(this,arguments)},l.default.prototype.circle=function(){l.default._validateParameters("circle",arguments);var e=Array.prototype.slice.call(arguments,0,2);return e.push(arguments[2]),e.push(arguments[2]),this._renderEllipse.apply(this,e)},l.default.prototype._renderEllipse=function(e,t,r,o,n){return(this._renderer._doStroke||this._renderer._doFill)&&(r<0&&(r=Math.abs(r)),void 0===o?o=r:o<0&&(o=Math.abs(o)),e=u.default.modeAdjust(e,t,r,o,this._renderer._ellipseMode),this._renderer.ellipse([e.x,e.y,e.w,e.h,n]),(this._accessibleOutputs.grid||this._accessibleOutputs.text)&&this._accsOutput("ellipse",[e.x,e.y,e.w,e.h])),this},l.default.prototype.line=function(){for(var e,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return l.default._validateParameters("line",r),this._renderer._doStroke&&(e=this._renderer).line.apply(e,r),(this._accessibleOutputs.grid||this._accessibleOutputs.text)&&this._accsOutput("line",r),this},l.default.prototype.point=function(){for(var e,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return l.default._validateParameters("point",r),this._renderer._doStroke&&(1===r.length&&r[0]instanceof l.default.Vector?this._renderer.point.call(this._renderer,r[0].x,r[0].y,r[0].z):((e=this._renderer).point.apply(e,r),(this._accessibleOutputs.grid||this._accessibleOutputs.text)&&this._accsOutput("point",r))),this},l.default.prototype.quad=function(){for(var e,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return l.default._validateParameters("quad",r),(this._renderer._doStroke||this._renderer._doFill)&&(this._renderer.isP3D&&r.length<12?this._renderer.quad.call(this._renderer,r[0],r[1],0,r[2],r[3],0,r[4],r[5],0,r[6],r[7],0,r[8],r[9]):((e=this._renderer).quad.apply(e,r),(this._accessibleOutputs.grid||this._accessibleOutputs.text)&&this._accsOutput("quadrilateral",r))),this},l.default.prototype.rect=function(){return l.default._validateParameters("rect",arguments),this._renderRect.apply(this,arguments)},l.default.prototype.square=function(e,t,r,o,n,s,i){return l.default._validateParameters("square",arguments),this._renderRect.call(this,e,t,r,r,o,n,s,i)},l.default.prototype._renderRect=function(){if(this._renderer._doStroke||this._renderer._doFill){3===arguments.length&&(arguments[3]=arguments[2]);for(var e=u.default.modeAdjust(arguments[0],arguments[1],arguments[2],arguments[3],this._renderer._rectMode),t=[e.x,e.y,e.w,e.h],r=4;r<arguments.length;r++)t[r]=arguments[r];this._renderer.rect(t),(this._accessibleOutputs.grid||this._accessibleOutputs.text)&&this._accsOutput("rectangle",[e.x,e.y,e.w,e.h])}return this},l.default.prototype.triangle=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return l.default._validateParameters("triangle",t),(this._renderer._doStroke||this._renderer._doFill)&&this._renderer.triangle(t),(this._accessibleOutputs.grid||this._accessibleOutputs.text)&&this._accsOutput("triangle",t),this};e=l.default;r.default=e},{"../constants":256,"../friendly_errors/fes_core":258,"../friendly_errors/file_errors":259,"../friendly_errors/validate_params":262,"../helpers":263,"../main":267,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.slice":162,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],275:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(l=e("../main"))&&l.__esModule?l:{default:l},s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}n.default.prototype.ellipseMode=function(e){return n.default._validateParameters("ellipseMode",arguments),e!==s.CORNER&&e!==s.CORNERS&&e!==s.RADIUS&&e!==s.CENTER||(this._renderer._ellipseMode=e),this},n.default.prototype.noSmooth=function(){return this._renderer.isP3D?this.setAttributes("antialias",!1):"imageSmoothingEnabled"in this.drawingContext&&(this.drawingContext.imageSmoothingEnabled=!1),this},n.default.prototype.rectMode=function(e){return n.default._validateParameters("rectMode",arguments),e!==s.CORNER&&e!==s.CORNERS&&e!==s.RADIUS&&e!==s.CENTER||(this._renderer._rectMode=e),this},n.default.prototype.smooth=function(){return this.setAttributes("antialias",!0),this._renderer.isP3D||"imageSmoothingEnabled"in this.drawingContext&&(this.drawingContext.imageSmoothingEnabled=!0),this},n.default.prototype.strokeCap=function(e){return n.default._validateParameters("strokeCap",arguments),e!==s.ROUND&&e!==s.SQUARE&&e!==s.PROJECT||this._renderer.strokeCap(e),this},n.default.prototype.strokeJoin=function(e){return n.default._validateParameters("strokeJoin",arguments),e!==s.ROUND&&e!==s.BEVEL&&e!==s.MITER||this._renderer.strokeJoin(e),this},n.default.prototype.strokeWeight=function(e){return n.default._validateParameters("strokeWeight",arguments),this._renderer.strokeWeight(e),this};var l=n.default;r.default=l},{"../constants":256,"../main":267,"core-js/modules/es.array.iterator":158,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],276:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var l=(o=e("../main"))&&o.__esModule?o:{default:o};e("../friendly_errors/fes_core"),e("../friendly_errors/file_errors"),e("../friendly_errors/validate_params"),l.default.prototype.bezier=function(){for(var e,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return l.default._validateParameters("bezier",r),(this._renderer._doStroke||this._renderer._doFill)&&(e=this._renderer).bezier.apply(e,r),this},l.default.prototype.bezierDetail=function(e){return l.default._validateParameters("bezierDetail",arguments),this._bezierDetail=e,this},l.default.prototype.bezierPoint=function(e,t,r,o,n){l.default._validateParameters("bezierPoint",arguments);var s=1-n;return Math.pow(s,3)*e+3*Math.pow(s,2)*n*t+3*s*Math.pow(n,2)*r+Math.pow(n,3)*o},l.default.prototype.bezierTangent=function(e,t,r,o,n){l.default._validateParameters("bezierTangent",arguments);var s=1-n;return 3*o*Math.pow(n,2)-3*r*Math.pow(n,2)+6*r*s*n-6*t*s*n+3*t*Math.pow(s,2)-3*e*Math.pow(s,2)},l.default.prototype.curve=function(){for(var e,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return l.default._validateParameters("curve",r),this._renderer._doStroke&&(e=this._renderer).curve.apply(e,r),this},l.default.prototype.curveDetail=function(e){return l.default._validateParameters("curveDetail",arguments),this._curveDetail=e<3?3:e,this},l.default.prototype.curveTightness=function(e){return l.default._validateParameters("curveTightness",arguments),this._renderer._curveTightness=e,this},l.default.prototype.curvePoint=function(e,t,r,o,n){l.default._validateParameters("curvePoint",arguments);var s=this._renderer._curveTightness,i=n*n*n,a=n*n;return e*((s-1)/2*i+(1-s)*a+(s-1)/2*n)+t*((s+3)/2*i+(-5-s)/2*a+1)+r*((-3-s)/2*i+(s+2)*a+(1-s)/2*n)+o*((1-s)/2*i+(s-1)/2*a)},l.default.prototype.curveTangent=function(e,t,r,o,n){l.default._validateParameters("curveTangent",arguments);var s=this._renderer._curveTightness,i=n*n*3,n=2*n;return e*((s-1)/2*i+(1-s)*n+(s-1)/2)+t*((s+3)/2*i+(-5-s)/2*n)+r*((-3-s)/2*i+(s+2)*n+(1-s)/2)+o*((1-s)/2*i+(s-1)/2*n)};var o=l.default;r.default=o},{"../friendly_errors/fes_core":258,"../friendly_errors/file_errors":259,"../friendly_errors/validate_params":262,"../main":267}],277:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.slice"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var a=(y=e("../main"))&&y.__esModule?y:{default:y},l=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../constants"));function u(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,u=function(){return e},e)}var n=null,c=[],d=[],f=!1,s=!1,h=!1,p=!1,m=!0,y=(a.default.prototype.beginContour=function(){return d=[],p=!0,this},a.default.prototype.beginShape=function(e){var t;return a.default._validateParameters("beginShape",arguments),this._renderer.isP3D?(t=this._renderer).beginShape.apply(t,arguments):(n=e===l.POINTS||e===l.LINES||e===l.TRIANGLES||e===l.TRIANGLE_FAN||e===l.TRIANGLE_STRIP||e===l.QUADS||e===l.QUAD_STRIP?e:null,c=[],d=[]),this},a.default.prototype.bezierVertex=function(){for(var e,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];if(a.default._validateParameters("bezierVertex",r),this._renderer.isP3D)(e=this._renderer).bezierVertex.apply(e,r);else if(0===c.length)a.default._friendlyError("vertex() must be used once before calling bezierVertex()","bezierVertex");else{f=!0;for(var n=[],s=0;s<r.length;s++)n[s]=r[s];n.isVert=!1,(p?d:c).push(n)}return this},a.default.prototype.curveVertex=function(){for(var e,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return a.default._validateParameters("curveVertex",r),this._renderer.isP3D?(e=this._renderer).curveVertex.apply(e,r):(s=!0,this.vertex(r[0],r[1])),this},a.default.prototype.endContour=function(){var e=d[0].slice();e.isVert=d[0].isVert,e.moveTo=!1,d.push(e),m&&(c.push(c[0]),m=!1);for(var t=0;t<d.length;t++)c.push(d[t]);return this},a.default.prototype.endShape=function(e){if(a.default._validateParameters("endShape",arguments),this._renderer.isP3D)this._renderer.endShape(e,s,f,h,p,n);else{if(0===c.length)return this;if(!this._renderer._doStroke&&!this._renderer._doFill)return this;var t=e===l.CLOSE;t&&!p&&c.push(c[0]),this._renderer.endShape(e,c,s,f,h,p,n),m=!(p=h=f=s=!1),t&&c.pop()}return this},a.default.prototype.quadraticVertex=function(){for(var e,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];if(a.default._validateParameters("quadraticVertex",r),this._renderer.isP3D)(e=this._renderer).quadraticVertex.apply(e,r);else{if(this._contourInited)return(e={}).x=r[0],e.y=r[1],e.x3=r[2],e.y3=r[3],e.type=l.QUADRATIC,this._contourVertices.push(e),this;if(0<c.length){h=!0;for(var n=[],s=0;s<r.length;s++)n[s]=r[s];n.isVert=!1,(p?d:c).push(n)}else a.default._friendlyError("vertex() must be used once before calling quadraticVertex()","quadraticVertex")}return this},a.default.prototype.vertex=function(e,t,r,o,n){var s;return this._renderer.isP3D?(s=this._renderer).vertex.apply(s,arguments):((s=[]).isVert=!0,s[0]=e,s[1]=t,s[2]=0,s[3]=0,s[4]=0,s[5]=this._renderer._getFill(),s[6]=this._renderer._getStroke(),r&&(s.moveTo=r),(p?(0===d.length&&(s.moveTo=!0),d):c).push(s)),this},a.default.prototype.normal=function(e,t,r){var o;return this._assert3d("normal"),a.default._validateParameters("normal",arguments),(o=this._renderer).normal.apply(o,arguments),this},a.default);r.default=y},{"../constants":256,"../main":267,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.slice":162,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],278:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e){return(n="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}var a,l,u;e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.typed-array.uint8-clamped-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.typed-array.uint8-clamped-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/web.dom-collections.iterator"),window.requestAnimationFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e,t){window.setTimeout(e,1e3/60)},"undefined"==typeof Uint8ClampedArray||Uint8ClampedArray.prototype.slice||Object.defineProperty(Uint8ClampedArray.prototype,"slice",{value:Array.prototype.slice,writable:!0,configurable:!0,enumerable:!1}),Object.assign||(a=Object.keys,e=Object.defineProperty,l="function"==typeof Symbol&&"symbol"===n(Symbol()),u=Object.prototype.propertyIsEnumerable,e(Object,"assign",{value:function(e,t){if(null==e)throw new TypeError("target must be an object");for(var r,o,n,s=Object(e),i=1;i<arguments.length;++i)for(r=Object(arguments[i]),n=a(r),l&&Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter(function(t){return function(e){return u.call(t,e)}}(r))),o=0;o<n.length;++o)s[n[o]]=r[n[o]];return s},configurable:!0,enumerable:!1,writable:!0}))},{"core-js/modules/es.array.filter":153,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.slice":162,"core-js/modules/es.object.assign":172,"core-js/modules/es.object.keys":176,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.typed-array.copy-within":197,"core-js/modules/es.typed-array.every":198,"core-js/modules/es.typed-array.fill":199,"core-js/modules/es.typed-array.filter":200,"core-js/modules/es.typed-array.find":202,"core-js/modules/es.typed-array.find-index":201,"core-js/modules/es.typed-array.for-each":205,"core-js/modules/es.typed-array.includes":206,"core-js/modules/es.typed-array.index-of":207,"core-js/modules/es.typed-array.iterator":210,"core-js/modules/es.typed-array.join":211,"core-js/modules/es.typed-array.last-index-of":212,"core-js/modules/es.typed-array.map":213,"core-js/modules/es.typed-array.reduce":215,"core-js/modules/es.typed-array.reduce-right":214,"core-js/modules/es.typed-array.reverse":216,"core-js/modules/es.typed-array.set":217,"core-js/modules/es.typed-array.slice":218,"core-js/modules/es.typed-array.some":219,"core-js/modules/es.typed-array.sort":220,"core-js/modules/es.typed-array.subarray":221,"core-js/modules/es.typed-array.to-locale-string":222,"core-js/modules/es.typed-array.to-string":223,"core-js/modules/es.typed-array.uint8-clamped-array":227,"core-js/modules/web.dom-collections.iterator":230}],279:[function(e,t,r){"use strict";e("core-js/modules/es.array.for-each"),e("core-js/modules/es.object.assign"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.object.assign"),e("core-js/modules/web.dom-collections.for-each"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;e=(e=e("./main"))&&e.__esModule?e:{default:e};e.default.prototype.noLoop=function(){this._loop=!1},e.default.prototype.loop=function(){this._loop||(this._loop=!0,this._setupDone&&this._draw())},e.default.prototype.isLooping=function(){return this._loop},e.default.prototype.push=function(){this._styles.push({props:{_colorMode:this._colorMode},renderer:this._renderer.push()})},e.default.prototype.pop=function(){var e=this._styles.pop();e?(this._renderer.pop(e.renderer),Object.assign(this,e.props)):console.warn("pop() was called without matching push()")},e.default.prototype.redraw=function(e){if(!this._inUserDraw&&this._setupDone){var t=parseInt(e),r=((isNaN(t)||t<1)&&(t=1),this._isGlobal?window:this);if("function"==typeof r.draw){void 0===r.setup&&r.scale(r._pixelDensity,r._pixelDensity);for(var o=function(e){e.call(r)},n=0;n<t;n++){r.resetMatrix(),(this._accessibleOutputs.grid||this._accessibleOutputs.text)&&this._updateAccsOutput(),r._renderer.isP3D&&r._renderer._update(),r._setProperty("frameCount",r.frameCount+1),r._registeredMethods.pre.forEach(o),this._inUserDraw=!0;try{r.draw()}finally{this._inUserDraw=!1}r._registeredMethods.post.forEach(o)}}}};e=e.default;r.default=e},{"./main":267,"core-js/modules/es.array.for-each":154,"core-js/modules/es.object.assign":172,"core-js/modules/web.dom-collections.for-each":229}],280:[function(e,t,r){"use strict";e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-prototype-of"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-prototype-of"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(e=e("./main"))&&e.__esModule?e:{default:e};function o(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}n.default.prototype.applyMatrix=function(){var e=arguments[0]instanceof Object.getPrototypeOf(Uint8Array);return Array.isArray(arguments[0])||e?(e=this._renderer).applyMatrix.apply(e,o(arguments[0])):(e=this._renderer).applyMatrix.apply(e,arguments),this},n.default.prototype.resetMatrix=function(){return this._renderer.resetMatrix(),this},n.default.prototype.rotate=function(e,t){return n.default._validateParameters("rotate",arguments),this._renderer.rotate(this._toRadians(e),t),this},n.default.prototype.rotateX=function(e){return this._assert3d("rotateX"),n.default._validateParameters("rotateX",arguments),this._renderer.rotateX(this._toRadians(e)),this},n.default.prototype.rotateY=function(e){return this._assert3d("rotateY"),n.default._validateParameters("rotateY",arguments),this._renderer.rotateY(this._toRadians(e)),this},n.default.prototype.rotateZ=function(e){return this._assert3d("rotateZ"),n.default._validateParameters("rotateZ",arguments),this._renderer.rotateZ(this._toRadians(e)),this},n.default.prototype.scale=function(e,t,r){var o;return n.default._validateParameters("scale",arguments),e instanceof n.default.Vector?(e=(o=e).x,t=o.y,r=o.z):e instanceof Array&&(e=(o=e)[0],t=o[1],r=o[2]||1),isNaN(t)?t=r=e:isNaN(r)&&(r=1),this._renderer.scale.call(this._renderer,e,t,r),this},n.default.prototype.shearX=function(e){n.default._validateParameters("shearX",arguments);e=this._toRadians(e);return this._renderer.applyMatrix(1,0,Math.tan(e),1,0,0),this},n.default.prototype.shearY=function(e){n.default._validateParameters("shearY",arguments);e=this._toRadians(e);return this._renderer.applyMatrix(1,Math.tan(e),0,1,0,0),this},n.default.prototype.translate=function(e,t,r){return n.default._validateParameters("translate",arguments),this._renderer.isP3D?this._renderer.translate(e,t,r):this._renderer.translate(e,t),this};e=n.default;r.default=e},{"./main":267,"core-js/modules/es.array.from":155,"core-js/modules/es.array.iterator":158,"core-js/modules/es.object.get-prototype-of":175,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.typed-array.copy-within":197,"core-js/modules/es.typed-array.every":198,"core-js/modules/es.typed-array.fill":199,"core-js/modules/es.typed-array.filter":200,"core-js/modules/es.typed-array.find":202,"core-js/modules/es.typed-array.find-index":201,"core-js/modules/es.typed-array.for-each":205,"core-js/modules/es.typed-array.includes":206,"core-js/modules/es.typed-array.index-of":207,"core-js/modules/es.typed-array.iterator":210,"core-js/modules/es.typed-array.join":211,"core-js/modules/es.typed-array.last-index-of":212,"core-js/modules/es.typed-array.map":213,"core-js/modules/es.typed-array.reduce":215,"core-js/modules/es.typed-array.reduce-right":214,"core-js/modules/es.typed-array.reverse":216,"core-js/modules/es.typed-array.set":217,"core-js/modules/es.typed-array.slice":218,"core-js/modules/es.typed-array.some":219,"core-js/modules/es.typed-array.sort":220,"core-js/modules/es.typed-array.subarray":221,"core-js/modules/es.typed-array.to-locale-string":222,"core-js/modules/es.typed-array.to-string":223,"core-js/modules/es.typed-array.uint8-array":226,"core-js/modules/web.dom-collections.iterator":230}],281:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.ends-with"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.ends-with"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator");var n=(e=e("../core/main"))&&e.__esModule?e:{default:e};function s(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}n.default.prototype.storeItem=function(e,t){"string"!=typeof e&&console.log("The argument that you passed to storeItem() - ".concat(e," is not a string.")),e.endsWith("p5TypeID")&&console.log("The argument that you passed to storeItem() - ".concat(e," must not end with 'p5TypeID'.")),void 0===t&&console.log("You cannot store undefined variables using storeItem().");var r=i(t);switch(r){case"number":case"boolean":t=t.toString();break;case"object":t instanceof n.default.Color?r="p5.Color":t instanceof n.default.Vector&&(r="p5.Vector",t=[t.x,t.y,t.z]),t=JSON.stringify(t)}localStorage.setItem(e,t);e="".concat(e,"p5TypeID");localStorage.setItem(e,r)},n.default.prototype.getItem=function(e){var t=localStorage.getItem(e),r=localStorage.getItem("".concat(e,"p5TypeID"));if(void 0===r)console.log("Unable to determine type of item stored under ".concat(e,"in local storage. Did you save the item with something other than setItem()?"));else if(null!==t)switch(r){case"number":t=parseFloat(t);break;case"boolean":t="true"===t;break;case"object":t=JSON.parse(t);break;case"p5.Color":t=JSON.parse(t),t=this.color.apply(this,s(t.levels));break;case"p5.Vector":t=JSON.parse(t),t=this.createVector.apply(this,s(t))}return t},n.default.prototype.clearStorage=function(){localStorage.clear()},n.default.prototype.removeItem=function(e){"string"!=typeof e&&console.log("The argument that you passed to removeItem() - ".concat(e," is not a string.")),localStorage.removeItem(e),localStorage.removeItem("".concat(e,"p5TypeID"))}},{"../core/main":267,"core-js/modules/es.array.from":155,"core-js/modules/es.array.iterator":158,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.string.ends-with":184,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/web.dom-collections.iterator":230}],282:[function(e,t,r){"use strict";e("core-js/modules/es.array.concat"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.string.sub"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.string.sub"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(e=e("../core/main"))&&e.__esModule?e:{default:e};n.default.prototype.createStringDict=function(e,t){return n.default._validateParameters("createStringDict",arguments),new n.default.StringDict(e,t)},n.default.prototype.createNumberDict=function(e,t){return n.default._validateParameters("createNumberDict",arguments),new n.default.NumberDict(e,t)},n.default.TypedDict=function(e,t){return e instanceof Object?this.data=e:(this.data={},this.data[e]=t),this},n.default.TypedDict.prototype.size=function(){return Object.keys(this.data).length},n.default.TypedDict.prototype.hasKey=function(e){return this.data.hasOwnProperty(e)},n.default.TypedDict.prototype.get=function(e){if(this.data.hasOwnProperty(e))return this.data[e];console.log("".concat(e," does not exist in this Dictionary"))},n.default.TypedDict.prototype.set=function(e,t){this._validate(t)?this.data[e]=t:console.log("Those values dont work for this dictionary type.")},n.default.TypedDict.prototype._addObj=function(e){for(var t in e)this.set(t,e[t])},n.default.TypedDict.prototype.create=function(e,t){e instanceof Object&&void 0===t?this._addObj(e):void 0!==e?this.set(e,t):console.log("In order to create a new Dictionary entry you must pass an object or a key, value pair")},n.default.TypedDict.prototype.clear=function(){this.data={}},n.default.TypedDict.prototype.remove=function(e){if(!this.data.hasOwnProperty(e))throw new Error("".concat(e," does not exist in this Dictionary"));delete this.data[e]},n.default.TypedDict.prototype.print=function(){for(var e in this.data)console.log("key:".concat(e," value:").concat(this.data[e]))},n.default.TypedDict.prototype.saveTable=function(e){var t,r="";for(t in this.data)r+="".concat(t,",").concat(this.data[t],"\n");var o=new Blob([r],{type:"text/csv"});n.default.prototype.downloadFile(o,e||"mycsv","csv")},n.default.TypedDict.prototype.saveJSON=function(e,t){n.default.prototype.saveJSON(this.data,e,t)},n.default.TypedDict.prototype._validate=function(e){return!0},n.default.StringDict=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];n.default.TypedDict.apply(this,t)},n.default.StringDict.prototype=Object.create(n.default.TypedDict.prototype),n.default.StringDict.prototype._validate=function(e){return"string"==typeof e},n.default.NumberDict=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];n.default.TypedDict.apply(this,t)},n.default.NumberDict.prototype=Object.create(n.default.TypedDict.prototype),n.default.NumberDict.prototype._validate=function(e){return"number"==typeof e},n.default.NumberDict.prototype.add=function(e,t){this.data.hasOwnProperty(e)?this.data[e]+=t:console.log("The key - ".concat(e," does not exist in this dictionary."))},n.default.NumberDict.prototype.sub=function(e,t){this.add(e,-t)},n.default.NumberDict.prototype.mult=function(e,t){this.data.hasOwnProperty(e)?this.data[e]*=t:console.log("The key - ".concat(e," does not exist in this dictionary."))},n.default.NumberDict.prototype.div=function(e,t){this.data.hasOwnProperty(e)?this.data[e]/=t:console.log("The key - ".concat(e," does not exist in this dictionary."))},n.default.NumberDict.prototype._valueTest=function(e){if(0===Object.keys(this.data).length)throw new Error("Unable to search for a minimum or maximum value on an empty NumberDict");if(1===Object.keys(this.data).length)return this.data[Object.keys(this.data)[0]];var t,r=this.data[Object.keys(this.data)[0]];for(t in this.data)this.data[t]*e<r*e&&(r=this.data[t]);return r},n.default.NumberDict.prototype.minValue=function(){return this._valueTest(1)},n.default.NumberDict.prototype.maxValue=function(){return this._valueTest(-1)},n.default.NumberDict.prototype._keyTest=function(e){if(0===Object.keys(this.data).length)throw new Error("Unable to use minValue on an empty NumberDict");if(1===Object.keys(this.data).length)return Object.keys(this.data)[0];for(var t=Object.keys(this.data)[0],r=1;r<Object.keys(this.data).length;r++)Object.keys(this.data)[r]*e<t*e&&(t=Object.keys(this.data)[r]);return t},n.default.NumberDict.prototype.minKey=function(){return this._keyTest(1)},n.default.NumberDict.prototype.maxKey=function(){return this._keyTest(-1)};e=n.default.TypedDict;r.default=e},{"../core/main":267,"core-js/modules/es.array.concat":149,"core-js/modules/es.object.keys":176,"core-js/modules/es.string.sub":192}],283:[function(t,r,o){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}t("core-js/modules/es.symbol"),t("core-js/modules/es.symbol.description"),t("core-js/modules/es.symbol.iterator"),t("core-js/modules/es.array.every"),t("core-js/modules/es.array.filter"),t("core-js/modules/es.array.for-each"),t("core-js/modules/es.array.from"),t("core-js/modules/es.array.index-of"),t("core-js/modules/es.array.iterator"),t("core-js/modules/es.array.map"),t("core-js/modules/es.array.slice"),t("core-js/modules/es.array.splice"),t("core-js/modules/es.function.name"),t("core-js/modules/es.object.to-string"),t("core-js/modules/es.promise"),t("core-js/modules/es.regexp.exec"),t("core-js/modules/es.regexp.to-string"),t("core-js/modules/es.string.iterator"),t("core-js/modules/es.string.replace"),t("core-js/modules/es.string.split"),t("core-js/modules/es.string.trim"),t("core-js/modules/web.dom-collections.for-each"),t("core-js/modules/web.dom-collections.iterator"),t("core-js/modules/web.url"),t("core-js/modules/es.symbol"),t("core-js/modules/es.symbol.description"),t("core-js/modules/es.symbol.iterator"),t("core-js/modules/es.array.every"),t("core-js/modules/es.array.filter"),t("core-js/modules/es.array.for-each"),t("core-js/modules/es.array.from"),t("core-js/modules/es.array.index-of"),t("core-js/modules/es.array.iterator"),t("core-js/modules/es.array.map"),t("core-js/modules/es.array.slice"),t("core-js/modules/es.array.splice"),t("core-js/modules/es.function.name"),t("core-js/modules/es.object.to-string"),t("core-js/modules/es.promise"),t("core-js/modules/es.regexp.exec"),t("core-js/modules/es.regexp.to-string"),t("core-js/modules/es.string.iterator"),t("core-js/modules/es.string.replace"),t("core-js/modules/es.string.split"),t("core-js/modules/es.string.trim"),t("core-js/modules/web.dom-collections.for-each"),t("core-js/modules/web.dom-collections.iterator"),t("core-js/modules/web.url"),Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0;var h=(t=t("../core/main"))&&t.__esModule?t:{default:t};function f(e){return(f="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}function p(e,t,r){(t._userNode||document.body).appendChild(e);r=new(r?h.default.MediaElement:h.default.Element)(e,t);return t._elements.push(r),r}function s(e,t,r,o){var n=document.createElement(t),s=("string"==typeof(r=r||"")&&(r=[r]),!0),t=!1,i=void 0;try{for(var a,l=r[Symbol.iterator]();!(s=(a=l.next()).done);s=!0){var u=a.value,c=document.createElement("source");c.setAttribute("src",u),n.appendChild(c)}}catch(e){t=!0,i=e}finally{try{s||null==l.return||l.return()}finally{if(t)throw i}}"function"==typeof o&&n.addEventListener("canplaythrough",function e(){o(),n.removeEventListener("canplaythrough",e)});var d=p(n,e,!0);return d.loadedmetadata=!1,n.addEventListener("loadedmetadata",function(){d.width=n.videoWidth,d.height=n.videoHeight,0===d.elt.width&&(d.elt.width=n.videoWidth),0===d.elt.height&&(d.elt.height=n.videoHeight),d.presetPlaybackRate&&(d.elt.playbackRate=d.presetPlaybackRate,delete d.presetPlaybackRate),d.loadedmetadata=!0}),d}h.default.prototype.select=function(e,t){h.default._validateParameters("select",arguments);t=this._getContainer(t).querySelector(e);return t?this._wrapElement(t):null},h.default.prototype.selectAll=function(e,t){h.default._validateParameters("selectAll",arguments);var r=[],o=this._getContainer(t).querySelectorAll(e);if(o)for(var n=0;n<o.length;n++){var s=this._wrapElement(o[n]);r.push(s)}return r},h.default.prototype._getContainer=function(e){var t=document;return"string"==typeof e?t=document.querySelector(e)||document:e instanceof h.default.Element?t=e.elt:e instanceof HTMLElement&&(t=e),t},h.default.prototype._wrapElement=function(e){var t,r=Array.prototype.slice.call(e.children);return"INPUT"===e.tagName&&"checkbox"===e.type?((t=new h.default.Element(e,this)).checked=function(){return 0===arguments.length?this.elt.checked:(this.elt.checked=!!arguments[0],this)},t):"VIDEO"===e.tagName||"AUDIO"===e.tagName?new h.default.MediaElement(e,this):"SELECT"===e.tagName?this.createSelect(new h.default.Element(e,this)):0<r.length&&r.every(function(e){return"INPUT"===e.tagName||"LABEL"===e.tagName})?this.createRadio(new h.default.Element(e,this)):new h.default.Element(e,this)},h.default.prototype.removeElements=function(e){h.default._validateParameters("removeElements",arguments);this._elements.filter(function(e){return!(e.elt instanceof HTMLCanvasElement)}).map(function(e){return e.remove()})},h.default.Element.prototype.changed=function(e){return h.default.Element._adjustListener("change",e,this),this},h.default.Element.prototype.input=function(e){return h.default.Element._adjustListener("input",e,this),this},h.default.prototype.createDiv=function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",t=document.createElement("div");return t.innerHTML=e,p(t,this)},h.default.prototype.createP=function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",t=document.createElement("p");return t.innerHTML=e,p(t,this)},h.default.prototype.createSpan=function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",t=document.createElement("span");return t.innerHTML=e,p(t,this)},h.default.prototype.createImg=function(){h.default._validateParameters("createImg",arguments);var t,r=document.createElement("img"),o=arguments;return 1<o.length&&"string"==typeof o[1]&&(r.alt=o[1]),2<o.length&&"string"==typeof o[2]&&(r.crossOrigin=o[2]),r.src=o[0],t=p(r,this),r.addEventListener("load",function(){t.width=r.offsetWidth||r.width,t.height=r.offsetHeight||r.height;var e=o[o.length-1];"function"==typeof e&&e(t)}),t},h.default.prototype.createA=function(e,t,r){h.default._validateParameters("createA",arguments);var o=document.createElement("a");return o.href=e,o.innerHTML=t,r&&(o.target=r),p(o,this)},h.default.prototype.createSlider=function(e,t,r,o){h.default._validateParameters("createSlider",arguments);var n=document.createElement("input");return n.type="range",n.min=e,n.max=t,0===o?n.step=1e-18:o&&(n.step=o),"number"==typeof r&&(n.value=r),p(n,this)},h.default.prototype.createButton=function(e,t){h.default._validateParameters("createButton",arguments);var r=document.createElement("button");return r.innerHTML=e,t&&(r.value=t),p(r,this)},h.default.prototype.createCheckbox=function(){h.default._validateParameters("createCheckbox",arguments);var e=document.createElement("div"),t=document.createElement("input"),r=(t.type="checkbox",document.createElement("label")),o=(r.appendChild(t),e.appendChild(r),p(e,this));return o.checked=function(){var e=o.elt.firstElementChild.getElementsByTagName("input")[0];if(e){if(0===arguments.length)return e.checked;e.checked=!!arguments[0]}return o},this.value=function(e){return o.value=e,this},arguments[0]&&(o.value(arguments[0]),(e=document.createElement("span")).innerHTML=arguments[0],r.appendChild(e)),arguments[1]&&(t.checked=!0),o},h.default.prototype.createSelect=function(){h.default._validateParameters("createSelect",arguments);var e,t,r=arguments[0];return r instanceof h.default.Element&&r.elt instanceof HTMLSelectElement?this.elt=(e=r).elt:r instanceof HTMLSelectElement?(e=p(r,this),this.elt=r):(t=document.createElement("select"),r&&"boolean"==typeof r&&t.setAttribute("multiple","true"),e=p(t,this),this.elt=t),e.option=function(e,t){var r;if(void 0!==e){for(var o,n=0;n<this.elt.length;n+=1)if(this.elt[n].textContent===e){r=n;break}void 0!==r?!1===t?this.elt.remove(r):this.elt[r].value=t:((o=document.createElement("option")).textContent=e,o.value=void 0===t?e:t,this.elt.appendChild(o),this._pInst._elements.push(o))}},e.selected=function(e){if(void 0!==e){for(var t=0;t<this.elt.length;t+=1)this.elt[t].value.toString()===e.toString()&&(this.elt.selectedIndex=t);return this}if(this.elt.getAttribute("multiple")){var r=[],o=!0,n=!1,s=void 0;try{for(var i,a=this.elt.selectedOptions[Symbol.iterator]();!(o=(i=a.next()).done);o=!0){var l=i.value;r.push(l.value)}}catch(e){n=!0,s=e}finally{try{o||null==a.return||a.return()}finally{if(n)throw s}}return r}return this.elt.value},e.disable=function(e){if("string"==typeof e)for(var t=0;t<this.elt.length;t++)this.elt[t].value.toString()===e&&(this.elt[t].disabled=!0,this.elt[t].selected=!1);else this.elt.disabled=!0;return this},e},h.default.prototype.createRadio=function(){function t(e){return e instanceof HTMLInputElement&&"radio"===e.type}function d(e){return e instanceof HTMLLabelElement}var f,e,r,o=arguments[0];o instanceof h.default.Element&&(o.elt instanceof HTMLDivElement||o.elt instanceof HTMLSpanElement)?(f=o,this.elt=o.elt):o instanceof HTMLDivElement||o instanceof HTMLSpanElement?(f=p(o,this),e=this.elt=o,"string"==typeof arguments[1]&&(r=arguments[1])):("string"==typeof o&&(r=o),e=document.createElement("div"),f=p(e,this),this.elt=e),f._name=r||"radioOption";return f._getOptionsArray=function(){return Array.from(this.elt.children).filter(function(e){return t(e)||d(e)&&t(e.firstElementChild)}).map(function(e){return t(e)?e:e.firstElementChild})},f.option=function(e,t){var r,o,n,s=!0,i=!1,a=void 0;try{for(var l,u=f._getOptionsArray()[Symbol.iterator]();!(s=(l=u.next()).done);s=!0){var c=l.value;if(c.value===e){r=c;break}}}catch(e){i=!0,a=e}finally{try{s||null==u.return||u.return()}finally{if(i)throw a}}return void 0===r&&((r=document.createElement("input")).setAttribute("type","radio"),r.setAttribute("value",e)),r.setAttribute("name",f._name),d(r.parentElement)?o=r.parentElement:(o=document.createElement("label")).insertAdjacentElement("afterbegin",r),o.lastElementChild instanceof HTMLSpanElement?n=o.lastElementChild:(n=document.createElement("span"),r.insertAdjacentElement("afterend",n)),n.innerHTML=void 0===t?e:t,this.elt.appendChild(o),r},f.remove=function(e){var t=!0,r=!1,o=void 0;try{for(var n,s=f._getOptionsArray()[Symbol.iterator]();!(t=(n=s.next()).done);t=!0){var i=n.value;if(i.value===e)return void(d(i.parentElement)?i.parentElement:i).remove()}}catch(e){r=!0,o=e}finally{try{t||null==s.return||s.return()}finally{if(r)throw o}}},f.value=function(){var e="",t=!0,r=!1,o=void 0;try{for(var n,s=f._getOptionsArray()[Symbol.iterator]();!(t=(n=s.next()).done);t=!0){var i=n.value;if(i.checked){e=i.value;break}}}catch(e){r=!0,o=e}finally{try{t||null==s.return||s.return()}finally{if(r)throw o}}return e},f.selected=function(e){var t=null;if(void 0===e){var r=!0,o=!1,n=void 0;try{for(var s,i=f._getOptionsArray()[Symbol.iterator]();!(r=(s=i.next()).done);r=!0){var a=s.value;if(a.checked){t=a;break}}}catch(e){o=!0,n=e}finally{try{r||null==i.return||i.return()}finally{if(o)throw n}}}else{f._getOptionsArray().forEach(function(e){e.checked=!1,e.removeAttribute("checked")});var l=!0,o=!1,n=void 0;try{for(var u,c=f._getOptionsArray()[Symbol.iterator]();!(l=(u=c.next()).done);l=!0){var d=u.value;d.value===e&&(d.setAttribute("checked",!0),d.checked=!0,t=d)}}catch(e){o=!0,n=e}finally{try{l||null==c.return||c.return()}finally{if(o)throw n}}}return t},f.disable=function(){var e=!(0<arguments.length&&void 0!==arguments[0])||arguments[0],t=!0,r=!1,o=void 0;try{for(var n,s=f._getOptionsArray()[Symbol.iterator]();!(t=(n=s.next()).done);t=!0)n.value.setAttribute("disabled",e)}catch(e){r=!0,o=e}finally{try{t||null==s.return||s.return()}finally{if(r)throw o}}},f},h.default.prototype.createColorPicker=function(e){h.default._validateParameters("createColorPicker",arguments);var t=document.createElement("input");return t.type="color",e?e instanceof h.default.Color?t.value=e.toString("#rrggbb"):(h.default.prototype._colorMode="rgb",h.default.prototype._colorMaxes={rgb:[255,255,255,255],hsb:[360,100,100,1],hsl:[360,100,100,1]},t.value=h.default.prototype.color(e).toString("#rrggbb")):t.value="#000000",(t=p(t,this)).color=function(){return e&&(e.mode&&(h.default.prototype._colorMode=e.mode),e.maxes&&(h.default.prototype._colorMaxes=e.maxes)),h.default.prototype.color(this.elt.value)},t},h.default.prototype.createInput=function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"text",r=(h.default._validateParameters("createInput",arguments),document.createElement("input"));return r.setAttribute("value",e),r.setAttribute("type",t),p(r,this)},h.default.prototype.createFileInput=function(a){var e,t=1<arguments.length&&void 0!==arguments[1]&&arguments[1];h.default._validateParameters("createFileInput",arguments);if(window.File&&window.FileReader&&window.FileList&&window.Blob)return(e=document.createElement("input")).setAttribute("type","file"),t&&e.setAttribute("multiple",!0),e.addEventListener("change",function(e){var t=!0,r=!1,o=void 0;try{for(var n,s=e.target.files[Symbol.iterator]();!(t=(n=s.next()).done);t=!0){var i=n.value;h.default.File._load(i,a)}}catch(e){r=!0,o=e}finally{try{t||null==s.return||s.return()}finally{if(r)throw o}}},!1),p(e,this);console.log("The File APIs are not fully supported in this browser. Cannot create element.")},h.default.prototype.createVideo=function(e,t){return h.default._validateParameters("createVideo",arguments),s(this,"video",e,t)},h.default.prototype.createAudio=function(e,t){return h.default._validateParameters("createAudio",arguments),s(this,"audio",e,t)},h.default.prototype.VIDEO="video",h.default.prototype.AUDIO="audio",void 0===navigator.mediaDevices&&(navigator.mediaDevices={}),void 0===navigator.mediaDevices.getUserMedia&&(navigator.mediaDevices.getUserMedia=function(r){var o=navigator.webkitGetUserMedia||navigator.mozGetUserMedia;return o?new Promise(function(e,t){o.call(navigator,r,e,t)}):Promise.reject(new Error("getUserMedia is not implemented in this browser"))}),h.default.prototype.createCapture=function(){if(h.default._validateParameters("createCapture",arguments),!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia)throw new DOMException("getUserMedia not supported in this browser");var e,t=!0,r=!0,o=!0,n=!1,s=void 0;try{for(var i,a=arguments[Symbol.iterator]();!(o=(i=a.next()).done);o=!0){var l=i.value;l===h.default.prototype.VIDEO?r=!1:l===h.default.prototype.AUDIO?t=!1:"object"===f(l)?u=l:"function"==typeof l&&(e=l)}}catch(e){n=!0,s=e}finally{try{o||null==a.return||a.return()}finally{if(n)throw s}}var u=u||{video:t,audio:r},c=document.createElement("video"),d=(c.setAttribute("playsinline",""),navigator.mediaDevices.getUserMedia(u).then(function(t){try{"srcObject"in c?c.srcObject=t:c.src=window.URL.createObjectURL(t)}catch(e){c.src=t}},console.log),p(c,this,!0));return d.loadedmetadata=!1,c.addEventListener("loadedmetadata",function(){c.play(),c.width?(d.width=c.width,d.height=c.height):(d.width=d.elt.width=c.videoWidth,d.height=d.elt.height=c.videoHeight),d.loadedmetadata=!0,e&&e(c.srcObject)}),d},h.default.prototype.createElement=function(e,t){h.default._validateParameters("createElement",arguments);e=document.createElement(e);return void 0!==t&&(e.innerHTML=t),p(e,this)},h.default.Element.prototype.addClass=function(e){return this.elt.className?this.hasClass(e)||(this.elt.className=this.elt.className+" "+e):this.elt.className=e,this},h.default.Element.prototype.removeClass=function(e){return this.elt.classList.remove(e),this},h.default.Element.prototype.hasClass=function(e){return this.elt.classList.contains(e)},h.default.Element.prototype.toggleClass=function(e){return this.elt.classList.contains(e)?this.elt.classList.remove(e):this.elt.classList.add(e),this},h.default.Element.prototype.child=function(e){return void 0===e?this.elt.childNodes:("string"==typeof e?("#"===e[0]&&(e=e.substring(1)),e=document.getElementById(e)):e instanceof h.default.Element&&(e=e.elt),e instanceof HTMLElement&&this.elt.appendChild(e),this)},h.default.Element.prototype.center=function(e){var t=this.elt.style.display,r="none"===this.elt.style.display,o="none"===this.parent().style.display,n={x:this.elt.offsetLeft,y:this.elt.offsetTop},s=(r&&this.show(),o&&this.parent().show(),this.elt.style.display="block",this.position(0,0),Math.abs(this.parent().offsetWidth-this.elt.offsetWidth)),i=Math.abs(this.parent().offsetHeight-this.elt.offsetHeight);return"both"===e||void 0===e?this.position(s/2+this.parent().offsetLeft,i/2+this.parent().offsetTop):"horizontal"===e?this.position(s/2+this.parent().offsetLeft,n.y):"vertical"===e&&this.position(n.x,i/2+this.parent().offsetTop),this.style("display",t),r&&this.hide(),o&&this.parent().hide(),this},h.default.Element.prototype.html=function(){return 0===arguments.length?this.elt.innerHTML:(arguments[1]?this.elt.insertAdjacentHTML("beforeend",arguments[0]):this.elt.innerHTML=arguments[0],this)},h.default.Element.prototype.position=function(){return 0===arguments.length?{x:this.elt.offsetLeft,y:this.elt.offsetTop}:(this.elt.style.position="static"!==arguments[2]&&"fixed"!==arguments[2]&&"relative"!==arguments[2]&&"sticky"!==arguments[2]&&"initial"!==arguments[2]&&"inherit"!==arguments[2]?"absolute":arguments[2],this.elt.style.left=arguments[0]+"px",this.elt.style.top=arguments[1]+"px",this.x=arguments[0],this.y=arguments[1],this)},h.default.Element.prototype._translate=function(){this.elt.style.position="absolute";var e="";return this.elt.style.transform&&(e=(e=this.elt.style.transform.replace(/translate3d\(.*\)/g,"")).replace(/translate[X-Z]?\(.*\)/g,"")),2===arguments.length?this.elt.style.transform="translate("+arguments[0]+"px, "+arguments[1]+"px)":2<arguments.length&&(this.elt.style.transform="translate3d("+arguments[0]+"px,"+arguments[1]+"px,"+arguments[2]+"px)",this.elt.parentElement.style.perspective=3===arguments.length?"1000px":arguments[3]+"px"),this.elt.style.transform+=e,this},h.default.Element.prototype._rotate=function(){var e="";return this.elt.style.transform&&(e=(e=this.elt.style.transform.replace(/rotate3d\(.*\)/g,"")).replace(/rotate[X-Z]?\(.*\)/g,"")),1===arguments.length?this.elt.style.transform="rotate("+arguments[0]+"deg)":2===arguments.length?this.elt.style.transform="rotate("+arguments[0]+"deg, "+arguments[1]+"deg)":3===arguments.length&&(this.elt.style.transform="rotateX("+arguments[0]+"deg)",this.elt.style.transform+="rotateY("+arguments[1]+"deg)",this.elt.style.transform+="rotateZ("+arguments[2]+"deg)"),this.elt.style.transform+=e,this},h.default.Element.prototype.style=function(e,t){if(void 0===(t=t instanceof h.default.Color?"rgba("+t.levels[0]+","+t.levels[1]+","+t.levels[2]+","+t.levels[3]/255+")":t)){if(-1===e.indexOf(":"))return window.getComputedStyle(this.elt).getPropertyValue(e);for(var r=e.split(";"),o=0;o<r.length;o++){var n=r[o].split(":");n[0]&&n[1]&&(this.elt.style[n[0].trim()]=n[1].trim())}}else this.elt.style[e]=t,"width"!==e&&"height"!==e&&"left"!==e&&"top"!==e||(t=window.getComputedStyle(this.elt).getPropertyValue(e).replace(/[^\d.]/g,""),this[e]=Math.round(parseFloat(t,10)));return this},h.default.Element.prototype.attribute=function(e,t){if(null==this.elt.firstChild||"checkbox"!==this.elt.firstChild.type&&"radio"!==this.elt.firstChild.type)return void 0===t?this.elt.getAttribute(e):(this.elt.setAttribute(e,t),this);if(void 0===t)return this.elt.firstChild.getAttribute(e);for(var r=0;r<this.elt.childNodes.length;r++)this.elt.childNodes[r].setAttribute(e,t)},h.default.Element.prototype.removeAttribute=function(e){if(null!=this.elt.firstChild&&("checkbox"===this.elt.firstChild.type||"radio"===this.elt.firstChild.type))for(var t=0;t<this.elt.childNodes.length;t++)this.elt.childNodes[t].removeAttribute(e);return this.elt.removeAttribute(e),this},h.default.Element.prototype.value=function(){return 0<arguments.length?(this.elt.value=arguments[0],this):"range"===this.elt.type?parseFloat(this.elt.value):this.elt.value},h.default.Element.prototype.show=function(){return this.elt.style.display="block",this},h.default.Element.prototype.hide=function(){return this.elt.style.display="none",this},h.default.Element.prototype.size=function(e,t){if(0===arguments.length)return{width:this.elt.offsetWidth,height:this.elt.offsetHeight};var r=e,o=t,n=h.default.prototype.AUTO;if(r!==n||o!==n){if(r===n?r=t*this.width/this.height:o===n&&(o=e*this.height/this.width),this.elt instanceof HTMLCanvasElement){var s,i={},a=this.elt.getContext("2d");for(s in a)i[s]=a[s];for(s in this.elt.setAttribute("width",r*this._pInst._pixelDensity),this.elt.setAttribute("height",o*this._pInst._pixelDensity),this.elt.style.width=r+"px",this.elt.style.height=o+"px",this._pInst.scale(this._pInst._pixelDensity,this._pInst._pixelDensity),i)this.elt.getContext("2d")[s]=i[s]}else this.elt.style.width=r+"px",this.elt.style.height=o+"px",this.elt.width=r,this.elt.height=o;this.width=this.elt.offsetWidth,this.height=this.elt.offsetHeight,this._pInst&&this._pInst._curElement&&this._pInst._curElement.elt===this.elt&&(this._pInst._setProperty("width",this.elt.offsetWidth),this._pInst._setProperty("height",this.elt.offsetHeight))}return this},h.default.Element.prototype.remove=function(){this instanceof h.default.MediaElement&&(this.stop(),null!==(t=this.elt.srcObject)&&t.getTracks().forEach(function(e){e.stop()}));var e,t=this._pInst._elements.indexOf(this);for(e in-1!==t&&this._pInst._elements.splice(t,1),this._events)this.elt.removeEventListener(e,this._events[e]);this.elt&&this.elt.parentNode&&this.elt.parentNode.removeChild(this.elt)},h.default.Element.prototype.drop=function(n,s){var e;return window.File&&window.FileReader&&window.FileList&&window.Blob?(this._dragDisabled||(this._dragDisabled=!0,this.elt.addEventListener("dragover",e=function(e){e.preventDefault()}),this.elt.addEventListener("dragleave",e)),h.default.Element._attachListener("drop",function(e){e.preventDefault(),"function"==typeof s&&s.call(this,e);for(var t=e.dataTransfer.files,r=0;r<t.length;r++){var o=t[r];h.default.File._load(o,n)}},this)):console.log("The File APIs are not fully supported in this browser."),this},h.default.MediaElement=function(o,e){h.default.Element.call(this,o,e);var n=this;this.elt.crossOrigin="anonymous",this._prevTime=0,this._cueIDCounter=0,this._cues=[],(this._pixelsState=this)._pixelDensity=1,this._modified=!1,Object.defineProperty(n,"src",{get:function(){var e=n.elt.children[0].src,t=n.elt.src===window.location.href?"":n.elt.src;return e===window.location.href?t:e},set:function(e){for(var t=0;t<n.elt.children.length;t++)n.elt.removeChild(n.elt.children[t]);var r=document.createElement("source");r.src=e,o.appendChild(r),n.elt.src=e,n.modified=!0}}),n._onended=function(){},n.elt.onended=function(){n._onended(n)}},h.default.MediaElement.prototype=Object.create(h.default.Element.prototype),h.default.MediaElement.prototype.play=function(){var e;return this.elt.currentTime===this.elt.duration&&(this.elt.currentTime=0),1<this.elt.readyState||this.elt.load(),(e=this.elt.play())&&e.catch&&e.catch(function(e){"NotAllowedError"===e.name?console.error(e):console.error("Media play method encountered an unexpected error",e)}),this},h.default.MediaElement.prototype.stop=function(){return this.elt.pause(),this.elt.currentTime=0,this},h.default.MediaElement.prototype.pause=function(){return this.elt.pause(),this},h.default.MediaElement.prototype.loop=function(){return this.elt.setAttribute("loop",!0),this.play(),this},h.default.MediaElement.prototype.noLoop=function(){return this.elt.removeAttribute("loop"),this},h.default.MediaElement.prototype._setupAutoplayFailDetection=function(){var t=setTimeout(function(){console.error(e)},500);this.elt.addEventListener("play",function(){return clearTimeout(t)},{passive:!0,once:!0})},h.default.MediaElement.prototype.autoplay=function(e){var t=this,r=this.elt.getAttribute("autoplay");return this.elt.setAttribute("autoplay",e),e&&!r&&(e=function(){return t._setupAutoplayFailDetection()},4===this.elt.readyState?e():this.elt.addEventListener("canplay",e,{passive:!0,once:!0})),this},h.default.MediaElement.prototype.volume=function(e){if(void 0===e)return this.elt.volume;this.elt.volume=e},h.default.MediaElement.prototype.speed=function(e){if(void 0===e)return this.presetPlaybackRate||this.elt.playbackRate;this.loadedmetadata?this.elt.playbackRate=e:this.presetPlaybackRate=e},h.default.MediaElement.prototype.time=function(e){return void 0===e?this.elt.currentTime:(this.elt.currentTime=e,this)},h.default.MediaElement.prototype.duration=function(){return this.elt.duration},h.default.MediaElement.prototype.pixels=[],h.default.MediaElement.prototype._ensureCanvas=function(){this.canvas||(this.canvas=document.createElement("canvas"),this.drawingContext=this.canvas.getContext("2d"),this.setModified(!0)),this.loadedmetadata&&(this.canvas.width!==this.elt.width&&(this.canvas.width=this.elt.width,this.canvas.height=this.elt.height,this.width=this.canvas.width,this.height=this.canvas.height),this.drawingContext.drawImage(this.elt,0,0,this.canvas.width,this.canvas.height),this.setModified(!0))},h.default.MediaElement.prototype.loadPixels=function(){return this._ensureCanvas(),h.default.Renderer2D.prototype.loadPixels.apply(this,arguments)},h.default.MediaElement.prototype.updatePixels=function(e,t,r,o){return this.loadedmetadata&&(this._ensureCanvas(),h.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,o)),this.setModified(!0),this},h.default.MediaElement.prototype.get=function(){return this._ensureCanvas(),h.default.Renderer2D.prototype.get.apply(this,arguments)},h.default.MediaElement.prototype._getPixel=function(){return this.loadPixels(),h.default.Renderer2D.prototype._getPixel.apply(this,arguments)},h.default.MediaElement.prototype.set=function(e,t,r){this.loadedmetadata&&(this._ensureCanvas(),h.default.Renderer2D.prototype.set.call(this,e,t,r),this.setModified(!0))},h.default.MediaElement.prototype.copy=function(){this._ensureCanvas(),h.default.prototype.copy.apply(this,arguments)},h.default.MediaElement.prototype.mask=function(){this.loadPixels(),this.setModified(!0),h.default.Image.prototype.mask.apply(this,arguments)},h.default.MediaElement.prototype.isModified=function(){return this._modified},h.default.MediaElement.prototype.setModified=function(e){this._modified=e},h.default.MediaElement.prototype.onended=function(e){return this._onended=e,this},h.default.MediaElement.prototype.connect=function(e){var t,r;if("function"==typeof h.default.prototype.getAudioContext)t=h.default.prototype.getAudioContext(),r=h.default.soundOut.input;else try{r=(t=e.context).destination}catch(e){throw"connect() is meant to be used with Web Audio API or p5.sound.js"}this.audioSourceNode||(this.audioSourceNode=t.createMediaElementSource(this.elt),this.audioSourceNode.connect(r)),e?e.input?this.audioSourceNode.connect(e.input):this.audioSourceNode.connect(e):this.audioSourceNode.connect(r)},h.default.MediaElement.prototype.disconnect=function(){if(!this.audioSourceNode)throw"nothing to disconnect";this.audioSourceNode.disconnect()},h.default.MediaElement.prototype.showControls=function(){this.elt.style["text-align"]="inherit",this.elt.controls=!0},h.default.MediaElement.prototype.hideControls=function(){this.elt.controls=!1};function i(e,t,r,o){this.callback=e,this.time=t,this.id=r,this.val=o}h.default.MediaElement.prototype.addCue=function(e,t,r){var o=this._cueIDCounter++,t=new i(t,e,o,r);return this._cues.push(t),this.elt.ontimeupdate||(this.elt.ontimeupdate=this._onTimeUpdate.bind(this)),o},h.default.MediaElement.prototype.removeCue=function(e){for(var t=0;t<this._cues.length;t++)this._cues[t].id===e&&(console.log(e),this._cues.splice(t,1));0===this._cues.length&&(this.elt.ontimeupdate=null)},h.default.MediaElement.prototype.clearCues=function(){this._cues=[],this.elt.ontimeupdate=null},h.default.MediaElement.prototype._onTimeUpdate=function(){for(var e=this.time(),t=0;t<this._cues.length;t++){var r=this._cues[t].time,o=this._cues[t].val;this._prevTime<r&&r<=e&&this._cues[t].callback(o)}this._prevTime=e},h.default.File=function(e,t){this.file=e,this._pInst=t;t=e.type.split("/");this.type=t[0],this.subtype=t[1],this.name=e.name,this.size=e.size,this.data=void 0},h.default.File._createLoader=function(o,n){var e=new FileReader;return e.onload=function(e){var t,r=new h.default.File(o);"application/json"===r.file.type?r.data=JSON.parse(e.target.result):"text/xml"===r.file.type?(t=(new DOMParser).parseFromString(e.target.result,"text/xml"),r.data=new h.default.XML(t.documentElement)):r.data=e.target.result,n(r)},e},h.default.File._load=function(e,t){var r;/^text\//.test(e.type)||"application/json"===e.type?h.default.File._createLoader(e,t).readAsText(e):/^(video|audio)\//.test(e.type)?((r=new h.default.File(e)).data=URL.createObjectURL(e),t(r)):h.default.File._createLoader(e,t).readAsDataURL(e)};t=h.default;o.default=t},{"../core/main":267,"core-js/modules/es.array.every":151,"core-js/modules/es.array.filter":153,"core-js/modules/es.array.for-each":154,"core-js/modules/es.array.from":155,"core-js/modules/es.array.index-of":157,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.map":161,"core-js/modules/es.array.slice":162,"core-js/modules/es.array.splice":164,"core-js/modules/es.function.name":165,"core-js/modules/es.object.to-string":177,"core-js/modules/es.promise":178,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.string.iterator":186,"core-js/modules/es.string.replace":189,"core-js/modules/es.string.split":191,"core-js/modules/es.string.trim":193,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/web.dom-collections.for-each":229,"core-js/modules/web.dom-collections.iterator":230,"core-js/modules/web.url":232}],284:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(y=e("../core/main"))&&y.__esModule?y:{default:y},s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}n.default.prototype.deviceOrientation=1<window.innerWidth/window.innerHeight?"landscape":"portrait",n.default.prototype.accelerationX=0,n.default.prototype.accelerationY=0,n.default.prototype.accelerationZ=0,n.default.prototype.pAccelerationX=0,n.default.prototype.pAccelerationY=0,n.default.prototype.pAccelerationZ=0,n.default.prototype._updatePAccelerations=function(){this._setProperty("pAccelerationX",this.accelerationX),this._setProperty("pAccelerationY",this.accelerationY),this._setProperty("pAccelerationZ",this.accelerationZ)},n.default.prototype.rotationX=0,n.default.prototype.rotationY=0,n.default.prototype.rotationZ=0,n.default.prototype.pRotationX=0,n.default.prototype.pRotationY=0;var l=n.default.prototype.pRotationZ=0,u=0,c=0,d="clockwise",f="clockwise",h="clockwise",p=(n.default.prototype.pRotateDirectionX=void 0,n.default.prototype.pRotateDirectionY=void 0,n.default.prototype.pRotateDirectionZ=void 0,n.default.prototype._updatePRotations=function(){this._setProperty("pRotationX",this.rotationX),this._setProperty("pRotationY",this.rotationY),this._setProperty("pRotationZ",this.rotationZ)},n.default.prototype.turnAxis=void 0,.5),m=30,y=(n.default.prototype.setMoveThreshold=function(e){n.default._validateParameters("setMoveThreshold",arguments),p=e},n.default.prototype.setShakeThreshold=function(e){n.default._validateParameters("setShakeThreshold",arguments),m=e},n.default.prototype._ondeviceorientation=function(e){this._updatePRotations(),this._angleMode===s.radians&&(e.beta=e.beta*(_PI/180),e.gamma=e.gamma*(_PI/180),e.alpha=e.alpha*(_PI/180)),this._setProperty("rotationX",e.beta),this._setProperty("rotationY",e.gamma),this._setProperty("rotationZ",e.alpha),this._handleMotion()},n.default.prototype._ondevicemotion=function(e){this._updatePAccelerations(),this._setProperty("accelerationX",2*e.acceleration.x),this._setProperty("accelerationY",2*e.acceleration.y),this._setProperty("accelerationZ",2*e.acceleration.z),this._handleMotion()},n.default.prototype._handleMotion=function(){90===window.orientation||-90===window.orientation?this._setProperty("deviceOrientation","landscape"):0===window.orientation?this._setProperty("deviceOrientation","portrait"):void 0===window.orientation&&this._setProperty("deviceOrientation","undefined");var e,t,r,o,n,s=this._isGlobal?window:this;"function"==typeof s.deviceMoved&&(Math.abs(this.accelerationX-this.pAccelerationX)>p||Math.abs(this.accelerationY-this.pAccelerationY)>p||Math.abs(this.accelerationZ-this.pAccelerationZ)>p)&&s.deviceMoved(),"function"==typeof s.deviceTurned&&(t=this.rotationX+180,e=this.pRotationX+180,r=l+180,0<t-e&&t-e<270||t-e<-270?d="clockwise":(t-e<0||270<t-e)&&(d="counter-clockwise"),d!==this.pRotateDirectionX&&(r=t),90<Math.abs(t-r)&&Math.abs(t-r)<270&&(r=t,this._setProperty("turnAxis","X"),s.deviceTurned()),this.pRotateDirectionX=d,l=r-180,e=this.rotationY+180,t=this.pRotationY+180,r=u+180,0<e-t&&e-t<270||e-t<-270?f="clockwise":(e-t<0||270<e-this.pRotationY)&&(f="counter-clockwise"),f!==this.pRotateDirectionY&&(r=e),90<Math.abs(e-r)&&Math.abs(e-r)<270&&(r=e,this._setProperty("turnAxis","Y"),s.deviceTurned()),this.pRotateDirectionY=f,u=r-180,0<this.rotationZ-this.pRotationZ&&this.rotationZ-this.pRotationZ<270||this.rotationZ-this.pRotationZ<-270?h="clockwise":(this.rotationZ-this.pRotationZ<0||270<this.rotationZ-this.pRotationZ)&&(h="counter-clockwise"),h!==this.pRotateDirectionZ&&(c=this.rotationZ),90<Math.abs(this.rotationZ-c)&&Math.abs(this.rotationZ-c)<270&&(c=this.rotationZ,this._setProperty("turnAxis","Z"),s.deviceTurned()),this.pRotateDirectionZ=h,this._setProperty("turnAxis",void 0)),"function"==typeof s.deviceShaken&&(null!==this.pAccelerationX&&(o=Math.abs(this.accelerationX-this.pAccelerationX),n=Math.abs(this.accelerationY-this.pAccelerationY)),m<o+n&&s.deviceShaken())},n.default);r.default=y},{"../core/constants":256,"../core/main":267,"core-js/modules/es.array.iterator":158,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],285:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(e=e("../core/main"))&&e.__esModule?e:{default:e};o.default.prototype.isKeyPressed=!1,o.default.prototype.keyIsPressed=!1,o.default.prototype.key="",o.default.prototype.keyCode=0,o.default.prototype._onkeydown=function(e){var t;this._downKeys[e.which]||(this._setProperty("isKeyPressed",!0),this._setProperty("keyIsPressed",!0),this._setProperty("keyCode",e.which),this._downKeys[e.which]=!0,this._setProperty("key",e.key||String.fromCharCode(e.which)||e.which),"function"!=typeof(t=this._isGlobal?window:this).keyPressed||e.charCode||!1===t.keyPressed(e)&&e.preventDefault())},o.default.prototype._onkeyup=function(e){this._downKeys[e.which]=!1,this._areDownKeys()||(this._setProperty("isKeyPressed",!1),this._setProperty("keyIsPressed",!1)),this._setProperty("_lastKeyCodeTyped",null),this._setProperty("key",e.key||String.fromCharCode(e.which)||e.which),this._setProperty("keyCode",e.which);var t=this._isGlobal?window:this;"function"==typeof t.keyReleased&&!1===t.keyReleased(e)&&e.preventDefault()},o.default.prototype._onkeypress=function(e){var t;e.which!==this._lastKeyCodeTyped&&(this._setProperty("_lastKeyCodeTyped",e.which),this._setProperty("key",e.key||String.fromCharCode(e.which)||e.which),"function"==typeof(t=this._isGlobal?window:this).keyTyped&&!1===t.keyTyped(e)&&e.preventDefault())},o.default.prototype._onblur=function(e){this._downKeys={}},o.default.prototype.keyIsDown=function(e){return o.default._validateParameters("keyIsDown",arguments),this._downKeys[e]||!1},o.default.prototype._areDownKeys=function(){for(var e in this._downKeys)if(this._downKeys.hasOwnProperty(e)&&!0===this._downKeys[e])return!0;return!1};e=o.default;r.default=e},{"../core/main":267}],286:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.string.includes"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(n=e("../core/main"))&&n.__esModule?n:{default:n},s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}n.default.prototype.movedX=0,n.default.prototype.movedY=0,n.default.prototype._hasMouseInteracted=!1,n.default.prototype.mouseX=0,n.default.prototype.mouseY=0,n.default.prototype.pmouseX=0,n.default.prototype.pmouseY=0,n.default.prototype.winMouseX=0,n.default.prototype.winMouseY=0,n.default.prototype.pwinMouseX=0,n.default.prototype.pwinMouseY=0,n.default.prototype.mouseButton=0,n.default.prototype.mouseIsPressed=!1,n.default.prototype._updateNextMouseCoords=function(e){var t,r,o,n,s;null!==this._curElement&&(!e.touches||0<e.touches.length)&&(t=this._curElement.elt,r=this.width,o=this.height,(n=e)&&!n.clientX&&(n.touches?n=n.touches[0]:n.changedTouches&&(n=n.changedTouches[0])),s=t.getBoundingClientRect(),r=t.scrollWidth/r||1,t=t.scrollHeight/o||1,o={x:(n.clientX-s.left)/r,y:(n.clientY-s.top)/t,winX:n.clientX,winY:n.clientY,id:n.identifier},this._setProperty("movedX",e.movementX),this._setProperty("movedY",e.movementY),this._setProperty("mouseX",o.x),this._setProperty("mouseY",o.y),this._setProperty("winMouseX",o.winX),this._setProperty("winMouseY",o.winY)),this._hasMouseInteracted||(this._updateMouseCoords(),this._setProperty("_hasMouseInteracted",!0))},n.default.prototype._updateMouseCoords=function(){this._setProperty("pmouseX",this.mouseX),this._setProperty("pmouseY",this.mouseY),this._setProperty("pwinMouseX",this.winMouseX),this._setProperty("pwinMouseY",this.winMouseY),this._setProperty("_pmouseWheelDeltaY",this._mouseWheelDeltaY)},n.default.prototype._setMouseButton=function(e){1===e.button?this._setProperty("mouseButton",s.CENTER):2===e.button?this._setProperty("mouseButton",s.RIGHT):this._setProperty("mouseButton",s.LEFT)},n.default.prototype._onmousemove=function(e){var t=this._isGlobal?window:this;this._updateNextMouseCoords(e),this.mouseIsPressed?"function"==typeof t.mouseDragged?!1===t.mouseDragged(e)&&e.preventDefault():"function"==typeof t.touchMoved&&!1===t.touchMoved(e)&&e.preventDefault():"function"==typeof t.mouseMoved&&!1===t.mouseMoved(e)&&e.preventDefault()},n.default.prototype._onmousedown=function(e){var t=this._isGlobal?window:this;this._setProperty("mouseIsPressed",!0),this._setMouseButton(e),this._updateNextMouseCoords(e),"function"==typeof t.mousePressed?!1===t.mousePressed(e)&&e.preventDefault():navigator.userAgent.toLowerCase().includes("safari")&&"function"==typeof t.touchStarted&&!1===t.touchStarted(e)&&e.preventDefault()},n.default.prototype._onmouseup=function(e){var t=this._isGlobal?window:this;this._setProperty("mouseIsPressed",!1),"function"==typeof t.mouseReleased?!1===t.mouseReleased(e)&&e.preventDefault():"function"==typeof t.touchEnded&&!1===t.touchEnded(e)&&e.preventDefault()},n.default.prototype._ondragend=n.default.prototype._onmouseup,n.default.prototype._ondragover=n.default.prototype._onmousemove,n.default.prototype._onclick=function(e){var t=this._isGlobal?window:this;"function"==typeof t.mouseClicked&&!1===t.mouseClicked(e)&&e.preventDefault()},n.default.prototype._ondblclick=function(e){var t=this._isGlobal?window:this;"function"==typeof t.doubleClicked&&!1===t.doubleClicked(e)&&e.preventDefault()},n.default.prototype._mouseWheelDeltaY=0,n.default.prototype._pmouseWheelDeltaY=0,n.default.prototype._onwheel=function(e){var t=this._isGlobal?window:this;this._setProperty("_mouseWheelDeltaY",e.deltaY),"function"==typeof t.mouseWheel&&(e.delta=e.deltaY,!1===t.mouseWheel(e)&&e.preventDefault())},n.default.prototype.requestPointerLock=function(){var e=this._curElement.elt;return e.requestPointerLock=e.requestPointerLock||e.mozRequestPointerLock,e.requestPointerLock?(e.requestPointerLock(),!0):(console.log("requestPointerLock is not implemented in this browser"),!1)},n.default.prototype.exitPointerLock=function(){document.exitPointerLock()};e=n.default;r.default=e},{"../core/constants":256,"../core/main":267,"core-js/modules/es.array.includes":156,"core-js/modules/es.array.iterator":158,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.includes":185,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],287:[function(e,t,r){"use strict";e("core-js/modules/es.array.includes"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.string.includes"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;e=(e=e("../core/main"))&&e.__esModule?e:{default:e};e.default.prototype.touches=[],e.default.prototype._updateTouchCoords=function(e){if(null!==this._curElement){for(var t=[],r=0;r<e.touches.length;r++)t[r]=function(e,t,r,o){var n=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0,s=e.getBoundingClientRect(),t=e.scrollWidth/t||1,e=e.scrollHeight/r||1,r=o.touches[n]||o.changedTouches[n];return{x:(r.clientX-s.left)/t,y:(r.clientY-s.top)/e,winX:r.clientX,winY:r.clientY,id:r.identifier}}(this._curElement.elt,this.width,this.height,e,r);this._setProperty("touches",t)}},e.default.prototype._ontouchstart=function(e){var t=this._isGlobal?window:this;this._setProperty("mouseIsPressed",!0),this._updateTouchCoords(e),this._updateNextMouseCoords(e),this._updateMouseCoords(),"function"==typeof t.touchStarted?!1===t.touchStarted(e)&&e.preventDefault():navigator.userAgent.toLowerCase().includes("safari")&&"function"==typeof t.mousePressed&&!1===t.mousePressed(e)&&e.preventDefault()},e.default.prototype._ontouchmove=function(e){var t=this._isGlobal?window:this;this._updateTouchCoords(e),this._updateNextMouseCoords(e),"function"==typeof t.touchMoved?!1===t.touchMoved(e)&&e.preventDefault():"function"==typeof t.mouseDragged&&!1===t.mouseDragged(e)&&e.preventDefault()},e.default.prototype._ontouchend=function(e){this._setProperty("mouseIsPressed",!1),this._updateTouchCoords(e),this._updateNextMouseCoords(e);var t=this._isGlobal?window:this;"function"==typeof t.touchEnded?!1===t.touchEnded(e)&&e.preventDefault():"function"==typeof t.mouseReleased&&!1===t.mouseReleased(e)&&e.preventDefault()};e=e.default;r.default=e},{"../core/main":267,"core-js/modules/es.array.includes":156,"core-js/modules/es.string.includes":185}],288:[function(e,t,r){"use strict";e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.typed-array.int32-array"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.typed-array.int32-array"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var N,F,B,G,V={};function o(e,D){for(var t,r,o,n,s,i,a,l,u,c,d=V._toPixels(e),f=e.width,h=e.height,p=f*h,m=new Int32Array(p),y=0;y<p;y++)m[y]=V._getARGB(d,y);var g,v,b,j=new Int32Array(p),_=new Int32Array(p),x=new Int32Array(p),w=new Int32Array(p),S=0,M=3.5*D|0;if(N!==(M=M<1?1:M<248?M:248)){F=1+(N=M)<<1,B=new Int32Array(F),G=new Array(F);for(var E,T,C=0;C<F;C++)G[C]=new Int32Array(256);for(var O=1,k=M-1;O<M;O++){B[M+O]=B[k]=T=k*k;for(var L=G[M+O],U=G[k--],P=0;P<256;P++)L[P]=U[P]=T*P}E=B[M]=M*M,L=G[M];for(var A=0;A<256;A++)L[A]=E*A}for(v=0;v<h;v++){for(g=0;g<f;g++){if(n=o=r=s=t=0,(i=g-N)<0)c=-i,i=0;else{if(f<=i)break;c=0}for(b=c;b<F&&!(f<=i);b++){var R,I=m[i+S];s+=(R=G[b])[(-16777216&I)>>>24],r+=R[(16711680&I)>>16],o+=R[(65280&I)>>8],n+=R[255&I],t+=B[b],i++}j[a=S+g]=s/t,_[a]=r/t,x[a]=o/t,w[a]=n/t}S+=f}for(u=(l=-N)*f,v=S=0;v<h;v++){for(g=0;g<f;g++){if(l<(n=o=r=s=t=0))c=a=-l,i=g;else{if(h<=l)break;c=0,a=l,i=g+u}for(b=c;b<F&&!(h<=a);b++)s+=(R=G[b])[j[i]],r+=R[_[i]],o+=R[x[i]],n+=R[w[i]],t+=B[b],a++,i+=f;m[g+S]=s/t<<24|r/t<<16|o/t<<8|n/t}S+=f,u+=f,l++}V._setPixels(d,m)}V._toPixels=function(e){var t,r;return e instanceof ImageData?e.data:e.getContext("2d")?e.getContext("2d").getImageData(0,0,e.width,e.height).data:e.getContext("webgl")?(r=(t=e.getContext("webgl")).drawingBufferWidth*t.drawingBufferHeight*4,r=new Uint8Array(r),t.readPixels(0,0,e.width,e.height,t.RGBA,t.UNSIGNED_BYTE,r),r):void 0},V._getARGB=function(e,t){t*=4;return e[3+t]<<24&4278190080|e[t]<<16&16711680|e[1+t]<<8&65280|255&e[2+t]},V._setPixels=function(e,t){for(var r,o=0,n=e.length;o<n;o++)e[0+(r=4*o)]=(16711680&t[o])>>>16,e[1+r]=(65280&t[o])>>>8,e[2+r]=255&t[o],e[3+r]=(4278190080&t[o])>>>24},V._toImageData=function(e){return e instanceof ImageData?e:e.getContext("2d").getImageData(0,0,e.width,e.height)},V._createImageData=function(e,t){return V._tmpCanvas=document.createElement("canvas"),V._tmpCtx=V._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(e,t)},V.apply=function(e,t,r){var o=e.getContext("2d"),n=o.getImageData(0,0,e.width,e.height),t=t(n,r);t instanceof ImageData?o.putImageData(t,0,0,0,0,e.width,e.height):o.putImageData(n,0,0,0,0,e.width,e.height)},V.threshold=function(e,t){for(var r=V._toPixels(e),o=(void 0===t&&(t=.5),Math.floor(255*t)),n=0;n<r.length;n+=4){var s=void 0,s=o<=.2126*r[n]+.7152*r[n+1]+.0722*r[n+2]?255:0;r[n]=r[n+1]=r[n+2]=s}},V.gray=function(e){for(var t=V._toPixels(e),r=0;r<t.length;r+=4){var o=t[r],n=t[r+1],s=t[r+2];t[r]=t[r+1]=t[r+2]=.2126*o+.7152*n+.0722*s}},V.opaque=function(e){for(var t=V._toPixels(e),r=0;r<t.length;r+=4)t[r+3]=255;return t},V.invert=function(e){for(var t=V._toPixels(e),r=0;r<t.length;r+=4)t[r]=255-t[r],t[r+1]=255-t[r+1],t[r+2]=255-t[r+2]},V.posterize=function(e,t){var r=V._toPixels(e);if(t<2||255<t)throw new Error("Level must be greater than 2 and less than 255 for posterize");for(var o=t-1,n=0;n<r.length;n+=4){var s=r[n],i=r[n+1],a=r[n+2];r[n]=255*(s*t>>8)/o,r[n+1]=255*(i*t>>8)/o,r[n+2]=255*(a*t>>8)/o}},V.dilate=function(e){for(var t,r,o,n,s,i,a,l,u,c=V._toPixels(e),d=0,f=c.length?c.length/4:0,h=new Int32Array(f);d<f;)for(r=(t=d)+e.width;d<r;)n=o=V._getARGB(c,d),(u=d-1)<t&&(u=d),r<=(l=d+1)&&(l=d),(s=d-e.width)<0&&(s=0),f<=(i=d+e.width)&&(i=d),s=V._getARGB(c,s),u=V._getARGB(c,u),i=V._getARGB(c,i),(n=77*(n>>16&255)+151*(n>>8&255)+28*(255&n))<(a=77*(u>>16&255)+151*(u>>8&255)+28*(255&u))&&(o=u,n=a),n<(a=77*((u=V._getARGB(c,l))>>16&255)+151*(u>>8&255)+28*(255&u))&&(o=u,n=a),n<(l=77*(s>>16&255)+151*(s>>8&255)+28*(255&s))&&(o=s,n=l),n<(u=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))&&(o=i,n=u),h[d++]=o;V._setPixels(c,h)},V.erode=function(e){for(var t,r,o,n,s,i,a,l,u,c=V._toPixels(e),d=0,f=c.length?c.length/4:0,h=new Int32Array(f);d<f;)for(r=(t=d)+e.width;d<r;)n=o=V._getARGB(c,d),(u=d-1)<t&&(u=d),r<=(l=d+1)&&(l=d),(s=d-e.width)<0&&(s=0),f<=(i=d+e.width)&&(i=d),s=V._getARGB(c,s),u=V._getARGB(c,u),i=V._getARGB(c,i),(a=77*(u>>16&255)+151*(u>>8&255)+28*(255&u))<(n=77*(n>>16&255)+151*(n>>8&255)+28*(255&n))&&(o=u,n=a),(a=77*((u=V._getARGB(c,l))>>16&255)+151*(u>>8&255)+28*(255&u))<n&&(o=u,n=a),(l=77*(s>>16&255)+151*(s>>8&255)+28*(255&s))<n&&(o=s,n=l),(u=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))<n&&(o=i,n=u),h[d++]=o;V._setPixels(c,h)},V.blur=function(e,t){o(e,t)},r.default=V},{"core-js/modules/es.array.iterator":158,"core-js/modules/es.object.to-string":177,"core-js/modules/es.typed-array.copy-within":197,"core-js/modules/es.typed-array.every":198,"core-js/modules/es.typed-array.fill":199,"core-js/modules/es.typed-array.filter":200,"core-js/modules/es.typed-array.find":202,"core-js/modules/es.typed-array.find-index":201,"core-js/modules/es.typed-array.for-each":205,"core-js/modules/es.typed-array.includes":206,"core-js/modules/es.typed-array.index-of":207,"core-js/modules/es.typed-array.int32-array":209,"core-js/modules/es.typed-array.iterator":210,"core-js/modules/es.typed-array.join":211,"core-js/modules/es.typed-array.last-index-of":212,"core-js/modules/es.typed-array.map":213,"core-js/modules/es.typed-array.reduce":215,"core-js/modules/es.typed-array.reduce-right":214,"core-js/modules/es.typed-array.reverse":216,"core-js/modules/es.typed-array.set":217,"core-js/modules/es.typed-array.slice":218,"core-js/modules/es.typed-array.some":219,"core-js/modules/es.typed-array.sort":220,"core-js/modules/es.typed-array.subarray":221,"core-js/modules/es.typed-array.to-locale-string":222,"core-js/modules/es.typed-array.to-string":223,"core-js/modules/es.typed-array.uint8-array":226}],289:[function(e,t,r){"use strict";e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.set"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.uint32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.set"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.uint32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var O=o(e("../core/main")),k=o(e("omggif"));function o(e){return e&&e.__esModule?e:{default:e}}function L(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}O.default.prototype.createImage=function(e,t){return O.default._validateParameters("createImage",arguments),new O.default.Image(e,t)},O.default.prototype.saveCanvas=function(){O.default._validateParameters("saveCanvas",arguments);var e,t,r,o,n=[].slice.call(arguments);switch(arguments[0]instanceof HTMLCanvasElement?(e=arguments[0],n.shift()):arguments[0]instanceof O.default.Element?(e=arguments[0].elt,n.shift()):e=this._curElement&&this._curElement.elt,1<=n.length&&(t=n[0]),r=(r=2<=n.length?n[1]:r)||O.default.prototype._checkFileExtension(t,r)[1]||"png"){default:o="image/png";break;case"jpeg":case"jpg":o="image/jpeg"}e.toBlob(function(e){O.default.prototype.downloadFile(e,t,r)},o)},O.default.prototype.encodeAndDownloadGif=function(h,e){for(var p=h.gifProperties,t=p.loopLimit,r=(1===t?t=null:null===t&&(t=0),new Uint8Array(h.width*h.height*p.numFrames)),m=[],o={},n=0;n<p.numFrames;n++){for(var s=new Set,i=p.frames[n].image.data,a=i.length,l=new Uint32Array(h.width*h.height),u=0,c=0;u<a;u+=4,c++){var d=i[u+0]<<16|i[u+1]<<8|i[u+2]<<0;s.add(d),l[c]=d}var f=L(s).sort().toString();void 0===o[f]?o[f]={freq:1,frames:[n]}:(o[f].freq+=1,o[f].frames.push(n)),m.push(l)}for(var y=[],g=Object.keys(o).sort(function(e,t){return o[t].freq-o[e].freq}),v=g[0].split(",").map(function(e){return parseInt(e)}),y=y.concat(o[v].frames),b=new Set(v),j=1;j<g.length;j++){var _=g[j].split(",").map(function(e){return parseInt(e)}).filter(function(e){return!b.has(e)});if(v.length+_.length<=256){for(var x=0;x<_.length;x++)v.push(_[x]),b.add(_[x]);y=y.concat(o[g[j]].frames)}}y=new Set(y);for(var w={},S=0;S<v.length;S++)w[v[S]]||(w[v[S]]=S);for(var M=1;M<v.length;)M<<=1;v.length=M;for(var t={loop:t,palette:new Uint32Array(v)},E=new k.default.GifWriter(r,h.width,h.height,t),T={},C=0;C<p.numFrames;C++)!function(e){for(var t=!y.has(e),r=t?[]:v,o=new Uint8Array(h.width*h.height),n={},s=new Set,i=0;i<m[e].length;i++){var a=m[e][i];t?(void 0===n[a]&&(n[a]=r.length,r.push(a)),o[i]=n[a]):o[i]=w[a],0<e&&m[e-1][i]!==a&&s.add(a)}var l={},u=r.filter(function(e){return!s.has(e)});if(0<u.length){var u=u[0],c=(t?n:w)[u];if(0<e){for(var d=0;d<m[e].length;d++)m[e-1][d]===m[e][d]&&(o[d]=c);l.transparent=c,T.frameOpts.disposal=1}}if(l.delay=p.frames[e].delay/10,t){for(var f=1;f<r.length;)f<<=1;r.length=f,l.palette=new Uint32Array(r)}0<e&&E.addFrame(0,0,h.width,h.height,T.pixelPaletteIndex,T.frameOpts),T={pixelPaletteIndex:o,frameOpts:l}}(C);T.frameOpts.disposal=1,E.addFrame(0,0,h.width,h.height,T.pixelPaletteIndex,T.frameOpts);t=new Blob([r.slice(0,E.end())],{type:"image/gif"});O.default.prototype.downloadFile(t,e,"gif")},O.default.prototype.saveFrames=function(e,t,r,o,i){O.default._validateParameters("saveFrames",arguments);r=O.default.prototype.constrain(r=r||3,0,15);r*=1e3;var o=O.default.prototype.constrain(o||15,0,22),n=0,s=O.default.prototype._makeFrame,a=this._curElement.elt,l=[],u=setInterval(function(){l.push(s(e+n,t,a)),n++},1e3/o);setTimeout(function(){if(clearInterval(u),i)i(l);else{var e=!0,t=!1,r=void 0;try{for(var o,n=l[Symbol.iterator]();!(e=(o=n.next()).done);e=!0){var s=o.value;O.default.prototype.downloadFile(s.imageData,s.filename,s.ext)}}catch(e){t=!0,r=e}finally{try{e||null==n.return||n.return()}finally{if(t)throw r}}}l=[]},.01+r)},O.default.prototype._makeFrame=function(e,t,r){var o,r=this?this._curElement.elt:r;if(t)switch(t.toLowerCase()){case"png":o="image/png";break;case"jpeg":case"jpg":o="image/jpeg";break;default:o="image/png"}else t="png",o="image/png";var r=(r=r.toDataURL(o)).replace(o,"image/octet-stream"),n={};return n.imageData=r,n.filename=e,n.ext=t,n};e=O.default;r.default=e},{"../core/main":267,"core-js/modules/es.array.concat":149,"core-js/modules/es.array.filter":153,"core-js/modules/es.array.from":155,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.map":161,"core-js/modules/es.array.slice":162,"core-js/modules/es.object.keys":176,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.set":183,"core-js/modules/es.string.iterator":186,"core-js/modules/es.string.replace":189,"core-js/modules/es.string.split":191,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.typed-array.copy-within":197,"core-js/modules/es.typed-array.every":198,"core-js/modules/es.typed-array.fill":199,"core-js/modules/es.typed-array.filter":200,"core-js/modules/es.typed-array.find":202,"core-js/modules/es.typed-array.find-index":201,"core-js/modules/es.typed-array.for-each":205,"core-js/modules/es.typed-array.includes":206,"core-js/modules/es.typed-array.index-of":207,"core-js/modules/es.typed-array.iterator":210,"core-js/modules/es.typed-array.join":211,"core-js/modules/es.typed-array.last-index-of":212,"core-js/modules/es.typed-array.map":213,"core-js/modules/es.typed-array.reduce":215,"core-js/modules/es.typed-array.reduce-right":214,"core-js/modules/es.typed-array.reverse":216,"core-js/modules/es.typed-array.set":217,"core-js/modules/es.typed-array.slice":218,"core-js/modules/es.typed-array.some":219,"core-js/modules/es.typed-array.sort":220,"core-js/modules/es.typed-array.subarray":221,"core-js/modules/es.typed-array.to-locale-string":222,"core-js/modules/es.typed-array.to-string":223,"core-js/modules/es.typed-array.uint32-array":225,"core-js/modules/es.typed-array.uint8-array":226,"core-js/modules/web.dom-collections.iterator":230,omggif:240}],290:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.copy-within"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.uint8-clamped-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.copy-within"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.uint8-clamped-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,e("regenerator-runtime/runtime");var T=n(e("../core/main")),m=n(e("../core/helpers")),j=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants")),g=n(e("omggif")),C=e("gifenc");function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}function n(e){return e&&e.__esModule?e:{default:e}}function l(e,t,r,o,n,s,i){try{var a=e[s](i),l=a.value}catch(e){return void r(e)}a.done?t(l):Promise.resolve(l).then(o,n)}function y(e,t,r,o,n,s,i,a,l,u,c){var d,f,h,p,m,y,g,v,b;return e===j.COVER&&(d=t,h=r,g=s,v=i,y=a,b=l,f=u,p=c,m=Math.max(g/f,v/p),g/=m,v/=m,m=y,y=b,d===j.CENTER?m+=(f-g)/2:d===j.RIGHT&&(m+=f-g),h===j.CENTER?y+=(p-v)/2:h===j.BOTTOM&&(y+=p-v),a=(b={x:m,y:y,w:g,h:v}).x,l=b.y,u=b.w,c=b.h),e===j.CONTAIN&&(d=t,f=r,h=o,p=n,m=s,y=i,g=u,v=c,b=Math.max(g/m,v/y),g/=b,v/=b,b=h,h=p,d===j.CENTER?b+=(m-g)/2:d===j.RIGHT&&(b+=m-g),f===j.CENTER?h+=(y-v)/2:f===j.BOTTOM&&(h+=y-v),o=(e={x:b,y:h,w:g,h:v}).x,n=e.y,s=e.w,i=e.h),{sx:a,sy:l,sw:u,sh:c,dx:o,dy:n,dw:s,dh:i}}function v(e,t){return 0<e&&e<t?e:t}e("../core/friendly_errors/validate_params"),e("../core/friendly_errors/file_errors"),e("../core/friendly_errors/fes_core"),T.default.prototype.loadImage=function(o,h,p){T.default._validateParameters("loadImage",arguments);var m=new T.default.Image(1,1,this),y=this,e=new Request(o,{method:"GET",mode:"cors"});return fetch(o,e).then(function(e){var t,r=e.headers.get("content-type");null===r&&console.warn("The image you loaded does not have a Content-Type header. If you are using the online editor consider reuploading the asset."),r&&r.includes("image/gif")?e.arrayBuffer().then(function(e){if(e){var e=new Uint8Array(e),r=m,t=h,o=p,n=function(e){y._decrementPreload()}.bind(y),s=new g.default.GifReader(e),i=(r.width=r.canvas.width=s.width,r.height=r.canvas.height=s.height,[]),a=s.numFrames(),l=new Uint8ClampedArray(r.width*r.height*4);if(1<a){for(var u=0;u<a;u++){var c=s.frameInfo(u),d=r.drawingContext.getImageData(0,0,r.width,r.height),f=(l=d.data.slice(),!function(e,t){try{t.decodeAndBlitFrameRGBA(e,l)}catch(e){T.default._friendlyFileLoadError(8,r.src),"function"==typeof o?o(e):console.error(e)}}(u,s),new ImageData(l,r.width,r.height)),f=(r.drawingContext.putImageData(f,0,0),c.delay);0===f&&(f=10),i.push({image:r.drawingContext.getImageData(0,0,r.width,r.height),delay:10*f}),2===c.disposal?r.drawingContext.clearRect(c.x,c.y,c.width,c.height):3===c.disposal&&r.drawingContext.putImageData(d,0,0,c.x,c.y,c.width,c.height)}e=s.loopCount();null===e?e=1:0===e&&(e=null),r.drawingContext.putImageData(i[0].image,0,0),r.gifProperties={displayIndex:0,loopLimit:e,loopCount:0,frames:i,numFrames:a,playing:!0,timeDisplayed:0,lastChangeTime:0}}"function"==typeof t&&t(r),n()}},function(e){"function"==typeof p?(p(e),y._decrementPreload()):console.error(e)}):((t=new Image).onload=function(){m.width=m.canvas.width=t.width,m.height=m.canvas.height=t.height,m.drawingContext.drawImage(t,0,0),m.modified=!0,"function"==typeof h&&h(m),y._decrementPreload()},t.onerror=function(e){T.default._friendlyFileLoadError(0,t.src),"function"==typeof p?(p(e),y._decrementPreload()):console.error(e)},0!==o.indexOf("data:image/")&&(t.crossOrigin="Anonymous"),t.src=o),m.modified=!0}).catch(function(e){T.default._friendlyFileLoadError(0,o),"function"==typeof p?(p(e),y._decrementPreload()):console.error(e)}),m},T.default.prototype.saveGif=function(){a=regeneratorRuntime.mark(function e(t,r){var o,n,s,i,a,l,u,c,d,f,h,p,m,y,g,v,b,j,_,x,w,S,M,E=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(o=2<E.length&&void 0!==E[2]?E[2]:{delay:0,units:"seconds"},"string"!=typeof t)throw TypeError("fileName parameter must be a string");e.next=3;break;case 3:if("number"!=typeof r)throw TypeError("Duration parameter must be a number");e.next=5;break;case 5:if(n=o&&o.delay||0,s=o&&o.units||"seconds","number"!=typeof n)throw TypeError("Delay parameter must be a number");e.next=9;break;case 9:if("seconds"!==s&&"frames"!==s)throw TypeError('Units parameter must be either "frames" or "seconds"');e.next=11;break;case 11:this._recording=!0,u=this._targetFrameRate,i=(i=1/(u=u!==1/0&&void 0!==u&&0!==u?u:60)*1e3)<20?20:i,l=(a="seconds"===s?r*u:r)+(u="seconds"===s?n*u:n),u=u,this.frameCount=u,c=this._pixelDensity,this.pixelDensity(1),d=[],f="p5.gif.progressBar",null!==document.getElementById(f)&&document.getElementById(f).remove(),(f=this.createP("")).id("progressBar"),f.style("font-size","16px"),f.style("font-family","Montserrat"),f.style("background-color","#ffffffa0"),f.style("padding","8px"),f.style("border-radius","10px"),f.position(0,0),this.drawingContext instanceof WebGLRenderingContext&&(p=document.getElementById("defaultCanvas0").getContext("webgl"),h=new Uint8Array(p.drawingBufferWidth*p.drawingBufferHeight*4)),this.noLoop();case 36:if(u<l)return this.redraw(),w=void 0,w=this.drawingContext instanceof WebGLRenderingContext?(h=new Uint8Array(p.drawingBufferWidth*p.drawingBufferHeight*4),p.readPixels(0,0,p.drawingBufferWidth,p.drawingBufferHeight,p.RGBA,p.UNSIGNED_BYTE,h),function(e){for(var t=parseInt(height/2),r=4*width,o=new Uint8Array(4*width),n=0;n<t;++n){var s=n*r,i=(height-n-1)*r;o.set(e.subarray(s,s+r)),e.copyWithin(s,i,i+r),e.set(o,i)}return e}(h)):this.drawingContext.getImageData(0,0,this.width,this.height).data,d.push(w),u++,f.html("Saved frame <b>"+d.length.toString()+"</b> out of "+a.toString()),e.next=45,new Promise(function(e){return setTimeout(e,0)});e.next=47;break;case 45:e.next=36;break;case 47:f.html("Frames processed, generating color palette..."),this.loop(),this.pixelDensity(c),m=(0,C.GIFEncoder)(),y=function(e){for(var t=new Uint8Array(e.length*e[0].length),r=0;r<e.length;r++)t.set(e[r],r*e[0].length);var o=(0,C.quantize)(t,256,{format:"rgba4444",oneBitAlpha:!0});256===o.length?o[o.length-1]=[255*Math.random(),255*Math.random(),255*Math.random(),0]:o.push([255*Math.random(),255*Math.random(),255*Math.random(),0]);return o}(d),g={},v=function(e){for(var t=e.length/4,r=new Uint8Array(t),o=0;o<t;o++){var n=e[4*o]<<24|e[4*o+1]<<16|e[4*o+2]<<8|e[4*o+3];void 0===g[n]&&(g[n]=(0,C.nearestColorIndex)(y,e.slice(4*o,4*(o+1)))),r[o]=g[n]}return r},b=y.length-1,j=[],_=0;case 57:if(!(_<d.length)){e.next=68;break}if(x=v(d[_]),w=x.slice(),0===_)m.writeFrame(x,this.width,this.height,{palette:y,delay:i,dispose:1});else{for(S=0;S<x.length;S++)x[S]===j[S]&&(x[S]=b);m.writeFrame(x,this.width,this.height,{delay:i,transparent:!0,transparentIndex:b,dispose:1})}return j=w,f.html("Rendered frame <b>"+_.toString()+"</b> out of "+a.toString()),e.next=65,new Promise(function(e){return setTimeout(e,0)});case 65:_++,e.next=57;break;case 68:m.finish(),M=m.bytesView(),M=new Blob([M],{type:"image/gif"}),d=[],this._recording=!1,this.loop(),f.html("Done. Downloading your gif!🌸"),T.default.prototype.downloadFile(M,t,"gif");case 77:case"end":return e.stop()}},e,this)});var a,r=function(){var e=this,i=arguments;return new Promise(function(t,r){var o=a.apply(e,i);function n(e){l(o,t,r,n,s,"next",e)}function s(e){l(o,t,r,n,s,"throw",e)}n(void 0)})};return function(e,t){return r.apply(this,arguments)}}(),T.default.prototype.image=function(e,t,r,o,n,s,i,a,l,u,c,d){T.default._validateParameters("image",arguments);var f=e.width,h=e.height,p=(d=d||j.CENTER,c=c||j.CENTER,e.elt&&e.elt.videoWidth&&!e.canvas&&(f=e.elt.videoWidth,h=e.elt.videoHeight),o||f),n=n||h,s=s||0,i=i||0,a=v(a||f,f),f=v(l||h,h),l=1;e.elt&&!e.canvas&&e.elt.style.width&&(l=e.elt.videoWidth&&!o?e.elt.videoWidth:e.elt.width,l/=parseInt(e.elt.style.width,10)),s*=l,i*=l,f*=l,a*=l;h=y(u,c,d,(h=m.default.modeAdjust(t,r,p,n,this._renderer._imageMode)).x,h.y,h.w,h.h,s,i,a,f);this._renderer.image(e,h.sx,h.sy,h.sw,h.sh,h.dx,h.dy,h.dw,h.dh)},T.default.prototype.tint=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];T.default._validateParameters("tint",t);var o=this.color.apply(this,t);this._renderer._tint=o.levels},T.default.prototype.noTint=function(){this._renderer._tint=null},T.default.prototype._getTintedImageCanvas=T.default.Renderer2D.prototype._getTintedImageCanvas,T.default.prototype.imageMode=function(e){T.default._validateParameters("imageMode",arguments),e!==j.CORNER&&e!==j.CORNERS&&e!==j.CENTER||(this._renderer._imageMode=e)};e=T.default;r.default=e},{"../core/constants":256,"../core/friendly_errors/fes_core":258,"../core/friendly_errors/file_errors":259,"../core/friendly_errors/validate_params":262,"../core/helpers":263,"../core/main":267,"core-js/modules/es.array.copy-within":150,"core-js/modules/es.array.includes":156,"core-js/modules/es.array.index-of":157,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.slice":162,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.promise":178,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.string.includes":185,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.typed-array.copy-within":197,"core-js/modules/es.typed-array.every":198,"core-js/modules/es.typed-array.fill":199,"core-js/modules/es.typed-array.filter":200,"core-js/modules/es.typed-array.find":202,"core-js/modules/es.typed-array.find-index":201,"core-js/modules/es.typed-array.for-each":205,"core-js/modules/es.typed-array.includes":206,"core-js/modules/es.typed-array.index-of":207,"core-js/modules/es.typed-array.iterator":210,"core-js/modules/es.typed-array.join":211,"core-js/modules/es.typed-array.last-index-of":212,"core-js/modules/es.typed-array.map":213,"core-js/modules/es.typed-array.reduce":215,"core-js/modules/es.typed-array.reduce-right":214,"core-js/modules/es.typed-array.reverse":216,"core-js/modules/es.typed-array.set":217,"core-js/modules/es.typed-array.slice":218,"core-js/modules/es.typed-array.some":219,"core-js/modules/es.typed-array.sort":220,"core-js/modules/es.typed-array.subarray":221,"core-js/modules/es.typed-array.to-locale-string":222,"core-js/modules/es.typed-array.to-string":223,"core-js/modules/es.typed-array.uint8-array":226,"core-js/modules/es.typed-array.uint8-clamped-array":227,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230,gifenc:237,omggif:240,"regenerator-runtime/runtime":244}],291:[function(e,t,r){"use strict";e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var s=n(e("../core/main")),o=n(e("./filters"));function n(e){return e&&e.__esModule?e:{default:e}}s.default.Image=function(e,t){this.width=e,this.height=t,this.canvas=document.createElement("canvas"),this.canvas.width=this.width,this.canvas.height=this.height,this.drawingContext=this.canvas.getContext("2d"),(this._pixelsState=this)._pixelDensity=1,this.gifProperties=null,this._modified=!1,this.pixels=[]},s.default.Image.prototype._animateGif=function(e){var t,r=this.gifProperties,e=e._lastFrameTime;0===r.lastChangeTime&&(r.lastChangeTime=e),r.playing&&(r.timeDisplayed=e-r.lastChangeTime,t=r.frames[r.displayIndex].delay,r.timeDisplayed>=t&&(t=Math.floor(r.timeDisplayed/t),r.timeDisplayed=0,r.lastChangeTime=e,r.displayIndex+=t,r.loopCount=Math.floor(r.displayIndex/r.numFrames),null!==r.loopLimit&&r.loopCount>=r.loopLimit?r.playing=!1:(e=r.displayIndex%r.numFrames,this.drawingContext.putImageData(r.frames[e].image,0,0),r.displayIndex=e,this.setModified(!0))))},s.default.Image.prototype._setProperty=function(e,t){this[e]=t,this.setModified(!0)},s.default.Image.prototype.loadPixels=function(){s.default.Renderer2D.prototype.loadPixels.call(this),this.setModified(!0)},s.default.Image.prototype.updatePixels=function(e,t,r,o){s.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,o),this.setModified(!0)},s.default.Image.prototype.get=function(e,t,r,o){return s.default._validateParameters("p5.Image.get",arguments),s.default.Renderer2D.prototype.get.apply(this,arguments)},s.default.Image.prototype._getPixel=s.default.Renderer2D.prototype._getPixel,s.default.Image.prototype.set=function(e,t,r){s.default.Renderer2D.prototype.set.call(this,e,t,r),this.setModified(!0)},s.default.Image.prototype.resize=function(e,t){0===e&&0===t?(e=this.canvas.width,t=this.canvas.height):0===e?e=this.canvas.width*t/this.canvas.height:0===t&&(t=this.canvas.height*e/this.canvas.width),e=Math.floor(e),t=Math.floor(t);var r=document.createElement("canvas");if(r.width=e,r.height=t,this.gifProperties)for(var o=this.gifProperties,n=0;n<o.numFrames;n++){for(var s=this.drawingContext.createImageData(e,t),i=(d=d=c=u=l=void 0,o.frames[n].image),a=s,l=0,u=0;u<a.height;u++)for(var c=0;c<a.width;c++){var d=Math.floor(c*i.width/a.width),d=4*(Math.floor(u*i.height/a.height)*i.width+d);a.data[l++]=i.data[d++],a.data[l++]=i.data[d++],a.data[l++]=i.data[d++],a.data[l++]=i.data[+d]}o.frames[n].image=s}r.getContext("2d").drawImage(this.canvas,0,0,this.canvas.width,this.canvas.height,0,0,r.width,r.height),this.canvas.width=this.width=e,this.canvas.height=this.height=t,this.drawingContext.drawImage(r,0,0,e,t,0,0,e,t),0<this.pixels.length&&this.loadPixels(),this.setModified(!0)},s.default.Image.prototype.copy=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];s.default.prototype.copy.apply(this,t)},s.default.Image.prototype.mask=function(e){var t=this.drawingContext.globalCompositeOperation,r=1,o=[e=void 0===e?this:e,0,0,(r=e instanceof s.default.Renderer?e._pInst._pixelDensity:r)*e.width,r*e.height,0,0,this.width,this.height];if(this.drawingContext.globalCompositeOperation="destination-in",this.gifProperties){for(var n=0;n<this.gifProperties.frames.length;n++)this.drawingContext.putImageData(this.gifProperties.frames[n].image,0,0),s.default.Image.prototype.copy.apply(this,o),this.gifProperties.frames[n].image=this.drawingContext.getImageData(0,0,this.width,this.height);this.drawingContext.putImageData(this.gifProperties.frames[this.gifProperties.displayIndex].image,0,0)}else s.default.Image.prototype.copy.apply(this,o);this.drawingContext.globalCompositeOperation=t,this.setModified(!0)},s.default.Image.prototype.filter=function(e,t){o.default.apply(this.canvas,o.default[e],t),this.setModified(!0)},s.default.Image.prototype.blend=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];s.default._validateParameters("p5.Image.blend",arguments),s.default.prototype.blend.apply(this,t),this.setModified(!0)},s.default.Image.prototype.setModified=function(e){this._modified=e},s.default.Image.prototype.isModified=function(){return this._modified},s.default.Image.prototype.save=function(e,t){this.gifProperties?s.default.prototype.encodeAndDownloadGif(this,e):s.default.prototype.saveCanvas(this.canvas,e,t)},s.default.Image.prototype.reset=function(){var e;this.gifProperties&&((e=this.gifProperties).playing=!0,e.timeSinceStart=0,e.timeDisplayed=0,e.lastChangeTime=0,e.loopCount=0,e.displayIndex=0,this.drawingContext.putImageData(e.frames[0].image,0,0))},s.default.Image.prototype.getCurrentFrame=function(){var e;if(this.gifProperties)return(e=this.gifProperties).displayIndex%e.numFrames},s.default.Image.prototype.setFrame=function(e){var t;this.gifProperties&&(e<(t=this.gifProperties).numFrames&&0<=e?(t.timeDisplayed=0,t.lastChangeTime=0,t.displayIndex=e,this.drawingContext.putImageData(t.frames[e].image,0,0)):console.log("Cannot set GIF to a frame number that is higher than total number of frames or below zero."))},s.default.Image.prototype.numFrames=function(){if(this.gifProperties)return this.gifProperties.numFrames},s.default.Image.prototype.play=function(){this.gifProperties&&(this.gifProperties.playing=!0)},s.default.Image.prototype.pause=function(){this.gifProperties&&(this.gifProperties.playing=!1)},s.default.Image.prototype.delay=function(e,t){if(this.gifProperties){var r=this.gifProperties;if(t<r.numFrames&&0<=t)r.frames[t].delay=e;else{var o=!0,t=!1,n=void 0;try{for(var s,i=r.frames[Symbol.iterator]();!(o=(s=i.next()).done);o=!0)s.value.delay=e}catch(e){t=!0,n=e}finally{try{o||null==i.return||i.return()}finally{if(t)throw n}}}}};e=s.default.Image;r.default=e},{"../core/main":267,"./filters":288,"core-js/modules/es.array.filter":153,"core-js/modules/es.array.iterator":158,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/web.dom-collections.iterator":230}],292:[function(e,t,r){"use strict";e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.filter"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var h=n(e("../core/main")),o=n(e("./filters"));function n(e){return e&&e.__esModule?e:{default:e}}e("../color/p5.Color"),h.default.prototype.pixels=[],h.default.prototype.blend=function(){for(var e,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];h.default._validateParameters("blend",r),this._renderer?(e=this._renderer).blend.apply(e,r):h.default.Renderer2D.prototype.blend.apply(this,r)},h.default.prototype.copy=function(){for(var e,t,r,o,n,s,i,a,l,u=arguments.length,c=new Array(u),d=0;d<u;d++)c[d]=arguments[d];if(h.default._validateParameters("copy",c),9===c.length)e=c[0],t=c[1],r=c[2],o=c[3],n=c[4],s=c[5],i=c[6],a=c[7],l=c[8];else{if(8!==c.length)throw new Error("Signature not supported");e=this,t=c[0],r=c[1],o=c[2],n=c[3],s=c[4],i=c[5],a=c[6],l=c[7]}h.default.prototype._copyHelper(this,e,t,r,o,n,s,i,a,l)},h.default.prototype._copyHelper=function(e,t,r,o,n,s,i,a,l,u){t.loadPixels();var c=t.canvas.width/t.width,d=0,f=0;t._renderer&&t._renderer.isP3D&&(d=t.width/2,f=t.height/2),e._renderer&&e._renderer.isP3D?h.default.RendererGL.prototype.image.call(e._renderer,t,r+d,o+f,n,s,i,a,l,u):e.drawingContext.drawImage(t.canvas,c*(r+d),c*(o+f),c*n,c*s,i,a,l,u)},h.default.prototype.filter=function(e,t){h.default._validateParameters("filter",arguments),void 0!==this.canvas?o.default.apply(this.canvas,o.default[e],t):o.default.apply(this.elt,o.default[e],t)},h.default.prototype.get=function(e,t,r,o){var n;return h.default._validateParameters("get",arguments),(n=this._renderer).get.apply(n,arguments)},h.default.prototype.loadPixels=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];h.default._validateParameters("loadPixels",t),this._renderer.loadPixels()},h.default.prototype.set=function(e,t,r){this._renderer.set(e,t,r)},h.default.prototype.updatePixels=function(e,t,r,o){h.default._validateParameters("updatePixels",arguments),0!==this.pixels.length&&this._renderer.updatePixels(e,t,r,o)};e=h.default;r.default=e},{"../color/p5.Color":254,"../core/main":267,"./filters":288,"core-js/modules/es.array.filter":153}],293:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.last-index-of"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.splice"),e("core-js/modules/es.function.name"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/web.url"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.last-index-of"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.splice"),e("core-js/modules/es.function.name"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.promise"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/web.url"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var v=s(e("../core/main")),m=(e("whatwg-fetch"),e("es6-promise/auto"),s(e("fetch-jsonp"))),n=s(e("file-saver"));function s(e){return e&&e.__esModule?e:{default:e}}function y(e){return(y="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}function g(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function i(e,t){t&&!0!==t&&"true"!==t||(t="");var r="";return(e=e||"untitled")&&e.includes(".")&&(r=e.split(".").pop()),t&&r!==t&&(r=t,e="".concat(e,".").concat(r)),[e,r]}e("../core/friendly_errors/validate_params"),e("../core/friendly_errors/file_errors"),e("../core/friendly_errors/fes_core"),v.default.prototype.loadJSON=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];v.default._validateParameters("loadJSON",t);for(var o,n,s,i=t[0],a={},l="json",u=1;u<t.length;u++){var c=t[u];"string"==typeof c?"jsonp"!==c&&"json"!==c||(l=c):"function"==typeof c?o?n=c:o=c:"object"===y(c)&&(c.hasOwnProperty("jsonpCallback")||c.hasOwnProperty("jsonpCallbackFunction"))&&(l="jsonp",s=c)}var d=this;return this.httpDo(i,"GET",s,l,function(e){for(var t in e)a[t]=e[t];void 0!==o&&o(e),d._decrementPreload()},function(e){if(v.default._friendlyFileLoadError(5,i),!n)throw e;n(e)}),a},v.default.prototype.loadStrings=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];v.default._validateParameters("loadStrings",t);for(var n,o,s=[],i=1;i<t.length;i++){var a=t[i];"function"==typeof a&&(void 0===n?n=a:void 0===o&&(o=a))}var l=this;return v.default.prototype.httpDo.call(this,t[0],"GET","text",function(e){for(var t=e.replace(/\r\n/g,"\r").replace(/\n/g,"\r").split(/\r/),r=0,o=t.length;r<o;r+=32768)Array.prototype.push.apply(s,t.slice(r,Math.min(r+32768,o)));void 0!==n&&n(s),l._decrementPreload()},function(e){if(v.default._friendlyFileLoadError(3,e),!o)throw e;o(e)}),s},v.default.prototype.loadTable=function(t){var h,r,p,e=[],m=!1,o=t.substring(t.lastIndexOf(".")+1,t.length);"csv"===o?p=",":"ssv"===o?p=";":"tsv"===o&&(p="\t");for(var n=1;n<arguments.length;n++)"function"==typeof arguments[n]?void 0===h?h=arguments[n]:void 0===r&&(r=arguments[n]):"string"==typeof arguments[n]&&(e.push(arguments[n]),"header"===arguments[n]&&(m=!0),"csv"===arguments[n]?p=",":"ssv"===arguments[n]?p=";":"tsv"===arguments[n]&&(p="\t"));var y=new v.default.Table,g=this;return this.httpDo(t,"GET","table",function(e){for(var t,r,o={},n=0,s=[],i=0,a=null,l=function(){o.currentState=n,o.token=""},u=function(){a.push(o.token),l()},c=function(){o.currentState=4,s.push(a),a=null};;){if(null==(t=e[i++])){if(o.escaped)throw new Error("Unclosed quote in file.");if(a){u(),c();break}}if(null===a&&(o.escaped=!1,a=[],l()),o.currentState===n){if('"'===t){o.escaped=!0,o.currentState=1;continue}o.currentState=1}if(1===o.currentState&&o.escaped)if('"'===t)'"'===e[i]?(o.token+='"',i++):(o.escaped=!1,o.currentState=2);else{if("\r"===t)continue;o.token+=t}else"\r"===t?("\n"===e[i]&&i++,u(),c()):"\n"===t?(u(),c()):t===p?u():1===o.currentState&&(o.token+=t)}if(m)y.columns=s.shift();else for(var d=0;d<s[0].length;d++)y.columns[d]="null";for(var f=0;f<s.length;f++)(1!==s[f].length||"undefined"!==s[f][0]&&""!==s[f][0])&&((r=new v.default.TableRow).arr=s[f],r.obj=function(e,t){var r={};if(void 0===(t=t||[]))for(var o=0;o<e.length;o++)t[o.toString()]=o;for(var n=0;n<t.length;n++){var s=t[n],i=e[n];r[s]=i}return r}(s[f],y.columns),y.addRow(r));"function"==typeof h&&h(y),g._decrementPreload()},function(e){v.default._friendlyFileLoadError(2,t),r?r(e):console.error(e)}),y},v.default.prototype.loadXML=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var o,n,s=new v.default.XML,i=1;i<t.length;i++){var a=t[i];"function"==typeof a&&(void 0===o?o=a:void 0===n&&(n=a))}var l=this;return this.httpDo(t[0],"GET","xml",function(e){for(var t in e)s[t]=e[t];void 0!==o&&o(s),l._decrementPreload()},function(e){if(v.default._friendlyFileLoadError(1,e),!n)throw e;n(e)}),s},v.default.prototype.loadBytes=function(t,r,o){var n={},s=this;return this.httpDo(t,"GET","arrayBuffer",function(e){n.bytes=new Uint8Array(e),"function"==typeof r&&r(n),s._decrementPreload()},function(e){if(v.default._friendlyFileLoadError(6,t),!o)throw e;o(e)}),n},v.default.prototype.httpGet=function(){v.default._validateParameters("httpGet",arguments);var e=Array.prototype.slice.call(arguments);return e.splice(1,0,"GET"),v.default.prototype.httpDo.apply(this,e)},v.default.prototype.httpPost=function(){v.default._validateParameters("httpPost",arguments);var e=Array.prototype.slice.call(arguments);return e.splice(1,0,"POST"),v.default.prototype.httpDo.apply(this,e)},v.default.prototype.httpDo=function(){for(var r,e,t,o={},n=0,s="text/plain",i=arguments.length-1;0<i&&"function"==typeof(i<0||arguments.length<=i?void 0:arguments[i]);i--)n++;var a=arguments.length-n,l=arguments.length<=0?void 0:arguments[0];if(2==a&&"string"==typeof l&&"object"===y(arguments.length<=1?void 0:arguments[1]))p=new Request(l,arguments.length<=1?void 0:arguments[1]),e=arguments.length<=2?void 0:arguments[2],t=arguments.length<=3?void 0:arguments[3];else{for(var u,c="GET",d=1;d<arguments.length;d++){var f=d<0||arguments.length<=d?void 0:arguments[d];if("string"==typeof f)"GET"===f||"POST"===f||"PUT"===f||"DELETE"===f?c=f:"json"===f||"jsonp"===f||"binary"===f||"arrayBuffer"===f||"xml"===f||"text"===f||"table"===f?r=f:u=f;else if("number"==typeof f)u=f.toString();else if("object"===y(f))if(f.hasOwnProperty("jsonpCallback")||f.hasOwnProperty("jsonpCallbackFunction"))for(var h in f)o[h]=f[h];else s=f instanceof v.default.XML?(u=f.serialize(),"application/xml"):(u=JSON.stringify(f),"application/json");else"function"==typeof f&&(e?t=f:e=f)}var a="GET"===c?new Headers:new Headers({"Content-Type":s}),p=new Request(l,{method:c,mode:"cors",body:u,headers:a})}return(a=(a="jsonp"===(r=r||(l.includes("json")?"json":l.includes("xml")?"xml":"text"))?(0,m.default)(l,o):fetch(p)).then(function(e){if(!e.ok)throw(t=new Error(e.body)).status=e.status,t.ok=!1,t;var t=0;switch((t="jsonp"!==r?e.headers.get("content-length"):t)&&64e6<t&&v.default._friendlyFileLoadError(7,l),r){case"json":case"jsonp":return e.json();case"binary":return e.blob();case"arrayBuffer":return e.arrayBuffer();case"xml":return e.text().then(function(e){e=(new DOMParser).parseFromString(e,"text/xml");return new v.default.XML(e.documentElement)});default:return e.text()}})).then(e||function(){}),a.catch(t||console.error),a},window.URL=window.URL||window.webkitURL,v.default.prototype._pWriters=[],v.default.prototype.createWriter=function(e,t){var r,o;for(o in v.default.prototype._pWriters)if(v.default.prototype._pWriters[o].name===e)return r=new v.default.PrintWriter(e+this.millis(),t),v.default.prototype._pWriters.push(r),r;return r=new v.default.PrintWriter(e,t),v.default.prototype._pWriters.push(r),r},v.default.PrintWriter=function(r,o){var n=this;this.name=r,this.content="",this.write=function(e){this.content+=e},this.print=function(e){this.content+="".concat(e,"\n")},this.clear=function(){this.content=""},this.close=function(){var e,t=[];for(e in t.push(this.content),v.default.prototype.writeFile(t,r,o),v.default.prototype._pWriters)v.default.prototype._pWriters[e].name===this.name&&v.default.prototype._pWriters.splice(e,1);n.clear(),n={}}},v.default.prototype.save=function(e,t,r){var o=arguments,n=(this._curElement||this).elt;if(0===o.length)v.default.prototype.saveCanvas(n);else if(o[0]instanceof v.default.Renderer||o[0]instanceof v.default.Graphics)v.default.prototype.saveCanvas(o[0].elt,o[1],o[2]);else if(1===o.length&&"string"==typeof o[0])v.default.prototype.saveCanvas(n,o[0]);else switch(i(o[1],o[2])[1]){case"json":return void v.default.prototype.saveJSON(o[0],o[1],o[2]);case"txt":return void v.default.prototype.saveStrings(o[0],o[1],o[2]);default:o[0]instanceof Array?v.default.prototype.saveStrings(o[0],o[1],o[2]):o[0]instanceof v.default.Table?v.default.prototype.saveTable(o[0],o[1],o[2]):o[0]instanceof v.default.Image?v.default.prototype.saveCanvas(o[0].canvas,o[1]):o[0]instanceof v.default.SoundFile&&v.default.prototype.saveSound(o[0],o[1],o[2],o[3])}},v.default.prototype.saveJSON=function(e,t,r){v.default._validateParameters("saveJSON",arguments),r=r?JSON.stringify(e):JSON.stringify(e,void 0,2),this.saveStrings(r.split("\n"),t,"json")},v.default.prototype.saveJSONObject=v.default.prototype.saveJSON,v.default.prototype.saveJSONArray=v.default.prototype.saveJSON,v.default.prototype.saveStrings=function(e,t,r,o){v.default._validateParameters("saveStrings",arguments);for(var n=this.createWriter(t,r||"txt"),s=0;s<e.length;s++)o?n.write(e[s]+"\r\n"):n.write(e[s]+"\n");n.close(),n.clear()},v.default.prototype.saveTable=function(e,t,r){v.default._validateParameters("saveTable",arguments),o=void 0===r?t.substring(t.lastIndexOf(".")+1,t.length):r;var o,n=this.createWriter(t,o),s=e.columns,i="tsv"===o?"\t":",";if("html"!==o){if("0"!==s[0]){for(var a=0;a<s.length;a++)a<s.length-1?n.write(s[a]+i):n.write(s[a]);n.write("\n")}for(var l=0;l<e.rows.length;l++){for(var u=void 0,u=0;u<e.rows[l].arr.length;u++)u<e.rows[l].arr.length-1?"csv"===o&&String(e.rows[l].arr[u]).includes(",")?n.write('"'+e.rows[l].arr[u]+'"'+i):n.write(e.rows[l].arr[u]+i):"csv"===o&&String(e.rows[l].arr[u]).includes(",")?n.write('"'+e.rows[l].arr[u]+'"'):n.write(e.rows[l].arr[u]);n.write("\n")}}else{n.print("<html>"),n.print("<head>");if(n.print(' <meta http-equiv="content-type" content="text/html;charset=utf-8" />'),n.print("</head>"),n.print("<body>"),n.print(" <table>"),"0"!==s[0]){n.print(" <tr>");for(var c=0;c<s.length;c++){var d=g(s[c]);n.print(" <td>".concat(d)),n.print(" </td>")}n.print(" </tr>")}for(var f=0;f<e.rows.length;f++){n.print(" <tr>");for(var h=0;h<e.columns.length;h++){var p=g(e.rows[f].getString(h));n.print(" <td>".concat(p)),n.print(" </td>")}n.print(" </tr>")}n.print(" </table>"),n.print("</body>"),n.print("</html>")}n.close(),n.clear()},v.default.prototype.writeFile=function(e,t,r){var o="application/octet-stream",e=(v.default.prototype._isSafari()&&(o="text/plain"),new Blob(e,{type:o}));v.default.prototype.downloadFile(e,t,r)},v.default.prototype.downloadFile=function(e,t,r){var o,t=i(t,r),r=t[0];e instanceof Blob?n.default.saveAs(e,r):((o=document.createElement("a")).href=e,o.download=r,o.onclick=function(e){document.body.removeChild(e.target),e.stopPropagation()},o.style.display="none",document.body.appendChild(o),v.default.prototype._isSafari()&&(e=(e='Hello, Safari user! To download this file...\n1. Go to File --\x3e Save As.\n2. Choose "Page Source" as the Format.\n')+'3. Name it with this extension: ."'.concat(t[1],'"'),alert(e)),o.click())},v.default.prototype._checkFileExtension=i,v.default.prototype._isSafari=function(){return 0<Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")};e=v.default;r.default=e},{"../core/friendly_errors/fes_core":258,"../core/friendly_errors/file_errors":259,"../core/friendly_errors/validate_params":262,"../core/main":267,"core-js/modules/es.array.concat":149,"core-js/modules/es.array.includes":156,"core-js/modules/es.array.index-of":157,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.last-index-of":160,"core-js/modules/es.array.slice":162,"core-js/modules/es.array.splice":164,"core-js/modules/es.function.name":165,"core-js/modules/es.object.to-string":177,"core-js/modules/es.promise":178,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.string.includes":185,"core-js/modules/es.string.iterator":186,"core-js/modules/es.string.replace":189,"core-js/modules/es.string.split":191,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.typed-array.copy-within":197,"core-js/modules/es.typed-array.every":198,"core-js/modules/es.typed-array.fill":199,"core-js/modules/es.typed-array.filter":200,"core-js/modules/es.typed-array.find":202,"core-js/modules/es.typed-array.find-index":201,"core-js/modules/es.typed-array.for-each":205,"core-js/modules/es.typed-array.includes":206,"core-js/modules/es.typed-array.index-of":207,"core-js/modules/es.typed-array.iterator":210,"core-js/modules/es.typed-array.join":211,"core-js/modules/es.typed-array.last-index-of":212,"core-js/modules/es.typed-array.map":213,"core-js/modules/es.typed-array.reduce":215,"core-js/modules/es.typed-array.reduce-right":214,"core-js/modules/es.typed-array.reverse":216,"core-js/modules/es.typed-array.set":217,"core-js/modules/es.typed-array.slice":218,"core-js/modules/es.typed-array.some":219,"core-js/modules/es.typed-array.sort":220,"core-js/modules/es.typed-array.subarray":221,"core-js/modules/es.typed-array.to-locale-string":222,"core-js/modules/es.typed-array.to-string":223,"core-js/modules/es.typed-array.uint8-array":226,"core-js/modules/web.dom-collections.iterator":230,"core-js/modules/web.url":232,"es6-promise/auto":233,"fetch-jsonp":235,"file-saver":236,"whatwg-fetch":245}],294:[function(e,t,r){"use strict";e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.splice"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.trim"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.splice"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.trim"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(e=e("../core/main"))&&e.__esModule?e:{default:e};o.default.Table=function(e){this.columns=[],this.rows=[]},o.default.Table.prototype.addRow=function(e){e=e||new o.default.TableRow;if(void 0===e.arr||void 0===e.obj)throw new Error("invalid TableRow: ".concat(e));return(e.table=this).rows.push(e),e},o.default.Table.prototype.removeRow=function(e){this.rows[e].table=null;e=this.rows.splice(e+1,this.rows.length);this.rows.pop(),this.rows=this.rows.concat(e)},o.default.Table.prototype.getRow=function(e){return this.rows[e]},o.default.Table.prototype.getRows=function(){return this.rows},o.default.Table.prototype.findRow=function(e,t){if("string"==typeof t){for(var r=0;r<this.rows.length;r++)if(this.rows[r].obj[t]===e)return this.rows[r]}else for(var o=0;o<this.rows.length;o++)if(this.rows[o].arr[t]===e)return this.rows[o];return null},o.default.Table.prototype.findRows=function(e,t){var r=[];if("string"==typeof t)for(var o=0;o<this.rows.length;o++)this.rows[o].obj[t]===e&&r.push(this.rows[o]);else for(var n=0;n<this.rows.length;n++)this.rows[n].arr[t]===e&&r.push(this.rows[n]);return r},o.default.Table.prototype.matchRow=function(e,t){if("number"==typeof t){for(var r=0;r<this.rows.length;r++)if(this.rows[r].arr[t].match(e))return this.rows[r]}else for(var o=0;o<this.rows.length;o++)if(this.rows[o].obj[t].match(e))return this.rows[o];return null},o.default.Table.prototype.matchRows=function(e,t){var r=[];if("number"==typeof t)for(var o=0;o<this.rows.length;o++)this.rows[o].arr[t].match(e)&&r.push(this.rows[o]);else for(var n=0;n<this.rows.length;n++)this.rows[n].obj[t].match(e)&&r.push(this.rows[n]);return r},o.default.Table.prototype.getColumn=function(e){var t=[];if("string"==typeof e)for(var r=0;r<this.rows.length;r++)t.push(this.rows[r].obj[e]);else for(var o=0;o<this.rows.length;o++)t.push(this.rows[o].arr[e]);return t},o.default.Table.prototype.clearRows=function(){delete this.rows,this.rows=[]},o.default.Table.prototype.addColumn=function(e){this.columns.push(e||null)},o.default.Table.prototype.getColumnCount=function(){return this.columns.length},o.default.Table.prototype.getRowCount=function(){return this.rows.length},o.default.Table.prototype.removeTokens=function(e,t){for(var r=[],o=0;o<e.length;o++)r.push(e.charAt(o).replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"));var n=new RegExp(r.join("|"),"g");if(void 0===t)for(var s=0;s<this.columns.length;s++)for(var i=0;i<this.rows.length;i++){var a=(a=this.rows[i].arr[s]).replace(n,"");this.rows[i].arr[s]=a,this.rows[i].obj[this.columns[s]]=a}else if("string"==typeof t)for(var l=0;l<this.rows.length;l++){var u=(u=this.rows[l].obj[t]).replace(n,""),c=(this.rows[l].obj[t]=u,this.columns.indexOf(t));this.rows[l].arr[c]=u}else for(var d=0;d<this.rows.length;d++){var f=(f=this.rows[d].arr[t]).replace(n,"");this.rows[d].arr[t]=f,this.rows[d].obj[this.columns[t]]=f}},o.default.Table.prototype.trim=function(e){var t=new RegExp(" ","g");if(void 0===e)for(var r=0;r<this.columns.length;r++)for(var o=0;o<this.rows.length;o++){var n=(n=this.rows[o].arr[r]).replace(t,"");this.rows[o].arr[r]=n,this.rows[o].obj[this.columns[r]]=n}else if("string"==typeof e)for(var s=0;s<this.rows.length;s++){var i=(i=this.rows[s].obj[e]).replace(t,""),a=(this.rows[s].obj[e]=i,this.columns.indexOf(e));this.rows[s].arr[a]=i}else for(var l=0;l<this.rows.length;l++){var u=(u=this.rows[l].arr[e]).replace(t,"");this.rows[l].arr[e]=u,this.rows[l].obj[this.columns[e]]=u}},o.default.Table.prototype.removeColumn=function(e){"string"==typeof e?r=this.columns.indexOf(t=e):t=this.columns[r=e];var t,r,e=this.columns.splice(r+1,this.columns.length);this.columns.pop(),this.columns=this.columns.concat(e);for(var o=0;o<this.rows.length;o++){var n=this.rows[o].arr,s=n.splice(r+1,n.length);n.pop(),this.rows[o].arr=n.concat(s),delete this.rows[o].obj[t]}},o.default.Table.prototype.set=function(e,t,r){this.rows[e].set(t,r)},o.default.Table.prototype.setNum=function(e,t,r){this.rows[e].setNum(t,r)},o.default.Table.prototype.setString=function(e,t,r){this.rows[e].setString(t,r)},o.default.Table.prototype.get=function(e,t){return this.rows[e].get(t)},o.default.Table.prototype.getNum=function(e,t){return this.rows[e].getNum(t)},o.default.Table.prototype.getString=function(e,t){return this.rows[e].getString(t)},o.default.Table.prototype.getObject=function(e){for(var t,r={},o=0;o<this.rows.length;o++)if(t=this.rows[o].obj,"string"==typeof e){if(!(0<=this.columns.indexOf(e)))throw new Error('This table has no column named "'.concat(e,'"'));r[t[e]]=t}else r[o]=this.rows[o].obj;return r},o.default.Table.prototype.getArray=function(){for(var e=[],t=0;t<this.rows.length;t++)e.push(this.rows[t].arr);return e};e=o.default;r.default=e},{"../core/main":267,"core-js/modules/es.array.concat":149,"core-js/modules/es.array.index-of":157,"core-js/modules/es.array.join":159,"core-js/modules/es.array.splice":164,"core-js/modules/es.regexp.constructor":180,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.string.match":187,"core-js/modules/es.string.replace":189,"core-js/modules/es.string.trim":193}],295:[function(e,t,r){"use strict";e("core-js/modules/es.array.index-of"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.split"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.split"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;e=(e=e("../core/main"))&&e.__esModule?e:{default:e};e.default.TableRow=function(e,t){var r=[],o={};e&&(r=e.split(t=t||","));for(var n=0;n<r.length;n++){var s=n,i=r[n];o[s]=i}this.arr=r,this.obj=o,this.table=null},e.default.TableRow.prototype.set=function(e,t){if("string"==typeof e){var r=this.table.columns.indexOf(e);if(!(0<=r))throw new Error('This table has no column named "'.concat(e,'"'));this.obj[e]=t,this.arr[r]=t}else{if(!(e<this.table.columns.length))throw new Error("Column #".concat(e," is out of the range of this table"));this.arr[e]=t;r=this.table.columns[e];this.obj[r]=t}},e.default.TableRow.prototype.setNum=function(e,t){t=parseFloat(t);this.set(e,t)},e.default.TableRow.prototype.setString=function(e,t){t=t.toString();this.set(e,t)},e.default.TableRow.prototype.get=function(e){return("string"==typeof e?this.obj:this.arr)[e]},e.default.TableRow.prototype.getNum=function(e){var t="string"==typeof e?parseFloat(this.obj[e]):parseFloat(this.arr[e]);if("NaN"===t.toString())throw"Error: ".concat(this.obj[e]," is NaN (Not a Number)");return t},e.default.TableRow.prototype.getString=function(e){return("string"==typeof e?this.obj:this.arr)[e].toString()};e=e.default;r.default=e},{"../core/main":267,"core-js/modules/es.array.index-of":157,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.string.split":191}],296:[function(e,t,r){"use strict";e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.replace"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.replace"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var a=(e=e("../core/main"))&&e.__esModule?e:{default:e};function o(e){for(var t=[],r=0;r<e.length;r++)t.push(new a.default.XML(e[r]));return t}a.default.XML=function(e){e?this.DOM=e:(e=document.implementation.createDocument(null,"doc"),this.DOM=e.createElement("root"))},a.default.XML.prototype.getParent=function(){return new a.default.XML(this.DOM.parentElement)},a.default.XML.prototype.getName=function(){return this.DOM.tagName},a.default.XML.prototype.setName=function(e){var t=this.DOM.innerHTML,r=this.DOM.attributes,o=document.implementation.createDocument(null,"default").createElement(e);o.innerHTML=t;for(var n=0;n<r.length;n++)o.setAttribute(r[n].nodeName,r.nodeValue);this.DOM=o},a.default.XML.prototype.hasChildren=function(){return 0<this.DOM.children.length},a.default.XML.prototype.listChildren=function(){for(var e=[],t=0;t<this.DOM.childNodes.length;t++)e.push(this.DOM.childNodes[t].nodeName);return e},a.default.XML.prototype.getChildren=function(e){return o(e?this.DOM.getElementsByTagName(e):this.DOM.children)},a.default.XML.prototype.getChild=function(e){if("string"!=typeof e)return new a.default.XML(this.DOM.children[e]);var t=!0,r=!1,o=void 0;try{for(var n,s=this.DOM.children[Symbol.iterator]();!(t=(n=s.next()).done);t=!0){var i=n.value;if(i.tagName===e)return new a.default.XML(i)}}catch(e){r=!0,o=e}finally{try{t||null==s.return||s.return()}finally{if(r)throw o}}},a.default.XML.prototype.addChild=function(e){e instanceof a.default.XML&&this.DOM.appendChild(e.DOM)},a.default.XML.prototype.removeChild=function(e){var t=-1;if("string"==typeof e){for(var r=0;r<this.DOM.children.length;r++)if(this.DOM.children[r].tagName===e){t=r;break}}else t=e;-1!==t&&this.DOM.removeChild(this.DOM.children[t])},a.default.XML.prototype.getAttributeCount=function(){return this.DOM.attributes.length},a.default.XML.prototype.listAttributes=function(){var e=[],t=!0,r=!1,o=void 0;try{for(var n,s=this.DOM.attributes[Symbol.iterator]();!(t=(n=s.next()).done);t=!0){var i=n.value;e.push(i.nodeName)}}catch(e){r=!0,o=e}finally{try{t||null==s.return||s.return()}finally{if(r)throw o}}return e},a.default.XML.prototype.hasAttribute=function(e){var t={},r=!0,o=!1,n=void 0;try{for(var s,i=this.DOM.attributes[Symbol.iterator]();!(r=(s=i.next()).done);r=!0){var a=s.value;t[a.nodeName]=a.nodeValue}}catch(e){o=!0,n=e}finally{try{r||null==i.return||i.return()}finally{if(o)throw n}}return!!t[e]},a.default.XML.prototype.getNum=function(e,t){var r={},o=!0,n=!1,s=void 0;try{for(var i,a=this.DOM.attributes[Symbol.iterator]();!(o=(i=a.next()).done);o=!0){var l=i.value;r[l.nodeName]=l.nodeValue}}catch(e){n=!0,s=e}finally{try{o||null==a.return||a.return()}finally{if(n)throw s}}return Number(r[e])||t||0},a.default.XML.prototype.getString=function(e,t){var r={},o=!0,n=!1,s=void 0;try{for(var i,a=this.DOM.attributes[Symbol.iterator]();!(o=(i=a.next()).done);o=!0){var l=i.value;r[l.nodeName]=l.nodeValue}}catch(e){n=!0,s=e}finally{try{o||null==a.return||a.return()}finally{if(n)throw s}}return r[e]?String(r[e]):t||null},a.default.XML.prototype.setAttribute=function(e,t){this.DOM.setAttribute(e,t)},a.default.XML.prototype.getContent=function(e){var t=this.DOM.textContent;return(t=t.replace(/\s\s+/g,","))||e||null},a.default.XML.prototype.setContent=function(e){this.DOM.children.length||(this.DOM.textContent=e)},a.default.XML.prototype.serialize=function(){return(new XMLSerializer).serializeToString(this.DOM)};e=a.default;r.default=e},{"../core/main":267,"core-js/modules/es.array.iterator":158,"core-js/modules/es.number.constructor":169,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.string.iterator":186,"core-js/modules/es.string.replace":189,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/web.dom-collections.iterator":230}],297:[function(e,t,r){"use strict";e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.math.hypot"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.math.hypot"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.string.includes"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=(e=e("../core/main"))&&e.__esModule?e:{default:e};function o(){if("function"==typeof Math.hypot)return Math.hypot.apply(null,arguments);for(var e=arguments.length,t=[],r=0,o=0;o<e;o++){var n=arguments[o];if((n=+n)===1/0||n===-1/0)return 1/0;r<(n=Math.abs(n))&&(r=n),t[o]=n}0===r&&(r=1);for(var s=0,i=0,a=0;a<e;a++)var l=t[a]/r,l=l*l-i,u=s+l,i=u-s-l,s=u;return Math.sqrt(s)*r}i.default.prototype.abs=Math.abs,i.default.prototype.ceil=Math.ceil,i.default.prototype.constrain=function(e,t,r){return i.default._validateParameters("constrain",arguments),Math.max(Math.min(e,r),t)},i.default.prototype.dist=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return i.default._validateParameters("dist",t),4===t.length?o(t[2]-t[0],t[3]-t[1]):6===t.length?o(t[3]-t[0],t[4]-t[1],t[5]-t[2]):void 0},i.default.prototype.exp=Math.exp,i.default.prototype.floor=Math.floor,i.default.prototype.lerp=function(e,t,r){return i.default._validateParameters("lerp",arguments),r*(t-e)+e},i.default.prototype.log=Math.log,i.default.prototype.mag=function(e,t){return i.default._validateParameters("mag",arguments),o(e,t)},i.default.prototype.map=function(e,t,r,o,n,s){i.default._validateParameters("map",arguments);e=(e-t)/(r-t)*(n-o)+o;return s?o<n?this.constrain(e,o,n):this.constrain(e,n,o):e},i.default.prototype.max=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t[0]instanceof Array?Math.max.apply(null,t[0]):Math.max.apply(null,t)},i.default.prototype.min=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t[0]instanceof Array?Math.min.apply(null,t[0]):Math.min.apply(null,t)},i.default.prototype.norm=function(e,t,r){return i.default._validateParameters("norm",arguments),this.map(e,t,r,0,1)},i.default.prototype.pow=Math.pow,i.default.prototype.round=function(e,t){return t?(t=Math.pow(10,t),Math.round(e*t)/t):Math.round(e)},i.default.prototype.sq=function(e){return e*e},i.default.prototype.sqrt=Math.sqrt,i.default.prototype.fract=function(e){i.default._validateParameters("fract",arguments);var t,r=0,e=Number(e);return isNaN(e)||Math.abs(e)===1/0?e:(e<0&&(e=-e,r=1),String(e).includes(".")&&!String(e).includes("e")?(t=String(e),t=Number("0"+t.slice(t.indexOf("."))),Math.abs(r-t)):e<1?Math.abs(r-e):0)};e=i.default;r.default=e},{"../core/main":267,"core-js/modules/es.array.includes":156,"core-js/modules/es.array.index-of":157,"core-js/modules/es.array.map":161,"core-js/modules/es.array.slice":162,"core-js/modules/es.math.hypot":167,"core-js/modules/es.number.constructor":169,"core-js/modules/es.string.includes":185}],298:[function(e,t,r){"use strict";e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.reflect.construct"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.reflect.construct"),e("core-js/modules/es.regexp.to-string"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(e=e("../core/main"))&&e.__esModule?e:{default:e};function n(e,t,r){return(n=function(){if("undefined"!=typeof Reflect&&Reflect.construct&&!Reflect.construct.sham){if("function"==typeof Proxy)return 1;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),1}catch(e){}}}()?Reflect.construct:function(e,t,r){var o=[null];o.push.apply(o,t);t=new(Function.bind.apply(e,o));return r&&s(t,r.prototype),t}).apply(null,arguments)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}o.default.prototype.createVector=function(e,t,r){return this instanceof o.default?n(o.default.Vector,[this._fromRadians.bind(this),this._toRadians.bind(this)].concat(Array.prototype.slice.call(arguments))):new o.default.Vector(e,t,r)};e=o.default;r.default=e},{"../core/main":267,"core-js/modules/es.array.concat":149,"core-js/modules/es.array.slice":162,"core-js/modules/es.object.to-string":177,"core-js/modules/es.reflect.construct":179,"core-js/modules/es.regexp.to-string":182}],299:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;e=(e=e("../core/main"))&&e.__esModule?e:{default:e};function b(e){return.5*(1-Math.cos(e*Math.PI))}var j,_=4095,x=4,w=.5,e=(e.default.prototype.noise=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0;if(null==j){j=new Array(4096);for(var o=0;o<4096;o++)j[o]=Math.random()}e<0&&(e=-e),t<0&&(t=-t),r<0&&(r=-r);for(var n,s,i=Math.floor(e),a=Math.floor(t),l=Math.floor(r),u=e-i,c=t-a,d=r-l,f=0,h=.5,p=0;p<x;p++){var m=i+(a<<4)+(l<<8),y=b(u),g=b(c),v=j[m&_];v+=y*(j[m+1&_]-v),n=j[m+16&_],v+=g*((n+=y*(j[m+16+1&_]-n))-v),n=j[(m+=256)&_],n+=y*(j[m+1&_]-n),s=j[m+16&_],n+=g*((s+=y*(j[m+16+1&_]-s))-n),f+=(v+=b(d)*(n-v))*h,h*=w,i<<=1,a<<=1,l<<=1,1<=(u*=2)&&(i++,u--),1<=(c*=2)&&(a++,c--),1<=(d*=2)&&(l++,d--)}return f},e.default.prototype.noiseDetail=function(e,t){0<e&&(x=e),0<t&&(w=t)},e.default.prototype.noiseSeed=function(e){o=4294967296;var t,r,o,n={setSeed:function(e){r=t=(null==e?Math.random()*o:e)>>>0},getSeed:function(){return t},rand:function(){return(r=(1664525*r+1013904223)%o)/o}};n.setSeed(e),j=new Array(4096);for(var s=0;s<4096;s++)j[s]=n.rand()},e.default);r.default=e},{"../core/main":267}],300:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.every"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.some"),e("core-js/modules/es.math.sign"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.number.is-finite"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.sub"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.every"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.some"),e("core-js/modules/es.math.sign"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.number.is-finite"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.sub"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var a=(s=e("../core/main"))&&s.__esModule?s:{default:s},n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants"));function l(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,l=function(){return e},e)}a.default.Vector=function(){var e,t,r="[object Function]"==={}.toString.call(arguments[0])?(this.isPInst=!0,this._fromRadians=arguments[0],this._toRadians=arguments[1],e=arguments[2]||0,t=arguments[3]||0,arguments[4]||0):(e=arguments[0]||0,t=arguments[1]||0,arguments[2]||0);this.x=e,this.y=t,this.z=r},a.default.Vector.prototype.toString=function(){return"p5.Vector Object : [".concat(this.x,", ").concat(this.y,", ").concat(this.z,"]")},a.default.Vector.prototype.set=function(e,t,r){return e instanceof a.default.Vector?(this.x=e.x||0,this.y=e.y||0,this.z=e.z||0):e instanceof Array?(this.x=e[0]||0,this.y=e[1]||0,this.z=e[2]||0):(this.x=e||0,this.y=t||0,this.z=r||0),this},a.default.Vector.prototype.copy=function(){return this.isPInst?new a.default.Vector(this._fromRadians,this._toRadians,this.x,this.y,this.z):new a.default.Vector(this.x,this.y,this.z)},a.default.Vector.prototype.add=function(e,t,r){return e instanceof a.default.Vector?(this.x+=e.x||0,this.y+=e.y||0,this.z+=e.z||0):e instanceof Array?(this.x+=e[0]||0,this.y+=e[1]||0,this.z+=e[2]||0):(this.x+=e||0,this.y+=t||0,this.z+=r||0),this};function u(e,t){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),this}function c(e,t,r){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),0!==r&&(this.z=this.z%r),this}a.default.Vector.prototype.rem=function(e,t,r){var o;if(e instanceof a.default.Vector){if(Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z))return n=parseFloat(e.x),s=parseFloat(e.y),o=parseFloat(e.z),c.call(this,n,s,o)}else if(e instanceof Array){if(e.every(function(e){return Number.isFinite(e)}))return 2===e.length?u.call(this,e[0],e[1]):3===e.length?c.call(this,e[0],e[1],e[2]):void 0}else if(1===arguments.length){if(Number.isFinite(e)&&0!==e)return this.x=this.x%e,this.y=this.y%e,this.z=this.z%e,this}else if(2===arguments.length){var n=Array.prototype.slice.call(arguments);if(n.every(function(e){return Number.isFinite(e)})&&2===n.length)return u.call(this,n[0],n[1])}else if(3===arguments.length){var s=Array.prototype.slice.call(arguments);if(s.every(function(e){return Number.isFinite(e)})&&3===s.length)return c.call(this,s[0],s[1],s[2])}},a.default.Vector.prototype.sub=function(e,t,r){return e instanceof a.default.Vector?(this.x-=e.x||0,this.y-=e.y||0,this.z-=e.z||0):e instanceof Array?(this.x-=e[0]||0,this.y-=e[1]||0,this.z-=e[2]||0):(this.x-=e||0,this.y-=t||0,this.z-=r||0),this},a.default.Vector.prototype.mult=function(e,t,r){var o;return e instanceof a.default.Vector?Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)&&"number"==typeof e.x&&"number"==typeof e.y&&"number"==typeof e.z?(this.x*=e.x,this.y*=e.y,this.z*=e.z):console.warn("p5.Vector.prototype.mult:","x contains components that are either undefined or not finite numbers"):e instanceof Array?e.every(function(e){return Number.isFinite(e)})&&e.every(function(e){return"number"==typeof e})?1===e.length?(this.x*=e[0],this.y*=e[0],this.z*=e[0]):2===e.length?(this.x*=e[0],this.y*=e[1]):3===e.length&&(this.x*=e[0],this.y*=e[1],this.z*=e[2]):console.warn("p5.Vector.prototype.mult:","x contains elements that are either undefined or not finite numbers"):(o=Array.prototype.slice.call(arguments)).every(function(e){return Number.isFinite(e)})&&o.every(function(e){return"number"==typeof e})?(1===arguments.length&&(this.x*=e,this.y*=e,this.z*=e),2===arguments.length&&(this.x*=e,this.y*=t),3===arguments.length&&(this.x*=e,this.y*=t,this.z*=r)):console.warn("p5.Vector.prototype.mult:","x, y, or z arguments are either undefined or not a finite number"),this},a.default.Vector.prototype.div=function(e,t,r){if(e instanceof a.default.Vector)if(Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)&&"number"==typeof e.x&&"number"==typeof e.y&&"number"==typeof e.z){var o=0===e.z&&0===this.z;if(0===e.x||0===e.y||!o&&0===e.z)return console.warn("p5.Vector.prototype.div:","divide by 0"),this;this.x/=e.x,this.y/=e.y,o||(this.z/=e.z)}else console.warn("p5.Vector.prototype.div:","x contains components that are either undefined or not finite numbers");else if(e instanceof Array)if(e.every(function(e){return Number.isFinite(e)})&&e.every(function(e){return"number"==typeof e})){if(e.some(function(e){return 0===e}))return console.warn("p5.Vector.prototype.div:","divide by 0"),this;1===e.length?(this.x/=e[0],this.y/=e[0],this.z/=e[0]):2===e.length?(this.x/=e[0],this.y/=e[1]):3===e.length&&(this.x/=e[0],this.y/=e[1],this.z/=e[2])}else console.warn("p5.Vector.prototype.div:","x contains components that are either undefined or not finite numbers");else{o=Array.prototype.slice.call(arguments);if(o.every(function(e){return Number.isFinite(e)})&&o.every(function(e){return"number"==typeof e})){if(o.some(function(e){return 0===e}))return console.warn("p5.Vector.prototype.div:","divide by 0"),this;1===arguments.length&&(this.x/=e,this.y/=e,this.z/=e),2===arguments.length&&(this.x/=e,this.y/=t),3===arguments.length&&(this.x/=e,this.y/=t,this.z/=r)}else console.warn("p5.Vector.prototype.div:","x, y, or z arguments are either undefined or not a finite number")}return this},a.default.Vector.prototype.mag=function(){return Math.sqrt(this.magSq())},a.default.Vector.prototype.magSq=function(){var e=this.x,t=this.y,r=this.z;return e*e+t*t+r*r},a.default.Vector.prototype.dot=function(e,t,r){return e instanceof a.default.Vector?this.dot(e.x,e.y,e.z):this.x*(e||0)+this.y*(t||0)+this.z*(r||0)},a.default.Vector.prototype.cross=function(e){var t=this.y*e.z-this.z*e.y,r=this.z*e.x-this.x*e.z,e=this.x*e.y-this.y*e.x;return this.isPInst?new a.default.Vector(this._fromRadians,this._toRadians,t,r,e):new a.default.Vector(t,r,e)},a.default.Vector.prototype.dist=function(e){return e.copy().sub(this).mag()},a.default.Vector.prototype.normalize=function(){var e=this.mag();return 0!==e&&this.mult(1/e),this},a.default.Vector.prototype.limit=function(e){var t=this.magSq();return e*e<t&&this.div(Math.sqrt(t)).mult(e),this},a.default.Vector.prototype.setMag=function(e){return this.normalize().mult(e)},a.default.Vector.prototype.heading=function(){var e=Math.atan2(this.y,this.x);return this.isPInst?this._fromRadians(e):e},a.default.Vector.prototype.setHeading=function(e){this.isPInst&&(e=this._toRadians(e));var t=this.mag();return this.x=t*Math.cos(e),this.y=t*Math.sin(e),this},a.default.Vector.prototype.rotate=function(e){var e=this.heading()+e,t=(this.isPInst&&(e=this._toRadians(e)),this.mag());return this.x=Math.cos(e)*t,this.y=Math.sin(e)*t,this},a.default.Vector.prototype.angleBetween=function(e){var t=this.dot(e)/(this.mag()*e.mag()),t=Math.acos(Math.min(1,Math.max(-1,t)));return t*=Math.sign(this.cross(e).z||1),t=this.isPInst?this._fromRadians(t):t},a.default.Vector.prototype.lerp=function(e,t,r,o){return e instanceof a.default.Vector?this.lerp(e.x,e.y,e.z,t):(this.x+=(e-this.x)*o||0,this.y+=(t-this.y)*o||0,this.z+=(r-this.z)*o||0,this)},a.default.Vector.prototype.reflect=function(e){return e.normalize(),this.sub(e.mult(2*this.dot(e)))},a.default.Vector.prototype.array=function(){return[this.x||0,this.y||0,this.z||0]},a.default.Vector.prototype.equals=function(e,t,r){var o,n,e=e instanceof a.default.Vector?(o=e.x||0,n=e.y||0,e.z||0):e instanceof Array?(o=e[0]||0,n=e[1]||0,e[2]||0):(o=e||0,n=t||0,r||0);return this.x===o&&this.y===n&&this.z===e},a.default.Vector.fromAngle=function(e,t){return new a.default.Vector((t=void 0===t?1:t)*Math.cos(e),t*Math.sin(e),0)},a.default.Vector.fromAngles=function(e,t,r){void 0===r&&(r=1);var o=Math.cos(t),t=Math.sin(t),n=Math.cos(e),e=Math.sin(e);return new a.default.Vector(r*e*t,-r*n,r*e*o)},a.default.Vector.random2D=function(){return this.fromAngle(Math.random()*n.TWO_PI)},a.default.Vector.random3D=function(){var e=Math.random()*n.TWO_PI,t=2*Math.random()-1,r=Math.sqrt(1-t*t),o=r*Math.cos(e),r=r*Math.sin(e);return new a.default.Vector(o,r,t)},a.default.Vector.copy=function(e){return e.copy(e)},a.default.Vector.add=function(e,t,r){return r?r.set(e):(r=e.copy(),3===arguments.length&&a.default._friendlyError("The target parameter is undefined, it should be of type p5.Vector","p5.Vector.add")),r.add(t),r},a.default.Vector.rem=function(e,t){if(e instanceof a.default.Vector&&t instanceof a.default.Vector)return(e=e.copy()).rem(t),e},a.default.Vector.sub=function(e,t,r){return r?r.set(e):(r=e.copy(),3===arguments.length&&a.default._friendlyError("The target parameter is undefined, it should be of type p5.Vector","p5.Vector.sub")),r.sub(t),r},a.default.Vector.mult=function(e,t,r){return r?r.set(e):(r=e.copy(),3===arguments.length&&a.default._friendlyError("The target parameter is undefined, it should be of type p5.Vector","p5.Vector.mult")),r.mult(t),r},a.default.Vector.rotate=function(e,t,r){return 2===arguments.length?r=e.copy():(r instanceof a.default.Vector||a.default._friendlyError("The target parameter should be of type p5.Vector","p5.Vector.rotate"),r.set(e)),r.rotate(t),r},a.default.Vector.div=function(e,t,r){return r?r.set(e):(r=e.copy(),3===arguments.length&&a.default._friendlyError("The target parameter is undefined, it should be of type p5.Vector","p5.Vector.div")),r.div(t),r},a.default.Vector.dot=function(e,t){return e.dot(t)},a.default.Vector.cross=function(e,t){return e.cross(t)},a.default.Vector.dist=function(e,t){return e.dist(t)},a.default.Vector.lerp=function(e,t,r,o){return o?o.set(e):(o=e.copy(),4===arguments.length&&a.default._friendlyError("The target parameter is undefined, it should be of type p5.Vector","p5.Vector.lerp")),o.lerp(t,r),o},a.default.Vector.mag=function(e){return e.mag()},a.default.Vector.magSq=function(e){return e.magSq()},a.default.Vector.normalize=function(e,t){return arguments.length<2?t=e.copy():(t instanceof a.default.Vector||a.default._friendlyError("The target parameter should be of type p5.Vector","p5.Vector.normalize"),t.set(e)),t.normalize()},a.default.Vector.limit=function(e,t,r){return arguments.length<3?r=e.copy():(r instanceof a.default.Vector||a.default._friendlyError("The target parameter should be of type p5.Vector","p5.Vector.limit"),r.set(e)),r.limit(t)},a.default.Vector.setMag=function(e,t,r){return arguments.length<3?r=e.copy():(r instanceof a.default.Vector||a.default._friendlyError("The target parameter should be of type p5.Vector","p5.Vector.setMag"),r.set(e)),r.setMag(t)},a.default.Vector.heading=function(e){return e.heading()},a.default.Vector.angleBetween=function(e,t){return e.angleBetween(t)},a.default.Vector.reflect=function(e,t,r){return arguments.length<3?r=e.copy():(r instanceof a.default.Vector||a.default._friendlyError("The target parameter should be of type p5.Vector","p5.Vector.reflect"),r.set(e)),r.reflect(t)},a.default.Vector.array=function(e){return e.array()},a.default.Vector.equals=function(e,t){var r;return e instanceof a.default.Vector?r=e:e instanceof Array?r=(new a.default.Vector).set(e):a.default._friendlyError("The v1 parameter should be of type Array or p5.Vector","p5.Vector.equals"),r.equals(t)};var s=a.default.Vector;r.default=s},{"../core/constants":256,"../core/main":267,"core-js/modules/es.array.concat":149,"core-js/modules/es.array.every":151,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.slice":162,"core-js/modules/es.array.some":163,"core-js/modules/es.math.sign":168,"core-js/modules/es.number.constructor":169,"core-js/modules/es.number.is-finite":170,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.string.iterator":186,"core-js/modules/es.string.sub":192,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],301:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(e=e("../core/main"))&&e.__esModule?e:{default:e};var s="_lcg_random_state",o=4294967296,i=0,e=(n.default.prototype._lcg=function(e){return this[e]=(1664525*this[e]+1013904223)%o,this[e]/o},n.default.prototype._lcgSetSeed=function(e,t){this[e]=(null==t?Math.random()*o:t)>>>0},n.default.prototype.randomSeed=function(e){this._lcgSetSeed(s,e),this._gaussian_previous=!1},n.default.prototype.random=function(e,t){var r,o;return n.default._validateParameters("random",arguments),r=null!=this[s]?this._lcg(s):Math.random(),void 0===e?r:void 0===t?e instanceof Array?e[Math.floor(r*e.length)]:r*e:(t<e&&(o=e,e=t,t=o),r*(t-e)+e)},n.default.prototype.randomGaussian=function(e){var t,r,o,n,s=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1;if(this._gaussian_previous)t=i,this._gaussian_previous=!1;else{for(;1<=(n=(r=this.random(2)-1)*r+(o=this.random(2)-1)*o););t=r*(n=Math.sqrt(-2*Math.log(n)/n)),i=o*n,this._gaussian_previous=!0}return t*s+(e||0)},n.default);r.default=e},{"../core/main":267}],302:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(l=e("../core/main"))&&l.__esModule?l:{default:l},s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}n.default.prototype._angleMode=s.RADIANS,n.default.prototype.acos=function(e){return this._fromRadians(Math.acos(e))},n.default.prototype.asin=function(e){return this._fromRadians(Math.asin(e))},n.default.prototype.atan=function(e){return this._fromRadians(Math.atan(e))},n.default.prototype.atan2=function(e,t){return this._fromRadians(Math.atan2(e,t))},n.default.prototype.cos=function(e){return Math.cos(this._toRadians(e))},n.default.prototype.sin=function(e){return Math.sin(this._toRadians(e))},n.default.prototype.tan=function(e){return Math.tan(this._toRadians(e))},n.default.prototype.degrees=function(e){return e*s.RAD_TO_DEG},n.default.prototype.radians=function(e){return e*s.DEG_TO_RAD},n.default.prototype.angleMode=function(e){if(n.default._validateParameters("angleMode",arguments),void 0===e)return this._angleMode;e!==s.DEGREES&&e!==s.RADIANS||(this._angleMode=e)},n.default.prototype._toRadians=function(e){return this._angleMode===s.DEGREES?e*s.DEG_TO_RAD:e},n.default.prototype._toDegrees=function(e){return this._angleMode===s.RADIANS?e*s.RAD_TO_DEG:e},n.default.prototype._fromRadians=function(e){return this._angleMode===s.DEGREES?e*s.RAD_TO_DEG:e};var l=n.default;r.default=l},{"../core/constants":256,"../core/main":267,"core-js/modules/es.array.iterator":158,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],303:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(e=e("../core/main"))&&e.__esModule?e:{default:e};n.default.prototype.textAlign=function(e,t){var r;return n.default._validateParameters("textAlign",arguments),(r=this._renderer).textAlign.apply(r,arguments)},n.default.prototype.textLeading=function(e){var t;return n.default._validateParameters("textLeading",arguments),(t=this._renderer).textLeading.apply(t,arguments)},n.default.prototype.textSize=function(e){var t;return n.default._validateParameters("textSize",arguments),(t=this._renderer).textSize.apply(t,arguments)},n.default.prototype.textStyle=function(e){var t;return n.default._validateParameters("textStyle",arguments),(t=this._renderer).textStyle.apply(t,arguments)},n.default.prototype.textWidth=function(){for(var e,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return r[0]+="",n.default._validateParameters("textWidth",r),0===r[0].length?0:(e=this._renderer).textWidth.apply(e,r)},n.default.prototype.textAscent=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.default._validateParameters("textAscent",t),this._renderer.textAscent()},n.default.prototype.textDescent=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.default._validateParameters("textDescent",t),this._renderer.textDescent()},n.default.prototype._updateTextMetrics=function(){return this._renderer._updateTextMetrics()},n.default.prototype.textWrap=function(e){if("WORD"!==e&&"CHAR"!==e)throw"Error: textWrap accepts only WORD or CHAR";return this._renderer.textWrap(e)};e=n.default;r.default=e},{"../core/main":267}],304:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.last-index-of"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.last-index-of"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.split"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var l=(c=e("../core/main"))&&c.__esModule?c:{default:c},n=s(e("../core/constants")),u=s(e("opentype.js"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}function s(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o,n={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e)Object.prototype.hasOwnProperty.call(e,r)&&((o=s?Object.getOwnPropertyDescriptor(e,r):null)&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]);return n.default=e,t&&t.set(e,n),n}e("../core/friendly_errors/validate_params"),e("../core/friendly_errors/file_errors"),e("../core/friendly_errors/fes_core"),l.default.prototype.loadFont=function(o,n,s){l.default._validateParameters("loadFont",arguments);var i=new l.default.Font(this),a=this;return u.load(o,function(e,t){if(e)return l.default._friendlyFileLoadError(4,o),void 0!==s?s(e):void console.error(e,o);i.font=t,void 0!==n&&n(i),a._decrementPreload();var e=o.split("\\").pop().split("/").pop(),t=e.lastIndexOf("."),r=t<1?null:e.slice(t+1);["ttf","otf","woff","woff2"].includes(r)&&(r=e.slice(0,-1!==t?t:0),(e=document.createElement("style")).appendChild(document.createTextNode("\n@font-face {\nfont-family: ".concat(r,";\nsrc: url(").concat(o,");\n}\n"))),document.head.appendChild(e))}),i},l.default.prototype.text=function(e,t,r,o,n){var s;return l.default._validateParameters("text",arguments),this._renderer._doFill||this._renderer._doStroke?(s=this._renderer).text.apply(s,arguments):this},l.default.prototype.textFont=function(e,t){if(l.default._validateParameters("textFont",arguments),arguments.length){if(e)return this._renderer._setProperty("_textFont",e),t&&(this._renderer._setProperty("_textSize",t),this._renderer._leadingSet||this._renderer._setProperty("_textLeading",t*n._DEFAULT_LEADMULT)),this._renderer._applyTextProperties();throw new Error("null font passed to textFont")}return this._renderer._textFont};var c=l.default;r.default=c},{"../core/constants":256,"../core/friendly_errors/fes_core":258,"../core/friendly_errors/file_errors":259,"../core/friendly_errors/validate_params":262,"../core/main":267,"core-js/modules/es.array.concat":149,"core-js/modules/es.array.includes":156,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.last-index-of":160,"core-js/modules/es.array.slice":162,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.string.iterator":186,"core-js/modules/es.string.split":191,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230,"opentype.js":241}],305:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.splice"),e("core-js/modules/es.function.name"),e("core-js/modules/es.number.to-fixed"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.splice"),e("core-js/modules/es.function.name"),e("core-js/modules/es.number.to-fixed"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(n=e("../core/main"))&&n.__esModule?n:{default:n},v=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==p(e)&&"function"!=typeof e)return{default:e};var t=i();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants"));function i(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,i=function(){return e},e)}function p(e){return(p="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}function m(e,t){var r=e.length;return e[t<0?t%r+r:t%r]}function y(e,t,r,o){var n,s,i;return o?(void 0===y.tmpPoint1&&(y.tmpPoint1=[],y.tmpPoint2=[]),s=y.tmpPoint1,i=y.tmpPoint2,s.x=t.x-e.x,s.y=t.y-e.y,i.x=r.x-t.x,i.y=r.y-t.y,n=s.x*i.x+s.y*i.y,s=Math.sqrt(s.x*s.x+s.y*s.y),i=Math.sqrt(i.x*i.x+i.y*i.y),Math.acos(n/(s*i))<o):0==(t[0]-e[0])*(r[1]-e[1])-(r[0]-e[0])*(t[1]-e[1])}function d(e,t,r,o,n,s,i,a,l){var u=1-l,c=Math.pow(u,3),d=Math.pow(u,2),f=l*l,h=f*l,p=c*e+3*d*l*r+3*u*l*l*n+h*i,c=c*t+3*d*l*o+3*u*l*l*s+h*a,d=e+2*l*(r-e)+f*(n-2*r+e),h=t+2*l*(o-t)+f*(s-2*o+t),m=r+2*l*(n-r)+f*(i-2*n+r),f=o+2*l*(s-o)+f*(a-2*s+o),e=u*e+l*r,r=u*t+l*o,t=u*n+l*i,o=u*s+l*a,n=90-180*Math.atan2(d-m,h-f)/Math.PI;return(m<d||h<f)&&(n+=180),{x:p,y:c,m:{x:d,y:h},n:{x:m,y:f},start:{x:e,y:r},end:{x:t,y:o},alpha:n}}function f(e,t,r,o,n,s,i,a,l){return null==l?h(e,t,r,o,n,s,i,a):d(e,t,r,o,n,s,i,a,function(e,t,r,o,n,s,i,a,l){if(!(l<0||h(e,t,r,o,n,s,i,a)<l)){var u,c=.5,d=1-c;for(u=h(e,t,r,o,n,s,i,a,d);.01<Math.abs(u-l);)u=h(e,t,r,o,n,s,i,a,d+=(u<l?1:-1)*(c/=2));return d}}(e,t,r,o,n,s,i,a,l))}function g(e,t,r){for(var o,n,s,i,a,l=0,u=0,c=(e=function(e,t){function r(e,t,r){var o,n;if(!e)return["C",t.x,t.y,t.x,t.y,t.x,t.y];switch(e[0]in{T:1,Q:1}||(t.qx=t.qy=null),e[0]){case"M":t.X=e[1],t.Y=e[2];break;case"A":e=["C"].concat(E.apply(0,[t.x,t.y].concat(e.slice(1))));break;case"S":n="C"===r||"S"===r?(o=2*t.x-t.bx,2*t.y-t.by):(o=t.x,t.y),e=["C",o,n].concat(e.slice(1));break;case"T":"Q"===r||"T"===r?(t.qx=2*t.x-t.qx,t.qy=2*t.y-t.qy):(t.qx=t.x,t.qy=t.y),e=["C"].concat(x(t.x,t.y,t.qx,t.qy,e[1],e[2]));break;case"Q":t.qx=e[1],t.qy=e[2],e=["C"].concat(x(t.x,t.y,e[1],e[2],e[3],e[4]));break;case"L":e=["C"].concat(_(t.x,t.y,e[1],e[2]));break;case"H":e=["C"].concat(_(t.x,t.y,e[1],t.y));break;case"V":e=["C"].concat(_(t.x,t.y,t.x,e[1]));break;case"Z":e=["C"].concat(_(t.x,t.y,t.X,t.Y))}return e}function o(e,t){if(7<e[t].length){e[t].shift();for(var r=e[t];r.length;)c[t]="A",a&&(d[t]="A"),e.splice(t++,0,["C"].concat(r.splice(0,6)));e.splice(t,1),s=Math.max(i.length,a&&a.length||0)}}function n(e,t,r,o,n){e&&t&&"M"===e[n][0]&&"M"!==t[n][0]&&(t.splice(n,0,["M",o.x,o.y]),r.bx=0,r.by=0,r.x=e[n][1],r.y=e[n][2],s=Math.max(i.length,a&&a.length||0))}var s,i=b(e),a=t&&b(t),l={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},u={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},c=[],d=[],f="",h="";s=Math.max(i.length,a&&a.length||0);for(var p=0;p<s;p++){"C"!==(f=i[p]?i[p][0]:f)&&(c[p]=f,p&&(h=c[p-1])),i[p]=r(i[p],l,h),"A"!==c[p]&&"C"===f&&(c[p]="C"),o(i,p),a&&("C"!==(f=a[p]?a[p][0]:f)&&(d[p]=f,p&&(h=d[p-1])),a[p]=r(a[p],u,h),"A"!==d[p]&&"C"===f&&(d[p]="C"),o(a,p)),n(i,a,l,u,p),n(a,i,u,l,p);var m=i[p],y=a&&a[p],g=m.length,v=a&&y.length;l.x=m[g-2],l.y=m[g-1],l.bx=parseFloat(m[g-4])||l.x,l.by=parseFloat(m[g-3])||l.y,u.bx=a&&(parseFloat(y[v-4])||u.x),u.by=a&&(parseFloat(y[v-3])||u.y),u.x=a&&y[v-2],u.y=a&&y[v-1]}return a?[i,a]:i}(e)).length;u<c;u++){if("M"===(s=e[u])[0])o=+s[1],n=+s[2];else{if(t<l+(i=f(o,n,s[1],s[2],s[3],s[4],s[5],s[6]))&&!r)return{x:(a=f(o,n,s[1],s[2],s[3],s[4],s[5],s[6],t-l)).x,y:a.y,alpha:a.alpha};l+=i,o=+s[5],n=+s[6]}s.shift()}return a=(a=r?l:d(o,n,s[0],s[1],s[2],s[3],s[4],s[5],1)).alpha?{x:a.x,y:a.y,alpha:a.alpha}:a}function b(e){var t=[],r=0,o=0,n=0,s=0,i=0;if(e){"M"===e[0][0]&&(n=r=+e[0][1],s=o=+e[0][2],i++,t[0]=["M",r,o]);for(var a,l,u=3===e.length&&"M"===e[0][0]&&"R"===e[1][0].toUpperCase()&&"Z"===e[2][0].toUpperCase(),c=i,d=e.length;c<d;c++){if(t.push(a=[]),(l=e[c])[0]!==String.prototype.toUpperCase.call(l[0]))switch(a[0]=String.prototype.toUpperCase.call(l[0]),a[0]){case"A":a[1]=l[1],a[2]=l[2],a[3]=l[3],a[4]=l[4],a[5]=l[5],a[6]=+(l[6]+r),a[7]=+(l[7]+o);break;case"V":a[1]=+l[1]+o;break;case"H":a[1]=+l[1]+r;break;case"R":for(var f,h=2,p=(f=[r,o].concat(l.slice(1))).length;h<p;h++)f[h]=+f[h]+r,f[++h]=+f[h]+o;t.pop(),t=t.concat(j(f,u));break;case"M":n=+l[1]+r,s=+l[2]+o;break;default:for(var m=1,y=l.length;m<y;m++)a[m]=+l[m]+(m%2?r:o)}else if("R"===l[0])f=[r,o].concat(l.slice(1)),t.pop(),t=t.concat(j(f,u)),a=["R"].concat(l.slice(-2));else for(var g=0,v=l.length;g<v;g++)a[g]=l[g];switch(a[0]){case"Z":r=n,o=s;break;case"H":r=a[1];break;case"V":o=a[1];break;case"M":n=a[a.length-2],s=a[a.length-1];break;default:r=a[a.length-2],o=a[a.length-1]}}}return t}function E(e,t,r,o,n,s,i,a,l,u){function c(e,t,r){return{x:e*Math.cos(r)-t*Math.sin(r),y:e*Math.sin(r)+t*Math.cos(r)}}var d,f=Math.PI,h=120*f/180,p=f/180*(+n||0),m=[],y=(u?(x=u[0],d=u[1],j=u[2],_=u[3]):(e=(v=c(e,t,-p)).x,t=v.y,1<(y=(g=(e-(a=(v=c(a,l,-p)).x))/2)*g/(r*r)+(v=(t-(l=v.y))/2)*v/(o*o))&&(r*=y=Math.sqrt(y),o*=y),y=r*r,b=o*o,j=(s=(s===i?-1:1)*Math.sqrt(Math.abs((y*b-y*v*v-b*g*g)/(y*v*v+b*g*g))))*r*v/o+(e+a)/2,_=s*-o*g/r+(t+l)/2,x=Math.asin(((t-_)/o).toFixed(9)),d=Math.asin(((l-_)/o).toFixed(9)),(x=e<j?f-x:x)<0&&(x=2*f+x),(d=a<j?f-d:d)<0&&(d=2*f+d),i&&d<x&&(x-=2*f),!i&&x<d&&(d-=2*f)),d-x),g=(Math.abs(y)>h&&(b=d,v=a,s=l,d=x+h*(i&&x<d?1:-1),m=E(a=j+r*Math.cos(d),l=_+o*Math.sin(d),r,o,n,0,i,v,s,[d,b,j,_])),y=d-x,Math.cos(x)),f=Math.sin(x),h=Math.cos(d),n=Math.sin(d),i=Math.tan(y/4),v=4/3*r*i,s=4/3*o*i,b=[e,t],j=[e+v*f,t-s*g],_=[a+v*n,l-s*h],x=[a,l];if(j[0]=2*b[0]-j[0],j[1]=2*b[1]-j[1],u)return[j,_,x].concat(m);for(var w=[],S=0,M=(m=[j,_,x].concat(m).join().split(",")).length;S<M;S++)w[S]=S%2?c(m[S-1],m[S],p).y:c(m[S],m[S+1],p).x;return w}function j(e,t){for(var r=[],o=0,n=e.length;o<n-2*!t;o+=2){var s=[{x:+e[o-2],y:+e[o-1]},{x:+e[o],y:+e[o+1]},{x:+e[o+2],y:+e[o+3]},{x:+e[o+4],y:+e[o+5]}];t?o?n-4===o?s[3]={x:+e[0],y:+e[1]}:n-2===o&&(s[2]={x:+e[0],y:+e[1]},s[3]={x:+e[2],y:+e[3]}):s[0]={x:+e[n-2],y:+e[n-1]}:n-4===o?s[3]=s[2]:o||(s[0]={x:+e[o],y:+e[o+1]}),r.push(["C",(-s[0].x+6*s[1].x+s[2].x)/6,(-s[0].y+6*s[1].y+s[2].y)/6,(s[1].x+6*s[2].x-s[3].x)/6,(s[1].y+6*s[2].y-s[3].y)/6,s[2].x,s[2].y])}return r}function _(e,t,r,o){return[e,t,r,o,r,o]}function x(e,t,r,o,n,s){return[1/3*e+2/3*r,1/3*t+2/3*o,1/3*n+2/3*r,1/3*s+2/3*o,n,s]}function h(e,t,r,o,n,s,i,a,l){for(var u=(l=1<(l=null==l?1:l)?1:l<0?0:l)/2,c=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],d=0,f=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],h=0;h<12;h++){var p=u*c[h]+u,m=w(p,e,r,n,i),p=w(p,t,o,s,a);d+=f[h]*Math.sqrt(m*m+p*p)}return u*d}function w(e,t,r,o,n){return e*(e*(-3*t+9*r-9*o+3*n)+6*t-12*r+6*o)-3*t+3*r}n.default.Font=function(e){this.parent=e,this.cache={},this.font=void 0},n.default.Font.prototype.textBounds=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,o=3<arguments.length?arguments[3]:void 0,n=4<arguments.length?arguments[4]:void 0,s=n&&n.renderer&&n.renderer._pInst||this.parent,i=s._renderer.drawingContext,o=(i.textAlign||v.LEFT,i.textBaseline||v.BASELINE,o||s._renderer._textSize);if(!g){for(var a=[],l=[],u=[],c=(u[0]=[],[]),d=this._scale(o),f=s._renderer.textLeading(),h=0,p=(this.font.forEachGlyph(e,t,r,o,n,function(e,t,r,o){var n=e.getMetrics();0===e.index||10===e.index?u[h+=1]=[]:(u[h].push(t+n.xMin*d),u[h].push(t+n.xMax*d),c.push(r+h*f+-n.yMin*d),c.push(r+h*f+-n.yMax*d))}),0<u[h].length&&(a[h]=Math.min.apply(null,u[h]),l[h]=Math.max.apply(null,u[h])),0),m=0;m<=h;m++){a[m]=Math.min.apply(null,u[m]),l[m]=Math.max.apply(null,u[m]);var y=l[m]-a[m];p<y&&(p=y)}var i=Math.min.apply(null,a),g={x:i,y:r=Math.min.apply(null,c),h:Math.max.apply(null,c)-r,w:p,advance:i-t},o=this._handleAlignment(s._renderer,e,g.x,g.y,g.w+g.advance);g.x=o.x,g.y=o.y}return g},n.default.Font.prototype.textToPoints=function(e,t,r,o,n){var s=0,i=[],a=this._getGlyphs(e);o=o||this.parent._renderer._textSize;for(var l,u=0;u<a.length;u++){if(!(a[l=u].name&&"space"===a[l].name||e.length===a.length&&" "===e[l]))for(var c=function(e){for(var t,r=[],o=0;o<e.length;o++)"M"===e[o].type&&(t&&r.push(t),t=[]),t.push(function(e){var t=[e.type];"M"===e.type||"L"===e.type?t.push(e.x,e.y):"C"===e.type?t.push(e.x1,e.y1,e.x2,e.y2,e.x,e.y):"Q"===e.type&&t.push(e.x1,e.y1,e.x,e.y);return t}(e[o]));return r.push(t),r}(a[u].getPath(t,r,o).commands),d=0;d<c.length;d++)for(var f=function(e,t){for(var t=function(e,t){if("object"!==p(e))e=t;else for(var r in t)void 0===e[r]&&(e[r]=t[r]);return e}(t,{sampleFactor:.1,simplifyThreshold:0}),r=g(e,0,1),o=r/(r*t.sampleFactor),n=[],s=0;s<r;s+=o)n.push(g(e,s));t.simplifyThreshold&&!function(e){for(var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,r=0,o=e.length-1;3<e.length&&0<=o;--o)y(m(e,o-1),m(e,o),m(e,o+1),t)&&(e.splice(o%e.length,1),r++)}(n,t.simplifyThreshold);return n}(c[d],n),h=0;h<f.length;h++)f[h].x+=s,i.push(f[h]);s+=a[u].advanceWidth*this._scale(o)}return i},n.default.Font.prototype._getGlyphs=function(e){return this.font.stringToGlyphs(e)},n.default.Font.prototype._getPath=function(e,t,r,o){var n=(o&&o.renderer&&o.renderer._pInst||this.parent)._renderer,t=this._handleAlignment(n,e,t,r);return this.font.getPath(e,t.x,t.y,n._textSize,o)},n.default.Font.prototype._getPathData=function(e,t,r,o){var n=3;return"string"==typeof e&&2<arguments.length?e=this._getPath(e,t,r,o):"object"===p(t)&&(o=t),o&&"number"==typeof o.decimals&&(n=o.decimals),e.toPathData(n)},n.default.Font.prototype._getSVG=function(e,t,r,o){var n=3;return"string"==typeof e&&2<arguments.length?e=this._getPath(e,t,r,o):"object"===p(t)&&(o=t),o&&("number"==typeof o.decimals&&(n=o.decimals),"number"==typeof o.strokeWidth&&(e.strokeWidth=o.strokeWidth),void 0!==o.fill&&(e.fill=o.fill),void 0!==o.stroke&&(e.stroke=o.stroke)),e.toSVG(n)},n.default.Font.prototype._renderPath=function(e,t,r,o){var n=o&&o.renderer||this.parent._renderer,s=n.drawingContext,e=("object"===p(e)&&e.commands?e:this._getPath(e,t,r,o)).commands,i=(s.beginPath(),!0),t=!1,r=void 0;try{for(var a,l=e[Symbol.iterator]();!(i=(a=l.next()).done);i=!0){var u=a.value;"M"===u.type?s.moveTo(u.x,u.y):"L"===u.type?s.lineTo(u.x,u.y):"C"===u.type?s.bezierCurveTo(u.x1,u.y1,u.x2,u.y2,u.x,u.y):"Q"===u.type?s.quadraticCurveTo(u.x1,u.y1,u.x,u.y):"Z"===u.type&&s.closePath()}}catch(e){t=!0,r=e}finally{try{i||null==l.return||l.return()}finally{if(t)throw r}}return n._doStroke&&n._strokeSet&&s.stroke(),n._doFill&&(n._fillSet||n._setFill(v._DEFAULT_TEXT_FILL),s.fill()),this},n.default.Font.prototype._textWidth=function(e,t){return this.font.getAdvanceWidth(e,t)},n.default.Font.prototype._textAscent=function(e){return this.font.ascender*this._scale(e)},n.default.Font.prototype._textDescent=function(e){return-this.font.descender*this._scale(e)},n.default.Font.prototype._scale=function(e){return 1/this.font.unitsPerEm*(e||this.parent._renderer._textSize)},n.default.Font.prototype._handleAlignment=function(e,t,r,o,n){var s=e._textSize;switch(void 0===n&&(n=this._textWidth(t,s)),e._textAlign){case v.CENTER:r-=n/2;break;case v.RIGHT:r-=n}switch(e._textBaseline){case v.TOP:o+=this._textAscent(s);break;case v.CENTER:o+=this._textAscent(s)/2;break;case v.BOTTOM:o-=this._textDescent(s)}return{x:r,y:o}};e=n.default;r.default=e},{"../core/constants":256,"../core/main":267,"core-js/modules/es.array.concat":149,"core-js/modules/es.array.fill":152,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.join":159,"core-js/modules/es.array.slice":162,"core-js/modules/es.array.splice":164,"core-js/modules/es.function.name":165,"core-js/modules/es.number.to-fixed":171,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.string.iterator":186,"core-js/modules/es.string.split":191,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],306:[function(e,t,r){"use strict";e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.splice"),e("core-js/modules/es.array-buffer.constructor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.splice"),e("core-js/modules/es.array-buffer.constructor"),e("core-js/modules/es.object.to-string"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;e=(e=e("../core/main"))&&e.__esModule?e:{default:e};e.default.prototype.append=function(e,t){return e.push(t),e},e.default.prototype.arrayCopy=function(e,t,r,o,n){var s,i;e=void 0!==n?(i=Math.min(n,e.length),s=o,e.slice(t,i+t)):(i=void 0!==r?(i=r,Math.min(i,e.length)):e.length,r=t,e.slice(s=0,i)),Array.prototype.splice.apply(r,[s,i].concat(e))},e.default.prototype.concat=function(e,t){return e.concat(t)},e.default.prototype.reverse=function(e){return e.reverse()},e.default.prototype.shorten=function(e){return e.pop(),e},e.default.prototype.shuffle=function(e,t){for(var r,o,n=ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(e),s=(e=t||n?e:e.slice()).length;1<s;)r=this.random(0,1)*s|0,o=e[--s],e[s]=e[r],e[r]=o;return e},e.default.prototype.sort=function(e,t){var r=t?e.slice(0,Math.min(t,e.length)):e,t=t?e.slice(Math.min(t,e.length)):[];return(r="string"==typeof r[0]?r.sort():r.sort(function(e,t){return e-t})).concat(t)},e.default.prototype.splice=function(e,t,r){return Array.prototype.splice.apply(e,[r,0].concat(t)),e},e.default.prototype.subset=function(e,t,r){return void 0!==r?e.slice(t,t+r):e.slice(t,e.length)};e=e.default;r.default=e},{"../core/main":267,"core-js/modules/es.array-buffer.constructor":148,"core-js/modules/es.array.concat":149,"core-js/modules/es.array.slice":162,"core-js/modules/es.array.splice":164,"core-js/modules/es.object.to-string":177}],307:[function(e,t,r){"use strict";e("core-js/modules/es.array.map"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.repeat"),e("core-js/modules/es.array.map"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.repeat"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=(e=e("../core/main"))&&e.__esModule?e:{default:e};o.default.prototype.float=function(e){return e instanceof Array?e.map(parseFloat):parseFloat(e)},o.default.prototype.int=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:10;return e===1/0||"Infinity"===e?1/0:e===-1/0||"-Infinity"===e?-1/0:"string"==typeof e?parseInt(e,t):"number"==typeof e?0|e:"boolean"==typeof e?e?1:0:e instanceof Array?e.map(function(e){return o.default.prototype.int(e,t)}):void 0},o.default.prototype.str=function(e){return e instanceof Array?e.map(o.default.prototype.str):String(e)},o.default.prototype.boolean=function(e){return"number"==typeof e?0!==e:"string"==typeof e?"true"===e.toLowerCase():"boolean"==typeof e?e:e instanceof Array?e.map(o.default.prototype.boolean):void 0},o.default.prototype.byte=function(e){e=o.default.prototype.int(e,10);return"number"==typeof e?(e+128)%256-128:e instanceof Array?e.map(o.default.prototype.byte):void 0},o.default.prototype.char=function(e){return"number"!=typeof e||isNaN(e)?e instanceof Array?e.map(o.default.prototype.char):"string"==typeof e?o.default.prototype.char(parseInt(e,10)):void 0:String.fromCharCode(e)},o.default.prototype.unchar=function(e){return"string"==typeof e&&1===e.length?e.charCodeAt(0):e instanceof Array?e.map(o.default.prototype.unchar):void 0},o.default.prototype.hex=function(e,t){if(t=null==t?8:t,e instanceof Array)return e.map(function(e){return o.default.prototype.hex(e,t)});if(e===1/0||e===-1/0)return(e===1/0?"F":"0").repeat(t);if("number"==typeof e){e<0&&(e=4294967295+e+1);for(var r=Number(e).toString(16).toUpperCase();r.length<t;)r="0".concat(r);return r=r.length>=t?r.substring(r.length-t,r.length):r}},o.default.prototype.unhex=function(e){return e instanceof Array?e.map(o.default.prototype.unhex):parseInt("0x".concat(e),16)};e=o.default;r.default=e},{"../core/main":267,"core-js/modules/es.array.map":161,"core-js/modules/es.number.constructor":169,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.string.repeat":188}],308:[function(e,t,r){"use strict";e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.trim"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.join"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.constructor"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.replace"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.trim"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var s=(l=e("../core/main"))&&l.__esModule?l:{default:l};function o(e,t,r){var o=e<0,e=o?e.toString().substring(1):e.toString(),n=e.indexOf("."),s=-1!==n?e.substring(0,n):e,i=-1!==n?e.substring(n+1):"",a=o?"-":"";if(void 0!==r){o="";(-1!==n||0<r-i.length)&&(o="."),i.length>r&&(i=i.substring(0,r));for(var l=0;l<t-s.length;l++)a+="0";for(var a=(a+=s)+o+i,u=0;u<r-i.length;u++)a+="0";return a}for(var c=0;c<Math.max(t-s.length,0);c++)a+="0";return a+=e}function n(e,t){var r=(e=e.toString()).indexOf("."),o=-1!==r?e.substring(r):"",e=(e=-1!==r?e.substring(0,r):e).toString().replace(/\B(?=(\d{3})+(?!\d))/g,",");if(0===t)o="";else if(void 0!==t)if(t>o.length)for(var n=t-(o+=-1===r?".":"").length+1,s=0;s<n;s++)o+="0";else o=o.substring(0,t+1);return e+o}function i(e){return 0<parseFloat(e)?"+".concat(e.toString()):e.toString()}function a(e){return 0<=parseFloat(e)?" ".concat(e.toString()):e.toString()}e("../core/friendly_errors/validate_params"),e("../core/friendly_errors/file_errors"),e("../core/friendly_errors/fes_core"),s.default.prototype.join=function(e,t){return s.default._validateParameters("join",arguments),e.join(t)},s.default.prototype.match=function(e,t){return s.default._validateParameters("match",arguments),e.match(t)},s.default.prototype.matchAll=function(e,t){s.default._validateParameters("matchAll",arguments);for(var r=new RegExp(t,"g"),o=r.exec(e),n=[];null!==o;)n.push(o),o=r.exec(e);return n},s.default.prototype.nf=function(e,t,r){return s.default._validateParameters("nf",arguments),e instanceof Array?e.map(function(e){return o(e,t,r)}):"[object Arguments]"===Object.prototype.toString.call(e)?3===e.length?this.nf(e[0],e[1],e[2]):2===e.length?this.nf(e[0],e[1]):this.nf(e[0]):o(e,t,r)},s.default.prototype.nfc=function(e,t){return s.default._validateParameters("nfc",arguments),e instanceof Array?e.map(function(e){return n(e,t)}):n(e,t)},s.default.prototype.nfp=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];s.default._validateParameters("nfp",t);var o=s.default.prototype.nf.apply(this,t);return o instanceof Array?o.map(i):i(o)},s.default.prototype.nfs=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];s.default._validateParameters("nfs",t);var o=s.default.prototype.nf.apply(this,t);return o instanceof Array?o.map(a):a(o)},s.default.prototype.split=function(e,t){return s.default._validateParameters("split",arguments),e.split(t)},s.default.prototype.splitTokens=function(e,t){var r,o;return s.default._validateParameters("splitTokens",arguments),o=void 0!==t?(o=/\]/g.exec(t=t),(r=/\[/g.exec(t))&&o?(t=t.slice(0,o.index)+t.slice(o.index+1),r=/\[/g.exec(t),t=t.slice(0,r.index)+t.slice(r.index+1),new RegExp("[\\[".concat(t,"\\]]"),"g")):o?(t=t.slice(0,o.index)+t.slice(o.index+1),new RegExp("[".concat(t,"\\]]"),"g")):r?(t=t.slice(0,r.index)+t.slice(r.index+1),new RegExp("[".concat(t,"\\[]"),"g")):new RegExp("[".concat(t,"]"),"g")):/\s/g,e.split(o).filter(function(e){return e})},s.default.prototype.trim=function(e){return s.default._validateParameters("trim",arguments),e instanceof Array?e.map(this.trim):e.trim()};var l=s.default;r.default=l},{"../core/friendly_errors/fes_core":258,"../core/friendly_errors/file_errors":259,"../core/friendly_errors/validate_params":262,"../core/main":267,"core-js/modules/es.array.filter":153,"core-js/modules/es.array.index-of":157,"core-js/modules/es.array.join":159,"core-js/modules/es.array.map":161,"core-js/modules/es.array.slice":162,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.constructor":180,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.string.match":187,"core-js/modules/es.string.replace":189,"core-js/modules/es.string.split":191,"core-js/modules/es.string.trim":193}],309:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;e=(e=e("../core/main"))&&e.__esModule?e:{default:e};e.default.prototype.day=function(){return(new Date).getDate()},e.default.prototype.hour=function(){return(new Date).getHours()},e.default.prototype.minute=function(){return(new Date).getMinutes()},e.default.prototype.millis=function(){return-1===this._millisStart?0:window.performance.now()-this._millisStart},e.default.prototype.month=function(){return(new Date).getMonth()+1},e.default.prototype.second=function(){return(new Date).getSeconds()},e.default.prototype.year=function(){return(new Date).getFullYear()};e=e.default;r.default=e},{"../core/main":267}],310:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.math.hypot"),e("core-js/modules/es.number.to-fixed"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.math.hypot"),e("core-js/modules/es.number.to-fixed"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var S=(n=e("../core/main"))&&n.__esModule?n:{default:n},_=(e("./p5.Geometry"),function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants")));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}S.default.prototype.plane=function(e,t,r,o){this._assert3d("plane"),S.default._validateParameters("plane",arguments),void 0===e&&(e=50),void 0===t&&(t=e),void 0===o&&(o=1);var n,s="plane|".concat(r=void 0===r?1:r,"|").concat(o);return this._renderer.geometryInHash(s)||((n=new S.default.Geometry(r,o,function(){for(var e,t,r=0;r<=this.detailY;r++)for(var o=r/this.detailY,n=0;n<=this.detailX;n++)e=n/this.detailX,t=new S.default.Vector(e-.5,o-.5,0),this.vertices.push(t),this.uvs.push(e,o)})).computeFaces().computeNormals(),r<=1&&o<=1?n._makeTriangleEdges()._edgesToVertices():this._renderer._doStroke&&console.log("Cannot draw stroke on plane objects with more than 1 detailX or 1 detailY"),this._renderer.createBuffers(s,n)),this._renderer.drawBuffersScaled(s,e,t,1),this},S.default.prototype.box=function(e,t,r,o,n){this._assert3d("box"),S.default._validateParameters("box",arguments),void 0===e&&(e=50),void 0===t&&(t=e),void 0===r&&(r=t);var s,i=this._renderer.attributes&&this._renderer.attributes.perPixelLighting,i=(void 0===n&&(n=i?1:4),"box|".concat(o=void 0===o?i?1:4:o,"|").concat(n));return this._renderer.geometryInHash(i)||((s=new S.default.Geometry(o,n,function(){var e=[[0,4,2,6],[1,3,5,7],[0,1,4,5],[2,6,3,7],[0,2,1,3],[4,5,6,7]];this.strokeIndices=[[0,1],[1,3],[3,2],[6,7],[8,9],[9,11],[14,15],[16,17],[17,19],[18,19],[20,21],[22,23]];for(var t=0;t<e.length;t++){for(var r=e[t],o=4*t,n=0;n<4;n++){var s=r[n],s=new S.default.Vector((2*(1&s)-1)/2,((2&s)-1)/2,((4&s)/2-1)/2);this.vertices.push(s),this.uvs.push(1&n,(2&n)/2)}this.faces.push([o,1+o,2+o]),this.faces.push([2+o,1+o,3+o])}})).computeNormals(),o<=4&&n<=4?s._makeTriangleEdges()._edgesToVertices():this._renderer._doStroke&&console.log("Cannot draw stroke on box objects with more than 4 detailX or 4 detailY"),this._renderer.createBuffers(i,s)),this._renderer.drawBuffersScaled(i,e,t,r),this},S.default.prototype.sphere=function(e,t,r){return this._assert3d("sphere"),S.default._validateParameters("sphere",arguments),this.ellipsoid(e=void 0===e?50:e,e,e,t=void 0===t?24:t,r=void 0===r?16:r),this};function l(e,t,r,o,n,s,i){e=e<=0?1:e,t=t<0?0:t,r=r<=0?e:r,o=o<3?3:o;for(var a,l,u=(s=void 0===s||s)?-2:0,c=(n=n<1?1:n)+((i=void 0===i?0!==t:i)?2:0),d=Math.atan2(e-t,r),f=Math.sin(d),h=Math.cos(d),p=u;p<=c;++p){var m=p/n,y=r*m,g=void 0,g=p<0?(m=y=0,e):n<p?(y=r,m=1,t):e+(t-e)*m;for(-2!==p&&p!==n+2||(g=0),y-=r/2,a=0;a<o;++a){var v=a/(o-1),b=2*Math.PI*v,j=Math.sin(b),b=Math.cos(b),_=(this.vertices.push(new S.default.Vector(j*g,y,b*g)),void 0),_=p<0?new S.default.Vector(0,-1,0):n<p&&t?new S.default.Vector(0,1,0):new S.default.Vector(j*h,f,b*h);this.vertexNormals.push(_),this.uvs.push(v,m)}}var x=0;if(s){for(l=0;l<o;++l)this.faces.push([x+l,x+o+(l+1)%o,x+o+l]);x+=2*o}for(p=0;p<n;++p){for(a=0;a<o;++a){var w=(a+1)%o;this.faces.push([x+a,x+w,x+o+w]),this.faces.push([x+a,x+o+w,x+o+a])}x+=o}if(i)for(x+=o,a=0;a<o;++a)this.faces.push([x+a,x+(a+1)%o,x+o])}S.default.prototype.cylinder=function(e,t,r,o,n,s){this._assert3d("cylinder"),S.default._validateParameters("cylinder",arguments),void 0===e&&(e=50),void 0===t&&(t=e),void 0===o&&(o=1),void 0===s&&(s=!0),void 0===n&&(n=!0);var i,a="cylinder|".concat(r=void 0===r?24:r,"|").concat(o,"|").concat(n,"|").concat(s);return this._renderer.geometryInHash(a)||(i=new S.default.Geometry(r,o),l.call(i,1,1,1,r,o,n,s),r<=24&&o<=16?i._makeTriangleEdges()._edgesToVertices():this._renderer._doStroke&&console.log("Cannot draw stroke on cylinder objects with more than 24 detailX or 16 detailY"),this._renderer.createBuffers(a,i)),this._renderer.drawBuffersScaled(a,e,t,e),this},S.default.prototype.cone=function(e,t,r,o,n){this._assert3d("cone"),S.default._validateParameters("cone",arguments),void 0===e&&(e=50),void 0===t&&(t=e),void 0===o&&(o=1),void 0===n&&(n=!0);var s,i="cone|".concat(r=void 0===r?24:r,"|").concat(o,"|").concat(n);return this._renderer.geometryInHash(i)||(s=new S.default.Geometry(r,o),l.call(s,1,0,1,r,o,n,!1),r<=24&&o<=16?s._makeTriangleEdges()._edgesToVertices():this._renderer._doStroke&&console.log("Cannot draw stroke on cone objects with more than 24 detailX or 16 detailY"),this._renderer.createBuffers(i,s)),this._renderer.drawBuffersScaled(i,e,t,e),this},S.default.prototype.ellipsoid=function(e,t,r,o,n){this._assert3d("ellipsoid"),S.default._validateParameters("ellipsoid",arguments),void 0===e&&(e=50),void 0===t&&(t=e),void 0===r&&(r=e),void 0===n&&(n=16);var s,i="ellipsoid|".concat(o=void 0===o?24:o,"|").concat(n);return this._renderer.geometryInHash(i)||((s=new S.default.Geometry(o,n,function(){for(var e=0;e<=this.detailY;e++)for(var t=e/this.detailY,r=Math.PI*t-Math.PI/2,o=Math.cos(r),n=Math.sin(r),s=0;s<=this.detailX;s++){var i=s/this.detailX,a=2*Math.PI*i,l=Math.cos(a),a=Math.sin(a),a=new S.default.Vector(o*a,n,o*l);this.vertices.push(a),this.vertexNormals.push(a),this.uvs.push(i,t)}})).computeFaces(),o<=24&&n<=24?s._makeTriangleEdges()._edgesToVertices():this._renderer._doStroke&&console.log("Cannot draw stroke on ellipsoids with more than 24 detailX or 24 detailY"),this._renderer.createBuffers(i,s)),this._renderer.drawBuffersScaled(i,e,t,r),this},S.default.prototype.torus=function(e,t,r,o){if(this._assert3d("torus"),S.default._validateParameters("torus",arguments),void 0===e)e=50;else if(!e)return;if(void 0===t)t=10;else if(!t)return;void 0===r&&(r=24),void 0===o&&(o=16);var n,d=(t/e).toPrecision(4),t="torus|".concat(d,"|").concat(r,"|").concat(o);return this._renderer.geometryInHash(t)||((n=new S.default.Geometry(r,o,function(){for(var e=0;e<=this.detailY;e++)for(var t=e/this.detailY,r=2*Math.PI*t,o=Math.cos(r),n=Math.sin(r),s=1+d*o,i=0;i<=this.detailX;i++){var a=i/this.detailX,l=2*Math.PI*a,u=Math.cos(l),l=Math.sin(l),c=new S.default.Vector(s*u,s*l,d*n),u=new S.default.Vector(o*u,o*l,n);this.vertices.push(c),this.vertexNormals.push(u),this.uvs.push(a,t)}})).computeFaces(),r<=24&&o<=16?n._makeTriangleEdges()._edgesToVertices():this._renderer._doStroke&&console.log("Cannot draw strokes on torus object with more than 24 detailX or 16 detailY"),this._renderer.createBuffers(t,n)),this._renderer.drawBuffersScaled(t,e,e,e),this},S.default.RendererGL.prototype.point=function(e,t,r){var o=[];return o.push(new S.default.Vector(e,t,r=void 0===r?0:r)),this._drawPoints(o,this.immediateMode.buffers.point),this},S.default.RendererGL.prototype.triangle=function(e){var t=e[0],r=e[1],o=e[2],n=e[3],s=e[4],e=e[5],i=(this.geometryInHash("tri")||((i=new S.default.Geometry(1,1,function(){var e=[];e.push(new S.default.Vector(0,0,0)),e.push(new S.default.Vector(1,0,0)),e.push(new S.default.Vector(0,1,0)),this.strokeIndices=[[0,1],[1,2],[2,0]],this.vertices=e,this.faces=[[0,1,2]],this.uvs=[0,0,1,0,1,1]}))._makeTriangleEdges()._edgesToVertices(),i.computeNormals(),this.createBuffers("tri",i)),this.uMVMatrix.copy());try{var a=new S.default.Matrix([o-t,n-r,0,0,s-t,e-r,0,0,0,0,1,0,t,r,0,1]).mult(this.uMVMatrix);this.uMVMatrix=a,this.drawBuffers("tri")}finally{this.uMVMatrix=i}return this},S.default.RendererGL.prototype.ellipse=function(e){this.arc(e[0],e[1],e[2],e[3],0,_.TWO_PI,_.OPEN,e[4])},S.default.RendererGL.prototype.arc=function(e){var t,r=arguments[1],o=arguments[2],n=arguments[3],s=arguments[4],i=arguments[5],a=arguments[6],l=arguments[7]||25,u=(Math.abs(i-s)>=_.TWO_PI?"".concat(c="ellipse","|"):"".concat(c="arc","|").concat(s,"|").concat(i,"|").concat(a,"|")).concat(l,"|"),c=(this.geometryInHash(u)||((t=new S.default.Geometry(l,1,function(){if(this.strokeIndices=[],s.toFixed(10)!==i.toFixed(10)){a!==_.PIE&&void 0!==a||(this.vertices.push(new S.default.Vector(.5,.5,0)),this.uvs.push([.5,.5]));for(var e=0;e<=l;e++){var t=(i-s)*(e/l)+s,r=.5+Math.cos(t)/2,t=.5+Math.sin(t)/2;this.vertices.push(new S.default.Vector(r,t,0)),this.uvs.push([r,t]),e<l-1&&(this.faces.push([0,e+1,e+2]),this.strokeIndices.push([e+1,e+2]))}switch(a){case _.PIE:this.faces.push([0,this.vertices.length-2,this.vertices.length-1]),this.strokeIndices.push([0,1]),this.strokeIndices.push([this.vertices.length-2,this.vertices.length-1]),this.strokeIndices.push([0,this.vertices.length-1]);break;case _.CHORD:this.strokeIndices.push([0,1]),this.strokeIndices.push([0,this.vertices.length-1]);break;case _.OPEN:this.strokeIndices.push([0,1]);break;default:this.faces.push([0,this.vertices.length-2,this.vertices.length-1]),this.strokeIndices.push([this.vertices.length-2,this.vertices.length-1])}}})).computeNormals(),l<=50?t._makeTriangleEdges()._edgesToVertices(t):this._doStroke&&console.log("Cannot apply a stroke to an ".concat(c," with more than 50 detail")),this.createBuffers(u,t)),this.uMVMatrix.copy());try{this.uMVMatrix.translate([e,r,0]),this.uMVMatrix.scale(o,n,1),this.drawBuffers(u)}finally{this.uMVMatrix=c}return this},S.default.RendererGL.prototype.rect=function(e){var t=e[0],r=e[1],o=e[2],n=e[3];if(void 0===e[4]){var s=this._pInst._glAttributes.perPixelLighting,i=e[4]||(s?1:24),a=e[5]||(s?1:16),s="rect|".concat(i,"|").concat(a),l=(this.geometryInHash(s)||((l=new S.default.Geometry(i,a,function(){for(var e=0;e<=this.detailY;e++)for(var t=e/this.detailY,r=0;r<=this.detailX;r++){var o=r/this.detailX,n=new S.default.Vector(o,t,0);this.vertices.push(n),this.uvs.push(o,t)}0<i&&0<a&&(this.strokeIndices=[[0,i],[i,(i+1)*(a+1)-1],[(i+1)*(a+1)-1,(i+1)*a],[(i+1)*a,0]])})).computeFaces().computeNormals()._makeTriangleEdges()._edgesToVertices(),this.createBuffers(s,l)),this.uMVMatrix.copy());try{this.uMVMatrix.translate([t,r,0]),this.uMVMatrix.scale(o,n,1),this.drawBuffers(s)}finally{this.uMVMatrix=l}}else{var s=e[4],l=void 0===e[5]?s:e[5],u=void 0===e[6]?l:e[6],e=void 0===e[7]?u:e[7],c=o,d=n,f=((c+=t)<t&&(f=t,t=c,c=f),(d+=r)<r&&(f=r,r=d,d=f),Math.min((c-t)/2,(d-r)/2)),h=(f<s&&(s=f),f<l&&(l=f),f<u&&(u=f),f<e&&(e=f),t),p=r,f=c,t=d,m=(this.beginShape(),0!==l?(this.vertex(f-l,p),this.quadraticVertex(f,p,f,p+l)):this.vertex(f,p),0!==u?(this.vertex(f,t-u),this.quadraticVertex(f,t,f-u,t)):this.vertex(f,t),0!==e?(this.vertex(h+e,t),this.quadraticVertex(h,t,h,t-e)):this.vertex(h,t),0!==s?(this.vertex(h,p+s),this.quadraticVertex(h,p,h+s,p)):this.vertex(h,p),!(this.immediateMode.geometry.uvs.length=0)),r=!1,c=void 0;try{for(var y,g=this.immediateMode.geometry.vertices[Symbol.iterator]();!(m=(y=g.next()).done);m=!0){var v=y.value,b=(v.x-h)/o,j=(v.y-p)/n;this.immediateMode.geometry.uvs.push(b,j)}}catch(e){r=!0,c=e}finally{try{m||null==g.return||g.return()}finally{if(r)throw c}}this.endShape(_.CLOSE)}return this},S.default.RendererGL.prototype.quad=function(i,a,l,u,c,d,f,h,p,m,y,g,e,t){void 0===e&&(e=2),void 0===t&&(t=2);var r="quad|".concat(i,"|").concat(a,"|").concat(l,"|").concat(u,"|").concat(c,"|").concat(d,"|").concat(f,"|").concat(h,"|").concat(p,"|").concat(m,"|").concat(y,"|").concat(g,"|").concat(e,"|").concat(t);if(!this.geometryInHash(r)){var o=new S.default.Geometry(e,t,function(){for(var e=1/(this.detailX-1),t=1/(this.detailY-1),r=0;r<this.detailY;r++)for(var o=0;o<this.detailX;o++){var n=o*e,s=r*t;this.vertices.push(new S.default.Vector((1-n)*((1-s)*i+s*m)+n*((1-s)*u+s*f),(1-n)*((1-s)*a+s*y)+n*((1-s)*c+s*h),(1-n)*((1-s)*l+s*g)+n*((1-s)*d+s*p))),this.uvs.push([n,s])}});o.faces=[];for(var n=0;n<t-1;n++)for(var s=0;s<e-1;s++){var v=s+n*e,b=s+1+(n+1)*e,j=s+(n+1)*e;o.faces.push([v,s+1+n*e,b]),o.faces.push([v,b,j])}o.computeNormals()._makeTriangleEdges()._edgesToVertices(),this.createBuffers(r,o)}return this.drawBuffers(r),this},S.default.RendererGL.prototype.bezier=function(e,t,r,o,n,s,i,a,l,u,c,d){8===arguments.length&&(c=a,u=i,a=s,i=n,n=o,o=r,r=s=l=d=0);var f=this._pInst._bezierDetail||20;this.beginShape();for(var h=0;h<=f;h++){var p=Math.pow(1-h/f,3),m=h/f*3*Math.pow(1-h/f,2),y=3*Math.pow(h/f,2)*(1-h/f),g=Math.pow(h/f,3);this.vertex(e*p+o*m+i*y+u*g,t*p+n*m+a*y+c*g,r*p+s*m+l*y+d*g)}return this.endShape(),this},S.default.RendererGL.prototype.curve=function(e,t,r,o,n,s,i,a,l,u,c,d){8===arguments.length&&(u=i,c=a,i=n,a=o,n=o=r,r=s=l=d=0);var f=this._pInst._curveDetail;this.beginShape();for(var h=0;h<=f;h++){var p=.5*Math.pow(h/f,3),m=.5*Math.pow(h/f,2),y=h/f*.5;this.vertex(p*(3*o-e-3*i+u)+m*(2*e-5*o+4*i-u)+y*(-e+i)+2*o*.5,p*(3*n-t-3*a+c)+m*(2*t-5*n+4*a-c)+y*(-t+a)+2*n*.5,p*(3*s-r-3*l+d)+m*(2*r-5*s+4*l-d)+y*(-r+l)+2*s*.5)}return this.endShape(),this},S.default.RendererGL.prototype.line=function(){return 6===arguments.length?(this.beginShape(_.LINES),this.vertex(arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2]),this.vertex(arguments.length<=3?void 0:arguments[3],arguments.length<=4?void 0:arguments[4],arguments.length<=5?void 0:arguments[5]),this.endShape()):4===arguments.length&&(this.beginShape(_.LINES),this.vertex(arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],0),this.vertex(arguments.length<=2?void 0:arguments[2],arguments.length<=3?void 0:arguments[3],0),this.endShape()),this},S.default.RendererGL.prototype.bezierVertex=function(){if(0===this.immediateMode._bezierVertex.length)throw Error("vertex() must be used once before calling bezierVertex()");var e,t,r,o,n,s,i=[],a=[],l=arguments.length;if(0===this._lookUpTableBezier.length||this._lutBezierDetail!==this._pInst._curveDetail){this._lookUpTableBezier=[],this._lutBezierDetail=this._pInst._curveDetail;for(var u=1/this._lutBezierDetail,c=0,d=1,f=0;c<1;){if(s=parseFloat(c.toFixed(6)),this._lookUpTableBezier[f]=this._bezierCoefficients(s),d.toFixed(6)===u.toFixed(6)){s=parseFloat(d.toFixed(6))+parseFloat(c.toFixed(6)),++f,this._lookUpTableBezier[f]=this._bezierCoefficients(s);break}c+=u,d-=u,++f}}for(var h=this._lookUpTableBezier.length,p=[],m=0;m<4;m++)p.push([]);p[0]=this.immediateMode.geometry.vertexColors.slice(-4),p[3]=this.curFillColor.slice();var y=[];for(m=0;m<4;m++)y.push([]);if(y[0]=this.immediateMode.geometry.vertexStrokeColors.slice(-4),y[3]=this.curStrokeColor.slice(),6===l){this.isBezier=!0;var i=[this.immediateMode._bezierVertex[0],arguments.length<=0?void 0:arguments[0],arguments.length<=2?void 0:arguments[2],arguments.length<=4?void 0:arguments[4]],a=[this.immediateMode._bezierVertex[1],arguments.length<=1?void 0:arguments[1],arguments.length<=3?void 0:arguments[3],arguments.length<=5?void 0:arguments[5]],g=Math.hypot(i[0]-i[1],a[0]-a[1]),v=Math.hypot(i[1]-i[2],a[1]-a[2]),b=Math.hypot(i[2]-i[3],a[2]-a[3]),v=g+v+b;for(g/=v,b/=v,n=0;n<4;n++)p[1].push(p[0][n]*(1-g)+p[3][n]*g),p[2].push(p[0][n]*b+p[3][n]*(1-b)),y[1].push(y[0][n]*(1-g)+y[3][n]*g),y[2].push(y[0][n]*b+y[3][n]*(1-b));for(o=0;o<h;o++){for(this.curFillColor=[0,0,0,0],this.curStrokeColor=[0,0,0,0],m=e=t=0;m<4;m++){for(n=0;n<4;n++)this.curFillColor[n]+=this._lookUpTableBezier[o][m]*p[m][n],this.curStrokeColor[n]+=this._lookUpTableBezier[o][m]*y[m][n];e+=i[m]*this._lookUpTableBezier[o][m],t+=a[m]*this._lookUpTableBezier[o][m]}this.vertex(e,t)}this.curFillColor=p[3],this.curStrokeColor=y[3],this.immediateMode._bezierVertex[0]=arguments.length<=4?void 0:arguments[4],this.immediateMode._bezierVertex[1]=arguments.length<=5?void 0:arguments[5]}else if(9===l){this.isBezier=!0,i=[this.immediateMode._bezierVertex[0],arguments.length<=0?void 0:arguments[0],arguments.length<=3?void 0:arguments[3],arguments.length<=6?void 0:arguments[6]],a=[this.immediateMode._bezierVertex[1],arguments.length<=1?void 0:arguments[1],arguments.length<=4?void 0:arguments[4],arguments.length<=7?void 0:arguments[7]];var j=[this.immediateMode._bezierVertex[2],arguments.length<=2?void 0:arguments[2],arguments.length<=5?void 0:arguments[5],arguments.length<=8?void 0:arguments[8]],_=Math.hypot(i[0]-i[1],a[0]-a[1],j[0]-j[1]),v=Math.hypot(i[1]-i[2],a[1]-a[2],j[1]-j[2]),x=Math.hypot(i[2]-i[3],a[2]-a[3],j[2]-j[3]),l=_+v+x;for(_/=l,x/=l,n=0;n<4;n++)p[1].push(p[0][n]*(1-_)+p[3][n]*_),p[2].push(p[0][n]*x+p[3][n]*(1-x)),y[1].push(y[0][n]*(1-_)+y[3][n]*_),y[2].push(y[0][n]*x+y[3][n]*(1-x));for(o=0;o<h;o++){for(this.curFillColor=[0,0,0,0],this.curStrokeColor=[0,0,0,0],m=e=t=r=0;m<4;m++){for(n=0;n<4;n++)this.curFillColor[n]+=this._lookUpTableBezier[o][m]*p[m][n],this.curStrokeColor[n]+=this._lookUpTableBezier[o][m]*y[m][n];e+=i[m]*this._lookUpTableBezier[o][m],t+=a[m]*this._lookUpTableBezier[o][m],r+=j[m]*this._lookUpTableBezier[o][m]}this.vertex(e,t,r)}this.curFillColor=p[3],this.curStrokeColor=y[3],this.immediateMode._bezierVertex[0]=arguments.length<=6?void 0:arguments[6],this.immediateMode._bezierVertex[1]=arguments.length<=7?void 0:arguments[7],this.immediateMode._bezierVertex[2]=arguments.length<=8?void 0:arguments[8]}},S.default.RendererGL.prototype.quadraticVertex=function(){if(0===this.immediateMode._quadraticVertex.length)throw Error("vertex() must be used once before calling quadraticVertex()");var e,t,r,o,n,s,i=[],a=[],l=arguments.length;if(0===this._lookUpTableQuadratic.length||this._lutQuadraticDetail!==this._pInst._curveDetail){this._lookUpTableQuadratic=[],this._lutQuadraticDetail=this._pInst._curveDetail;for(var u=1/this._lutQuadraticDetail,c=0,d=1,f=0;c<1;){if(s=parseFloat(c.toFixed(6)),this._lookUpTableQuadratic[f]=this._quadraticCoefficients(s),d.toFixed(6)===u.toFixed(6)){s=parseFloat(d.toFixed(6))+parseFloat(c.toFixed(6)),++f,this._lookUpTableQuadratic[f]=this._quadraticCoefficients(s);break}c+=u,d-=u,++f}}for(var h=this._lookUpTableQuadratic.length,p=[],m=0;m<3;m++)p.push([]);p[0]=this.immediateMode.geometry.vertexColors.slice(-4),p[2]=this.curFillColor.slice();var y=[];for(m=0;m<3;m++)y.push([]);if(y[0]=this.immediateMode.geometry.vertexStrokeColors.slice(-4),y[2]=this.curStrokeColor.slice(),4===l){this.isQuadratic=!0;var i=[this.immediateMode._quadraticVertex[0],arguments.length<=0?void 0:arguments[0],arguments.length<=2?void 0:arguments[2]],a=[this.immediateMode._quadraticVertex[1],arguments.length<=1?void 0:arguments[1],arguments.length<=3?void 0:arguments[3]],g=Math.hypot(i[0]-i[1],a[0]-a[1]);for(g/=g+Math.hypot(i[1]-i[2],a[1]-a[2]),n=0;n<4;n++)p[1].push(p[0][n]*(1-g)+p[2][n]*g),y[1].push(y[0][n]*(1-g)+y[2][n]*g);for(o=0;o<h;o++){for(this.curFillColor=[0,0,0,0],this.curStrokeColor=[0,0,0,0],m=e=t=0;m<3;m++){for(n=0;n<4;n++)this.curFillColor[n]+=this._lookUpTableQuadratic[o][m]*p[m][n],this.curStrokeColor[n]+=this._lookUpTableQuadratic[o][m]*y[m][n];e+=i[m]*this._lookUpTableQuadratic[o][m],t+=a[m]*this._lookUpTableQuadratic[o][m]}this.vertex(e,t)}this.curFillColor=p[2],this.curStrokeColor=y[2],this.immediateMode._quadraticVertex[0]=arguments.length<=2?void 0:arguments[2],this.immediateMode._quadraticVertex[1]=arguments.length<=3?void 0:arguments[3]}else if(6===l){this.isQuadratic=!0,i=[this.immediateMode._quadraticVertex[0],arguments.length<=0?void 0:arguments[0],arguments.length<=3?void 0:arguments[3]],a=[this.immediateMode._quadraticVertex[1],arguments.length<=1?void 0:arguments[1],arguments.length<=4?void 0:arguments[4]];var v=[this.immediateMode._quadraticVertex[2],arguments.length<=2?void 0:arguments[2],arguments.length<=5?void 0:arguments[5]],b=Math.hypot(i[0]-i[1],a[0]-a[1],v[0]-v[1]);for(b/=b+Math.hypot(i[1]-i[2],a[1]-a[2],v[1]-v[2]),n=0;n<4;n++)p[1].push(p[0][n]*(1-b)+p[2][n]*b),y[1].push(y[0][n]*(1-b)+y[2][n]*b);for(o=0;o<h;o++){for(this.curFillColor=[0,0,0,0],this.curStrokeColor=[0,0,0,0],m=e=t=r=0;m<3;m++){for(n=0;n<4;n++)this.curFillColor[n]+=this._lookUpTableQuadratic[o][m]*p[m][n],this.curStrokeColor[n]+=this._lookUpTableQuadratic[o][m]*y[m][n];e+=i[m]*this._lookUpTableQuadratic[o][m],t+=a[m]*this._lookUpTableQuadratic[o][m],r+=v[m]*this._lookUpTableQuadratic[o][m]}this.vertex(e,t,r)}this.curFillColor=p[2],this.curStrokeColor=y[2],this.immediateMode._quadraticVertex[0]=arguments.length<=3?void 0:arguments[3],this.immediateMode._quadraticVertex[1]=arguments.length<=4?void 0:arguments[4],this.immediateMode._quadraticVertex[2]=arguments.length<=5?void 0:arguments[5]}},S.default.RendererGL.prototype.curveVertex=function(){var e,t,r,o,n,s,i=[],a=[],l=arguments.length;if(0===this._lookUpTableBezier.length||this._lutBezierDetail!==this._pInst._curveDetail){this._lookUpTableBezier=[],this._lutBezierDetail=this._pInst._curveDetail;for(var u=1/this._lutBezierDetail,c=0,d=1,f=0;c<1;){if(s=parseFloat(c.toFixed(6)),this._lookUpTableBezier[f]=this._bezierCoefficients(s),d.toFixed(6)===u.toFixed(6)){s=parseFloat(d.toFixed(6))+parseFloat(c.toFixed(6)),++f,this._lookUpTableBezier[f]=this._bezierCoefficients(s);break}c+=u,d-=u,++f}}var h=this._lookUpTableBezier.length;if(2===l){if(this.immediateMode._curveVertex.push(arguments.length<=0?void 0:arguments[0]),this.immediateMode._curveVertex.push(arguments.length<=1?void 0:arguments[1]),8===this.immediateMode._curveVertex.length){for(this.isCurve=!0,i=this._bezierToCatmull([this.immediateMode._curveVertex[0],this.immediateMode._curveVertex[2],this.immediateMode._curveVertex[4],this.immediateMode._curveVertex[6]]),a=this._bezierToCatmull([this.immediateMode._curveVertex[1],this.immediateMode._curveVertex[3],this.immediateMode._curveVertex[5],this.immediateMode._curveVertex[7]]),n=0;n<h;n++)t=i[0]*this._lookUpTableBezier[n][0]+i[1]*this._lookUpTableBezier[n][1]+i[2]*this._lookUpTableBezier[n][2]+i[3]*this._lookUpTableBezier[n][3],r=a[0]*this._lookUpTableBezier[n][0]+a[1]*this._lookUpTableBezier[n][1]+a[2]*this._lookUpTableBezier[n][2]+a[3]*this._lookUpTableBezier[n][3],this.vertex(t,r);for(n=0;n<l;n++)this.immediateMode._curveVertex.shift()}}else if(3===l&&(this.immediateMode._curveVertex.push(arguments.length<=0?void 0:arguments[0]),this.immediateMode._curveVertex.push(arguments.length<=1?void 0:arguments[1]),this.immediateMode._curveVertex.push(arguments.length<=2?void 0:arguments[2]),12===this.immediateMode._curveVertex.length)){for(this.isCurve=!0,i=this._bezierToCatmull([this.immediateMode._curveVertex[0],this.immediateMode._curveVertex[3],this.immediateMode._curveVertex[6],this.immediateMode._curveVertex[9]]),a=this._bezierToCatmull([this.immediateMode._curveVertex[1],this.immediateMode._curveVertex[4],this.immediateMode._curveVertex[7],this.immediateMode._curveVertex[10]]),e=this._bezierToCatmull([this.immediateMode._curveVertex[2],this.immediateMode._curveVertex[5],this.immediateMode._curveVertex[8],this.immediateMode._curveVertex[11]]),n=0;n<h;n++)t=i[0]*this._lookUpTableBezier[n][0]+i[1]*this._lookUpTableBezier[n][1]+i[2]*this._lookUpTableBezier[n][2]+i[3]*this._lookUpTableBezier[n][3],r=a[0]*this._lookUpTableBezier[n][0]+a[1]*this._lookUpTableBezier[n][1]+a[2]*this._lookUpTableBezier[n][2]+a[3]*this._lookUpTableBezier[n][3],o=e[0]*this._lookUpTableBezier[n][0]+e[1]*this._lookUpTableBezier[n][1]+e[2]*this._lookUpTableBezier[n][2]+e[3]*this._lookUpTableBezier[n][3],this.vertex(t,r,o);for(n=0;n<l;n++)this.immediateMode._curveVertex.shift()}},S.default.RendererGL.prototype.image=function(e,t,r,o,n,s,i,a,l){this._isErasing&&this.blendMode(this._cachedBlendMode),this._pInst.push(),this._pInst.noLights(),this._pInst.noStroke(),this._pInst.texture(e),this._pInst.textureMode(_.NORMAL);var u=0,c=(t<=e.width&&(u=t/e.width),1),t=(t+o<=e.width&&(c=(t+o)/e.width),0),o=(r<=e.height&&(t=r/e.height),1);r+n<=e.height&&(o=(r+n)/e.height),this.beginShape(),this.vertex(s,i,0,u,t),this.vertex(s+a,i,0,c,t),this.vertex(s+a,i+l,0,c,o),this.vertex(s,i+l,0,u,o),this.endShape(_.CLOSE),this._pInst.pop(),this._isErasing&&this.blendMode(_.REMOVE)};var n=S.default;r.default=n},{"../core/constants":256,"../core/main":267,"./p5.Geometry":316,"core-js/modules/es.array.concat":149,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.slice":162,"core-js/modules/es.math.hypot":167,"core-js/modules/es.number.to-fixed":171,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],311:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.splice"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.splice"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var s=(l=e("../core/main"))&&l.__esModule?l:{default:l},n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}s.default.prototype.orbitControl=function(e,t,r){var o,n;if(this._assert3d("orbitControl"),s.default._validateParameters("orbitControl",arguments),this.mouseX<this.width&&0<this.mouseX&&this.mouseY<this.height&&0<this.mouseY)return o=this._renderer._curCamera,void 0===e&&(e=1),void 0===t&&(t=e),void 0===r&&(r=.5),!0!==this.contextMenuDisabled&&(this.canvas.oncontextmenu=function(){return!1},this._setProperty("contextMenuDisabled",!0)),!0!==this.wheelDefaultDisabled&&(this.canvas.onwheel=function(){return!1},this._setProperty("wheelDefaultDisabled",!0)),n=this.height<this.width?this.height:this.width,this._mouseWheelDeltaY!==this._pmouseWheelDeltaY&&(0<this._mouseWheelDeltaY?this._renderer._curCamera._orbit(0,0,r*n):this._renderer._curCamera._orbit(0,0,-r*n)),this.mouseIsPressed&&(this.mouseButton===this.LEFT?(r=-e*(this.mouseX-this.pmouseX)/n,n=t*(this.mouseY-this.pmouseY)/n,this._renderer._curCamera._orbit(r,n,0)):this.mouseButton===this.RIGHT&&(r=o._getLocalAxes(),0!==(n=Math.sqrt(r.x[0]*r.x[0]+r.x[2]*r.x[2]))&&(r.x[0]/=n,r.x[2]/=n),0!==(n=Math.sqrt(r.y[0]*r.y[0]+r.y[2]*r.y[2]))&&(r.y[0]/=n,r.y[2]/=n),n=-1*e*(this.mouseX-this.pmouseX),e=-1*t*(this.mouseY-this.pmouseY),o.setPosition(o.eyeX+n*r.x[0]+e*r.z[0],o.eyeY,o.eyeZ+n*r.x[2]+e*r.z[2]))),this},s.default.prototype.debugMode=function(){this._assert3d("debugMode");for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];s.default._validateParameters("debugMode",t);for(var o=this._registeredMethods.post.length-1;0<=o;o--)this._registeredMethods.post[o].toString()!==this._grid().toString()&&this._registeredMethods.post[o].toString()!==this._axesIcon().toString()||this._registeredMethods.post.splice(o,1);t[0]===n.GRID?this.registerMethod("post",this._grid.call(this,t[1],t[2],t[3],t[4],t[5])):t[0]===n.AXES?this.registerMethod("post",this._axesIcon.call(this,t[1],t[2],t[3],t[4])):(this.registerMethod("post",this._grid.call(this,t[0],t[1],t[2],t[3],t[4])),this.registerMethod("post",this._axesIcon.call(this,t[5],t[6],t[7],t[8])))},s.default.prototype.noDebugMode=function(){this._assert3d("noDebugMode");for(var e=this._registeredMethods.post.length-1;0<=e;e--)this._registeredMethods.post[e].toString()!==this._grid().toString()&&this._registeredMethods.post[e].toString()!==this._axesIcon().toString()||this._registeredMethods.post.splice(e,1)},s.default.prototype._grid=function(e,r,o,n,s){void 0===e&&(e=this.width/2),void 0===r&&(r=Math.round(e/30)<4?4:Math.round(e/30)),void 0===o&&(o=0),void 0===n&&(n=0),void 0===s&&(s=0);var i=e/r,a=e/2;return function(){this.push(),this.stroke(255*this._renderer.curStrokeColor[0],255*this._renderer.curStrokeColor[1],255*this._renderer.curStrokeColor[2]),this._renderer.uMVMatrix.set(this._renderer._curCamera.cameraMatrix.mat4[0],this._renderer._curCamera.cameraMatrix.mat4[1],this._renderer._curCamera.cameraMatrix.mat4[2],this._renderer._curCamera.cameraMatrix.mat4[3],this._renderer._curCamera.cameraMatrix.mat4[4],this._renderer._curCamera.cameraMatrix.mat4[5],this._renderer._curCamera.cameraMatrix.mat4[6],this._renderer._curCamera.cameraMatrix.mat4[7],this._renderer._curCamera.cameraMatrix.mat4[8],this._renderer._curCamera.cameraMatrix.mat4[9],this._renderer._curCamera.cameraMatrix.mat4[10],this._renderer._curCamera.cameraMatrix.mat4[11],this._renderer._curCamera.cameraMatrix.mat4[12],this._renderer._curCamera.cameraMatrix.mat4[13],this._renderer._curCamera.cameraMatrix.mat4[14],this._renderer._curCamera.cameraMatrix.mat4[15]);for(var e=0;e<=r;e++)this.beginShape(this.LINES),this.vertex(-a+o,n,e*i-a+s),this.vertex(a+o,n,e*i-a+s),this.endShape();for(var t=0;t<=r;t++)this.beginShape(this.LINES),this.vertex(t*i-a+o,n,-a+s),this.vertex(t*i-a+o,n,a+s),this.endShape();this.pop()}},s.default.prototype._axesIcon=function(e,t,r,o){return void 0===e&&(e=40<this.width/20?this.width/20:40),void 0===t&&(t=-this.width/4),void 0===r&&(r=t),void 0===o&&(o=t),function(){this.push(),this._renderer.uMVMatrix.set(this._renderer._curCamera.cameraMatrix.mat4[0],this._renderer._curCamera.cameraMatrix.mat4[1],this._renderer._curCamera.cameraMatrix.mat4[2],this._renderer._curCamera.cameraMatrix.mat4[3],this._renderer._curCamera.cameraMatrix.mat4[4],this._renderer._curCamera.cameraMatrix.mat4[5],this._renderer._curCamera.cameraMatrix.mat4[6],this._renderer._curCamera.cameraMatrix.mat4[7],this._renderer._curCamera.cameraMatrix.mat4[8],this._renderer._curCamera.cameraMatrix.mat4[9],this._renderer._curCamera.cameraMatrix.mat4[10],this._renderer._curCamera.cameraMatrix.mat4[11],this._renderer._curCamera.cameraMatrix.mat4[12],this._renderer._curCamera.cameraMatrix.mat4[13],this._renderer._curCamera.cameraMatrix.mat4[14],this._renderer._curCamera.cameraMatrix.mat4[15]),this.strokeWeight(2),this.stroke(255,0,0),this.beginShape(this.LINES),this.vertex(t,r,o),this.vertex(t+e,r,o),this.endShape(),this.stroke(0,255,0),this.beginShape(this.LINES),this.vertex(t,r,o),this.vertex(t,r+e,o),this.endShape(),this.stroke(0,0,255),this.beginShape(this.LINES),this.vertex(t,r,o),this.vertex(t,r,o+e),this.endShape(),this.pop()}};var l=s.default;r.default=l},{"../core/constants":256,"../core/main":267,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.splice":164,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],312:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var m=(s=e("../core/main"))&&s.__esModule?s:{default:s},n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}m.default.prototype.ambientLight=function(e,t,r,o){this._assert3d("ambientLight"),m.default._validateParameters("ambientLight",arguments);var n=this.color.apply(this,arguments);return this._renderer.ambientLightColors.push(n._array[0],n._array[1],n._array[2]),this._renderer._enableLighting=!0,this},m.default.prototype.specularColor=function(e,t,r){this._assert3d("specularColor"),m.default._validateParameters("specularColor",arguments);var o=this.color.apply(this,arguments);return this._renderer.specularColors=[o._array[0],o._array[1],o._array[2]],this},m.default.prototype.directionalLight=function(e,t,r,o,n,s){this._assert3d("directionalLight"),m.default._validateParameters("directionalLight",arguments),e=e instanceof m.default.Color?e:this.color(e,t,r);var i,a,t=arguments[arguments.length-1],r="number"==typeof t?(i=arguments[arguments.length-3],a=arguments[arguments.length-2],arguments[arguments.length-1]):(i=t.x,a=t.y,t.z),t=Math.sqrt(i*i+a*a+r*r);return this._renderer.directionalLightDirections.push(i/t,a/t,r/t),this._renderer.directionalLightDiffuseColors.push(e._array[0],e._array[1],e._array[2]),Array.prototype.push.apply(this._renderer.directionalLightSpecularColors,this._renderer.specularColors),this._renderer._enableLighting=!0,this},m.default.prototype.pointLight=function(e,t,r,o,n,s){this._assert3d("pointLight"),m.default._validateParameters("pointLight",arguments),e=e instanceof m.default.Color?e:this.color(e,t,r);var i,a,t=arguments[arguments.length-1],r="number"==typeof t?(i=arguments[arguments.length-3],a=arguments[arguments.length-2],arguments[arguments.length-1]):(i=t.x,a=t.y,t.z);return this._renderer.pointLightPositions.push(i,a,r),this._renderer.pointLightDiffuseColors.push(e._array[0],e._array[1],e._array[2]),Array.prototype.push.apply(this._renderer.pointLightSpecularColors,this._renderer.specularColors),this._renderer._enableLighting=!0,this},m.default.prototype.lights=function(){var e;return this._assert3d("lights"),this._colorMode===n.RGB?(this.ambientLight(128,128,128),this.directionalLight(128,128,128,0,0,-1)):(e=this._colorMaxes[this._colorMode][2],this.ambientLight(0,0,e),this.directionalLight(0,0,e,0,0,-1)),this},m.default.prototype.lightFalloff=function(e,t,r){return this._assert3d("lightFalloff"),m.default._validateParameters("lightFalloff",arguments),e<0&&(e=0,console.warn("Value of constant argument in lightFalloff() should be never be negative. Set to 0.")),t<0&&(t=0,console.warn("Value of linear argument in lightFalloff() should be never be negative. Set to 0.")),r<0&&(r=0,console.warn("Value of quadratic argument in lightFalloff() should be never be negative. Set to 0.")),0===e&&0===t&&0===r&&(e=1,console.warn("Either one of the three arguments in lightFalloff() should be greater than zero. Set constant argument to 1.")),this._renderer.constantAttenuation=e,this._renderer.linearAttenuation=t,this._renderer.quadraticAttenuation=r,this},m.default.prototype.spotLight=function(e,t,r,o,n,s,i,a,l,u,c){this._assert3d("spotLight"),m.default._validateParameters("spotLight",arguments);var d,f,h,p=arguments.length;switch(p){case 11:case 10:d=this.color(e,t,r),f=new m.default.Vector(o,n,s),h=new m.default.Vector(i,a,l);break;case 9:e instanceof m.default.Color?(d=e,f=new m.default.Vector(t,r,o),h=new m.default.Vector(n,s,i),u=a,c=l):o instanceof m.default.Vector?(d=this.color(e,t,r),f=o,h=new m.default.Vector(n,s,i),u=a,c=l):i instanceof m.default.Vector?(d=this.color(e,t,r),f=new m.default.Vector(o,n,s),h=i,u=a,c=l):(d=this.color(e,t,r),f=new m.default.Vector(o,n,s),h=new m.default.Vector(i,a,l));break;case 8:u=(h=e instanceof m.default.Color?(d=e,f=new m.default.Vector(t,r,o),new m.default.Vector(n,s,i)):o instanceof m.default.Vector?(d=this.color(e,t,r),f=o,new m.default.Vector(n,s,i)):(d=this.color(e,t,r),f=new m.default.Vector(o,n,s),i),a);break;case 7:e instanceof m.default.Color&&t instanceof m.default.Vector?(d=e,f=t,h=new m.default.Vector(r,o,n),u=s,c=i):e instanceof m.default.Color&&n instanceof m.default.Vector?(d=e,f=new m.default.Vector(t,r,o),h=n,u=s,c=i):o instanceof m.default.Vector&&n instanceof m.default.Vector?(d=this.color(e,t,r),f=o,h=n,u=s,c=i):h=e instanceof m.default.Color?(d=e,f=new m.default.Vector(t,r,o),new m.default.Vector(n,s,i)):o instanceof m.default.Vector?(d=this.color(e,t,r),f=o,new m.default.Vector(n,s,i)):(d=this.color(e,t,r),f=new m.default.Vector(o,n,s),i);break;case 6:o instanceof m.default.Vector&&n instanceof m.default.Vector?(d=this.color(e,t,r),f=o,h=n,u=s):e instanceof m.default.Color&&n instanceof m.default.Vector?(d=e,f=new m.default.Vector(t,r,o),h=n,u=s):e instanceof m.default.Color&&t instanceof m.default.Vector&&(d=e,f=t,h=new m.default.Vector(r,o,n),u=s);break;case 5:e instanceof m.default.Color&&t instanceof m.default.Vector&&r instanceof m.default.Vector?(d=e,f=t,h=r,u=o,c=n):o instanceof m.default.Vector&&n instanceof m.default.Vector?(d=this.color(e,t,r),f=o,h=n):e instanceof m.default.Color&&n instanceof m.default.Vector?(d=e,f=new m.default.Vector(t,r,o),h=n):e instanceof m.default.Color&&t instanceof m.default.Vector&&(d=e,f=t,h=new m.default.Vector(r,o,n));break;case 4:d=e,f=t,h=r,u=o;break;case 3:d=e,f=t,h=r;break;default:return console.warn("Sorry, input for spotlight() is not in prescribed format. Too ".concat(p<3?"few":"many"," arguments were provided")),this}return this._renderer.spotLightDiffuseColors.push(d._array[0],d._array[1],d._array[2]),Array.prototype.push.apply(this._renderer.spotLightSpecularColors,this._renderer.specularColors),this._renderer.spotLightPositions.push(f.x,f.y,f.z),h.normalize(),this._renderer.spotLightDirections.push(h.x,h.y,h.z),void 0===u&&(u=Math.PI/3),void 0!==c&&c<1?(c=1,console.warn("Value of concentration needs to be greater than 1. Setting it to 1")):void 0===c&&(c=100),u=this._renderer._pInst._toRadians(u),this._renderer.spotLightAngle.push(Math.cos(u)),this._renderer.spotLightConc.push(c),this._renderer._enableLighting=!0,this},m.default.prototype.noLights=function(){return this._assert3d("noLights"),m.default._validateParameters("noLights",arguments),this._renderer._enableLighting=!1,this._renderer.ambientLightColors.length=0,this._renderer.specularColors=[1,1,1],this._renderer.directionalLightDirections.length=0,this._renderer.directionalLightDiffuseColors.length=0,this._renderer.directionalLightSpecularColors.length=0,this._renderer.pointLightPositions.length=0,this._renderer.pointLightDiffuseColors.length=0,this._renderer.pointLightSpecularColors.length=0,this._renderer.spotLightPositions.length=0,this._renderer.spotLightDirections.length=0,this._renderer.spotLightDiffuseColors.length=0,this._renderer.spotLightSpecularColors.length=0,this._renderer.spotLightAngle.length=0,this._renderer.spotLightConc.length=0,this._renderer.constantAttenuation=1,this._renderer.linearAttenuation=0,this._renderer.quadraticAttenuation=0,this._renderer._useShininess=1,this};var s=m.default;r.default=s},{"../core/constants":256,"../core/main":267,"core-js/modules/es.array.iterator":158,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],313:[function(e,t,r){"use strict";e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.splice"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.trim"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.splice"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.match"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.trim"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var x=(o=e("../core/main"))&&o.__esModule?o:{default:o};e("./p5.Geometry"),x.default.prototype.loadModel=function(e){x.default._validateParameters("loadModel",arguments);var y,g,t,r=e.slice(-4),v=("boolean"==typeof arguments[1]?(y=arguments[1],g=arguments[2],t=arguments[3],void 0!==arguments[4]&&(r=arguments[4])):(y=!1,g=arguments[1],t=arguments[2],void 0!==arguments[3]&&(r=arguments[3])),new x.default.Geometry),b=(v.gid="".concat(e,"|").concat(y),this);return r.match(/\.stl$/i)?this.httpDo(e,"GET","arrayBuffer",function(e){!function(e,t){if(function(e){for(var t=new DataView(e),r=[115,111,108,105,100],o=0;o<5;o++)if(function(e,t,r){for(var o=0,n=e.length;o<n;o++)if(e[o]!==t.getUint8(r+o,!1))return;return 1}(r,t,o))return;return 1}(t))!function(e,t){for(var r,o,n,s,i,a,l,u=new DataView(t),c=u.getUint32(80,!0),d=!1,f=0;f<70;f++)1129270351===u.getUint32(f,!1)&&82===u.getUint8(f+4)&&61===u.getUint8(f+5)&&(d=!0,s=[],i=u.getUint8(f+6)/255,a=u.getUint8(f+7)/255,l=u.getUint8(f+8)/255);for(var h=0;h<c;h++){for(var p,m=84+50*h,y=u.getFloat32(m,!0),g=u.getFloat32(4+m,!0),v=u.getFloat32(8+m,!0),b=(d&&(p=u.getUint16(48+m,!0),n=0==(32768&p)?(r=(31&p)/31,o=(p>>5&31)/31,(p>>10&31)/31):(r=i,o=a,l)),new x.default.Vector(y,g,v)),j=1;j<=3;j++){var _=m+12*j,_=new x.default.Vector(u.getFloat32(_,!0),u.getFloat32(4+_,!0),u.getFloat32(8+_,!0));e.vertices.push(_),e.vertexNormals.push(b),d&&s.push(r,o,n)}e.faces.push([3*h,3*h+1,3*h+2]),e.uvs.push([0,0],[0,0],[0,0])}}(e,t);else{t=new DataView(t);if(!("TextDecoder"in window))return console.warn("Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)");t=new TextDecoder("utf-8").decode(t).split("\n");!function(e,t){for(var r,o,n="",s=[],i=0;i<t.length;++i){for(var a=t[i].trim(),l=a.split(" "),u=0;u<l.length;++u)""===l[u]&&l.splice(u,1);if(0!==l.length)switch(n){case"":if("solid"!==l[0])return console.error(a),console.error('Invalid state "'.concat(l[0],'", should be "solid"'));n="solid";break;case"solid":if("facet"!==l[0]||"normal"!==l[1])return console.error(a),console.error('Invalid state "'.concat(l[0],'", should be "facet normal"'));r=new x.default.Vector(parseFloat(l[2]),parseFloat(l[3]),parseFloat(l[4])),e.vertexNormals.push(r,r,r),n="facet normal";break;case"facet normal":if("outer"!==l[0]||"loop"!==l[1])return console.error(a),console.error('Invalid state "'.concat(l[0],'", should be "outer loop"'));n="vertex";break;case"vertex":if("vertex"===l[0])o=new x.default.Vector(parseFloat(l[1]),parseFloat(l[2]),parseFloat(l[3])),e.vertices.push(o),e.uvs.push([0,0]),s.push(e.vertices.indexOf(o));else{if("endloop"!==l[0])return console.error(a),console.error('Invalid state "'.concat(l[0],'", should be "vertex" or "endloop"'));e.faces.push(s),s=[],n="endloop"}break;case"endloop":if("endfacet"!==l[0])return console.error(a),console.error('Invalid state "'.concat(l[0],'", should be "endfacet"'));n="endfacet";break;case"endfacet":if("endsolid"!==l[0]){if("facet"!==l[0]||"normal"!==l[1])return console.error(a),console.error('Invalid state "'.concat(l[0],'", should be "endsolid" or "facet normal"'));r=new x.default.Vector(parseFloat(l[2]),parseFloat(l[3]),parseFloat(l[4])),e.vertexNormals.push(r,r,r),n="facet normal"}break;default:console.error('Invalid state "'.concat(n,'"'))}}}(e,t)}}(v,e),y&&v.normalize(),b._decrementPreload(),"function"==typeof g&&g(v)},t):r.match(/\.obj$/i)?this.loadStrings(e,function(e){for(var t=v,r=e,o={v:[],vt:[],vn:[]},n={},s=0;s<r.length;++s){var i=r[s].trim().split(/\b\s+/);if(0<i.length)if("v"===i[0]||"vn"===i[0]){var a=new x.default.Vector(parseFloat(i[1]),parseFloat(i[2]),parseFloat(i[3]));o[i[0]].push(a)}else if("vt"===i[0]){a=[parseFloat(i[1]),1-parseFloat(i[2])];o[i[0]].push(a)}else if("f"===i[0])for(var l=3;l<i.length;++l){for(var u=[],c=[1,l-1,l],d=0;d<c.length;++d){var f=i[c[d]],h=0;if(void 0!==n[f])h=n[f];else{for(var p=f.split("/"),m=0;m<p.length;m++)p[m]=parseInt(p[m])-1;h=n[f]=t.vertices.length,t.vertices.push(o.v[p[0]].copy()),o.vt[p[1]]?t.uvs.push(o.vt[p[1]].slice()):t.uvs.push([0,0]),o.vn[p[2]]&&t.vertexNormals.push(o.vn[p[2]].copy())}u.push(h)}u[0]!==u[1]&&u[0]!==u[2]&&u[1]!==u[2]&&t.faces.push(u)}}0===t.vertexNormals.length&&t.computeNormals(),y&&v.normalize(),b._decrementPreload(),"function"==typeof g&&g(v)},t):(x.default._friendlyFileLoadError(3,e),t?t():console.error("Sorry, the file type is invalid. Only OBJ and STL files are supported.")),v},x.default.prototype.model=function(e){this._assert3d("model"),x.default._validateParameters("model",arguments),0<e.vertices.length&&(this._renderer.geometryInHash(e.gid)||(e._makeTriangleEdges()._edgesToVertices(),this._renderer.createBuffers(e.gid,e)),this._renderer.drawBuffers(e.gid))};var o=x.default;r.default=o},{"../core/main":267,"./p5.Geometry":316,"core-js/modules/es.array.concat":149,"core-js/modules/es.array.index-of":157,"core-js/modules/es.array.slice":162,"core-js/modules/es.array.splice":164,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.string.match":187,"core-js/modules/es.string.split":191,"core-js/modules/es.string.trim":193}],314:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.join"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.join"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var u=(s=e("../core/main"))&&s.__esModule?s:{default:s},n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}e("./p5.Texture"),u.default.prototype.loadShader=function(e,t,r,o){u.default._validateParameters("loadShader",arguments),o=o||console.error;function n(){i._decrementPreload(),r&&r(s)}var s=new u.default.Shader,i=this,a=!1,l=!1;return this.loadStrings(e,function(e){s._vertSrc=e.join("\n"),l=!0,a&&n()},o),this.loadStrings(t,function(e){s._fragSrc=e.join("\n"),a=!0,l&&n()},o),s},u.default.prototype.createShader=function(e,t){return this._assert3d("createShader"),u.default._validateParameters("createShader",arguments),new u.default.Shader(this._renderer,e,t)},u.default.prototype.shader=function(e){return this._assert3d("shader"),u.default._validateParameters("shader",arguments),void 0===e._renderer&&(e._renderer=this._renderer),e.init(),e.isStrokeShader()?this._renderer.userStrokeShader=e:(this._renderer.userFillShader=e,this._renderer._useNormalMaterial=!1),this},u.default.prototype.resetShader=function(){return this._renderer.userFillShader=this._renderer.userStrokeShader=null,this},u.default.prototype.texture=function(e){return this._assert3d("texture"),u.default._validateParameters("texture",arguments),e.gifProperties&&e._animateGif(this),this._renderer.drawMode=n.TEXTURE,this._renderer._useSpecularMaterial=!1,this._renderer._useEmissiveMaterial=!1,this._renderer._useNormalMaterial=!1,this._renderer._tex=e,this._renderer._setProperty("_doFill",!0),this},u.default.prototype.textureMode=function(e){e!==n.IMAGE&&e!==n.NORMAL?console.warn("You tried to set ".concat(e," textureMode only supports IMAGE & NORMAL ")):this._renderer.textureMode=e},u.default.prototype.textureWrap=function(e){for(var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:e,r=(this._renderer.textureWrapX=e,this._renderer.textureWrapY=t,this._renderer.textures),o=0;o<r.length;o++)r[o].setWrapMode(e,t)},u.default.prototype.normalMaterial=function(){this._assert3d("normalMaterial");for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return u.default._validateParameters("normalMaterial",t),this._renderer.drawMode=n.FILL,this._renderer._useSpecularMaterial=!1,this._renderer._useEmissiveMaterial=!1,this._renderer._useNormalMaterial=!0,this._renderer.curFillColor=[1,1,1,1],this._renderer._setProperty("_doFill",!0),this.noStroke(),this},u.default.prototype.ambientMaterial=function(e,t,r){this._assert3d("ambientMaterial"),u.default._validateParameters("ambientMaterial",arguments);var o=u.default.prototype.color.apply(this,arguments);return this._renderer.curAmbientColor=o._array,this._renderer._useNormalMaterial=!1,this._renderer._enableLighting=!0,this._renderer._tex=null,this._renderer._setProperty("_doFill",!0),this},u.default.prototype.emissiveMaterial=function(e,t,r,o){this._assert3d("emissiveMaterial"),u.default._validateParameters("emissiveMaterial",arguments);var n=u.default.prototype.color.apply(this,arguments);return this._renderer.curEmissiveColor=n._array,this._renderer._useEmissiveMaterial=!0,this._renderer._useNormalMaterial=!1,this._renderer._enableLighting=!0,this._renderer._tex=null,this},u.default.prototype.specularMaterial=function(e,t,r,o){this._assert3d("specularMaterial"),u.default._validateParameters("specularMaterial",arguments);var n=u.default.prototype.color.apply(this,arguments);return this._renderer.curSpecularColor=n._array,this._renderer._useSpecularMaterial=!0,this._renderer._useNormalMaterial=!1,this._renderer._enableLighting=!0,this._renderer._tex=null,this},u.default.prototype.shininess=function(e){return this._assert3d("shininess"),u.default._validateParameters("shininess",arguments),this._renderer._useShininess=e=e<1?1:e,this},u.default.RendererGL.prototype._applyColorBlend=function(e){var t=this.GL,r=this.drawMode===n.TEXTURE,r=this.userFillShader||this.userStrokeShader||this.userPointShader||r||this.curBlendMode!==n.BLEND||e[e.length-1]<1||this._isErasing;return r!==this._isBlending&&(r||this.curBlendMode!==n.BLEND&&this.curBlendMode!==n.ADD?t.enable(t.BLEND):t.disable(t.BLEND),t.depthMask(!0),this._isBlending=r),this._applyBlendMode(),e},u.default.RendererGL.prototype._applyBlendMode=function(){if(this._cachedBlendMode!==this.curBlendMode){var e=this.GL;switch(this.curBlendMode){case n.BLEND:e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case n.ADD:e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ONE);break;case n.REMOVE:e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ZERO,e.ONE_MINUS_SRC_ALPHA);break;case n.MULTIPLY:e.blendEquation(e.FUNC_ADD),e.blendFunc(e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA);break;case n.SCREEN:e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_COLOR);break;case n.EXCLUSION:e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ONE_MINUS_DST_COLOR,e.ONE_MINUS_SRC_COLOR,e.ONE,e.ONE);break;case n.REPLACE:e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ZERO);break;case n.SUBTRACT:e.blendEquationSeparate(e.FUNC_REVERSE_SUBTRACT,e.FUNC_ADD),e.blendFuncSeparate(e.ONE,e.ONE,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case n.DARKEST:this.blendExt?(e.blendEquationSeparate(this.blendExt.MIN_EXT,e.FUNC_ADD),e.blendFuncSeparate(e.ONE,e.ONE,e.ONE,e.ONE)):console.warn("blendMode(DARKEST) does not work in your browser in WEBGL mode.");break;case n.LIGHTEST:this.blendExt?(e.blendEquationSeparate(this.blendExt.MAX_EXT,e.FUNC_ADD),e.blendFuncSeparate(e.ONE,e.ONE,e.ONE,e.ONE)):console.warn("blendMode(LIGHTEST) does not work in your browser in WEBGL mode.");break;default:console.error("Oops! Somehow RendererGL set curBlendMode to an unsupported mode.")}this._isErasing||(this._cachedBlendMode=this.curBlendMode)}};var s=u.default;r.default=s},{"../core/constants":256,"../core/main":267,"./p5.Texture":323,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.join":159,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],315:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var f=(e=e("../core/main"))&&e.__esModule?e:{default:e};f.default.prototype.camera=function(){var e;this._assert3d("camera");for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return f.default._validateParameters("camera",r),(e=this._renderer._curCamera).camera.apply(e,r),this},f.default.prototype.perspective=function(){var e;this._assert3d("perspective");for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return f.default._validateParameters("perspective",r),(e=this._renderer._curCamera).perspective.apply(e,r),this},f.default.prototype.ortho=function(){var e;this._assert3d("ortho");for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return f.default._validateParameters("ortho",r),(e=this._renderer._curCamera).ortho.apply(e,r),this},f.default.prototype.frustum=function(){var e;this._assert3d("frustum");for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return f.default._validateParameters("frustum",r),(e=this._renderer._curCamera).frustum.apply(e,r),this},f.default.prototype.createCamera=function(){this._assert3d("createCamera");var e=new f.default.Camera(this._renderer);return e._computeCameraDefaultSettings(),e._setDefaultCamera(),this._renderer._curCamera=e},f.default.Camera=function(e){this._renderer=e,this.cameraType="default",this.cameraMatrix=new f.default.Matrix,this.projMatrix=new f.default.Matrix},f.default.Camera.prototype.perspective=function(e,t,r,o){this.cameraType=0<arguments.length?"custom":"default",void 0===e?(e=this.defaultCameraFOV,this.cameraFOV=e):this.cameraFOV=this._renderer._pInst._toRadians(e),void 0===t&&(t=this.defaultAspectRatio),void 0===r&&(r=this.defaultCameraNear),void 0===o&&(o=this.defaultCameraFar),r<=1e-4&&(r=.01,console.log("Avoid perspective near plane values close to or below 0. Setting value to 0.01.")),o<r&&console.log("Perspective far plane value is less than near plane value. Nothing will be shown."),this.aspectRatio=t,this.cameraNear=r,this.cameraFar=o,this.projMatrix=f.default.Matrix.identity();var e=1/Math.tan(this.cameraFOV/2),n=1/(this.cameraNear-this.cameraFar);this.projMatrix.set(e/t,0,0,0,0,-e,0,0,0,0,(o+r)*n,-1,0,0,2*o*r*n,0),this._isActive()&&this._renderer.uPMatrix.set(this.projMatrix.mat4[0],this.projMatrix.mat4[1],this.projMatrix.mat4[2],this.projMatrix.mat4[3],this.projMatrix.mat4[4],this.projMatrix.mat4[5],this.projMatrix.mat4[6],this.projMatrix.mat4[7],this.projMatrix.mat4[8],this.projMatrix.mat4[9],this.projMatrix.mat4[10],this.projMatrix.mat4[11],this.projMatrix.mat4[12],this.projMatrix.mat4[13],this.projMatrix.mat4[14],this.projMatrix.mat4[15])},f.default.Camera.prototype.ortho=function(e,t,r,o,n,s){void 0===e&&(e=-this._renderer.width/2),void 0===t&&(t=+this._renderer.width/2),void 0===r&&(r=-this._renderer.height/2),void 0===n&&(n=0);var i=t-e,a=(o=void 0===o?+this._renderer.height/2:o)-r,l=(s=void 0===s?Math.max(this._renderer.width,this._renderer.height):s)-n,u=2/i,c=2/a,d=-2/l,t=-(t+e)/i,e=-(o+r)/a,i=-(s+n)/l;this.projMatrix=f.default.Matrix.identity(),this.projMatrix.set(u,0,0,0,0,-c,0,0,0,0,d,0,t,e,i,1),this._isActive()&&this._renderer.uPMatrix.set(this.projMatrix.mat4[0],this.projMatrix.mat4[1],this.projMatrix.mat4[2],this.projMatrix.mat4[3],this.projMatrix.mat4[4],this.projMatrix.mat4[5],this.projMatrix.mat4[6],this.projMatrix.mat4[7],this.projMatrix.mat4[8],this.projMatrix.mat4[9],this.projMatrix.mat4[10],this.projMatrix.mat4[11],this.projMatrix.mat4[12],this.projMatrix.mat4[13],this.projMatrix.mat4[14],this.projMatrix.mat4[15]),this.cameraType="custom"},f.default.Camera.prototype.frustum=function(e,t,r,o,n,s){void 0===e&&(e=-this._renderer.width/2),void 0===t&&(t=+this._renderer.width/2),void 0===r&&(r=-this._renderer.height/2),void 0===n&&(n=0);var i=t-e,a=(o=void 0===o?+this._renderer.height/2:o)-r,l=(s=void 0===s?Math.max(this._renderer.width,this._renderer.height):s)-n,u=2*n/i,c=2*n/a,d=-2*s*n/l,t=(t+e)/i,e=(o+r)/a,i=-(s+n)/l;this.projMatrix=f.default.Matrix.identity(),this.projMatrix.set(u,0,0,0,0,c,0,0,t,e,i,-1,0,0,d,0),this._isActive()&&this._renderer.uPMatrix.set(this.projMatrix.mat4[0],this.projMatrix.mat4[1],this.projMatrix.mat4[2],this.projMatrix.mat4[3],this.projMatrix.mat4[4],this.projMatrix.mat4[5],this.projMatrix.mat4[6],this.projMatrix.mat4[7],this.projMatrix.mat4[8],this.projMatrix.mat4[9],this.projMatrix.mat4[10],this.projMatrix.mat4[11],this.projMatrix.mat4[12],this.projMatrix.mat4[13],this.projMatrix.mat4[14],this.projMatrix.mat4[15]),this.cameraType="custom"},f.default.Camera.prototype._rotateView=function(e,t,r,o){var n=this.centerX,s=this.centerY,i=this.centerZ,a=(n-=this.eyeX,s-=this.eyeY,i-=this.eyeZ,f.default.Matrix.identity(this._renderer._pInst)),e=(a.rotate(this._renderer._pInst._toRadians(e),t,r,o),[n*a.mat4[0]+s*a.mat4[4]+i*a.mat4[8],n*a.mat4[1]+s*a.mat4[5]+i*a.mat4[9],n*a.mat4[2]+s*a.mat4[6]+i*a.mat4[10]]);e[0]+=this.eyeX,e[1]+=this.eyeY,e[2]+=this.eyeZ,this.camera(this.eyeX,this.eyeY,this.eyeZ,e[0],e[1],e[2],this.upX,this.upY,this.upZ)},f.default.Camera.prototype.pan=function(e){var t=this._getLocalAxes();this._rotateView(e,t.y[0],t.y[1],t.y[2])},f.default.Camera.prototype.tilt=function(e){var t=this._getLocalAxes();this._rotateView(e,t.x[0],t.x[1],t.x[2])},f.default.Camera.prototype.lookAt=function(e,t,r){this.camera(this.eyeX,this.eyeY,this.eyeZ,e,t,r,this.upX,this.upY,this.upZ)},f.default.Camera.prototype.camera=function(e,t,r,o,n,s,i,a,l){void 0===e&&(e=this.defaultEyeX,t=this.defaultEyeY,r=this.defaultEyeZ,o=e,n=t,a=1,l=i=s=0),this.eyeX=e,this.eyeY=t,this.eyeZ=r,void 0!==o&&(this.centerX=o,this.centerY=n,this.centerZ=s),void 0!==i&&(this.upX=i,this.upY=a,this.upZ=l);o=this._getLocalAxes(),this.cameraMatrix.set(o.x[0],o.y[0],o.z[0],0,o.x[1],o.y[1],o.z[1],0,o.x[2],o.y[2],o.z[2],0,0,0,0,1),n=-e;return this.cameraMatrix.translate([n,-t,-r]),this._isActive()&&this._renderer.uMVMatrix.set(this.cameraMatrix.mat4[0],this.cameraMatrix.mat4[1],this.cameraMatrix.mat4[2],this.cameraMatrix.mat4[3],this.cameraMatrix.mat4[4],this.cameraMatrix.mat4[5],this.cameraMatrix.mat4[6],this.cameraMatrix.mat4[7],this.cameraMatrix.mat4[8],this.cameraMatrix.mat4[9],this.cameraMatrix.mat4[10],this.cameraMatrix.mat4[11],this.cameraMatrix.mat4[12],this.cameraMatrix.mat4[13],this.cameraMatrix.mat4[14],this.cameraMatrix.mat4[15]),this},f.default.Camera.prototype.move=function(e,t,r){var o=this._getLocalAxes(),e=[o.x[0]*e,o.x[1]*e,o.x[2]*e],t=[o.y[0]*t,o.y[1]*t,o.y[2]*t],o=[o.z[0]*r,o.z[1]*r,o.z[2]*r];this.camera(this.eyeX+e[0]+t[0]+o[0],this.eyeY+e[1]+t[1]+o[1],this.eyeZ+e[2]+t[2]+o[2],this.centerX+e[0]+t[0]+o[0],this.centerY+e[1]+t[1]+o[1],this.centerZ+e[2]+t[2]+o[2],this.upX,this.upY,this.upZ)},f.default.Camera.prototype.setPosition=function(e,t,r){var o=e-this.eyeX,n=t-this.eyeY,s=r-this.eyeZ;this.camera(e,t,r,this.centerX+o,this.centerY+n,this.centerZ+s,this.upX,this.upY,this.upZ)},f.default.Camera.prototype._computeCameraDefaultSettings=function(){this.defaultCameraFOV=60/180*Math.PI,this.defaultAspectRatio=this._renderer.width/this._renderer.height,this.defaultEyeX=0,this.defaultEyeY=0,this.defaultEyeZ=this._renderer.height/2/Math.tan(this.defaultCameraFOV/2),this.defaultCenterX=0,this.defaultCenterY=0,this.defaultCenterZ=0,this.defaultCameraNear=.1*this.defaultEyeZ,this.defaultCameraFar=10*this.defaultEyeZ},f.default.Camera.prototype._setDefaultCamera=function(){this.cameraFOV=this.defaultCameraFOV,this.aspectRatio=this.defaultAspectRatio,this.eyeX=this.defaultEyeX,this.eyeY=this.defaultEyeY,this.eyeZ=this.defaultEyeZ,this.centerX=this.defaultCenterX,this.centerY=this.defaultCenterY,this.centerZ=this.defaultCenterZ,this.upX=0,this.upY=1,this.upZ=0,this.cameraNear=this.defaultCameraNear,this.cameraFar=this.defaultCameraFar,this.perspective(),this.camera(),this.cameraType="default"},f.default.Camera.prototype._resize=function(){"default"===this.cameraType?(this._computeCameraDefaultSettings(),this._setDefaultCamera()):this.perspective(this.cameraFOV,this._renderer.width/this._renderer.height)},f.default.Camera.prototype.copy=function(){var e=new f.default.Camera(this._renderer);return e.cameraFOV=this.cameraFOV,e.aspectRatio=this.aspectRatio,e.eyeX=this.eyeX,e.eyeY=this.eyeY,e.eyeZ=this.eyeZ,e.centerX=this.centerX,e.centerY=this.centerY,e.centerZ=this.centerZ,e.cameraNear=this.cameraNear,e.cameraFar=this.cameraFar,e.cameraType=this.cameraType,e.cameraMatrix=this.cameraMatrix.copy(),e.projMatrix=this.projMatrix.copy(),e},f.default.Camera.prototype._getLocalAxes=function(){var e=this.eyeX-this.centerX,t=this.eyeY-this.centerY,r=this.eyeZ-this.centerZ,o=Math.sqrt(e*e+t*t+r*r),o=(0!==o&&(e/=o,t/=o,r/=o),this.upX),n=(a=this.upY)*r-(l=this.upZ)*t,s=-o*r+l*e,i=o*t-a*e,o=t*i-r*s,a=-e*i+r*n,l=e*s-t*n,u=Math.sqrt(n*n+s*s+i*i),u=(0!==u&&(n/=u,s/=u,i/=u),Math.sqrt(o*o+a*a+l*l));return 0!==u&&(o/=u,a/=u,l/=u),{x:[n,s,i],y:[o,a,l],z:[e,t,r]}},f.default.Camera.prototype._orbit=function(e,t,r){var o=this.eyeX-this.centerX,n=this.eyeY-this.centerY,s=this.eyeZ-this.centerZ,i=Math.sqrt(o*o+n*n+s*s),o=Math.atan2(o,s),s=Math.acos(Math.max(-1,Math.min(1,n/i))),n=0<this.upY?1:-1,e=(o+=n*e,((s+=n*t)<=0||s>=Math.PI)&&(n*=-1),(i+=r)<0&&(i=.1),Math.sin(s)*i*Math.sin(o)),t=Math.cos(s)*i,r=Math.sin(s)*i*Math.cos(o);this.camera(e+this.centerX,t+this.centerY,r+this.centerZ,this.centerX,this.centerY,this.centerZ,0,n,0)},f.default.Camera.prototype._isActive=function(){return this===this._renderer._curCamera},f.default.prototype.setCamera=function(e){this._renderer._curCamera=e,this._renderer.uPMatrix.set(e.projMatrix.mat4[0],e.projMatrix.mat4[1],e.projMatrix.mat4[2],e.projMatrix.mat4[3],e.projMatrix.mat4[4],e.projMatrix.mat4[5],e.projMatrix.mat4[6],e.projMatrix.mat4[7],e.projMatrix.mat4[8],e.projMatrix.mat4[9],e.projMatrix.mat4[10],e.projMatrix.mat4[11],e.projMatrix.mat4[12],e.projMatrix.mat4[13],e.projMatrix.mat4[14],e.projMatrix.mat4[15])};e=f.default.Camera;r.default=e},{"../core/main":267}],316:[function(e,t,r){"use strict";e("core-js/modules/es.array.slice"),e("core-js/modules/es.string.sub"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.string.sub"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var l=(e=e("../core/main"))&&e.__esModule?e:{default:e};l.default.Geometry=function(e,t,r){return this.vertices=[],this.lineVertices=[],this.lineTangentsIn=[],this.lineTangentsOut=[],this.lineSides=[],this.vertexNormals=[],this.faces=[],this.uvs=[],this.edges=[],this.vertexColors=[],this.vertexStrokeColors=[],this.lineVertexColors=[],this.detailX=void 0!==e?e:1,this.detailY=void 0!==t?t:1,this.dirtyFlags={},r instanceof Function&&r.call(this),this},l.default.Geometry.prototype.reset=function(){this.lineVertices.length=0,this.lineTangentsIn.length=0,this.lineTangentsOut.length=0,this.lineSides.length=0,this.vertices.length=0,this.edges.length=0,this.vertexColors.length=0,this.vertexStrokeColors.length=0,this.lineVertexColors.length=0,this.vertexNormals.length=0,this.uvs.length=0,this.dirtyFlags={}},l.default.Geometry.prototype.computeFaces=function(){this.faces.length=0;for(var e,t,r,o=this.detailX+1,n=0;n<this.detailY;n++)for(var s=0;s<this.detailX;s++)t=(n+1)*o+s+1,this.faces.push([n*o+s,e=n*o+s+1,r=(n+1)*o+s]),this.faces.push([r,e,t]);return this},l.default.Geometry.prototype._getFaceNormal=function(e){var e=this.faces[e],t=this.vertices[e[0]],r=this.vertices[e[1]],e=this.vertices[e[2]],r=l.default.Vector.sub(r,t),e=l.default.Vector.sub(e,t),t=l.default.Vector.cross(r,e),o=l.default.Vector.mag(t),r=o/(l.default.Vector.mag(r)*l.default.Vector.mag(e));return 0===r||isNaN(r)?(console.warn("p5.Geometry.prototype._getFaceNormal:","face has colinear sides or a repeated vertex"),t):(1<r&&(r=1),t.mult(Math.asin(r)/o))},l.default.Geometry.prototype.computeNormals=function(){for(var e=this.vertexNormals,t=this.vertices,r=this.faces,o=e.length=0;o<t.length;++o)e.push(new l.default.Vector);for(var n=0;n<r.length;++n)for(var s=r[n],i=this._getFaceNormal(n),a=0;a<3;++a)e[s[a]].add(i);for(o=0;o<t.length;++o)e[o].normalize();return this},l.default.Geometry.prototype.averageNormals=function(){for(var e=0;e<=this.detailY;e++){var t=this.detailX+1,r=l.default.Vector.add(this.vertexNormals[e*t],this.vertexNormals[e*t+this.detailX]),r=l.default.Vector.div(r,2);this.vertexNormals[e*t]=r,this.vertexNormals[e*t+this.detailX]=r}return this},l.default.Geometry.prototype.averagePoleNormals=function(){for(var e=new l.default.Vector(0,0,0),t=0;t<this.detailX;t++)e.add(this.vertexNormals[t]);for(var e=l.default.Vector.div(e,this.detailX),r=0;r<this.detailX;r++)this.vertexNormals[r]=e;e=new l.default.Vector(0,0,0);for(var o=this.vertices.length-1;o>this.vertices.length-1-this.detailX;o--)e.add(this.vertexNormals[o]);e=l.default.Vector.div(e,this.detailX);for(var n=this.vertices.length-1;n>this.vertices.length-1-this.detailX;n--)this.vertexNormals[n]=e;return this},l.default.Geometry.prototype._makeTriangleEdges=function(){if(this.edges.length=0,Array.isArray(this.strokeIndices))for(var e=0,t=this.strokeIndices.length;e<t;e++)this.edges.push(this.strokeIndices[e]);else for(var r=0;r<this.faces.length;r++)this.edges.push([this.faces[r][0],this.faces[r][1]]),this.edges.push([this.faces[r][1],this.faces[r][2]]),this.edges.push([this.faces[r][2],this.faces[r][0]]);return this},l.default.Geometry.prototype._edgesToVertices=function(){this.lineVertices.length=0,this.lineTangentsIn.length=0,this.lineTangentsOut.length=0,this.lineSides.length=0;for(var e,t=1<this.edges.length&&this.edges[0][0]===this.edges[this.edges.length-1][1],r=!1,o=0;o<this.edges.length;o++){var n=this.edges[o-1],s=this.edges[o],i=this.vertices[s[0]],a=this.vertices[s[1]],l=0<this.vertexStrokeColors.length?this.vertexStrokeColors.slice(4*s[0],4*(s[0]+1)):[0,0,0,0],u=0<this.vertexStrokeColors.length?this.vertexStrokeColors.slice(4*s[1],4*(s[1]+1)):[0,0,0,0],c=a.copy().sub(i).normalize(),d=0<c.magSq();d&&this._addSegment(i,a,l,u,c),0<o&&n[1]===s[0]?(e&&d&&c.dot(e)<1-1e-8&&this._addJoin(i,e,c,l),!d||r||t||(this._addCap(i,c.copy().mult(-1),l),r=!0)):(r=!1,d&&(!t||0<o)&&(this._addCap(i,c.copy().mult(-1),l),r=!0),e&&(!t||o<this.edges.length-1)&&(this._addCap(this.vertices[n[1]],e,l),e=void 0)),o===this.edges.length-1&&(t?this._addJoin(a,c,this.vertices[this.edges[0][1]].copy().sub(a).normalize(),u):this._addCap(a,c,u)),d&&(e=c)}return this},l.default.Geometry.prototype._addSegment=function(e,t,r,o,n){var e=e.array(),t=t.array(),s=n.array();this.lineSides.push(1,-1,1,1,-1,-1);for(var i=0,a=[this.lineTangentsIn,this.lineTangentsOut];i<a.length;i++)a[i].push(s,s,s,s,s,s);return this.lineVertices.push(e,e,t,t,e,t),this.lineVertexColors.push(r,r,o,o,r,o),this},l.default.Geometry.prototype._addCap=function(e,t,r){for(var o=e.array(),n=t.array(),s=[0,0,0],i=0;i<6;i++)this.lineVertices.push(o),this.lineTangentsIn.push(n),this.lineTangentsOut.push(s),this.lineVertexColors.push(r);return this.lineSides.push(-1,-2,2,2,1,-1),this},l.default.Geometry.prototype._addJoin=function(e,t,r,o){for(var n=e.array(),s=t.array(),i=r.array(),a=0;a<12;a++)this.lineVertices.push(n),this.lineTangentsIn.push(s),this.lineTangentsOut.push(i),this.lineVertexColors.push(o);for(var l=0,u=[-1,1];l<u.length;l++){var c=u[l];this.lineSides.push(c,2*c,3*c,c,3*c,0)}return this},l.default.Geometry.prototype.normalize=function(){if(0<this.vertices.length){for(var e=this.vertices[0].copy(),t=this.vertices[0].copy(),r=0;r<this.vertices.length;r++)e.x=Math.max(e.x,this.vertices[r].x),t.x=Math.min(t.x,this.vertices[r].x),e.y=Math.max(e.y,this.vertices[r].y),t.y=Math.min(t.y,this.vertices[r].y),e.z=Math.max(e.z,this.vertices[r].z),t.z=Math.min(t.z,this.vertices[r].z);for(var o=l.default.Vector.lerp(e,t,.5),n=l.default.Vector.sub(e,t),s=200/Math.max(Math.max(n.x,n.y),n.z),i=0;i<this.vertices.length;i++)this.vertices[i].sub(o),this.vertices[i].mult(s)}return this};e=l.default.Geometry;r.default=e},{"../core/main":267,"core-js/modules/es.array.slice":162,"core-js/modules/es.string.sub":192}],317:[function(e,t,r){"use strict";e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var O=(e=e("../core/main"))&&e.__esModule?e:{default:e};var o=Array,k=function(e){return e instanceof Array},e=("undefined"!=typeof Float32Array&&(o=Float32Array,k=function(e){return e instanceof Array||e instanceof Float32Array}),O.default.Matrix=function(){for(var e=new Array(arguments.length),t=0;t<e.length;++t)e[t]=arguments[t];return e.length&&e[e.length-1]instanceof O.default&&(this.p5=e[e.length-1]),"mat3"===e[0]?this.mat3=Array.isArray(e[1])?e[1]:new o([1,0,0,0,1,0,0,0,1]):this.mat4=Array.isArray(e[0])?e[0]:new o([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this},O.default.Matrix.prototype.set=function(e){return e instanceof O.default.Matrix?this.mat4=e.mat4:k(e)?this.mat4=e:16===arguments.length&&(this.mat4[0]=e,this.mat4[1]=arguments[1],this.mat4[2]=arguments[2],this.mat4[3]=arguments[3],this.mat4[4]=arguments[4],this.mat4[5]=arguments[5],this.mat4[6]=arguments[6],this.mat4[7]=arguments[7],this.mat4[8]=arguments[8],this.mat4[9]=arguments[9],this.mat4[10]=arguments[10],this.mat4[11]=arguments[11],this.mat4[12]=arguments[12],this.mat4[13]=arguments[13],this.mat4[14]=arguments[14],this.mat4[15]=arguments[15]),this},O.default.Matrix.prototype.get=function(){return new O.default.Matrix(this.mat4,this.p5)},O.default.Matrix.prototype.copy=function(){var e=new O.default.Matrix(this.p5);return e.mat4[0]=this.mat4[0],e.mat4[1]=this.mat4[1],e.mat4[2]=this.mat4[2],e.mat4[3]=this.mat4[3],e.mat4[4]=this.mat4[4],e.mat4[5]=this.mat4[5],e.mat4[6]=this.mat4[6],e.mat4[7]=this.mat4[7],e.mat4[8]=this.mat4[8],e.mat4[9]=this.mat4[9],e.mat4[10]=this.mat4[10],e.mat4[11]=this.mat4[11],e.mat4[12]=this.mat4[12],e.mat4[13]=this.mat4[13],e.mat4[14]=this.mat4[14],e.mat4[15]=this.mat4[15],e},O.default.Matrix.identity=function(e){return new O.default.Matrix(e)},O.default.Matrix.prototype.transpose=function(e){var t,r,o,n,s,i;return e instanceof O.default.Matrix?(t=e.mat4[1],r=e.mat4[2],o=e.mat4[3],n=e.mat4[6],s=e.mat4[7],i=e.mat4[11],this.mat4[0]=e.mat4[0],this.mat4[1]=e.mat4[4],this.mat4[2]=e.mat4[8],this.mat4[3]=e.mat4[12],this.mat4[4]=t,this.mat4[5]=e.mat4[5],this.mat4[6]=e.mat4[9],this.mat4[7]=e.mat4[13],this.mat4[8]=r,this.mat4[9]=n,this.mat4[10]=e.mat4[10],this.mat4[11]=e.mat4[14],this.mat4[12]=o,this.mat4[13]=s,this.mat4[14]=i,this.mat4[15]=e.mat4[15]):k(e)&&(t=e[1],r=e[2],o=e[3],n=e[6],s=e[7],i=e[11],this.mat4[0]=e[0],this.mat4[1]=e[4],this.mat4[2]=e[8],this.mat4[3]=e[12],this.mat4[4]=t,this.mat4[5]=e[5],this.mat4[6]=e[9],this.mat4[7]=e[13],this.mat4[8]=r,this.mat4[9]=n,this.mat4[10]=e[10],this.mat4[11]=e[14],this.mat4[12]=o,this.mat4[13]=s,this.mat4[14]=i,this.mat4[15]=e[15]),this},O.default.Matrix.prototype.invert=function(e){e instanceof O.default.Matrix?(t=e.mat4[0],r=e.mat4[1],o=e.mat4[2],n=e.mat4[3],s=e.mat4[4],i=e.mat4[5],a=e.mat4[6],l=e.mat4[7],u=e.mat4[8],c=e.mat4[9],d=e.mat4[10],f=e.mat4[11],h=e.mat4[12],p=e.mat4[13],m=e.mat4[14],y=e.mat4[15]):k(e)&&(t=e[0],r=e[1],o=e[2],n=e[3],s=e[4],i=e[5],a=e[6],l=e[7],u=e[8],c=e[9],d=e[10],f=e[11],h=e[12],p=e[13],m=e[14],y=e[15]);var t,r,o,n,s,i,a,l,u,c,d,f,h,p,m,y,e=t*i-r*s,g=t*a-o*s,v=t*l-n*s,b=r*a-o*i,j=r*l-n*i,_=o*l-n*a,x=u*p-c*h,w=u*m-d*h,S=u*y-f*h,M=c*m-d*p,E=c*y-f*p,T=d*y-f*m,C=e*T-g*E+v*M+b*S-j*w+_*x;return C?(this.mat4[0]=(i*T-a*E+l*M)*(C=1/C),this.mat4[1]=(o*E-r*T-n*M)*C,this.mat4[2]=(p*_-m*j+y*b)*C,this.mat4[3]=(d*j-c*_-f*b)*C,this.mat4[4]=(a*S-s*T-l*w)*C,this.mat4[5]=(t*T-o*S+n*w)*C,this.mat4[6]=(m*v-h*_-y*g)*C,this.mat4[7]=(u*_-d*v+f*g)*C,this.mat4[8]=(s*E-i*S+l*x)*C,this.mat4[9]=(r*S-t*E-n*x)*C,this.mat4[10]=(h*j-p*v+y*e)*C,this.mat4[11]=(c*v-u*j-f*e)*C,this.mat4[12]=(i*w-s*M-a*x)*C,this.mat4[13]=(t*M-r*w+o*x)*C,this.mat4[14]=(p*g-h*b-m*e)*C,this.mat4[15]=(u*b-c*g+d*e)*C,this):null},O.default.Matrix.prototype.invert3x3=function(){var e=this.mat3[0],t=this.mat3[1],r=this.mat3[2],o=this.mat3[3],n=this.mat3[4],s=this.mat3[5],i=this.mat3[6],a=this.mat3[7],l=this.mat3[8],u=l*n-s*a,c=-l*o+s*i,d=a*o-n*i,f=e*u+t*c+r*d;return f?(this.mat3[0]=u*(f=1/f),this.mat3[1]=(-l*t+r*a)*f,this.mat3[2]=(s*t-r*n)*f,this.mat3[3]=c*f,this.mat3[4]=(l*e-r*i)*f,this.mat3[5]=(-s*e+r*o)*f,this.mat3[6]=d*f,this.mat3[7]=(-a*e+t*i)*f,this.mat3[8]=(n*e-t*o)*f,this):null},O.default.Matrix.prototype.transpose3x3=function(e){var t=e[1],r=e[2],o=e[5];return this.mat3[1]=e[3],this.mat3[2]=e[6],this.mat3[3]=t,this.mat3[5]=e[7],this.mat3[6]=r,this.mat3[7]=o,this},O.default.Matrix.prototype.inverseTranspose=function(e){void 0===this.mat3?console.error("sorry, this function only works with mat3"):(this.mat3[0]=e.mat4[0],this.mat3[1]=e.mat4[1],this.mat3[2]=e.mat4[2],this.mat3[3]=e.mat4[4],this.mat3[4]=e.mat4[5],this.mat3[5]=e.mat4[6],this.mat3[6]=e.mat4[8],this.mat3[7]=e.mat4[9],this.mat3[8]=e.mat4[10]);e=this.invert3x3();if(e)e.transpose3x3(this.mat3);else for(var t=0;t<9;t++)this.mat3[t]=0;return this},O.default.Matrix.prototype.determinant=function(){var e=this.mat4[0]*this.mat4[5]-this.mat4[1]*this.mat4[4],t=this.mat4[0]*this.mat4[6]-this.mat4[2]*this.mat4[4],r=this.mat4[0]*this.mat4[7]-this.mat4[3]*this.mat4[4],o=this.mat4[1]*this.mat4[6]-this.mat4[2]*this.mat4[5],n=this.mat4[1]*this.mat4[7]-this.mat4[3]*this.mat4[5],s=this.mat4[2]*this.mat4[7]-this.mat4[3]*this.mat4[6],i=this.mat4[8]*this.mat4[13]-this.mat4[9]*this.mat4[12],a=this.mat4[8]*this.mat4[14]-this.mat4[10]*this.mat4[12],l=this.mat4[8]*this.mat4[15]-this.mat4[11]*this.mat4[12],u=this.mat4[9]*this.mat4[14]-this.mat4[10]*this.mat4[13],c=this.mat4[9]*this.mat4[15]-this.mat4[11]*this.mat4[13];return e*(this.mat4[10]*this.mat4[15]-this.mat4[11]*this.mat4[14])-t*c+r*u+o*l-n*a+s*i},O.default.Matrix.prototype.mult=function(e){var t;if(e===this||e===this.mat4)t=this.copy().mat4;else if(e instanceof O.default.Matrix)t=e.mat4;else if(k(e))t=e;else{if(16!==arguments.length)return;t=arguments}var e=this.mat4[0],r=this.mat4[1],o=this.mat4[2],n=this.mat4[3];return this.mat4[0]=e*t[0]+r*t[4]+o*t[8]+n*t[12],this.mat4[1]=e*t[1]+r*t[5]+o*t[9]+n*t[13],this.mat4[2]=e*t[2]+r*t[6]+o*t[10]+n*t[14],this.mat4[3]=e*t[3]+r*t[7]+o*t[11]+n*t[15],e=this.mat4[4],r=this.mat4[5],o=this.mat4[6],n=this.mat4[7],this.mat4[4]=e*t[0]+r*t[4]+o*t[8]+n*t[12],this.mat4[5]=e*t[1]+r*t[5]+o*t[9]+n*t[13],this.mat4[6]=e*t[2]+r*t[6]+o*t[10]+n*t[14],this.mat4[7]=e*t[3]+r*t[7]+o*t[11]+n*t[15],e=this.mat4[8],r=this.mat4[9],o=this.mat4[10],n=this.mat4[11],this.mat4[8]=e*t[0]+r*t[4]+o*t[8]+n*t[12],this.mat4[9]=e*t[1]+r*t[5]+o*t[9]+n*t[13],this.mat4[10]=e*t[2]+r*t[6]+o*t[10]+n*t[14],this.mat4[11]=e*t[3]+r*t[7]+o*t[11]+n*t[15],e=this.mat4[12],r=this.mat4[13],o=this.mat4[14],n=this.mat4[15],this.mat4[12]=e*t[0]+r*t[4]+o*t[8]+n*t[12],this.mat4[13]=e*t[1]+r*t[5]+o*t[9]+n*t[13],this.mat4[14]=e*t[2]+r*t[6]+o*t[10]+n*t[14],this.mat4[15]=e*t[3]+r*t[7]+o*t[11]+n*t[15],this},O.default.Matrix.prototype.apply=function(e){var t;if(e===this||e===this.mat4)t=this.copy().mat4;else if(e instanceof O.default.Matrix)t=e.mat4;else if(k(e))t=e;else{if(16!==arguments.length)return;t=arguments}var e=this.mat4,r=e[0],o=e[4],n=e[8],s=e[12],r=(e[0]=t[0]*r+t[1]*o+t[2]*n+t[3]*s,e[4]=t[4]*r+t[5]*o+t[6]*n+t[7]*s,e[8]=t[8]*r+t[9]*o+t[10]*n+t[11]*s,e[12]=t[12]*r+t[13]*o+t[14]*n+t[15]*s,e[1]),o=e[5],n=e[9],s=e[13],r=(e[1]=t[0]*r+t[1]*o+t[2]*n+t[3]*s,e[5]=t[4]*r+t[5]*o+t[6]*n+t[7]*s,e[9]=t[8]*r+t[9]*o+t[10]*n+t[11]*s,e[13]=t[12]*r+t[13]*o+t[14]*n+t[15]*s,e[2]),o=e[6],n=e[10],s=e[14],r=(e[2]=t[0]*r+t[1]*o+t[2]*n+t[3]*s,e[6]=t[4]*r+t[5]*o+t[6]*n+t[7]*s,e[10]=t[8]*r+t[9]*o+t[10]*n+t[11]*s,e[14]=t[12]*r+t[13]*o+t[14]*n+t[15]*s,e[3]),o=e[7],n=e[11],s=e[15];return e[3]=t[0]*r+t[1]*o+t[2]*n+t[3]*s,e[7]=t[4]*r+t[5]*o+t[6]*n+t[7]*s,e[11]=t[8]*r+t[9]*o+t[10]*n+t[11]*s,e[15]=t[12]*r+t[13]*o+t[14]*n+t[15]*s,this},O.default.Matrix.prototype.scale=function(e,t,r){return e instanceof O.default.Vector?(t=e.y,r=e.z,e=e.x):e instanceof Array&&(t=e[1],r=e[2],e=e[0]),this.mat4[0]*=e,this.mat4[1]*=e,this.mat4[2]*=e,this.mat4[3]*=e,this.mat4[4]*=t,this.mat4[5]*=t,this.mat4[6]*=t,this.mat4[7]*=t,this.mat4[8]*=r,this.mat4[9]*=r,this.mat4[10]*=r,this.mat4[11]*=r,this},O.default.Matrix.prototype.rotate=function(e,t,r,o){t instanceof O.default.Vector?(r=t.y,o=t.z,t=t.x):t instanceof Array&&(r=t[1],o=t[2],t=t[0]);var n=Math.sqrt(t*t+r*r+o*o),n=(t*=1/n,r*=1/n,o*=1/n,this.mat4[0]),s=this.mat4[1],i=this.mat4[2],a=this.mat4[3],l=this.mat4[4],u=this.mat4[5],c=this.mat4[6],d=this.mat4[7],f=this.mat4[8],h=this.mat4[9],p=this.mat4[10],m=this.mat4[11],y=Math.sin(e),e=Math.cos(e),g=1-e,v=t*t*g+e,b=r*t*g+o*y,j=o*t*g-r*y,_=t*r*g-o*y,x=r*r*g+e,w=o*r*g+t*y,S=t*o*g+r*y,r=r*o*g-t*y,t=o*o*g+e;return this.mat4[0]=n*v+l*b+f*j,this.mat4[1]=s*v+u*b+h*j,this.mat4[2]=i*v+c*b+p*j,this.mat4[3]=a*v+d*b+m*j,this.mat4[4]=n*_+l*x+f*w,this.mat4[5]=s*_+u*x+h*w,this.mat4[6]=i*_+c*x+p*w,this.mat4[7]=a*_+d*x+m*w,this.mat4[8]=n*S+l*r+f*t,this.mat4[9]=s*S+u*r+h*t,this.mat4[10]=i*S+c*r+p*t,this.mat4[11]=a*S+d*r+m*t,this},O.default.Matrix.prototype.translate=function(e){var t=e[0],r=e[1],e=e[2]||0;this.mat4[12]+=this.mat4[0]*t+this.mat4[4]*r+this.mat4[8]*e,this.mat4[13]+=this.mat4[1]*t+this.mat4[5]*r+this.mat4[9]*e,this.mat4[14]+=this.mat4[2]*t+this.mat4[6]*r+this.mat4[10]*e,this.mat4[15]+=this.mat4[3]*t+this.mat4[7]*r+this.mat4[11]*e},O.default.Matrix.prototype.rotateX=function(e){this.rotate(e,1,0,0)},O.default.Matrix.prototype.rotateY=function(e){this.rotate(e,0,1,0)},O.default.Matrix.prototype.rotateZ=function(e){this.rotate(e,0,0,1)},O.default.Matrix.prototype.perspective=function(e,t,r,o){var e=1/Math.tan(e/2),n=1/(r-o);return this.mat4[0]=e/t,this.mat4[1]=0,this.mat4[2]=0,this.mat4[3]=0,this.mat4[4]=0,this.mat4[5]=e,this.mat4[6]=0,this.mat4[7]=0,this.mat4[8]=0,this.mat4[9]=0,this.mat4[10]=(o+r)*n,this.mat4[11]=-1,this.mat4[12]=0,this.mat4[13]=0,this.mat4[14]=2*o*r*n,this.mat4[15]=0,this},O.default.Matrix.prototype.ortho=function(e,t,r,o,n,s){var i=1/(e-t),a=1/(r-o),l=1/(n-s);return this.mat4[0]=-2*i,this.mat4[1]=0,this.mat4[2]=0,this.mat4[3]=0,this.mat4[4]=0,this.mat4[5]=-2*a,this.mat4[6]=0,this.mat4[7]=0,this.mat4[8]=0,this.mat4[9]=0,this.mat4[10]=2*l,this.mat4[11]=0,this.mat4[12]=(e+t)*i,this.mat4[13]=(o+r)*a,this.mat4[14]=(s+n)*l,this.mat4[15]=1,this},O.default.Matrix);r.default=e},{"../core/main":267,"core-js/modules/es.array.iterator":158,"core-js/modules/es.object.to-string":177,"core-js/modules/es.typed-array.copy-within":197,"core-js/modules/es.typed-array.every":198,"core-js/modules/es.typed-array.fill":199,"core-js/modules/es.typed-array.filter":200,"core-js/modules/es.typed-array.find":202,"core-js/modules/es.typed-array.find-index":201,"core-js/modules/es.typed-array.float32-array":203,"core-js/modules/es.typed-array.for-each":205,"core-js/modules/es.typed-array.includes":206,"core-js/modules/es.typed-array.index-of":207,"core-js/modules/es.typed-array.iterator":210,"core-js/modules/es.typed-array.join":211,"core-js/modules/es.typed-array.last-index-of":212,"core-js/modules/es.typed-array.map":213,"core-js/modules/es.typed-array.reduce":215,"core-js/modules/es.typed-array.reduce-right":214,"core-js/modules/es.typed-array.reverse":216,"core-js/modules/es.typed-array.set":217,"core-js/modules/es.typed-array.slice":218,"core-js/modules/es.typed-array.some":219,"core-js/modules/es.typed-array.sort":220,"core-js/modules/es.typed-array.subarray":221,"core-js/modules/es.typed-array.to-locale-string":222,"core-js/modules/es.typed-array.to-string":223}],318:[function(e,t,r){"use strict";e("core-js/modules/es.array.map"),e("core-js/modules/es.array.map"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;e=(e=e("../core/main"))&&e.__esModule?e:{default:e};e.default.RenderBuffer=function(e,t,r,o,n,s){this.size=e,this.src=t,this.dst=r,this.attr=o,this._renderer=n,this.map=s},e.default.RenderBuffer.prototype._prepareBuffer=function(e,t){var r,o,n,s=t.attributes,i=this._renderer.GL,a=e.model||e,s=s[this.attr];s&&(r=e[this.dst],0<(o=a[this.src]).length?((n=!r)&&(e[this.dst]=r=i.createBuffer()),i.bindBuffer(i.ARRAY_BUFFER,r),!n&&!1===a.dirtyFlags[this.src]||(n=(e=this.map)?e(o):o,this._renderer._bindBuffer(r,i.ARRAY_BUFFER,n),a.dirtyFlags[this.src]=!1),t.enableAttrib(s,this.size)):-1!==(e=s.location)&&this._renderer.registerEnabled[e]&&(i.disableVertexAttribArray(e),this._renderer.registerEnabled[e]=!1))};e=e.default.RenderBuffer;r.default=e},{"../core/main":267,"core-js/modules/es.array.map":161}],319:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var l=(n=e("../core/main"))&&n.__esModule?n:{default:n},u=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}function c(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}e("./p5.RenderBuffer"),l.default.RendererGL.prototype.beginShape=function(e){return this.immediateMode.shapeMode=void 0!==e?e:u.TESS,this.immediateMode.geometry.reset(),this};var d={vertices:1,vertexNormals:1,vertexColors:4,vertexStrokeColors:4,uvs:2},n=(l.default.RendererGL.prototype.vertex=function(e,t){if(this.immediateMode.shapeMode===u.QUADS&&this.immediateMode.geometry.vertices.length%6==3)for(var r in d){var o=d[r],r=this.immediateMode.geometry[r];r.push.apply(r,c(r.slice(r.length-3*o,r.length-2*o)).concat(c(r.slice(r.length-o,r.length))))}var n,s,i=n=s=0,a=(3===arguments.length?i=arguments[2]:4===arguments.length?(n=arguments[2],s=arguments[3]):5===arguments.length&&(i=arguments[2],n=arguments[3],s=arguments[4]),new l.default.Vector(e,t,i)),a=(this.immediateMode.geometry.vertices.push(a),this.immediateMode.geometry.vertexNormals.push(this._currentNormal),this.curFillColor||[.5,.5,.5,1]),a=(this.immediateMode.geometry.vertexColors.push(a[0],a[1],a[2],a[3]),this.curStrokeColor||[.5,.5,.5,1]);return this.immediateMode.geometry.vertexStrokeColors.push(a[0],a[1],a[2],a[3]),this.textureMode===u.IMAGE&&(null!==this._tex?0<this._tex.width&&0<this._tex.height&&(n/=this._tex.width,s/=this._tex.height):!this.isProcessingVertices&&null===this._tex&&4<=arguments.length&&console.warn("You must first call texture() before using vertex() with image based u and v coordinates")),this.immediateMode.geometry.uvs.push(n,s),this.immediateMode._bezierVertex[0]=e,this.immediateMode._bezierVertex[1]=t,this.immediateMode._bezierVertex[2]=i,this.immediateMode._quadraticVertex[0]=e,this.immediateMode._quadraticVertex[1]=t,this.immediateMode._quadraticVertex[2]=i,this},l.default.RendererGL.prototype.normal=function(e,t,r){return e instanceof l.default.Vector?this._currentNormal=e:this._currentNormal=new l.default.Vector(e,t,r),this},l.default.RendererGL.prototype.endShape=function(e,t,r,o,n,s){return this.immediateMode.shapeMode===u.POINTS?this._drawPoints(this.immediateMode.geometry.vertices,this.immediateMode.buffers.point):(this.isProcessingVertices=!0,this._processVertices.apply(this,arguments),this.isProcessingVertices=!1,this._doFill&&1<this.immediateMode.geometry.vertices.length&&this._drawImmediateFill(),this._doStroke&&1<this.immediateMode.geometry.lineVertices.length&&this._drawImmediateStroke(),this.isBezier=!1,this.isQuadratic=!1,this.isCurve=!1,this.immediateMode._bezierVertex.length=0,this.immediateMode._quadraticVertex.length=0,this.immediateMode._curveVertex.length=0),this},l.default.RendererGL.prototype._processVertices=function(e){var t;0!==this.immediateMode.geometry.vertices.length&&(t=this._doStroke,e=e===u.CLOSE,t&&(this.immediateMode.geometry.edges=this._calculateEdges(this.immediateMode.shapeMode,this.immediateMode.geometry.vertices,e),this.immediateMode.geometry._edgesToVertices()),t=this.immediateMode.shapeMode===u.TESS,this._doFill&&(this.isBezier||this.isQuadratic||this.isCurve||t)&&this.immediateMode.shapeMode!==u.LINES&&this._tesselateShape())},l.default.RendererGL.prototype._calculateEdges=function(e,t,r){var o=[],n=0;switch(e){case u.TRIANGLE_STRIP:for(n=0;n<t.length-2;n++)o.push([n,n+1]),o.push([n,n+2]);o.push([n,n+1]);break;case u.TRIANGLE_FAN:for(n=1;n<t.length-1;n++)o.push([0,n]),o.push([n,n+1]);o.push([0,t.length-1]);break;case u.TRIANGLES:for(n=0;n<t.length-2;n+=3)o.push([n,n+1]),o.push([n+1,n+2]),o.push([n+2,n]);break;case u.LINES:for(n=0;n<t.length-1;n+=2)o.push([n,n+1]);break;case u.QUADS:for(n=0;n<t.length-5;n+=6)o.push([n,n+1]),o.push([n+1,n+2]),o.push([n+3,n+5]),o.push([n+4,n+5]);break;case u.QUAD_STRIP:for(n=0;n<t.length-2;n+=2)o.push([n,n+1]),o.push([n,n+2]),o.push([n+1,n+3]);o.push([n,n+1]);break;default:for(n=0;n<t.length-1;n++)o.push([n,n+1])}return r&&o.push([t.length-1,0]),o},l.default.RendererGL.prototype._tesselateShape=function(){for(var r=this,e=(this.immediateMode.shapeMode=u.TRIANGLES,[this._flatten(this.immediateMode.geometry.vertices.map(function(e,t){return[e.x,e.y,e.z,r.immediateMode.geometry.uvs[2*t],r.immediateMode.geometry.uvs[2*t+1],r.immediateMode.geometry.vertexColors[4*t],r.immediateMode.geometry.vertexColors[4*t+1],r.immediateMode.geometry.vertexColors[4*t+2],r.immediateMode.geometry.vertexColors[4*t+3],r.immediateMode.geometry.vertexNormals[t].x,r.immediateMode.geometry.vertexNormals[t].y,r.immediateMode.geometry.vertexNormals[t].z]}))]),t=this._triangulate(e),o=(this.immediateMode.geometry.vertices=[],this.immediateMode.geometry.vertexNormals=[],this.immediateMode.geometry.uvs=[],[]),n=0,s=t.length;n<s;n+=l.default.RendererGL.prototype.tessyVertexSize)o.push.apply(o,c(t.slice(n+5,n+9))),this.normal.apply(this,c(t.slice(n+9,n+12))),this.vertex.apply(this,c(t.slice(n,n+5)));this.immediateMode.geometry.vertexColors=o},l.default.RendererGL.prototype._drawImmediateFill=function(){var e=this.GL,t=(this._useVertexColor=0<this.immediateMode.geometry.vertexColors.length,this._getImmediateFillShader()),r=(this._setFillUniforms(t),!0),o=!1,n=void 0;try{for(var s,i=this.immediateMode.buffers.fill[Symbol.iterator]();!(r=(s=i.next()).done);r=!0)s.value._prepareBuffer(this.immediateMode.geometry,t)}catch(e){o=!0,n=e}finally{try{r||null==i.return||i.return()}finally{if(o)throw n}}this.immediateMode.shapeMode!==u.LINE_STRIP&&this.immediateMode.shapeMode!==u.LINES||(this.immediateMode.shapeMode=u.TRIANGLE_FAN),this.immediateMode.shapeMode===u.QUADS?this.immediateMode.shapeMode=u.TRIANGLES:this.immediateMode.shapeMode===u.QUAD_STRIP&&(this.immediateMode.shapeMode=u.TRIANGLE_STRIP),this._applyColorBlend(this.curFillColor),e.drawArrays(this.immediateMode.shapeMode,0,this.immediateMode.geometry.vertices.length),t.unbindShader()},l.default.RendererGL.prototype._drawImmediateStroke=function(){var e=this.GL,t=e.isEnabled(e.CULL_FACE),r=(e.disable(e.CULL_FACE),this._getImmediateStrokeShader()),o=(this._useLineColor=0<this.immediateMode.geometry.vertexStrokeColors.length,this._setStrokeUniforms(r),!0),n=!1,s=void 0;try{for(var i,a=this.immediateMode.buffers.stroke[Symbol.iterator]();!(o=(i=a.next()).done);o=!0)i.value._prepareBuffer(this.immediateMode.geometry,r)}catch(e){n=!0,s=e}finally{try{o||null==a.return||a.return()}finally{if(n)throw s}}this._applyColorBlend(this.curStrokeColor),e.drawArrays(e.TRIANGLES,0,this.immediateMode.geometry.lineVertices.length),t&&e.enable(e.CULL_FACE),r.unbindShader()},l.default.RendererGL);r.default=n},{"../core/constants":256,"../core/main":267,"./p5.RenderBuffer":318,"core-js/modules/es.array.concat":149,"core-js/modules/es.array.fill":152,"core-js/modules/es.array.from":155,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.map":161,"core-js/modules/es.array.slice":162,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],320:[function(e,t,r){"use strict";e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.some"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.uint16-array"),e("core-js/modules/es.typed-array.uint32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.some"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.uint16-array"),e("core-js/modules/es.typed-array.uint32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var a=(n=e("../core/main"))&&n.__esModule?n:{default:n};e("./p5.RendererGL"),e("./p5.RenderBuffer");var o=0,n=(a.default.RendererGL.prototype._initBufferDefaults=function(e){var t;return this._freeBuffers(e),1e3<++o&&(t=Object.keys(this.retainedMode.geometry)[0],delete this.retainedMode.geometry[t],o--),this.retainedMode.geometry[e]={}},a.default.RendererGL.prototype._freeBuffers=function(e){var a,l=this.retainedMode.geometry[e];function t(e){var t=!0,r=!1,o=void 0;try{for(var n,s=e[Symbol.iterator]();!(t=(n=s.next()).done);t=!0){var i=n.value;l[i.dst]&&(a.deleteBuffer(l[i.dst]),l[i.dst]=null)}}catch(e){r=!0,o=e}finally{try{t||null==s.return||s.return()}finally{if(r)throw o}}}l&&(delete this.retainedMode.geometry[e],o--,a=this.GL,l.indexBuffer&&a.deleteBuffer(l.indexBuffer),t(this.retainedMode.buffers.stroke),t(this.retainedMode.buffers.fill))},a.default.RendererGL.prototype.createBuffers=function(e,t){var r,o,n,s=this.GL,e=this._initBufferDefaults(e),i=(e.model=t,e.indexBuffer);return t.faces.length?(i=i||(e.indexBuffer=s.createBuffer()),n=(o=(r=a.default.RendererGL.prototype._flatten(t.faces)).some(function(e){return 65535<e}))?Uint32Array:Uint16Array,this._bindBuffer(i,s.ELEMENT_ARRAY_BUFFER,r,n),e.indexBufferType=o?s.UNSIGNED_INT:s.UNSIGNED_SHORT,e.vertexCount=3*t.faces.length):(i&&(s.deleteBuffer(i),e.indexBuffer=null),e.vertexCount=t.vertices?t.vertices.length:0),e.lineVertexCount=t.lineVertices?t.lineVertices.length:0,e},a.default.RendererGL.prototype.drawBuffers=function(e){var t=this.GL,r=this.retainedMode.geometry[e];if(this._doStroke&&0<r.lineVertexCount){var o=t.isEnabled(t.CULL_FACE),n=(t.disable(t.CULL_FACE),this._getRetainedStrokeShader()),s=(this._useLineColor=0<r.model.vertexStrokeColors.length,this._setStrokeUniforms(n),!0),i=!1,a=void 0;try{for(var l,u=this.retainedMode.buffers.stroke[Symbol.iterator]();!(s=(l=u.next()).done);s=!0)l.value._prepareBuffer(r,n)}catch(e){i=!0,a=e}finally{try{s||null==u.return||u.return()}finally{if(i)throw a}}this._applyColorBlend(this.curStrokeColor),this._drawArrays(t.TRIANGLES,e),o&&t.enable(t.CULL_FACE),n.unbindShader()}if(this._doFill){this._useVertexColor=0<r.model.vertexColors.length;var c=this._getRetainedFillShader(),d=(this._setFillUniforms(c),!0),i=!1,a=void 0;try{for(var f,h=this.retainedMode.buffers.fill[Symbol.iterator]();!(d=(f=h.next()).done);d=!0)f.value._prepareBuffer(r,c)}catch(e){i=!0,a=e}finally{try{d||null==h.return||h.return()}finally{if(i)throw a}}r.indexBuffer&&this._bindBuffer(r.indexBuffer,t.ELEMENT_ARRAY_BUFFER),this._applyColorBlend(this.curFillColor),this._drawElements(t.TRIANGLES,e),c.unbindShader()}return this},a.default.RendererGL.prototype.drawBuffersScaled=function(e,t,r,o){var n=this.uMVMatrix.copy();try{this.uMVMatrix.scale(t,r,o),this.drawBuffers(e)}finally{this.uMVMatrix=n}},a.default.RendererGL.prototype._drawArrays=function(e,t){return this.GL.drawArrays(e,0,this.retainedMode.geometry[t].lineVertexCount),this},a.default.RendererGL.prototype._drawElements=function(e,t){var t=this.retainedMode.geometry[t],r=this.GL;if(t.indexBuffer){if(t.indexBufferType===r.UNSIGNED_INT&&!r.getExtension("OES_element_index_uint"))throw new Error("Unable to render a 3d model with > 65535 triangles. Your web browser does not support the WebGL Extension OES_element_index_uint.");r.drawElements(r.TRIANGLES,t.vertexCount,t.indexBufferType,0)}else r.drawArrays(e||r.TRIANGLES,0,t.vertexCount)},a.default.RendererGL.prototype._drawPoints=function(e,t){var r=this.GL,o=this._getImmediatePointShader();this._setPointUniforms(o),this._bindBuffer(t,r.ARRAY_BUFFER,this._vToNArray(e),Float32Array,r.STATIC_DRAW),o.enableAttrib(o.attributes.aPosition,3),r.drawArrays(r.Points,0,e.length),o.unbindShader()},a.default.RendererGL);r.default=n},{"../core/main":267,"./p5.RenderBuffer":318,"./p5.RendererGL":321,"core-js/modules/es.array.fill":152,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.some":163,"core-js/modules/es.object.keys":176,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.typed-array.copy-within":197,"core-js/modules/es.typed-array.every":198,"core-js/modules/es.typed-array.fill":199,"core-js/modules/es.typed-array.filter":200,"core-js/modules/es.typed-array.find":202,"core-js/modules/es.typed-array.find-index":201,"core-js/modules/es.typed-array.float32-array":203,"core-js/modules/es.typed-array.for-each":205,"core-js/modules/es.typed-array.includes":206,"core-js/modules/es.typed-array.index-of":207,"core-js/modules/es.typed-array.iterator":210,"core-js/modules/es.typed-array.join":211,"core-js/modules/es.typed-array.last-index-of":212,"core-js/modules/es.typed-array.map":213,"core-js/modules/es.typed-array.reduce":215,"core-js/modules/es.typed-array.reduce-right":214,"core-js/modules/es.typed-array.reverse":216,"core-js/modules/es.typed-array.set":217,"core-js/modules/es.typed-array.slice":218,"core-js/modules/es.typed-array.some":219,"core-js/modules/es.typed-array.sort":220,"core-js/modules/es.typed-array.subarray":221,"core-js/modules/es.typed-array.to-locale-string":222,"core-js/modules/es.typed-array.to-string":223,"core-js/modules/es.typed-array.uint16-array":224,"core-js/modules/es.typed-array.uint32-array":225,"core-js/modules/web.dom-collections.iterator":230}],321:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.float64-array"),e("core-js/modules/es.typed-array.int16-array"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.uint16-array"),e("core-js/modules/es.typed-array.uint32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.filter"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.float64-array"),e("core-js/modules/es.typed-array.int16-array"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.uint16-array"),e("core-js/modules/es.typed-array.uint32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var p=l(e("../core/main")),s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants")),n=l(e("libtess"));e("./p5.Shader"),e("./p5.Camera"),e("../core/p5.Renderer"),e("./p5.Matrix"),e("path");function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}function l(e){return e&&e.__esModule?e:{default:e}}function u(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function c(e,t){m+="#define STROKE_CAP_".concat(e," ").concat(t,"\n"),f[s[e]]=t}function d(e,t){m+="#define STROKE_JOIN_".concat(e," ").concat(t,"\n"),h[s[e]]=t}var f={},h={},m="",e=(c("ROUND",0),c("PROJECT",1),c("SQUARE",2),d("ROUND",0),d("MITER",1),d("BEVEL",2),"precision highp float;\nprecision highp int;\n\nuniform mat4 uViewMatrix;\n\nuniform bool uUseLighting;\n\nuniform int uAmbientLightCount;\nuniform vec3 uAmbientColor[5];\n\nuniform int uDirectionalLightCount;\nuniform vec3 uLightingDirection[5];\nuniform vec3 uDirectionalDiffuseColors[5];\nuniform vec3 uDirectionalSpecularColors[5];\n\nuniform int uPointLightCount;\nuniform vec3 uPointLightLocation[5];\nuniform vec3 uPointLightDiffuseColors[5];\t\nuniform vec3 uPointLightSpecularColors[5];\n\nuniform int uSpotLightCount;\nuniform float uSpotLightAngle[5];\nuniform float uSpotLightConc[5];\nuniform vec3 uSpotLightDiffuseColors[5];\nuniform vec3 uSpotLightSpecularColors[5];\nuniform vec3 uSpotLightLocation[5];\nuniform vec3 uSpotLightDirection[5];\n\nuniform bool uSpecular;\nuniform float uShininess;\n\nuniform float uConstantAttenuation;\nuniform float uLinearAttenuation;\nuniform float uQuadraticAttenuation;\n\nconst float specularFactor = 2.0;\nconst float diffuseFactor = 0.73;\n\nstruct LightResult {\n float specular;\n float diffuse;\n};\n\nfloat _phongSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float shininess) {\n\n vec3 R = reflect(lightDirection, surfaceNormal);\n return pow(max(0.0, dot(R, viewDirection)), shininess);\n}\n\nfloat _lambertDiffuse(vec3 lightDirection, vec3 surfaceNormal) {\n return max(0.0, dot(-lightDirection, surfaceNormal));\n}\n\nLightResult _light(vec3 viewDirection, vec3 normal, vec3 lightVector) {\n\n vec3 lightDir = normalize(lightVector);\n\n //compute our diffuse & specular terms\n LightResult lr;\n if (uSpecular)\n lr.specular = _phongSpecular(lightDir, viewDirection, normal, uShininess);\n lr.diffuse = _lambertDiffuse(lightDir, normal);\n return lr;\n}\n\nvoid totalLight(\n vec3 modelPosition,\n vec3 normal,\n out vec3 totalDiffuse,\n out vec3 totalSpecular\n) {\n\n totalSpecular = vec3(0.0);\n\n if (!uUseLighting) {\n totalDiffuse = vec3(1.0);\n return;\n }\n\n totalDiffuse = vec3(0.0);\n\n vec3 viewDirection = normalize(-modelPosition);\n\n for (int j = 0; j < 5; j++) {\n if (j < uDirectionalLightCount) {\n vec3 lightVector = (uViewMatrix * vec4(uLightingDirection[j], 0.0)).xyz;\n vec3 lightColor = uDirectionalDiffuseColors[j];\n vec3 specularColor = uDirectionalSpecularColors[j];\n LightResult result = _light(viewDirection, normal, lightVector);\n totalDiffuse += result.diffuse * lightColor;\n totalSpecular += result.specular * lightColor * specularColor;\n }\n\n if (j < uPointLightCount) {\n vec3 lightPosition = (uViewMatrix * vec4(uPointLightLocation[j], 1.0)).xyz;\n vec3 lightVector = modelPosition - lightPosition;\n \n //calculate attenuation\n float lightDistance = length(lightVector);\n float lightFalloff = 1.0 / (uConstantAttenuation + lightDistance * uLinearAttenuation + (lightDistance * lightDistance) * uQuadraticAttenuation);\n vec3 lightColor = lightFalloff * uPointLightDiffuseColors[j];\n vec3 specularColor = lightFalloff * uPointLightSpecularColors[j];\n\n LightResult result = _light(viewDirection, normal, lightVector);\n totalDiffuse += result.diffuse * lightColor;\n totalSpecular += result.specular * lightColor * specularColor;\n }\n\n if(j < uSpotLightCount) {\n vec3 lightPosition = (uViewMatrix * vec4(uSpotLightLocation[j], 1.0)).xyz;\n vec3 lightVector = modelPosition - lightPosition;\n \n float lightDistance = length(lightVector);\n float lightFalloff = 1.0 / (uConstantAttenuation + lightDistance * uLinearAttenuation + (lightDistance * lightDistance) * uQuadraticAttenuation);\n\n vec3 lightDirection = (uViewMatrix * vec4(uSpotLightDirection[j], 0.0)).xyz;\n float spotDot = dot(normalize(lightVector), normalize(lightDirection));\n float spotFalloff;\n if(spotDot < uSpotLightAngle[j]) {\n spotFalloff = 0.0;\n }\n else {\n spotFalloff = pow(spotDot, uSpotLightConc[j]);\n }\n lightFalloff *= spotFalloff;\n\n vec3 lightColor = uSpotLightDiffuseColors[j];\n vec3 specularColor = uSpotLightSpecularColors[j];\n \n LightResult result = _light(viewDirection, normal, lightVector);\n \n totalDiffuse += result.diffuse * lightColor * lightFalloff;\n totalSpecular += result.specular * lightColor * specularColor * lightFalloff;\n }\n }\n\n totalDiffuse *= diffuseFactor;\n totalSpecular *= specularFactor;\n}\n"),y={immediateVert:"attribute vec3 aPosition;\nattribute vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uResolution;\nuniform float uPointSize;\n\nvarying vec4 vColor;\nvoid main(void) {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vColor = aVertexColor;\n gl_PointSize = uPointSize;\n}\n",vertexColorVert:"attribute vec3 aPosition;\nattribute vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\n\nvarying vec4 vColor;\n\nvoid main(void) {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vColor = aVertexColor;\n}\n",vertexColorFrag:"precision mediump float;\nvarying vec4 vColor;\nvoid main(void) {\n gl_FragColor = vec4(vColor.rgb, 1.) * vColor.a;\n}\n",normalVert:"attribute vec3 aPosition;\nattribute vec3 aNormal;\nattribute vec2 aTexCoord;\nattribute vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\n\nuniform vec4 uMaterialColor;\nuniform bool uUseVertexColor;\n\nvarying vec3 vVertexNormal;\nvarying highp vec2 vVertTexCoord;\nvarying vec4 vColor;\n\nvoid main(void) {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vVertexNormal = normalize(vec3( uNormalMatrix * aNormal ));\n vVertTexCoord = aTexCoord;\n vColor = (uUseVertexColor ? aVertexColor : uMaterialColor);\n}\n",normalFrag:"precision mediump float;\nvarying vec3 vVertexNormal;\nvoid main(void) {\n gl_FragColor = vec4(vVertexNormal, 1.0);\n}",basicFrag:"precision mediump float;\nvarying vec4 vColor;\nvoid main(void) {\n gl_FragColor = vec4(vColor.rgb, 1.) * vColor.a;\n}\n",lightVert:e+"// include lighting.glgl\n\nattribute vec3 aPosition;\nattribute vec3 aNormal;\nattribute vec2 aTexCoord;\nattribute vec4 aVertexColor;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\n\nuniform bool uUseVertexColor;\nuniform vec4 uMaterialColor;\n\nvarying highp vec2 vVertTexCoord;\nvarying vec3 vDiffuseColor;\nvarying vec3 vSpecularColor;\nvarying vec4 vColor;\n\nvoid main(void) {\n\n vec4 viewModelPosition = uModelViewMatrix * vec4(aPosition, 1.0);\n gl_Position = uProjectionMatrix * viewModelPosition;\n\n vec3 vertexNormal = normalize(uNormalMatrix * aNormal);\n vVertTexCoord = aTexCoord;\n\n totalLight(viewModelPosition.xyz, vertexNormal, vDiffuseColor, vSpecularColor);\n\n for (int i = 0; i < 8; i++) {\n if (i < uAmbientLightCount) {\n vDiffuseColor += uAmbientColor[i];\n }\n }\n \n vColor = (uUseVertexColor ? aVertexColor : uMaterialColor);\n}\n",lightTextureFrag:"precision highp float;\n\nuniform vec4 uTint;\nuniform sampler2D uSampler;\nuniform bool isTexture;\nuniform bool uEmissive;\n\nvarying highp vec2 vVertTexCoord;\nvarying vec3 vDiffuseColor;\nvarying vec3 vSpecularColor;\nvarying vec4 vColor;\n\nvoid main(void) {\n if(uEmissive && !isTexture) {\n gl_FragColor = vColor;\n }\n else {\n vec4 baseColor = isTexture ? texture2D(uSampler, vVertTexCoord) * (uTint / vec4(255, 255, 255, 255)) : vColor;\n gl_FragColor = vec4(gl_FragColor.rgb * vDiffuseColor + vSpecularColor, 1.) * baseColor.a;\n }\n}\n",phongVert:"precision highp float;\nprecision highp int;\n\nattribute vec3 aPosition;\nattribute vec3 aNormal;\nattribute vec2 aTexCoord;\nattribute vec4 aVertexColor;\n\nuniform vec3 uAmbientColor[5];\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform mat3 uNormalMatrix;\nuniform int uAmbientLightCount;\n\nuniform bool uUseVertexColor;\nuniform vec4 uMaterialColor;\n\nvarying vec3 vNormal;\nvarying vec2 vTexCoord;\nvarying vec3 vViewPosition;\nvarying vec3 vAmbientColor;\nvarying vec4 vColor;\n\nvoid main(void) {\n\n vec4 viewModelPosition = uModelViewMatrix * vec4(aPosition, 1.0);\n\n // Pass varyings to fragment shader\n vViewPosition = viewModelPosition.xyz;\n gl_Position = uProjectionMatrix * viewModelPosition; \n\n vNormal = uNormalMatrix * aNormal;\n vTexCoord = aTexCoord;\n\n // TODO: this should be a uniform\n vAmbientColor = vec3(0.0);\n for (int i = 0; i < 5; i++) {\n if (i < uAmbientLightCount) {\n vAmbientColor += uAmbientColor[i];\n }\n }\n \n vColor = (uUseVertexColor ? aVertexColor : uMaterialColor);\n}\n",phongFrag:e+"// include lighting.glsl\nprecision highp float;\nprecision highp int;\n\nuniform vec4 uSpecularMatColor;\nuniform vec4 uAmbientMatColor;\nuniform vec4 uEmissiveMatColor;\n\nuniform vec4 uTint;\nuniform sampler2D uSampler;\nuniform bool isTexture;\n\nvarying vec3 vNormal;\nvarying vec2 vTexCoord;\nvarying vec3 vViewPosition;\nvarying vec3 vAmbientColor;\nvarying vec4 vColor;\n\nvoid main(void) {\n\n vec3 diffuse;\n vec3 specular;\n totalLight(vViewPosition, normalize(vNormal), diffuse, specular);\n\n // Calculating final color as result of all lights (plus emissive term).\n\n vec4 baseColor = isTexture ? texture2D(uSampler, vTexCoord) * (uTint / vec4(255, 255, 255, 255)) : vColor;\n gl_FragColor = vec4(diffuse * baseColor.rgb + \n vAmbientColor * uAmbientMatColor.rgb + \n specular * uSpecularMatColor.rgb + \n uEmissiveMatColor.rgb, 1.) * baseColor.a;\n}\n",fontVert:"precision mediump float;\n\nattribute vec3 aPosition;\nattribute vec2 aTexCoord;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\n\nuniform vec4 uGlyphRect;\nuniform float uGlyphOffset;\n\nvarying vec2 vTexCoord;\nvarying float w;\n\nvoid main() {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n\n // scale by the size of the glyph's rectangle\n positionVec4.xy *= uGlyphRect.zw - uGlyphRect.xy;\n\n // Expand glyph bounding boxes by 1px on each side to give a bit of room\n // for antialiasing\n vec2 pixelScale = vec2(\n 1. / uModelViewMatrix[0][0],\n 1. / uModelViewMatrix[1][1]\n );\n vec2 offset = pixelScale * normalize(aTexCoord - vec2(0.5, 0.5)) * vec2(1., -1.);\n vec2 textureOffset = offset * (1. / vec2(\n uGlyphRect.z - uGlyphRect.x,\n uGlyphRect.w - uGlyphRect.y\n ));\n\n // move to the corner of the glyph\n positionVec4.xy += uGlyphRect.xy;\n\n // move to the letter's line offset\n positionVec4.x += uGlyphOffset;\n\n positionVec4.xy += offset;\n \n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vTexCoord = aTexCoord + textureOffset;\n w = gl_Position.w;\n}\n",fontFrag:"#extension GL_OES_standard_derivatives : enable\nprecision mediump float;\n\n#if 0\n // simulate integer math using floats\n\t#define int float\n\t#define ivec2 vec2\n\t#define INT(x) float(x)\n\n\tint ifloor(float v) { return floor(v); }\n\tivec2 ifloor(vec2 v) { return floor(v); }\n\n#else\n // use native integer math\n\tprecision highp int;\n\t#define INT(x) x\n\n\tint ifloor(float v) { return int(v); }\n\tint ifloor(int v) { return v; }\n\tivec2 ifloor(vec2 v) { return ivec2(v); }\n\n#endif\n\nuniform sampler2D uSamplerStrokes;\nuniform sampler2D uSamplerRowStrokes;\nuniform sampler2D uSamplerRows;\nuniform sampler2D uSamplerColStrokes;\nuniform sampler2D uSamplerCols;\n\nuniform ivec2 uStrokeImageSize;\nuniform ivec2 uCellsImageSize;\nuniform ivec2 uGridImageSize;\n\nuniform ivec2 uGridOffset;\nuniform ivec2 uGridSize;\nuniform vec4 uMaterialColor;\n\nvarying vec2 vTexCoord;\n\n// some helper functions\nint round(float v) { return ifloor(v + 0.5); }\nivec2 round(vec2 v) { return ifloor(v + 0.5); }\nfloat saturate(float v) { return clamp(v, 0.0, 1.0); }\nvec2 saturate(vec2 v) { return clamp(v, 0.0, 1.0); }\n\nint mul(float v1, int v2) {\n return ifloor(v1 * float(v2));\n}\n\nivec2 mul(vec2 v1, ivec2 v2) {\n return ifloor(v1 * vec2(v2) + 0.5);\n}\n\n// unpack a 16-bit integer from a float vec2\nint getInt16(vec2 v) {\n ivec2 iv = round(v * 255.0);\n return iv.x * INT(128) + iv.y;\n}\n\nvec2 pixelScale;\nvec2 coverage = vec2(0.0);\nvec2 weight = vec2(0.5);\nconst float minDistance = 1.0/8192.0;\nconst float hardness = 1.05; // amount of antialias\n\n// the maximum number of curves in a glyph\nconst int N = INT(250);\n\n// retrieves an indexed pixel from a sampler\nvec4 getTexel(sampler2D sampler, int pos, ivec2 size) {\n int width = size.x;\n int y = ifloor(pos / width);\n int x = pos - y * width; // pos % width\n\n return texture2D(sampler, (vec2(x, y) + 0.5) / vec2(size));\n}\n\nvoid calulateCrossings(vec2 p0, vec2 p1, vec2 p2, out vec2 C1, out vec2 C2) {\n\n // get the coefficients of the quadratic in t\n vec2 a = p0 - p1 * 2.0 + p2;\n vec2 b = p0 - p1;\n vec2 c = p0 - vTexCoord;\n\n // found out which values of 't' it crosses the axes\n vec2 surd = sqrt(max(vec2(0.0), b * b - a * c));\n vec2 t1 = ((b - surd) / a).yx;\n vec2 t2 = ((b + surd) / a).yx;\n\n // approximate straight lines to avoid rounding errors\n if (abs(a.y) < 0.001)\n t1.x = t2.x = c.y / (2.0 * b.y);\n\n if (abs(a.x) < 0.001)\n t1.y = t2.y = c.x / (2.0 * b.x);\n\n // plug into quadratic formula to find the corrdinates of the crossings\n C1 = ((a * t1 - b * 2.0) * t1 + c) * pixelScale;\n C2 = ((a * t2 - b * 2.0) * t2 + c) * pixelScale;\n}\n\nvoid coverageX(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n // determine on which side of the x-axis the points lie\n bool y0 = p0.y > vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n gl_FragColor = vec4(uMaterialColor.rgb, 1.) * uMaterialColor.a;\n gl_FragColor *= saturate(max(antialias, cover));\n}\n",lineVert:m+"/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nprecision mediump float;\nprecision mediump int;\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform bool uUseLineColor;\nuniform vec4 uMaterialColor;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\nuniform int uStrokeJoin;\n\nattribute vec4 aPosition;\nattribute vec3 aTangentIn;\nattribute vec3 aTangentOut;\nattribute float aSide;\nattribute vec4 aVertexColor;\n\nvarying vec4 vColor;\nvarying vec2 vTangent;\nvarying vec2 vCenter;\nvarying vec2 vPosition;\nvarying float vMaxDist;\nvarying float vCap;\nvarying float vJoin;\n\nvec2 lineIntersection(vec2 aPoint, vec2 aDir, vec2 bPoint, vec2 bDir) {\n // Rotate and translate so a starts at the origin and goes out to the right\n bPoint -= aPoint;\n vec2 rotatedBFrom = vec2(\n bPoint.x*aDir.x + bPoint.y*aDir.y,\n bPoint.y*aDir.x - bPoint.x*aDir.y\n );\n vec2 bTo = bPoint + bDir;\n vec2 rotatedBTo = vec2(\n bTo.x*aDir.x + bTo.y*aDir.y,\n bTo.y*aDir.x - bTo.x*aDir.y\n );\n float intersectionDistance =\n rotatedBTo.x + (rotatedBFrom.x - rotatedBTo.x) * rotatedBTo.y /\n (rotatedBTo.y - rotatedBFrom.y);\n return aPoint + aDir * intersectionDistance;\n}\n\nvoid main() {\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n vec3 scale = vec3(0.9995);\n\n // Caps have one of either the in or out tangent set to 0\n vCap = (aTangentIn == vec3(0.)) != (aTangentOut == (vec3(0.)))\n ? 1. : 0.;\n\n // Joins have two unique, defined tangents\n vJoin = (\n aTangentIn != vec3(0.) &&\n aTangentOut != vec3(0.) &&\n aTangentIn != aTangentOut\n ) ? 1. : 0.;\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posqIn = uModelViewMatrix * (aPosition + vec4(aTangentIn, 0));\n vec4 posqOut = uModelViewMatrix * (aPosition + vec4(aTangentOut, 0));\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posqIn.xyz = posqIn.xyz * scale;\n posqOut.xyz = posqOut.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 qIn = uProjectionMatrix * posqIn;\n vec4 qOut = uProjectionMatrix * posqOut;\n vCenter = p.xy;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don't care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can't remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangentIn = normalize((qIn.xy*p.w - p.xy*qIn.w) * uViewport.zw);\n vec2 tangentOut = normalize((qOut.xy*p.w - p.xy*qOut.w) * uViewport.zw);\n\n vec2 curPerspScale;\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n // invert Y, projections in Processing invert Y\n curPerspScale = (uProjectionMatrix * vec4(1, -1, 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n vec2 offset;\n if (vJoin == 1.) {\n vTangent = normalize(tangentIn + tangentOut);\n vec2 normalIn = vec2(-tangentIn.y, tangentIn.x);\n vec2 normalOut = vec2(-tangentOut.y, tangentOut.x);\n float side = sign(aSide);\n float sideEnum = abs(aSide);\n\n // We generate vertices for joins on either side of the centerline, but\n // the \"elbow\" side is the only one needing a join. By not setting the\n // offset for the other side, all its vertices will end up in the same\n // spot and not render, effectively discarding it.\n if (sign(dot(tangentOut, vec2(-tangentIn.y, tangentIn.x))) != side) {\n // Side enums:\n // 1: the side going into the join\n // 2: the middle of the join\n // 3: the side going out of the join\n if (sideEnum == 2.) {\n // Calculate the position + tangent on either side of the join, and\n // find where the lines intersect to find the elbow of the join\n vec2 c = (posp.xy/posp.w + vec2(1.,1.)) * 0.5 * uViewport.zw;\n vec2 intersection = lineIntersection(\n c + (side * normalIn * uStrokeWeight / 2.) * curPerspScale,\n tangentIn,\n c + (side * normalOut * uStrokeWeight / 2.) * curPerspScale,\n tangentOut\n );\n offset = (intersection - c);\n\n // When lines are thick and the angle of the join approaches 180, the\n // elbow might be really far from the center. We'll apply a limit to\n // the magnitude to avoid lines going across the whole screen when this\n // happens.\n float mag = length(offset);\n float maxMag = 3. * uStrokeWeight;\n if (mag > maxMag) {\n offset *= maxMag / mag;\n }\n } else if (sideEnum == 1.) {\n offset = side * normalIn * curPerspScale * uStrokeWeight / 2.;\n } else if (sideEnum == 3.) {\n offset = side * normalOut * curPerspScale * uStrokeWeight / 2.;\n }\n }\n if (uStrokeJoin == STROKE_JOIN_BEVEL) {\n vec2 avgNormal = vec2(-vTangent.y, vTangent.x);\n vMaxDist = abs(dot(avgNormal, normalIn * uStrokeWeight / 2.));\n } else {\n vMaxDist = uStrokeWeight / 2.;\n }\n } else {\n vec2 tangent = aTangentIn == vec3(0.) ? tangentOut : tangentIn;\n vTangent = tangent;\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float normalOffset = sign(aSide);\n // Caps will have side values of -2 or 2 on the edge of the cap that\n // extends out from the line\n float tangentOffset = abs(aSide) - 1.;\n offset = (normal * normalOffset + tangent * tangentOffset) *\n uStrokeWeight * 0.5 * curPerspScale;\n vMaxDist = uStrokeWeight / 2.;\n }\n vPosition = vCenter + offset / curPerspScale;\n\n gl_Position.xy = p.xy + offset.xy;\n gl_Position.zw = p.zw;\n \n vColor = (uUseLineColor ? aVertexColor : uMaterialColor);\n}\n",lineFrag:m+"precision mediump float;\nprecision mediump int;\n\nuniform vec4 uMaterialColor;\nuniform int uStrokeCap;\nuniform int uStrokeJoin;\nuniform float uStrokeWeight;\n\nvarying vec4 vColor;\nvarying vec2 vTangent;\nvarying vec2 vCenter;\nvarying vec2 vPosition;\nvarying float vMaxDist;\nvarying float vCap;\nvarying float vJoin;\n\nfloat distSquared(vec2 a, vec2 b) {\n vec2 aToB = b - a;\n return dot(aToB, aToB);\n}\n\nvoid main() {\n if (vCap > 0.) {\n if (\n uStrokeCap == STROKE_CAP_ROUND &&\n distSquared(vPosition, vCenter) > uStrokeWeight * uStrokeWeight * 0.25\n ) {\n discard;\n } else if (\n uStrokeCap == STROKE_CAP_SQUARE &&\n dot(vPosition - vCenter, vTangent) > 0.\n ) {\n discard;\n }\n // Use full area for PROJECT\n } else if (vJoin > 0.) {\n if (\n uStrokeJoin == STROKE_JOIN_ROUND &&\n distSquared(vPosition, vCenter) > uStrokeWeight * uStrokeWeight * 0.25\n ) {\n discard;\n } else if (uStrokeJoin == STROKE_JOIN_BEVEL) {\n vec2 normal = vec2(-vTangent.y, vTangent.x);\n if (abs(dot(vPosition - vCenter, normal)) > vMaxDist) {\n discard;\n }\n }\n // Use full area for MITER\n }\n gl_FragColor = vec4(vColor.rgb, 1.) * vColor.a;\n}\n",pointVert:"attribute vec3 aPosition;\nuniform float uPointSize;\nvarying float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}",pointFrag:"precision mediump float;\nprecision mediump int;\nuniform vec4 uMaterialColor;\nvarying float vStrokeWeight;\n\nvoid main(){\n float mask = 0.0;\n\n // make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n mask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n // if strokeWeight is 1 or less lets just draw a square\n // this prevents weird artifacting from carving circles when our points are really small\n // if strokeWeight is larger than 1, we just use it as is\n\n mask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n // throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n if(mask > 0.98){\n discard;\n }\n\n gl_FragColor = vec4(uMaterialColor.rgb, 1.) * uMaterialColor.a;\n}\n"},e=(p.default.RendererGL=function(e,t,r,o){return p.default.Renderer.call(this,e,t,r),this._setAttributeDefaults(t),this._initContext(),this.isP3D=!0,this.GL=this.drawingContext,this._pInst._setProperty("drawingContext",this.drawingContext),this._isErasing=!1,this._enableLighting=!1,this.ambientLightColors=[],this.specularColors=[1,1,1],this.directionalLightDirections=[],this.directionalLightDiffuseColors=[],this.directionalLightSpecularColors=[],this.pointLightPositions=[],this.pointLightDiffuseColors=[],this.pointLightSpecularColors=[],this.spotLightPositions=[],this.spotLightDirections=[],this.spotLightDiffuseColors=[],this.spotLightSpecularColors=[],this.spotLightAngle=[],this.spotLightConc=[],this.drawMode=s.FILL,this.curFillColor=this._cachedFillStyle=[1,1,1,1],this.curAmbientColor=this._cachedFillStyle=[1,1,1,1],this.curSpecularColor=this._cachedFillStyle=[0,0,0,0],this.curEmissiveColor=this._cachedFillStyle=[0,0,0,0],this.curStrokeColor=this._cachedStrokeStyle=[0,0,0,1],this.curBlendMode=s.BLEND,this._cachedBlendMode=void 0,this.blendExt=this.GL.getExtension("EXT_blend_minmax"),this._isBlending=!1,this._useSpecularMaterial=!1,this._useEmissiveMaterial=!1,this._useNormalMaterial=!1,this._useShininess=1,this._useLineColor=!1,this._useVertexColor=!1,this.registerEnabled=[],this._tint=[255,255,255,255],this.constantAttenuation=1,this.linearAttenuation=0,this.quadraticAttenuation=0,this.uMVMatrix=new p.default.Matrix,this.uPMatrix=new p.default.Matrix,this.uNMatrix=new p.default.Matrix("mat3"),this._currentNormal=new p.default.Vector(0,0,1),this._curCamera=new p.default.Camera(this),this._curCamera._computeCameraDefaultSettings(),this._curCamera._setDefaultCamera(),this._defaultLightShader=void 0,this._defaultImmediateModeShader=void 0,this._defaultNormalShader=void 0,this._defaultColorShader=void 0,this._defaultPointShader=void 0,this.userFillShader=void 0,this.userStrokeShader=void 0,this.userPointShader=void 0,this.retainedMode={geometry:{},buffers:{stroke:[new p.default.RenderBuffer(4,"lineVertexColors","lineColorBuffer","aVertexColor",this,this._flatten),new p.default.RenderBuffer(3,"lineVertices","lineVerticesBuffer","aPosition",this,this._flatten),new p.default.RenderBuffer(3,"lineTangentsIn","lineTangentsInBuffer","aTangentIn",this,this._flatten),new p.default.RenderBuffer(3,"lineTangentsOut","lineTangentsOutBuffer","aTangentOut",this,this._flatten),new p.default.RenderBuffer(1,"lineSides","lineSidesBuffer","aSide",this)],fill:[new p.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new p.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new p.default.RenderBuffer(4,"vertexColors","colorBuffer","aVertexColor",this),new p.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new p.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],text:[new p.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new p.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)]}},this.immediateMode={geometry:new p.default.Geometry,shapeMode:s.TRIANGLE_FAN,_bezierVertex:[],_quadraticVertex:[],_curveVertex:[],buffers:{fill:[new p.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new p.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new p.default.RenderBuffer(4,"vertexColors","colorBuffer","aVertexColor",this),new p.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new p.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],stroke:[new p.default.RenderBuffer(4,"lineVertexColors","lineColorBuffer","aVertexColor",this,this._flatten),new p.default.RenderBuffer(3,"lineVertices","lineVerticesBuffer","aPosition",this,this._flatten),new p.default.RenderBuffer(3,"lineTangentsIn","lineTangentsInBuffer","aTangentIn",this,this._flatten),new p.default.RenderBuffer(3,"lineTangentsOut","lineTangentsOutBuffer","aTangentOut",this,this._flatten),new p.default.RenderBuffer(1,"lineSides","lineSidesBuffer","aSide",this)],point:this.GL.createBuffer()}},this.pointSize=5,this.curStrokeWeight=1,this.curStrokeCap=s.ROUND,this.curStrokeJoin=s.ROUND,this.textures=[],this.textureMode=s.IMAGE,this.textureWrapX=s.CLAMP,this.textureWrapY=s.CLAMP,this._tex=null,this._curveTightness=6,this._lookUpTableBezier=[],this._lookUpTableQuadratic=[],this._lutBezierDetail=0,this._lutQuadraticDetail=0,this.isProcessingVertices=!1,this._tessy=this._initTessy(),this.fontInfos={},this._curShader=void 0,this},p.default.RendererGL.prototype=Object.create(p.default.Renderer.prototype),p.default.RendererGL.prototype._setAttributeDefaults=function(e){var t={alpha:!0,depth:!0,stencil:!0,antialias:navigator.userAgent.toLowerCase().includes("safari"),premultipliedAlpha:!0,preserveDrawingBuffer:!0,perPixelLighting:!0};null===e._glAttributes?e._glAttributes=t:e._glAttributes=Object.assign(t,e._glAttributes)},p.default.RendererGL.prototype._initContext=function(){if(this.drawingContext=this.canvas.getContext("webgl",this._pInst._glAttributes)||this.canvas.getContext("experimental-webgl",this._pInst._glAttributes),null===this.drawingContext)throw new Error("Error creating webgl context");var e=this.drawingContext;e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),this._viewport=this.drawingContext.getParameter(this.drawingContext.VIEWPORT)},p.default.RendererGL.prototype._resetContext=function(e,t){var r,o=this.width,n=this.height,s=this.canvas.id,i=this._pInst instanceof p.default.Graphics,s=(i?((r=this._pInst).canvas.parentNode.removeChild(r.canvas),r.canvas=document.createElement("canvas"),(r._pInst._userNode||document.body).appendChild(r.canvas),p.default.Element.call(r,r.canvas,r._pInst),r.width=o,r.height=n):((r=this.canvas)&&r.parentNode.removeChild(r),(r=document.createElement("canvas")).id=s,(this._pInst._userNode||document.body).appendChild(r),this._pInst.canvas=r,this.canvas=r),new p.default.RendererGL(this._pInst.canvas,this._pInst,!i));this._pInst._setProperty("_renderer",s),s.resize(o,n),s._applyDefaults(),i||this._pInst._elements.push(s),"function"==typeof t&&setTimeout(function(){t.apply(window._renderer,e)},0)},p.default.prototype.setAttributes=function(e,t){if(void 0===this._glAttributes)console.log("You are trying to use setAttributes on a p5.Graphics object that does not use a WEBGL renderer.");else{var r=!0;if(void 0!==t?(null===this._glAttributes&&(this._glAttributes={}),this._glAttributes[e]!==t&&(this._glAttributes[e]=t,r=!1)):e instanceof Object&&this._glAttributes!==e&&(this._glAttributes=e,r=!1),this._renderer.isP3D&&!r){if(!this._setupDone)for(var o in this._renderer.retainedMode.geometry)if(this._renderer.retainedMode.geometry.hasOwnProperty(o))return void console.error("Sorry, Could not set the attributes, you need to call setAttributes() before calling the other drawing methods in setup()");this.push(),this._renderer._resetContext(),this.pop(),this._renderer._curCamera&&(this._renderer._curCamera._renderer=this._renderer)}}},p.default.RendererGL.prototype._update=function(){this.uMVMatrix.set(this._curCamera.cameraMatrix.mat4[0],this._curCamera.cameraMatrix.mat4[1],this._curCamera.cameraMatrix.mat4[2],this._curCamera.cameraMatrix.mat4[3],this._curCamera.cameraMatrix.mat4[4],this._curCamera.cameraMatrix.mat4[5],this._curCamera.cameraMatrix.mat4[6],this._curCamera.cameraMatrix.mat4[7],this._curCamera.cameraMatrix.mat4[8],this._curCamera.cameraMatrix.mat4[9],this._curCamera.cameraMatrix.mat4[10],this._curCamera.cameraMatrix.mat4[11],this._curCamera.cameraMatrix.mat4[12],this._curCamera.cameraMatrix.mat4[13],this._curCamera.cameraMatrix.mat4[14],this._curCamera.cameraMatrix.mat4[15]),this.ambientLightColors.length=0,this.specularColors=[1,1,1],this.directionalLightDirections.length=0,this.directionalLightDiffuseColors.length=0,this.directionalLightSpecularColors.length=0,this.pointLightPositions.length=0,this.pointLightDiffuseColors.length=0,this.pointLightSpecularColors.length=0,this.spotLightPositions.length=0,this.spotLightDirections.length=0,this.spotLightDiffuseColors.length=0,this.spotLightSpecularColors.length=0,this.spotLightAngle.length=0,this.spotLightConc.length=0,this._enableLighting=!1,this._tint=[255,255,255,255],this.GL.clear(this.GL.DEPTH_BUFFER_BIT)},p.default.RendererGL.prototype.background=function(){var e=(e=this._pInst).color.apply(e,arguments),t=e.levels[0]/255,r=e.levels[1]/255,o=e.levels[2]/255,e=e.levels[3]/255;this.clear(t,r,o,e)},p.default.RendererGL.prototype.fill=function(e,t,r,o){var n=p.default.prototype.color.apply(this._pInst,arguments);this.curFillColor=n._array,this.drawMode=s.FILL,this._useNormalMaterial=!1,this._tex=null},p.default.RendererGL.prototype.stroke=function(e,t,r,o){var n=p.default.prototype.color.apply(this._pInst,arguments);this.curStrokeColor=n._array},p.default.RendererGL.prototype.strokeCap=function(e){this.curStrokeCap=e},p.default.RendererGL.prototype.strokeJoin=function(e){this.curStrokeJoin=e},p.default.RendererGL.prototype.filter=function(e){console.error("filter() does not work in WEBGL mode")},p.default.RendererGL.prototype.blendMode=function(e){e===s.DARKEST||e===s.LIGHTEST||e===s.ADD||e===s.BLEND||e===s.SUBTRACT||e===s.SCREEN||e===s.EXCLUSION||e===s.REPLACE||e===s.MULTIPLY||e===s.REMOVE?this.curBlendMode=e:e!==s.BURN&&e!==s.OVERLAY&&e!==s.HARD_LIGHT&&e!==s.SOFT_LIGHT&&e!==s.DODGE||console.warn("BURN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, and DODGE only work for blendMode in 2D mode.")},p.default.RendererGL.prototype.erase=function(e,t){this._isErasing||(this._applyBlendMode(s.REMOVE),this._isErasing=!0,this._cachedFillStyle=this.curFillColor.slice(),this.curFillColor=[1,1,1,e/255],this._cachedStrokeStyle=this.curStrokeColor.slice(),this.curStrokeColor=[1,1,1,t/255])},p.default.RendererGL.prototype.noErase=function(){this._isErasing&&(this._isErasing=!1,this.curFillColor=this._cachedFillStyle.slice(),this.curStrokeColor=this._cachedStrokeStyle.slice(),this.blendMode(this._cachedBlendMode))},p.default.RendererGL.prototype.strokeWeight=function(e){this.curStrokeWeight!==e&&(this.pointSize=e,this.curStrokeWeight=e)},p.default.RendererGL.prototype._getPixel=function(e,t){var r=new Uint8Array(4);return this.drawingContext.readPixels(e,t,1,1,this.drawingContext.RGBA,this.drawingContext.UNSIGNED_BYTE,r),[r[0],r[1],r[2],r[3]]},p.default.RendererGL.prototype.loadPixels=function(){var e,t=this._pixelsState;!0!==this._pInst._glAttributes.preserveDrawingBuffer?console.log("loadPixels only works in WebGL when preserveDrawingBuffer is true."):(t=t.pixels,e=this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4,t instanceof Uint8Array&&t.length===e||(t=new Uint8Array(e),this._pixelsState._setProperty("pixels",t)),e=this._pInst._pixelDensity,this.GL.readPixels(0,0,this.width*e,this.height*e,this.GL.RGBA,this.GL.UNSIGNED_BYTE,t))},p.default.RendererGL.prototype.geometryInHash=function(e){return void 0!==this.retainedMode.geometry[e]},p.default.RendererGL.prototype.resize=function(e,t){p.default.Renderer.prototype.resize.call(this,e,t),this.GL.viewport(0,0,this.GL.drawingBufferWidth,this.GL.drawingBufferHeight),this._viewport=this.GL.getParameter(this.GL.VIEWPORT),this._curCamera._resize();e=this._pixelsState;void 0!==e.pixels&&e._setProperty("pixels",new Uint8Array(this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4))},p.default.RendererGL.prototype.clear=function(){var e=(arguments.length<=0?void 0:arguments[0])||0,t=(arguments.length<=1?void 0:arguments[1])||0,r=(arguments.length<=2?void 0:arguments[2])||0,o=(arguments.length<=3?void 0:arguments[3])||0;this.GL.clearColor(e*o,t*o,r*o,o),this.GL.clearDepth(1),this.GL.clear(this.GL.COLOR_BUFFER_BIT|this.GL.DEPTH_BUFFER_BIT)},p.default.RendererGL.prototype.applyMatrix=function(e,t,r,o,n,s){16===arguments.length?p.default.Matrix.prototype.apply.apply(this.uMVMatrix,arguments):this.uMVMatrix.apply([e,t,0,0,r,o,0,0,0,0,1,0,n,s,0,1])},p.default.RendererGL.prototype.translate=function(e,t,r){return e instanceof p.default.Vector&&(r=e.z,t=e.y,e=e.x),this.uMVMatrix.translate([e,t,r]),this},p.default.RendererGL.prototype.scale=function(e,t,r){return this.uMVMatrix.scale(e,t,r),this},p.default.RendererGL.prototype.rotate=function(e,t){return void 0===t?this.rotateZ(e):(p.default.Matrix.prototype.rotate.apply(this.uMVMatrix,arguments),this)},p.default.RendererGL.prototype.rotateX=function(e){return this.rotate(e,1,0,0),this},p.default.RendererGL.prototype.rotateY=function(e){return this.rotate(e,0,1,0),this},p.default.RendererGL.prototype.rotateZ=function(e){return this.rotate(e,0,0,1),this},p.default.RendererGL.prototype.push=function(){var e=p.default.Renderer.prototype.push.apply(this),t=e.properties;return t.uMVMatrix=this.uMVMatrix.copy(),t.uPMatrix=this.uPMatrix.copy(),t._curCamera=this._curCamera,this._curCamera=this._curCamera.copy(),t.ambientLightColors=this.ambientLightColors.slice(),t.specularColors=this.specularColors.slice(),t.directionalLightDirections=this.directionalLightDirections.slice(),t.directionalLightDiffuseColors=this.directionalLightDiffuseColors.slice(),t.directionalLightSpecularColors=this.directionalLightSpecularColors.slice(),t.pointLightPositions=this.pointLightPositions.slice(),t.pointLightDiffuseColors=this.pointLightDiffuseColors.slice(),t.pointLightSpecularColors=this.pointLightSpecularColors.slice(),t.spotLightPositions=this.spotLightPositions.slice(),t.spotLightDirections=this.spotLightDirections.slice(),t.spotLightDiffuseColors=this.spotLightDiffuseColors.slice(),t.spotLightSpecularColors=this.spotLightSpecularColors.slice(),t.spotLightAngle=this.spotLightAngle.slice(),t.spotLightConc=this.spotLightConc.slice(),t.userFillShader=this.userFillShader,t.userStrokeShader=this.userStrokeShader,t.userPointShader=this.userPointShader,t.pointSize=this.pointSize,t.curStrokeWeight=this.curStrokeWeight,t.curStrokeColor=this.curStrokeColor,t.curFillColor=this.curFillColor,t.curAmbientColor=this.curAmbientColor,t.curSpecularColor=this.curSpecularColor,t.curEmissiveColor=this.curEmissiveColor,t._useSpecularMaterial=this._useSpecularMaterial,t._useEmissiveMaterial=this._useEmissiveMaterial,t._useShininess=this._useShininess,t.constantAttenuation=this.constantAttenuation,t.linearAttenuation=this.linearAttenuation,t.quadraticAttenuation=this.quadraticAttenuation,t._enableLighting=this._enableLighting,t._useNormalMaterial=this._useNormalMaterial,t._tex=this._tex,t.drawMode=this.drawMode,t._currentNormal=this._currentNormal,t.curBlendMode=this.curBlendMode,e},p.default.RendererGL.prototype.resetMatrix=function(){return this.uMVMatrix.set(this._curCamera.cameraMatrix.mat4[0],this._curCamera.cameraMatrix.mat4[1],this._curCamera.cameraMatrix.mat4[2],this._curCamera.cameraMatrix.mat4[3],this._curCamera.cameraMatrix.mat4[4],this._curCamera.cameraMatrix.mat4[5],this._curCamera.cameraMatrix.mat4[6],this._curCamera.cameraMatrix.mat4[7],this._curCamera.cameraMatrix.mat4[8],this._curCamera.cameraMatrix.mat4[9],this._curCamera.cameraMatrix.mat4[10],this._curCamera.cameraMatrix.mat4[11],this._curCamera.cameraMatrix.mat4[12],this._curCamera.cameraMatrix.mat4[13],this._curCamera.cameraMatrix.mat4[14],this._curCamera.cameraMatrix.mat4[15]),this},p.default.RendererGL.prototype._getImmediateStrokeShader=function(){var e=this.userStrokeShader;return e&&e.isStrokeShader()?e:this._getLineShader()},p.default.RendererGL.prototype._getRetainedStrokeShader=p.default.RendererGL.prototype._getImmediateStrokeShader,p.default.RendererGL.prototype._getImmediateFillShader=function(){var e=this.userFillShader;if(this._useNormalMaterial&&(!e||!e.isNormalShader()))return this._getNormalShader();if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getImmediateModeShader();return e},p.default.RendererGL.prototype._getRetainedFillShader=function(){if(this._useNormalMaterial)return this._getNormalShader();var e=this.userFillShader;if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getColorShader();return e},p.default.RendererGL.prototype._getImmediatePointShader=function(){var e=this.userPointShader;return e&&e.isPointShader()?e:this._getPointShader()},p.default.RendererGL.prototype._getRetainedLineShader=p.default.RendererGL.prototype._getImmediateLineShader,p.default.RendererGL.prototype._getLightShader=function(){return this._defaultLightShader||(this._pInst._glAttributes.perPixelLighting?this._defaultLightShader=new p.default.Shader(this,y.phongVert,y.phongFrag):this._defaultLightShader=new p.default.Shader(this,y.lightVert,y.lightTextureFrag)),this._defaultLightShader},p.default.RendererGL.prototype._getImmediateModeShader=function(){return this._defaultImmediateModeShader||(this._defaultImmediateModeShader=new p.default.Shader(this,y.immediateVert,y.vertexColorFrag)),this._defaultImmediateModeShader},p.default.RendererGL.prototype._getNormalShader=function(){return this._defaultNormalShader||(this._defaultNormalShader=new p.default.Shader(this,y.normalVert,y.normalFrag)),this._defaultNormalShader},p.default.RendererGL.prototype._getColorShader=function(){return this._defaultColorShader||(this._defaultColorShader=new p.default.Shader(this,y.normalVert,y.basicFrag)),this._defaultColorShader},p.default.RendererGL.prototype._getPointShader=function(){return this._defaultPointShader||(this._defaultPointShader=new p.default.Shader(this,y.pointVert,y.pointFrag)),this._defaultPointShader},p.default.RendererGL.prototype._getLineShader=function(){return this._defaultLineShader||(this._defaultLineShader=new p.default.Shader(this,y.lineVert,y.lineFrag)),this._defaultLineShader},p.default.RendererGL.prototype._getFontShader=function(){return this._defaultFontShader||(this.GL.getExtension("OES_standard_derivatives"),this._defaultFontShader=new p.default.Shader(this,y.fontVert,y.fontFrag)),this._defaultFontShader},p.default.RendererGL.prototype._getEmptyTexture=function(){var e;return this._emptyTexture||((e=new p.default.Image(1,1)).set(0,0,255),this._emptyTexture=new p.default.Texture(this,e)),this._emptyTexture},p.default.RendererGL.prototype.getTexture=function(e){var t=this.textures,r=!0,o=!1,n=void 0;try{for(var s,i=t[Symbol.iterator]();!(r=(s=i.next()).done);r=!0){var a=s.value;if(a.src===e)return a}}catch(e){o=!0,n=e}finally{try{r||null==i.return||i.return()}finally{if(o)throw n}}o=new p.default.Texture(this,e);return t.push(o),o},p.default.RendererGL.prototype._setStrokeUniforms=function(e){e.bindShader(),e.setUniform("uUseLineColor",this._useLineColor),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uStrokeWeight",this.curStrokeWeight),e.setUniform("uStrokeCap",f[this.curStrokeCap]),e.setUniform("uStrokeJoin",h[this.curStrokeJoin])},p.default.RendererGL.prototype._setFillUniforms=function(e){e.bindShader(),e.setUniform("uUseVertexColor",this._useVertexColor),e.setUniform("uMaterialColor",this.curFillColor),e.setUniform("isTexture",!!this._tex),this._tex&&e.setUniform("uSampler",this._tex),e.setUniform("uTint",this._tint),e.setUniform("uAmbientMatColor",this.curAmbientColor),e.setUniform("uSpecularMatColor",this.curSpecularColor),e.setUniform("uEmissiveMatColor",this.curEmissiveColor),e.setUniform("uSpecular",this._useSpecularMaterial),e.setUniform("uEmissive",this._useEmissiveMaterial),e.setUniform("uShininess",this._useShininess),e.setUniform("uUseLighting",this._enableLighting);var t=this.pointLightDiffuseColors.length/3,t=(e.setUniform("uPointLightCount",t),e.setUniform("uPointLightLocation",this.pointLightPositions),e.setUniform("uPointLightDiffuseColors",this.pointLightDiffuseColors),e.setUniform("uPointLightSpecularColors",this.pointLightSpecularColors),this.directionalLightDiffuseColors.length/3),t=(e.setUniform("uDirectionalLightCount",t),e.setUniform("uLightingDirection",this.directionalLightDirections),e.setUniform("uDirectionalDiffuseColors",this.directionalLightDiffuseColors),e.setUniform("uDirectionalSpecularColors",this.directionalLightSpecularColors),this.ambientLightColors.length/3),t=(e.setUniform("uAmbientLightCount",t),e.setUniform("uAmbientColor",this.ambientLightColors),this.spotLightDiffuseColors.length/3);e.setUniform("uSpotLightCount",t),e.setUniform("uSpotLightAngle",this.spotLightAngle),e.setUniform("uSpotLightConc",this.spotLightConc),e.setUniform("uSpotLightDiffuseColors",this.spotLightDiffuseColors),e.setUniform("uSpotLightSpecularColors",this.spotLightSpecularColors),e.setUniform("uSpotLightLocation",this.spotLightPositions),e.setUniform("uSpotLightDirection",this.spotLightDirections),e.setUniform("uConstantAttenuation",this.constantAttenuation),e.setUniform("uLinearAttenuation",this.linearAttenuation),e.setUniform("uQuadraticAttenuation",this.quadraticAttenuation),e.bindTextures()},p.default.RendererGL.prototype._setPointUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uPointSize",this.pointSize*this._pInst._pixelDensity)},p.default.RendererGL.prototype._bindBuffer=function(e,t,r,o,n){t=t||this.GL.ARRAY_BUFFER,this.GL.bindBuffer(t,e),void 0!==r&&(e=new(o||Float32Array)(r),this.GL.bufferData(t,e,n||this.GL.STATIC_DRAW))},p.default.RendererGL.prototype._arraysEqual=function(e,t){var r=e.length;if(r!==t.length)return!1;for(var o=0;o<r;o++)if(e[o]!==t[o])return!1;return!0},p.default.RendererGL.prototype._isTypedArray=function(e){0 instanceof Float32Array;return 0 instanceof Float64Array,0 instanceof Int16Array,0 instanceof Uint16Array,e instanceof Uint32Array},p.default.RendererGL.prototype._flatten=function(e){if(0===e.length)return[];var t;if(2e4<e.length){for(var r=Object.prototype.toString,o=[],n=e.slice(),s=n.pop();"[object Array]"===r.call(s)?n.push.apply(n,u(s)):o.push(s),n.length&&void 0!==(s=n.pop()););return o.reverse(),o}return(t=[]).concat.apply(t,u(e))},p.default.RendererGL.prototype._vToNArray=function(e){var t=[],r=!0,o=!1,n=void 0;try{for(var s,i=e[Symbol.iterator]();!(r=(s=i.next()).done);r=!0){var a=s.value;t.push(a.x,a.y,a.z)}}catch(e){o=!0,n=e}finally{try{r||null==i.return||i.return()}finally{if(o)throw n}}return t},p.default.prototype._assert3d=function(e){if(!this._renderer.isP3D)throw new Error("".concat(e,"() is only supported in WEBGL mode. If you'd like to use 3D graphics and WebGL, see https://p5js.org/examples/form-3d-primitives.html for more information."))},p.default.RendererGL.prototype.tessyVertexSize=12,p.default.RendererGL.prototype._initTessy=function(){var e=new n.default.GluTesselator;return e.gluTessCallback(n.default.gluEnum.GLU_TESS_VERTEX_DATA,function(e,t){for(var r=0;r<e.length;r++)t[t.length]=e[r]}),e.gluTessCallback(n.default.gluEnum.GLU_TESS_BEGIN,function(e){e!==n.default.primitiveType.GL_TRIANGLES&&console.log("expected TRIANGLES but got type: ".concat(e))}),e.gluTessCallback(n.default.gluEnum.GLU_TESS_ERROR,function(e){console.log("error callback"),console.log("error number: ".concat(e))}),e.gluTessCallback(n.default.gluEnum.GLU_TESS_COMBINE,function(e,t,r){for(var o=new Array(p.default.RendererGL.prototype.tessyVertexSize).fill(0),n=0;n<r.length;n++)for(var s=0;s<o.length;s++)0!==r[n]&&t[n]&&(o[s]+=t[n][s]*r[n]);return o}),e.gluTessCallback(n.default.gluEnum.GLU_TESS_EDGE_FLAG,function(e){}),e},p.default.RendererGL.prototype._triangulate=function(e){var t=e[0]?e[0][2]:void 0,r=!0,o=!0,n=!1,s=void 0;try{for(var i,a=e[Symbol.iterator]();!(o=(i=a.next()).done);o=!0)for(var l=i.value,u=0;u<l.length;u+=p.default.RendererGL.prototype.tessyVertexSize)if(l[u+2]!==t){r=!1;break}}catch(e){n=!0,s=e}finally{try{o||null==a.return||a.return()}finally{if(n)throw s}}r?this._tessy.gluTessNormal(0,0,1):this._tessy.gluTessNormal(0,0,0);n=[];this._tessy.gluTessBeginPolygon(n);for(var c=0;c<e.length;c++){this._tessy.gluTessBeginContour();for(var d=e[c],f=0;f<d.length;f+=p.default.RendererGL.prototype.tessyVertexSize){var h=d.slice(f,f+p.default.RendererGL.prototype.tessyVertexSize);this._tessy.gluTessVertex(h,h)}this._tessy.gluTessEndContour()}return this._tessy.gluTessEndPolygon(),n},p.default.RendererGL.prototype._bezierCoefficients=function(e){var t=e*e,r=1-e,o=r*r;return[o*r,3*o*e,3*r*t,t*e]},p.default.RendererGL.prototype._quadraticCoefficients=function(e){var t=1-e;return[t*t,2*t*e,e*e]},p.default.RendererGL.prototype._bezierToCatmull=function(e){return[e[1],e[1]+(e[2]-e[0])/this._curveTightness,e[2]-(e[3]-e[1])/this._curveTightness,e[2]]},p.default.RendererGL);r.default=e},{"../core/constants":256,"../core/main":267,"../core/p5.Renderer":270,"./p5.Camera":315,"./p5.Matrix":317,"./p5.Shader":322,"core-js/modules/es.array.concat":149,"core-js/modules/es.array.fill":152,"core-js/modules/es.array.filter":153,"core-js/modules/es.array.from":155,"core-js/modules/es.array.includes":156,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.slice":162,"core-js/modules/es.object.assign":172,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.to-string":182,"core-js/modules/es.string.includes":185,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.typed-array.copy-within":197,"core-js/modules/es.typed-array.every":198,"core-js/modules/es.typed-array.fill":199,"core-js/modules/es.typed-array.filter":200,"core-js/modules/es.typed-array.find":202,"core-js/modules/es.typed-array.find-index":201,"core-js/modules/es.typed-array.float32-array":203,"core-js/modules/es.typed-array.float64-array":204,"core-js/modules/es.typed-array.for-each":205,"core-js/modules/es.typed-array.includes":206,"core-js/modules/es.typed-array.index-of":207,"core-js/modules/es.typed-array.int16-array":208,"core-js/modules/es.typed-array.iterator":210,"core-js/modules/es.typed-array.join":211,"core-js/modules/es.typed-array.last-index-of":212,"core-js/modules/es.typed-array.map":213,"core-js/modules/es.typed-array.reduce":215,"core-js/modules/es.typed-array.reduce-right":214,"core-js/modules/es.typed-array.reverse":216,"core-js/modules/es.typed-array.set":217,"core-js/modules/es.typed-array.slice":218,"core-js/modules/es.typed-array.some":219,"core-js/modules/es.typed-array.sort":220,"core-js/modules/es.typed-array.subarray":221,"core-js/modules/es.typed-array.to-locale-string":222,"core-js/modules/es.typed-array.to-string":223,"core-js/modules/es.typed-array.uint16-array":224,"core-js/modules/es.typed-array.uint32-array":225,"core-js/modules/es.typed-array.uint8-array":226,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230,libtess:239,path:242}],322:[function(e,t,r){"use strict";e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.function.name"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.index-of"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.function.name"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var s=(e=e("../core/main"))&&e.__esModule?e:{default:e};s.default.Shader=function(e,t,r){this._renderer=e,this._vertSrc=t,this._fragSrc=r,this._vertShader=-1,this._fragShader=-1,this._glProgram=0,this._loadedAttributes=!1,this.attributes={},this._loadedUniforms=!1,this.uniforms={},this._bound=!1,this.samplers=[]},s.default.Shader.prototype.init=function(){if(0===this._glProgram){var e=this._renderer.GL;if(this._vertShader=e.createShader(e.VERTEX_SHADER),e.shaderSource(this._vertShader,this._vertSrc),e.compileShader(this._vertShader),!e.getShaderParameter(this._vertShader,e.COMPILE_STATUS))return console.error("Yikes! An error occurred compiling the vertex shader:".concat(e.getShaderInfoLog(this._vertShader))),null;if(this._fragShader=e.createShader(e.FRAGMENT_SHADER),e.shaderSource(this._fragShader,this._fragSrc),e.compileShader(this._fragShader),!e.getShaderParameter(this._fragShader,e.COMPILE_STATUS))return console.error("Darn! An error occurred compiling the fragment shader:".concat(e.getShaderInfoLog(this._fragShader))),null;this._glProgram=e.createProgram(),e.attachShader(this._glProgram,this._vertShader),e.attachShader(this._glProgram,this._fragShader),e.linkProgram(this._glProgram),e.getProgramParameter(this._glProgram,e.LINK_STATUS)||console.error("Snap! Error linking shader program: ".concat(e.getProgramInfoLog(this._glProgram))),this._loadAttributes(),this._loadUniforms()}return this},s.default.Shader.prototype._loadAttributes=function(){if(!this._loadedAttributes){this.attributes={};for(var e=this._renderer.GL,t=e.getProgramParameter(this._glProgram,e.ACTIVE_ATTRIBUTES),r=0;r<t;++r){var o=e.getActiveAttrib(this._glProgram,r),n=o.name,s=e.getAttribLocation(this._glProgram,n),i={};i.name=n,i.location=s,i.index=r,i.type=o.type,i.size=o.size,this.attributes[n]=i}this._loadedAttributes=!0}},s.default.Shader.prototype._loadUniforms=function(){if(!this._loadedUniforms){for(var e=this._renderer.GL,t=e.getProgramParameter(this._glProgram,e.ACTIVE_UNIFORMS),r=0,o=0;o<t;++o){var n=e.getActiveUniform(this._glProgram,o),s={},i=(s.location=e.getUniformLocation(this._glProgram,n.name),s.size=n.size,n.name);1<n.size&&(i=i.substring(0,i.indexOf("[0]"))),s.name=i,s.type=n.type,s._cachedData=void 0,s.type===e.SAMPLER_2D&&(s.samplerIndex=r,r++,this.samplers.push(s)),s.isArray=1<n.size||s.type===e.FLOAT_MAT3||s.type===e.FLOAT_MAT4||s.type===e.FLOAT_VEC2||s.type===e.FLOAT_VEC3||s.type===e.FLOAT_VEC4||s.type===e.INT_VEC2||s.type===e.INT_VEC4||s.type===e.INT_VEC3,this.uniforms[i]=s}this._loadedUniforms=!0}},s.default.Shader.prototype.compile=function(){},s.default.Shader.prototype.bindShader=function(){this.init(),this._bound||(this.useProgram(),this._bound=!0,this._setMatrixUniforms(),this.setUniform("uViewport",this._renderer._viewport))},s.default.Shader.prototype.unbindShader=function(){return this._bound&&(this.unbindTextures(),this._bound=!1),this},s.default.Shader.prototype.bindTextures=function(){var e=this._renderer.GL,t=!0,r=!1,o=void 0;try{for(var n,s=this.samplers[Symbol.iterator]();!(t=(n=s.next()).done);t=!0){var i=n.value,a=i.texture;void 0===a&&(a=this._renderer._getEmptyTexture()),e.activeTexture(e.TEXTURE0+i.samplerIndex),a.bindTexture(),a.update(),e.uniform1i(i.location,i.samplerIndex)}}catch(e){r=!0,o=e}finally{try{t||null==s.return||s.return()}finally{if(r)throw o}}},s.default.Shader.prototype.updateTextures=function(){var e=!0,t=!1,r=void 0;try{for(var o,n=this.samplers[Symbol.iterator]();!(e=(o=n.next()).done);e=!0){var s=o.value.texture;s&&s.update()}}catch(e){t=!0,r=e}finally{try{e||null==n.return||n.return()}finally{if(t)throw r}}},s.default.Shader.prototype.unbindTextures=function(){var e=!0,t=!1,r=void 0;try{for(var o,n=this.samplers[Symbol.iterator]();!(e=(o=n.next()).done);e=!0){var s=o.value;this.setUniform(s.name,this._renderer._getEmptyTexture())}}catch(e){t=!0,r=e}finally{try{e||null==n.return||n.return()}finally{if(t)throw r}}},s.default.Shader.prototype._setMatrixUniforms=function(){var e=this._renderer._curCamera.cameraMatrix,t=this._renderer.uPMatrix,r=this._renderer.uMVMatrix,o=r.copy();o.mult(t),this.isStrokeShader()&&("default"===this._renderer._curCamera.cameraType?this.setUniform("uPerspective",1):this.setUniform("uPerspective",0)),this.setUniform("uViewMatrix",e.mat4),this.setUniform("uProjectionMatrix",t.mat4),this.setUniform("uModelViewMatrix",r.mat4),this.setUniform("uModelViewProjectionMatrix",o.mat4),this.uniforms.uNormalMatrix&&(this._renderer.uNMatrix.inverseTranspose(this._renderer.uMVMatrix),this.setUniform("uNormalMatrix",this._renderer.uNMatrix.mat3))},s.default.Shader.prototype.useProgram=function(){var e=this._renderer.GL;return this._renderer._curShader!==this&&(e.useProgram(this._glProgram),this._renderer._curShader=this),this},s.default.Shader.prototype.setUniform=function(e,t){var r=this.uniforms[e];if(r){var o=this._renderer.GL;if(r.isArray){if(r._cachedData&&this._renderer._arraysEqual(r._cachedData,t))return;r._cachedData=t.slice(0)}else{if(r._cachedData&&r._cachedData===t)return;Array.isArray(t)?r._cachedData=t.slice(0):r._cachedData=t}var n=r.location;switch(this.useProgram(),r.type){case o.BOOL:!0===t?o.uniform1i(n,1):o.uniform1i(n,0);break;case o.INT:1<r.size?t.length&&o.uniform1iv(n,t):o.uniform1i(n,t);break;case o.FLOAT:1<r.size?t.length&&o.uniform1fv(n,t):o.uniform1f(n,t);break;case o.FLOAT_MAT3:o.uniformMatrix3fv(n,!1,t);break;case o.FLOAT_MAT4:o.uniformMatrix4fv(n,!1,t);break;case o.FLOAT_VEC2:1<r.size?t.length&&o.uniform2fv(n,t):o.uniform2f(n,t[0],t[1]);break;case o.FLOAT_VEC3:1<r.size?t.length&&o.uniform3fv(n,t):o.uniform3f(n,t[0],t[1],t[2]);break;case o.FLOAT_VEC4:1<r.size?t.length&&o.uniform4fv(n,t):o.uniform4f(n,t[0],t[1],t[2],t[3]);break;case o.INT_VEC2:1<r.size?t.length&&o.uniform2iv(n,t):o.uniform2i(n,t[0],t[1]);break;case o.INT_VEC3:1<r.size?t.length&&o.uniform3iv(n,t):o.uniform3i(n,t[0],t[1],t[2]);break;case o.INT_VEC4:1<r.size?t.length&&o.uniform4iv(n,t):o.uniform4i(n,t[0],t[1],t[2],t[3]);break;case o.SAMPLER_2D:o.activeTexture(o.TEXTURE0+r.samplerIndex),r.texture=t instanceof s.default.Texture?t:this._renderer.getTexture(t),o.uniform1i(n,r.samplerIndex),r.texture.src.gifProperties&&r.texture.src._animateGif(this._renderer._pInst)}return this}},s.default.Shader.prototype.isLightShader=function(){return void 0!==this.attributes.aNormal||void 0!==this.uniforms.uUseLighting||void 0!==this.uniforms.uAmbientLightCount||void 0!==this.uniforms.uDirectionalLightCount||void 0!==this.uniforms.uPointLightCount||void 0!==this.uniforms.uAmbientColor||void 0!==this.uniforms.uDirectionalDiffuseColors||void 0!==this.uniforms.uDirectionalSpecularColors||void 0!==this.uniforms.uPointLightLocation||void 0!==this.uniforms.uPointLightDiffuseColors||void 0!==this.uniforms.uPointLightSpecularColors||void 0!==this.uniforms.uLightingDirection||void 0!==this.uniforms.uSpecular},s.default.Shader.prototype.isNormalShader=function(){return void 0!==this.attributes.aNormal},s.default.Shader.prototype.isTextureShader=function(){return 0<this.samplers.length},s.default.Shader.prototype.isColorShader=function(){return void 0!==this.attributes.aVertexColor||void 0!==this.uniforms.uMaterialColor},s.default.Shader.prototype.isTexLightShader=function(){return this.isLightShader()&&this.isTextureShader()},s.default.Shader.prototype.isStrokeShader=function(){return void 0!==this.uniforms.uStrokeWeight},s.default.Shader.prototype.enableAttrib=function(e,t,r,o,n,s){var i;return e&&-1!==(e=e.location)&&(i=this._renderer.GL,this._renderer.registerEnabled[e]||(i.enableVertexAttribArray(e),this._renderer.registerEnabled[e]=!0),this._renderer.GL.vertexAttribPointer(e,t,r||i.FLOAT,o||!1,n||0,s||0)),this};e=s.default.Shader;r.default=e},{"../core/main":267,"core-js/modules/es.array.index-of":157,"core-js/modules/es.array.iterator":158,"core-js/modules/es.array.slice":162,"core-js/modules/es.function.name":165,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/web.dom-collections.iterator":230}],323:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(s=e("../core/main"))&&s.__esModule?s:{default:s},a=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants"));function l(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,l=function(){return e},e)}n.default.Texture=function(e,t,r){this._renderer=e;e=this._renderer.GL,(r=r||{}).dataType===e.FLOAT&&(e.getExtension("OES_texture_float")||console.log("Oh no, your device doesn't support floating point textures!"),e.getExtension("OES_texture_float_linear")||console.log("Ack! Your device doesn't support linear filtering for floating point textures")),this.src=t,this.glTex=void 0,this.glTarget=e.TEXTURE_2D,this.glFormat=r.format||e.RGBA,this.mipmaps=!1,this.glMinFilter=r.minFilter||e.LINEAR,this.glMagFilter=r.magFilter||e.LINEAR,this.glWrapS=r.wrapS||e.CLAMP_TO_EDGE,this.glWrapT=r.wrapT||e.CLAMP_TO_EDGE,this.glDataType=r.dataType||e.UNSIGNED_BYTE,this.isSrcMediaElement=void 0!==n.default.MediaElement&&t instanceof n.default.MediaElement,this._videoPrevUpdateTime=0,this.isSrcHTMLElement=void 0!==n.default.Element&&t instanceof n.default.Element&&!(t instanceof n.default.Graphics)&&!(t instanceof n.default.Renderer),this.isSrcP5Image=t instanceof n.default.Image,this.isSrcP5Graphics=t instanceof n.default.Graphics,this.isSrcP5Renderer=t instanceof n.default.Renderer,this.isImageData="undefined"!=typeof ImageData&&t instanceof ImageData,r=this._getTextureDataFromSource();return this.width=r.width,this.height=r.height,this.init(r),this},n.default.Texture.prototype._getTextureDataFromSource=function(){var e;return this.isSrcP5Image?e=this.src.canvas:this.isSrcMediaElement||this.isSrcP5Graphics||this.isSrcP5Renderer||this.isSrcHTMLElement?e=this.src.elt:this.isImageData&&(e=this.src),e},n.default.Texture.prototype.init=function(e){var t,r=this._renderer.GL;this.glTex=r.createTexture(),this.glWrapS=this._renderer.textureWrapX,this.glWrapT=this._renderer.textureWrapY,this.setWrapMode(this.glWrapS,this.glWrapT),this.bindTexture(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,this.glMagFilter),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,this.glMinFilter),0===this.width||0===this.height||this.isSrcMediaElement&&!this.src.loadedmetadata?(t=new Uint8Array([1,1,1,1]),r.texImage2D(this.glTarget,0,r.RGBA,1,1,0,this.glFormat,this.glDataType,t)):r.texImage2D(this.glTarget,0,this.glFormat,this.glFormat,this.glDataType,e)},n.default.Texture.prototype.update=function(){var e,t,r,o=this.src;return 0!==o.width&&0!==o.height&&(e=this._getTextureDataFromSource(),t=!1,r=this._renderer.GL,e.width!==this.width||e.height!==this.height?(t=!0,this.width=e.width,this.height=e.height,this.isSrcP5Image?o.setModified(!1):(this.isSrcMediaElement||this.isSrcHTMLElement)&&o.setModified(!0)):this.isSrcP5Image?o.isModified()&&o.setModified(!(t=!0)):this.isSrcMediaElement?o.isModified()?o.setModified(!(t=!0)):o.loadedmetadata&&this._videoPrevUpdateTime!==o.time()&&(this._videoPrevUpdateTime=o.time(),t=!0):this.isImageData?o._dirty&&(t=!(o._dirty=!1)):t=!0,t&&(this.bindTexture(),r.texImage2D(this.glTarget,0,this.glFormat,this.glFormat,this.glDataType,e)),t)},n.default.Texture.prototype.bindTexture=function(){return this._renderer.GL.bindTexture(this.glTarget,this.glTex),this},n.default.Texture.prototype.unbindTexture=function(){this._renderer.GL.bindTexture(this.glTarget,null)},n.default.Texture.prototype.setInterpolation=function(e,t){var r=this._renderer.GL;e===a.NEAREST?this.glMinFilter=r.NEAREST:this.glMinFilter=r.LINEAR,t===a.NEAREST?this.glMagFilter=r.NEAREST:this.glMagFilter=r.LINEAR,this.bindTexture(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,this.glMinFilter),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,this.glMagFilter),this.unbindTexture()},n.default.Texture.prototype.setWrapMode=function(e,t){function r(e){return 0==(e&e-1)}var o=this._renderer.GL,n=this._getTextureDataFromSource(),n=n.naturalWidth&&n.naturalHeight?(s=n.naturalWidth,n.naturalHeight):(s=this.width,this.height),s=r(s),n=r(n);e===a.REPEAT?s&&n?this.glWrapS=o.REPEAT:(console.warn("You tried to set the wrap mode to REPEAT but the texture size is not a power of two. Setting to CLAMP instead"),this.glWrapS=o.CLAMP_TO_EDGE):e===a.MIRROR?s&&n?this.glWrapS=o.MIRRORED_REPEAT:(console.warn("You tried to set the wrap mode to MIRROR but the texture size is not a power of two. Setting to CLAMP instead"),this.glWrapS=o.CLAMP_TO_EDGE):this.glWrapS=o.CLAMP_TO_EDGE,t===a.REPEAT?s&&n?this.glWrapT=o.REPEAT:(console.warn("You tried to set the wrap mode to REPEAT but the texture size is not a power of two. Setting to CLAMP instead"),this.glWrapT=o.CLAMP_TO_EDGE):t===a.MIRROR?s&&n?this.glWrapT=o.MIRRORED_REPEAT:(console.warn("You tried to set the wrap mode to MIRROR but the texture size is not a power of two. Setting to CLAMP instead"),this.glWrapT=o.CLAMP_TO_EDGE):this.glWrapT=o.CLAMP_TO_EDGE,this.bindTexture(),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,this.glWrapS),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,this.glWrapT),this.unbindTexture()};var s=n.default.Texture;r.default=s},{"../core/constants":256,"../core/main":267,"core-js/modules/es.array.iterator":158,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.string.iterator":186,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.typed-array.copy-within":197,"core-js/modules/es.typed-array.every":198,"core-js/modules/es.typed-array.fill":199,"core-js/modules/es.typed-array.filter":200,"core-js/modules/es.typed-array.find":202,"core-js/modules/es.typed-array.find-index":201,"core-js/modules/es.typed-array.for-each":205,"core-js/modules/es.typed-array.includes":206,"core-js/modules/es.typed-array.index-of":207,"core-js/modules/es.typed-array.iterator":210,"core-js/modules/es.typed-array.join":211,"core-js/modules/es.typed-array.last-index-of":212,"core-js/modules/es.typed-array.map":213,"core-js/modules/es.typed-array.reduce":215,"core-js/modules/es.typed-array.reduce-right":214,"core-js/modules/es.typed-array.reverse":216,"core-js/modules/es.typed-array.set":217,"core-js/modules/es.typed-array.slice":218,"core-js/modules/es.typed-array.some":219,"core-js/modules/es.typed-array.sort":220,"core-js/modules/es.typed-array.subarray":221,"core-js/modules/es.typed-array.to-locale-string":222,"core-js/modules/es.typed-array.to-string":223,"core-js/modules/es.typed-array.uint8-array":226,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}],324:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.sub"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.exec"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.split"),e("core-js/modules/es.string.sub"),e("core-js/modules/web.dom-collections.iterator");var n,B=(n=e("../core/main"))&&n.__esModule?n:{default:n},E=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}e("./p5.Shader"),e("./p5.RendererGL.Retained"),B.default.RendererGL.prototype._applyTextProperties=function(){},B.default.RendererGL.prototype.textWidth=function(e){return this._isOpenType()?this._textFont._textWidth(e,this._textSize):0};function s(e,t){this.width=e,this.height=t,this.infos=[],this.findImage=function(e){var t,r,o=this.width*this.height;if(o<e)throw new Error("font is too complex to render in 3D");for(var n=this.infos.length-1;0<=n;--n){var s=this.infos[n];if(s.index+e<o){r=(t=s).imageData;break}}if(!t){try{r=new ImageData(this.width,this.height)}catch(e){var i=document.getElementsByTagName("canvas")[0],a=!i,l=(i||((i=document.createElement("canvas")).style.display="none",document.body.appendChild(i)),i.getContext("2d"));l&&(r=l.createImageData(this.width,this.height)),a&&document.body.removeChild(i)}this.infos.push(t={index:0,imageData:r})}l=t.index;return t.index+=e,r._dirty=!0,{imageData:r,index:l}}}function G(e,t,r,o,n){var s=e.imageData.data,e=4*e.index++;s[e++]=t,s[e++]=r,s[e++]=o,s[+e]=n}function T(e){this.font=e,this.strokeImageInfos=new s(64,64),this.colDimImageInfos=new s(64,64),this.rowDimImageInfos=new s(64,64),this.colCellImageInfos=new s(64,64),this.rowCellImageInfos=new s(64,64),this.glyphInfos={},this.getGlyphInfo=function(e){var t=this.glyphInfos[e.index];if(!t){var r=e.getBoundingBox(),o=r.x1,n=r.y1,s=r.x2-o,i=r.y2-n,a=e.path.commands;if(0==s||0==i||!a.length)return this.glyphInfos[e.index]={};for(var l,u,c,d,f=[],h=[],p=[],m=8;0<=m;--m)p.push([]);for(m=8;0<=m;--m)h.push([]);var y=!0,g=!1,v=void 0;try{for(var b,j=a[Symbol.iterator]();!(y=(b=j.next()).done);y=!0){var _=b.value,x=(_.x-o)/s,w=(_.y-n)/i;if(!N(l,u,x,w)){switch(_.type){case"M":c=x,d=w;break;case"L":U(l,u,x,w);break;case"Q":var S=(_.x1-o)/s,M=(_.y1-n)/i;A([l,x,S],[u,w,M],{x:l,y:u,cx:S,cy:M});break;case"Z":N(l,u,c,d)?f.push({x:l,y:u}):(U(l,u,c,d),f.push({x:c,y:d}));break;case"C":for(var E=function(e,t,r,o,n,s,i,a){var e=new I(new B.default.Vector(e,t),new B.default.Vector(r,o),new B.default.Vector(n,s),new B.default.Vector(i,a)).splitInflections(),l=[],u=30/V,c=!0,t=!1,r=void 0;try{for(var d,f=e[Symbol.iterator]();!(c=(d=f.next()).done);c=!0){for(var h=d.value,p=[],m=void 0;!(.125<=(m=u/h.quadError()));){var y=Math.pow(m,1/3),g=h.split(y),v=h.split(1-y/(1-y));l.push(g),p.push(h),h=v}m<1&&l.push(h.split(.5)),l.push(h),Array.prototype.push.apply(l,p.reverse())}}catch(e){t=!0,r=e}finally{try{c||null==f.return||f.return()}finally{if(t)throw r}}return l}(l,u,(_.x1-o)/s,(_.y1-n)/i,(_.x2-o)/s,(_.y2-n)/i,x,w),T=0;T<E.length;T++){var C=E[T].toQuadratic();A([C.x,C.x1,C.cx],[C.y,C.y1,C.cy],C)}break;default:throw new Error("unknown command type: ".concat(_.type))}l=x,u=w}}}catch(e){g=!0,v=e}finally{try{y||null==j.return||j.return()}finally{if(g)throw v}}for(var O=f.length,k=this.strokeImageInfos.findImage(O),D=k.index,L=0;L<O;++L){var P=f[L];G(k,R(P.x),R(P.y),R(P.cx),R(P.cy))}(t=this.glyphInfos[e.index]={glyph:e,uGlyphRect:[r.x1,-r.y1,r.x2,-r.y2],strokeImageInfo:k,strokes:f,colInfo:F(p,this.colDimImageInfos,this.colCellImageInfos),rowInfo:F(h,this.rowDimImageInfos,this.rowCellImageInfos)}).uGridOffset=[t.colInfo.dimOffset,t.rowInfo.dimOffset]}return t;function A(e,t,r){var o=f.length;function n(e,t,r){for(var o=e.length;0<o--;){var n=e[o];n<t&&(t=n),r<n&&(r=n)}return{min:t,max:r}}f.push(r);for(var r=n(e,1,0),e=Math.max(Math.floor(9*r.min-.5),0),s=Math.min(Math.ceil(9*r.max+.5),9),i=e;i<s;++i)p[i].push(o);for(var r=n(t,1,0),e=Math.max(Math.floor(9*r.min-.5),0),a=Math.min(Math.ceil(9*r.max+.5),9),l=e;l<a;++l)h[l].push(o)}function R(e){return(e=(r=255)*e)<(t=0)?t:r<e?r:e;var t,r}function I(e,t,r,o){this.p0=e,this.c0=t,this.c1=r,this.p1=o,this.toQuadratic=function(){return{x:this.p0.x,y:this.p0.y,x1:this.p1.x,y1:this.p1.y,cx:(3*(this.c0.x+this.c1.x)-(this.p0.x+this.p1.x))/4,cy:(3*(this.c0.y+this.c1.y)-(this.p0.y+this.p1.y))/4}},this.quadError=function(){return B.default.Vector.sub(B.default.Vector.sub(this.p1,this.p0),B.default.Vector.mult(B.default.Vector.sub(this.c1,this.c0),3)).mag()/2},this.split=function(e){var t=B.default.Vector.lerp(this.p0,this.c0,e),r=B.default.Vector.lerp(this.c0,this.c1,e),o=B.default.Vector.lerp(t,r,e),r=(this.c1=B.default.Vector.lerp(this.c1,this.p1,e),this.c0=B.default.Vector.lerp(r,this.c1,e),B.default.Vector.lerp(o,this.c0,e)),e=new I(this.p0,t,o,r);return this.p0=r,e},this.splitInflections=function(){var e=B.default.Vector.sub(this.c0,this.p0),t=B.default.Vector.sub(B.default.Vector.sub(this.c1,this.c0),e),r=B.default.Vector.sub(B.default.Vector.sub(B.default.Vector.sub(this.p1,this.c1),e),B.default.Vector.mult(t,2)),o=[],n=t.x*r.y-t.y*r.x;return 0!==n&&0<=(e=(r=e.x*r.y-e.y*r.x)*r-4*n*(e.x*t.y-e.y*t.x))&&(n<0&&(n=-n,r=-r,0),e=(-r+(t=Math.sqrt(e)))/(2*n),0<(r=(-r-t)/(2*n))&&r<1&&(o.push(this.split(r)),e=1-(1-e)/(1-r)),0<e&&e<1&&o.push(this.split(e))),o.push(this),o}}function U(e,t,r,o){A([e,r],[t,o],{x:e,y:t,cx:(e+r)/2,cy:(t+o)/2})}function N(e,t,r,o){return Math.abs(r-e)<1e-5&&Math.abs(o-t)<1e-5}function F(e,t,r){for(var o=e.length,n=t.findImage(o),t=n.index,s=0,i=0;i<o;++i)s+=e[i].length;for(var a=r.findImage(s),l=0;l<o;++l){var u=e[l],c=u.length,d=a.index;G(n,d>>7,127&d,c>>7,127&c);for(var f=0;f<c;++f){var h=u[f]+D;G(a,h>>7,127&h,0,0)}}return{cellImageInfo:a,dimOffset:t,dimImageInfo:n}}}}var V=Math.sqrt(3);B.default.RendererGL.prototype._renderText=function(e,t,r,o,n){if(this._textFont&&"string"!=typeof this._textFont){if(!(n<=o)&&this._doFill){if(this._isOpenType()){e.push();var n=this._doStroke,s=this.drawMode,i=(this._doStroke=!1,this.drawMode=E.TEXTURE,this._textFont.font),a=(a=this._textFont._fontInfo)||(this._textFont._fontInfo=new T(i)),r=this._textFont._handleAlignment(this,t,r,o),o=this._textSize/i.unitsPerEm,l=(this.translate(r.x,r.y,0),this.scale(o,o,1),this.GL),r=!this._defaultFontShader,u=this._getFontShader(),c=(u.init(),u.bindShader(),r&&(u.setUniform("uGridImageSize",[64,64]),u.setUniform("uCellsImageSize",[64,64]),u.setUniform("uStrokeImageSize",[64,64]),u.setUniform("uGridSize",[9,9])),this._applyColorBlend(this.curFillColor),this.retainedMode.geometry.glyph),d=(c||((o=this._textGeom=new B.default.Geometry(1,1,function(){for(var e=0;e<=1;e++)for(var t=0;t<=1;t++)this.vertices.push(new B.default.Vector(t,e,0)),this.uvs.push(t,e)})).computeFaces().computeNormals(),c=this.createBuffers("glyph",o)),!0),r=!1,o=void 0;try{for(var f,h=this.retainedMode.buffers.text[Symbol.iterator]();!(d=(f=h.next()).done);d=!0)f.value._prepareBuffer(c,u)}catch(e){r=!0,o=e}finally{try{d||null==h.return||h.return()}finally{if(r)throw o}}this._bindBuffer(c.indexBuffer,l.ELEMENT_ARRAY_BUFFER),u.setUniform("uMaterialColor",this.curFillColor);try{var p=0,m=null,y=i.stringToGlyphs(t),g=!0,v=!1,b=void 0;try{for(var j,_=y[Symbol.iterator]();!(g=(j=_.next()).done);g=!0){var x,w,S=j.value,M=(m&&(p+=i.getKerningValue(m,S)),a.getGlyphInfo(S));M.uGlyphRect&&(x=M.rowInfo,w=M.colInfo,u.setUniform("uSamplerStrokes",M.strokeImageInfo.imageData),u.setUniform("uSamplerRowStrokes",x.cellImageInfo.imageData),u.setUniform("uSamplerRows",x.dimImageInfo.imageData),u.setUniform("uSamplerColStrokes",w.cellImageInfo.imageData),u.setUniform("uSamplerCols",w.dimImageInfo.imageData),u.setUniform("uGridOffset",M.uGridOffset),u.setUniform("uGlyphRect",M.uGlyphRect),u.setUniform("uGlyphOffset",p),u.bindTextures(),l.drawElements(l.TRIANGLES,6,this.GL.UNSIGNED_SHORT,0)),p+=S.advanceWidth,m=S}}catch(e){v=!0,b=e}finally{try{g||null==_.return||_.return()}finally{if(v)throw b}}}finally{u.unbindShader(),this._doStroke=n,this.drawMode=s,e.pop()}}else console.log("WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported");return e}}else console.log("WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.")}},{"../core/constants":256,"../core/main":267,"./p5.RendererGL.Retained":320,"./p5.Shader":322,"core-js/modules/es.array.iterator":158,"core-js/modules/es.object.get-own-property-descriptor":173,"core-js/modules/es.object.to-string":177,"core-js/modules/es.regexp.exec":181,"core-js/modules/es.string.iterator":186,"core-js/modules/es.string.split":191,"core-js/modules/es.string.sub":192,"core-js/modules/es.symbol":196,"core-js/modules/es.symbol.description":194,"core-js/modules/es.symbol.iterator":195,"core-js/modules/es.weak-map":228,"core-js/modules/web.dom-collections.iterator":230}]},{},[251])(251)}); \ No newline at end of file
diff --git a/vhosts/blog/static/pdf.min.js b/vhosts/blog/static/pdf.min.js
new file mode 100644
index 00000000..e156646b
--- /dev/null
+++ b/vhosts/blog/static/pdf.min.js
@@ -0,0 +1,22 @@
+/**
+ * @licstart The following is the entire license notice for the
+ * JavaScript code in this page
+ *
+ * Copyright 2023 Mozilla Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * @licend The above is the entire license notice for the
+ * JavaScript code in this page
+ */
+!function webpackUniversalModuleDefinition(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("pdfjs-dist/build/pdf",[],e):"object"==typeof exports?exports["pdfjs-dist/build/pdf"]=e():t["pdfjs-dist/build/pdf"]=t.pdfjsLib=e()}(globalThis,(()=>(()=>{"use strict";var __webpack_modules__=[,(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0});e.VerbosityLevel=e.Util=e.UnknownErrorException=e.UnexpectedResponseException=e.UNSUPPORTED_FEATURES=e.TextRenderingMode=e.RenderingIntentFlag=e.PermissionFlag=e.PasswordResponses=e.PasswordException=e.PageActionEventType=e.OPS=e.MissingPDFException=e.LINE_FACTOR=e.LINE_DESCENT_FACTOR=e.InvalidPDFException=e.ImageKind=e.IDENTITY_MATRIX=e.FormatError=e.FeatureTest=e.FONT_IDENTITY_MATRIX=e.DocumentActionEventType=e.CMapCompressionType=e.BaseException=e.BASELINE_FACTOR=e.AnnotationType=e.AnnotationStateModelType=e.AnnotationReviewState=e.AnnotationReplyType=e.AnnotationMode=e.AnnotationMarkedState=e.AnnotationFlag=e.AnnotationFieldFlag=e.AnnotationEditorType=e.AnnotationEditorPrefix=e.AnnotationEditorParamsType=e.AnnotationBorderStyleType=e.AnnotationActionEventType=e.AbortException=void 0;e.assert=function assert(t,e){t||unreachable(e)};e.bytesToString=function bytesToString(t){"object"==typeof t&&null!==t&&void 0!==t.length||unreachable("Invalid argument for bytesToString");const e=t.length,s=8192;if(e<s)return String.fromCharCode.apply(null,t);const n=[];for(let i=0;i<e;i+=s){const a=Math.min(i+s,e),r=t.subarray(i,a);n.push(String.fromCharCode.apply(null,r))}return n.join("")};e.createPromiseCapability=function createPromiseCapability(){const t=Object.create(null);let e=!1;Object.defineProperty(t,"settled",{get:()=>e});t.promise=new Promise((function(s,n){t.resolve=function(t){e=!0;s(t)};t.reject=function(t){e=!0;n(t)}}));return t};e.createValidAbsoluteUrl=function createValidAbsoluteUrl(t,e=null,s=null){if(!t)return null;try{if(s&&"string"==typeof t){if(s.addDefaultProtocol&&t.startsWith("www.")){const e=t.match(/\./g);e&&e.length>=2&&(t=`http://${t}`)}if(s.tryConvertEncoding)try{t=stringToUTF8String(t)}catch(t){}}const n=e?new URL(t,e):new URL(t);if(function _isValidProtocol(t){if(!t)return!1;switch(t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(n))return n}catch(t){}return null};e.getModificationDate=function getModificationDate(t=new Date){return[t.getUTCFullYear().toString(),(t.getUTCMonth()+1).toString().padStart(2,"0"),t.getUTCDate().toString().padStart(2,"0"),t.getUTCHours().toString().padStart(2,"0"),t.getUTCMinutes().toString().padStart(2,"0"),t.getUTCSeconds().toString().padStart(2,"0")].join("")};e.getVerbosityLevel=function getVerbosityLevel(){return n};e.info=function info(t){n>=s.INFOS&&console.log(`Info: ${t}`)};e.isArrayBuffer=function isArrayBuffer(t){return"object"==typeof t&&null!==t&&void 0!==t.byteLength};e.isArrayEqual=function isArrayEqual(t,e){if(t.length!==e.length)return!1;for(let s=0,n=t.length;s<n;s++)if(t[s]!==e[s])return!1;return!0};e.objectFromMap=function objectFromMap(t){const e=Object.create(null);for(const[s,n]of t)e[s]=n;return e};e.objectSize=function objectSize(t){return Object.keys(t).length};e.setVerbosityLevel=function setVerbosityLevel(t){Number.isInteger(t)&&(n=t)};e.shadow=shadow;e.string32=function string32(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t)};e.stringToBytes=stringToBytes;e.stringToPDFString=function stringToPDFString(t){if(t[0]>="ï"){let e;"þ"===t[0]&&"ÿ"===t[1]?e="utf-16be":"ÿ"===t[0]&&"þ"===t[1]?e="utf-16le":"ï"===t[0]&&"»"===t[1]&&"¿"===t[2]&&(e="utf-8");if(e)try{const s=new TextDecoder(e,{fatal:!0}),n=stringToBytes(t);return s.decode(n)}catch(t){warn(`stringToPDFString: "${t}".`)}}const e=[];for(let s=0,n=t.length;s<n;s++){const n=r[t.charCodeAt(s)];e.push(n?String.fromCharCode(n):t.charAt(s))}return e.join("")};e.stringToUTF8String=stringToUTF8String;e.unreachable=unreachable;e.utf8StringToString=function utf8StringToString(t){return unescape(encodeURIComponent(t))};e.warn=warn;e.IDENTITY_MATRIX=[1,0,0,1,0,0];e.FONT_IDENTITY_MATRIX=[.001,0,0,.001,0,0];e.LINE_FACTOR=1.35;e.LINE_DESCENT_FACTOR=.35;e.BASELINE_FACTOR=.25925925925925924;e.RenderingIntentFlag={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};e.AnnotationMode={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};e.AnnotationEditorPrefix="pdfjs_internal_editor_";e.AnnotationEditorType={DISABLE:-1,NONE:0,FREETEXT:3,INK:15};e.AnnotationEditorParamsType={FREETEXT_SIZE:1,FREETEXT_COLOR:2,FREETEXT_OPACITY:3,INK_COLOR:11,INK_THICKNESS:12,INK_OPACITY:13};e.PermissionFlag={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};e.TextRenderingMode={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};e.ImageKind={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};e.AnnotationType={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26};e.AnnotationStateModelType={MARKED:"Marked",REVIEW:"Review"};e.AnnotationMarkedState={MARKED:"Marked",UNMARKED:"Unmarked"};e.AnnotationReviewState={ACCEPTED:"Accepted",REJECTED:"Rejected",CANCELLED:"Cancelled",COMPLETED:"Completed",NONE:"None"};e.AnnotationReplyType={GROUP:"Group",REPLY:"R"};e.AnnotationFlag={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};e.AnnotationFieldFlag={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};e.AnnotationBorderStyleType={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};e.AnnotationActionEventType={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"};e.DocumentActionEventType={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};e.PageActionEventType={O:"PageOpen",C:"PageClose"};const s={ERRORS:0,WARNINGS:1,INFOS:5};e.VerbosityLevel=s;e.CMapCompressionType={NONE:0,BINARY:1};e.OPS={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};e.UNSUPPORTED_FEATURES={forms:"forms",javaScript:"javaScript",signatures:"signatures",smask:"smask",shadingPattern:"shadingPattern",errorTilingPattern:"errorTilingPattern",errorExtGState:"errorExtGState",errorXObject:"errorXObject",errorFontLoadType3:"errorFontLoadType3",errorFontState:"errorFontState",errorFontMissing:"errorFontMissing",errorFontTranslate:"errorFontTranslate",errorColorSpace:"errorColorSpace",errorOperatorList:"errorOperatorList",errorFontToUnicode:"errorFontToUnicode",errorFontLoadNative:"errorFontLoadNative",errorFontBuildPath:"errorFontBuildPath",errorFontGetPath:"errorFontGetPath",errorMarkedContent:"errorMarkedContent",errorContentSubStream:"errorContentSubStream"};e.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let n=s.WARNINGS;function warn(t){n>=s.WARNINGS&&console.log(`Warning: ${t}`)}function unreachable(t){throw new Error(t)}function shadow(t,e,s,n=!1){Object.defineProperty(t,e,{value:s,enumerable:!n,configurable:!0,writable:!1});return s}const i=function BaseExceptionClosure(){function BaseException(t,e){this.constructor===BaseException&&unreachable("Cannot initialize BaseException.");this.message=t;this.name=e}BaseException.prototype=new Error;BaseException.constructor=BaseException;return BaseException}();e.BaseException=i;e.PasswordException=class PasswordException extends i{constructor(t,e){super(t,"PasswordException");this.code=e}};e.UnknownErrorException=class UnknownErrorException extends i{constructor(t,e){super(t,"UnknownErrorException");this.details=e}};e.InvalidPDFException=class InvalidPDFException extends i{constructor(t){super(t,"InvalidPDFException")}};e.MissingPDFException=class MissingPDFException extends i{constructor(t){super(t,"MissingPDFException")}};e.UnexpectedResponseException=class UnexpectedResponseException extends i{constructor(t,e){super(t,"UnexpectedResponseException");this.status=e}};e.FormatError=class FormatError extends i{constructor(t){super(t,"FormatError")}};e.AbortException=class AbortException extends i{constructor(t){super(t,"AbortException")}};function stringToBytes(t){"string"!=typeof t&&unreachable("Invalid argument for stringToBytes");const e=t.length,s=new Uint8Array(e);for(let n=0;n<e;++n)s[n]=255&t.charCodeAt(n);return s}e.FeatureTest=class FeatureTest{static get isLittleEndian(){return shadow(this,"isLittleEndian",function isLittleEndian(){const t=new Uint8Array(4);t[0]=1;return 1===new Uint32Array(t.buffer,0,1)[0]}())}static get isEvalSupported(){return shadow(this,"isEvalSupported",function isEvalSupported(){try{new Function("");return!0}catch(t){return!1}}())}static get isOffscreenCanvasSupported(){return shadow(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}static get platform(){return"undefined"==typeof navigator?shadow(this,"platform",{isWin:!1,isMac:!1}):shadow(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}};const a=[...Array(256).keys()].map((t=>t.toString(16).padStart(2,"0")));class Util{static makeHexColor(t,e,s){return`#${a[t]}${a[e]}${a[s]}`}static scaleMinMax(t,e){let s;if(t[0]){if(t[0]<0){s=e[0];e[0]=e[1];e[1]=s}e[0]*=t[0];e[1]*=t[0];if(t[3]<0){s=e[2];e[2]=e[3];e[3]=s}e[2]*=t[3];e[3]*=t[3]}else{s=e[0];e[0]=e[2];e[2]=s;s=e[1];e[1]=e[3];e[3]=s;if(t[1]<0){s=e[2];e[2]=e[3];e[3]=s}e[2]*=t[1];e[3]*=t[1];if(t[2]<0){s=e[0];e[0]=e[1];e[1]=s}e[0]*=t[2];e[1]*=t[2]}e[0]+=t[4];e[1]+=t[4];e[2]+=t[5];e[3]+=t[5]}static transform(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}static applyTransform(t,e){return[t[0]*e[0]+t[1]*e[2]+e[4],t[0]*e[1]+t[1]*e[3]+e[5]]}static applyInverseTransform(t,e){const s=e[0]*e[3]-e[1]*e[2];return[(t[0]*e[3]-t[1]*e[2]+e[2]*e[5]-e[4]*e[3])/s,(-t[0]*e[1]+t[1]*e[0]+e[4]*e[1]-e[5]*e[0])/s]}static getAxialAlignedBoundingBox(t,e){const s=Util.applyTransform(t,e),n=Util.applyTransform(t.slice(2,4),e),i=Util.applyTransform([t[0],t[3]],e),a=Util.applyTransform([t[2],t[1]],e);return[Math.min(s[0],n[0],i[0],a[0]),Math.min(s[1],n[1],i[1],a[1]),Math.max(s[0],n[0],i[0],a[0]),Math.max(s[1],n[1],i[1],a[1])]}static inverseTransform(t){const e=t[0]*t[3]-t[1]*t[2];return[t[3]/e,-t[1]/e,-t[2]/e,t[0]/e,(t[2]*t[5]-t[4]*t[3])/e,(t[4]*t[1]-t[5]*t[0])/e]}static singularValueDecompose2dScale(t){const e=[t[0],t[2],t[1],t[3]],s=t[0]*e[0]+t[1]*e[2],n=t[0]*e[1]+t[1]*e[3],i=t[2]*e[0]+t[3]*e[2],a=t[2]*e[1]+t[3]*e[3],r=(s+a)/2,o=Math.sqrt((s+a)**2-4*(s*a-i*n))/2,l=r+o||1,c=r-o||1;return[Math.sqrt(l),Math.sqrt(c)]}static normalizeRect(t){const e=t.slice(0);if(t[0]>t[2]){e[0]=t[2];e[2]=t[0]}if(t[1]>t[3]){e[1]=t[3];e[3]=t[1]}return e}static intersect(t,e){const s=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),n=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(s>n)return null;const i=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),a=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3]));return i>a?null:[s,i,n,a]}static bezierBoundingBox(t,e,s,n,i,a,r,o){const l=[],c=[[],[]];let h,d,u,p,g,f,m,b;for(let c=0;c<2;++c){if(0===c){d=6*t-12*s+6*i;h=-3*t+9*s-9*i+3*r;u=3*s-3*t}else{d=6*e-12*n+6*a;h=-3*e+9*n-9*a+3*o;u=3*n-3*e}if(Math.abs(h)<1e-12){if(Math.abs(d)<1e-12)continue;p=-u/d;0<p&&p<1&&l.push(p)}else{m=d*d-4*u*h;b=Math.sqrt(m);if(!(m<0)){g=(-d+b)/(2*h);0<g&&g<1&&l.push(g);f=(-d-b)/(2*h);0<f&&f<1&&l.push(f)}}}let A,_=l.length;const v=_;for(;_--;){p=l[_];A=1-p;c[0][_]=A*A*A*t+3*A*A*p*s+3*A*p*p*i+p*p*p*r;c[1][_]=A*A*A*e+3*A*A*p*n+3*A*p*p*a+p*p*p*o}c[0][v]=t;c[1][v]=e;c[0][v+1]=r;c[1][v+1]=o;c[0].length=c[1].length=v+2;return[Math.min(...c[0]),Math.min(...c[1]),Math.max(...c[0]),Math.max(...c[1])]}}e.Util=Util;const r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function stringToUTF8String(t){return decodeURIComponent(escape(t))}},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{Object.defineProperty(exports,"__esModule",{value:!0});exports.build=exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0;exports.getDocument=getDocument;exports.version=void 0;var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(3),_display_utils=__w_pdfjs_require__(6),_font_loader=__w_pdfjs_require__(9),_canvas=__w_pdfjs_require__(11),_worker_options=__w_pdfjs_require__(14),_is_node=__w_pdfjs_require__(10),_message_handler=__w_pdfjs_require__(15),_metadata=__w_pdfjs_require__(16),_optional_content_config=__w_pdfjs_require__(17),_transport_stream=__w_pdfjs_require__(18),_xfa_text=__w_pdfjs_require__(19);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100;let DefaultCanvasFactory=_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;let DefaultCMapReaderFactory=_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;let DefaultStandardFontDataFactory=_display_utils.DOMStandardFontDataFactory,createPDFNetworkStream;exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory;if(_is_node.isNodeJS){const{NodeCanvasFactory:t,NodeCMapReaderFactory:e,NodeStandardFontDataFactory:s}=__w_pdfjs_require__(20);exports.DefaultCanvasFactory=DefaultCanvasFactory=t;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory=e;exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory=s}if(_is_node.isNodeJS){const{PDFNodeStream:t}=__w_pdfjs_require__(21);createPDFNetworkStream=e=>new t(e)}else{const{PDFNetworkStream:t}=__w_pdfjs_require__(24),{PDFFetchStream:e}=__w_pdfjs_require__(25);createPDFNetworkStream=s=>(0,_display_utils.isValidFetchUrl)(s.url)?new e(s):new t(s)}function getDocument(t){if("string"==typeof t||t instanceof URL)t={url:t};else if((0,_util.isArrayBuffer)(t))t={data:t};else if(t instanceof PDFDataRangeTransport){(0,_display_utils.deprecated)("`PDFDataRangeTransport`-instance, please use a parameter object with `range`-property instead.");t={range:t}}else if("object"!=typeof t)throw new Error("Invalid parameter in getDocument, need either string, URL, TypedArray, or parameter object.");if(!t.url&&!t.data&&!t.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const e=new PDFDocumentLoadingTask,s=t.url?getUrlProp(t.url):null,n=t.data?getDataProp(t.data):null,i=t.httpHeaders||null,a=!0===t.withCredentials,r=t.password??null,o=t.range instanceof PDFDataRangeTransport?t.range:null,l=Number.isInteger(t.rangeChunkSize)&&t.rangeChunkSize>0?t.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE;let c=t.worker instanceof PDFWorker?t.worker:null;const h=t.verbosity,d="string"!=typeof t.docBaseUrl||(0,_display_utils.isDataScheme)(t.docBaseUrl)?null:t.docBaseUrl,u="string"==typeof t.cMapUrl?t.cMapUrl:null,p=!1!==t.cMapPacked,g=t.CMapReaderFactory||DefaultCMapReaderFactory,f="string"==typeof t.standardFontDataUrl?t.standardFontDataUrl:null,m=t.StandardFontDataFactory||DefaultStandardFontDataFactory,b=!0!==t.stopAtErrors,A=Number.isInteger(t.maxImageSize)&&t.maxImageSize>-1?t.maxImageSize:-1,_=!1!==t.isEvalSupported,v="boolean"==typeof t.isOffscreenCanvasSupported?t.isOffscreenCanvasSupported:!_is_node.isNodeJS,y="boolean"==typeof t.disableFontFace?t.disableFontFace:_is_node.isNodeJS,S=!0===t.fontExtraProperties,x=!0===t.enableXfa,E=t.ownerDocument||globalThis.document,C=!0===t.disableRange,P=!0===t.disableStream,T=!0===t.disableAutoFetch,w=!0===t.pdfBug,k=o?o.length:t.length??NaN,R="boolean"==typeof t.useSystemFonts?t.useSystemFonts:!_is_node.isNodeJS&&!y,M="boolean"==typeof t.useWorkerFetch?t.useWorkerFetch:g===_display_utils.DOMCMapReaderFactory&&m===_display_utils.DOMStandardFontDataFactory&&(0,_display_utils.isValidFetchUrl)(u,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(f,document.baseURI);(0,_util.setVerbosityLevel)(h);const F=M?null:{cMapReaderFactory:new g({baseUrl:u,isCompressed:p}),standardFontDataFactory:new m({baseUrl:f})};if(!c){const t={verbosity:h,port:_worker_options.GlobalWorkerOptions.workerPort};c=t.port?PDFWorker.fromPort(t):new PDFWorker(t);e._worker=c}const D=e.docId,I={docId:D,apiVersion:"3.4.120",data:n,password:r,disableAutoFetch:T,rangeChunkSize:l,length:k,docBaseUrl:d,enableXfa:x,evaluatorOptions:{maxImageSize:A,disableFontFace:y,ignoreErrors:b,isEvalSupported:_,isOffscreenCanvasSupported:v,fontExtraProperties:S,useSystemFonts:R,cMapUrl:M?u:null,standardFontDataUrl:M?f:null}},O={ignoreErrors:b,isEvalSupported:_,disableFontFace:y,fontExtraProperties:S,enableXfa:x,ownerDocument:E,disableAutoFetch:T,pdfBug:w,styleElement:null};c.promise.then((function(){if(e.destroyed)throw new Error("Loading aborted");const t=_fetchDocument(c,I),r=new Promise((function(t){let e;o?e=new _transport_stream.PDFDataTransportStream({length:k,initialData:o.initialData,progressiveDone:o.progressiveDone,contentDispositionFilename:o.contentDispositionFilename,disableRange:C,disableStream:P},o):n||(e=createPDFNetworkStream({url:s,length:k,httpHeaders:i,withCredentials:a,rangeChunkSize:l,disableRange:C,disableStream:P}));t(e)}));return Promise.all([t,r]).then((function([t,s]){if(e.destroyed)throw new Error("Loading aborted");const n=new _message_handler.MessageHandler(D,t,c.port),i=new WorkerTransport(n,e,s,O,F);e._transport=i;n.send("Ready",null)}))})).catch(e._capability.reject);return e}async function _fetchDocument(t,e){if(t.destroyed)throw new Error("Worker was destroyed");const s=await t.messageHandler.sendWithPromise("GetDocRequest",e,e.data?[e.data.buffer]:null);if(t.destroyed)throw new Error("Worker was destroyed");return s}function getUrlProp(t){if(t instanceof URL)return t.href;try{return new URL(t,window.location).href}catch(e){if(_is_node.isNodeJS&&"string"==typeof t)return t}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp(t){if(_is_node.isNodeJS&&"undefined"!=typeof Buffer&&t instanceof Buffer){(0,_display_utils.deprecated)("Please provide binary data as `Uint8Array`, rather than `Buffer`.");return new Uint8Array(t)}if(t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength)return t;if("string"==typeof t)return(0,_util.stringToBytes)(t);if("object"==typeof t&&!isNaN(t?.length)||(0,_util.isArrayBuffer)(t))return new Uint8Array(t);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}class PDFDocumentLoadingTask{static#t=0;#e=null;constructor(){this._capability=(0,_util.createPromiseCapability)();this._transport=null;this._worker=null;this.docId="d"+PDFDocumentLoadingTask.#t++;this.destroyed=!1;this.onPassword=null;this.onProgress=null}get onUnsupportedFeature(){return this.#e}set onUnsupportedFeature(t){(0,_display_utils.deprecated)("The PDFDocumentLoadingTask onUnsupportedFeature property will be removed in the future.");this.#e=t}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;await(this._transport?.destroy());this._transport=null;if(this._worker){this._worker.destroy();this._worker=null}}}exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(t,e,s=!1,n=null){this.length=t;this.initialData=e;this.progressiveDone=s;this.contentDispositionFilename=n;this._rangeListeners=[];this._progressListeners=[];this._progressiveReadListeners=[];this._progressiveDoneListeners=[];this._readyCapability=(0,_util.createPromiseCapability)()}addRangeListener(t){this._rangeListeners.push(t)}addProgressListener(t){this._progressListeners.push(t)}addProgressiveReadListener(t){this._progressiveReadListeners.push(t)}addProgressiveDoneListener(t){this._progressiveDoneListeners.push(t)}onDataRange(t,e){for(const s of this._rangeListeners)s(t,e)}onDataProgress(t,e){this._readyCapability.promise.then((()=>{for(const s of this._progressListeners)s(t,e)}))}onDataProgressiveRead(t){this._readyCapability.promise.then((()=>{for(const e of this._progressiveReadListeners)e(t)}))}onDataProgressiveDone(){this._readyCapability.promise.then((()=>{for(const t of this._progressiveDoneListeners)t()}))}transportReady(){this._readyCapability.resolve()}requestDataRange(t,e){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(t,e){this._pdfInfo=t;this._transport=e}get annotationStorage(){return this._transport.annotationStorage}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJavaScript(){return this._transport.getJavaScript()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(t=!1){return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{constructor(t,e,s,n,i=!1){this._pageIndex=t;this._pageInfo=e;this._ownerDocument=n;this._transport=s;this._stats=i?new _display_utils.StatTimer:null;this._pdfBug=i;this.commonObjs=s.commonObjs;this.objs=new PDFObjects;this.cleanupAfterRender=!1;this.pendingCleanup=!1;this._intentStates=new Map;this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:t,rotation:e=this.rotate,offsetX:s=0,offsetY:n=0,dontFlip:i=!1}={}){return new _display_utils.PageViewport({viewBox:this.view,scale:t,rotation:e,offsetX:s,offsetY:n,dontFlip:i})}getAnnotations({intent:t="display"}={}){const e=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,e.renderingIntent)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:t,viewport:e,intent:s="display",annotationMode:n=_util.AnnotationMode.ENABLE,transform:i=null,canvasFactory:a=null,background:r=null,optionalContentConfigPromise:o=null,annotationCanvasMap:l=null,pageColors:c=null,printAnnotationStorage:h=null}){this._stats?.time("Overall");const d=this._transport.getRenderingIntent(s,n,h);this.pendingCleanup=!1;o||(o=this._transport.getOptionalContentConfig());let u=this._intentStates.get(d.cacheKey);if(!u){u=Object.create(null);this._intentStates.set(d.cacheKey,u)}if(u.streamReaderCancelTimeout){clearTimeout(u.streamReaderCancelTimeout);u.streamReaderCancelTimeout=null}const p=a||new DefaultCanvasFactory({ownerDocument:this._ownerDocument}),g=!!(d.renderingIntent&_util.RenderingIntentFlag.PRINT);if(!u.displayReadyCapability){u.displayReadyCapability=(0,_util.createPromiseCapability)();u.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null};this._stats?.time("Page Request");this._pumpOperatorList(d)}const complete=t=>{u.renderTasks.delete(f);(this.cleanupAfterRender||g)&&(this.pendingCleanup=!0);this._tryCleanup();if(t){f.capability.reject(t);this._abortOperatorList({intentState:u,reason:t instanceof Error?t:new Error(t)})}else f.capability.resolve();this._stats?.timeEnd("Rendering");this._stats?.timeEnd("Overall")},f=new InternalRenderTask({callback:complete,params:{canvasContext:t,viewport:e,transform:i,background:r},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:l,operatorList:u.operatorList,pageIndex:this._pageIndex,canvasFactory:p,useRequestAnimationFrame:!g,pdfBug:this._pdfBug,pageColors:c});(u.renderTasks||=new Set).add(f);const m=f.task;Promise.all([u.displayReadyCapability.promise,o]).then((([t,e])=>{if(this.pendingCleanup)complete();else{this._stats?.time("Rendering");f.initializeGraphics({transparency:t,optionalContentConfig:e});f.operatorListChanged()}})).catch(complete);return m}getOperatorList({intent:t="display",annotationMode:e=_util.AnnotationMode.ENABLE,printAnnotationStorage:s=null}={}){const n=this._transport.getRenderingIntent(t,e,s,!0);let i,a=this._intentStates.get(n.cacheKey);if(!a){a=Object.create(null);this._intentStates.set(n.cacheKey,a)}if(!a.opListReadCapability){i=Object.create(null);i.operatorListChanged=function operatorListChanged(){if(a.operatorList.lastChunk){a.opListReadCapability.resolve(a.operatorList);a.renderTasks.delete(i)}};a.opListReadCapability=(0,_util.createPromiseCapability)();(a.renderTasks||=new Set).add(i);a.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null};this._stats?.time("Page Request");this._pumpOperatorList(n)}return a.opListReadCapability.promise}streamTextContent({disableCombineTextItems:t=!1,includeMarkedContent:e=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,combineTextItems:!0!==t,includeMarkedContent:!0===e},{highWaterMark:100,size:t=>t.items.length})}getTextContent(t={}){if(this._transport._htmlForXfa)return this.getXfa().then((t=>_xfa_text.XfaText.textContent(t)));const e=this.streamTextContent(t);return new Promise((function(t,s){const n=e.getReader(),i={items:[],styles:Object.create(null)};!function pump(){n.read().then((function({value:e,done:s}){if(s)t(i);else{Object.assign(i.styles,e.styles);i.items.push(...e.items);pump()}}),s)}()}))}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const e of this._intentStates.values()){this._abortOperatorList({intentState:e,reason:new Error("Page was destroyed."),force:!0});if(!e.opListReadCapability)for(const s of e.renderTasks){t.push(s.completed);s.cancel()}}this.objs.clear();this.pendingCleanup=!1;return Promise.all(t)}cleanup(t=!1){this.pendingCleanup=!0;return this._tryCleanup(t)}_tryCleanup(t=!1){if(!this.pendingCleanup)return!1;for(const{renderTasks:t,operatorList:e}of this._intentStates.values())if(t.size>0||!e.lastChunk)return!1;this._intentStates.clear();this.objs.clear();t&&this._stats&&(this._stats=new _display_utils.StatTimer);this.pendingCleanup=!1;return!0}_startRenderPage(t,e){const s=this._intentStates.get(e);if(s){this._stats?.timeEnd("Page Request");s.displayReadyCapability?.resolve(t)}}_renderPageChunk(t,e){for(let s=0,n=t.length;s<n;s++){e.operatorList.fnArray.push(t.fnArray[s]);e.operatorList.argsArray.push(t.argsArray[s])}e.operatorList.lastChunk=t.lastChunk;e.operatorList.separateAnnots=t.separateAnnots;for(const t of e.renderTasks)t.operatorListChanged();t.lastChunk&&this._tryCleanup()}_pumpOperatorList({renderingIntent:t,cacheKey:e,annotationStorageMap:s}){const n=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:t,cacheKey:e,annotationStorage:s}).getReader(),i=this._intentStates.get(e);i.streamReader=n;const pump=()=>{n.read().then((({value:t,done:e})=>{if(e)i.streamReader=null;else if(!this._transport.destroyed){this._renderPageChunk(t,i);pump()}}),(t=>{i.streamReader=null;if(!this._transport.destroyed){if(i.operatorList){i.operatorList.lastChunk=!0;for(const t of i.renderTasks)t.operatorListChanged();this._tryCleanup()}if(i.displayReadyCapability)i.displayReadyCapability.reject(t);else{if(!i.opListReadCapability)throw t;i.opListReadCapability.reject(t)}}}))};pump()}_abortOperatorList({intentState:t,reason:e,force:s=!1}){if(t.streamReader){if(t.streamReaderCancelTimeout){clearTimeout(t.streamReaderCancelTimeout);t.streamReaderCancelTimeout=null}if(!s){if(t.renderTasks.size>0)return;if(e instanceof _display_utils.RenderingCancelledException){let s=RENDERING_CANCELLED_TIMEOUT;e.extraDelay>0&&e.extraDelay<1e3&&(s+=e.extraDelay);t.streamReaderCancelTimeout=setTimeout((()=>{t.streamReaderCancelTimeout=null;this._abortOperatorList({intentState:t,reason:e,force:!0})}),s);return}}t.streamReader.cancel(new _util.AbortException(e.message)).catch((()=>{}));t.streamReader=null;if(!this._transport.destroyed){for(const[e,s]of this._intentStates)if(s===t){this._intentStates.delete(e);break}this.cleanup()}}}get stats(){return this._stats}}exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{#s=new Set;#n=Promise.resolve();postMessage(t,e){const s={data:structuredClone(t,e)};this.#n.then((()=>{for(const t of this.#s)t.call(this,s)}))}addEventListener(t,e){this.#s.add(e)}removeEventListener(t,e){this.#s.delete(e)}terminate(){this.#s.clear()}}exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};exports.PDFWorkerUtil=PDFWorkerUtil;if(_is_node.isNodeJS&&"function"==typeof require){PDFWorkerUtil.isWorkerDisabled=!0;PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js"}else if("object"==typeof document){const t=document?.currentScript?.src;t&&(PDFWorkerUtil.fallbackWorkerSrc=t.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(t,e){let s;try{s=new URL(t);if(!s.origin||"null"===s.origin)return!1}catch(t){return!1}const n=new URL(e,s);return s.origin===n.origin};PDFWorkerUtil.createCDNWrapper=function(t){const e=`importScripts("${t}");`;return URL.createObjectURL(new Blob([e]))};class PDFWorker{static#i=new WeakMap;constructor({name:t=null,port:e=null,verbosity:s=(0,_util.getVerbosityLevel)()}={}){if(e&&PDFWorker.#i.has(e))throw new Error("Cannot use more than one PDFWorker per port.");this.name=t;this.destroyed=!1;this.verbosity=s;this._readyCapability=(0,_util.createPromiseCapability)();this._port=null;this._webWorker=null;this._messageHandler=null;if(e){PDFWorker.#i.set(e,this);this._initializeFromPort(e)}else this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(t){this._port=t;this._messageHandler=new _message_handler.MessageHandler("main","worker",t);this._messageHandler.on("ready",(function(){}));this._readyCapability.resolve();this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:t}=PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,t)||(t=PDFWorkerUtil.createCDNWrapper(new URL(t,window.location).href));const e=new Worker(t),s=new _message_handler.MessageHandler("main","worker",e),terminateEarly=()=>{e.removeEventListener("error",onWorkerError);s.destroy();e.terminate();this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},onWorkerError=()=>{this._webWorker||terminateEarly()};e.addEventListener("error",onWorkerError);s.on("test",(t=>{e.removeEventListener("error",onWorkerError);if(this.destroyed)terminateEarly();else if(t){this._messageHandler=s;this._port=e;this._webWorker=e;this._readyCapability.resolve();s.send("configure",{verbosity:this.verbosity})}else{this._setupFakeWorker();s.destroy();e.terminate()}}));s.on("ready",(t=>{e.removeEventListener("error",onWorkerError);if(this.destroyed)terminateEarly();else try{sendTest()}catch(t){this._setupFakeWorker()}}));const sendTest=()=>{const t=new Uint8Array;s.send("test",t,[t.buffer])};sendTest();return}catch(t){(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){if(!PDFWorkerUtil.isWorkerDisabled){(0,_util.warn)("Setting up fake worker.");PDFWorkerUtil.isWorkerDisabled=!0}PDFWorker._setupFakeWorkerGlobal.then((t=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const e=new LoopbackPort;this._port=e;const s="fake"+PDFWorkerUtil.fakeWorkerId++,n=new _message_handler.MessageHandler(s+"_worker",s,e);t.setup(n,e);const i=new _message_handler.MessageHandler(s,s+"_worker",e);this._messageHandler=i;this._readyCapability.resolve();i.send("configure",{verbosity:this.verbosity})})).catch((t=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${t.message}".`))}))}destroy(){this.destroyed=!0;if(this._webWorker){this._webWorker.terminate();this._webWorker=null}PDFWorker.#i.delete(this._port);this._port=null;if(this._messageHandler){this._messageHandler.destroy();this._messageHandler=null}}static fromPort(t){if(!t?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return this.#i.has(t.port)?this.#i.get(t.port):new PDFWorker(t)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(null!==PDFWorkerUtil.fallbackWorkerSrc){_is_node.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.');return PDFWorkerUtil.fallbackWorkerSrc}throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch(t){return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_is_node.isNodeJS&&"function"==typeof require){const worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}await(0,_display_utils.loadScript)(this.workerSrc);return window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}}exports.PDFWorker=PDFWorker;class WorkerTransport{#a=new Map;#r=new Map;#o=new Map;constructor(t,e,s,n,i){this.messageHandler=t;this.loadingTask=e;this.commonObjs=new PDFObjects;this.fontLoader=new _font_loader.FontLoader({onUnsupportedFeature:this._onUnsupportedFeature.bind(this),ownerDocument:n.ownerDocument,styleElement:n.styleElement});this._params=n;this.cMapReaderFactory=i?.cMapReaderFactory;this.standardFontDataFactory=i?.standardFontDataFactory;this.destroyed=!1;this.destroyCapability=null;this._passwordCapability=null;this._networkStream=s;this._fullReader=null;this._lastProgress=null;this.downloadInfoCapability=(0,_util.createPromiseCapability)();this.setupMessageHandler()}#l(t,e=null){const s=this.#a.get(t);if(s)return s;const n=this.messageHandler.sendWithPromise(t,e);this.#a.set(t,n);return n}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}getRenderingIntent(t,e=_util.AnnotationMode.ENABLE,s=null,n=!1){let i=_util.RenderingIntentFlag.DISPLAY,a=null;switch(t){case"any":i=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":i=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${t}`)}switch(e){case _util.AnnotationMode.DISABLE:i+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:i+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:i+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE;a=(i&_util.RenderingIntentFlag.PRINT&&s instanceof _annotation_storage.PrintAnnotationStorage?s:this.annotationStorage).serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${e}`)}n&&(i+=_util.RenderingIntentFlag.OPLIST);return{renderingIntent:i,cacheKey:`${i}_${_annotation_storage.AnnotationStorage.getHash(a)}`,annotationStorageMap:a}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0;this.destroyCapability=(0,_util.createPromiseCapability)();this._passwordCapability&&this._passwordCapability.reject(new Error("Worker was destroyed during onPassword callback"));const t=[];for(const e of this.#r.values())t.push(e._destroy());this.#r.clear();this.#o.clear();this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const e=this.messageHandler.sendWithPromise("Terminate",null);t.push(e);Promise.all(t).then((()=>{this.commonObjs.clear();this.fontLoader.clear();this.#a.clear();this._networkStream&&this._networkStream.cancelAllRequests(new _util.AbortException("Worker was terminated."));if(this.messageHandler){this.messageHandler.destroy();this.messageHandler=null}this.destroyCapability.resolve()}),this.destroyCapability.reject);return this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:t,loadingTask:e}=this;t.on("GetReader",((t,e)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available.");this._fullReader=this._networkStream.getFullReader();this._fullReader.onProgress=t=>{this._lastProgress={loaded:t.loaded,total:t.total}};e.onPull=()=>{this._fullReader.read().then((function({value:t,done:s}){if(s)e.close();else{(0,_util.assert)(t instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer.");e.enqueue(new Uint8Array(t),1,[t])}})).catch((t=>{e.error(t)}))};e.onCancel=t=>{this._fullReader.cancel(t);e.ready.catch((t=>{if(!this.destroyed)throw t}))}}));t.on("ReaderHeadersReady",(t=>{const s=(0,_util.createPromiseCapability)(),n=this._fullReader;n.headersReady.then((()=>{if(!n.isStreamingSupported||!n.isRangeSupported){this._lastProgress&&e.onProgress?.(this._lastProgress);n.onProgress=t=>{e.onProgress?.({loaded:t.loaded,total:t.total})}}s.resolve({isStreamingSupported:n.isStreamingSupported,isRangeSupported:n.isRangeSupported,contentLength:n.contentLength})}),s.reject);return s.promise}));t.on("GetRangeReader",((t,e)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const s=this._networkStream.getRangeReader(t.begin,t.end);if(s){e.onPull=()=>{s.read().then((function({value:t,done:s}){if(s)e.close();else{(0,_util.assert)(t instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer.");e.enqueue(new Uint8Array(t),1,[t])}})).catch((t=>{e.error(t)}))};e.onCancel=t=>{s.cancel(t);e.ready.catch((t=>{if(!this.destroyed)throw t}))}}else e.close()}));t.on("GetDoc",(({pdfInfo:t})=>{this._numPages=t.numPages;this._htmlForXfa=t.htmlForXfa;delete t.htmlForXfa;e._capability.resolve(new PDFDocumentProxy(t,this))}));t.on("DocException",(function(t){let s;switch(t.name){case"PasswordException":s=new _util.PasswordException(t.message,t.code);break;case"InvalidPDFException":s=new _util.InvalidPDFException(t.message);break;case"MissingPDFException":s=new _util.MissingPDFException(t.message);break;case"UnexpectedResponseException":s=new _util.UnexpectedResponseException(t.message,t.status);break;case"UnknownErrorException":s=new _util.UnknownErrorException(t.message,t.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}e._capability.reject(s)}));t.on("PasswordRequest",(t=>{this._passwordCapability=(0,_util.createPromiseCapability)();if(e.onPassword){const updatePassword=t=>{t instanceof Error?this._passwordCapability.reject(t):this._passwordCapability.resolve({password:t})};try{e.onPassword(updatePassword,t.code)}catch(t){this._passwordCapability.reject(t)}}else this._passwordCapability.reject(new _util.PasswordException(t.message,t.code));return this._passwordCapability.promise}));t.on("DataLoaded",(t=>{e.onProgress?.({loaded:t.length,total:t.length});this.downloadInfoCapability.resolve(t)}));t.on("StartRenderPage",(t=>{if(this.destroyed)return;this.#r.get(t.pageIndex)._startRenderPage(t.transparency,t.cacheKey)}));t.on("commonobj",(([e,s,n])=>{if(!this.destroyed&&!this.commonObjs.has(e))switch(s){case"Font":const i=this._params;if("error"in n){const t=n.error;(0,_util.warn)(`Error during font loading: ${t}`);this.commonObjs.resolve(e,t);break}let a=null;i.pdfBug&&globalThis.FontInspector?.enabled&&(a={registerFont(t,e){globalThis.FontInspector.fontAdded(t,e)}});const r=new _font_loader.FontFaceObject(n,{isEvalSupported:i.isEvalSupported,disableFontFace:i.disableFontFace,ignoreErrors:i.ignoreErrors,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),fontRegistry:a});this.fontLoader.bind(r).catch((s=>t.sendWithPromise("FontFallback",{id:e}))).finally((()=>{!i.fontExtraProperties&&r.data&&(r.data=null);this.commonObjs.resolve(e,r)}));break;case"FontPath":case"Image":this.commonObjs.resolve(e,n);break;default:throw new Error(`Got unknown common object type ${s}`)}}));t.on("obj",(([t,e,s,n])=>{if(this.destroyed)return;const i=this.#r.get(e);if(!i.objs.has(t))switch(s){case"Image":i.objs.resolve(t,n);const e=8e6;if(n){let t;if(n.bitmap){const{width:e,height:s}=n;t=e*s*4}else t=n.data?.length||0;t>e&&(i.cleanupAfterRender=!0)}break;case"Pattern":i.objs.resolve(t,n);break;default:throw new Error(`Got unknown object type ${s}`)}}));t.on("DocProgress",(t=>{this.destroyed||e.onProgress?.({loaded:t.loaded,total:t.total})}));t.on("UnsupportedFeature",this._onUnsupportedFeature.bind(this));t.on("FetchBuiltInCMap",(t=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(t):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))));t.on("FetchStandardFontData",(t=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(t):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter."))))}_onUnsupportedFeature({featureId:t}){this.destroyed||this.loadingTask.onUnsupportedFeature?.(t)}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:this.annotationStorage.serializable,filename:this._fullReader?.filename??null}).finally((()=>{this.annotationStorage.resetModified()}))}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));const e=t-1,s=this.#o.get(e);if(s)return s;const n=this.messageHandler.sendWithPromise("GetPage",{pageIndex:e}).then((t=>{if(this.destroyed)throw new Error("Transport destroyed");const s=new PDFPageProxy(e,t,this,this._params.ownerDocument,this._params.pdfBug);this.#r.set(e,s);return s}));this.#o.set(e,n);return n}getPageIndex(t){return"object"!=typeof t||null===t||!Number.isInteger(t.num)||t.num<0||!Number.isInteger(t.gen)||t.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen})}getAnnotations(t,e){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:e})}getFieldObjects(){return this.#l("GetFieldObjects")}hasJSActions(){return this.#l("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return"string"!=typeof t?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getJavaScript(){return this.messageHandler.sendWithPromise("GetJavaScript",null)}getDocJSActions(){return this.messageHandler.sendWithPromise("GetDocJSActions",null)}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then((t=>new _optional_content_config.OptionalContentConfig(t)))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",e=this.#a.get(t);if(e)return e;const s=this.messageHandler.sendWithPromise(t,null).then((t=>({info:t[0],metadata:t[1]?new _metadata.Metadata(t[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null})));this.#a.set(t,s);return s}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(t=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const t of this.#r.values()){if(!t.cleanup())throw new Error(`startCleanup: Page ${t.pageNumber} is currently rendering.`)}this.commonObjs.clear();t||this.fontLoader.clear();this.#a.clear()}}get loadingParams(){const{disableAutoFetch:t,enableXfa:e}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:t,enableXfa:e})}}class PDFObjects{#c=Object.create(null);#h(t){const e=this.#c[t];return e||(this.#c[t]={capability:(0,_util.createPromiseCapability)(),data:null})}get(t,e=null){if(e){const s=this.#h(t);s.capability.promise.then((()=>e(s.data)));return null}const s=this.#c[t];if(!s?.capability.settled)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return s.data}has(t){return this.#c[t]?.capability.settled||!1}resolve(t,e=null){const s=this.#h(t);s.data=e;s.capability.resolve()}clear(){for(const t in this.#c){const{data:e}=this.#c[t];e?.bitmap?.close()}this.#c=Object.create(null)}}class RenderTask{#d=null;constructor(t){this.#d=t;this.onContinue=null}get promise(){return this.#d.capability.promise}cancel(t=0){this.#d.cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=this.#d.operatorList;if(!t)return!1;const{annotationCanvasMap:e}=this.#d;return t.form||t.canvas&&e?.size>0}}exports.RenderTask=RenderTask;class InternalRenderTask{static#u=new WeakSet;constructor({callback:t,params:e,objs:s,commonObjs:n,annotationCanvasMap:i,operatorList:a,pageIndex:r,canvasFactory:o,useRequestAnimationFrame:l=!1,pdfBug:c=!1,pageColors:h=null}){this.callback=t;this.params=e;this.objs=s;this.commonObjs=n;this.annotationCanvasMap=i;this.operatorListIdx=null;this.operatorList=a;this._pageIndex=r;this.canvasFactory=o;this._pdfBug=c;this.pageColors=h;this.running=!1;this.graphicsReadyCallback=null;this.graphicsReady=!1;this._useRequestAnimationFrame=!0===l&&"undefined"!=typeof window;this.cancelled=!1;this.capability=(0,_util.createPromiseCapability)();this.task=new RenderTask(this);this._cancelBound=this.cancel.bind(this);this._continueBound=this._continue.bind(this);this._scheduleNextBound=this._scheduleNext.bind(this);this._nextBound=this._next.bind(this);this._canvas=e.canvasContext.canvas}get completed(){return this.capability.promise.catch((function(){}))}initializeGraphics({transparency:t=!1,optionalContentConfig:e}){if(this.cancelled)return;if(this._canvas){if(InternalRenderTask.#u.has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");InternalRenderTask.#u.add(this._canvas)}if(this._pdfBug&&globalThis.StepperManager?.enabled){this.stepper=globalThis.StepperManager.create(this._pageIndex);this.stepper.init(this.operatorList);this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint()}const{canvasContext:s,viewport:n,transform:i,background:a}=this.params;this.gfx=new _canvas.CanvasGraphics(s,this.commonObjs,this.objs,this.canvasFactory,{optionalContentConfig:e},this.annotationCanvasMap,this.pageColors);this.gfx.beginDrawing({transform:i,viewport:n,transparency:t,background:a});this.operatorListIdx=0;this.graphicsReady=!0;this.graphicsReadyCallback?.()}cancel(t=null,e=0){this.running=!1;this.cancelled=!0;this.gfx?.endDrawing();this._canvas&&InternalRenderTask.#u.delete(this._canvas);this.callback(t||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,"canvas",e))}operatorListChanged(){if(this.graphicsReady){this.stepper?.updateOperatorList(this.operatorList);this.running||this._continue()}else this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound)}_continue(){this.running=!0;this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame((()=>{this._nextBound().catch(this._cancelBound)})):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){if(!this.cancelled){this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper);if(this.operatorListIdx===this.operatorList.argsArray.length){this.running=!1;if(this.operatorList.lastChunk){this.gfx.endDrawing();this._canvas&&InternalRenderTask.#u.delete(this._canvas);this.callback()}}}}}const version="3.4.120";exports.version=version;const build="af6414988";exports.build=build},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.PrintAnnotationStorage=e.AnnotationStorage=void 0;var n=s(1),i=s(4),a=s(8);class AnnotationStorage{#p=!1;#g=new Map;constructor(){this.onSetModified=null;this.onResetModified=null;this.onAnnotationEditor=null}getValue(t,e){const s=this.#g.get(t);return void 0===s?e:Object.assign(e,s)}getRawValue(t){return this.#g.get(t)}remove(t){this.#g.delete(t);0===this.#g.size&&this.resetModified();if("function"==typeof this.onAnnotationEditor){for(const t of this.#g.values())if(t instanceof i.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(t,e){const s=this.#g.get(t);let n=!1;if(void 0!==s){for(const[t,i]of Object.entries(e))if(s[t]!==i){n=!0;s[t]=i}}else{n=!0;this.#g.set(t,e)}n&&this.#f();e instanceof i.AnnotationEditor&&"function"==typeof this.onAnnotationEditor&&this.onAnnotationEditor(e.constructor._type)}has(t){return this.#g.has(t)}getAll(){return this.#g.size>0?(0,n.objectFromMap)(this.#g):null}setAll(t){for(const[e,s]of Object.entries(t))this.setValue(e,s)}get size(){return this.#g.size}#f(){if(!this.#p){this.#p=!0;"function"==typeof this.onSetModified&&this.onSetModified()}}resetModified(){if(this.#p){this.#p=!1;"function"==typeof this.onResetModified&&this.onResetModified()}}get print(){return new PrintAnnotationStorage(this)}get serializable(){if(0===this.#g.size)return null;const t=new Map;for(const[e,s]of this.#g){const n=s instanceof i.AnnotationEditor?s.serialize():s;n&&t.set(e,n)}return t}static getHash(t){if(!t)return"";const e=new a.MurmurHash3_64;for(const[s,n]of t)e.update(`${s}:${JSON.stringify(n)}`);return e.hexdigest()}}e.AnnotationStorage=AnnotationStorage;class PrintAnnotationStorage extends AnnotationStorage{#m=null;constructor(t){super();this.#m=structuredClone(t.serializable)}get print(){(0,n.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#m}}e.PrintAnnotationStorage=PrintAnnotationStorage},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.AnnotationEditor=void 0;var n=s(5),i=s(1);class AnnotationEditor{#b=this.focusin.bind(this);#A=this.focusout.bind(this);#_=!1;#v=!1;#y=!1;_uiManager=null;#S=AnnotationEditor._zIndex++;static _colorManager=new n.ColorManager;static _zIndex=1;constructor(t){this.constructor===AnnotationEditor&&(0,i.unreachable)("Cannot initialize AnnotationEditor.");this.parent=t.parent;this.id=t.id;this.width=this.height=null;this.pageIndex=t.parent.pageIndex;this.name=t.name;this.div=null;this._uiManager=t.uiManager;const{rotation:e,rawDims:{pageWidth:s,pageHeight:n,pageX:a,pageY:r}}=this.parent.viewport;this.rotation=e;this.pageDimensions=[s,n];this.pageTranslation=[a,r];const[o,l]=this.parentDimensions;this.x=t.x/o;this.y=t.y/l;this.isAttachedToDOM=!1}static get _defaultLineColor(){return(0,i.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#S}setParent(t){if(null!==t){this.pageIndex=t.pageIndex;this.pageDimensions=t.pageDimensions}this.parent=t}focusin(t){this.#_?this.#_=!1:this.parent.setSelected(this)}focusout(t){if(!this.isAttachedToDOM)return;if(!t.relatedTarget?.closest(`#${this.id}`)){t.preventDefault();this.parent?.isMultipleSelection||this.commitOrRemove()}}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}dragstart(t){const e=this.parent.div.getBoundingClientRect();this.startX=t.clientX-e.x;this.startY=t.clientY-e.y;t.dataTransfer.setData("text/plain",this.id);t.dataTransfer.effectAllowed="move"}setAt(t,e,s,n){const[i,a]=this.parentDimensions;[s,n]=this.screenToPageTranslation(s,n);this.x=(t+s)/i;this.y=(e+n)/a;this.div.style.left=100*this.x+"%";this.div.style.top=100*this.y+"%"}translate(t,e){const[s,n]=this.parentDimensions;[t,e]=this.screenToPageTranslation(t,e);this.x+=t/s;this.y+=e/n;this.div.style.left=100*this.x+"%";this.div.style.top=100*this.y+"%"}screenToPageTranslation(t,e){switch(this.parentRotation){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return this._uiManager.viewParameters.rotation}get parentDimensions(){const{realScale:t}=this._uiManager.viewParameters,[e,s]=this.pageDimensions;return[e*t,s*t]}setDims(t,e){const[s,n]=this.parentDimensions;this.div.style.width=100*t/s+"%";this.div.style.height=100*e/n+"%"}fixDims(){const{style:t}=this.div,{height:e,width:s}=t,n=s.endsWith("%"),i=e.endsWith("%");if(n&&i)return;const[a,r]=this.parentDimensions;n||(t.width=100*parseFloat(s)/a+"%");i||(t.height=100*parseFloat(e)/r+"%")}getInitialTranslation(){return[0,0]}render(){this.div=document.createElement("div");this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360);this.div.className=this.name;this.div.setAttribute("id",this.id);this.div.setAttribute("tabIndex",0);this.setInForeground();this.div.addEventListener("focusin",this.#b);this.div.addEventListener("focusout",this.#A);const[t,e]=this.getInitialTranslation();this.translate(t,e);(0,n.bindEvents)(this,this.div,["dragstart","pointerdown"]);return this.div}pointerdown(t){const{isMac:e}=i.FeatureTest.platform;if(0!==t.button||t.ctrlKey&&e)t.preventDefault();else{t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this);this.#_=!0}}getRect(t,e){const s=this.parentScale,[n,i]=this.pageDimensions,[a,r]=this.pageTranslation,o=t/s,l=e/s,c=this.x*n,h=this.y*i,d=this.width*n,u=this.height*i;switch(this.rotation){case 0:return[c+o+a,i-h-l-u+r,c+o+d+a,i-h-l+r];case 90:return[c+l+a,i-h+o+r,c+l+u+a,i-h+o+d+r];case 180:return[c-o-d+a,i-h+l+r,c-o+a,i-h+l+u+r];case 270:return[c-l-u+a,i-h-o-d+r,c-l+a,i-h-o+r];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,e){const[s,n,i,a]=t,r=i-s,o=a-n;switch(this.rotation){case 0:return[s,e-a,r,o];case 90:return[s,e-n,o,r];case 180:return[i,e-n,r,o];case 270:return[i,e-a,o,r];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){this.#y=!0}disableEditMode(){this.#y=!1}isInEditMode(){return this.#y}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){this.div?.addEventListener("focusin",this.#b)}serialize(){(0,i.unreachable)("An editor must be serializable")}static deserialize(t,e,s){const n=new this.prototype.constructor({parent:e,id:e.getNextId(),uiManager:s});n.rotation=t.rotation;const[i,a]=n.pageDimensions,[r,o,l,c]=n.getRectInCurrentCoords(t.rect,a);n.x=r/i;n.y=o/a;n.width=l/i;n.height=c/a;return n}remove(){this.div.removeEventListener("focusin",this.#b);this.div.removeEventListener("focusout",this.#A);this.isEmpty()||this.commit();this.parent.remove(this)}select(){this.div?.classList.add("selectedEditor")}unselect(){this.div?.classList.remove("selectedEditor")}updateParams(t,e){}disableEditing(){}enableEditing(){}get propertiesToUpdate(){return{}}get contentDiv(){return this.div}get isEditing(){return this.#v}set isEditing(t){this.#v=t;if(t){this.parent.setSelected(this);this.parent.setActiveEditor(this)}else this.parent.setActiveEditor(null)}}e.AnnotationEditor=AnnotationEditor},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.KeyboardManager=e.CommandManager=e.ColorManager=e.AnnotationEditorUIManager=void 0;e.bindEvents=function bindEvents(t,e,s){for(const n of s)e.addEventListener(n,t[n].bind(t))};e.opacityToHex=function opacityToHex(t){return Math.round(Math.min(255,Math.max(1,255*t))).toString(16).padStart(2,"0")};var n=s(1),i=s(6);class IdManager{#x=0;getId(){return`${n.AnnotationEditorPrefix}${this.#x++}`}}class CommandManager{#E=[];#C=!1;#P;#T=-1;constructor(t=128){this.#P=t}add({cmd:t,undo:e,mustExec:s,type:n=NaN,overwriteIfSameType:i=!1,keepUndo:a=!1}){s&&t();if(this.#C)return;const r={cmd:t,undo:e,type:n};if(-1===this.#T){this.#E.length>0&&(this.#E.length=0);this.#T=0;this.#E.push(r);return}if(i&&this.#E[this.#T].type===n){a&&(r.undo=this.#E[this.#T].undo);this.#E[this.#T]=r;return}const o=this.#T+1;if(o===this.#P)this.#E.splice(0,1);else{this.#T=o;o<this.#E.length&&this.#E.splice(o)}this.#E.push(r)}undo(){if(-1!==this.#T){this.#C=!0;this.#E[this.#T].undo();this.#C=!1;this.#T-=1}}redo(){if(this.#T<this.#E.length-1){this.#T+=1;this.#C=!0;this.#E[this.#T].cmd();this.#C=!1}}hasSomethingToUndo(){return-1!==this.#T}hasSomethingToRedo(){return this.#T<this.#E.length-1}destroy(){this.#E=null}}e.CommandManager=CommandManager;class KeyboardManager{constructor(t){this.buffer=[];this.callbacks=new Map;this.allKeys=new Set;const{isMac:e}=n.FeatureTest.platform;for(const[s,n]of t)for(const t of s){const s=t.startsWith("mac+");if(e&&s){this.callbacks.set(t.slice(4),n);this.allKeys.add(t.split("+").at(-1))}else if(!e&&!s){this.callbacks.set(t,n);this.allKeys.add(t.split("+").at(-1))}}}#w(t){t.altKey&&this.buffer.push("alt");t.ctrlKey&&this.buffer.push("ctrl");t.metaKey&&this.buffer.push("meta");t.shiftKey&&this.buffer.push("shift");this.buffer.push(t.key);const e=this.buffer.join("+");this.buffer.length=0;return e}exec(t,e){if(!this.allKeys.has(e.key))return;const s=this.callbacks.get(this.#w(e));if(s){s.bind(t)();e.stopPropagation();e.preventDefault()}}}e.KeyboardManager=KeyboardManager;class ColorManager{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);(0,i.getColorValues)(t);return(0,n.shadow)(this,"_colors",t)}convert(t){const e=(0,i.getRGB)(t);if(!window.matchMedia("(forced-colors: active)").matches)return e;for(const[t,s]of this._colors)if(s.every(((t,s)=>t===e[s])))return ColorManager._colorsMapping.get(t);return e}getHexCode(t){const e=this._colors.get(t);return e?n.Util.makeHexColor(...e):t}}e.ColorManager=ColorManager;class AnnotationEditorUIManager{#k=null;#R=new Map;#M=new Map;#F=null;#D=new CommandManager;#I=0;#O=null;#L=new Set;#N=null;#j=new IdManager;#U=!1;#B=n.AnnotationEditorType.NONE;#q=new Set;#W=this.copy.bind(this);#H=this.cut.bind(this);#G=this.paste.bind(this);#z=this.keydown.bind(this);#V=this.onEditingAction.bind(this);#X=this.onPageChanging.bind(this);#$=this.onScaleChanging.bind(this);#Y=this.onRotationChanging.bind(this);#K={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1};#J=null;static _keyboardManager=new KeyboardManager([[["ctrl+a","mac+meta+a"],AnnotationEditorUIManager.prototype.selectAll],[["ctrl+z","mac+meta+z"],AnnotationEditorUIManager.prototype.undo],[["ctrl+y","ctrl+shift+Z","mac+meta+shift+Z"],AnnotationEditorUIManager.prototype.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete"],AnnotationEditorUIManager.prototype.delete],[["Escape","mac+Escape"],AnnotationEditorUIManager.prototype.unselectAll]]);constructor(t,e,s){this.#J=t;this.#N=e;this.#N._on("editingaction",this.#V);this.#N._on("pagechanging",this.#X);this.#N._on("scalechanging",this.#$);this.#N._on("rotationchanging",this.#Y);this.#F=s;this.viewParameters={realScale:i.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}destroy(){this.#Q();this.#N._off("editingaction",this.#V);this.#N._off("pagechanging",this.#X);this.#N._off("scalechanging",this.#$);this.#N._off("rotationchanging",this.#Y);for(const t of this.#M.values())t.destroy();this.#M.clear();this.#R.clear();this.#L.clear();this.#k=null;this.#q.clear();this.#D.destroy()}onPageChanging({pageNumber:t}){this.#I=t-1}focusMainContainer(){this.#J.focus()}addShouldRescale(t){this.#L.add(t)}removeShouldRescale(t){this.#L.delete(t)}onScaleChanging({scale:t}){this.commitOrRemove();this.viewParameters.realScale=t*i.PixelsPerInch.PDF_TO_CSS_UNITS;for(const t of this.#L)t.onScaleChanging()}onRotationChanging({pagesRotation:t}){this.commitOrRemove();this.viewParameters.rotation=t}addToAnnotationStorage(t){t.isEmpty()||!this.#F||this.#F.has(t.id)||this.#F.setValue(t.id,t)}#Z(){this.#J.addEventListener("keydown",this.#z)}#Q(){this.#J.removeEventListener("keydown",this.#z)}#tt(){document.addEventListener("copy",this.#W);document.addEventListener("cut",this.#H);document.addEventListener("paste",this.#G)}#et(){document.removeEventListener("copy",this.#W);document.removeEventListener("cut",this.#H);document.removeEventListener("paste",this.#G)}copy(t){t.preventDefault();this.#k&&this.#k.commitOrRemove();if(!this.hasSelection)return;const e=[];for(const t of this.#q)t.isEmpty()||e.push(t.serialize());0!==e.length&&t.clipboardData.setData("application/pdfjs",JSON.stringify(e))}cut(t){this.copy(t);this.delete()}paste(t){t.preventDefault();let e=t.clipboardData.getData("application/pdfjs");if(!e)return;try{e=JSON.parse(e)}catch(t){(0,n.warn)(`paste: "${t.message}".`);return}if(!Array.isArray(e))return;this.unselectAll();const s=this.#M.get(this.#I);try{const t=[];for(const n of e){const e=s.deserialize(n);if(!e)return;t.push(e)}const cmd=()=>{for(const e of t)this.#st(e);this.#nt(t)},undo=()=>{for(const e of t)e.remove()};this.addCommands({cmd:cmd,undo:undo,mustExec:!0})}catch(t){(0,n.warn)(`paste: "${t.message}".`)}}keydown(t){this.getActive()?.shouldGetKeyboardEvents()||AnnotationEditorUIManager._keyboardManager.exec(this,t)}onEditingAction(t){["undo","redo","delete","selectAll"].includes(t.name)&&this[t.name]()}#it(t){Object.entries(t).some((([t,e])=>this.#K[t]!==e))&&this.#N.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#K,t)})}#at(t){this.#N.dispatch("annotationeditorparamschanged",{source:this,details:t})}setEditingState(t){if(t){this.#Z();this.#tt();this.#it({isEditing:this.#B!==n.AnnotationEditorType.NONE,isEmpty:this.#rt(),hasSomethingToUndo:this.#D.hasSomethingToUndo(),hasSomethingToRedo:this.#D.hasSomethingToRedo(),hasSelectedEditor:!1})}else{this.#Q();this.#et();this.#it({isEditing:!1})}}registerEditorTypes(t){if(!this.#O){this.#O=t;for(const t of this.#O)this.#at(t.defaultPropertiesToUpdate)}}getId(){return this.#j.getId()}get currentLayer(){return this.#M.get(this.#I)}get currentPageIndex(){return this.#I}addLayer(t){this.#M.set(t.pageIndex,t);this.#U?t.enable():t.disable()}removeLayer(t){this.#M.delete(t.pageIndex)}updateMode(t){this.#B=t;if(t===n.AnnotationEditorType.NONE){this.setEditingState(!1);this.#ot()}else{this.setEditingState(!0);this.#lt();for(const e of this.#M.values())e.updateMode(t)}}updateToolbar(t){t!==this.#B&&this.#N.dispatch("switchannotationeditormode",{source:this,mode:t})}updateParams(t,e){if(this.#O){for(const s of this.#q)s.updateParams(t,e);for(const s of this.#O)s.updateDefaultParams(t,e)}}#lt(){if(!this.#U){this.#U=!0;for(const t of this.#M.values())t.enable()}}#ot(){this.unselectAll();if(this.#U){this.#U=!1;for(const t of this.#M.values())t.disable()}}getEditors(t){const e=[];for(const s of this.#R.values())s.pageIndex===t&&e.push(s);return e}getEditor(t){return this.#R.get(t)}addEditor(t){this.#R.set(t.id,t)}removeEditor(t){this.#R.delete(t.id);this.unselect(t);this.#F?.remove(t.id)}#st(t){const e=this.#M.get(t.pageIndex);e?e.addOrRebuild(t):this.addEditor(t)}setActiveEditor(t){if(this.#k!==t){this.#k=t;t&&this.#at(t.propertiesToUpdate)}}toggleSelected(t){if(this.#q.has(t)){this.#q.delete(t);t.unselect();this.#it({hasSelectedEditor:this.hasSelection})}else{this.#q.add(t);t.select();this.#at(t.propertiesToUpdate);this.#it({hasSelectedEditor:!0})}}setSelected(t){for(const e of this.#q)e!==t&&e.unselect();this.#q.clear();this.#q.add(t);t.select();this.#at(t.propertiesToUpdate);this.#it({hasSelectedEditor:!0})}isSelected(t){return this.#q.has(t)}unselect(t){t.unselect();this.#q.delete(t);this.#it({hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==this.#q.size}undo(){this.#D.undo();this.#it({hasSomethingToUndo:this.#D.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#rt()})}redo(){this.#D.redo();this.#it({hasSomethingToUndo:!0,hasSomethingToRedo:this.#D.hasSomethingToRedo(),isEmpty:this.#rt()})}addCommands(t){this.#D.add(t);this.#it({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#rt()})}#rt(){if(0===this.#R.size)return!0;if(1===this.#R.size)for(const t of this.#R.values())return t.isEmpty();return!1}delete(){this.commitOrRemove();if(!this.hasSelection)return;const t=[...this.#q];this.addCommands({cmd:()=>{for(const e of t)e.remove()},undo:()=>{for(const e of t)this.#st(e)},mustExec:!0})}commitOrRemove(){this.#k?.commitOrRemove()}#nt(t){this.#q.clear();for(const e of t)if(!e.isEmpty()){this.#q.add(e);e.select()}this.#it({hasSelectedEditor:!0})}selectAll(){for(const t of this.#q)t.commit();this.#nt(this.#R.values())}unselectAll(){if(this.#k)this.#k.commitOrRemove();else if(0!==this.#q.size){for(const t of this.#q)t.unselect();this.#q.clear();this.#it({hasSelectedEditor:!1})}}isActive(t){return this.#k===t}getActive(){return this.#k}getMode(){return this.#B}}e.AnnotationEditorUIManager=AnnotationEditorUIManager},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.StatTimer=e.RenderingCancelledException=e.PixelsPerInch=e.PageViewport=e.PDFDateString=e.DOMStandardFontDataFactory=e.DOMSVGFactory=e.DOMCanvasFactory=e.DOMCMapReaderFactory=e.AnnotationPrefix=void 0;e.deprecated=function deprecated(t){console.log("Deprecated API usage: "+t)};e.getColorValues=function getColorValues(t){const e=document.createElement("span");e.style.visibility="hidden";document.body.append(e);for(const s of t.keys()){e.style.color=s;const n=window.getComputedStyle(e).color;t.set(s,getRGB(n))}e.remove()};e.getCurrentTransform=function getCurrentTransform(t){const{a:e,b:s,c:n,d:i,e:a,f:r}=t.getTransform();return[e,s,n,i,a,r]};e.getCurrentTransformInverse=function getCurrentTransformInverse(t){const{a:e,b:s,c:n,d:i,e:a,f:r}=t.getTransform().invertSelf();return[e,s,n,i,a,r]};e.getFilenameFromUrl=function getFilenameFromUrl(t,e=!1){e||([t]=t.split(/[#?]/,1));return t.substring(t.lastIndexOf("/")+1)};e.getPdfFilenameFromUrl=function getPdfFilenameFromUrl(t,e="document.pdf"){if("string"!=typeof t)return e;if(isDataScheme(t)){(0,i.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.');return e}const s=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,n=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(t);let a=s.exec(n[1])||s.exec(n[2])||s.exec(n[3]);if(a){a=a[0];if(a.includes("%"))try{a=s.exec(decodeURIComponent(a))[0]}catch(t){}}return a||e};e.getRGB=getRGB;e.getXfaPageViewport=function getXfaPageViewport(t,{scale:e=1,rotation:s=0}){const{width:n,height:i}=t.attributes.style,a=[0,0,parseInt(n),parseInt(i)];return new PageViewport({viewBox:a,scale:e,rotation:s})};e.isDataScheme=isDataScheme;e.isPdfFile=function isPdfFile(t){return"string"==typeof t&&/\.pdf$/i.test(t)};e.isValidFetchUrl=isValidFetchUrl;e.loadScript=function loadScript(t,e=!1){return new Promise(((s,n)=>{const i=document.createElement("script");i.src=t;i.onload=function(t){e&&i.remove();s(t)};i.onerror=function(){n(new Error(`Cannot load script at: ${i.src}`))};(document.head||document.documentElement).append(i)}))};e.setLayerDimensions=function setLayerDimensions(t,e,s=!1,n=!0){if(e instanceof PageViewport){const{pageWidth:n,pageHeight:i}=e.rawDims,{style:a}=t,r=`calc(var(--scale-factor) * ${n}px)`,o=`calc(var(--scale-factor) * ${i}px)`;if(s&&e.rotation%180!=0){a.width=o;a.height=r}else{a.width=r;a.height=o}}n&&t.setAttribute("data-main-rotation",e.rotation)};var n=s(7),i=s(1);e.AnnotationPrefix="pdfjs_internal_id_";class PixelsPerInch{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}e.PixelsPerInch=PixelsPerInch;class DOMCanvasFactory extends n.BaseCanvasFactory{constructor({ownerDocument:t=globalThis.document}={}){super();this._document=t}_createCanvas(t,e){const s=this._document.createElement("canvas");s.width=t;s.height=e;return s}}e.DOMCanvasFactory=DOMCanvasFactory;async function fetchData(t,e=!1){if(isValidFetchUrl(t,document.baseURI)){const s=await fetch(t);if(!s.ok)throw new Error(s.statusText);return e?new Uint8Array(await s.arrayBuffer()):(0,i.stringToBytes)(await s.text())}return new Promise(((s,n)=>{const a=new XMLHttpRequest;a.open("GET",t,!0);e&&(a.responseType="arraybuffer");a.onreadystatechange=()=>{if(a.readyState===XMLHttpRequest.DONE){if(200===a.status||0===a.status){let t;e&&a.response?t=new Uint8Array(a.response):!e&&a.responseText&&(t=(0,i.stringToBytes)(a.responseText));if(t){s(t);return}}n(new Error(a.statusText))}};a.send(null)}))}class DOMCMapReaderFactory extends n.BaseCMapReaderFactory{_fetchData(t,e){return fetchData(t,this.isCompressed).then((t=>({cMapData:t,compressionType:e})))}}e.DOMCMapReaderFactory=DOMCMapReaderFactory;class DOMStandardFontDataFactory extends n.BaseStandardFontDataFactory{_fetchData(t){return fetchData(t,!0)}}e.DOMStandardFontDataFactory=DOMStandardFontDataFactory;class DOMSVGFactory extends n.BaseSVGFactory{_createSVG(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}}e.DOMSVGFactory=DOMSVGFactory;class PageViewport{constructor({viewBox:t,scale:e,rotation:s,offsetX:n=0,offsetY:i=0,dontFlip:a=!1}){this.viewBox=t;this.scale=e;this.rotation=s;this.offsetX=n;this.offsetY=i;const r=(t[2]+t[0])/2,o=(t[3]+t[1])/2;let l,c,h,d,u,p,g,f;(s%=360)<0&&(s+=360);switch(s){case 180:l=-1;c=0;h=0;d=1;break;case 90:l=0;c=1;h=1;d=0;break;case 270:l=0;c=-1;h=-1;d=0;break;case 0:l=1;c=0;h=0;d=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}if(a){h=-h;d=-d}if(0===l){u=Math.abs(o-t[1])*e+n;p=Math.abs(r-t[0])*e+i;g=(t[3]-t[1])*e;f=(t[2]-t[0])*e}else{u=Math.abs(r-t[0])*e+n;p=Math.abs(o-t[1])*e+i;g=(t[2]-t[0])*e;f=(t[3]-t[1])*e}this.transform=[l*e,c*e,h*e,d*e,u-l*e*r-h*e*o,p-c*e*r-d*e*o];this.width=g;this.height=f}get rawDims(){const{viewBox:t}=this;return(0,i.shadow)(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone({scale:t=this.scale,rotation:e=this.rotation,offsetX:s=this.offsetX,offsetY:n=this.offsetY,dontFlip:i=!1}={}){return new PageViewport({viewBox:this.viewBox.slice(),scale:t,rotation:e,offsetX:s,offsetY:n,dontFlip:i})}convertToViewportPoint(t,e){return i.Util.applyTransform([t,e],this.transform)}convertToViewportRectangle(t){const e=i.Util.applyTransform([t[0],t[1]],this.transform),s=i.Util.applyTransform([t[2],t[3]],this.transform);return[e[0],e[1],s[0],s[1]]}convertToPdfPoint(t,e){return i.Util.applyInverseTransform([t,e],this.transform)}}e.PageViewport=PageViewport;class RenderingCancelledException extends i.BaseException{constructor(t,e,s=0){super(t,"RenderingCancelledException");this.type=e;this.extraDelay=s}}e.RenderingCancelledException=RenderingCancelledException;function isDataScheme(t){const e=t.length;let s=0;for(;s<e&&""===t[s].trim();)s++;return"data:"===t.substring(s,s+5).toLowerCase()}e.StatTimer=class StatTimer{started=Object.create(null);times=[];time(t){t in this.started&&(0,i.warn)(`Timer is already running for ${t}`);this.started[t]=Date.now()}timeEnd(t){t in this.started||(0,i.warn)(`Timer has not been started for ${t}`);this.times.push({name:t,start:this.started[t],end:Date.now()});delete this.started[t]}toString(){const t=[];let e=0;for(const{name:t}of this.times)e=Math.max(t.length,e);for(const{name:s,start:n,end:i}of this.times)t.push(`${s.padEnd(e)} ${i-n}ms\n`);return t.join("")}};function isValidFetchUrl(t,e){try{const{protocol:s}=e?new URL(t,e):new URL(t);return"http:"===s||"https:"===s}catch(t){return!1}}let a;e.PDFDateString=class PDFDateString{static toDateObject(t){if(!t||"string"!=typeof t)return null;a||(a=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const e=a.exec(t);if(!e)return null;const s=parseInt(e[1],10);let n=parseInt(e[2],10);n=n>=1&&n<=12?n-1:0;let i=parseInt(e[3],10);i=i>=1&&i<=31?i:1;let r=parseInt(e[4],10);r=r>=0&&r<=23?r:0;let o=parseInt(e[5],10);o=o>=0&&o<=59?o:0;let l=parseInt(e[6],10);l=l>=0&&l<=59?l:0;const c=e[7]||"Z";let h=parseInt(e[8],10);h=h>=0&&h<=23?h:0;let d=parseInt(e[9],10)||0;d=d>=0&&d<=59?d:0;if("-"===c){r+=h;o+=d}else if("+"===c){r-=h;o-=d}return new Date(Date.UTC(s,n,i,r,o,l))}};function getRGB(t){if(t.startsWith("#")){const e=parseInt(t.slice(1),16);return[(16711680&e)>>16,(65280&e)>>8,255&e]}if(t.startsWith("rgb("))return t.slice(4,-1).split(",").map((t=>parseInt(t)));if(t.startsWith("rgba("))return t.slice(5,-1).split(",").map((t=>parseInt(t))).slice(0,3);(0,i.warn)(`Not a valid color format: "${t}"`);return[0,0,0]}},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.BaseStandardFontDataFactory=e.BaseSVGFactory=e.BaseCanvasFactory=e.BaseCMapReaderFactory=void 0;var n=s(1);class BaseCanvasFactory{constructor(){this.constructor===BaseCanvasFactory&&(0,n.unreachable)("Cannot initialize BaseCanvasFactory.")}create(t,e){if(t<=0||e<=0)throw new Error("Invalid canvas size");const s=this._createCanvas(t,e);return{canvas:s,context:s.getContext("2d")}}reset(t,e,s){if(!t.canvas)throw new Error("Canvas is not specified");if(e<=0||s<=0)throw new Error("Invalid canvas size");t.canvas.width=e;t.canvas.height=s}destroy(t){if(!t.canvas)throw new Error("Canvas is not specified");t.canvas.width=0;t.canvas.height=0;t.canvas=null;t.context=null}_createCanvas(t,e){(0,n.unreachable)("Abstract method `_createCanvas` called.")}}e.BaseCanvasFactory=BaseCanvasFactory;class BaseCMapReaderFactory{constructor({baseUrl:t=null,isCompressed:e=!0}){this.constructor===BaseCMapReaderFactory&&(0,n.unreachable)("Cannot initialize BaseCMapReaderFactory.");this.baseUrl=t;this.isCompressed=e}async fetch({name:t}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!t)throw new Error("CMap name must be specified.");const e=this.baseUrl+t+(this.isCompressed?".bcmap":""),s=this.isCompressed?n.CMapCompressionType.BINARY:n.CMapCompressionType.NONE;return this._fetchData(e,s).catch((t=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${e}`)}))}_fetchData(t,e){(0,n.unreachable)("Abstract method `_fetchData` called.")}}e.BaseCMapReaderFactory=BaseCMapReaderFactory;class BaseStandardFontDataFactory{constructor({baseUrl:t=null}){this.constructor===BaseStandardFontDataFactory&&(0,n.unreachable)("Cannot initialize BaseStandardFontDataFactory.");this.baseUrl=t}async fetch({filename:t}){if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!t)throw new Error("Font filename must be specified.");const e=`${this.baseUrl}${t}`;return this._fetchData(e).catch((t=>{throw new Error(`Unable to load font data at: ${e}`)}))}_fetchData(t){(0,n.unreachable)("Abstract method `_fetchData` called.")}}e.BaseStandardFontDataFactory=BaseStandardFontDataFactory;class BaseSVGFactory{constructor(){this.constructor===BaseSVGFactory&&(0,n.unreachable)("Cannot initialize BaseSVGFactory.")}create(t,e,s=!1){if(t<=0||e<=0)throw new Error("Invalid SVG dimensions");const n=this._createSVG("svg:svg");n.setAttribute("version","1.1");if(!s){n.setAttribute("width",`${t}px`);n.setAttribute("height",`${e}px`)}n.setAttribute("preserveAspectRatio","none");n.setAttribute("viewBox",`0 0 ${t} ${e}`);return n}createElement(t){if("string"!=typeof t)throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){(0,n.unreachable)("Abstract method `_createSVG` called.")}}e.BaseSVGFactory=BaseSVGFactory},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.MurmurHash3_64=void 0;var n=s(1);const i=3285377520,a=4294901760,r=65535;e.MurmurHash3_64=class MurmurHash3_64{constructor(t){this.h1=t?4294967295&t:i;this.h2=t?4294967295&t:i}update(t){let e,s;if("string"==typeof t){e=new Uint8Array(2*t.length);s=0;for(let n=0,i=t.length;n<i;n++){const i=t.charCodeAt(n);if(i<=255)e[s++]=i;else{e[s++]=i>>>8;e[s++]=255&i}}}else{if(!(0,n.isArrayBuffer)(t))throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");e=t.slice();s=e.byteLength}const i=s>>2,o=s-4*i,l=new Uint32Array(e.buffer,0,i);let c=0,h=0,d=this.h1,u=this.h2;const p=3432918353,g=461845907,f=11601,m=13715;for(let t=0;t<i;t++)if(1&t){c=l[t];c=c*p&a|c*f&r;c=c<<15|c>>>17;c=c*g&a|c*m&r;d^=c;d=d<<13|d>>>19;d=5*d+3864292196}else{h=l[t];h=h*p&a|h*f&r;h=h<<15|h>>>17;h=h*g&a|h*m&r;u^=h;u=u<<13|u>>>19;u=5*u+3864292196}c=0;switch(o){case 3:c^=e[4*i+2]<<16;case 2:c^=e[4*i+1]<<8;case 1:c^=e[4*i];c=c*p&a|c*f&r;c=c<<15|c>>>17;c=c*g&a|c*m&r;1&i?d^=c:u^=c}this.h1=d;this.h2=u}hexdigest(){let t=this.h1,e=this.h2;t^=e>>>1;t=3981806797*t&a|36045*t&r;e=4283543511*e&a|(2950163797*(e<<16|t>>>16)&a)>>>16;t^=e>>>1;t=444984403*t&a|60499*t&r;e=3301882366*e&a|(3120437893*(e<<16|t>>>16)&a)>>>16;t^=e>>>1;return(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.FontLoader=e.FontFaceObject=void 0;var n=s(1),i=s(10);e.FontLoader=class FontLoader{constructor({onUnsupportedFeature:t,ownerDocument:e=globalThis.document,styleElement:s=null}){this._onUnsupportedFeature=t;this._document=e;this.nativeFontFaces=[];this.styleElement=null;this.loadingRequests=[];this.loadTestFontId=0}addNativeFontFace(t){this.nativeFontFaces.push(t);this._document.fonts.add(t)}insertRule(t){if(!this.styleElement){this.styleElement=this._document.createElement("style");this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement)}const e=this.styleElement.sheet;e.insertRule(t,e.cssRules.length)}clear(){for(const t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.length=0;if(this.styleElement){this.styleElement.remove();this.styleElement=null}}async bind(t){if(t.attached||t.missingFile)return;t.attached=!0;if(this.isFontLoadingAPISupported){const e=t.createNativeFontFace();if(e){this.addNativeFontFace(e);try{await e.loaded}catch(s){this._onUnsupportedFeature({featureId:n.UNSUPPORTED_FEATURES.errorFontLoadNative});(0,n.warn)(`Failed to load font '${e.family}': '${s}'.`);t.disableFontFace=!0;throw s}}return}const e=t.createFontFaceRule();if(e){this.insertRule(e);if(this.isSyncFontLoadingSupported)return;await new Promise((e=>{const s=this._queueLoadingCallback(e);this._prepareFontLoadEvent(t,s)}))}}get isFontLoadingAPISupported(){const t=!!this._document?.fonts;return(0,n.shadow)(this,"isFontLoadingAPISupported",t)}get isSyncFontLoadingSupported(){let t=!1;(i.isNodeJS||"undefined"!=typeof navigator&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(t=!0);return(0,n.shadow)(this,"isSyncFontLoadingSupported",t)}_queueLoadingCallback(t){const{loadingRequests:e}=this,s={done:!1,complete:function completeRequest(){(0,n.assert)(!s.done,"completeRequest() cannot be called twice.");s.done=!0;for(;e.length>0&&e[0].done;){const t=e.shift();setTimeout(t.callback,0)}},callback:t};e.push(s);return s}get _loadTestFont(){const t=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,n.shadow)(this,"_loadTestFont",t)}_prepareFontLoadEvent(t,e){function int32(t,e){return t.charCodeAt(e)<<24|t.charCodeAt(e+1)<<16|t.charCodeAt(e+2)<<8|255&t.charCodeAt(e+3)}function spliceString(t,e,s,n){return t.substring(0,e)+n+t.substring(e+s)}let s,i;const a=this._document.createElement("canvas");a.width=1;a.height=1;const r=a.getContext("2d");let o=0;const l=`lt${Date.now()}${this.loadTestFontId++}`;let c=this._loadTestFont;c=spliceString(c,976,l.length,l);const h=1482184792;let d=int32(c,16);for(s=0,i=l.length-3;s<i;s+=4)d=d-h+int32(l,s)|0;s<l.length&&(d=d-h+int32(l+"XXX",s)|0);c=spliceString(c,16,4,(0,n.string32)(d));const u=`@font-face {font-family:"${l}";src:${`url(data:font/opentype;base64,${btoa(c)});`}}`;this.insertRule(u);const p=this._document.createElement("div");p.style.visibility="hidden";p.style.width=p.style.height="10px";p.style.position="absolute";p.style.top=p.style.left="0px";for(const e of[t.loadedName,l]){const t=this._document.createElement("span");t.textContent="Hi";t.style.fontFamily=e;p.append(t)}this._document.body.append(p);!function isFontReady(t,e){if(++o>30){(0,n.warn)("Load test font never loaded.");e();return}r.font="30px "+t;r.fillText(".",0,20);r.getImageData(0,0,1,1).data[3]>0?e():setTimeout(isFontReady.bind(null,t,e))}(l,(()=>{p.remove();e.complete()}))}};e.FontFaceObject=class FontFaceObject{constructor(t,{isEvalSupported:e=!0,disableFontFace:s=!1,ignoreErrors:n=!1,onUnsupportedFeature:i,fontRegistry:a=null}){this.compiledGlyphs=Object.create(null);for(const e in t)this[e]=t[e];this.isEvalSupported=!1!==e;this.disableFontFace=!0===s;this.ignoreErrors=!0===n;this._onUnsupportedFeature=i;this.fontRegistry=a}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let t;if(this.cssFontInfo){const e={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(e.style=`oblique ${this.cssFontInfo.italicAngle}deg`);t=new FontFace(this.cssFontInfo.fontFamily,this.data,e)}else t=new FontFace(this.loadedName,this.data,{});this.fontRegistry?.registerFont(this);return t}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const t=(0,n.bytesToString)(this.data),e=`url(data:${this.mimetype};base64,${btoa(t)});`;let s;if(this.cssFontInfo){let t=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(t+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`);s=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${t}src:${e}}`}else s=`@font-face {font-family:"${this.loadedName}";src:${e}}`;this.fontRegistry?.registerFont(this,e);return s}getPathGenerator(t,e){if(void 0!==this.compiledGlyphs[e])return this.compiledGlyphs[e];let s;try{s=t.get(this.loadedName+"_path_"+e)}catch(t){if(!this.ignoreErrors)throw t;this._onUnsupportedFeature({featureId:n.UNSUPPORTED_FEATURES.errorFontGetPath});(0,n.warn)(`getPathGenerator - ignoring character: "${t}".`);return this.compiledGlyphs[e]=function(t,e){}}if(this.isEvalSupported&&n.FeatureTest.isEvalSupported){const t=[];for(const e of s){const s=void 0!==e.args?e.args.join(","):"";t.push("c.",e.cmd,"(",s,");\n")}return this.compiledGlyphs[e]=new Function("c","size",t.join(""))}return this.compiledGlyphs[e]=function(t,e){for(const n of s){"scale"===n.cmd&&(n.args=[e,-e]);t[n.cmd].apply(t,n.args)}}}}},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0});e.isNodeJS=void 0;const s=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type);e.isNodeJS=s},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.CanvasGraphics=void 0;var n=s(1),i=s(6),a=s(12),r=s(13);const o=4096,l=1e3,c=16;class CachedCanvases{constructor(t){this.canvasFactory=t;this.cache=Object.create(null)}getCanvas(t,e,s){let n;if(void 0!==this.cache[t]){n=this.cache[t];this.canvasFactory.reset(n,e,s)}else{n=this.canvasFactory.create(e,s);this.cache[t]=n}return n}delete(t){delete this.cache[t]}clear(){for(const t in this.cache){const e=this.cache[t];this.canvasFactory.destroy(e);delete this.cache[t]}}}function drawImageAtIntegerCoords(t,e,s,n,a,r,o,l,c,h){const[d,u,p,g,f,m]=(0,i.getCurrentTransform)(t);if(0===u&&0===p){const i=o*d+f,b=Math.round(i),A=l*g+m,_=Math.round(A),v=(o+c)*d+f,y=Math.abs(Math.round(v)-b)||1,S=(l+h)*g+m,x=Math.abs(Math.round(S)-_)||1;t.setTransform(Math.sign(d),0,0,Math.sign(g),b,_);t.drawImage(e,s,n,a,r,0,0,y,x);t.setTransform(d,u,p,g,f,m);return[y,x]}if(0===d&&0===g){const i=l*p+f,b=Math.round(i),A=o*u+m,_=Math.round(A),v=(l+h)*p+f,y=Math.abs(Math.round(v)-b)||1,S=(o+c)*u+m,x=Math.abs(Math.round(S)-_)||1;t.setTransform(0,Math.sign(u),Math.sign(p),0,b,_);t.drawImage(e,s,n,a,r,0,0,x,y);t.setTransform(d,u,p,g,f,m);return[x,y]}t.drawImage(e,s,n,a,r,o,l,c,h);return[Math.hypot(d,u)*c,Math.hypot(p,g)*h]}class CanvasExtraState{constructor(t,e){this.alphaIsShape=!1;this.fontSize=0;this.fontSizeScale=1;this.textMatrix=n.IDENTITY_MATRIX;this.textMatrixScale=1;this.fontMatrix=n.FONT_IDENTITY_MATRIX;this.leading=0;this.x=0;this.y=0;this.lineX=0;this.lineY=0;this.charSpacing=0;this.wordSpacing=0;this.textHScale=1;this.textRenderingMode=n.TextRenderingMode.FILL;this.textRise=0;this.fillColor="#000000";this.strokeColor="#000000";this.patternFill=!1;this.fillAlpha=1;this.strokeAlpha=1;this.lineWidth=1;this.activeSMask=null;this.transferMaps=null;this.startNewPathAndClipBox([0,0,t,e])}clone(){const t=Object.create(this);t.clipBox=this.clipBox.slice();return t}setCurrentPoint(t,e){this.x=t;this.y=e}updatePathMinMax(t,e,s){[e,s]=n.Util.applyTransform([e,s],t);this.minX=Math.min(this.minX,e);this.minY=Math.min(this.minY,s);this.maxX=Math.max(this.maxX,e);this.maxY=Math.max(this.maxY,s)}updateRectMinMax(t,e){const s=n.Util.applyTransform(e,t),i=n.Util.applyTransform(e.slice(2),t);this.minX=Math.min(this.minX,s[0],i[0]);this.minY=Math.min(this.minY,s[1],i[1]);this.maxX=Math.max(this.maxX,s[0],i[0]);this.maxY=Math.max(this.maxY,s[1],i[1])}updateScalingPathMinMax(t,e){n.Util.scaleMinMax(t,e);this.minX=Math.min(this.minX,e[0]);this.maxX=Math.max(this.maxX,e[1]);this.minY=Math.min(this.minY,e[2]);this.maxY=Math.max(this.maxY,e[3])}updateCurvePathMinMax(t,e,s,i,a,r,o,l,c,h){const d=n.Util.bezierBoundingBox(e,s,i,a,r,o,l,c);if(h){h[0]=Math.min(h[0],d[0],d[2]);h[1]=Math.max(h[1],d[0],d[2]);h[2]=Math.min(h[2],d[1],d[3]);h[3]=Math.max(h[3],d[1],d[3])}else this.updateRectMinMax(t,d)}getPathBoundingBox(t=a.PathType.FILL,e=null){const s=[this.minX,this.minY,this.maxX,this.maxY];if(t===a.PathType.STROKE){e||(0,n.unreachable)("Stroke bounding box must include transform.");const t=n.Util.singularValueDecompose2dScale(e),i=t[0]*this.lineWidth/2,a=t[1]*this.lineWidth/2;s[0]-=i;s[1]-=a;s[2]+=i;s[3]+=a}return s}updateClipFromPath(){const t=n.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(t){this.clipBox=t;this.minX=1/0;this.minY=1/0;this.maxX=0;this.maxY=0}getClippedPathBoundingBox(t=a.PathType.FILL,e=null){return n.Util.intersect(this.clipBox,this.getPathBoundingBox(t,e))}}function putBinaryImageData(t,e,s=null){if("undefined"!=typeof ImageData&&e instanceof ImageData){t.putImageData(e,0,0);return}const i=e.height,a=e.width,r=i%c,o=(i-r)/c,l=0===r?o:o+1,h=t.createImageData(a,c);let d,u=0;const p=e.data,g=h.data;let f,m,b,A,_,v,y,S;if(s)switch(s.length){case 1:_=s[0];v=s[0];y=s[0];S=s[0];break;case 4:_=s[0];v=s[1];y=s[2];S=s[3]}if(e.kind===n.ImageKind.GRAYSCALE_1BPP){const e=p.byteLength,s=new Uint32Array(g.buffer,0,g.byteLength>>2),i=s.length,A=a+7>>3;let _=4294967295,v=n.FeatureTest.isLittleEndian?4278190080:255;S&&255===S[0]&&0===S[255]&&([_,v]=[v,_]);for(f=0;f<l;f++){b=f<o?c:r;d=0;for(m=0;m<b;m++){const t=e-u;let n=0;const i=t>A?a:8*t-7,r=-8&i;let o=0,l=0;for(;n<r;n+=8){l=p[u++];s[d++]=128&l?_:v;s[d++]=64&l?_:v;s[d++]=32&l?_:v;s[d++]=16&l?_:v;s[d++]=8&l?_:v;s[d++]=4&l?_:v;s[d++]=2&l?_:v;s[d++]=1&l?_:v}for(;n<i;n++){if(0===o){l=p[u++];o=128}s[d++]=l&o?_:v;o>>=1}}for(;d<i;)s[d++]=0;t.putImageData(h,0,f*c)}}else if(e.kind===n.ImageKind.RGBA_32BPP){const e=!!(_||v||y);m=0;A=a*c*4;for(f=0;f<o;f++){g.set(p.subarray(u,u+A));u+=A;if(e)for(let t=0;t<A;t+=4){_&&(g[t+0]=_[g[t+0]]);v&&(g[t+1]=v[g[t+1]]);y&&(g[t+2]=y[g[t+2]])}t.putImageData(h,0,m);m+=c}if(f<l){A=a*r*4;g.set(p.subarray(u,u+A));if(e)for(let t=0;t<A;t+=4){_&&(g[t+0]=_[g[t+0]]);v&&(g[t+1]=v[g[t+1]]);y&&(g[t+2]=y[g[t+2]])}t.putImageData(h,0,m)}}else{if(e.kind!==n.ImageKind.RGB_24BPP)throw new Error(`bad image kind: ${e.kind}`);{const e=!!(_||v||y);b=c;A=a*b;for(f=0;f<l;f++){if(f>=o){b=r;A=a*b}d=0;for(m=A;m--;){g[d++]=p[u++];g[d++]=p[u++];g[d++]=p[u++];g[d++]=255}if(e)for(let t=0;t<d;t+=4){_&&(g[t+0]=_[g[t+0]]);v&&(g[t+1]=v[g[t+1]]);y&&(g[t+2]=y[g[t+2]])}t.putImageData(h,0,f*c)}}}}function putBinaryImageMask(t,e){if(e.bitmap){t.drawImage(e.bitmap,0,0);return}const s=e.height,n=e.width,i=s%c,a=(s-i)/c,o=0===i?a:a+1,l=t.createImageData(n,c);let h=0;const d=e.data,u=l.data;for(let e=0;e<o;e++){const s=e<a?c:i;({srcPos:h}=(0,r.applyMaskImageData)({src:d,srcPos:h,dest:u,width:n,height:s}));t.putImageData(l,0,e*c)}}function copyCtxState(t,e){const s=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font"];for(const n of s)void 0!==t[n]&&(e[n]=t[n]);if(void 0!==t.setLineDash){e.setLineDash(t.getLineDash());e.lineDashOffset=t.lineDashOffset}}function resetCtxToDefault(t,e){t.strokeStyle=t.fillStyle=e||"#000000";t.fillRule="nonzero";t.globalAlpha=1;t.lineWidth=1;t.lineCap="butt";t.lineJoin="miter";t.miterLimit=10;t.globalCompositeOperation="source-over";t.font="10px sans-serif";if(void 0!==t.setLineDash){t.setLineDash([]);t.lineDashOffset=0}}function composeSMaskBackdrop(t,e,s,n){const i=t.length;for(let a=3;a<i;a+=4){const i=t[a];if(0===i){t[a-3]=e;t[a-2]=s;t[a-1]=n}else if(i<255){const r=255-i;t[a-3]=t[a-3]*i+e*r>>8;t[a-2]=t[a-2]*i+s*r>>8;t[a-1]=t[a-1]*i+n*r>>8}}}function composeSMaskAlpha(t,e,s){const n=t.length;for(let i=3;i<n;i+=4){const n=s?s[t[i]]:t[i];e[i]=e[i]*n*.00392156862745098|0}}function composeSMaskLuminosity(t,e,s){const n=t.length;for(let i=3;i<n;i+=4){const n=77*t[i-3]+152*t[i-2]+28*t[i-1];e[i]=s?e[i]*s[n>>8]>>8:e[i]*n>>16}}function composeSMask(t,e,s,n){const i=n[0],a=n[1],r=n[2]-i,o=n[3]-a;if(0!==r&&0!==o){!function genericComposeSMask(t,e,s,n,i,a,r,o,l,c,h){const d=!!a,u=d?a[0]:0,p=d?a[1]:0,g=d?a[2]:0;let f;f="Luminosity"===i?composeSMaskLuminosity:composeSMaskAlpha;const m=Math.min(n,Math.ceil(1048576/s));for(let i=0;i<n;i+=m){const a=Math.min(m,n-i),b=t.getImageData(o-c,i+(l-h),s,a),A=e.getImageData(o,i+l,s,a);d&&composeSMaskBackdrop(b.data,u,p,g);f(b.data,A.data,r);e.putImageData(A,o,i+l)}}(e.context,s,r,o,e.subtype,e.backdrop,e.transferMap,i,a,e.offsetX,e.offsetY);t.save();t.globalAlpha=1;t.globalCompositeOperation="source-over";t.setTransform(1,0,0,1,0,0);t.drawImage(s.canvas,0,0);t.restore()}}function getImageSmoothingEnabled(t,e){const s=n.Util.singularValueDecompose2dScale(t);s[0]=Math.fround(s[0]);s[1]=Math.fround(s[1]);const a=Math.fround((globalThis.devicePixelRatio||1)*i.PixelsPerInch.PDF_TO_CSS_UNITS);return void 0!==e?e:s[0]<=a||s[1]<=a}const h=["butt","round","square"],d=["miter","round","bevel"],u={},p={};class CanvasGraphics{constructor(t,e,s,n,{optionalContentConfig:i,markedContentStack:a=null},r,o){this.ctx=t;this.current=new CanvasExtraState(this.ctx.canvas.width,this.ctx.canvas.height);this.stateStack=[];this.pendingClip=null;this.pendingEOFill=!1;this.res=null;this.xobjs=null;this.commonObjs=e;this.objs=s;this.canvasFactory=n;this.groupStack=[];this.processingType3=null;this.baseTransform=null;this.baseTransformStack=[];this.groupLevel=0;this.smaskStack=[];this.smaskCounter=0;this.tempSMask=null;this.suspendedCtx=null;this.contentVisible=!0;this.markedContentStack=a||[];this.optionalContentConfig=i;this.cachedCanvases=new CachedCanvases(this.canvasFactory);this.cachedPatterns=new Map;this.annotationCanvasMap=r;this.viewportScale=1;this.outputScaleX=1;this.outputScaleY=1;this.backgroundColor=o?.background||null;this.foregroundColor=o?.foreground||null;this._cachedScaleForStroking=null;this._cachedGetSinglePixelWidth=null;this._cachedBitmapsMap=new Map}getObject(t,e=null){return"string"==typeof t?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):e}beginDrawing({transform:t,viewport:e,transparency:s=!1,background:n=null}){const a=this.ctx.canvas.width,r=this.ctx.canvas.height,o=n||"#ffffff";this.ctx.save();if(this.foregroundColor&&this.backgroundColor){this.ctx.fillStyle=this.foregroundColor;const t=this.foregroundColor=this.ctx.fillStyle;this.ctx.fillStyle=this.backgroundColor;const e=this.backgroundColor=this.ctx.fillStyle;let s=!0,n=o;this.ctx.fillStyle=o;n=this.ctx.fillStyle;s="string"==typeof n&&/^#[0-9A-Fa-f]{6}$/.test(n);if("#000000"===t&&"#ffffff"===e||t===e||!s)this.foregroundColor=this.backgroundColor=null;else{const[s,a,r]=(0,i.getRGB)(n),newComp=t=>(t/=255)<=.03928?t/12.92:((t+.055)/1.055)**2.4,o=Math.round(.2126*newComp(s)+.7152*newComp(a)+.0722*newComp(r));this.selectColor=(s,n,i)=>{const a=.2126*newComp(s)+.7152*newComp(n)+.0722*newComp(i);return Math.round(a)===o?e:t}}}this.ctx.fillStyle=this.backgroundColor||o;this.ctx.fillRect(0,0,a,r);this.ctx.restore();if(s){const t=this.cachedCanvases.getCanvas("transparent",a,r);this.compositeCtx=this.ctx;this.transparentCanvas=t.canvas;this.ctx=t.context;this.ctx.save();this.ctx.transform(...(0,i.getCurrentTransform)(this.compositeCtx))}this.ctx.save();resetCtxToDefault(this.ctx,this.foregroundColor);if(t){this.ctx.transform(...t);this.outputScaleX=t[0];this.outputScaleY=t[0]}this.ctx.transform(...e.transform);this.viewportScale=e.scale;this.baseTransform=(0,i.getCurrentTransform)(this.ctx)}executeOperatorList(t,e,s,i){const a=t.argsArray,r=t.fnArray;let o=e||0;const l=a.length;if(l===o)return o;const c=l-o>10&&"function"==typeof s,h=c?Date.now()+15:0;let d=0;const u=this.commonObjs,p=this.objs;let g;for(;;){if(void 0!==i&&o===i.nextBreakPoint){i.breakIt(o,s);return o}g=r[o];if(g!==n.OPS.dependency)this[g].apply(this,a[o]);else for(const t of a[o]){const e=t.startsWith("g_")?u:p;if(!e.has(t)){e.get(t,s);return o}}o++;if(o===l)return o;if(c&&++d>10){if(Date.now()>h){s();return o}d=0}}}#ct(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore();if(this.transparentCanvas){this.ctx=this.compositeCtx;this.ctx.save();this.ctx.setTransform(1,0,0,1,0,0);this.ctx.drawImage(this.transparentCanvas,0,0);this.ctx.restore();this.transparentCanvas=null}}endDrawing(){this.#ct();this.cachedCanvases.clear();this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const e of t.values())"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement&&(e.width=e.height=0);t.clear()}this._cachedBitmapsMap.clear()}_scaleImage(t,e){const s=t.width,n=t.height;let i,a,r=Math.max(Math.hypot(e[0],e[1]),1),o=Math.max(Math.hypot(e[2],e[3]),1),l=s,c=n,h="prescale1";for(;r>2&&l>1||o>2&&c>1;){let e=l,s=c;if(r>2&&l>1){e=Math.ceil(l/2);r/=l/e}if(o>2&&c>1){s=Math.ceil(c/2);o/=c/s}i=this.cachedCanvases.getCanvas(h,e,s);a=i.context;a.clearRect(0,0,e,s);a.drawImage(t,0,0,l,c,0,0,e,s);t=i.canvas;l=e;c=s;h="prescale1"===h?"prescale2":"prescale1"}return{img:t,paintWidth:l,paintHeight:c}}_createMaskCanvas(t){const e=this.ctx,{width:s,height:r}=t,o=this.current.fillColor,l=this.current.patternFill,c=(0,i.getCurrentTransform)(e);let h,d,u,p;if((t.bitmap||t.data)&&t.count>1){const e=t.bitmap||t.data.buffer;d=JSON.stringify(l?c:[c.slice(0,4),o]);h=this._cachedBitmapsMap.get(e);if(!h){h=new Map;this._cachedBitmapsMap.set(e,h)}const s=h.get(d);if(s&&!l){return{canvas:s,offsetX:Math.round(Math.min(c[0],c[2])+c[4]),offsetY:Math.round(Math.min(c[1],c[3])+c[5])}}u=s}if(!u){p=this.cachedCanvases.getCanvas("maskCanvas",s,r);putBinaryImageMask(p.context,t)}let g=n.Util.transform(c,[1/s,0,0,-1/r,0,0]);g=n.Util.transform(g,[1,0,0,1,0,-r]);const f=n.Util.applyTransform([0,0],g),m=n.Util.applyTransform([s,r],g),b=n.Util.normalizeRect([f[0],f[1],m[0],m[1]]),A=Math.round(b[2]-b[0])||1,_=Math.round(b[3]-b[1])||1,v=this.cachedCanvases.getCanvas("fillCanvas",A,_),y=v.context,S=Math.min(f[0],m[0]),x=Math.min(f[1],m[1]);y.translate(-S,-x);y.transform(...g);if(!u){u=this._scaleImage(p.canvas,(0,i.getCurrentTransformInverse)(y));u=u.img;h&&l&&h.set(d,u)}y.imageSmoothingEnabled=getImageSmoothingEnabled((0,i.getCurrentTransform)(y),t.interpolate);drawImageAtIntegerCoords(y,u,0,0,u.width,u.height,0,0,s,r);y.globalCompositeOperation="source-in";const E=n.Util.transform((0,i.getCurrentTransformInverse)(y),[1,0,0,1,-S,-x]);y.fillStyle=l?o.getPattern(e,this,E,a.PathType.FILL):o;y.fillRect(0,0,s,r);if(h&&!l){this.cachedCanvases.delete("fillCanvas");h.set(d,v.canvas)}return{canvas:v.canvas,offsetX:Math.round(S),offsetY:Math.round(x)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking=null);this.current.lineWidth=t;this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=h[t]}setLineJoin(t){this.ctx.lineJoin=d[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,e){const s=this.ctx;if(void 0!==s.setLineDash){s.setLineDash(t);s.lineDashOffset=e}}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[e,s]of t)switch(e){case"LW":this.setLineWidth(s);break;case"LC":this.setLineCap(s);break;case"LJ":this.setLineJoin(s);break;case"ML":this.setMiterLimit(s);break;case"D":this.setDash(s[0],s[1]);break;case"RI":this.setRenderingIntent(s);break;case"FL":this.setFlatness(s);break;case"Font":this.setFont(s[0],s[1]);break;case"CA":this.current.strokeAlpha=s;break;case"ca":this.current.fillAlpha=s;this.ctx.globalAlpha=s;break;case"BM":this.ctx.globalCompositeOperation=s;break;case"SMask":this.current.activeSMask=s?this.tempSMask:null;this.tempSMask=null;this.checkSMaskState();break;case"TR":this.current.transferMaps=s}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const t=this.ctx.canvas.width,e=this.ctx.canvas.height,s="smaskGroupAt"+this.groupLevel,n=this.cachedCanvases.getCanvas(s,t,e);this.suspendedCtx=this.ctx;this.ctx=n.context;const a=this.ctx;a.setTransform(...(0,i.getCurrentTransform)(this.suspendedCtx));copyCtxState(this.suspendedCtx,a);!function mirrorContextOperations(t,e){if(t._removeMirroring)throw new Error("Context is already forwarding operations.");t.__originalSave=t.save;t.__originalRestore=t.restore;t.__originalRotate=t.rotate;t.__originalScale=t.scale;t.__originalTranslate=t.translate;t.__originalTransform=t.transform;t.__originalSetTransform=t.setTransform;t.__originalResetTransform=t.resetTransform;t.__originalClip=t.clip;t.__originalMoveTo=t.moveTo;t.__originalLineTo=t.lineTo;t.__originalBezierCurveTo=t.bezierCurveTo;t.__originalRect=t.rect;t.__originalClosePath=t.closePath;t.__originalBeginPath=t.beginPath;t._removeMirroring=()=>{t.save=t.__originalSave;t.restore=t.__originalRestore;t.rotate=t.__originalRotate;t.scale=t.__originalScale;t.translate=t.__originalTranslate;t.transform=t.__originalTransform;t.setTransform=t.__originalSetTransform;t.resetTransform=t.__originalResetTransform;t.clip=t.__originalClip;t.moveTo=t.__originalMoveTo;t.lineTo=t.__originalLineTo;t.bezierCurveTo=t.__originalBezierCurveTo;t.rect=t.__originalRect;t.closePath=t.__originalClosePath;t.beginPath=t.__originalBeginPath;delete t._removeMirroring};t.save=function ctxSave(){e.save();this.__originalSave()};t.restore=function ctxRestore(){e.restore();this.__originalRestore()};t.translate=function ctxTranslate(t,s){e.translate(t,s);this.__originalTranslate(t,s)};t.scale=function ctxScale(t,s){e.scale(t,s);this.__originalScale(t,s)};t.transform=function ctxTransform(t,s,n,i,a,r){e.transform(t,s,n,i,a,r);this.__originalTransform(t,s,n,i,a,r)};t.setTransform=function ctxSetTransform(t,s,n,i,a,r){e.setTransform(t,s,n,i,a,r);this.__originalSetTransform(t,s,n,i,a,r)};t.resetTransform=function ctxResetTransform(){e.resetTransform();this.__originalResetTransform()};t.rotate=function ctxRotate(t){e.rotate(t);this.__originalRotate(t)};t.clip=function ctxRotate(t){e.clip(t);this.__originalClip(t)};t.moveTo=function(t,s){e.moveTo(t,s);this.__originalMoveTo(t,s)};t.lineTo=function(t,s){e.lineTo(t,s);this.__originalLineTo(t,s)};t.bezierCurveTo=function(t,s,n,i,a,r){e.bezierCurveTo(t,s,n,i,a,r);this.__originalBezierCurveTo(t,s,n,i,a,r)};t.rect=function(t,s,n,i){e.rect(t,s,n,i);this.__originalRect(t,s,n,i)};t.closePath=function(){e.closePath();this.__originalClosePath()};t.beginPath=function(){e.beginPath();this.__originalBeginPath()}}(a,this.suspendedCtx);this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring();copyCtxState(this.ctx,this.suspendedCtx);this.ctx=this.suspendedCtx;this.suspendedCtx=null}compose(t){if(!this.current.activeSMask)return;if(t){t[0]=Math.floor(t[0]);t[1]=Math.floor(t[1]);t[2]=Math.ceil(t[2]);t[3]=Math.ceil(t[3])}else t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const e=this.current.activeSMask;composeSMask(this.suspendedCtx,e,this.ctx,t);this.ctx.save();this.ctx.setTransform(1,0,0,1,0,0);this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height);this.ctx.restore()}save(){if(this.inSMaskMode){copyCtxState(this.ctx,this.suspendedCtx);this.suspendedCtx.save()}else this.ctx.save();const t=this.current;this.stateStack.push(t);this.current=t.clone()}restore(){0===this.stateStack.length&&this.inSMaskMode&&this.endSMaskMode();if(0!==this.stateStack.length){this.current=this.stateStack.pop();if(this.inSMaskMode){this.suspendedCtx.restore();copyCtxState(this.suspendedCtx,this.ctx)}else this.ctx.restore();this.checkSMaskState();this.pendingClip=null;this._cachedScaleForStroking=null;this._cachedGetSinglePixelWidth=null}}transform(t,e,s,n,i,a){this.ctx.transform(t,e,s,n,i,a);this._cachedScaleForStroking=null;this._cachedGetSinglePixelWidth=null}constructPath(t,e,s){const a=this.ctx,r=this.current;let o,l,c=r.x,h=r.y;const d=(0,i.getCurrentTransform)(a),u=0===d[0]&&0===d[3]||0===d[1]&&0===d[2],p=u?s.slice(0):null;for(let s=0,i=0,g=t.length;s<g;s++)switch(0|t[s]){case n.OPS.rectangle:c=e[i++];h=e[i++];const t=e[i++],s=e[i++],g=c+t,f=h+s;a.moveTo(c,h);if(0===t||0===s)a.lineTo(g,f);else{a.lineTo(g,h);a.lineTo(g,f);a.lineTo(c,f)}u||r.updateRectMinMax(d,[c,h,g,f]);a.closePath();break;case n.OPS.moveTo:c=e[i++];h=e[i++];a.moveTo(c,h);u||r.updatePathMinMax(d,c,h);break;case n.OPS.lineTo:c=e[i++];h=e[i++];a.lineTo(c,h);u||r.updatePathMinMax(d,c,h);break;case n.OPS.curveTo:o=c;l=h;c=e[i+4];h=e[i+5];a.bezierCurveTo(e[i],e[i+1],e[i+2],e[i+3],c,h);r.updateCurvePathMinMax(d,o,l,e[i],e[i+1],e[i+2],e[i+3],c,h,p);i+=6;break;case n.OPS.curveTo2:o=c;l=h;a.bezierCurveTo(c,h,e[i],e[i+1],e[i+2],e[i+3]);r.updateCurvePathMinMax(d,o,l,c,h,e[i],e[i+1],e[i+2],e[i+3],p);c=e[i+2];h=e[i+3];i+=4;break;case n.OPS.curveTo3:o=c;l=h;c=e[i+2];h=e[i+3];a.bezierCurveTo(e[i],e[i+1],c,h,c,h);r.updateCurvePathMinMax(d,o,l,e[i],e[i+1],c,h,c,h,p);i+=4;break;case n.OPS.closePath:a.closePath()}u&&r.updateScalingPathMinMax(d,p);r.setCurrentPoint(c,h)}closePath(){this.ctx.closePath()}stroke(t=!0){const e=this.ctx,s=this.current.strokeColor;e.globalAlpha=this.current.strokeAlpha;if(this.contentVisible)if("object"==typeof s&&s?.getPattern){e.save();e.strokeStyle=s.getPattern(e,this,(0,i.getCurrentTransformInverse)(e),a.PathType.STROKE);this.rescaleAndStroke(!1);e.restore()}else this.rescaleAndStroke(!0);t&&this.consumePath(this.current.getClippedPathBoundingBox());e.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath();this.stroke()}fill(t=!0){const e=this.ctx,s=this.current.fillColor;let n=!1;if(this.current.patternFill){e.save();e.fillStyle=s.getPattern(e,this,(0,i.getCurrentTransformInverse)(e),a.PathType.FILL);n=!0}const r=this.current.getClippedPathBoundingBox();if(this.contentVisible&&null!==r)if(this.pendingEOFill){e.fill("evenodd");this.pendingEOFill=!1}else e.fill();n&&e.restore();t&&this.consumePath(r)}eoFill(){this.pendingEOFill=!0;this.fill()}fillStroke(){this.fill(!1);this.stroke(!1);this.consumePath()}eoFillStroke(){this.pendingEOFill=!0;this.fillStroke()}closeFillStroke(){this.closePath();this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0;this.closePath();this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=u}eoClip(){this.pendingClip=p}beginText(){this.current.textMatrix=n.IDENTITY_MATRIX;this.current.textMatrixScale=1;this.current.x=this.current.lineX=0;this.current.y=this.current.lineY=0}endText(){const t=this.pendingTextPaths,e=this.ctx;if(void 0!==t){e.save();e.beginPath();for(const s of t){e.setTransform(...s.transform);e.translate(s.x,s.y);s.addToPath(e,s.fontSize)}e.restore();e.clip();e.beginPath();delete this.pendingTextPaths}else e.beginPath()}setCharSpacing(t){this.current.charSpacing=t}setWordSpacing(t){this.current.wordSpacing=t}setHScale(t){this.current.textHScale=t/100}setLeading(t){this.current.leading=-t}setFont(t,e){const s=this.commonObjs.get(t),i=this.current;if(!s)throw new Error(`Can't find font for ${t}`);i.fontMatrix=s.fontMatrix||n.FONT_IDENTITY_MATRIX;0!==i.fontMatrix[0]&&0!==i.fontMatrix[3]||(0,n.warn)("Invalid font matrix for font "+t);if(e<0){e=-e;i.fontDirection=-1}else i.fontDirection=1;this.current.font=s;this.current.fontSize=e;if(s.isType3Font)return;const a=s.loadedName||"sans-serif";let r="normal";s.black?r="900":s.bold&&(r="bold");const o=s.italic?"italic":"normal",l=`"${a}", ${s.fallbackName}`;let c=e;e<16?c=16:e>100&&(c=100);this.current.fontSizeScale=e/c;this.ctx.font=`${o} ${r} ${c}px ${l}`}setTextRenderingMode(t){this.current.textRenderingMode=t}setTextRise(t){this.current.textRise=t}moveText(t,e){this.current.x=this.current.lineX+=t;this.current.y=this.current.lineY+=e}setLeadingMoveText(t,e){this.setLeading(-e);this.moveText(t,e)}setTextMatrix(t,e,s,n,i,a){this.current.textMatrix=[t,e,s,n,i,a];this.current.textMatrixScale=Math.hypot(t,e);this.current.x=this.current.lineX=0;this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(t,e,s,a){const r=this.ctx,o=this.current,l=o.font,c=o.textRenderingMode,h=o.fontSize/o.fontSizeScale,d=c&n.TextRenderingMode.FILL_STROKE_MASK,u=!!(c&n.TextRenderingMode.ADD_TO_PATH_FLAG),p=o.patternFill&&!l.missingFile;let g;(l.disableFontFace||u||p)&&(g=l.getPathGenerator(this.commonObjs,t));if(l.disableFontFace||p){r.save();r.translate(e,s);r.beginPath();g(r,h);a&&r.setTransform(...a);d!==n.TextRenderingMode.FILL&&d!==n.TextRenderingMode.FILL_STROKE||r.fill();d!==n.TextRenderingMode.STROKE&&d!==n.TextRenderingMode.FILL_STROKE||r.stroke();r.restore()}else{d!==n.TextRenderingMode.FILL&&d!==n.TextRenderingMode.FILL_STROKE||r.fillText(t,e,s);d!==n.TextRenderingMode.STROKE&&d!==n.TextRenderingMode.FILL_STROKE||r.strokeText(t,e,s)}if(u){(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:(0,i.getCurrentTransform)(r),x:e,y:s,fontSize:h,addToPath:g})}}get isFontSubpixelAAEnabled(){const{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1);t.fillText("I",0,10);const e=t.getImageData(0,0,10,10).data;let s=!1;for(let t=3;t<e.length;t+=4)if(e[t]>0&&e[t]<255){s=!0;break}return(0,n.shadow)(this,"isFontSubpixelAAEnabled",s)}showText(t){const e=this.current,s=e.font;if(s.isType3Font)return this.showType3Text(t);const r=e.fontSize;if(0===r)return;const o=this.ctx,l=e.fontSizeScale,c=e.charSpacing,h=e.wordSpacing,d=e.fontDirection,u=e.textHScale*d,p=t.length,g=s.vertical,f=g?1:-1,m=s.defaultVMetrics,b=r*e.fontMatrix[0],A=e.textRenderingMode===n.TextRenderingMode.FILL&&!s.disableFontFace&&!e.patternFill;o.save();o.transform(...e.textMatrix);o.translate(e.x,e.y+e.textRise);d>0?o.scale(u,-1):o.scale(u,1);let _;if(e.patternFill){o.save();const t=e.fillColor.getPattern(o,this,(0,i.getCurrentTransformInverse)(o),a.PathType.FILL);_=(0,i.getCurrentTransform)(o);o.restore();o.fillStyle=t}let v=e.lineWidth;const y=e.textMatrixScale;if(0===y||0===v){const t=e.textRenderingMode&n.TextRenderingMode.FILL_STROKE_MASK;t!==n.TextRenderingMode.STROKE&&t!==n.TextRenderingMode.FILL_STROKE||(v=this.getSinglePixelWidth())}else v/=y;if(1!==l){o.scale(l,l);v/=l}o.lineWidth=v;if(s.isInvalidPDFjsFont){const s=[];let n=0;for(const e of t){s.push(e.unicode);n+=e.width}o.fillText(s.join(""),0,0);e.x+=n*b*u;o.restore();this.compose();return}let S,x=0;for(S=0;S<p;++S){const e=t[S];if("number"==typeof e){x+=f*e*r/1e3;continue}let n=!1;const i=(e.isSpace?h:0)+c,a=e.fontChar,u=e.accent;let p,v,y,E=e.width;if(g){const t=e.vmetric||m,s=-(e.vmetric?t[1]:.5*E)*b,n=t[2]*b;E=t?-t[0]:E;p=s/l;v=(x+n)/l}else{p=x/l;v=0}if(s.remeasure&&E>0){const t=1e3*o.measureText(a).width/r*l;if(E<t&&this.isFontSubpixelAAEnabled){const e=E/t;n=!0;o.save();o.scale(e,1);p/=e}else E!==t&&(p+=(E-t)/2e3*r/l)}if(this.contentVisible&&(e.isInFont||s.missingFile))if(A&&!u)o.fillText(a,p,v);else{this.paintChar(a,p,v,_);if(u){const t=p+r*u.offset.x/l,e=v-r*u.offset.y/l;this.paintChar(u.fontChar,t,e,_)}}y=g?E*b-i*d:E*b+i*d;x+=y;n&&o.restore()}g?e.y-=x:e.x+=x*u;o.restore();this.compose()}showType3Text(t){const e=this.ctx,s=this.current,i=s.font,a=s.fontSize,r=s.fontDirection,o=i.vertical?1:-1,l=s.charSpacing,c=s.wordSpacing,h=s.textHScale*r,d=s.fontMatrix||n.FONT_IDENTITY_MATRIX,u=t.length;let p,g,f,m;if(!(s.textRenderingMode===n.TextRenderingMode.INVISIBLE)&&0!==a){this._cachedScaleForStroking=null;this._cachedGetSinglePixelWidth=null;e.save();e.transform(...s.textMatrix);e.translate(s.x,s.y);e.scale(h,r);for(p=0;p<u;++p){g=t[p];if("number"==typeof g){m=o*g*a/1e3;this.ctx.translate(m,0);s.x+=m*h;continue}const r=(g.isSpace?c:0)+l,u=i.charProcOperatorList[g.operatorListId];if(!u){(0,n.warn)(`Type3 character "${g.operatorListId}" is not available.`);continue}if(this.contentVisible){this.processingType3=g;this.save();e.scale(a,a);e.transform(...d);this.executeOperatorList(u);this.restore()}f=n.Util.applyTransform([g.width,0],d)[0]*a+r;e.translate(f,0);s.x+=f*h}e.restore();this.processingType3=null}}setCharWidth(t,e){}setCharWidthAndBounds(t,e,s,n,i,a){this.ctx.rect(s,n,i-s,a-n);this.ctx.clip();this.endPath()}getColorN_Pattern(t){let e;if("TilingPattern"===t[0]){const s=t[1],n=this.baseTransform||(0,i.getCurrentTransform)(this.ctx),r={createCanvasGraphics:t=>new CanvasGraphics(t,this.commonObjs,this.objs,this.canvasFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};e=new a.TilingPattern(t,s,this.ctx,r,n)}else e=this._getPattern(t[1],t[2]);return e}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments);this.current.patternFill=!0}setStrokeRGBColor(t,e,s){const i=this.selectColor?.(t,e,s)||n.Util.makeHexColor(t,e,s);this.ctx.strokeStyle=i;this.current.strokeColor=i}setFillRGBColor(t,e,s){const i=this.selectColor?.(t,e,s)||n.Util.makeHexColor(t,e,s);this.ctx.fillStyle=i;this.current.fillColor=i;this.current.patternFill=!1}_getPattern(t,e=null){let s;if(this.cachedPatterns.has(t))s=this.cachedPatterns.get(t);else{s=(0,a.getShadingPattern)(this.objs.get(t));this.cachedPatterns.set(t,s)}e&&(s.matrix=e);return s}shadingFill(t){if(!this.contentVisible)return;const e=this.ctx;this.save();const s=this._getPattern(t);e.fillStyle=s.getPattern(e,this,(0,i.getCurrentTransformInverse)(e),a.PathType.SHADING);const r=(0,i.getCurrentTransformInverse)(e);if(r){const t=e.canvas,s=t.width,i=t.height,a=n.Util.applyTransform([0,0],r),o=n.Util.applyTransform([0,i],r),l=n.Util.applyTransform([s,0],r),c=n.Util.applyTransform([s,i],r),h=Math.min(a[0],o[0],l[0],c[0]),d=Math.min(a[1],o[1],l[1],c[1]),u=Math.max(a[0],o[0],l[0],c[0]),p=Math.max(a[1],o[1],l[1],c[1]);this.ctx.fillRect(h,d,u-h,p-d)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox());this.restore()}beginInlineImage(){(0,n.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,n.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(t,e){if(this.contentVisible){this.save();this.baseTransformStack.push(this.baseTransform);Array.isArray(t)&&6===t.length&&this.transform(...t);this.baseTransform=(0,i.getCurrentTransform)(this.ctx);if(e){const t=e[2]-e[0],s=e[3]-e[1];this.ctx.rect(e[0],e[1],t,s);this.current.updateRectMinMax((0,i.getCurrentTransform)(this.ctx),e);this.clip();this.endPath()}}}paintFormXObjectEnd(){if(this.contentVisible){this.restore();this.baseTransform=this.baseTransformStack.pop()}}beginGroup(t){if(!this.contentVisible)return;this.save();if(this.inSMaskMode){this.endSMaskMode();this.current.activeSMask=null}const e=this.ctx;t.isolated||(0,n.info)("TODO: Support non-isolated groups.");t.knockout&&(0,n.warn)("Knockout groups not supported.");const s=(0,i.getCurrentTransform)(e);t.matrix&&e.transform(...t.matrix);if(!t.bbox)throw new Error("Bounding box is required.");let a=n.Util.getAxialAlignedBoundingBox(t.bbox,(0,i.getCurrentTransform)(e));const r=[0,0,e.canvas.width,e.canvas.height];a=n.Util.intersect(a,r)||[0,0,0,0];const l=Math.floor(a[0]),c=Math.floor(a[1]);let h=Math.max(Math.ceil(a[2])-l,1),d=Math.max(Math.ceil(a[3])-c,1),u=1,p=1;if(h>o){u=h/o;h=o}if(d>o){p=d/o;d=o}this.current.startNewPathAndClipBox([0,0,h,d]);let g="groupAt"+this.groupLevel;t.smask&&(g+="_smask_"+this.smaskCounter++%2);const f=this.cachedCanvases.getCanvas(g,h,d),m=f.context;m.scale(1/u,1/p);m.translate(-l,-c);m.transform(...s);if(t.smask)this.smaskStack.push({canvas:f.canvas,context:m,offsetX:l,offsetY:c,scaleX:u,scaleY:p,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null});else{e.setTransform(1,0,0,1,0,0);e.translate(l,c);e.scale(u,p);e.save()}copyCtxState(e,m);this.ctx=m;this.setGState([["BM","source-over"],["ca",1],["CA",1]]);this.groupStack.push(e);this.groupLevel++}endGroup(t){if(!this.contentVisible)return;this.groupLevel--;const e=this.ctx,s=this.groupStack.pop();this.ctx=s;this.ctx.imageSmoothingEnabled=!1;if(t.smask){this.tempSMask=this.smaskStack.pop();this.restore()}else{this.ctx.restore();const t=(0,i.getCurrentTransform)(this.ctx);this.restore();this.ctx.save();this.ctx.setTransform(...t);const s=n.Util.getAxialAlignedBoundingBox([0,0,e.canvas.width,e.canvas.height],t);this.ctx.drawImage(e.canvas,0,0);this.ctx.restore();this.compose(s)}}beginAnnotation(t,e,s,a,r){this.#ct();resetCtxToDefault(this.ctx,this.foregroundColor);this.ctx.save();this.save();this.baseTransform&&this.ctx.setTransform(...this.baseTransform);if(Array.isArray(e)&&4===e.length){const a=e[2]-e[0],o=e[3]-e[1];if(r&&this.annotationCanvasMap){(s=s.slice())[4]-=e[0];s[5]-=e[1];(e=e.slice())[0]=e[1]=0;e[2]=a;e[3]=o;const[r,l]=n.Util.singularValueDecompose2dScale((0,i.getCurrentTransform)(this.ctx)),{viewportScale:c}=this,h=Math.ceil(a*this.outputScaleX*c),d=Math.ceil(o*this.outputScaleY*c);this.annotationCanvas=this.canvasFactory.create(h,d);const{canvas:u,context:p}=this.annotationCanvas;this.annotationCanvasMap.set(t,u);this.annotationCanvas.savedCtx=this.ctx;this.ctx=p;this.ctx.setTransform(r,0,0,-l,0,o*l);resetCtxToDefault(this.ctx,this.foregroundColor)}else{resetCtxToDefault(this.ctx,this.foregroundColor);this.ctx.rect(e[0],e[1],a,o);this.ctx.clip();this.endPath()}}this.current=new CanvasExtraState(this.ctx.canvas.width,this.ctx.canvas.height);this.transform(...s);this.transform(...a)}endAnnotation(){if(this.annotationCanvas){this.ctx=this.annotationCanvas.savedCtx;delete this.annotationCanvas.savedCtx;delete this.annotationCanvas}}paintImageMaskXObject(t){if(!this.contentVisible)return;const e=t.count;(t=this.getObject(t.data,t)).count=e;const s=this.ctx,n=this.processingType3;if(n){void 0===n.compiled&&(n.compiled=function compileType3Glyph(t){const{width:e,height:s}=t;if(e>l||s>l)return null;const n=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),i=e+1;let a,r,o,c=new Uint8Array(i*(s+1));const h=e+7&-8;let d=new Uint8Array(h*s),u=0;for(const e of t.data){let t=128;for(;t>0;){d[u++]=e&t?0:255;t>>=1}}let p=0;u=0;if(0!==d[u]){c[0]=1;++p}for(r=1;r<e;r++){if(d[u]!==d[u+1]){c[r]=d[u]?2:1;++p}u++}if(0!==d[u]){c[r]=2;++p}for(a=1;a<s;a++){u=a*h;o=a*i;if(d[u-h]!==d[u]){c[o]=d[u]?1:8;++p}let t=(d[u]?4:0)+(d[u-h]?8:0);for(r=1;r<e;r++){t=(t>>2)+(d[u+1]?4:0)+(d[u-h+1]?8:0);if(n[t]){c[o+r]=n[t];++p}u++}if(d[u-h]!==d[u]){c[o+r]=d[u]?2:4;++p}if(p>1e3)return null}u=h*(s-1);o=a*i;if(0!==d[u]){c[o]=8;++p}for(r=1;r<e;r++){if(d[u]!==d[u+1]){c[o+r]=d[u]?4:8;++p}u++}if(0!==d[u]){c[o+r]=4;++p}if(p>1e3)return null;const g=new Int32Array([0,i,-1,0,-i,0,0,0,1]),f=new Path2D;for(a=0;p&&a<=s;a++){let t=a*i;const s=t+e;for(;t<s&&!c[t];)t++;if(t===s)continue;f.moveTo(t%i,a);const n=t;let r=c[t];do{const e=g[r];do{t+=e}while(!c[t]);const s=c[t];if(5!==s&&10!==s){r=s;c[t]=0}else{r=s&51*r>>4;c[t]&=r>>2|r<<2}f.lineTo(t%i,t/i|0);c[t]||--p}while(n!==t);--a}d=null;c=null;return function(t){t.save();t.scale(1/e,-1/s);t.translate(0,-s);t.fill(f);t.beginPath();t.restore()}}(t));if(n.compiled){n.compiled(s);return}}const i=this._createMaskCanvas(t),a=i.canvas;s.save();s.setTransform(1,0,0,1,0,0);s.drawImage(a,i.offsetX,i.offsetY);s.restore();this.compose()}paintImageMaskXObjectRepeat(t,e,s=0,a=0,r,o){if(!this.contentVisible)return;t=this.getObject(t.data,t);const l=this.ctx;l.save();const c=(0,i.getCurrentTransform)(l);l.transform(e,s,a,r,0,0);const h=this._createMaskCanvas(t);l.setTransform(1,0,0,1,h.offsetX-c[4],h.offsetY-c[5]);for(let t=0,i=o.length;t<i;t+=2){const i=n.Util.transform(c,[e,s,a,r,o[t],o[t+1]]),[d,u]=n.Util.applyTransform([0,0],i);l.drawImage(h.canvas,d,u)}l.restore();this.compose()}paintImageMaskXObjectGroup(t){if(!this.contentVisible)return;const e=this.ctx,s=this.current.fillColor,n=this.current.patternFill;for(const r of t){const{data:t,width:o,height:l,transform:c}=r,h=this.cachedCanvases.getCanvas("maskCanvas",o,l),d=h.context;d.save();putBinaryImageMask(d,this.getObject(t,r));d.globalCompositeOperation="source-in";d.fillStyle=n?s.getPattern(d,this,(0,i.getCurrentTransformInverse)(e),a.PathType.FILL):s;d.fillRect(0,0,o,l);d.restore();e.save();e.transform(...c);e.scale(1,-1);drawImageAtIntegerCoords(e,h.canvas,0,0,o,l,0,-1,1,1);e.restore()}this.compose()}paintImageXObject(t){if(!this.contentVisible)return;const e=this.getObject(t);e?this.paintInlineImageXObject(e):(0,n.warn)("Dependent image isn't ready yet")}paintImageXObjectRepeat(t,e,s,i){if(!this.contentVisible)return;const a=this.getObject(t);if(!a){(0,n.warn)("Dependent image isn't ready yet");return}const r=a.width,o=a.height,l=[];for(let t=0,n=i.length;t<n;t+=2)l.push({transform:[e,0,0,s,i[t],i[t+1]],x:0,y:0,w:r,h:o});this.paintInlineImageXObjectGroup(a,l)}paintInlineImageXObject(t){if(!this.contentVisible)return;const e=t.width,s=t.height,n=this.ctx;this.save();n.scale(1/e,-1/s);let a;if("function"==typeof HTMLElement&&t instanceof HTMLElement||!t.data)a=t;else{const n=this.cachedCanvases.getCanvas("inlineImage",e,s);putBinaryImageData(n.context,t,this.current.transferMaps);a=n.canvas}const r=this._scaleImage(a,(0,i.getCurrentTransformInverse)(n));n.imageSmoothingEnabled=getImageSmoothingEnabled((0,i.getCurrentTransform)(n),t.interpolate);drawImageAtIntegerCoords(n,r.img,0,0,r.paintWidth,r.paintHeight,0,-s,e,s);this.compose();this.restore()}paintInlineImageXObjectGroup(t,e){if(!this.contentVisible)return;const s=this.ctx,n=t.width,i=t.height,a=this.cachedCanvases.getCanvas("inlineImage",n,i);putBinaryImageData(a.context,t,this.current.transferMaps);for(const t of e){s.save();s.transform(...t.transform);s.scale(1,-1);drawImageAtIntegerCoords(s,a.canvas,t.x,t.y,t.w,t.h,0,-1,1,1);s.restore()}this.compose()}paintSolidColorImageMask(){if(this.contentVisible){this.ctx.fillRect(0,0,1,1);this.compose()}}markPoint(t){}markPointProps(t,e){}beginMarkedContent(t){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,e){"OC"===t?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(e)}):this.markedContentStack.push({visible:!0});this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop();this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(t){const e=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath();this.pendingClip||this.compose(t);const s=this.ctx;if(this.pendingClip){e||(this.pendingClip===p?s.clip("evenodd"):s.clip());this.pendingClip=null}this.current.startNewPathAndClipBox(this.current.clipBox);s.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=(0,i.getCurrentTransform)(this.ctx);if(0===t[1]&&0===t[2])this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{const e=Math.abs(t[0]*t[3]-t[2]*t[1]),s=Math.hypot(t[0],t[2]),n=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(s,n)/e}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(!this._cachedScaleForStroking){const{lineWidth:t}=this.current,e=(0,i.getCurrentTransform)(this.ctx);let s,n;if(0===e[1]&&0===e[2]){const i=Math.abs(e[0]),a=Math.abs(e[3]);if(0===t){s=1/i;n=1/a}else{const e=i*t,r=a*t;s=e<1?1/e:1;n=r<1?1/r:1}}else{const i=Math.abs(e[0]*e[3]-e[2]*e[1]),a=Math.hypot(e[0],e[1]),r=Math.hypot(e[2],e[3]);if(0===t){s=r/i;n=a/i}else{const e=t*i;s=r>e?r/e:1;n=a>e?a/e:1}}this._cachedScaleForStroking=[s,n]}return this._cachedScaleForStroking}rescaleAndStroke(t){const{ctx:e}=this,{lineWidth:s}=this.current,[n,a]=this.getScaleForStroking();e.lineWidth=s||1;if(1===n&&1===a){e.stroke();return}let r,o,l;if(t){r=(0,i.getCurrentTransform)(e);o=e.getLineDash().slice();l=e.lineDashOffset}e.scale(n,a);const c=Math.max(n,a);e.setLineDash(e.getLineDash().map((t=>t/c)));e.lineDashOffset/=c;e.stroke();if(t){e.setTransform(...r);e.setLineDash(o);e.lineDashOffset=l}}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}e.CanvasGraphics=CanvasGraphics;for(const t in n.OPS)void 0!==CanvasGraphics.prototype[t]&&(CanvasGraphics.prototype[n.OPS[t]]=CanvasGraphics.prototype[t])},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.TilingPattern=e.PathType=void 0;e.getShadingPattern=function getShadingPattern(t){switch(t[0]){case"RadialAxial":return new RadialAxialShadingPattern(t);case"Mesh":return new MeshShadingPattern(t);case"Dummy":return new DummyShadingPattern}throw new Error(`Unknown IR type: ${t[0]}`)};var n=s(1),i=s(6);const a={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};e.PathType=a;function applyBoundingBox(t,e){if(!e)return;const s=e[2]-e[0],n=e[3]-e[1],i=new Path2D;i.rect(e[0],e[1],s,n);t.clip(i)}class BaseShadingPattern{constructor(){this.constructor===BaseShadingPattern&&(0,n.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,n.unreachable)("Abstract method `getPattern` called.")}}class RadialAxialShadingPattern extends BaseShadingPattern{constructor(t){super();this._type=t[1];this._bbox=t[2];this._colorStops=t[3];this._p0=t[4];this._p1=t[5];this._r0=t[6];this._r1=t[7];this.matrix=null}_createGradient(t){let e;"axial"===this._type?e=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(e=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const t of this._colorStops)e.addColorStop(t[0],t[1]);return e}getPattern(t,e,s,r){let o;if(r===a.STROKE||r===a.FILL){const a=e.current.getClippedPathBoundingBox(r,(0,i.getCurrentTransform)(t))||[0,0,0,0],l=Math.ceil(a[2]-a[0])||1,c=Math.ceil(a[3]-a[1])||1,h=e.cachedCanvases.getCanvas("pattern",l,c,!0),d=h.context;d.clearRect(0,0,d.canvas.width,d.canvas.height);d.beginPath();d.rect(0,0,d.canvas.width,d.canvas.height);d.translate(-a[0],-a[1]);s=n.Util.transform(s,[1,0,0,1,a[0],a[1]]);d.transform(...e.baseTransform);this.matrix&&d.transform(...this.matrix);applyBoundingBox(d,this._bbox);d.fillStyle=this._createGradient(d);d.fill();o=t.createPattern(h.canvas,"no-repeat");const u=new DOMMatrix(s);o.setTransform(u)}else{applyBoundingBox(t,this._bbox);o=this._createGradient(t)}return o}}function drawTriangle(t,e,s,n,i,a,r,o){const l=e.coords,c=e.colors,h=t.data,d=4*t.width;let u;if(l[s+1]>l[n+1]){u=s;s=n;n=u;u=a;a=r;r=u}if(l[n+1]>l[i+1]){u=n;n=i;i=u;u=r;r=o;o=u}if(l[s+1]>l[n+1]){u=s;s=n;n=u;u=a;a=r;r=u}const p=(l[s]+e.offsetX)*e.scaleX,g=(l[s+1]+e.offsetY)*e.scaleY,f=(l[n]+e.offsetX)*e.scaleX,m=(l[n+1]+e.offsetY)*e.scaleY,b=(l[i]+e.offsetX)*e.scaleX,A=(l[i+1]+e.offsetY)*e.scaleY;if(g>=A)return;const _=c[a],v=c[a+1],y=c[a+2],S=c[r],x=c[r+1],E=c[r+2],C=c[o],P=c[o+1],T=c[o+2],w=Math.round(g),k=Math.round(A);let R,M,F,D,I,O,L,N;for(let t=w;t<=k;t++){if(t<m){let e;e=t<g?0:(g-t)/(g-m);R=p-(p-f)*e;M=_-(_-S)*e;F=v-(v-x)*e;D=y-(y-E)*e}else{let e;e=t>A?1:m===A?0:(m-t)/(m-A);R=f-(f-b)*e;M=S-(S-C)*e;F=x-(x-P)*e;D=E-(E-T)*e}let e;e=t<g?0:t>A?1:(g-t)/(g-A);I=p-(p-b)*e;O=_-(_-C)*e;L=v-(v-P)*e;N=y-(y-T)*e;const s=Math.round(Math.min(R,I)),n=Math.round(Math.max(R,I));let i=d*t+4*s;for(let t=s;t<=n;t++){e=(R-t)/(R-I);e<0?e=0:e>1&&(e=1);h[i++]=M-(M-O)*e|0;h[i++]=F-(F-L)*e|0;h[i++]=D-(D-N)*e|0;h[i++]=255}}}function drawFigure(t,e,s){const n=e.coords,i=e.colors;let a,r;switch(e.type){case"lattice":const o=e.verticesPerRow,l=Math.floor(n.length/o)-1,c=o-1;for(a=0;a<l;a++){let e=a*o;for(let a=0;a<c;a++,e++){drawTriangle(t,s,n[e],n[e+1],n[e+o],i[e],i[e+1],i[e+o]);drawTriangle(t,s,n[e+o+1],n[e+1],n[e+o],i[e+o+1],i[e+1],i[e+o])}}break;case"triangles":for(a=0,r=n.length;a<r;a+=3)drawTriangle(t,s,n[a],n[a+1],n[a+2],i[a],i[a+1],i[a+2]);break;default:throw new Error("illegal figure")}}class MeshShadingPattern extends BaseShadingPattern{constructor(t){super();this._coords=t[2];this._colors=t[3];this._figures=t[4];this._bounds=t[5];this._bbox=t[7];this._background=t[8];this.matrix=null}_createMeshCanvas(t,e,s){const n=Math.floor(this._bounds[0]),i=Math.floor(this._bounds[1]),a=Math.ceil(this._bounds[2])-n,r=Math.ceil(this._bounds[3])-i,o=Math.min(Math.ceil(Math.abs(a*t[0]*1.1)),3e3),l=Math.min(Math.ceil(Math.abs(r*t[1]*1.1)),3e3),c=a/o,h=r/l,d={coords:this._coords,colors:this._colors,offsetX:-n,offsetY:-i,scaleX:1/c,scaleY:1/h},u=o+4,p=l+4,g=s.getCanvas("mesh",u,p,!1),f=g.context,m=f.createImageData(o,l);if(e){const t=m.data;for(let s=0,n=t.length;s<n;s+=4){t[s]=e[0];t[s+1]=e[1];t[s+2]=e[2];t[s+3]=255}}for(const t of this._figures)drawFigure(m,t,d);f.putImageData(m,2,2);return{canvas:g.canvas,offsetX:n-2*c,offsetY:i-2*h,scaleX:c,scaleY:h}}getPattern(t,e,s,r){applyBoundingBox(t,this._bbox);let o;if(r===a.SHADING)o=n.Util.singularValueDecompose2dScale((0,i.getCurrentTransform)(t));else{o=n.Util.singularValueDecompose2dScale(e.baseTransform);if(this.matrix){const t=n.Util.singularValueDecompose2dScale(this.matrix);o=[o[0]*t[0],o[1]*t[1]]}}const l=this._createMeshCanvas(o,r===a.SHADING?null:this._background,e.cachedCanvases);if(r!==a.SHADING){t.setTransform(...e.baseTransform);this.matrix&&t.transform(...this.matrix)}t.translate(l.offsetX,l.offsetY);t.scale(l.scaleX,l.scaleY);return t.createPattern(l.canvas,"no-repeat")}}class DummyShadingPattern extends BaseShadingPattern{getPattern(){return"hotpink"}}const r=1,o=2;class TilingPattern{static get MAX_PATTERN_SIZE(){return(0,n.shadow)(this,"MAX_PATTERN_SIZE",3e3)}constructor(t,e,s,n,i){this.operatorList=t[2];this.matrix=t[3]||[1,0,0,1,0,0];this.bbox=t[4];this.xstep=t[5];this.ystep=t[6];this.paintType=t[7];this.tilingType=t[8];this.color=e;this.ctx=s;this.canvasGraphicsFactory=n;this.baseTransform=i}createPatternCanvas(t){const e=this.operatorList,s=this.bbox,a=this.xstep,r=this.ystep,o=this.paintType,l=this.tilingType,c=this.color,h=this.canvasGraphicsFactory;(0,n.info)("TilingType: "+l);const d=s[0],u=s[1],p=s[2],g=s[3],f=n.Util.singularValueDecompose2dScale(this.matrix),m=n.Util.singularValueDecompose2dScale(this.baseTransform),b=[f[0]*m[0],f[1]*m[1]],A=this.getSizeAndScale(a,this.ctx.canvas.width,b[0]),_=this.getSizeAndScale(r,this.ctx.canvas.height,b[1]),v=t.cachedCanvases.getCanvas("pattern",A.size,_.size,!0),y=v.context,S=h.createCanvasGraphics(y);S.groupLevel=t.groupLevel;this.setFillAndStrokeStyleToContext(S,o,c);let x=d,E=u,C=p,P=g;if(d<0){x=0;C+=Math.abs(d)}if(u<0){E=0;P+=Math.abs(u)}y.translate(-A.scale*x,-_.scale*E);S.transform(A.scale,0,0,_.scale,0,0);y.save();this.clipBbox(S,x,E,C,P);S.baseTransform=(0,i.getCurrentTransform)(S.ctx);S.executeOperatorList(e);S.endDrawing();return{canvas:v.canvas,scaleX:A.scale,scaleY:_.scale,offsetX:x,offsetY:E}}getSizeAndScale(t,e,s){t=Math.abs(t);const n=Math.max(TilingPattern.MAX_PATTERN_SIZE,e);let i=Math.ceil(t*s);i>=n?i=n:s=i/t;return{scale:s,size:i}}clipBbox(t,e,s,n,a){const r=n-e,o=a-s;t.ctx.rect(e,s,r,o);t.current.updateRectMinMax((0,i.getCurrentTransform)(t.ctx),[e,s,n,a]);t.clip();t.endPath()}setFillAndStrokeStyleToContext(t,e,s){const i=t.ctx,a=t.current;switch(e){case r:const t=this.ctx;i.fillStyle=t.fillStyle;i.strokeStyle=t.strokeStyle;a.fillColor=t.fillStyle;a.strokeColor=t.strokeStyle;break;case o:const l=n.Util.makeHexColor(s[0],s[1],s[2]);i.fillStyle=l;i.strokeStyle=l;a.fillColor=l;a.strokeColor=l;break;default:throw new n.FormatError(`Unsupported paint type: ${e}`)}}getPattern(t,e,s,i){let r=s;if(i!==a.SHADING){r=n.Util.transform(r,e.baseTransform);this.matrix&&(r=n.Util.transform(r,this.matrix))}const o=this.createPatternCanvas(e);let l=new DOMMatrix(r);l=l.translate(o.offsetX,o.offsetY);l=l.scale(1/o.scaleX,1/o.scaleY);const c=t.createPattern(o.canvas,"repeat");c.setTransform(l);return c}}e.TilingPattern=TilingPattern},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.applyMaskImageData=function applyMaskImageData({src:t,srcPos:e=0,dest:s,destPos:i=0,width:a,height:r,inverseDecode:o=!1}){const l=n.FeatureTest.isLittleEndian?4278190080:255,[c,h]=o?[0,l]:[l,0],d=a>>3,u=7&a,p=t.length;s=new Uint32Array(s.buffer);for(let n=0;n<r;n++){for(const n=e+d;e<n;e++){const n=e<p?t[e]:255;s[i++]=128&n?h:c;s[i++]=64&n?h:c;s[i++]=32&n?h:c;s[i++]=16&n?h:c;s[i++]=8&n?h:c;s[i++]=4&n?h:c;s[i++]=2&n?h:c;s[i++]=1&n?h:c}if(0===u)continue;const n=e<p?t[e++]:255;for(let t=0;t<u;t++)s[i++]=n&1<<7-t?h:c}return{srcPos:e,destPos:i}};var n=s(1)},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0});e.GlobalWorkerOptions=void 0;const s=Object.create(null);e.GlobalWorkerOptions=s;s.workerPort=null;s.workerSrc=""},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.MessageHandler=void 0;var n=s(1);const i=1,a=2,r=1,o=2,l=3,c=4,h=5,d=6,u=7,p=8;function wrapReason(t){t instanceof Error||"object"==typeof t&&null!==t||(0,n.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.');switch(t.name){case"AbortException":return new n.AbortException(t.message);case"MissingPDFException":return new n.MissingPDFException(t.message);case"PasswordException":return new n.PasswordException(t.message,t.code);case"UnexpectedResponseException":return new n.UnexpectedResponseException(t.message,t.status);case"UnknownErrorException":return new n.UnknownErrorException(t.message,t.details);default:return new n.UnknownErrorException(t.message,t.toString())}}e.MessageHandler=class MessageHandler{constructor(t,e,s){this.sourceName=t;this.targetName=e;this.comObj=s;this.callbackId=1;this.streamId=1;this.streamSinks=Object.create(null);this.streamControllers=Object.create(null);this.callbackCapabilities=Object.create(null);this.actionHandler=Object.create(null);this._onComObjOnMessage=t=>{const e=t.data;if(e.targetName!==this.sourceName)return;if(e.stream){this._processStreamMessage(e);return}if(e.callback){const t=e.callbackId,s=this.callbackCapabilities[t];if(!s)throw new Error(`Cannot resolve callback ${t}`);delete this.callbackCapabilities[t];if(e.callback===i)s.resolve(e.data);else{if(e.callback!==a)throw new Error("Unexpected callback case");s.reject(wrapReason(e.reason))}return}const n=this.actionHandler[e.action];if(!n)throw new Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){const t=this.sourceName,r=e.sourceName;new Promise((function(t){t(n(e.data))})).then((function(n){s.postMessage({sourceName:t,targetName:r,callback:i,callbackId:e.callbackId,data:n})}),(function(n){s.postMessage({sourceName:t,targetName:r,callback:a,callbackId:e.callbackId,reason:wrapReason(n)})}))}else e.streamId?this._createStreamSink(e):n(e.data)};s.addEventListener("message",this._onComObjOnMessage)}on(t,e){const s=this.actionHandler;if(s[t])throw new Error(`There is already an actionName called "${t}"`);s[t]=e}send(t,e,s){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:e},s)}sendWithPromise(t,e,s){const i=this.callbackId++,a=(0,n.createPromiseCapability)();this.callbackCapabilities[i]=a;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:i,data:e},s)}catch(t){a.reject(t)}return a.promise}sendWithStream(t,e,s,i){const a=this.streamId++,o=this.sourceName,l=this.targetName,c=this.comObj;return new ReadableStream({start:s=>{const r=(0,n.createPromiseCapability)();this.streamControllers[a]={controller:s,startCall:r,pullCall:null,cancelCall:null,isClosed:!1};c.postMessage({sourceName:o,targetName:l,action:t,streamId:a,data:e,desiredSize:s.desiredSize},i);return r.promise},pull:t=>{const e=(0,n.createPromiseCapability)();this.streamControllers[a].pullCall=e;c.postMessage({sourceName:o,targetName:l,stream:d,streamId:a,desiredSize:t.desiredSize});return e.promise},cancel:t=>{(0,n.assert)(t instanceof Error,"cancel must have a valid reason");const e=(0,n.createPromiseCapability)();this.streamControllers[a].cancelCall=e;this.streamControllers[a].isClosed=!0;c.postMessage({sourceName:o,targetName:l,stream:r,streamId:a,reason:wrapReason(t)});return e.promise}},s)}_createStreamSink(t){const e=t.streamId,s=this.sourceName,i=t.sourceName,a=this.comObj,r=this,o=this.actionHandler[t.action],d={enqueue(t,r=1,o){if(this.isCancelled)return;const l=this.desiredSize;this.desiredSize-=r;if(l>0&&this.desiredSize<=0){this.sinkCapability=(0,n.createPromiseCapability)();this.ready=this.sinkCapability.promise}a.postMessage({sourceName:s,targetName:i,stream:c,streamId:e,chunk:t},o)},close(){if(!this.isCancelled){this.isCancelled=!0;a.postMessage({sourceName:s,targetName:i,stream:l,streamId:e});delete r.streamSinks[e]}},error(t){(0,n.assert)(t instanceof Error,"error must have a valid reason");if(!this.isCancelled){this.isCancelled=!0;a.postMessage({sourceName:s,targetName:i,stream:h,streamId:e,reason:wrapReason(t)})}},sinkCapability:(0,n.createPromiseCapability)(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};d.sinkCapability.resolve();d.ready=d.sinkCapability.promise;this.streamSinks[e]=d;new Promise((function(e){e(o(t.data,d))})).then((function(){a.postMessage({sourceName:s,targetName:i,stream:p,streamId:e,success:!0})}),(function(t){a.postMessage({sourceName:s,targetName:i,stream:p,streamId:e,reason:wrapReason(t)})}))}_processStreamMessage(t){const e=t.streamId,s=this.sourceName,i=t.sourceName,a=this.comObj,g=this.streamControllers[e],f=this.streamSinks[e];switch(t.stream){case p:t.success?g.startCall.resolve():g.startCall.reject(wrapReason(t.reason));break;case u:t.success?g.pullCall.resolve():g.pullCall.reject(wrapReason(t.reason));break;case d:if(!f){a.postMessage({sourceName:s,targetName:i,stream:u,streamId:e,success:!0});break}f.desiredSize<=0&&t.desiredSize>0&&f.sinkCapability.resolve();f.desiredSize=t.desiredSize;new Promise((function(t){t(f.onPull&&f.onPull())})).then((function(){a.postMessage({sourceName:s,targetName:i,stream:u,streamId:e,success:!0})}),(function(t){a.postMessage({sourceName:s,targetName:i,stream:u,streamId:e,reason:wrapReason(t)})}));break;case c:(0,n.assert)(g,"enqueue should have stream controller");if(g.isClosed)break;g.controller.enqueue(t.chunk);break;case l:(0,n.assert)(g,"close should have stream controller");if(g.isClosed)break;g.isClosed=!0;g.controller.close();this._deleteStreamController(g,e);break;case h:(0,n.assert)(g,"error should have stream controller");g.controller.error(wrapReason(t.reason));this._deleteStreamController(g,e);break;case o:t.success?g.cancelCall.resolve():g.cancelCall.reject(wrapReason(t.reason));this._deleteStreamController(g,e);break;case r:if(!f)break;new Promise((function(e){e(f.onCancel&&f.onCancel(wrapReason(t.reason)))})).then((function(){a.postMessage({sourceName:s,targetName:i,stream:o,streamId:e,success:!0})}),(function(t){a.postMessage({sourceName:s,targetName:i,stream:o,streamId:e,reason:wrapReason(t)})}));f.sinkCapability.reject(wrapReason(t.reason));f.isCancelled=!0;delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}}async _deleteStreamController(t,e){await Promise.allSettled([t.startCall&&t.startCall.promise,t.pullCall&&t.pullCall.promise,t.cancelCall&&t.cancelCall.promise]);delete this.streamControllers[e]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.Metadata=void 0;var n=s(1);e.Metadata=class Metadata{#ht;#dt;constructor({parsedData:t,rawData:e}){this.#ht=t;this.#dt=e}getRaw(){return this.#dt}get(t){return this.#ht.get(t)??null}getAll(){return(0,n.objectFromMap)(this.#ht)}has(t){return this.#ht.has(t)}}},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.OptionalContentConfig=void 0;var n=s(1),i=s(8);const a=Symbol("INTERNAL");class OptionalContentGroup{#ut=!0;constructor(t,e){this.name=t;this.intent=e}get visible(){return this.#ut}_setVisible(t,e){t!==a&&(0,n.unreachable)("Internal method `_setVisible` called.");this.#ut=e}}e.OptionalContentConfig=class OptionalContentConfig{#pt=null;#gt=new Map;#ft=null;#mt=null;constructor(t){this.name=null;this.creator=null;if(null!==t){this.name=t.name;this.creator=t.creator;this.#mt=t.order;for(const e of t.groups)this.#gt.set(e.id,new OptionalContentGroup(e.name,e.intent));if("OFF"===t.baseState)for(const t of this.#gt.values())t._setVisible(a,!1);for(const e of t.on)this.#gt.get(e)._setVisible(a,!0);for(const e of t.off)this.#gt.get(e)._setVisible(a,!1);this.#ft=this.getHash()}}#bt(t){const e=t.length;if(e<2)return!0;const s=t[0];for(let i=1;i<e;i++){const e=t[i];let a;if(Array.isArray(e))a=this.#bt(e);else{if(!this.#gt.has(e)){(0,n.warn)(`Optional content group not found: ${e}`);return!0}a=this.#gt.get(e).visible}switch(s){case"And":if(!a)return!1;break;case"Or":if(a)return!0;break;case"Not":return!a;default:return!0}}return"And"===s}isVisible(t){if(0===this.#gt.size)return!0;if(!t){(0,n.warn)("Optional content group not defined.");return!0}if("OCG"===t.type){if(!this.#gt.has(t.id)){(0,n.warn)(`Optional content group not found: ${t.id}`);return!0}return this.#gt.get(t.id).visible}if("OCMD"===t.type){if(t.expression)return this.#bt(t.expression);if(!t.policy||"AnyOn"===t.policy){for(const e of t.ids){if(!this.#gt.has(e)){(0,n.warn)(`Optional content group not found: ${e}`);return!0}if(this.#gt.get(e).visible)return!0}return!1}if("AllOn"===t.policy){for(const e of t.ids){if(!this.#gt.has(e)){(0,n.warn)(`Optional content group not found: ${e}`);return!0}if(!this.#gt.get(e).visible)return!1}return!0}if("AnyOff"===t.policy){for(const e of t.ids){if(!this.#gt.has(e)){(0,n.warn)(`Optional content group not found: ${e}`);return!0}if(!this.#gt.get(e).visible)return!0}return!1}if("AllOff"===t.policy){for(const e of t.ids){if(!this.#gt.has(e)){(0,n.warn)(`Optional content group not found: ${e}`);return!0}if(this.#gt.get(e).visible)return!1}return!0}(0,n.warn)(`Unknown optional content policy ${t.policy}.`);return!0}(0,n.warn)(`Unknown group type ${t.type}.`);return!0}setVisibility(t,e=!0){if(this.#gt.has(t)){this.#gt.get(t)._setVisible(a,!!e);this.#pt=null}else(0,n.warn)(`Optional content group not found: ${t}`)}get hasInitialVisibility(){return this.getHash()===this.#ft}getOrder(){return this.#gt.size?this.#mt?this.#mt.slice():[...this.#gt.keys()]:null}getGroups(){return this.#gt.size>0?(0,n.objectFromMap)(this.#gt):null}getGroup(t){return this.#gt.get(t)||null}getHash(){if(null!==this.#pt)return this.#pt;const t=new i.MurmurHash3_64;for(const[e,s]of this.#gt)t.update(`${e}:${s.visible}`);return this.#pt=t.hexdigest()}}},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.PDFDataTransportStream=void 0;var n=s(1),i=s(6);e.PDFDataTransportStream=class PDFDataTransportStream{constructor({length:t,initialData:e,progressiveDone:s=!1,contentDispositionFilename:i=null,disableRange:a=!1,disableStream:r=!1},o){(0,n.assert)(o,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');this._queuedChunks=[];this._progressiveDone=s;this._contentDispositionFilename=i;if(e?.length>0){const t=e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength?e.buffer:new Uint8Array(e).buffer;this._queuedChunks.push(t)}this._pdfDataRangeTransport=o;this._isStreamingSupported=!r;this._isRangeSupported=!a;this._contentLength=t;this._fullRequestReader=null;this._rangeReaders=[];this._pdfDataRangeTransport.addRangeListener(((t,e)=>{this._onReceiveData({begin:t,chunk:e})}));this._pdfDataRangeTransport.addProgressListener(((t,e)=>{this._onProgress({loaded:t,total:e})}));this._pdfDataRangeTransport.addProgressiveReadListener((t=>{this._onReceiveData({chunk:t})}));this._pdfDataRangeTransport.addProgressiveDoneListener((()=>{this._onProgressiveDone()}));this._pdfDataRangeTransport.transportReady()}_onReceiveData({begin:t,chunk:e}){const s=e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength?e.buffer:new Uint8Array(e).buffer;if(void 0===t)this._fullRequestReader?this._fullRequestReader._enqueue(s):this._queuedChunks.push(s);else{const e=this._rangeReaders.some((function(e){if(e._begin!==t)return!1;e._enqueue(s);return!0}));(0,n.assert)(e,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(t){void 0===t.total?this._rangeReaders[0]?.onProgress?.({loaded:t.loaded}):this._fullRequestReader?.onProgress?.({loaded:t.loaded,total:t.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone();this._progressiveDone=!0}_removeRangeReader(t){const e=this._rangeReaders.indexOf(t);e>=0&&this._rangeReaders.splice(e,1)}getFullReader(){(0,n.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;this._queuedChunks=null;return new PDFDataTransportStreamReader(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const s=new PDFDataTransportStreamRangeReader(this,t,e);this._pdfDataRangeTransport.requestDataRange(t,e);this._rangeReaders.push(s);return s}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeReaders.slice(0))e.cancel(t);this._pdfDataRangeTransport.abort()}};class PDFDataTransportStreamReader{constructor(t,e,s=!1,n=null){this._stream=t;this._done=s||!1;this._filename=(0,i.isPdfFile)(n)?n:null;this._queuedChunks=e||[];this._loaded=0;for(const t of this._queuedChunks)this._loaded+=t.byteLength;this._requests=[];this._headersReady=Promise.resolve();t._fullRequestReader=this;this.onProgress=null}_enqueue(t){if(!this._done){if(this._requests.length>0){this._requests.shift().resolve({value:t,done:!1})}else this._queuedChunks.push(t);this._loaded+=t.byteLength}}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0){return{value:this._queuedChunks.shift(),done:!1}}if(this._done)return{value:void 0,done:!0};const t=(0,n.createPromiseCapability)();this._requests.push(t);return t.promise}cancel(t){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class PDFDataTransportStreamRangeReader{constructor(t,e,s){this._stream=t;this._begin=e;this._end=s;this._queuedChunk=null;this._requests=[];this._done=!1;this.onProgress=null}_enqueue(t){if(!this._done){if(0===this._requests.length)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0;this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const t=this._queuedChunk;this._queuedChunk=null;return{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=(0,n.createPromiseCapability)();this._requests.push(t);return t.promise}cancel(t){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0;this._stream._removeRangeReader(this)}}},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0});e.XfaText=void 0;class XfaText{static textContent(t){const e=[],s={items:e,styles:Object.create(null)};!function walk(t){if(!t)return;let s=null;const n=t.name;if("#text"===n)s=t.value;else{if(!XfaText.shouldBuildText(n))return;t?.attributes?.textContent?s=t.attributes.textContent:t.value&&(s=t.value)}null!==s&&e.push({str:s});if(t.children)for(const e of t.children)walk(e)}(t);return s}static shouldBuildText(t){return!("textarea"===t||"input"===t||"option"===t||"select"===t)}}e.XfaText=XfaText},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.NodeStandardFontDataFactory=e.NodeCanvasFactory=e.NodeCMapReaderFactory=void 0;var n=s(7);const fetchData=function(t){return new Promise(((e,s)=>{require("fs").readFile(t,((t,n)=>{!t&&n?e(new Uint8Array(n)):s(new Error(t))}))}))};class NodeCanvasFactory extends n.BaseCanvasFactory{_createCanvas(t,e){return require("canvas").createCanvas(t,e)}}e.NodeCanvasFactory=NodeCanvasFactory;class NodeCMapReaderFactory extends n.BaseCMapReaderFactory{_fetchData(t,e){return fetchData(t).then((t=>({cMapData:t,compressionType:e})))}}e.NodeCMapReaderFactory=NodeCMapReaderFactory;class NodeStandardFontDataFactory extends n.BaseStandardFontDataFactory{_fetchData(t){return fetchData(t)}}e.NodeStandardFontDataFactory=NodeStandardFontDataFactory},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.PDFNodeStream=void 0;var n=s(1),i=s(22);const a=require("fs"),r=require("http"),o=require("https"),l=require("url"),c=/^file:\/\/\/[a-zA-Z]:\//;e.PDFNodeStream=class PDFNodeStream{constructor(t){this.source=t;this.url=function parseUrl(t){const e=l.parse(t);if("file:"===e.protocol||e.host)return e;if(/^[a-z]:[/\\]/i.test(t))return l.parse(`file:///${t}`);e.host||(e.protocol="file:");return e}(t.url);this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol;this.isFsUrl="file:"===this.url.protocol;this.httpHeaders=this.isHttp&&t.httpHeaders||{};this._fullRequestReader=null;this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){(0,n.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once.");this._fullRequestReader=this.isFsUrl?new PDFNodeStreamFsFullReader(this):new PDFNodeStreamFullReader(this);return this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const s=this.isFsUrl?new PDFNodeStreamFsRangeReader(this,t,e):new PDFNodeStreamRangeReader(this,t,e);this._rangeRequestReaders.push(s);return s}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}};class BaseFullReader{constructor(t){this._url=t.url;this._done=!1;this._storedError=null;this.onProgress=null;const e=t.source;this._contentLength=e.length;this._loaded=0;this._filename=null;this._disableRange=e.disableRange||!1;this._rangeChunkSize=e.rangeChunkSize;this._rangeChunkSize||this._disableRange||(this._disableRange=!0);this._isStreamingSupported=!e.disableStream;this._isRangeSupported=!e.disableRange;this._readableStream=null;this._readCapability=(0,n.createPromiseCapability)();this._headersCapability=(0,n.createPromiseCapability)()}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;if(this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();if(null===t){this._readCapability=(0,n.createPromiseCapability)();return this.read()}this._loaded+=t.length;this.onProgress?.({loaded:this._loaded,total:this._contentLength});return{value:new Uint8Array(t).buffer,done:!1}}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}_error(t){this._storedError=t;this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t;t.on("readable",(()=>{this._readCapability.resolve()}));t.on("end",(()=>{t.destroy();this._done=!0;this._readCapability.resolve()}));t.on("error",(t=>{this._error(t)}));!this._isStreamingSupported&&this._isRangeSupported&&this._error(new n.AbortException("streaming is disabled"));this._storedError&&this._readableStream.destroy(this._storedError)}}class BaseRangeReader{constructor(t){this._url=t.url;this._done=!1;this._storedError=null;this.onProgress=null;this._loaded=0;this._readableStream=null;this._readCapability=(0,n.createPromiseCapability)();const e=t.source;this._isStreamingSupported=!e.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;if(this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();if(null===t){this._readCapability=(0,n.createPromiseCapability)();return this.read()}this._loaded+=t.length;this.onProgress?.({loaded:this._loaded});return{value:new Uint8Array(t).buffer,done:!1}}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}_error(t){this._storedError=t;this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t;t.on("readable",(()=>{this._readCapability.resolve()}));t.on("end",(()=>{t.destroy();this._done=!0;this._readCapability.resolve()}));t.on("error",(t=>{this._error(t)}));this._storedError&&this._readableStream.destroy(this._storedError)}}function createRequestOptions(t,e){return{protocol:t.protocol,auth:t.auth,host:t.hostname,port:t.port,path:t.path,method:"GET",headers:e}}class PDFNodeStreamFullReader extends BaseFullReader{constructor(t){super(t);const handleResponse=e=>{if(404===e.statusCode){const t=new n.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=t;this._headersCapability.reject(t);return}this._headersCapability.resolve();this._setReadableStream(e);const getResponseHeader=t=>this._readableStream.headers[t.toLowerCase()],{allowRangeRequests:s,suggestedLength:a}=(0,i.validateRangeRequestCapabilities)({getResponseHeader:getResponseHeader,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=s;this._contentLength=a||this._contentLength;this._filename=(0,i.extractFilenameFromHeader)(getResponseHeader)};this._request=null;"http:"===this._url.protocol?this._request=r.request(createRequestOptions(this._url,t.httpHeaders),handleResponse):this._request=o.request(createRequestOptions(this._url,t.httpHeaders),handleResponse);this._request.on("error",(t=>{this._storedError=t;this._headersCapability.reject(t)}));this._request.end()}}class PDFNodeStreamRangeReader extends BaseRangeReader{constructor(t,e,s){super(t);this._httpHeaders={};for(const e in t.httpHeaders){const s=t.httpHeaders[e];void 0!==s&&(this._httpHeaders[e]=s)}this._httpHeaders.Range=`bytes=${e}-${s-1}`;const handleResponse=t=>{if(404!==t.statusCode)this._setReadableStream(t);else{const t=new n.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=t}};this._request=null;"http:"===this._url.protocol?this._request=r.request(createRequestOptions(this._url,this._httpHeaders),handleResponse):this._request=o.request(createRequestOptions(this._url,this._httpHeaders),handleResponse);this._request.on("error",(t=>{this._storedError=t}));this._request.end()}}class PDFNodeStreamFsFullReader extends BaseFullReader{constructor(t){super(t);let e=decodeURIComponent(this._url.path);c.test(this._url.href)&&(e=e.replace(/^\//,""));a.lstat(e,((t,s)=>{if(t){"ENOENT"===t.code&&(t=new n.MissingPDFException(`Missing PDF "${e}".`));this._storedError=t;this._headersCapability.reject(t)}else{this._contentLength=s.size;this._setReadableStream(a.createReadStream(e));this._headersCapability.resolve()}}))}}class PDFNodeStreamFsRangeReader extends BaseRangeReader{constructor(t,e,s){super(t);let n=decodeURIComponent(this._url.path);c.test(this._url.href)&&(n=n.replace(/^\//,""));this._setReadableStream(a.createReadStream(n,{start:e,end:s-1}))}}},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.createResponseStatusError=function createResponseStatusError(t,e){if(404===t||0===t&&e.startsWith("file:"))return new n.MissingPDFException('Missing PDF "'+e+'".');return new n.UnexpectedResponseException(`Unexpected server response (${t}) while retrieving PDF "${e}".`,t)};e.extractFilenameFromHeader=function extractFilenameFromHeader(t){const e=t("Content-Disposition");if(e){let t=(0,i.getFilenameFromContentDispositionHeader)(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch(t){}if((0,a.isPdfFile)(t))return t}return null};e.validateRangeRequestCapabilities=function validateRangeRequestCapabilities({getResponseHeader:t,isHttp:e,rangeChunkSize:s,disableRange:n}){const i={allowRangeRequests:!1,suggestedLength:void 0},a=parseInt(t("Content-Length"),10);if(!Number.isInteger(a))return i;i.suggestedLength=a;if(a<=2*s)return i;if(n||!e)return i;if("bytes"!==t("Accept-Ranges"))return i;if("identity"!==(t("Content-Encoding")||"identity"))return i;i.allowRangeRequests=!0;return i};e.validateResponseStatus=function validateResponseStatus(t){return 200===t||206===t};var n=s(1),i=s(23),a=s(6)},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.getFilenameFromContentDispositionHeader=function getFilenameFromContentDispositionHeader(t){let e=!0,s=toParamRegExp("filename\\*","i").exec(t);if(s){s=s[1];let t=rfc2616unquote(s);t=unescape(t);t=rfc5987decode(t);t=rfc2047decode(t);return fixupEncoding(t)}s=function rfc2231getparam(t){const e=[];let s;const n=toParamRegExp("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(s=n.exec(t));){let[,t,n,i]=s;t=parseInt(t,10);if(t in e){if(0===t)break}else e[t]=[n,i]}const i=[];for(let t=0;t<e.length&&t in e;++t){let[s,n]=e[t];n=rfc2616unquote(n);if(s){n=unescape(n);0===t&&(n=rfc5987decode(n))}i.push(n)}return i.join("")}(t);if(s){return fixupEncoding(rfc2047decode(s))}s=toParamRegExp("filename","i").exec(t);if(s){s=s[1];let t=rfc2616unquote(s);t=rfc2047decode(t);return fixupEncoding(t)}function toParamRegExp(t,e){return new RegExp("(?:^|;)\\s*"+t+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',e)}function textdecode(t,s){if(t){if(!/^[\x00-\xFF]+$/.test(s))return s;try{const i=new TextDecoder(t,{fatal:!0}),a=(0,n.stringToBytes)(s);s=i.decode(a);e=!1}catch(t){}}return s}function fixupEncoding(t){if(e&&/[\x80-\xff]/.test(t)){t=textdecode("utf-8",t);e&&(t=textdecode("iso-8859-1",t))}return t}function rfc2616unquote(t){if(t.startsWith('"')){const e=t.slice(1).split('\\"');for(let t=0;t<e.length;++t){const s=e[t].indexOf('"');if(-1!==s){e[t]=e[t].slice(0,s);e.length=t+1}e[t]=e[t].replace(/\\(.)/g,"$1")}t=e.join('"')}return t}function rfc5987decode(t){const e=t.indexOf("'");if(-1===e)return t;return textdecode(t.slice(0,e),t.slice(e+1).replace(/^[^']*'/,""))}function rfc2047decode(t){return!t.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(t)?t:t.replace(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,(function(t,e,s,n){if("q"===s||"Q"===s)return textdecode(e,n=(n=n.replace(/_/g," ")).replace(/=([0-9a-fA-F]{2})/g,(function(t,e){return String.fromCharCode(parseInt(e,16))})));try{n=atob(n)}catch(t){}return textdecode(e,n)}))}return""};var n=s(1)},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.PDFNetworkStream=void 0;var n=s(1),i=s(22);class NetworkManager{constructor(t,e={}){this.url=t;this.isHttp=/^https?:/i.test(t);this.httpHeaders=this.isHttp&&e.httpHeaders||Object.create(null);this.withCredentials=e.withCredentials||!1;this.getXhr=e.getXhr||function NetworkManager_getXhr(){return new XMLHttpRequest};this.currXhrId=0;this.pendingRequests=Object.create(null)}requestRange(t,e,s){const n={begin:t,end:e};for(const t in s)n[t]=s[t];return this.request(n)}requestFull(t){return this.request(t)}request(t){const e=this.getXhr(),s=this.currXhrId++,n=this.pendingRequests[s]={xhr:e};e.open("GET",this.url);e.withCredentials=this.withCredentials;for(const t in this.httpHeaders){const s=this.httpHeaders[t];void 0!==s&&e.setRequestHeader(t,s)}if(this.isHttp&&"begin"in t&&"end"in t){e.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`);n.expectedStatus=206}else n.expectedStatus=200;e.responseType="arraybuffer";t.onError&&(e.onerror=function(s){t.onError(e.status)});e.onreadystatechange=this.onStateChange.bind(this,s);e.onprogress=this.onProgress.bind(this,s);n.onHeadersReceived=t.onHeadersReceived;n.onDone=t.onDone;n.onError=t.onError;n.onProgress=t.onProgress;e.send(null);return s}onProgress(t,e){const s=this.pendingRequests[t];s&&s.onProgress?.(e)}onStateChange(t,e){const s=this.pendingRequests[t];if(!s)return;const i=s.xhr;if(i.readyState>=2&&s.onHeadersReceived){s.onHeadersReceived();delete s.onHeadersReceived}if(4!==i.readyState)return;if(!(t in this.pendingRequests))return;delete this.pendingRequests[t];if(0===i.status&&this.isHttp){s.onError?.(i.status);return}const a=i.status||200;if(!(200===a&&206===s.expectedStatus)&&a!==s.expectedStatus){s.onError?.(i.status);return}const r=function getArrayBuffer(t){const e=t.response;return"string"!=typeof e?e:(0,n.stringToBytes)(e).buffer}(i);if(206===a){const t=i.getResponseHeader("Content-Range"),e=/bytes (\d+)-(\d+)\/(\d+)/.exec(t);s.onDone({begin:parseInt(e[1],10),chunk:r})}else r?s.onDone({begin:0,chunk:r}):s.onError?.(i.status)}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){const e=this.pendingRequests[t].xhr;delete this.pendingRequests[t];e.abort()}}e.PDFNetworkStream=class PDFNetworkStream{constructor(t){this._source=t;this._manager=new NetworkManager(t.url,{httpHeaders:t.httpHeaders,withCredentials:t.withCredentials});this._rangeChunkSize=t.rangeChunkSize;this._fullRequestReader=null;this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){const e=this._rangeRequestReaders.indexOf(t);e>=0&&this._rangeRequestReaders.splice(e,1)}getFullReader(){(0,n.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once.");this._fullRequestReader=new PDFNetworkStreamFullRequestReader(this._manager,this._source);return this._fullRequestReader}getRangeReader(t,e){const s=new PDFNetworkStreamRangeRequestReader(this._manager,t,e);s.onClosed=this._onRangeRequestReaderClosed.bind(this);this._rangeRequestReaders.push(s);return s}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}};class PDFNetworkStreamFullRequestReader{constructor(t,e){this._manager=t;const s={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=e.url;this._fullRequestId=t.requestFull(s);this._headersReceivedCapability=(0,n.createPromiseCapability)();this._disableRange=e.disableRange||!1;this._contentLength=e.length;this._rangeChunkSize=e.rangeChunkSize;this._rangeChunkSize||this._disableRange||(this._disableRange=!0);this._isStreamingSupported=!1;this._isRangeSupported=!1;this._cachedChunks=[];this._requests=[];this._done=!1;this._storedError=void 0;this._filename=null;this.onProgress=null}_onHeadersReceived(){const t=this._fullRequestId,e=this._manager.getRequestXhr(t),getResponseHeader=t=>e.getResponseHeader(t),{allowRangeRequests:s,suggestedLength:n}=(0,i.validateRangeRequestCapabilities)({getResponseHeader:getResponseHeader,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});s&&(this._isRangeSupported=!0);this._contentLength=n||this._contentLength;this._filename=(0,i.extractFilenameFromHeader)(getResponseHeader);this._isRangeSupported&&this._manager.abortRequest(t);this._headersReceivedCapability.resolve()}_onDone(t){if(t)if(this._requests.length>0){this._requests.shift().resolve({value:t.chunk,done:!1})}else this._cachedChunks.push(t.chunk);this._done=!0;if(!(this._cachedChunks.length>0)){for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){this._storedError=(0,i.createResponseStatusError)(t,this._url);this._headersReceivedCapability.reject(this._storedError);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0;this._cachedChunks.length=0}_onProgress(t){this.onProgress?.({loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0){return{value:this._cachedChunks.shift(),done:!1}}if(this._done)return{value:void 0,done:!0};const t=(0,n.createPromiseCapability)();this._requests.push(t);return t.promise}cancel(t){this._done=!0;this._headersReceivedCapability.reject(t);for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0;this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId);this._fullRequestReader=null}}class PDFNetworkStreamRangeRequestReader{constructor(t,e,s){this._manager=t;const n={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url;this._requestId=t.requestRange(e,s,n);this._requests=[];this._queuedChunk=null;this._done=!1;this._storedError=void 0;this.onProgress=null;this.onClosed=null}_close(){this.onClosed?.(this)}_onDone(t){const e=t.chunk;if(this._requests.length>0){this._requests.shift().resolve({value:e,done:!1})}else this._queuedChunk=e;this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0;this._close()}_onError(t){this._storedError=(0,i.createResponseStatusError)(t,this._url);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0;this._queuedChunk=null}_onProgress(t){this.isStreamingSupported||this.onProgress?.({loaded:t.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){const t=this._queuedChunk;this._queuedChunk=null;return{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=(0,n.createPromiseCapability)();this._requests.push(t);return t.promise}cancel(t){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0;this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId);this._close()}}},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.PDFFetchStream=void 0;var n=s(1),i=s(22);function createFetchOptions(t,e,s){return{method:"GET",headers:t,signal:s.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function createHeaders(t){const e=new Headers;for(const s in t){const n=t[s];void 0!==n&&e.append(s,n)}return e}function getArrayBuffer(t){if(t instanceof Uint8Array)return t.buffer;if(t instanceof ArrayBuffer)return t;(0,n.warn)(`getArrayBuffer - unexpected data format: ${t}`);return new Uint8Array(t).buffer}e.PDFFetchStream=class PDFFetchStream{constructor(t){this.source=t;this.isHttp=/^https?:/i.test(t.url);this.httpHeaders=this.isHttp&&t.httpHeaders||{};this._fullRequestReader=null;this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){(0,n.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once.");this._fullRequestReader=new PDFFetchStreamReader(this);return this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const s=new PDFFetchStreamRangeReader(this,t,e);this._rangeRequestReaders.push(s);return s}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}};class PDFFetchStreamReader{constructor(t){this._stream=t;this._reader=null;this._loaded=0;this._filename=null;const e=t.source;this._withCredentials=e.withCredentials||!1;this._contentLength=e.length;this._headersCapability=(0,n.createPromiseCapability)();this._disableRange=e.disableRange||!1;this._rangeChunkSize=e.rangeChunkSize;this._rangeChunkSize||this._disableRange||(this._disableRange=!0);this._abortController=new AbortController;this._isStreamingSupported=!e.disableStream;this._isRangeSupported=!e.disableRange;this._headers=createHeaders(this._stream.httpHeaders);const s=e.url;fetch(s,createFetchOptions(this._headers,this._withCredentials,this._abortController)).then((t=>{if(!(0,i.validateResponseStatus)(t.status))throw(0,i.createResponseStatusError)(t.status,s);this._reader=t.body.getReader();this._headersCapability.resolve();const getResponseHeader=e=>t.headers.get(e),{allowRangeRequests:e,suggestedLength:a}=(0,i.validateRangeRequestCapabilities)({getResponseHeader:getResponseHeader,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=e;this._contentLength=a||this._contentLength;this._filename=(0,i.extractFilenameFromHeader)(getResponseHeader);!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new n.AbortException("Streaming is disabled."))})).catch(this._headersCapability.reject);this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;const{value:t,done:e}=await this._reader.read();if(e)return{value:t,done:e};this._loaded+=t.byteLength;this.onProgress?.({loaded:this._loaded,total:this._contentLength});return{value:getArrayBuffer(t),done:!1}}cancel(t){this._reader?.cancel(t);this._abortController.abort()}}class PDFFetchStreamRangeReader{constructor(t,e,s){this._stream=t;this._reader=null;this._loaded=0;const a=t.source;this._withCredentials=a.withCredentials||!1;this._readCapability=(0,n.createPromiseCapability)();this._isStreamingSupported=!a.disableStream;this._abortController=new AbortController;this._headers=createHeaders(this._stream.httpHeaders);this._headers.append("Range",`bytes=${e}-${s-1}`);const r=a.url;fetch(r,createFetchOptions(this._headers,this._withCredentials,this._abortController)).then((t=>{if(!(0,i.validateResponseStatus)(t.status))throw(0,i.createResponseStatusError)(t.status,r);this._readCapability.resolve();this._reader=t.body.getReader()})).catch(this._readCapability.reject);this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:t,done:e}=await this._reader.read();if(e)return{value:t,done:e};this._loaded+=t.byteLength;this.onProgress?.({loaded:this._loaded});return{value:getArrayBuffer(t),done:!1}}cancel(t){this._reader?.cancel(t);this._abortController.abort()}}},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.TextLayerRenderTask=void 0;e.renderTextLayer=function renderTextLayer(t){if(!t.textContentSource&&(t.textContent||t.textContentStream)){(0,i.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead.");t.textContentSource=t.textContent||t.textContentStream}const e=new TextLayerRenderTask(t);e._render();return e};e.updateTextLayer=function updateTextLayer({container:t,viewport:e,textDivs:s,textDivProperties:n,isOffscreenCanvasSupported:a,mustRotate:r=!0,mustRescale:o=!0}){r&&(0,i.setLayerDimensions)(t,{rotation:e.rotation});if(o){const t=getCtx(0,a),i={prevFontSize:null,prevFontFamily:null,div:null,scale:e.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:t};for(const t of s){i.properties=n.get(t);i.div=t;layout(i)}}};var n=s(1),i=s(6);const a=1e5,r=30,o=.8,l=new Map;function getCtx(t,e){let s;if(e&&n.FeatureTest.isOffscreenCanvasSupported)s=new OffscreenCanvas(t,t).getContext("2d",{alpha:!1});else{const e=document.createElement("canvas");e.width=e.height=t;s=e.getContext("2d",{alpha:!1})}return s}function appendText(t,e,s){const i=document.createElement("span"),a={angle:0,canvasWidth:0,hasText:""!==e.str,hasEOL:e.hasEOL,fontSize:0};t._textDivs.push(i);const c=n.Util.transform(t._transform,e.transform);let h=Math.atan2(c[1],c[0]);const d=s[e.fontName];d.vertical&&(h+=Math.PI/2);const u=Math.hypot(c[2],c[3]),p=u*function getAscent(t,e){const s=l.get(t);if(s)return s;const n=getCtx(r,e);n.font=`${r}px ${t}`;const i=n.measureText("");let a=i.fontBoundingBoxAscent,c=Math.abs(i.fontBoundingBoxDescent);if(a){const e=a/(a+c);l.set(t,e);n.canvas.width=n.canvas.height=0;return e}n.strokeStyle="red";n.clearRect(0,0,r,r);n.strokeText("g",0,0);let h=n.getImageData(0,0,r,r).data;c=0;for(let t=h.length-1-3;t>=0;t-=4)if(h[t]>0){c=Math.ceil(t/4/r);break}n.clearRect(0,0,r,r);n.strokeText("A",0,r);h=n.getImageData(0,0,r,r).data;a=0;for(let t=0,e=h.length;t<e;t+=4)if(h[t]>0){a=r-Math.floor(t/4/r);break}n.canvas.width=n.canvas.height=0;if(a){const e=a/(a+c);l.set(t,e);return e}l.set(t,o);return o}(d.fontFamily,t._isOffscreenCanvasSupported);let g,f;if(0===h){g=c[4];f=c[5]-p}else{g=c[4]+p*Math.sin(h);f=c[5]-p*Math.cos(h)}const m="calc(var(--scale-factor)*",b=i.style;if(t._container===t._rootContainer){b.left=`${(100*g/t._pageWidth).toFixed(2)}%`;b.top=`${(100*f/t._pageHeight).toFixed(2)}%`}else{b.left=`${m}${g.toFixed(2)}px)`;b.top=`${m}${f.toFixed(2)}px)`}b.fontSize=`${m}${u.toFixed(2)}px)`;b.fontFamily=d.fontFamily;a.fontSize=u;i.setAttribute("role","presentation");i.textContent=e.str;i.dir=e.dir;t._fontInspectorEnabled&&(i.dataset.fontName=e.fontName);0!==h&&(a.angle=h*(180/Math.PI));let A=!1;if(e.str.length>1)A=!0;else if(" "!==e.str&&e.transform[0]!==e.transform[3]){const t=Math.abs(e.transform[0]),s=Math.abs(e.transform[3]);t!==s&&Math.max(t,s)/Math.min(t,s)>1.5&&(A=!0)}A&&(a.canvasWidth=d.vertical?e.height:e.width);t._textDivProperties.set(i,a);t._isReadableStream&&t._layoutText(i)}function layout(t){const{div:e,scale:s,properties:n,ctx:i,prevFontSize:a,prevFontFamily:r}=t,{style:o}=e;let l="";if(0!==n.canvasWidth&&n.hasText){const{fontFamily:c}=o,{canvasWidth:h,fontSize:d}=n;if(a!==d||r!==c){i.font=`${d*s}px ${c}`;t.prevFontSize=d;t.prevFontFamily=c}const{width:u}=i.measureText(e.textContent);u>0&&(l=`scaleX(${h*s/u})`)}0!==n.angle&&(l=`rotate(${n.angle}deg) ${l}`);l.length>0&&(o.transform=l)}class TextLayerRenderTask{constructor({textContentSource:t,container:e,viewport:s,textDivs:a,textDivProperties:r,textContentItemsStr:o,isOffscreenCanvasSupported:l}){this._textContentSource=t;this._isReadableStream=t instanceof ReadableStream;this._container=this._rootContainer=e;this._textDivs=a||[];this._textContentItemsStr=o||[];this._isOffscreenCanvasSupported=l;this._fontInspectorEnabled=!!globalThis.FontInspector?.enabled;this._reader=null;this._textDivProperties=r||new WeakMap;this._canceled=!1;this._capability=(0,n.createPromiseCapability)();this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:s.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:getCtx(0,l)};const{pageWidth:c,pageHeight:h,pageX:d,pageY:u}=s.rawDims;this._transform=[1,0,0,-1,-d,u+h];this._pageWidth=c;this._pageHeight=h;(0,i.setLayerDimensions)(e,s);this._capability.promise.finally((()=>{this._layoutTextParams=null})).catch((()=>{}))}get promise(){return this._capability.promise}cancel(){this._canceled=!0;if(this._reader){this._reader.cancel(new n.AbortException("TextLayer task cancelled.")).catch((()=>{}));this._reader=null}this._capability.reject(new n.AbortException("TextLayer task cancelled."))}_processItems(t,e){for(const s of t)if(void 0!==s.str){this._textContentItemsStr.push(s.str);appendText(this,s,e)}else if("beginMarkedContentProps"===s.type||"beginMarkedContent"===s.type){const t=this._container;this._container=document.createElement("span");this._container.classList.add("markedContent");null!==s.id&&this._container.setAttribute("id",`${s.id}`);t.append(this._container)}else"endMarkedContent"===s.type&&(this._container=this._container.parentNode)}_layoutText(t){const e=this._layoutTextParams.properties=this._textDivProperties.get(t);this._layoutTextParams.div=t;layout(this._layoutTextParams);e.hasText&&this._container.append(t);if(e.hasEOL){const t=document.createElement("br");t.setAttribute("role","presentation");this._container.append(t)}}_render(){const t=(0,n.createPromiseCapability)();let e=Object.create(null);if(this._isReadableStream){const pump=()=>{this._reader.read().then((({value:s,done:n})=>{if(n)t.resolve();else{Object.assign(e,s.styles);this._processItems(s.items,e);pump()}}),t.reject)};this._reader=this._textContentSource.getReader();pump()}else{if(!this._textContentSource)throw new Error('No "textContentSource" parameter specified.');{const{items:e,styles:s}=this._textContentSource;this._processItems(e,s);t.resolve()}}t.promise.then((()=>{e=null;!function render(t){if(t._canceled)return;const e=t._textDivs,s=t._capability;if(e.length>a)s.resolve();else{if(!t._isReadableStream)for(const s of e)t._layoutText(s);s.resolve()}}(this)}),this._capability.reject)}}e.TextLayerRenderTask=TextLayerRenderTask},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.AnnotationEditorLayer=void 0;var n=s(1),i=s(5),a=s(28),r=s(29),o=s(6);class AnnotationEditorLayer{#At;#_t=!1;#vt=this.pointerup.bind(this);#yt=this.pointerdown.bind(this);#St=new Map;#xt=!1;#Et=!1;#Ct;static _initialized=!1;constructor(t){if(!AnnotationEditorLayer._initialized){AnnotationEditorLayer._initialized=!0;a.FreeTextEditor.initialize(t.l10n);r.InkEditor.initialize(t.l10n)}t.uiManager.registerEditorTypes([a.FreeTextEditor,r.InkEditor]);this.#Ct=t.uiManager;this.pageIndex=t.pageIndex;this.div=t.div;this.#At=t.accessibilityManager;this.#Ct.addLayer(this)}get isEmpty(){return 0===this.#St.size}updateToolbar(t){this.#Ct.updateToolbar(t)}updateMode(t=this.#Ct.getMode()){this.#Pt();if(t===n.AnnotationEditorType.INK){this.addInkEditorIfNeeded(!1);this.disableClick()}else this.enableClick();this.#Ct.unselectAll();if(t!==n.AnnotationEditorType.NONE){this.div.classList.toggle("freeTextEditing",t===n.AnnotationEditorType.FREETEXT);this.div.classList.toggle("inkEditing",t===n.AnnotationEditorType.INK);this.div.hidden=!1}}addInkEditorIfNeeded(t){if(!t&&this.#Ct.getMode()!==n.AnnotationEditorType.INK)return;if(!t)for(const t of this.#St.values())if(t.isEmpty()){t.setInBackground();return}this.#Tt({offsetX:0,offsetY:0}).setInBackground()}setEditingState(t){this.#Ct.setEditingState(t)}addCommands(t){this.#Ct.addCommands(t)}enable(){this.div.style.pointerEvents="auto";for(const t of this.#St.values())t.enableEditing()}disable(){this.div.style.pointerEvents="none";for(const t of this.#St.values())t.disableEditing();this.#Pt();this.isEmpty&&(this.div.hidden=!0)}setActiveEditor(t){this.#Ct.getActive()!==t&&this.#Ct.setActiveEditor(t)}enableClick(){this.div.addEventListener("pointerdown",this.#yt);this.div.addEventListener("pointerup",this.#vt)}disableClick(){this.div.removeEventListener("pointerdown",this.#yt);this.div.removeEventListener("pointerup",this.#vt)}attach(t){this.#St.set(t.id,t)}detach(t){this.#St.delete(t.id);this.#At?.removePointerInTextLayer(t.contentDiv)}remove(t){this.#Ct.removeEditor(t);this.detach(t);t.div.style.display="none";setTimeout((()=>{t.div.style.display="";t.div.remove();t.isAttachedToDOM=!1;document.activeElement===document.body&&this.#Ct.focusMainContainer()}),0);this.#Et||this.addInkEditorIfNeeded(!1)}#wt(t){if(t.parent!==this){this.attach(t);t.parent?.detach(t);t.setParent(this);if(t.div&&t.isAttachedToDOM){t.div.remove();this.div.append(t.div)}}}add(t){this.#wt(t);this.#Ct.addEditor(t);this.attach(t);if(!t.isAttachedToDOM){const e=t.render();this.div.append(e);t.isAttachedToDOM=!0}this.moveEditorInDOM(t);t.onceAdded();this.#Ct.addToAnnotationStorage(t)}moveEditorInDOM(t){this.#At?.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addOrRebuild(t){t.needsToBeRebuilt()?t.rebuild():this.add(t)}addANewEditor(t){this.addCommands({cmd:()=>{this.addOrRebuild(t)},undo:()=>{t.remove()},mustExec:!0})}addUndoableEditor(t){this.addCommands({cmd:()=>{this.addOrRebuild(t)},undo:()=>{t.remove()},mustExec:!1})}getNextId(){return this.#Ct.getId()}#kt(t){switch(this.#Ct.getMode()){case n.AnnotationEditorType.FREETEXT:return new a.FreeTextEditor(t);case n.AnnotationEditorType.INK:return new r.InkEditor(t)}return null}deserialize(t){switch(t.annotationType){case n.AnnotationEditorType.FREETEXT:return a.FreeTextEditor.deserialize(t,this,this.#Ct);case n.AnnotationEditorType.INK:return r.InkEditor.deserialize(t,this,this.#Ct)}return null}#Tt(t){const e=this.getNextId(),s=this.#kt({parent:this,id:e,x:t.offsetX,y:t.offsetY,uiManager:this.#Ct});s&&this.add(s);return s}setSelected(t){this.#Ct.setSelected(t)}toggleSelected(t){this.#Ct.toggleSelected(t)}isSelected(t){return this.#Ct.isSelected(t)}unselect(t){this.#Ct.unselect(t)}pointerup(t){const{isMac:e}=n.FeatureTest.platform;if(!(0!==t.button||t.ctrlKey&&e)&&t.target===this.div&&this.#xt){this.#xt=!1;this.#_t?this.#Tt(t):this.#_t=!0}}pointerdown(t){const{isMac:e}=n.FeatureTest.platform;if(0!==t.button||t.ctrlKey&&e)return;if(t.target!==this.div)return;this.#xt=!0;const s=this.#Ct.getActive();this.#_t=!s||s.isEmpty()}drop(t){const e=t.dataTransfer.getData("text/plain"),s=this.#Ct.getEditor(e);if(!s)return;t.preventDefault();t.dataTransfer.dropEffect="move";this.#wt(s);const n=this.div.getBoundingClientRect(),i=t.clientX-n.x,a=t.clientY-n.y;s.translate(i-s.startX,a-s.startY);this.moveEditorInDOM(s);s.div.focus()}dragover(t){t.preventDefault()}destroy(){this.#Ct.getActive()?.parent===this&&this.#Ct.setActiveEditor(null);for(const t of this.#St.values()){this.#At?.removePointerInTextLayer(t.contentDiv);t.setParent(null);t.isAttachedToDOM=!1;t.div.remove()}this.div=null;this.#St.clear();this.#Ct.removeLayer(this)}#Pt(){this.#Et=!0;for(const t of this.#St.values())t.isEmpty()&&t.remove();this.#Et=!1}render({viewport:t}){this.viewport=t;(0,o.setLayerDimensions)(this.div,t);(0,i.bindEvents)(this,this.div,["dragover","drop"]);for(const t of this.#Ct.getEditors(this.pageIndex))this.add(t);this.updateMode()}update({viewport:t}){this.#Ct.commitOrRemove();this.viewport=t;(0,o.setLayerDimensions)(this.div,{rotation:t.rotation});this.updateMode()}get pageDimensions(){const{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}}e.AnnotationEditorLayer=AnnotationEditorLayer},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.FreeTextEditor=void 0;var n=s(1),i=s(5),a=s(4);class FreeTextEditor extends a.AnnotationEditor{#Rt=this.editorDivBlur.bind(this);#Mt=this.editorDivFocus.bind(this);#Ft=this.editorDivInput.bind(this);#Dt=this.editorDivKeydown.bind(this);#It;#Ot="";#Lt=`${this.id}-editor`;#Nt=!1;#jt;static _freeTextDefaultContent="";static _l10nPromise;static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static _keyboardManager=new i.KeyboardManager([[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],FreeTextEditor.prototype.commitOrRemove]]);static _type="freetext";constructor(t){super({...t,name:"freeTextEditor"});this.#It=t.color||FreeTextEditor._defaultColor||a.AnnotationEditor._defaultLineColor;this.#jt=t.fontSize||FreeTextEditor._defaultFontSize}static initialize(t){this._l10nPromise=new Map(["free_text2_default_content","editor_free_text2_aria_label"].map((e=>[e,t.get(e)])));const e=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(e.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,e){switch(t){case n.AnnotationEditorParamsType.FREETEXT_SIZE:FreeTextEditor._defaultFontSize=e;break;case n.AnnotationEditorParamsType.FREETEXT_COLOR:FreeTextEditor._defaultColor=e}}updateParams(t,e){switch(t){case n.AnnotationEditorParamsType.FREETEXT_SIZE:this.#Ut(e);break;case n.AnnotationEditorParamsType.FREETEXT_COLOR:this.#Bt(e)}}static get defaultPropertiesToUpdate(){return[[n.AnnotationEditorParamsType.FREETEXT_SIZE,FreeTextEditor._defaultFontSize],[n.AnnotationEditorParamsType.FREETEXT_COLOR,FreeTextEditor._defaultColor||a.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[n.AnnotationEditorParamsType.FREETEXT_SIZE,this.#jt],[n.AnnotationEditorParamsType.FREETEXT_COLOR,this.#It]]}#Ut(t){const setFontsize=t=>{this.editorDiv.style.fontSize=`calc(${t}px * var(--scale-factor))`;this.translate(0,-(t-this.#jt)*this.parentScale);this.#jt=t;this.#qt()},e=this.#jt;this.addCommands({cmd:()=>{setFontsize(t)},undo:()=>{setFontsize(e)},mustExec:!0,type:n.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#Bt(t){const e=this.#It;this.addCommands({cmd:()=>{this.#It=this.editorDiv.style.color=t},undo:()=>{this.#It=this.editorDiv.style.color=e},mustExec:!0,type:n.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}getInitialTranslation(){const t=this.parentScale;return[-FreeTextEditor._internalPadding*t,-(FreeTextEditor._internalPadding+this.#jt)*t]}rebuild(){super.rebuild();null!==this.div&&(this.isAttachedToDOM||this.parent.add(this))}enableEditMode(){if(!this.isInEditMode()){this.parent.setEditingState(!1);this.parent.updateToolbar(n.AnnotationEditorType.FREETEXT);super.enableEditMode();this.overlayDiv.classList.remove("enabled");this.editorDiv.contentEditable=!0;this.div.draggable=!1;this.div.removeAttribute("aria-activedescendant");this.editorDiv.addEventListener("keydown",this.#Dt);this.editorDiv.addEventListener("focus",this.#Mt);this.editorDiv.addEventListener("blur",this.#Rt);this.editorDiv.addEventListener("input",this.#Ft)}}disableEditMode(){if(this.isInEditMode()){this.parent.setEditingState(!0);super.disableEditMode();this.overlayDiv.classList.add("enabled");this.editorDiv.contentEditable=!1;this.div.setAttribute("aria-activedescendant",this.#Lt);this.div.draggable=!0;this.editorDiv.removeEventListener("keydown",this.#Dt);this.editorDiv.removeEventListener("focus",this.#Mt);this.editorDiv.removeEventListener("blur",this.#Rt);this.editorDiv.removeEventListener("input",this.#Ft);this.div.focus({preventScroll:!0});this.isEditing=!1;this.parent.div.classList.add("freeTextEditing")}}focusin(t){super.focusin(t);t.target!==this.editorDiv&&this.editorDiv.focus()}onceAdded(){if(!this.width){this.enableEditMode();this.editorDiv.focus()}}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1;this.parent.setEditingState(!0);this.parent.div.classList.add("freeTextEditing");super.remove()}#Wt(){const t=this.editorDiv.getElementsByTagName("div");if(0===t.length)return this.editorDiv.innerText;const e=[];for(const s of t)e.push(s.innerText.replace(/\r\n?|\n/,""));return e.join("\n")}#qt(){const[t,e]=this.parentDimensions;let s;if(this.isAttachedToDOM)s=this.div.getBoundingClientRect();else{const{currentLayer:t,div:e}=this,n=e.style.display;e.style.display="hidden";t.div.append(this.div);s=e.getBoundingClientRect();e.remove();e.style.display=n}this.width=s.width/t;this.height=s.height/e}commit(){if(this.isInEditMode()){super.commit();if(!this.#Nt){this.#Nt=!0;this.parent.addUndoableEditor(this)}this.disableEditMode();this.#Ot=this.#Wt().trimEnd();this.#qt()}}shouldGetKeyboardEvents(){return this.isInEditMode()}dblclick(t){this.enableEditMode();this.editorDiv.focus()}keydown(t){if(t.target===this.div&&"Enter"===t.key){this.enableEditMode();this.editorDiv.focus()}}editorDivKeydown(t){FreeTextEditor._keyboardManager.exec(this,t)}editorDivFocus(t){this.isEditing=!0}editorDivBlur(t){this.isEditing=!1}editorDivInput(t){this.parent.div.classList.toggle("freeTextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment");this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox");this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let t,e;if(this.width){t=this.x;e=this.y}super.render();this.editorDiv=document.createElement("div");this.editorDiv.className="internal";this.editorDiv.setAttribute("id",this.#Lt);this.enableEditing();FreeTextEditor._l10nPromise.get("editor_free_text2_aria_label").then((t=>this.editorDiv?.setAttribute("aria-label",t)));FreeTextEditor._l10nPromise.get("free_text2_default_content").then((t=>this.editorDiv?.setAttribute("default-content",t)));this.editorDiv.contentEditable=!0;const{style:s}=this.editorDiv;s.fontSize=`calc(${this.#jt}px * var(--scale-factor))`;s.color=this.#It;this.div.append(this.editorDiv);this.overlayDiv=document.createElement("div");this.overlayDiv.classList.add("overlay","enabled");this.div.append(this.overlayDiv);(0,i.bindEvents)(this,this.div,["dblclick","keydown"]);if(this.width){const[s,n]=this.parentDimensions;this.setAt(t*s,e*n,this.width*s,this.height*n);for(const t of this.#Ot.split("\n")){const e=document.createElement("div");e.append(t?document.createTextNode(t):document.createElement("br"));this.editorDiv.append(e)}this.div.draggable=!0;this.editorDiv.contentEditable=!1}else{this.div.draggable=!1;this.editorDiv.contentEditable=!0}return this.div}get contentDiv(){return this.editorDiv}static deserialize(t,e,s){const i=super.deserialize(t,e,s);i.#jt=t.fontSize;i.#It=n.Util.makeHexColor(...t.color);i.#Ot=t.value;return i}serialize(){if(this.isEmpty())return null;const t=FreeTextEditor._internalPadding*this.parentScale,e=this.getRect(t,t),s=a.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.#It);return{annotationType:n.AnnotationEditorType.FREETEXT,color:s,fontSize:this.#jt,value:this.#Ot,pageIndex:this.pageIndex,rect:e,rotation:this.rotation}}}e.FreeTextEditor=FreeTextEditor},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.InkEditor=void 0;Object.defineProperty(e,"fitCurve",{enumerable:!0,get:function(){return a.fitCurve}});var n=s(1),i=s(4),a=s(30),r=s(5);const o=16;class InkEditor extends i.AnnotationEditor{#Ht=0;#Gt=0;#zt=0;#Vt=this.canvasPointermove.bind(this);#Xt=this.canvasPointerleave.bind(this);#$t=this.canvasPointerup.bind(this);#Yt=this.canvasPointerdown.bind(this);#Kt=!1;#Jt=!1;#Qt=null;#Zt=null;#te=0;#ee=0;#se=null;static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=1;static _l10nPromise;static _type="ink";constructor(t){super({...t,name:"inkEditor"});this.color=t.color||null;this.thickness=t.thickness||null;this.opacity=t.opacity||null;this.paths=[];this.bezierPath2D=[];this.currentPath=[];this.scaleFactor=1;this.translationX=this.translationY=0;this.x=0;this.y=0}static initialize(t){this._l10nPromise=new Map(["editor_ink_canvas_aria_label","editor_ink2_aria_label"].map((e=>[e,t.get(e)])))}static updateDefaultParams(t,e){switch(t){case n.AnnotationEditorParamsType.INK_THICKNESS:InkEditor._defaultThickness=e;break;case n.AnnotationEditorParamsType.INK_COLOR:InkEditor._defaultColor=e;break;case n.AnnotationEditorParamsType.INK_OPACITY:InkEditor._defaultOpacity=e/100}}updateParams(t,e){switch(t){case n.AnnotationEditorParamsType.INK_THICKNESS:this.#ne(e);break;case n.AnnotationEditorParamsType.INK_COLOR:this.#Bt(e);break;case n.AnnotationEditorParamsType.INK_OPACITY:this.#ie(e)}}static get defaultPropertiesToUpdate(){return[[n.AnnotationEditorParamsType.INK_THICKNESS,InkEditor._defaultThickness],[n.AnnotationEditorParamsType.INK_COLOR,InkEditor._defaultColor||i.AnnotationEditor._defaultLineColor],[n.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*InkEditor._defaultOpacity)]]}get propertiesToUpdate(){return[[n.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||InkEditor._defaultThickness],[n.AnnotationEditorParamsType.INK_COLOR,this.color||InkEditor._defaultColor||i.AnnotationEditor._defaultLineColor],[n.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(this.opacity??InkEditor._defaultOpacity))]]}#ne(t){const e=this.thickness;this.addCommands({cmd:()=>{this.thickness=t;this.#ae()},undo:()=>{this.thickness=e;this.#ae()},mustExec:!0,type:n.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}#Bt(t){const e=this.color;this.addCommands({cmd:()=>{this.color=t;this.#re()},undo:()=>{this.color=e;this.#re()},mustExec:!0,type:n.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}#ie(t){t/=100;const e=this.opacity;this.addCommands({cmd:()=>{this.opacity=t;this.#re()},undo:()=>{this.opacity=e;this.#re()},mustExec:!0,type:n.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}rebuild(){super.rebuild();if(null!==this.div){if(!this.canvas){this.#oe();this.#le()}if(!this.isAttachedToDOM){this.parent.add(this);this.#ce()}this.#ae()}}remove(){if(null!==this.canvas){this.isEmpty()||this.commit();this.canvas.width=this.canvas.height=0;this.canvas.remove();this.canvas=null;this.#Zt.disconnect();this.#Zt=null;super.remove()}}setParent(t){!this.parent&&t?this._uiManager.removeShouldRescale(this):this.parent&&null===t&&this._uiManager.addShouldRescale(this);super.setParent(t)}onScaleChanging(){const[t,e]=this.parentDimensions,s=this.width*t,n=this.height*e;this.setDimensions(s,n)}enableEditMode(){if(!this.#Kt&&null!==this.canvas){super.enableEditMode();this.div.draggable=!1;this.canvas.addEventListener("pointerdown",this.#Yt);this.canvas.addEventListener("pointerup",this.#$t)}}disableEditMode(){if(this.isInEditMode()&&null!==this.canvas){super.disableEditMode();this.div.draggable=!this.isEmpty();this.div.classList.remove("editing");this.canvas.removeEventListener("pointerdown",this.#Yt);this.canvas.removeEventListener("pointerup",this.#$t)}}onceAdded(){this.div.draggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}#he(){const{parentRotation:t,parentDimensions:[e,s]}=this;switch(t){case 90:return[0,s,s,e];case 180:return[e,s,e,s];case 270:return[e,0,s,e];default:return[0,0,e,s]}}#de(){const{ctx:t,color:e,opacity:s,thickness:n,parentScale:i,scaleFactor:a}=this;t.lineWidth=n*i/a;t.lineCap="round";t.lineJoin="round";t.miterLimit=10;t.strokeStyle=`${e}${(0,r.opacityToHex)(s)}`}#ue(t,e){this.isEditing=!0;if(!this.#Jt){this.#Jt=!0;this.#ce();this.thickness||=InkEditor._defaultThickness;this.color||=InkEditor._defaultColor||i.AnnotationEditor._defaultLineColor;this.opacity??=InkEditor._defaultOpacity}this.currentPath.push([t,e]);this.#Qt=null;this.#de();this.ctx.beginPath();this.ctx.moveTo(t,e);this.#se=()=>{if(this.#se){if(this.#Qt){if(this.isEmpty()){this.ctx.setTransform(1,0,0,1,0,0);this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height)}else this.#re();this.ctx.lineTo(...this.#Qt);this.#Qt=null;this.ctx.stroke()}window.requestAnimationFrame(this.#se)}};window.requestAnimationFrame(this.#se)}#pe(t,e){const[s,n]=this.currentPath.at(-1);if(t!==s||e!==n){this.currentPath.push([t,e]);this.#Qt=[t,e]}}#ge(t,e){this.ctx.closePath();this.#se=null;t=Math.min(Math.max(t,0),this.canvas.width);e=Math.min(Math.max(e,0),this.canvas.height);const[s,n]=this.currentPath.at(-1);t===s&&e===n||this.currentPath.push([t,e]);let i;if(1!==this.currentPath.length)i=(0,a.fitCurve)(this.currentPath,30,null);else{const s=[t,e];i=[[s,s.slice(),s.slice(),s]]}const r=InkEditor.#fe(i);this.currentPath.length=0;this.addCommands({cmd:()=>{this.paths.push(i);this.bezierPath2D.push(r);this.rebuild()},undo:()=>{this.paths.pop();this.bezierPath2D.pop();if(0===this.paths.length)this.remove();else{if(!this.canvas){this.#oe();this.#le()}this.#ae()}},mustExec:!0})}#re(){if(this.isEmpty()){this.#me();return}this.#de();const{canvas:t,ctx:e}=this;e.setTransform(1,0,0,1,0,0);e.clearRect(0,0,t.width,t.height);this.#me();for(const t of this.bezierPath2D)e.stroke(t)}commit(){if(!this.#Kt){super.commit();this.isEditing=!1;this.disableEditMode();this.setInForeground();this.#Kt=!0;this.div.classList.add("disabled");this.#ae(!0);this.parent.addInkEditorIfNeeded(!0);this.parent.moveEditorInDOM(this);this.div.focus({preventScroll:!0})}}focusin(t){super.focusin(t);this.enableEditMode()}canvasPointerdown(t){if(0===t.button&&this.isInEditMode()&&!this.#Kt){this.setInForeground();"mouse"!==t.type&&this.div.focus();t.stopPropagation();this.canvas.addEventListener("pointerleave",this.#Xt);this.canvas.addEventListener("pointermove",this.#Vt);this.#ue(t.offsetX,t.offsetY)}}canvasPointermove(t){t.stopPropagation();this.#pe(t.offsetX,t.offsetY)}canvasPointerup(t){if(0===t.button&&this.isInEditMode()&&0!==this.currentPath.length){t.stopPropagation();this.#be(t);this.setInBackground()}}canvasPointerleave(t){this.#be(t);this.setInBackground()}#be(t){this.#ge(t.offsetX,t.offsetY);this.canvas.removeEventListener("pointerleave",this.#Xt);this.canvas.removeEventListener("pointermove",this.#Vt);this.addToAnnotationStorage()}#oe(){this.canvas=document.createElement("canvas");this.canvas.width=this.canvas.height=0;this.canvas.className="inkEditorCanvas";InkEditor._l10nPromise.get("editor_ink_canvas_aria_label").then((t=>this.canvas?.setAttribute("aria-label",t)));this.div.append(this.canvas);this.ctx=this.canvas.getContext("2d")}#le(){let t=null;this.#Zt=new ResizeObserver((e=>{const s=e[0].contentRect;if(s.width&&s.height){null!==t&&clearTimeout(t);t=setTimeout((()=>{this.fixDims();t=null}),100);this.setDimensions(s.width,s.height)}}));this.#Zt.observe(this.div)}render(){if(this.div)return this.div;let t,e;if(this.width){t=this.x;e=this.y}super.render();InkEditor._l10nPromise.get("editor_ink2_aria_label").then((t=>this.div?.setAttribute("aria-label",t)));const[s,n,i,a]=this.#he();this.setAt(s,n,0,0);this.setDims(i,a);this.#oe();if(this.width){const[s,n]=this.parentDimensions;this.setAt(t*s,e*n,this.width*s,this.height*n);this.#Jt=!0;this.#ce();this.setDims(this.width*s,this.height*n);this.#re();this.#Ae();this.div.classList.add("disabled")}else{this.div.classList.add("editing");this.enableEditMode()}this.#le();return this.div}#ce(){if(!this.#Jt)return;const[t,e]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*t);this.canvas.height=Math.ceil(this.height*e);this.#me()}setDimensions(t,e){const s=Math.round(t),n=Math.round(e);if(this.#te===s&&this.#ee===n)return;this.#te=s;this.#ee=n;this.canvas.style.visibility="hidden";if(this.#Ht&&Math.abs(this.#Ht-t/e)>.01){e=Math.ceil(t/this.#Ht);this.setDims(t,e)}const[i,a]=this.parentDimensions;this.width=t/i;this.height=e/a;this.#Kt&&this.#_e(t,e);this.#ce();this.#re();this.canvas.style.visibility="visible"}#_e(t,e){const s=this.#ve(),n=(t-s)/this.#zt,i=(e-s)/this.#Gt;this.scaleFactor=Math.min(n,i)}#me(){const t=this.#ve()/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+t,this.translationY*this.scaleFactor+t)}static#fe(t){const e=new Path2D;for(let s=0,n=t.length;s<n;s++){const[n,i,a,r]=t[s];0===s&&e.moveTo(...n);e.bezierCurveTo(i[0],i[1],a[0],a[1],r[0],r[1])}return e}#ye(t,e,s,n){const i=[],a=this.thickness/2;let r,o;for(const l of this.paths){r=[];o=[];for(let i=0,c=l.length;i<c;i++){const[c,h,d,u]=l[i],p=t*(c[0]+e)+a,g=n-t*(c[1]+s)-a,f=t*(h[0]+e)+a,m=n-t*(h[1]+s)-a,b=t*(d[0]+e)+a,A=n-t*(d[1]+s)-a,_=t*(u[0]+e)+a,v=n-t*(u[1]+s)-a;if(0===i){r.push(p,g);o.push(p,g)}r.push(f,m,b,A,_,v);this.#Se(p,g,f,m,b,A,_,v,4,o)}i.push({bezier:r,points:o})}return i}#Se(t,e,s,n,i,a,r,o,l,c){if(this.#xe(t,e,s,n,i,a,r,o))c.push(r,o);else{for(let h=1;h<l-1;h++){const d=h/l,u=1-d;let p=d*t+u*s,g=d*e+u*n,f=d*s+u*i,m=d*n+u*a;p=d*p+u*f;g=d*g+u*m;f=d*f+u*(d*i+u*r);m=d*m+u*(d*a+u*o);p=d*p+u*f;g=d*g+u*m;c.push(p,g)}c.push(r,o)}}#xe(t,e,s,n,i,a,r,o){const l=(3*s-2*t-r)**2,c=(3*n-2*e-o)**2,h=(3*i-t-2*r)**2,d=(3*a-e-2*o)**2;return Math.max(l,h)+Math.max(c,d)<=10}#Ee(){let t=1/0,e=-1/0,s=1/0,i=-1/0;for(const a of this.paths)for(const[r,o,l,c]of a){const a=n.Util.bezierBoundingBox(...r,...o,...l,...c);t=Math.min(t,a[0]);s=Math.min(s,a[1]);e=Math.max(e,a[2]);i=Math.max(i,a[3])}return[t,s,e,i]}#ve(){return this.#Kt?Math.ceil(this.thickness*this.parentScale):0}#ae(t=!1){if(this.isEmpty())return;if(!this.#Kt){this.#re();return}const e=this.#Ee(),s=this.#ve();this.#zt=Math.max(o,e[2]-e[0]);this.#Gt=Math.max(o,e[3]-e[1]);const n=Math.ceil(s+this.#zt*this.scaleFactor),i=Math.ceil(s+this.#Gt*this.scaleFactor),[a,r]=this.parentDimensions;this.width=n/a;this.height=i/r;this.#Ht=n/i;this.#Ae();const l=this.translationX,c=this.translationY;this.translationX=-e[0];this.translationY=-e[1];this.#ce();this.#re();this.#te=n;this.#ee=i;this.setDims(n,i);const h=t?s/this.scaleFactor/2:0;this.translate(l-this.translationX-h,c-this.translationY-h)}#Ae(){const{style:t}=this.div;if(this.#Ht>=1){t.minHeight="16px";t.minWidth=`${Math.round(this.#Ht*o)}px`}else{t.minWidth="16px";t.minHeight=`${Math.round(o/this.#Ht)}px`}}static deserialize(t,e,s){const i=super.deserialize(t,e,s);i.thickness=t.thickness;i.color=n.Util.makeHexColor(...t.color);i.opacity=t.opacity;const[a,r]=i.pageDimensions,l=i.width*a,c=i.height*r,h=i.parentScale,d=t.thickness/2;i.#Ht=l/c;i.#Kt=!0;i.#te=Math.round(l);i.#ee=Math.round(c);for(const{bezier:e}of t.paths){const t=[];i.paths.push(t);let s=h*(e[0]-d),n=h*(c-e[1]-d);for(let i=2,a=e.length;i<a;i+=6){const a=h*(e[i]-d),r=h*(c-e[i+1]-d),o=h*(e[i+2]-d),l=h*(c-e[i+3]-d),u=h*(e[i+4]-d),p=h*(c-e[i+5]-d);t.push([[s,n],[a,r],[o,l],[u,p]]);s=u;n=p}const a=this.#fe(t);i.bezierPath2D.push(a)}const u=i.#Ee();i.#zt=Math.max(o,u[2]-u[0]);i.#Gt=Math.max(o,u[3]-u[1]);i.#_e(l,c);return i}serialize(){if(this.isEmpty())return null;const t=this.getRect(0,0),e=this.rotation%180==0?t[3]-t[1]:t[2]-t[0],s=i.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);return{annotationType:n.AnnotationEditorType.INK,color:s,thickness:this.thickness,opacity:this.opacity,paths:this.#ye(this.scaleFactor/this.parentScale,this.translationX,this.translationY,e),pageIndex:this.pageIndex,rect:t,rotation:this.rotation}}}e.InkEditor=InkEditor},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.fitCurve=void 0;const n=s(31);e.fitCurve=n},t=>{function fitCubic(t,e,s,n,i){var a,r,o,l,c,h,d,u,p,g,f,m,b;if(2===t.length){m=maths.vectorLen(maths.subtract(t[0],t[1]))/3;return[a=[t[0],maths.addArrays(t[0],maths.mulItems(e,m)),maths.addArrays(t[1],maths.mulItems(s,m)),t[1]]]}r=function chordLengthParameterize(t){var e,s,n,i=[];t.forEach(((t,a)=>{e=a?s+maths.vectorLen(maths.subtract(t,n)):0;i.push(e);s=e;n=t}));i=i.map((t=>t/s));return i}(t);[a,l,h]=generateAndReport(t,r,r,e,s,i);if(0===l||l<n)return[a];if(l<n*n){o=r;c=l;d=h;for(b=0;b<20;b++){o=reparameterize(a,t,o);[a,l,h]=generateAndReport(t,r,o,e,s,i);if(l<n)return[a];if(h===d){let t=l/c;if(t>.9999&&t<1.0001)break}c=l;d=h}}f=[];if((u=maths.subtract(t[h-1],t[h+1])).every((t=>0===t))){u=maths.subtract(t[h-1],t[h]);[u[0],u[1]]=[-u[1],u[0]]}p=maths.normalize(u);g=maths.mulItems(p,-1);return f=(f=f.concat(fitCubic(t.slice(0,h+1),e,p,n,i))).concat(fitCubic(t.slice(h),g,s,n,i))}function generateAndReport(t,e,s,n,i,a){var r,o,l;r=function generateBezier(t,e,s,n){var i,a,r,o,l,c,h,d,u,p,g,f,m,b,A,_,v,y=t[0],S=t[t.length-1];i=[y,null,null,S];a=maths.zeros_Xx2x2(e.length);for(m=0,b=e.length;m<b;m++){v=1-(_=e[m]);(r=a[m])[0]=maths.mulItems(s,3*_*(v*v));r[1]=maths.mulItems(n,3*v*(_*_))}o=[[0,0],[0,0]];l=[0,0];for(m=0,b=t.length;m<b;m++){_=e[m];r=a[m];o[0][0]+=maths.dot(r[0],r[0]);o[0][1]+=maths.dot(r[0],r[1]);o[1][0]+=maths.dot(r[0],r[1]);o[1][1]+=maths.dot(r[1],r[1]);A=maths.subtract(t[m],bezier.q([y,y,S,S],_));l[0]+=maths.dot(r[0],A);l[1]+=maths.dot(r[1],A)}c=o[0][0]*o[1][1]-o[1][0]*o[0][1];h=o[0][0]*l[1]-o[1][0]*l[0];d=l[0]*o[1][1]-l[1]*o[0][1];u=0===c?0:d/c;p=0===c?0:h/c;f=maths.vectorLen(maths.subtract(y,S));if(u<(g=1e-6*f)||p<g){i[1]=maths.addArrays(y,maths.mulItems(s,f/3));i[2]=maths.addArrays(S,maths.mulItems(n,f/3))}else{i[1]=maths.addArrays(y,maths.mulItems(s,u));i[2]=maths.addArrays(S,maths.mulItems(n,p))}return i}(t,s,n,i);[o,l]=function computeMaxError(t,e,s){var n,i,a,r,o,l,c,h;i=0;a=Math.floor(t.length/2);const d=mapTtoRelativeDistances(e,10);for(o=0,l=t.length;o<l;o++){c=t[o];h=find_t(e,s[o],d,10);if((n=(r=maths.subtract(bezier.q(e,h),c))[0]*r[0]+r[1]*r[1])>i){i=n;a=o}}return[i,a]}(t,r,e);a&&a({bez:r,points:t,params:e,maxErr:o,maxPoint:l});return[r,o,l]}function reparameterize(t,e,s){return s.map(((s,n)=>newtonRaphsonRootFind(t,e[n],s)))}function newtonRaphsonRootFind(t,e,s){var n=maths.subtract(bezier.q(t,s),e),i=bezier.qprime(t,s),a=maths.mulMatrix(n,i),r=maths.sum(maths.squareItems(i))+2*maths.mulMatrix(n,bezier.qprimeprime(t,s));return 0===r?s:s-a/r}var mapTtoRelativeDistances=function(t,e){for(var s,n=[0],i=t[0],a=0,r=1;r<=e;r++){s=bezier.q(t,r/e);a+=maths.vectorLen(maths.subtract(s,i));n.push(a);i=s}return n=n.map((t=>t/a))};function find_t(t,e,s,n){if(e<0)return 0;if(e>1)return 1;for(var i,a,r,o,l=1;l<=n;l++)if(e<=s[l]){r=(l-1)/n;a=l/n;o=(e-(i=s[l-1]))/(s[l]-i)*(a-r)+r;break}return o}function createTangent(t,e){return maths.normalize(maths.subtract(t,e))}class maths{static zeros_Xx2x2(t){for(var e=[];t--;)e.push([0,0]);return e}static mulItems(t,e){return t.map((t=>t*e))}static mulMatrix(t,e){return t.reduce(((t,s,n)=>t+s*e[n]),0)}static subtract(t,e){return t.map(((t,s)=>t-e[s]))}static addArrays(t,e){return t.map(((t,s)=>t+e[s]))}static addItems(t,e){return t.map((t=>t+e))}static sum(t){return t.reduce(((t,e)=>t+e))}static dot(t,e){return maths.mulMatrix(t,e)}static vectorLen(t){return Math.hypot(...t)}static divItems(t,e){return t.map((t=>t/e))}static squareItems(t){return t.map((t=>t*t))}static normalize(t){return this.divItems(t,this.vectorLen(t))}}class bezier{static q(t,e){var s=1-e,n=maths.mulItems(t[0],s*s*s),i=maths.mulItems(t[1],3*s*s*e),a=maths.mulItems(t[2],3*s*e*e),r=maths.mulItems(t[3],e*e*e);return maths.addArrays(maths.addArrays(n,i),maths.addArrays(a,r))}static qprime(t,e){var s=1-e,n=maths.mulItems(maths.subtract(t[1],t[0]),3*s*s),i=maths.mulItems(maths.subtract(t[2],t[1]),6*s*e),a=maths.mulItems(maths.subtract(t[3],t[2]),3*e*e);return maths.addArrays(maths.addArrays(n,i),a)}static qprimeprime(t,e){return maths.addArrays(maths.mulItems(maths.addArrays(maths.subtract(t[2],maths.mulItems(t[1],2)),t[0]),6*(1-e)),maths.mulItems(maths.addArrays(maths.subtract(t[3],maths.mulItems(t[2],2)),t[1]),6*e))}}t.exports=function fitCurve(t,e,s){if(!Array.isArray(t))throw new TypeError("First argument should be an array");t.forEach((e=>{if(!Array.isArray(e)||e.some((t=>"number"!=typeof t))||e.length!==t[0].length)throw Error("Each point should be an array of numbers. Each point should have the same amount of numbers.")}));if((t=t.filter(((e,s)=>0===s||!e.every(((e,n)=>e===t[s-1][n]))))).length<2)return[];const n=t.length,i=createTangent(t[1],t[0]),a=createTangent(t[n-2],t[n-1]);return fitCubic(t,i,a,e,s)};t.exports.fitCubic=fitCubic;t.exports.createTangent=createTangent},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.AnnotationLayer=void 0;var n=s(1),i=s(6),a=s(3),r=s(33),o=s(34);const l=1e3,c=new WeakSet;function getRectDims(t){return{width:t[2]-t[0],height:t[3]-t[1]}}class AnnotationElementFactory{static create(t){switch(t.data.annotationType){case n.AnnotationType.LINK:return new LinkAnnotationElement(t);case n.AnnotationType.TEXT:return new TextAnnotationElement(t);case n.AnnotationType.WIDGET:switch(t.data.fieldType){case"Tx":return new TextWidgetAnnotationElement(t);case"Btn":return t.data.radioButton?new RadioButtonWidgetAnnotationElement(t):t.data.checkBox?new CheckboxWidgetAnnotationElement(t):new PushButtonWidgetAnnotationElement(t);case"Ch":return new ChoiceWidgetAnnotationElement(t)}return new WidgetAnnotationElement(t);case n.AnnotationType.POPUP:return new PopupAnnotationElement(t);case n.AnnotationType.FREETEXT:return new FreeTextAnnotationElement(t);case n.AnnotationType.LINE:return new LineAnnotationElement(t);case n.AnnotationType.SQUARE:return new SquareAnnotationElement(t);case n.AnnotationType.CIRCLE:return new CircleAnnotationElement(t);case n.AnnotationType.POLYLINE:return new PolylineAnnotationElement(t);case n.AnnotationType.CARET:return new CaretAnnotationElement(t);case n.AnnotationType.INK:return new InkAnnotationElement(t);case n.AnnotationType.POLYGON:return new PolygonAnnotationElement(t);case n.AnnotationType.HIGHLIGHT:return new HighlightAnnotationElement(t);case n.AnnotationType.UNDERLINE:return new UnderlineAnnotationElement(t);case n.AnnotationType.SQUIGGLY:return new SquigglyAnnotationElement(t);case n.AnnotationType.STRIKEOUT:return new StrikeOutAnnotationElement(t);case n.AnnotationType.STAMP:return new StampAnnotationElement(t);case n.AnnotationType.FILEATTACHMENT:return new FileAttachmentAnnotationElement(t);default:return new AnnotationElement(t)}}}class AnnotationElement{constructor(t,{isRenderable:e=!1,ignoreBorder:s=!1,createQuadrilaterals:n=!1}={}){this.isRenderable=e;this.data=t.data;this.layer=t.layer;this.page=t.page;this.viewport=t.viewport;this.linkService=t.linkService;this.downloadManager=t.downloadManager;this.imageResourcesPath=t.imageResourcesPath;this.renderForms=t.renderForms;this.svgFactory=t.svgFactory;this.annotationStorage=t.annotationStorage;this.enableScripting=t.enableScripting;this.hasJSActions=t.hasJSActions;this._fieldObjects=t.fieldObjects;e&&(this.container=this._createContainer(s));n&&(this.quadrilaterals=this._createQuadrilaterals(s))}_createContainer(t=!1){const{data:e,page:s,viewport:i}=this,a=document.createElement("section");a.setAttribute("data-annotation-id",e.id);const{pageWidth:r,pageHeight:o,pageX:l,pageY:c}=i.rawDims,{width:h,height:d}=getRectDims(e.rect),u=n.Util.normalizeRect([e.rect[0],s.view[3]-e.rect[1]+s.view[1],e.rect[2],s.view[3]-e.rect[3]+s.view[1]]);if(!t&&e.borderStyle.width>0){a.style.borderWidth=`${e.borderStyle.width}px`;const t=e.borderStyle.horizontalCornerRadius,s=e.borderStyle.verticalCornerRadius;if(t>0||s>0){const e=`calc(${t}px * var(--scale-factor)) / calc(${s}px * var(--scale-factor))`;a.style.borderRadius=e}else if(this instanceof RadioButtonWidgetAnnotationElement){const t=`calc(${h}px * var(--scale-factor)) / calc(${d}px * var(--scale-factor))`;a.style.borderRadius=t}switch(e.borderStyle.style){case n.AnnotationBorderStyleType.SOLID:a.style.borderStyle="solid";break;case n.AnnotationBorderStyleType.DASHED:a.style.borderStyle="dashed";break;case n.AnnotationBorderStyleType.BEVELED:(0,n.warn)("Unimplemented border style: beveled");break;case n.AnnotationBorderStyleType.INSET:(0,n.warn)("Unimplemented border style: inset");break;case n.AnnotationBorderStyleType.UNDERLINE:a.style.borderBottomStyle="solid"}const i=e.borderColor||null;i?a.style.borderColor=n.Util.makeHexColor(0|i[0],0|i[1],0|i[2]):a.style.borderWidth=0}a.style.left=100*(u[0]-l)/r+"%";a.style.top=100*(u[1]-c)/o+"%";const{rotation:p}=e;if(e.hasOwnCanvas||0===p){a.style.width=100*h/r+"%";a.style.height=100*d/o+"%"}else this.setRotation(p,a);return a}setRotation(t,e=this.container){const{pageWidth:s,pageHeight:n}=this.viewport.rawDims,{width:i,height:a}=getRectDims(this.data.rect);let r,o;if(t%180==0){r=100*i/s;o=100*a/n}else{r=100*a/s;o=100*i/n}e.style.width=`${r}%`;e.style.height=`${o}%`;e.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const setColor=(t,e,s)=>{const n=s.detail[t];s.target.style[e]=r.ColorConverters[`${n[0]}_HTML`](n.slice(1))};return(0,n.shadow)(this,"_commonActions",{display:t=>{const e=t.detail.display%2==1;this.container.style.visibility=e?"hidden":"visible";this.annotationStorage.setValue(this.data.id,{hidden:e,print:0===t.detail.display||3===t.detail.display})},print:t=>{this.annotationStorage.setValue(this.data.id,{print:t.detail.print})},hidden:t=>{this.container.style.visibility=t.detail.hidden?"hidden":"visible";this.annotationStorage.setValue(this.data.id,{hidden:t.detail.hidden})},focus:t=>{setTimeout((()=>t.target.focus({preventScroll:!1})),0)},userName:t=>{t.target.title=t.detail.userName},readonly:t=>{t.detail.readonly?t.target.setAttribute("readonly",""):t.target.removeAttribute("readonly")},required:t=>{this._setRequired(t.target,t.detail.required)},bgColor:t=>{setColor("bgColor","backgroundColor",t)},fillColor:t=>{setColor("fillColor","backgroundColor",t)},fgColor:t=>{setColor("fgColor","color",t)},textColor:t=>{setColor("textColor","color",t)},borderColor:t=>{setColor("borderColor","borderColor",t)},strokeColor:t=>{setColor("strokeColor","borderColor",t)},rotation:t=>{const e=t.detail.rotation;this.setRotation(e);this.annotationStorage.setValue(this.data.id,{rotation:e})}})}_dispatchEventFromSandbox(t,e){const s=this._commonActions;for(const n of Object.keys(e.detail)){(t[n]||s[n])?.(e)}}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const e=this.annotationStorage.getRawValue(this.data.id);if(!e)return;const s=this._commonActions;for(const[n,i]of Object.entries(e)){const a=s[n];if(a){a({detail:{[n]:i},target:t});delete e[n]}}}_createQuadrilaterals(t=!1){if(!this.data.quadPoints)return null;const e=[],s=this.data.rect;for(const s of this.data.quadPoints){this.data.rect=[s[2].x,s[2].y,s[1].x,s[1].y];e.push(this._createContainer(t))}this.data.rect=s;return e}_createPopup(t,e){let s=this.container;if(this.quadrilaterals){t=t||this.quadrilaterals;s=this.quadrilaterals[0]}if(!t){(t=document.createElement("div")).className="popupTriggerArea";s.append(t)}const n=new PopupElement({container:s,trigger:t,color:e.color,titleObj:e.titleObj,modificationDate:e.modificationDate,contentsObj:e.contentsObj,richText:e.richText,hideWrapper:!0}).render();n.style.left="100%";s.append(n)}_renderQuadrilaterals(t){for(const e of this.quadrilaterals)e.className=t;return this.quadrilaterals}render(){(0,n.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(t,e=null){const s=[];if(this._fieldObjects){const i=this._fieldObjects[t];if(i)for(const{page:t,id:a,exportValues:r}of i){if(-1===t)continue;if(a===e)continue;const i="string"==typeof r?r:null,o=document.querySelector(`[data-element-id="${a}"]`);!o||c.has(o)?s.push({id:a,exportValue:i,domElement:o}):(0,n.warn)(`_getElementsByName - element not allowed: ${a}`)}return s}for(const n of document.getElementsByName(t)){const{exportValue:t}=n,i=n.getAttribute("data-element-id");i!==e&&(c.has(n)&&s.push({id:i,exportValue:t,domElement:n}))}return s}}class LinkAnnotationElement extends AnnotationElement{constructor(t,e=null){super(t,{isRenderable:!0,ignoreBorder:!!e?.ignoreBorder,createQuadrilaterals:!0});this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:e}=this,s=document.createElement("a");s.setAttribute("data-element-id",t.id);let n=!1;if(t.url){e.addLinkAttributes(s,t.url,t.newWindow);n=!0}else if(t.action){this._bindNamedAction(s,t.action);n=!0}else if(t.attachment){this._bindAttachment(s,t.attachment);n=!0}else if(t.setOCGState){this.#Ce(s,t.setOCGState);n=!0}else if(t.dest){this._bindLink(s,t.dest);n=!0}else{if(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions){this._bindJSAction(s,t);n=!0}if(t.resetForm){this._bindResetFormAction(s,t.resetForm);n=!0}else if(this.isTooltipOnly&&!n){this._bindLink(s,"");n=!0}}if(this.quadrilaterals)return this._renderQuadrilaterals("linkAnnotation").map(((t,e)=>{const n=0===e?s:s.cloneNode();t.append(n);return t}));this.container.className="linkAnnotation";n&&this.container.append(s);return this.container}#Pe(){this.container.setAttribute("data-internal-link","")}_bindLink(t,e){t.href=this.linkService.getDestinationHash(e);t.onclick=()=>{e&&this.linkService.goToDestination(e);return!1};(e||""===e)&&this.#Pe()}_bindNamedAction(t,e){t.href=this.linkService.getAnchorUrl("");t.onclick=()=>{this.linkService.executeNamedAction(e);return!1};this.#Pe()}_bindAttachment(t,e){t.href=this.linkService.getAnchorUrl("");t.onclick=()=>{this.downloadManager?.openOrDownloadData(this.container,e.content,e.filename);return!1};this.#Pe()}#Ce(t,e){t.href=this.linkService.getAnchorUrl("");t.onclick=()=>{this.linkService.executeSetOCGState(e);return!1};this.#Pe()}_bindJSAction(t,e){t.href=this.linkService.getAnchorUrl("");const s=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const n of Object.keys(e.actions)){const i=s.get(n);i&&(t[i]=()=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e.id,name:n}});return!1})}t.onclick||(t.onclick=()=>!1);this.#Pe()}_bindResetFormAction(t,e){const s=t.onclick;s||(t.href=this.linkService.getAnchorUrl(""));this.#Pe();if(this._fieldObjects)t.onclick=()=>{s?.();const{fields:t,refs:i,include:a}=e,r=[];if(0!==t.length||0!==i.length){const e=new Set(i);for(const s of t){const t=this._fieldObjects[s]||[];for(const{id:s}of t)e.add(s)}for(const t of Object.values(this._fieldObjects))for(const s of t)e.has(s.id)===a&&r.push(s)}else for(const t of Object.values(this._fieldObjects))r.push(...t);const o=this.annotationStorage,l=[];for(const t of r){const{id:e}=t;l.push(e);switch(t.type){case"text":{const s=t.defaultValue||"";o.setValue(e,{value:s});break}case"checkbox":case"radiobutton":{const s=t.defaultValue===t.exportValues;o.setValue(e,{value:s});break}case"combobox":case"listbox":{const s=t.defaultValue||"";o.setValue(e,{value:s});break}default:continue}const s=document.querySelector(`[data-element-id="${e}"]`);s&&(c.has(s)?s.dispatchEvent(new Event("resetform")):(0,n.warn)(`_bindResetFormAction - element not allowed: ${e}`))}this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:l,name:"ResetForm"}});return!1};else{(0,n.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.');s||(t.onclick=()=>!1)}}}class TextAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str)})}render(){this.container.className="textAnnotation";const t=document.createElement("img");t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg";t.alt="[{{type}} Annotation]";t.dataset.l10nId="text_annotation_type";t.dataset.l10nArgs=JSON.stringify({type:this.data.name});this.data.hasPopup||this._createPopup(t,this.data);this.container.append(t);return this.container}}class WidgetAnnotationElement extends AnnotationElement{render(){this.data.alternativeText&&(this.container.title=this.data.alternativeText);return this.container}_getKeyModifier(t){const{isWin:e,isMac:s}=n.FeatureTest.platform;return e&&t.ctrlKey||s&&t.metaKey}_setEventListener(t,e,s,n){e.includes("mouse")?t.addEventListener(e,(t=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:s,value:n(t),shift:t.shiftKey,modifier:this._getKeyModifier(t)}})})):t.addEventListener(e,(t=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:s,value:n(t)}})}))}_setEventListeners(t,e,s){for(const[n,i]of e)("Action"===i||this.data.actions?.[i])&&this._setEventListener(t,n,i,s)}_setBackgroundColor(t){const e=this.data.backgroundColor||null;t.style.backgroundColor=null===e?"transparent":n.Util.makeHexColor(e[0],e[1],e[2])}_setTextStyle(t){const e=["left","center","right"],{fontColor:s}=this.data.defaultAppearanceData,i=this.data.defaultAppearanceData.fontSize||9,a=t.style;let r;const roundToOneDecimal=t=>Math.round(10*t)/10;if(this.data.multiLine){const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2),e=t/(Math.round(t/(n.LINE_FACTOR*i))||1);r=Math.min(i,roundToOneDecimal(e/n.LINE_FACTOR))}else{const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2);r=Math.min(i,roundToOneDecimal(t/n.LINE_FACTOR))}a.fontSize=`calc(${r}px * var(--scale-factor))`;a.color=n.Util.makeHexColor(s[0],s[1],s[2]);null!==this.data.textAlignment&&(a.textAlign=e[this.data.textAlignment])}_setRequired(t,e){e?t.setAttribute("required",!0):t.removeAttribute("required");t.setAttribute("aria-required",e)}}class TextWidgetAnnotationElement extends WidgetAnnotationElement{constructor(t){super(t,{isRenderable:t.renderForms||!t.data.hasAppearance&&!!t.data.fieldValue})}setPropertyOnSiblings(t,e,s,n){const i=this.annotationStorage;for(const a of this._getElementsByName(t.name,t.id)){a.domElement&&(a.domElement[e]=s);i.setValue(a.id,{[n]:s})}}render(){const t=this.annotationStorage,e=this.data.id;this.container.className="textWidgetAnnotation";let s=null;if(this.renderForms){const n=t.getValue(e,{value:this.data.fieldValue});let i=n.formattedValue||n.value||"";const a=t.getValue(e,{charLimit:this.data.maxLen}).charLimit;a&&i.length>a&&(i=i.slice(0,a));const r={userValue:i,formattedValue:null,lastCommittedValue:null,commitKey:1};if(this.data.multiLine){s=document.createElement("textarea");s.textContent=i;this.data.doNotScroll&&(s.style.overflowY="hidden")}else{s=document.createElement("input");s.type="text";s.setAttribute("value",i);this.data.doNotScroll&&(s.style.overflowX="hidden")}c.add(s);s.setAttribute("data-element-id",e);s.disabled=this.data.readOnly;s.name=this.data.fieldName;s.tabIndex=l;this._setRequired(s,this.data.required);a&&(s.maxLength=a);s.addEventListener("input",(n=>{t.setValue(e,{value:n.target.value});this.setPropertyOnSiblings(s,"value",n.target.value,"value")}));s.addEventListener("resetform",(t=>{const e=this.data.defaultFieldValue??"";s.value=r.userValue=e;r.formattedValue=null}));let blurListener=t=>{const{formattedValue:e}=r;null!=e&&(t.target.value=e);t.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){s.addEventListener("focus",(t=>{const{target:e}=t;r.userValue&&(e.value=r.userValue);r.lastCommittedValue=e.value;r.commitKey=1}));s.addEventListener("updatefromsandbox",(s=>{const n={value(s){r.userValue=s.detail.value??"";t.setValue(e,{value:r.userValue.toString()});s.target.value=r.userValue},formattedValue(s){const{formattedValue:n}=s.detail;r.formattedValue=n;null!=n&&s.target!==document.activeElement&&(s.target.value=n);t.setValue(e,{formattedValue:n})},selRange(t){t.target.setSelectionRange(...t.detail.selRange)},charLimit:s=>{const{charLimit:n}=s.detail,{target:i}=s;if(0===n){i.removeAttribute("maxLength");return}i.setAttribute("maxLength",n);let a=r.userValue;if(a&&!(a.length<=n)){a=a.slice(0,n);i.value=r.userValue=a;t.setValue(e,{value:a});this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:a,willCommit:!0,commitKey:1,selStart:i.selectionStart,selEnd:i.selectionEnd}})}}};this._dispatchEventFromSandbox(n,s)}));s.addEventListener("keydown",(t=>{r.commitKey=1;let s=-1;"Escape"===t.key?s=0:"Enter"!==t.key||this.data.multiLine?"Tab"===t.key&&(r.commitKey=3):s=2;if(-1===s)return;const{value:n}=t.target;if(r.lastCommittedValue!==n){r.lastCommittedValue=n;r.userValue=n;this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:n,willCommit:!0,commitKey:s,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}})}}));const n=blurListener;blurListener=null;s.addEventListener("blur",(t=>{if(!t.relatedTarget)return;const{value:s}=t.target;r.userValue=s;r.lastCommittedValue!==s&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:s,willCommit:!0,commitKey:r.commitKey,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}});n(t)}));this.data.actions?.Keystroke&&s.addEventListener("beforeinput",(t=>{r.lastCommittedValue=null;const{data:s,target:n}=t,{value:i,selectionStart:a,selectionEnd:o}=n;let l=a,c=o;switch(t.inputType){case"deleteWordBackward":{const t=i.substring(0,a).match(/\w*[^\w]*$/);t&&(l-=t[0].length);break}case"deleteWordForward":{const t=i.substring(a).match(/^[^\w]*\w*/);t&&(c+=t[0].length);break}case"deleteContentBackward":a===o&&(l-=1);break;case"deleteContentForward":a===o&&(c+=1)}t.preventDefault();this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:i,change:s||"",willCommit:!1,selStart:l,selEnd:c}})}));this._setEventListeners(s,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.value))}blurListener&&s.addEventListener("blur",blurListener);if(this.data.comb){const t=(this.data.rect[2]-this.data.rect[0])/a;s.classList.add("comb");s.style.letterSpacing=`calc(${t}px * var(--scale-factor) - 1ch)`}}else{s=document.createElement("div");s.textContent=this.data.fieldValue;s.style.verticalAlign="middle";s.style.display="table-cell"}this._setTextStyle(s);this._setBackgroundColor(s);this._setDefaultPropertiesFromJS(s);this.container.append(s);return this.container}}class CheckboxWidgetAnnotationElement extends WidgetAnnotationElement{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,e=this.data,s=e.id;let n=t.getValue(s,{value:e.exportValue===e.fieldValue}).value;if("string"==typeof n){n="Off"!==n;t.setValue(s,{value:n})}this.container.className="buttonWidgetAnnotation checkBox";const i=document.createElement("input");c.add(i);i.setAttribute("data-element-id",s);i.disabled=e.readOnly;this._setRequired(i,this.data.required);i.type="checkbox";i.name=e.fieldName;n&&i.setAttribute("checked",!0);i.setAttribute("exportValue",e.exportValue);i.tabIndex=l;i.addEventListener("change",(n=>{const{name:i,checked:a}=n.target;for(const n of this._getElementsByName(i,s)){const s=a&&n.exportValue===e.exportValue;n.domElement&&(n.domElement.checked=s);t.setValue(n.id,{value:s})}t.setValue(s,{value:a})}));i.addEventListener("resetform",(t=>{const s=e.defaultFieldValue||"Off";t.target.checked=s===e.exportValue}));if(this.enableScripting&&this.hasJSActions){i.addEventListener("updatefromsandbox",(e=>{const n={value(e){e.target.checked="Off"!==e.detail.value;t.setValue(s,{value:e.target.checked})}};this._dispatchEventFromSandbox(n,e)}));this._setEventListeners(i,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.checked))}this._setBackgroundColor(i);this._setDefaultPropertiesFromJS(i);this.container.append(i);return this.container}}class RadioButtonWidgetAnnotationElement extends WidgetAnnotationElement{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.className="buttonWidgetAnnotation radioButton";const t=this.annotationStorage,e=this.data,s=e.id;let n=t.getValue(s,{value:e.fieldValue===e.buttonValue}).value;if("string"==typeof n){n=n!==e.buttonValue;t.setValue(s,{value:n})}const i=document.createElement("input");c.add(i);i.setAttribute("data-element-id",s);i.disabled=e.readOnly;this._setRequired(i,this.data.required);i.type="radio";i.name=e.fieldName;n&&i.setAttribute("checked",!0);i.tabIndex=l;i.addEventListener("change",(e=>{const{name:n,checked:i}=e.target;for(const e of this._getElementsByName(n,s))t.setValue(e.id,{value:!1});t.setValue(s,{value:i})}));i.addEventListener("resetform",(t=>{const s=e.defaultFieldValue;t.target.checked=null!=s&&s===e.buttonValue}));if(this.enableScripting&&this.hasJSActions){const n=e.buttonValue;i.addEventListener("updatefromsandbox",(e=>{const i={value:e=>{const i=n===e.detail.value;for(const n of this._getElementsByName(e.target.name)){const e=i&&n.id===s;n.domElement&&(n.domElement.checked=e);t.setValue(n.id,{value:e})}}};this._dispatchEventFromSandbox(i,e)}));this._setEventListeners(i,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.checked))}this._setBackgroundColor(i);this._setDefaultPropertiesFromJS(i);this.container.append(i);return this.container}}class PushButtonWidgetAnnotationElement extends LinkAnnotationElement{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();t.className="buttonWidgetAnnotation pushButton";this.data.alternativeText&&(t.title=this.data.alternativeText);const e=t.lastChild;if(this.enableScripting&&this.hasJSActions&&e){this._setDefaultPropertiesFromJS(e);e.addEventListener("updatefromsandbox",(t=>{this._dispatchEventFromSandbox({},t)}))}return t}}class ChoiceWidgetAnnotationElement extends WidgetAnnotationElement{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.className="choiceWidgetAnnotation";const t=this.annotationStorage,e=this.data.id,s=t.getValue(e,{value:this.data.fieldValue}),n=document.createElement("select");c.add(n);n.setAttribute("data-element-id",e);n.disabled=this.data.readOnly;this._setRequired(n,this.data.required);n.name=this.data.fieldName;n.tabIndex=l;let i=this.data.combo&&this.data.options.length>0;if(!this.data.combo){n.size=this.data.options.length;this.data.multiSelect&&(n.multiple=!0)}n.addEventListener("resetform",(t=>{const e=this.data.defaultFieldValue;for(const t of n.options)t.selected=t.value===e}));for(const t of this.data.options){const e=document.createElement("option");e.textContent=t.displayValue;e.value=t.exportValue;if(s.value.includes(t.exportValue)){e.setAttribute("selected",!0);i=!1}n.append(e)}let a=null;if(i){const t=document.createElement("option");t.value=" ";t.setAttribute("hidden",!0);t.setAttribute("selected",!0);n.prepend(t);a=()=>{t.remove();n.removeEventListener("input",a);a=null};n.addEventListener("input",a)}const getValue=t=>{const e=t?"value":"textContent",{options:s,multiple:i}=n;return i?Array.prototype.filter.call(s,(t=>t.selected)).map((t=>t[e])):-1===s.selectedIndex?null:s[s.selectedIndex][e]};let r=getValue(!1);const getItems=t=>{const e=t.target.options;return Array.prototype.map.call(e,(t=>({displayValue:t.textContent,exportValue:t.value})))};if(this.enableScripting&&this.hasJSActions){n.addEventListener("updatefromsandbox",(s=>{const i={value(s){a?.();const i=s.detail.value,o=new Set(Array.isArray(i)?i:[i]);for(const t of n.options)t.selected=o.has(t.value);t.setValue(e,{value:getValue(!0)});r=getValue(!1)},multipleSelection(t){n.multiple=!0},remove(s){const i=n.options,a=s.detail.remove;i[a].selected=!1;n.remove(a);if(i.length>0){-1===Array.prototype.findIndex.call(i,(t=>t.selected))&&(i[0].selected=!0)}t.setValue(e,{value:getValue(!0),items:getItems(s)});r=getValue(!1)},clear(s){for(;0!==n.length;)n.remove(0);t.setValue(e,{value:null,items:[]});r=getValue(!1)},insert(s){const{index:i,displayValue:a,exportValue:o}=s.detail.insert,l=n.children[i],c=document.createElement("option");c.textContent=a;c.value=o;l?l.before(c):n.append(c);t.setValue(e,{value:getValue(!0),items:getItems(s)});r=getValue(!1)},items(s){const{items:i}=s.detail;for(;0!==n.length;)n.remove(0);for(const t of i){const{displayValue:e,exportValue:s}=t,i=document.createElement("option");i.textContent=e;i.value=s;n.append(i)}n.options.length>0&&(n.options[0].selected=!0);t.setValue(e,{value:getValue(!0),items:getItems(s)});r=getValue(!1)},indices(s){const n=new Set(s.detail.indices);for(const t of s.target.options)t.selected=n.has(t.index);t.setValue(e,{value:getValue(!0)});r=getValue(!1)},editable(t){t.target.disabled=!t.detail.editable}};this._dispatchEventFromSandbox(i,s)}));n.addEventListener("input",(s=>{const n=getValue(!0);t.setValue(e,{value:n});s.preventDefault();this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:r,changeEx:n,willCommit:!1,commitKey:1,keyDown:!1}})}));this._setEventListeners(n,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],(t=>t.target.value))}else n.addEventListener("input",(function(s){t.setValue(e,{value:getValue(!0)})}));this.data.combo&&this._setTextStyle(n);this._setBackgroundColor(n);this._setDefaultPropertiesFromJS(n);this.container.append(n);return this.container}}class PopupAnnotationElement extends AnnotationElement{static IGNORE_TYPES=new Set(["Line","Square","Circle","PolyLine","Polygon","Ink"]);constructor(t){const{data:e}=t;super(t,{isRenderable:!PopupAnnotationElement.IGNORE_TYPES.has(e.parentType)&&!!(e.titleObj?.str||e.contentsObj?.str||e.richText?.str)})}render(){this.container.className="popupAnnotation";const t=this.layer.querySelectorAll(`[data-annotation-id="${this.data.parentId}"]`);if(0===t.length)return this.container;const e=new PopupElement({container:this.container,trigger:Array.from(t),color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText}),s=this.page,i=n.Util.normalizeRect([this.data.parentRect[0],s.view[3]-this.data.parentRect[1]+s.view[1],this.data.parentRect[2],s.view[3]-this.data.parentRect[3]+s.view[1]]),a=i[0]+this.data.parentRect[2]-this.data.parentRect[0],r=i[1],{pageWidth:o,pageHeight:l,pageX:c,pageY:h}=this.viewport.rawDims;this.container.style.left=100*(a-c)/o+"%";this.container.style.top=100*(r-h)/l+"%";this.container.append(e.render());return this.container}}class PopupElement{constructor(t){this.container=t.container;this.trigger=t.trigger;this.color=t.color;this.titleObj=t.titleObj;this.modificationDate=t.modificationDate;this.contentsObj=t.contentsObj;this.richText=t.richText;this.hideWrapper=t.hideWrapper||!1;this.pinned=!1}render(){const t=document.createElement("div");t.className="popupWrapper";this.hideElement=this.hideWrapper?t:this.container;this.hideElement.hidden=!0;const e=document.createElement("div");e.className="popup";const s=this.color;if(s){const t=.7*(255-s[0])+s[0],i=.7*(255-s[1])+s[1],a=.7*(255-s[2])+s[2];e.style.backgroundColor=n.Util.makeHexColor(0|t,0|i,0|a)}const a=document.createElement("h1");a.dir=this.titleObj.dir;a.textContent=this.titleObj.str;e.append(a);const r=i.PDFDateString.toDateObject(this.modificationDate);if(r){const t=document.createElement("span");t.className="popupDate";t.textContent="{{date}}, {{time}}";t.dataset.l10nId="annotation_date_string";t.dataset.l10nArgs=JSON.stringify({date:r.toLocaleDateString(),time:r.toLocaleTimeString()});e.append(t)}if(!this.richText?.str||this.contentsObj?.str&&this.contentsObj.str!==this.richText.str){const t=this._formatContents(this.contentsObj);e.append(t)}else{o.XfaLayer.render({xfaHtml:this.richText.html,intent:"richText",div:e});e.lastChild.className="richText popupContent"}Array.isArray(this.trigger)||(this.trigger=[this.trigger]);for(const t of this.trigger){t.addEventListener("click",this._toggle.bind(this));t.addEventListener("mouseover",this._show.bind(this,!1));t.addEventListener("mouseout",this._hide.bind(this,!1))}e.addEventListener("click",this._hide.bind(this,!0));t.append(e);return t}_formatContents({str:t,dir:e}){const s=document.createElement("p");s.className="popupContent";s.dir=e;const n=t.split(/(?:\r\n?|\n)/);for(let t=0,e=n.length;t<e;++t){const i=n[t];s.append(document.createTextNode(i));t<e-1&&s.append(document.createElement("br"))}return s}_toggle(){this.pinned?this._hide(!0):this._show(!0)}_show(t=!1){t&&(this.pinned=!0);if(this.hideElement.hidden){this.hideElement.hidden=!1;this.container.style.zIndex=parseInt(this.container.style.zIndex)+1e3}}_hide(t=!0){t&&(this.pinned=!1);if(!this.hideElement.hidden&&!this.pinned){this.hideElement.hidden=!0;this.container.style.zIndex=parseInt(this.container.style.zIndex)-1e3}}}class FreeTextAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str),ignoreBorder:!0});this.textContent=t.data.textContent}render(){this.container.className="freeTextAnnotation";if(this.textContent){const t=document.createElement("div");t.className="annotationTextContent";t.setAttribute("role","comment");for(const e of this.textContent){const s=document.createElement("span");s.textContent=e;t.append(s)}this.container.append(t)}this.data.hasPopup||this._createPopup(null,this.data);return this.container}}class LineAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str),ignoreBorder:!0})}render(){this.container.className="lineAnnotation";const t=this.data,{width:e,height:s}=getRectDims(t.rect),n=this.svgFactory.create(e,s,!0),i=this.svgFactory.createElement("svg:line");i.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]);i.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]);i.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]);i.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]);i.setAttribute("stroke-width",t.borderStyle.width||1);i.setAttribute("stroke","transparent");i.setAttribute("fill","transparent");n.append(i);this.container.append(n);this._createPopup(i,t);return this.container}}class SquareAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str),ignoreBorder:!0})}render(){this.container.className="squareAnnotation";const t=this.data,{width:e,height:s}=getRectDims(t.rect),n=this.svgFactory.create(e,s,!0),i=t.borderStyle.width,a=this.svgFactory.createElement("svg:rect");a.setAttribute("x",i/2);a.setAttribute("y",i/2);a.setAttribute("width",e-i);a.setAttribute("height",s-i);a.setAttribute("stroke-width",i||1);a.setAttribute("stroke","transparent");a.setAttribute("fill","transparent");n.append(a);this.container.append(n);this._createPopup(a,t);return this.container}}class CircleAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str),ignoreBorder:!0})}render(){this.container.className="circleAnnotation";const t=this.data,{width:e,height:s}=getRectDims(t.rect),n=this.svgFactory.create(e,s,!0),i=t.borderStyle.width,a=this.svgFactory.createElement("svg:ellipse");a.setAttribute("cx",e/2);a.setAttribute("cy",s/2);a.setAttribute("rx",e/2-i/2);a.setAttribute("ry",s/2-i/2);a.setAttribute("stroke-width",i||1);a.setAttribute("stroke","transparent");a.setAttribute("fill","transparent");n.append(a);this.container.append(n);this._createPopup(a,t);return this.container}}class PolylineAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str),ignoreBorder:!0});this.containerClassName="polylineAnnotation";this.svgElementName="svg:polyline"}render(){this.container.className=this.containerClassName;const t=this.data,{width:e,height:s}=getRectDims(t.rect),n=this.svgFactory.create(e,s,!0);let i=[];for(const e of t.vertices){const s=e.x-t.rect[0],n=t.rect[3]-e.y;i.push(s+","+n)}i=i.join(" ");const a=this.svgFactory.createElement(this.svgElementName);a.setAttribute("points",i);a.setAttribute("stroke-width",t.borderStyle.width||1);a.setAttribute("stroke","transparent");a.setAttribute("fill","transparent");n.append(a);this.container.append(n);this._createPopup(a,t);return this.container}}class PolygonAnnotationElement extends PolylineAnnotationElement{constructor(t){super(t);this.containerClassName="polygonAnnotation";this.svgElementName="svg:polygon"}}class CaretAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str),ignoreBorder:!0})}render(){this.container.className="caretAnnotation";this.data.hasPopup||this._createPopup(null,this.data);return this.container}}class InkAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str),ignoreBorder:!0});this.containerClassName="inkAnnotation";this.svgElementName="svg:polyline"}render(){this.container.className=this.containerClassName;const t=this.data,{width:e,height:s}=getRectDims(t.rect),n=this.svgFactory.create(e,s,!0);for(const e of t.inkLists){let s=[];for(const n of e){const e=n.x-t.rect[0],i=t.rect[3]-n.y;s.push(`${e},${i}`)}s=s.join(" ");const i=this.svgFactory.createElement(this.svgElementName);i.setAttribute("points",s);i.setAttribute("stroke-width",t.borderStyle.width||1);i.setAttribute("stroke","transparent");i.setAttribute("fill","transparent");this._createPopup(i,t);n.append(i)}this.container.append(n);return this.container}}class HighlightAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){this.data.hasPopup||this._createPopup(null,this.data);if(this.quadrilaterals)return this._renderQuadrilaterals("highlightAnnotation");this.container.className="highlightAnnotation";return this.container}}class UnderlineAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){this.data.hasPopup||this._createPopup(null,this.data);if(this.quadrilaterals)return this._renderQuadrilaterals("underlineAnnotation");this.container.className="underlineAnnotation";return this.container}}class SquigglyAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){this.data.hasPopup||this._createPopup(null,this.data);if(this.quadrilaterals)return this._renderQuadrilaterals("squigglyAnnotation");this.container.className="squigglyAnnotation";return this.container}}class StrikeOutAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){this.data.hasPopup||this._createPopup(null,this.data);if(this.quadrilaterals)return this._renderQuadrilaterals("strikeoutAnnotation");this.container.className="strikeoutAnnotation";return this.container}}class StampAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str),ignoreBorder:!0})}render(){this.container.className="stampAnnotation";this.data.hasPopup||this._createPopup(null,this.data);return this.container}}class FileAttachmentAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!0});const{filename:e,content:s}=this.data.file;this.filename=(0,i.getFilenameFromUrl)(e,!0);this.content=s;this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,filename:e,content:s})}render(){this.container.className="fileAttachmentAnnotation";let t;if(this.data.hasAppearance)t=document.createElement("div");else{t=document.createElement("img");t.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(this.data.name)?"paperclip":"pushpin"}.svg`}t.className="popupTriggerArea";t.addEventListener("dblclick",this._download.bind(this));!this.data.hasPopup&&(this.data.titleObj?.str||this.data.contentsObj?.str||this.data.richText)&&this._createPopup(t,this.data);this.container.append(t);return this.container}_download(){this.downloadManager?.openOrDownloadData(this.container,this.content,this.filename)}}class AnnotationLayer{static#Te(t,e,s,n){const a=t.firstChild||t;a.id=`${i.AnnotationPrefix}${e}`;s.append(t);n?.moveElementInDOM(s,t,a,!1)}static render(t){const{annotations:e,div:s,viewport:r,accessibilityManager:o}=t;(0,i.setLayerDimensions)(s,r);const l={data:null,layer:s,page:t.page,viewport:r,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:!1!==t.renderForms,svgFactory:new i.DOMSVGFactory,annotationStorage:t.annotationStorage||new a.AnnotationStorage,enableScripting:!0===t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects};let c=0;for(const t of e){if(t.annotationType!==n.AnnotationType.POPUP){const{width:e,height:s}=getRectDims(t.rect);if(e<=0||s<=0)continue}l.data=t;const e=AnnotationElementFactory.create(l);if(!e.isRenderable)continue;const i=e.render();t.hidden&&(i.style.visibility="hidden");if(Array.isArray(i))for(const e of i){e.style.zIndex=c++;AnnotationLayer.#Te(e,t.id,s,o)}else{i.style.zIndex=c++;e instanceof PopupAnnotationElement?s.prepend(i):AnnotationLayer.#Te(i,t.id,s,o)}}this.#we(s,t.annotationCanvasMap)}static update(t){const{annotationCanvasMap:e,div:s,viewport:n}=t;(0,i.setLayerDimensions)(s,{rotation:n.rotation});this.#we(s,e);s.hidden=!1}static#we(t,e){if(e){for(const[s,n]of e){const e=t.querySelector(`[data-annotation-id="${s}"]`);if(!e)continue;const{firstChild:i}=e;i?"CANVAS"===i.nodeName?i.replaceWith(n):i.before(n):e.append(n)}e.clear()}}}e.AnnotationLayer=AnnotationLayer},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0});e.ColorConverters=void 0;function makeColorComp(t){return Math.floor(255*Math.max(0,Math.min(1,t))).toString(16).padStart(2,"0")}e.ColorConverters=class ColorConverters{static CMYK_G([t,e,s,n]){return["G",1-Math.min(1,.3*t+.59*s+.11*e+n)]}static G_CMYK([t]){return["CMYK",0,0,0,1-t]}static G_RGB([t]){return["RGB",t,t,t]}static G_HTML([t]){const e=makeColorComp(t);return`#${e}${e}${e}`}static RGB_G([t,e,s]){return["G",.3*t+.59*e+.11*s]}static RGB_HTML([t,e,s]){return`#${makeColorComp(t)}${makeColorComp(e)}${makeColorComp(s)}`}static T_HTML(){return"#00000000"}static CMYK_RGB([t,e,s,n]){return["RGB",1-Math.min(1,t+n),1-Math.min(1,s+n),1-Math.min(1,e+n)]}static CMYK_HTML(t){const e=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(e)}static RGB_CMYK([t,e,s]){const n=1-t,i=1-e,a=1-s;return["CMYK",n,i,a,Math.min(n,i,a)]}}},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.XfaLayer=void 0;var n=s(19);e.XfaLayer=class XfaLayer{static setupStorage(t,e,s,n,i){const a=n.getValue(e,{value:null});switch(s.name){case"textarea":null!==a.value&&(t.textContent=a.value);if("print"===i)break;t.addEventListener("input",(t=>{n.setValue(e,{value:t.target.value})}));break;case"input":if("radio"===s.attributes.type||"checkbox"===s.attributes.type){a.value===s.attributes.xfaOn?t.setAttribute("checked",!0):a.value===s.attributes.xfaOff&&t.removeAttribute("checked");if("print"===i)break;t.addEventListener("change",(t=>{n.setValue(e,{value:t.target.checked?t.target.getAttribute("xfaOn"):t.target.getAttribute("xfaOff")})}))}else{null!==a.value&&t.setAttribute("value",a.value);if("print"===i)break;t.addEventListener("input",(t=>{n.setValue(e,{value:t.target.value})}))}break;case"select":if(null!==a.value)for(const t of s.children)t.attributes.value===a.value&&(t.attributes.selected=!0);t.addEventListener("input",(t=>{const s=t.target.options,i=-1===s.selectedIndex?"":s[s.selectedIndex].value;n.setValue(e,{value:i})}))}}static setAttributes({html:t,element:e,storage:s=null,intent:n,linkService:i}){const{attributes:a}=e,r=t instanceof HTMLAnchorElement;"radio"===a.type&&(a.name=`${a.name}-${n}`);for(const[e,s]of Object.entries(a))if(null!=s)switch(e){case"class":s.length&&t.setAttribute(e,s.join(" "));break;case"dataId":break;case"id":t.setAttribute("data-element-id",s);break;case"style":Object.assign(t.style,s);break;case"textContent":t.textContent=s;break;default:(!r||"href"!==e&&"newWindow"!==e)&&t.setAttribute(e,s)}r&&i.addLinkAttributes(t,a.href,a.newWindow);s&&a.dataId&&this.setupStorage(t,a.dataId,e,s)}static render(t){const e=t.annotationStorage,s=t.linkService,i=t.xfaHtml,a=t.intent||"display",r=document.createElement(i.name);i.attributes&&this.setAttributes({html:r,element:i,intent:a,linkService:s});const o=[[i,-1,r]],l=t.div;l.append(r);if(t.viewport){const e=`matrix(${t.viewport.transform.join(",")})`;l.style.transform=e}"richText"!==a&&l.setAttribute("class","xfaLayer xfaFont");const c=[];for(;o.length>0;){const[t,i,r]=o.at(-1);if(i+1===t.children.length){o.pop();continue}const l=t.children[++o.at(-1)[1]];if(null===l)continue;const{name:h}=l;if("#text"===h){const t=document.createTextNode(l.value);c.push(t);r.append(t);continue}let d;d=l?.attributes?.xmlns?document.createElementNS(l.attributes.xmlns,h):document.createElement(h);r.append(d);l.attributes&&this.setAttributes({html:d,element:l,storage:e,intent:a,linkService:s});if(l.children&&l.children.length>0)o.push([l,-1,d]);else if(l.value){const t=document.createTextNode(l.value);n.XfaText.shouldBuildText(h)&&c.push(t);d.append(t)}}for(const t of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))t.setAttribute("readOnly",!0);return{textDivs:c}}static update(t){const e=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=e;t.div.hidden=!1}}},(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0});e.SVGGraphics=void 0;var n=s(6),i=s(1),a=s(10);let r=class{constructor(){(0,i.unreachable)("Not implemented: SVGGraphics")}};e.SVGGraphics=r;{const o={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},l="http://www.w3.org/XML/1998/namespace",c="http://www.w3.org/1999/xlink",h=["butt","round","square"],d=["miter","round","bevel"],createObjectURL=function(t,e="",s=!1){if(URL.createObjectURL&&"undefined"!=typeof Blob&&!s)return URL.createObjectURL(new Blob([t],{type:e}));const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let i=`data:${e};base64,`;for(let e=0,s=t.length;e<s;e+=3){const a=255&t[e],r=255&t[e+1],o=255&t[e+2];i+=n[a>>2]+n[(3&a)<<4|r>>4]+n[e+1<s?(15&r)<<2|o>>6:64]+n[e+2<s?63&o:64]}return i},u=function(){const t=new Uint8Array([137,80,78,71,13,10,26,10]),e=12,s=new Int32Array(256);for(let t=0;t<256;t++){let e=t;for(let t=0;t<8;t++)e=1&e?3988292384^e>>1&2147483647:e>>1&2147483647;s[t]=e}function writePngChunk(t,e,n,i){let a=i;const r=e.length;n[a]=r>>24&255;n[a+1]=r>>16&255;n[a+2]=r>>8&255;n[a+3]=255&r;a+=4;n[a]=255&t.charCodeAt(0);n[a+1]=255&t.charCodeAt(1);n[a+2]=255&t.charCodeAt(2);n[a+3]=255&t.charCodeAt(3);a+=4;n.set(e,a);a+=e.length;const o=function crc32(t,e,n){let i=-1;for(let a=e;a<n;a++){const e=255&(i^t[a]);i=i>>>8^s[e]}return-1^i}(n,i+4,a);n[a]=o>>24&255;n[a+1]=o>>16&255;n[a+2]=o>>8&255;n[a+3]=255&o}function deflateSyncUncompressed(t){let e=t.length;const s=65535,n=Math.ceil(e/s),i=new Uint8Array(2+e+5*n+4);let a=0;i[a++]=120;i[a++]=156;let r=0;for(;e>s;){i[a++]=0;i[a++]=255;i[a++]=255;i[a++]=0;i[a++]=0;i.set(t.subarray(r,r+s),a);a+=s;r+=s;e-=s}i[a++]=1;i[a++]=255&e;i[a++]=e>>8&255;i[a++]=255&~e;i[a++]=(65535&~e)>>8&255;i.set(t.subarray(r),a);a+=t.length-r;const o=function adler32(t,e,s){let n=1,i=0;for(let a=e;a<s;++a){n=(n+(255&t[a]))%65521;i=(i+n)%65521}return i<<16|n}(t,0,t.length);i[a++]=o>>24&255;i[a++]=o>>16&255;i[a++]=o>>8&255;i[a++]=255&o;return i}function encode(s,n,r,o){const l=s.width,c=s.height;let h,d,u;const p=s.data;switch(n){case i.ImageKind.GRAYSCALE_1BPP:d=0;h=1;u=l+7>>3;break;case i.ImageKind.RGB_24BPP:d=2;h=8;u=3*l;break;case i.ImageKind.RGBA_32BPP:d=6;h=8;u=4*l;break;default:throw new Error("invalid format")}const g=new Uint8Array((1+u)*c);let f=0,m=0;for(let t=0;t<c;++t){g[f++]=0;g.set(p.subarray(m,m+u),f);m+=u;f+=u}if(n===i.ImageKind.GRAYSCALE_1BPP&&o){f=0;for(let t=0;t<c;t++){f++;for(let t=0;t<u;t++)g[f++]^=255}}const b=new Uint8Array([l>>24&255,l>>16&255,l>>8&255,255&l,c>>24&255,c>>16&255,c>>8&255,255&c,h,d,0,0,0]),A=function deflateSync(t){if(!a.isNodeJS)return deflateSyncUncompressed(t);try{let e;e=parseInt(process.versions.node)>=8?t:Buffer.from(t);const s=require("zlib").deflateSync(e,{level:9});return s instanceof Uint8Array?s:new Uint8Array(s)}catch(t){(0,i.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+t)}return deflateSyncUncompressed(t)}(g),_=t.length+3*e+b.length+A.length,v=new Uint8Array(_);let y=0;v.set(t,y);y+=t.length;writePngChunk("IHDR",b,v,y);y+=e+b.length;writePngChunk("IDATA",A,v,y);y+=e+A.length;writePngChunk("IEND",new Uint8Array(0),v,y);return createObjectURL(v,"image/png",r)}return function convertImgDataToPng(t,e,s){return encode(t,void 0===t.kind?i.ImageKind.GRAYSCALE_1BPP:t.kind,e,s)}}();class SVGExtraState{constructor(){this.fontSizeScale=1;this.fontWeight=o.fontWeight;this.fontSize=0;this.textMatrix=i.IDENTITY_MATRIX;this.fontMatrix=i.FONT_IDENTITY_MATRIX;this.leading=0;this.textRenderingMode=i.TextRenderingMode.FILL;this.textMatrixScale=1;this.x=0;this.y=0;this.lineX=0;this.lineY=0;this.charSpacing=0;this.wordSpacing=0;this.textHScale=1;this.textRise=0;this.fillColor=o.fillColor;this.strokeColor="#000000";this.fillAlpha=1;this.strokeAlpha=1;this.lineWidth=1;this.lineJoin="";this.lineCap="";this.miterLimit=0;this.dashArray=[];this.dashPhase=0;this.dependencies=[];this.activeClipUrl=null;this.clipGroup=null;this.maskId=""}clone(){return Object.create(this)}setCurrentPoint(t,e){this.x=t;this.y=e}}function opListToTree(t){let e=[];const s=[];for(const n of t)if("save"!==n.fn)"restore"===n.fn?e=s.pop():e.push(n);else{e.push({fnId:92,fn:"group",items:[]});s.push(e);e=e.at(-1).items}return e}function pf(t){if(Number.isInteger(t))return t.toString();const e=t.toFixed(10);let s=e.length-1;if("0"!==e[s])return e;do{s--}while("0"===e[s]);return e.substring(0,"."===e[s]?s:s+1)}function pm(t){if(0===t[4]&&0===t[5]){if(0===t[1]&&0===t[2])return 1===t[0]&&1===t[3]?"":`scale(${pf(t[0])} ${pf(t[3])})`;if(t[0]===t[3]&&t[1]===-t[2]){return`rotate(${pf(180*Math.acos(t[0])/Math.PI)})`}}else if(1===t[0]&&0===t[1]&&0===t[2]&&1===t[3])return`translate(${pf(t[4])} ${pf(t[5])})`;return`matrix(${pf(t[0])} ${pf(t[1])} ${pf(t[2])} ${pf(t[3])} ${pf(t[4])} ${pf(t[5])})`}let p=0,g=0,f=0;e.SVGGraphics=r=class{constructor(t,e,s=!1){(0,n.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future.");this.svgFactory=new n.DOMSVGFactory;this.current=new SVGExtraState;this.transformMatrix=i.IDENTITY_MATRIX;this.transformStack=[];this.extraStack=[];this.commonObjs=t;this.objs=e;this.pendingClip=null;this.pendingEOFill=!1;this.embedFonts=!1;this.embeddedFonts=Object.create(null);this.cssStyle=null;this.forceDataSchema=!!s;this._operatorIdMapping=[];for(const t in i.OPS)this._operatorIdMapping[i.OPS[t]]=t}getObject(t,e=null){return"string"==typeof t?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):e}save(){this.transformStack.push(this.transformMatrix);const t=this.current;this.extraStack.push(t);this.current=t.clone()}restore(){this.transformMatrix=this.transformStack.pop();this.current=this.extraStack.pop();this.pendingClip=null;this.tgrp=null}group(t){this.save();this.executeOpTree(t);this.restore()}loadDependencies(t){const e=t.fnArray,s=t.argsArray;for(let t=0,n=e.length;t<n;t++)if(e[t]===i.OPS.dependency)for(const e of s[t]){const t=e.startsWith("g_")?this.commonObjs:this.objs,s=new Promise((s=>{t.get(e,s)}));this.current.dependencies.push(s)}return Promise.all(this.current.dependencies)}transform(t,e,s,n,a,r){const o=[t,e,s,n,a,r];this.transformMatrix=i.Util.transform(this.transformMatrix,o);this.tgrp=null}getSVG(t,e){this.viewport=e;const s=this._initialize(e);return this.loadDependencies(t).then((()=>{this.transformMatrix=i.IDENTITY_MATRIX;this.executeOpTree(this.convertOpList(t));return s}))}convertOpList(t){const e=this._operatorIdMapping,s=t.argsArray,n=t.fnArray,i=[];for(let t=0,a=n.length;t<a;t++){const a=n[t];i.push({fnId:a,fn:e[a],args:s[t]})}return opListToTree(i)}executeOpTree(t){for(const e of t){const t=e.fn,s=e.fnId,n=e.args;switch(0|s){case i.OPS.beginText:this.beginText();break;case i.OPS.dependency:break;case i.OPS.setLeading:this.setLeading(n);break;case i.OPS.setLeadingMoveText:this.setLeadingMoveText(n[0],n[1]);break;case i.OPS.setFont:this.setFont(n);break;case i.OPS.showText:case i.OPS.showSpacedText:this.showText(n[0]);break;case i.OPS.endText:this.endText();break;case i.OPS.moveText:this.moveText(n[0],n[1]);break;case i.OPS.setCharSpacing:this.setCharSpacing(n[0]);break;case i.OPS.setWordSpacing:this.setWordSpacing(n[0]);break;case i.OPS.setHScale:this.setHScale(n[0]);break;case i.OPS.setTextMatrix:this.setTextMatrix(n[0],n[1],n[2],n[3],n[4],n[5]);break;case i.OPS.setTextRise:this.setTextRise(n[0]);break;case i.OPS.setTextRenderingMode:this.setTextRenderingMode(n[0]);break;case i.OPS.setLineWidth:this.setLineWidth(n[0]);break;case i.OPS.setLineJoin:this.setLineJoin(n[0]);break;case i.OPS.setLineCap:this.setLineCap(n[0]);break;case i.OPS.setMiterLimit:this.setMiterLimit(n[0]);break;case i.OPS.setFillRGBColor:this.setFillRGBColor(n[0],n[1],n[2]);break;case i.OPS.setStrokeRGBColor:this.setStrokeRGBColor(n[0],n[1],n[2]);break;case i.OPS.setStrokeColorN:this.setStrokeColorN(n);break;case i.OPS.setFillColorN:this.setFillColorN(n);break;case i.OPS.shadingFill:this.shadingFill(n[0]);break;case i.OPS.setDash:this.setDash(n[0],n[1]);break;case i.OPS.setRenderingIntent:this.setRenderingIntent(n[0]);break;case i.OPS.setFlatness:this.setFlatness(n[0]);break;case i.OPS.setGState:this.setGState(n[0]);break;case i.OPS.fill:this.fill();break;case i.OPS.eoFill:this.eoFill();break;case i.OPS.stroke:this.stroke();break;case i.OPS.fillStroke:this.fillStroke();break;case i.OPS.eoFillStroke:this.eoFillStroke();break;case i.OPS.clip:this.clip("nonzero");break;case i.OPS.eoClip:this.clip("evenodd");break;case i.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case i.OPS.paintImageXObject:this.paintImageXObject(n[0]);break;case i.OPS.paintInlineImageXObject:this.paintInlineImageXObject(n[0]);break;case i.OPS.paintImageMaskXObject:this.paintImageMaskXObject(n[0]);break;case i.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(n[0],n[1]);break;case i.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case i.OPS.closePath:this.closePath();break;case i.OPS.closeStroke:this.closeStroke();break;case i.OPS.closeFillStroke:this.closeFillStroke();break;case i.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case i.OPS.nextLine:this.nextLine();break;case i.OPS.transform:this.transform(n[0],n[1],n[2],n[3],n[4],n[5]);break;case i.OPS.constructPath:this.constructPath(n[0],n[1]);break;case i.OPS.endPath:this.endPath();break;case 92:this.group(e.items);break;default:(0,i.warn)(`Unimplemented operator ${t}`)}}}setWordSpacing(t){this.current.wordSpacing=t}setCharSpacing(t){this.current.charSpacing=t}nextLine(){this.moveText(0,this.current.leading)}setTextMatrix(t,e,s,n,i,a){const r=this.current;r.textMatrix=r.lineMatrix=[t,e,s,n,i,a];r.textMatrixScale=Math.hypot(t,e);r.x=r.lineX=0;r.y=r.lineY=0;r.xcoords=[];r.ycoords=[];r.tspan=this.svgFactory.createElement("svg:tspan");r.tspan.setAttributeNS(null,"font-family",r.fontFamily);r.tspan.setAttributeNS(null,"font-size",`${pf(r.fontSize)}px`);r.tspan.setAttributeNS(null,"y",pf(-r.y));r.txtElement=this.svgFactory.createElement("svg:text");r.txtElement.append(r.tspan)}beginText(){const t=this.current;t.x=t.lineX=0;t.y=t.lineY=0;t.textMatrix=i.IDENTITY_MATRIX;t.lineMatrix=i.IDENTITY_MATRIX;t.textMatrixScale=1;t.tspan=this.svgFactory.createElement("svg:tspan");t.txtElement=this.svgFactory.createElement("svg:text");t.txtgrp=this.svgFactory.createElement("svg:g");t.xcoords=[];t.ycoords=[]}moveText(t,e){const s=this.current;s.x=s.lineX+=t;s.y=s.lineY+=e;s.xcoords=[];s.ycoords=[];s.tspan=this.svgFactory.createElement("svg:tspan");s.tspan.setAttributeNS(null,"font-family",s.fontFamily);s.tspan.setAttributeNS(null,"font-size",`${pf(s.fontSize)}px`);s.tspan.setAttributeNS(null,"y",pf(-s.y))}showText(t){const e=this.current,s=e.font,n=e.fontSize;if(0===n)return;const a=e.fontSizeScale,r=e.charSpacing,c=e.wordSpacing,h=e.fontDirection,d=e.textHScale*h,u=s.vertical,p=u?1:-1,g=s.defaultVMetrics,f=n*e.fontMatrix[0];let m=0;for(const i of t){if(null===i){m+=h*c;continue}if("number"==typeof i){m+=p*i*n/1e3;continue}const t=(i.isSpace?c:0)+r,o=i.fontChar;let l,d,b,A=i.width;if(u){let t;const e=i.vmetric||g;t=i.vmetric?e[1]:.5*A;t=-t*f;const s=e[2]*f;A=e?-e[0]:A;l=t/a;d=(m+s)/a}else{l=m/a;d=0}if(i.isInFont||s.missingFile){e.xcoords.push(e.x+l);u&&e.ycoords.push(-e.y+d);e.tspan.textContent+=o}b=u?A*f-t*h:A*f+t*h;m+=b}e.tspan.setAttributeNS(null,"x",e.xcoords.map(pf).join(" "));u?e.tspan.setAttributeNS(null,"y",e.ycoords.map(pf).join(" ")):e.tspan.setAttributeNS(null,"y",pf(-e.y));u?e.y-=m:e.x+=m*d;e.tspan.setAttributeNS(null,"font-family",e.fontFamily);e.tspan.setAttributeNS(null,"font-size",`${pf(e.fontSize)}px`);e.fontStyle!==o.fontStyle&&e.tspan.setAttributeNS(null,"font-style",e.fontStyle);e.fontWeight!==o.fontWeight&&e.tspan.setAttributeNS(null,"font-weight",e.fontWeight);const b=e.textRenderingMode&i.TextRenderingMode.FILL_STROKE_MASK;if(b===i.TextRenderingMode.FILL||b===i.TextRenderingMode.FILL_STROKE){e.fillColor!==o.fillColor&&e.tspan.setAttributeNS(null,"fill",e.fillColor);e.fillAlpha<1&&e.tspan.setAttributeNS(null,"fill-opacity",e.fillAlpha)}else e.textRenderingMode===i.TextRenderingMode.ADD_TO_PATH?e.tspan.setAttributeNS(null,"fill","transparent"):e.tspan.setAttributeNS(null,"fill","none");if(b===i.TextRenderingMode.STROKE||b===i.TextRenderingMode.FILL_STROKE){const t=1/(e.textMatrixScale||1);this._setStrokeAttributes(e.tspan,t)}let A=e.textMatrix;if(0!==e.textRise){A=A.slice();A[5]+=e.textRise}e.txtElement.setAttributeNS(null,"transform",`${pm(A)} scale(${pf(d)}, -1)`);e.txtElement.setAttributeNS(l,"xml:space","preserve");e.txtElement.append(e.tspan);e.txtgrp.append(e.txtElement);this._ensureTransformGroup().append(e.txtElement)}setLeadingMoveText(t,e){this.setLeading(-e);this.moveText(t,e)}addFontStyle(t){if(!t.data)throw new Error('addFontStyle: No font data available, ensure that the "fontExtraProperties" API parameter is set.');if(!this.cssStyle){this.cssStyle=this.svgFactory.createElement("svg:style");this.cssStyle.setAttributeNS(null,"type","text/css");this.defs.append(this.cssStyle)}const e=createObjectURL(t.data,t.mimetype,this.forceDataSchema);this.cssStyle.textContent+=`@font-face { font-family: "${t.loadedName}"; src: url(${e}); }\n`}setFont(t){const e=this.current,s=this.commonObjs.get(t[0]);let n=t[1];e.font=s;if(this.embedFonts&&!s.missingFile&&!this.embeddedFonts[s.loadedName]){this.addFontStyle(s);this.embeddedFonts[s.loadedName]=s}e.fontMatrix=s.fontMatrix||i.FONT_IDENTITY_MATRIX;let a="normal";s.black?a="900":s.bold&&(a="bold");const r=s.italic?"italic":"normal";if(n<0){n=-n;e.fontDirection=-1}else e.fontDirection=1;e.fontSize=n;e.fontFamily=s.loadedName;e.fontWeight=a;e.fontStyle=r;e.tspan=this.svgFactory.createElement("svg:tspan");e.tspan.setAttributeNS(null,"y",pf(-e.y));e.xcoords=[];e.ycoords=[]}endText(){const t=this.current;if(t.textRenderingMode&i.TextRenderingMode.ADD_TO_PATH_FLAG&&t.txtElement?.hasChildNodes()){t.element=t.txtElement;this.clip("nonzero");this.endPath()}}setLineWidth(t){t>0&&(this.current.lineWidth=t)}setLineCap(t){this.current.lineCap=h[t]}setLineJoin(t){this.current.lineJoin=d[t]}setMiterLimit(t){this.current.miterLimit=t}setStrokeAlpha(t){this.current.strokeAlpha=t}setStrokeRGBColor(t,e,s){this.current.strokeColor=i.Util.makeHexColor(t,e,s)}setFillAlpha(t){this.current.fillAlpha=t}setFillRGBColor(t,e,s){this.current.fillColor=i.Util.makeHexColor(t,e,s);this.current.tspan=this.svgFactory.createElement("svg:tspan");this.current.xcoords=[];this.current.ycoords=[]}setStrokeColorN(t){this.current.strokeColor=this._makeColorN_Pattern(t)}setFillColorN(t){this.current.fillColor=this._makeColorN_Pattern(t)}shadingFill(t){const e=this.viewport.width,s=this.viewport.height,n=i.Util.inverseTransform(this.transformMatrix),a=i.Util.applyTransform([0,0],n),r=i.Util.applyTransform([0,s],n),o=i.Util.applyTransform([e,0],n),l=i.Util.applyTransform([e,s],n),c=Math.min(a[0],r[0],o[0],l[0]),h=Math.min(a[1],r[1],o[1],l[1]),d=Math.max(a[0],r[0],o[0],l[0]),u=Math.max(a[1],r[1],o[1],l[1]),p=this.svgFactory.createElement("svg:rect");p.setAttributeNS(null,"x",c);p.setAttributeNS(null,"y",h);p.setAttributeNS(null,"width",d-c);p.setAttributeNS(null,"height",u-h);p.setAttributeNS(null,"fill",this._makeShadingPattern(t));this.current.fillAlpha<1&&p.setAttributeNS(null,"fill-opacity",this.current.fillAlpha);this._ensureTransformGroup().append(p)}_makeColorN_Pattern(t){return"TilingPattern"===t[0]?this._makeTilingPattern(t):this._makeShadingPattern(t)}_makeTilingPattern(t){const e=t[1],s=t[2],n=t[3]||i.IDENTITY_MATRIX,[a,r,o,l]=t[4],c=t[5],h=t[6],d=t[7],u="shading"+f++,[p,g,m,b]=i.Util.normalizeRect([...i.Util.applyTransform([a,r],n),...i.Util.applyTransform([o,l],n)]),[A,_]=i.Util.singularValueDecompose2dScale(n),v=c*A,y=h*_,S=this.svgFactory.createElement("svg:pattern");S.setAttributeNS(null,"id",u);S.setAttributeNS(null,"patternUnits","userSpaceOnUse");S.setAttributeNS(null,"width",v);S.setAttributeNS(null,"height",y);S.setAttributeNS(null,"x",`${p}`);S.setAttributeNS(null,"y",`${g}`);const x=this.svg,E=this.transformMatrix,C=this.current.fillColor,P=this.current.strokeColor,T=this.svgFactory.create(m-p,b-g);this.svg=T;this.transformMatrix=n;if(2===d){const t=i.Util.makeHexColor(...e);this.current.fillColor=t;this.current.strokeColor=t}this.executeOpTree(this.convertOpList(s));this.svg=x;this.transformMatrix=E;this.current.fillColor=C;this.current.strokeColor=P;S.append(T.childNodes[0]);this.defs.append(S);return`url(#${u})`}_makeShadingPattern(t){"string"==typeof t&&(t=this.objs.get(t));switch(t[0]){case"RadialAxial":const e="shading"+f++,s=t[3];let n;switch(t[1]){case"axial":const s=t[4],i=t[5];n=this.svgFactory.createElement("svg:linearGradient");n.setAttributeNS(null,"id",e);n.setAttributeNS(null,"gradientUnits","userSpaceOnUse");n.setAttributeNS(null,"x1",s[0]);n.setAttributeNS(null,"y1",s[1]);n.setAttributeNS(null,"x2",i[0]);n.setAttributeNS(null,"y2",i[1]);break;case"radial":const a=t[4],r=t[5],o=t[6],l=t[7];n=this.svgFactory.createElement("svg:radialGradient");n.setAttributeNS(null,"id",e);n.setAttributeNS(null,"gradientUnits","userSpaceOnUse");n.setAttributeNS(null,"cx",r[0]);n.setAttributeNS(null,"cy",r[1]);n.setAttributeNS(null,"r",l);n.setAttributeNS(null,"fx",a[0]);n.setAttributeNS(null,"fy",a[1]);n.setAttributeNS(null,"fr",o);break;default:throw new Error(`Unknown RadialAxial type: ${t[1]}`)}for(const t of s){const e=this.svgFactory.createElement("svg:stop");e.setAttributeNS(null,"offset",t[0]);e.setAttributeNS(null,"stop-color",t[1]);n.append(e)}this.defs.append(n);return`url(#${e})`;case"Mesh":(0,i.warn)("Unimplemented pattern Mesh");return null;case"Dummy":return"hotpink";default:throw new Error(`Unknown IR type: ${t[0]}`)}}setDash(t,e){this.current.dashArray=t;this.current.dashPhase=e}constructPath(t,e){const s=this.current;let n=s.x,a=s.y,r=[],o=0;for(const s of t)switch(0|s){case i.OPS.rectangle:n=e[o++];a=e[o++];const t=n+e[o++],s=a+e[o++];r.push("M",pf(n),pf(a),"L",pf(t),pf(a),"L",pf(t),pf(s),"L",pf(n),pf(s),"Z");break;case i.OPS.moveTo:n=e[o++];a=e[o++];r.push("M",pf(n),pf(a));break;case i.OPS.lineTo:n=e[o++];a=e[o++];r.push("L",pf(n),pf(a));break;case i.OPS.curveTo:n=e[o+4];a=e[o+5];r.push("C",pf(e[o]),pf(e[o+1]),pf(e[o+2]),pf(e[o+3]),pf(n),pf(a));o+=6;break;case i.OPS.curveTo2:r.push("C",pf(n),pf(a),pf(e[o]),pf(e[o+1]),pf(e[o+2]),pf(e[o+3]));n=e[o+2];a=e[o+3];o+=4;break;case i.OPS.curveTo3:n=e[o+2];a=e[o+3];r.push("C",pf(e[o]),pf(e[o+1]),pf(n),pf(a),pf(n),pf(a));o+=4;break;case i.OPS.closePath:r.push("Z")}r=r.join(" ");if(s.path&&t.length>0&&t[0]!==i.OPS.rectangle&&t[0]!==i.OPS.moveTo)r=s.path.getAttributeNS(null,"d")+r;else{s.path=this.svgFactory.createElement("svg:path");this._ensureTransformGroup().append(s.path)}s.path.setAttributeNS(null,"d",r);s.path.setAttributeNS(null,"fill","none");s.element=s.path;s.setCurrentPoint(n,a)}endPath(){const t=this.current;t.path=null;if(!this.pendingClip)return;if(!t.element){this.pendingClip=null;return}const e="clippath"+p++,s=this.svgFactory.createElement("svg:clipPath");s.setAttributeNS(null,"id",e);s.setAttributeNS(null,"transform",pm(this.transformMatrix));const n=t.element.cloneNode(!0);"evenodd"===this.pendingClip?n.setAttributeNS(null,"clip-rule","evenodd"):n.setAttributeNS(null,"clip-rule","nonzero");this.pendingClip=null;s.append(n);this.defs.append(s);if(t.activeClipUrl){t.clipGroup=null;for(const t of this.extraStack)t.clipGroup=null;s.setAttributeNS(null,"clip-path",t.activeClipUrl)}t.activeClipUrl=`url(#${e})`;this.tgrp=null}clip(t){this.pendingClip=t}closePath(){const t=this.current;if(t.path){const e=`${t.path.getAttributeNS(null,"d")}Z`;t.path.setAttributeNS(null,"d",e)}}setLeading(t){this.current.leading=-t}setTextRise(t){this.current.textRise=t}setTextRenderingMode(t){this.current.textRenderingMode=t}setHScale(t){this.current.textHScale=t/100}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[e,s]of t)switch(e){case"LW":this.setLineWidth(s);break;case"LC":this.setLineCap(s);break;case"LJ":this.setLineJoin(s);break;case"ML":this.setMiterLimit(s);break;case"D":this.setDash(s[0],s[1]);break;case"RI":this.setRenderingIntent(s);break;case"FL":this.setFlatness(s);break;case"Font":this.setFont(s);break;case"CA":this.setStrokeAlpha(s);break;case"ca":this.setFillAlpha(s);break;default:(0,i.warn)(`Unimplemented graphic state operator ${e}`)}}fill(){const t=this.current;if(t.element){t.element.setAttributeNS(null,"fill",t.fillColor);t.element.setAttributeNS(null,"fill-opacity",t.fillAlpha);this.endPath()}}stroke(){const t=this.current;if(t.element){this._setStrokeAttributes(t.element);t.element.setAttributeNS(null,"fill","none");this.endPath()}}_setStrokeAttributes(t,e=1){const s=this.current;let n=s.dashArray;1!==e&&n.length>0&&(n=n.map((function(t){return e*t})));t.setAttributeNS(null,"stroke",s.strokeColor);t.setAttributeNS(null,"stroke-opacity",s.strokeAlpha);t.setAttributeNS(null,"stroke-miterlimit",pf(s.miterLimit));t.setAttributeNS(null,"stroke-linecap",s.lineCap);t.setAttributeNS(null,"stroke-linejoin",s.lineJoin);t.setAttributeNS(null,"stroke-width",pf(e*s.lineWidth)+"px");t.setAttributeNS(null,"stroke-dasharray",n.map(pf).join(" "));t.setAttributeNS(null,"stroke-dashoffset",pf(e*s.dashPhase)+"px")}eoFill(){this.current.element?.setAttributeNS(null,"fill-rule","evenodd");this.fill()}fillStroke(){this.stroke();this.fill()}eoFillStroke(){this.current.element?.setAttributeNS(null,"fill-rule","evenodd");this.fillStroke()}closeStroke(){this.closePath();this.stroke()}closeFillStroke(){this.closePath();this.fillStroke()}closeEOFillStroke(){this.closePath();this.eoFillStroke()}paintSolidColorImageMask(){const t=this.svgFactory.createElement("svg:rect");t.setAttributeNS(null,"x","0");t.setAttributeNS(null,"y","0");t.setAttributeNS(null,"width","1px");t.setAttributeNS(null,"height","1px");t.setAttributeNS(null,"fill",this.current.fillColor);this._ensureTransformGroup().append(t)}paintImageXObject(t){const e=this.getObject(t);e?this.paintInlineImageXObject(e):(0,i.warn)(`Dependent image with object ID ${t} is not ready yet`)}paintInlineImageXObject(t,e){const s=t.width,n=t.height,i=u(t,this.forceDataSchema,!!e),a=this.svgFactory.createElement("svg:rect");a.setAttributeNS(null,"x","0");a.setAttributeNS(null,"y","0");a.setAttributeNS(null,"width",pf(s));a.setAttributeNS(null,"height",pf(n));this.current.element=a;this.clip("nonzero");const r=this.svgFactory.createElement("svg:image");r.setAttributeNS(c,"xlink:href",i);r.setAttributeNS(null,"x","0");r.setAttributeNS(null,"y",pf(-n));r.setAttributeNS(null,"width",pf(s)+"px");r.setAttributeNS(null,"height",pf(n)+"px");r.setAttributeNS(null,"transform",`scale(${pf(1/s)} ${pf(-1/n)})`);e?e.append(r):this._ensureTransformGroup().append(r)}paintImageMaskXObject(t){const e=this.getObject(t.data,t);if(e.bitmap){(0,i.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");return}const s=this.current,n=e.width,a=e.height,r=s.fillColor;s.maskId="mask"+g++;const o=this.svgFactory.createElement("svg:mask");o.setAttributeNS(null,"id",s.maskId);const l=this.svgFactory.createElement("svg:rect");l.setAttributeNS(null,"x","0");l.setAttributeNS(null,"y","0");l.setAttributeNS(null,"width",pf(n));l.setAttributeNS(null,"height",pf(a));l.setAttributeNS(null,"fill",r);l.setAttributeNS(null,"mask",`url(#${s.maskId})`);this.defs.append(o);this._ensureTransformGroup().append(l);this.paintInlineImageXObject(e,o)}paintFormXObjectBegin(t,e){Array.isArray(t)&&6===t.length&&this.transform(t[0],t[1],t[2],t[3],t[4],t[5]);if(e){const t=e[2]-e[0],s=e[3]-e[1],n=this.svgFactory.createElement("svg:rect");n.setAttributeNS(null,"x",e[0]);n.setAttributeNS(null,"y",e[1]);n.setAttributeNS(null,"width",pf(t));n.setAttributeNS(null,"height",pf(s));this.current.element=n;this.clip("nonzero");this.endPath()}}paintFormXObjectEnd(){}_initialize(t){const e=this.svgFactory.create(t.width,t.height),s=this.svgFactory.createElement("svg:defs");e.append(s);this.defs=s;const n=this.svgFactory.createElement("svg:g");n.setAttributeNS(null,"transform",pm(t.transform));e.append(n);this.svg=n;return e}_ensureClipGroup(){if(!this.current.clipGroup){const t=this.svgFactory.createElement("svg:g");t.setAttributeNS(null,"clip-path",this.current.activeClipUrl);this.svg.append(t);this.current.clipGroup=t}return this.current.clipGroup}_ensureTransformGroup(){if(!this.tgrp){this.tgrp=this.svgFactory.createElement("svg:g");this.tgrp.setAttributeNS(null,"transform",pm(this.transformMatrix));this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)}return this.tgrp}}}}],__webpack_module_cache__={};function __w_pdfjs_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var s=__webpack_module_cache__[t]={exports:{}};__webpack_modules__[t](s,s.exports,__w_pdfjs_require__);return s.exports}var __webpack_exports__={};(()=>{var t=__webpack_exports__;Object.defineProperty(t,"__esModule",{value:!0});Object.defineProperty(t,"AbortException",{enumerable:!0,get:function(){return e.AbortException}});Object.defineProperty(t,"AnnotationEditorLayer",{enumerable:!0,get:function(){return a.AnnotationEditorLayer}});Object.defineProperty(t,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return e.AnnotationEditorParamsType}});Object.defineProperty(t,"AnnotationEditorType",{enumerable:!0,get:function(){return e.AnnotationEditorType}});Object.defineProperty(t,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return r.AnnotationEditorUIManager}});Object.defineProperty(t,"AnnotationLayer",{enumerable:!0,get:function(){return o.AnnotationLayer}});Object.defineProperty(t,"AnnotationMode",{enumerable:!0,get:function(){return e.AnnotationMode}});Object.defineProperty(t,"CMapCompressionType",{enumerable:!0,get:function(){return e.CMapCompressionType}});Object.defineProperty(t,"FeatureTest",{enumerable:!0,get:function(){return e.FeatureTest}});Object.defineProperty(t,"GlobalWorkerOptions",{enumerable:!0,get:function(){return l.GlobalWorkerOptions}});Object.defineProperty(t,"InvalidPDFException",{enumerable:!0,get:function(){return e.InvalidPDFException}});Object.defineProperty(t,"MissingPDFException",{enumerable:!0,get:function(){return e.MissingPDFException}});Object.defineProperty(t,"OPS",{enumerable:!0,get:function(){return e.OPS}});Object.defineProperty(t,"PDFDataRangeTransport",{enumerable:!0,get:function(){return s.PDFDataRangeTransport}});Object.defineProperty(t,"PDFDateString",{enumerable:!0,get:function(){return n.PDFDateString}});Object.defineProperty(t,"PDFWorker",{enumerable:!0,get:function(){return s.PDFWorker}});Object.defineProperty(t,"PasswordResponses",{enumerable:!0,get:function(){return e.PasswordResponses}});Object.defineProperty(t,"PermissionFlag",{enumerable:!0,get:function(){return e.PermissionFlag}});Object.defineProperty(t,"PixelsPerInch",{enumerable:!0,get:function(){return n.PixelsPerInch}});Object.defineProperty(t,"RenderingCancelledException",{enumerable:!0,get:function(){return n.RenderingCancelledException}});Object.defineProperty(t,"SVGGraphics",{enumerable:!0,get:function(){return c.SVGGraphics}});Object.defineProperty(t,"UNSUPPORTED_FEATURES",{enumerable:!0,get:function(){return e.UNSUPPORTED_FEATURES}});Object.defineProperty(t,"UnexpectedResponseException",{enumerable:!0,get:function(){return e.UnexpectedResponseException}});Object.defineProperty(t,"Util",{enumerable:!0,get:function(){return e.Util}});Object.defineProperty(t,"VerbosityLevel",{enumerable:!0,get:function(){return e.VerbosityLevel}});Object.defineProperty(t,"XfaLayer",{enumerable:!0,get:function(){return h.XfaLayer}});Object.defineProperty(t,"build",{enumerable:!0,get:function(){return s.build}});Object.defineProperty(t,"createPromiseCapability",{enumerable:!0,get:function(){return e.createPromiseCapability}});Object.defineProperty(t,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return e.createValidAbsoluteUrl}});Object.defineProperty(t,"getDocument",{enumerable:!0,get:function(){return s.getDocument}});Object.defineProperty(t,"getFilenameFromUrl",{enumerable:!0,get:function(){return n.getFilenameFromUrl}});Object.defineProperty(t,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return n.getPdfFilenameFromUrl}});Object.defineProperty(t,"getXfaPageViewport",{enumerable:!0,get:function(){return n.getXfaPageViewport}});Object.defineProperty(t,"isDataScheme",{enumerable:!0,get:function(){return n.isDataScheme}});Object.defineProperty(t,"isPdfFile",{enumerable:!0,get:function(){return n.isPdfFile}});Object.defineProperty(t,"loadScript",{enumerable:!0,get:function(){return n.loadScript}});Object.defineProperty(t,"renderTextLayer",{enumerable:!0,get:function(){return i.renderTextLayer}});Object.defineProperty(t,"setLayerDimensions",{enumerable:!0,get:function(){return n.setLayerDimensions}});Object.defineProperty(t,"shadow",{enumerable:!0,get:function(){return e.shadow}});Object.defineProperty(t,"updateTextLayer",{enumerable:!0,get:function(){return i.updateTextLayer}});Object.defineProperty(t,"version",{enumerable:!0,get:function(){return s.version}});var e=__w_pdfjs_require__(1),s=__w_pdfjs_require__(2),n=__w_pdfjs_require__(6),i=__w_pdfjs_require__(26),a=__w_pdfjs_require__(27),r=__w_pdfjs_require__(5),o=__w_pdfjs_require__(32),l=__w_pdfjs_require__(14),c=__w_pdfjs_require__(35),h=__w_pdfjs_require__(34)})();return __webpack_exports__})())); \ No newline at end of file
diff --git a/vhosts/blog/static/pdf.worker.min.js b/vhosts/blog/static/pdf.worker.min.js
new file mode 100644
index 00000000..058b9a37
--- /dev/null
+++ b/vhosts/blog/static/pdf.worker.min.js
@@ -0,0 +1,22 @@
+/**
+ * @licstart The following is the entire license notice for the
+ * JavaScript code in this page
+ *
+ * Copyright 2023 Mozilla Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * @licend The above is the entire license notice for the
+ * JavaScript code in this page
+ */
+!function webpackUniversalModuleDefinition(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("pdfjs-dist/build/pdf.worker",[],t):"object"==typeof exports?exports["pdfjs-dist/build/pdf.worker"]=t():e["pdfjs-dist/build/pdf.worker"]=e.pdfjsWorker=t()}(globalThis,(()=>(()=>{"use strict";var e=[,(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.WorkerTask=t.WorkerMessageHandler=void 0;var r=a(2),n=a(3),i=a(4),s=a(6),o=a(69),c=a(63),l=a(100),h=a(101),u=a(102);class WorkerTask{constructor(e){this.name=e;this.terminated=!1;this._capability=(0,r.createPromiseCapability)()}get finished(){return this._capability.promise}finish(){this._capability.resolve()}terminate(){this.terminated=!0}ensureNotTerminated(){if(this.terminated)throw new Error("Worker task was terminated")}}t.WorkerTask=WorkerTask;class WorkerMessageHandler{static setup(e,t){let a=!1;e.on("test",(function(t){if(!a){a=!0;e.send("test",t instanceof Uint8Array)}}));e.on("configure",(function(e){(0,r.setVerbosityLevel)(e.verbosity)}));e.on("GetDocRequest",(function(e){return WorkerMessageHandler.createDocumentHandler(e,t)}))}static createDocumentHandler(e,t){let a,d=!1,f=null;const g=new Set,p=(0,r.getVerbosityLevel)(),{docId:m,apiVersion:b}=e,y="3.4.120";if(b!==y)throw new Error(`The API version "${b}" does not match the Worker version "${y}".`);const w=[];for(const e in[])w.push(e);if(w.length)throw new Error("The `Array.prototype` contains unexpected enumerable properties: "+w.join(", ")+"; thus breaking e.g. `for...in` iteration of `Array`s.");if("undefined"==typeof ReadableStream){const e="The browser/environment lacks native support for critical functionality used by the PDF.js library (e.g. `ReadableStream`); ";if(l.isNodeJS)throw new Error(e+"please use a `legacy`-build instead.");throw new Error(e+"please update to a supported browser.")}const S=m+"_worker";let x=new h.MessageHandler(S,m,t);function ensureNotTerminated(){if(d)throw new Error("Worker was terminated")}function startWorkerTask(e){g.add(e)}function finishWorkerTask(e){e.finish();g.delete(e)}async function loadDocument(e){await a.ensureDoc("checkHeader");await a.ensureDoc("parseStartXRef");await a.ensureDoc("parse",[e]);await a.ensureDoc("checkFirstPage",[e]);await a.ensureDoc("checkLastPage",[e]);const t=await a.ensureDoc("isPureXfa");if(t){const e=new WorkerTask("loadXfaFonts");startWorkerTask(e);await Promise.all([a.loadXfaFonts(x,e).catch((e=>{})).then((()=>finishWorkerTask(e))),a.loadXfaImages()])}const[r,n]=await Promise.all([a.ensureDoc("numPages"),a.ensureDoc("fingerprints")]);return{numPages:r,fingerprints:n,htmlForXfa:t?await a.ensureDoc("htmlForXfa"):null}}function getPdfManager({data:e,password:t,disableAutoFetch:a,rangeChunkSize:i,length:o,docBaseUrl:c,enableXfa:l,evaluatorOptions:h}){const d={source:null,disableAutoFetch:a,docBaseUrl:c,docId:m,enableXfa:l,evaluatorOptions:h,handler:x,length:o,password:t,rangeChunkSize:i},g=(0,r.createPromiseCapability)();let p;if(e){try{d.source=e;p=new s.LocalPdfManager(d);g.resolve(p)}catch(e){g.reject(e)}return g.promise}let b,y=[];try{b=new u.PDFWorkerStream(x)}catch(e){g.reject(e);return g.promise}const w=b.getFullReader();w.headersReady.then((function(){if(w.isRangeSupported){d.source=b;d.length=w.contentLength;d.disableAutoFetch=d.disableAutoFetch||w.isStreamingSupported;p=new s.NetworkPdfManager(d);for(const e of y)p.sendProgressiveData(e);y=[];g.resolve(p);f=null}})).catch((function(e){g.reject(e);f=null}));let S=0;new Promise((function(e,t){const readChunk=function({value:e,done:a}){try{ensureNotTerminated();if(a){p||function(){const e=(0,n.arrayBuffersToBytes)(y);o&&e.length!==o&&(0,r.warn)("reported HTTP length is different from actual");try{d.source=e;p=new s.LocalPdfManager(d);g.resolve(p)}catch(e){g.reject(e)}y=[]}();f=null;return}S+=e.byteLength;w.isStreamingSupported||x.send("DocProgress",{loaded:S,total:Math.max(S,w.contentLength||0)});p?p.sendProgressiveData(e):y.push(e);w.read().then(readChunk,t)}catch(e){t(e)}};w.read().then(readChunk,t)})).catch((function(e){g.reject(e);f=null}));f=function(e){b.cancelAllRequests(e)};return g.promise}x.on("GetPage",(function(e){return a.getPage(e.pageIndex).then((function(e){return Promise.all([a.ensure(e,"rotate"),a.ensure(e,"ref"),a.ensure(e,"userUnit"),a.ensure(e,"view")]).then((function([e,t,a,r]){return{rotate:e,ref:t,userUnit:a,view:r}}))}))}));x.on("GetPageIndex",(function(e){const t=i.Ref.get(e.num,e.gen);return a.ensureCatalog("getPageIndex",[t])}));x.on("GetDestinations",(function(e){return a.ensureCatalog("destinations")}));x.on("GetDestination",(function(e){return a.ensureCatalog("getDestination",[e.id])}));x.on("GetPageLabels",(function(e){return a.ensureCatalog("pageLabels")}));x.on("GetPageLayout",(function(e){return a.ensureCatalog("pageLayout")}));x.on("GetPageMode",(function(e){return a.ensureCatalog("pageMode")}));x.on("GetViewerPreferences",(function(e){return a.ensureCatalog("viewerPreferences")}));x.on("GetOpenAction",(function(e){return a.ensureCatalog("openAction")}));x.on("GetAttachments",(function(e){return a.ensureCatalog("attachments")}));x.on("GetJavaScript",(function(e){return a.ensureCatalog("javaScript")}));x.on("GetDocJSActions",(function(e){return a.ensureCatalog("jsActions")}));x.on("GetPageJSActions",(function({pageIndex:e}){return a.getPage(e).then((function(e){return a.ensure(e,"jsActions")}))}));x.on("GetOutline",(function(e){return a.ensureCatalog("documentOutline")}));x.on("GetOptionalContentConfig",(function(e){return a.ensureCatalog("optionalContentConfig")}));x.on("GetPermissions",(function(e){return a.ensureCatalog("permissions")}));x.on("GetMetadata",(function(e){return Promise.all([a.ensureDoc("documentInfo"),a.ensureCatalog("metadata")])}));x.on("GetMarkInfo",(function(e){return a.ensureCatalog("markInfo")}));x.on("GetData",(function(e){return a.requestLoadedStream().then((function(e){return e.bytes}))}));x.on("GetAnnotations",(function({pageIndex:e,intent:t}){return a.getPage(e).then((function(a){const r=new WorkerTask(`GetAnnotations: page ${e}`);startWorkerTask(r);return a.getAnnotationsData(x,r,t).then((e=>{finishWorkerTask(r);return e}),(e=>{finishWorkerTask(r);throw e}))}))}));x.on("GetFieldObjects",(function(e){return a.ensureDoc("fieldObjects")}));x.on("HasJSActions",(function(e){return a.ensureDoc("hasJSActions")}));x.on("GetCalculationOrderIds",(function(e){return a.ensureDoc("calculationOrderIds")}));x.on("SaveDocument",(function({isPureXfa:e,numPages:t,annotationStorage:s,filename:o}){const l=[a.requestLoadedStream(),a.ensureCatalog("acroForm"),a.ensureCatalog("acroFormRef"),a.ensureDoc("xref"),a.ensureDoc("startXRef")],h=e?null:(0,n.getNewAnnotationsMap)(s);if(h)for(const[e,t]of h)l.push(a.getPage(e).then((a=>{const r=new WorkerTask(`Save (editor): page ${e}`);return a.saveNewAnnotations(x,r,t).finally((function(){finishWorkerTask(r)}))})));if(e)l.push(a.serializeXfaData(s));else for(let e=0;e<t;e++)l.push(a.getPage(e).then((function(t){const a=new WorkerTask(`Save: page ${e}`);return t.save(x,a,s).finally((function(){finishWorkerTask(a)}))})));return Promise.all(l).then((function([t,a,n,s,l,...h]){let u=[],d=null;if(e){d=h[0];if(!d)return t.bytes}else{u=h.flat(2);if(0===u.length)return t.bytes}const f=n&&a instanceof i.Dict&&u.some((e=>e.needAppearances)),g=a instanceof i.Dict&&a.get("XFA")||null;let p=null,m=!1;if(Array.isArray(g)){for(let e=0,t=g.length;e<t;e+=2)if("datasets"===g[e]){p=g[e+1];m=!0}null===p&&(p=s.getNewTemporaryRef())}else g&&(0,r.warn)("Unsupported XFA type.");let b=Object.create(null);if(s.trailer){const e=Object.create(null),t=s.trailer.get("Info")||null;t instanceof i.Dict&&t.forEach(((t,a)=>{"string"==typeof a&&(e[t]=(0,r.stringToPDFString)(a))}));b={rootRef:s.trailer.getRaw("Root")||null,encryptRef:s.trailer.getRaw("Encrypt")||null,newRef:s.getNewTemporaryRef(),infoRef:s.trailer.getRaw("Info")||null,info:e,fileIds:s.trailer.get("ID")||null,startXRef:l,filename:o}}try{return(0,c.incrementalUpdate)({originalData:t.bytes,xrefInfo:b,newRefs:u,xref:s,hasXfa:!!g,xfaDatasetsRef:p,hasXfaDatasetsEntry:m,needAppearances:f,acroFormRef:n,acroForm:a,xfaData:d})}finally{s.resetNewTemporaryRef()}}))}));x.on("GetOperatorList",(function(e,t){const n=e.pageIndex;a.getPage(n).then((function(a){const i=new WorkerTask(`GetOperatorList: page ${n}`);startWorkerTask(i);const s=p>=r.VerbosityLevel.INFOS?Date.now():0;a.getOperatorList({handler:x,sink:t,task:i,intent:e.intent,cacheKey:e.cacheKey,annotationStorage:e.annotationStorage}).then((function(e){finishWorkerTask(i);s&&(0,r.info)(`page=${n+1} - getOperatorList: time=${Date.now()-s}ms, len=${e.length}`);t.close()}),(function(e){finishWorkerTask(i);i.terminated||t.error(e)}))}))}));x.on("GetTextContent",(function(e,t){const n=e.pageIndex;a.getPage(n).then((function(a){const i=new WorkerTask("GetTextContent: page "+n);startWorkerTask(i);const s=p>=r.VerbosityLevel.INFOS?Date.now():0;a.extractTextContent({handler:x,task:i,sink:t,includeMarkedContent:e.includeMarkedContent,combineTextItems:e.combineTextItems}).then((function(){finishWorkerTask(i);s&&(0,r.info)(`page=${n+1} - getTextContent: time=`+(Date.now()-s)+"ms");t.close()}),(function(e){finishWorkerTask(i);i.terminated||t.error(e)}))}))}));x.on("GetStructTree",(function(e){return a.getPage(e.pageIndex).then((function(e){return a.ensure(e,"getStructTree")}))}));x.on("FontFallback",(function(e){return a.fontFallback(e.id,x)}));x.on("Cleanup",(function(e){return a.cleanup(!0)}));x.on("Terminate",(function(e){d=!0;const t=[];if(a){a.terminate(new r.AbortException("Worker was terminated."));const e=a.cleanup();t.push(e);a=null}else(0,o.clearGlobalCaches)();f&&f(new r.AbortException("Worker was terminated."));for(const e of g){t.push(e.finished);e.terminate()}return Promise.all(t).then((function(){x.destroy();x=null}))}));x.on("Ready",(function(t){!function setupDoc(e){function onSuccess(e){ensureNotTerminated();x.send("GetDoc",{pdfInfo:e})}function onFailure(e){ensureNotTerminated();if(e instanceof r.PasswordException){const t=new WorkerTask(`PasswordException: response ${e.code}`);startWorkerTask(t);x.sendWithPromise("PasswordRequest",e).then((function({password:e}){finishWorkerTask(t);a.updatePassword(e);pdfManagerReady()})).catch((function(){finishWorkerTask(t);x.send("DocException",e)}))}else e instanceof r.InvalidPDFException||e instanceof r.MissingPDFException||e instanceof r.UnexpectedResponseException||e instanceof r.UnknownErrorException?x.send("DocException",e):x.send("DocException",new r.UnknownErrorException(e.message,e.toString()))}function pdfManagerReady(){ensureNotTerminated();loadDocument(!1).then(onSuccess,(function(e){ensureNotTerminated();e instanceof n.XRefParseException?a.requestLoadedStream().then((function(){ensureNotTerminated();loadDocument(!0).then(onSuccess,onFailure)})):onFailure(e)}))}ensureNotTerminated();getPdfManager(e).then((function(e){if(d){e.terminate(new r.AbortException("Worker was terminated."));throw new Error("Worker was terminated")}a=e;a.requestLoadedStream(!0).then((e=>{x.send("DataLoaded",{length:e.bytes.byteLength})}))})).then(pdfManagerReady,onFailure)}(e);e=null}));return S}static initializeFromPort(e){const t=new h.MessageHandler("worker","main",e);WorkerMessageHandler.setup(t,e);t.send("ready",null)}}t.WorkerMessageHandler=WorkerMessageHandler;"undefined"==typeof window&&!l.isNodeJS&&"undefined"!=typeof self&&function isMessagePort(e){return"function"==typeof e.postMessage&&"onmessage"in e}(self)&&WorkerMessageHandler.initializeFromPort(self)},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.VerbosityLevel=t.Util=t.UnknownErrorException=t.UnexpectedResponseException=t.UNSUPPORTED_FEATURES=t.TextRenderingMode=t.RenderingIntentFlag=t.PermissionFlag=t.PasswordResponses=t.PasswordException=t.PageActionEventType=t.OPS=t.MissingPDFException=t.LINE_FACTOR=t.LINE_DESCENT_FACTOR=t.InvalidPDFException=t.ImageKind=t.IDENTITY_MATRIX=t.FormatError=t.FeatureTest=t.FONT_IDENTITY_MATRIX=t.DocumentActionEventType=t.CMapCompressionType=t.BaseException=t.BASELINE_FACTOR=t.AnnotationType=t.AnnotationStateModelType=t.AnnotationReviewState=t.AnnotationReplyType=t.AnnotationMode=t.AnnotationMarkedState=t.AnnotationFlag=t.AnnotationFieldFlag=t.AnnotationEditorType=t.AnnotationEditorPrefix=t.AnnotationEditorParamsType=t.AnnotationBorderStyleType=t.AnnotationActionEventType=t.AbortException=void 0;t.assert=function assert(e,t){e||unreachable(t)};t.bytesToString=function bytesToString(e){"object"==typeof e&&null!==e&&void 0!==e.length||unreachable("Invalid argument for bytesToString");const t=e.length,a=8192;if(t<a)return String.fromCharCode.apply(null,e);const r=[];for(let n=0;n<t;n+=a){const i=Math.min(n+a,t),s=e.subarray(n,i);r.push(String.fromCharCode.apply(null,s))}return r.join("")};t.createPromiseCapability=function createPromiseCapability(){const e=Object.create(null);let t=!1;Object.defineProperty(e,"settled",{get:()=>t});e.promise=new Promise((function(a,r){e.resolve=function(e){t=!0;a(e)};e.reject=function(e){t=!0;r(e)}}));return e};t.createValidAbsoluteUrl=function createValidAbsoluteUrl(e,t=null,a=null){if(!e)return null;try{if(a&&"string"==typeof e){if(a.addDefaultProtocol&&e.startsWith("www.")){const t=e.match(/\./g);t&&t.length>=2&&(e=`http://${e}`)}if(a.tryConvertEncoding)try{e=stringToUTF8String(e)}catch(e){}}const r=t?new URL(e,t):new URL(e);if(function _isValidProtocol(e){if(!e)return!1;switch(e.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(r))return r}catch(e){}return null};t.getModificationDate=function getModificationDate(e=new Date){return[e.getUTCFullYear().toString(),(e.getUTCMonth()+1).toString().padStart(2,"0"),e.getUTCDate().toString().padStart(2,"0"),e.getUTCHours().toString().padStart(2,"0"),e.getUTCMinutes().toString().padStart(2,"0"),e.getUTCSeconds().toString().padStart(2,"0")].join("")};t.getVerbosityLevel=function getVerbosityLevel(){return r};t.info=function info(e){r>=a.INFOS&&console.log(`Info: ${e}`)};t.isArrayBuffer=function isArrayBuffer(e){return"object"==typeof e&&null!==e&&void 0!==e.byteLength};t.isArrayEqual=function isArrayEqual(e,t){if(e.length!==t.length)return!1;for(let a=0,r=e.length;a<r;a++)if(e[a]!==t[a])return!1;return!0};t.objectFromMap=function objectFromMap(e){const t=Object.create(null);for(const[a,r]of e)t[a]=r;return t};t.objectSize=function objectSize(e){return Object.keys(e).length};t.setVerbosityLevel=function setVerbosityLevel(e){Number.isInteger(e)&&(r=e)};t.shadow=shadow;t.string32=function string32(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e)};t.stringToBytes=stringToBytes;t.stringToPDFString=function stringToPDFString(e){if(e[0]>="ï"){let t;"þ"===e[0]&&"ÿ"===e[1]?t="utf-16be":"ÿ"===e[0]&&"þ"===e[1]?t="utf-16le":"ï"===e[0]&&"»"===e[1]&&"¿"===e[2]&&(t="utf-8");if(t)try{const a=new TextDecoder(t,{fatal:!0}),r=stringToBytes(e);return a.decode(r)}catch(e){warn(`stringToPDFString: "${e}".`)}}const t=[];for(let a=0,r=e.length;a<r;a++){const r=s[e.charCodeAt(a)];t.push(r?String.fromCharCode(r):e.charAt(a))}return t.join("")};t.stringToUTF8String=stringToUTF8String;t.unreachable=unreachable;t.utf8StringToString=function utf8StringToString(e){return unescape(encodeURIComponent(e))};t.warn=warn;t.IDENTITY_MATRIX=[1,0,0,1,0,0];t.FONT_IDENTITY_MATRIX=[.001,0,0,.001,0,0];t.LINE_FACTOR=1.35;t.LINE_DESCENT_FACTOR=.35;t.BASELINE_FACTOR=.25925925925925924;t.RenderingIntentFlag={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};t.AnnotationMode={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};t.AnnotationEditorPrefix="pdfjs_internal_editor_";t.AnnotationEditorType={DISABLE:-1,NONE:0,FREETEXT:3,INK:15};t.AnnotationEditorParamsType={FREETEXT_SIZE:1,FREETEXT_COLOR:2,FREETEXT_OPACITY:3,INK_COLOR:11,INK_THICKNESS:12,INK_OPACITY:13};t.PermissionFlag={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};t.TextRenderingMode={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};t.ImageKind={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};t.AnnotationType={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26};t.AnnotationStateModelType={MARKED:"Marked",REVIEW:"Review"};t.AnnotationMarkedState={MARKED:"Marked",UNMARKED:"Unmarked"};t.AnnotationReviewState={ACCEPTED:"Accepted",REJECTED:"Rejected",CANCELLED:"Cancelled",COMPLETED:"Completed",NONE:"None"};t.AnnotationReplyType={GROUP:"Group",REPLY:"R"};t.AnnotationFlag={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};t.AnnotationFieldFlag={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};t.AnnotationBorderStyleType={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};t.AnnotationActionEventType={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"};t.DocumentActionEventType={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};t.PageActionEventType={O:"PageOpen",C:"PageClose"};const a={ERRORS:0,WARNINGS:1,INFOS:5};t.VerbosityLevel=a;t.CMapCompressionType={NONE:0,BINARY:1};t.OPS={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};t.UNSUPPORTED_FEATURES={forms:"forms",javaScript:"javaScript",signatures:"signatures",smask:"smask",shadingPattern:"shadingPattern",errorTilingPattern:"errorTilingPattern",errorExtGState:"errorExtGState",errorXObject:"errorXObject",errorFontLoadType3:"errorFontLoadType3",errorFontState:"errorFontState",errorFontMissing:"errorFontMissing",errorFontTranslate:"errorFontTranslate",errorColorSpace:"errorColorSpace",errorOperatorList:"errorOperatorList",errorFontToUnicode:"errorFontToUnicode",errorFontLoadNative:"errorFontLoadNative",errorFontBuildPath:"errorFontBuildPath",errorFontGetPath:"errorFontGetPath",errorMarkedContent:"errorMarkedContent",errorContentSubStream:"errorContentSubStream"};t.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let r=a.WARNINGS;function warn(e){r>=a.WARNINGS&&console.log(`Warning: ${e}`)}function unreachable(e){throw new Error(e)}function shadow(e,t,a,r=!1){Object.defineProperty(e,t,{value:a,enumerable:!r,configurable:!0,writable:!1});return a}const n=function BaseExceptionClosure(){function BaseException(e,t){this.constructor===BaseException&&unreachable("Cannot initialize BaseException.");this.message=e;this.name=t}BaseException.prototype=new Error;BaseException.constructor=BaseException;return BaseException}();t.BaseException=n;t.PasswordException=class PasswordException extends n{constructor(e,t){super(e,"PasswordException");this.code=t}};t.UnknownErrorException=class UnknownErrorException extends n{constructor(e,t){super(e,"UnknownErrorException");this.details=t}};t.InvalidPDFException=class InvalidPDFException extends n{constructor(e){super(e,"InvalidPDFException")}};t.MissingPDFException=class MissingPDFException extends n{constructor(e){super(e,"MissingPDFException")}};t.UnexpectedResponseException=class UnexpectedResponseException extends n{constructor(e,t){super(e,"UnexpectedResponseException");this.status=t}};t.FormatError=class FormatError extends n{constructor(e){super(e,"FormatError")}};t.AbortException=class AbortException extends n{constructor(e){super(e,"AbortException")}};function stringToBytes(e){"string"!=typeof e&&unreachable("Invalid argument for stringToBytes");const t=e.length,a=new Uint8Array(t);for(let r=0;r<t;++r)a[r]=255&e.charCodeAt(r);return a}t.FeatureTest=class FeatureTest{static get isLittleEndian(){return shadow(this,"isLittleEndian",function isLittleEndian(){const e=new Uint8Array(4);e[0]=1;return 1===new Uint32Array(e.buffer,0,1)[0]}())}static get isEvalSupported(){return shadow(this,"isEvalSupported",function isEvalSupported(){try{new Function("");return!0}catch(e){return!1}}())}static get isOffscreenCanvasSupported(){return shadow(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}static get platform(){return"undefined"==typeof navigator?shadow(this,"platform",{isWin:!1,isMac:!1}):shadow(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}};const i=[...Array(256).keys()].map((e=>e.toString(16).padStart(2,"0")));class Util{static makeHexColor(e,t,a){return`#${i[e]}${i[t]}${i[a]}`}static scaleMinMax(e,t){let a;if(e[0]){if(e[0]<0){a=t[0];t[0]=t[1];t[1]=a}t[0]*=e[0];t[1]*=e[0];if(e[3]<0){a=t[2];t[2]=t[3];t[3]=a}t[2]*=e[3];t[3]*=e[3]}else{a=t[0];t[0]=t[2];t[2]=a;a=t[1];t[1]=t[3];t[3]=a;if(e[1]<0){a=t[2];t[2]=t[3];t[3]=a}t[2]*=e[1];t[3]*=e[1];if(e[2]<0){a=t[0];t[0]=t[1];t[1]=a}t[0]*=e[2];t[1]*=e[2]}t[0]+=e[4];t[1]+=e[4];t[2]+=e[5];t[3]+=e[5]}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static applyTransform(e,t){return[e[0]*t[0]+e[1]*t[2]+t[4],e[0]*t[1]+e[1]*t[3]+t[5]]}static applyInverseTransform(e,t){const a=t[0]*t[3]-t[1]*t[2];return[(e[0]*t[3]-e[1]*t[2]+t[2]*t[5]-t[4]*t[3])/a,(-e[0]*t[1]+e[1]*t[0]+t[4]*t[1]-t[5]*t[0])/a]}static getAxialAlignedBoundingBox(e,t){const a=Util.applyTransform(e,t),r=Util.applyTransform(e.slice(2,4),t),n=Util.applyTransform([e[0],e[3]],t),i=Util.applyTransform([e[2],e[1]],t);return[Math.min(a[0],r[0],n[0],i[0]),Math.min(a[1],r[1],n[1],i[1]),Math.max(a[0],r[0],n[0],i[0]),Math.max(a[1],r[1],n[1],i[1])]}static inverseTransform(e){const t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static singularValueDecompose2dScale(e){const t=[e[0],e[2],e[1],e[3]],a=e[0]*t[0]+e[1]*t[2],r=e[0]*t[1]+e[1]*t[3],n=e[2]*t[0]+e[3]*t[2],i=e[2]*t[1]+e[3]*t[3],s=(a+i)/2,o=Math.sqrt((a+i)**2-4*(a*i-n*r))/2,c=s+o||1,l=s-o||1;return[Math.sqrt(c),Math.sqrt(l)]}static normalizeRect(e){const t=e.slice(0);if(e[0]>e[2]){t[0]=e[2];t[2]=e[0]}if(e[1]>e[3]){t[1]=e[3];t[3]=e[1]}return t}static intersect(e,t){const a=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),r=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(a>r)return null;const n=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),i=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return n>i?null:[a,n,r,i]}static bezierBoundingBox(e,t,a,r,n,i,s,o){const c=[],l=[[],[]];let h,u,d,f,g,p,m,b;for(let l=0;l<2;++l){if(0===l){u=6*e-12*a+6*n;h=-3*e+9*a-9*n+3*s;d=3*a-3*e}else{u=6*t-12*r+6*i;h=-3*t+9*r-9*i+3*o;d=3*r-3*t}if(Math.abs(h)<1e-12){if(Math.abs(u)<1e-12)continue;f=-d/u;0<f&&f<1&&c.push(f)}else{m=u*u-4*d*h;b=Math.sqrt(m);if(!(m<0)){g=(-u+b)/(2*h);0<g&&g<1&&c.push(g);p=(-u-b)/(2*h);0<p&&p<1&&c.push(p)}}}let y,w=c.length;const S=w;for(;w--;){f=c[w];y=1-f;l[0][w]=y*y*y*e+3*y*y*f*a+3*y*f*f*n+f*f*f*s;l[1][w]=y*y*y*t+3*y*y*f*r+3*y*f*f*i+f*f*f*o}l[0][S]=e;l[1][S]=t;l[0][S+1]=s;l[1][S+1]=o;l[0].length=l[1].length=S+2;return[Math.min(...l[0]),Math.min(...l[1]),Math.max(...l[0]),Math.max(...l[1])]}}t.Util=Util;const s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function stringToUTF8String(e){return decodeURIComponent(escape(e))}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.XRefParseException=t.XRefEntryException=t.ParserEOFException=t.PDF_VERSION_REGEXP=t.MissingDataException=void 0;t.arrayBuffersToBytes=function arrayBuffersToBytes(e){const t=e.length;if(0===t)return new Uint8Array(0);if(1===t)return new Uint8Array(e[0]);let a=0;for(let r=0;r<t;r++)a+=e[r].byteLength;const r=new Uint8Array(a);let n=0;for(let a=0;a<t;a++){const t=new Uint8Array(e[a]);r.set(t,n);n+=t.byteLength}return r};t.collectActions=function collectActions(e,t,a){const i=Object.create(null),s=getInheritableProperty({dict:t,key:"AA",stopWhenFound:!1});if(s)for(let t=s.length-1;t>=0;t--){const r=s[t];if(r instanceof n.Dict)for(const t of r.getKeys()){const s=a[t];if(!s)continue;const o=[];_collectJS(r.getRaw(t),e,o,new n.RefSet);o.length>0&&(i[s]=o)}}if(t.has("A")){const a=[];_collectJS(t.get("A"),e,a,new n.RefSet);a.length>0&&(i.Action=a)}return(0,r.objectSize)(i)>0?i:null};t.encodeToXmlString=function encodeToXmlString(e){const t=[];let a=0;for(let r=0,n=e.length;r<n;r++){const n=e.codePointAt(r);if(32<=n&&n<=126){const i=o[n];if(i){a<r&&t.push(e.substring(a,r));t.push(i);a=r+1}}else{a<r&&t.push(e.substring(a,r));t.push(`&#x${n.toString(16).toUpperCase()};`);n>55295&&(n<57344||n>65533)&&r++;a=r+1}}if(0===t.length)return e;a<e.length&&t.push(e.substring(a,e.length));return t.join("")};t.escapePDFName=function escapePDFName(e){const t=[];let a=0;for(let r=0,n=e.length;r<n;r++){const n=e.charCodeAt(r);if(n<33||n>126||35===n||40===n||41===n||60===n||62===n||91===n||93===n||123===n||125===n||47===n||37===n){a<r&&t.push(e.substring(a,r));t.push(`#${n.toString(16)}`);a=r+1}}if(0===t.length)return e;a<e.length&&t.push(e.substring(a,e.length));return t.join("")};t.escapeString=function escapeString(e){return e.replace(/([()\\\n\r])/g,(e=>"\n"===e?"\\n":"\r"===e?"\\r":`\\${e}`))};t.getArrayLookupTableFactory=function getArrayLookupTableFactory(e){let t;return function(){if(e){let a=e();e=null;t=Object.create(null);for(let e=0,r=a.length;e<r;e+=2)t[a[e]]=a[e+1];a=null}return t}};t.getInheritableProperty=getInheritableProperty;t.getLookupTableFactory=function getLookupTableFactory(e){let t;return function(){if(e){t=Object.create(null);e(t);e=null}return t}};t.getNewAnnotationsMap=function getNewAnnotationsMap(e){if(!e)return null;const t=new Map;for(const[a,n]of e){if(!a.startsWith(r.AnnotationEditorPrefix))continue;let e=t.get(n.pageIndex);if(!e){e=[];t.set(n.pageIndex,e)}e.push(n)}return t.size>0?t:null};t.getRotationMatrix=function getRotationMatrix(e,t,a){switch(e){case 90:return[0,1,-1,0,t,0];case 180:return[-1,0,0,-1,t,a];case 270:return[0,-1,1,0,0,a];default:throw new Error("Invalid rotation")}};t.isAscii=function isAscii(e){return/^[\x00-\x7F]*$/.test(e)};t.isWhiteSpace=function isWhiteSpace(e){return 32===e||9===e||13===e||10===e};t.log2=function log2(e){if(e<=0)return 0;return Math.ceil(Math.log2(e))};t.numberToString=function numberToString(e){if(Number.isInteger(e))return e.toString();const t=Math.round(100*e);if(t%100==0)return(t/100).toString();if(t%10==0)return e.toFixed(1);return e.toFixed(2)};t.parseXFAPath=function parseXFAPath(e){const t=/(.+)\[(\d+)\]$/;return e.split(".").map((e=>{const a=e.match(t);return a?{name:a[1],pos:parseInt(a[2],10)}:{name:e,pos:0}}))};t.readInt8=function readInt8(e,t){return e[t]<<24>>24};t.readUint16=function readUint16(e,t){return e[t]<<8|e[t+1]};t.readUint32=function readUint32(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0};t.recoverJsURL=function recoverJsURL(e){const t=new RegExp("^\\s*("+["app.launchURL","window.open","xfa.host.gotoURL"].join("|").split(".").join("\\.")+")\\((?:'|\")([^'\"]*)(?:'|\")(?:,\\s*(\\w+)\\)|\\))","i").exec(e);if(t&&t[2]){const e=t[2];let a=!1;"true"===t[3]&&"app.launchURL"===t[1]&&(a=!0);return{url:e,newWindow:a}}return null};t.stringToUTF16HexString=function stringToUTF16HexString(e){const t=[];for(let a=0,r=e.length;a<r;a++){const r=e.charCodeAt(a);t.push((r>>8&255).toString(16).padStart(2,"0"),(255&r).toString(16).padStart(2,"0"))}return t.join("")};t.stringToUTF16String=function stringToUTF16String(e,t=!1){const a=[];t&&a.push("þÿ");for(let t=0,r=e.length;t<r;t++){const r=e.charCodeAt(t);a.push(String.fromCharCode(r>>8&255),String.fromCharCode(255&r))}return a.join("")};t.toRomanNumerals=function toRomanNumerals(e,t=!1){(0,r.assert)(Number.isInteger(e)&&e>0,"The number should be a positive integer.");const a=[];let n;for(;e>=1e3;){e-=1e3;a.push("M")}n=e/100|0;e%=100;a.push(s[n]);n=e/10|0;e%=10;a.push(s[10+n]);a.push(s[20+e]);const i=a.join("");return t?i.toLowerCase():i};t.validateCSSFont=function validateCSSFont(e){const t=new Set(["100","200","300","400","500","600","700","800","900","1000","normal","bold","bolder","lighter"]),{fontFamily:a,fontWeight:n,italicAngle:i}=e;if(/^".*"$/.test(a)){if(/[^\\]"/.test(a.slice(1,a.length-1))){(0,r.warn)(`XFA - FontFamily contains some unescaped ": ${a}.`);return!1}}else if(/^'.*'$/.test(a)){if(/[^\\]'/.test(a.slice(1,a.length-1))){(0,r.warn)(`XFA - FontFamily contains some unescaped ': ${a}.`);return!1}}else for(const e of a.split(/[ \t]+/))if(/^(\d|(-(\d|-)))/.test(e)||!/^[\w-\\]+$/.test(e)){(0,r.warn)(`XFA - FontFamily contains some invalid <custom-ident>: ${a}.`);return!1}const s=n?n.toString():"";e.fontWeight=t.has(s)?s:"400";const o=parseFloat(i);e.italicAngle=isNaN(o)||o<-90||o>90?"14":i.toString();return!0};var r=a(2),n=a(4),i=a(5);t.PDF_VERSION_REGEXP=/^[1-9]\.\d$/;class MissingDataException extends r.BaseException{constructor(e,t){super(`Missing data [${e}, ${t})`,"MissingDataException");this.begin=e;this.end=t}}t.MissingDataException=MissingDataException;class ParserEOFException extends r.BaseException{constructor(e){super(e,"ParserEOFException")}}t.ParserEOFException=ParserEOFException;class XRefEntryException extends r.BaseException{constructor(e){super(e,"XRefEntryException")}}t.XRefEntryException=XRefEntryException;class XRefParseException extends r.BaseException{constructor(e){super(e,"XRefParseException")}}t.XRefParseException=XRefParseException;function getInheritableProperty({dict:e,key:t,getArray:a=!1,stopWhenFound:r=!0}){let i;const s=new n.RefSet;for(;e instanceof n.Dict&&(!e.objId||!s.has(e.objId));){e.objId&&s.put(e.objId);const n=a?e.getArray(t):e.get(t);if(void 0!==n){if(r)return n;i||(i=[]);i.push(n)}e=e.get("Parent")}return i}const s=["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM","","X","XX","XXX","XL","L","LX","LXX","LXXX","XC","","I","II","III","IV","V","VI","VII","VIII","IX"];function _collectJS(e,t,a,s){if(!e)return;let o=null;if(e instanceof n.Ref){if(s.has(e))return;o=e;s.put(o);e=t.fetch(e)}if(Array.isArray(e))for(const r of e)_collectJS(r,t,a,s);else if(e instanceof n.Dict){if((0,n.isName)(e.get("S"),"JavaScript")){const t=e.get("JS");let n;t instanceof i.BaseStream?n=t.getString():"string"==typeof t&&(n=t);n=n&&(0,r.stringToPDFString)(n).replace(/\u0000/g,"");n&&a.push(n)}_collectJS(e.getRaw("Next"),t,a,s)}o&&s.remove(o)}const o={60:"&lt;",62:"&gt;",38:"&amp;",34:"&quot;",39:"&apos;"}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.RefSetCache=t.RefSet=t.Ref=t.Name=t.EOF=t.Dict=t.Cmd=t.CIRCULAR_REF=void 0;t.clearPrimitiveCaches=function clearPrimitiveCaches(){o._clearCache();s._clearCache();l._clearCache()};t.isCmd=function isCmd(e,t){return e instanceof o&&(void 0===t||e.cmd===t)};t.isDict=function isDict(e,t){return e instanceof Dict&&(void 0===t||isName(e.get("Type"),t))};t.isName=isName;t.isRefsEqual=function isRefsEqual(e,t){return e.num===t.num&&e.gen===t.gen};var r=a(2);const n=Symbol("CIRCULAR_REF");t.CIRCULAR_REF=n;const i=Symbol("EOF");t.EOF=i;const s=function NameClosure(){let e=Object.create(null);class Name{constructor(e){this.name=e}static get(t){return e[t]||(e[t]=new Name(t))}static _clearCache(){e=Object.create(null)}}return Name}();t.Name=s;const o=function CmdClosure(){let e=Object.create(null);class Cmd{constructor(e){this.cmd=e}static get(t){return e[t]||(e[t]=new Cmd(t))}static _clearCache(){e=Object.create(null)}}return Cmd}();t.Cmd=o;const c=function nonSerializableClosure(){return c};class Dict{constructor(e=null){this._map=Object.create(null);this.xref=e;this.objId=null;this.suppressEncryption=!1;this.__nonSerializable__=c}assignXref(e){this.xref=e}get size(){return Object.keys(this._map).length}get(e,t,a){let r=this._map[e];if(void 0===r&&void 0!==t){r=this._map[t];void 0===r&&void 0!==a&&(r=this._map[a])}return r instanceof l&&this.xref?this.xref.fetch(r,this.suppressEncryption):r}async getAsync(e,t,a){let r=this._map[e];if(void 0===r&&void 0!==t){r=this._map[t];void 0===r&&void 0!==a&&(r=this._map[a])}return r instanceof l&&this.xref?this.xref.fetchAsync(r,this.suppressEncryption):r}getArray(e,t,a){let r=this._map[e];if(void 0===r&&void 0!==t){r=this._map[t];void 0===r&&void 0!==a&&(r=this._map[a])}r instanceof l&&this.xref&&(r=this.xref.fetch(r,this.suppressEncryption));if(Array.isArray(r)){r=r.slice();for(let e=0,t=r.length;e<t;e++)r[e]instanceof l&&this.xref&&(r[e]=this.xref.fetch(r[e],this.suppressEncryption))}return r}getRaw(e){return this._map[e]}getKeys(){return Object.keys(this._map)}getRawValues(){return Object.values(this._map)}set(e,t){this._map[e]=t}has(e){return void 0!==this._map[e]}forEach(e){for(const t in this._map)e(t,this.get(t))}static get empty(){const e=new Dict(null);e.set=(e,t)=>{(0,r.unreachable)("Should not call `set` on the empty dictionary.")};return(0,r.shadow)(this,"empty",e)}static merge({xref:e,dictArray:t,mergeSubDicts:a=!1}){const r=new Dict(e),n=new Map;for(const e of t)if(e instanceof Dict)for(const[t,r]of Object.entries(e._map)){let e=n.get(t);if(void 0===e){e=[];n.set(t,e)}else if(!(a&&r instanceof Dict))continue;e.push(r)}for(const[t,a]of n){if(1===a.length||!(a[0]instanceof Dict)){r._map[t]=a[0];continue}const n=new Dict(e);for(const e of a)for(const[t,a]of Object.entries(e._map))void 0===n._map[t]&&(n._map[t]=a);n.size>0&&(r._map[t]=n)}n.clear();return r.size>0?r:Dict.empty}}t.Dict=Dict;const l=function RefClosure(){let e=Object.create(null);class Ref{constructor(e,t){this.num=e;this.gen=t}toString(){return 0===this.gen?`${this.num}R`:`${this.num}R${this.gen}`}static get(t,a){const r=0===a?`${t}R`:`${t}R${a}`;return e[r]||(e[r]=new Ref(t,a))}static _clearCache(){e=Object.create(null)}}return Ref}();t.Ref=l;class RefSet{constructor(e=null){this._set=new Set(e&&e._set)}has(e){return this._set.has(e.toString())}put(e){this._set.add(e.toString())}remove(e){this._set.delete(e.toString())}[Symbol.iterator](){return this._set.values()}clear(){this._set.clear()}}t.RefSet=RefSet;class RefSetCache{constructor(){this._map=new Map}get size(){return this._map.size}get(e){return this._map.get(e.toString())}has(e){return this._map.has(e.toString())}put(e,t){this._map.set(e.toString(),t)}putAlias(e,t){this._map.set(e.toString(),this.get(t))}[Symbol.iterator](){return this._map.values()}clear(){this._map.clear()}}t.RefSetCache=RefSetCache;function isName(e,t){return e instanceof s&&(void 0===t||e.name===t)}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.BaseStream=void 0;var r=a(2);class BaseStream{constructor(){this.constructor===BaseStream&&(0,r.unreachable)("Cannot initialize BaseStream.")}get length(){(0,r.unreachable)("Abstract getter `length` accessed")}get isEmpty(){(0,r.unreachable)("Abstract getter `isEmpty` accessed")}get isDataLoaded(){return(0,r.shadow)(this,"isDataLoaded",!0)}getByte(){(0,r.unreachable)("Abstract method `getByte` called")}getBytes(e){(0,r.unreachable)("Abstract method `getBytes` called")}peekByte(){const e=this.getByte();-1!==e&&this.pos--;return e}peekBytes(e){const t=this.getBytes(e);this.pos-=t.length;return t}getUint16(){const e=this.getByte(),t=this.getByte();return-1===e||-1===t?-1:(e<<8)+t}getInt32(){return(this.getByte()<<24)+(this.getByte()<<16)+(this.getByte()<<8)+this.getByte()}getByteRange(e,t){(0,r.unreachable)("Abstract method `getByteRange` called")}getString(e){return(0,r.bytesToString)(this.getBytes(e))}skip(e){this.pos+=e||1}reset(){(0,r.unreachable)("Abstract method `reset` called")}moveStart(){(0,r.unreachable)("Abstract method `moveStart` called")}makeSubStream(e,t,a=null){(0,r.unreachable)("Abstract method `makeSubStream` called")}getBaseStreams(){return null}}t.BaseStream=BaseStream},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.NetworkPdfManager=t.LocalPdfManager=void 0;var r=a(2),n=a(7),i=a(3),s=a(9),o=a(8);class BasePdfManager{constructor(e){this.constructor===BasePdfManager&&(0,r.unreachable)("Cannot initialize BasePdfManager.");this._docBaseUrl=function parseDocBaseUrl(e){if(e){const t=(0,r.createValidAbsoluteUrl)(e);if(t)return t.href;(0,r.warn)(`Invalid absolute docBaseUrl: "${e}".`)}return null}(e.docBaseUrl);this._docId=e.docId;this._password=e.password;this.enableXfa=e.enableXfa;this.evaluatorOptions=e.evaluatorOptions}get docId(){return this._docId}get password(){return this._password}get docBaseUrl(){const e=this.pdfDocument.catalog;return(0,r.shadow)(this,"docBaseUrl",e.baseUrl||this._docBaseUrl)}ensureDoc(e,t){return this.ensure(this.pdfDocument,e,t)}ensureXRef(e,t){return this.ensure(this.pdfDocument.xref,e,t)}ensureCatalog(e,t){return this.ensure(this.pdfDocument.catalog,e,t)}getPage(e){return this.pdfDocument.getPage(e)}fontFallback(e,t){return this.pdfDocument.fontFallback(e,t)}loadXfaFonts(e,t){return this.pdfDocument.loadXfaFonts(e,t)}loadXfaImages(){return this.pdfDocument.loadXfaImages()}serializeXfaData(e){return this.pdfDocument.serializeXfaData(e)}cleanup(e=!1){return this.pdfDocument.cleanup(e)}async ensure(e,t,a){(0,r.unreachable)("Abstract method `ensure` called")}requestRange(e,t){(0,r.unreachable)("Abstract method `requestRange` called")}requestLoadedStream(e=!1){(0,r.unreachable)("Abstract method `requestLoadedStream` called")}sendProgressiveData(e){(0,r.unreachable)("Abstract method `sendProgressiveData` called")}updatePassword(e){this._password=e}terminate(e){(0,r.unreachable)("Abstract method `terminate` called")}}t.LocalPdfManager=class LocalPdfManager extends BasePdfManager{constructor(e){super(e);const t=new o.Stream(e.source);this.pdfDocument=new s.PDFDocument(this,t);this._loadedStreamPromise=Promise.resolve(t)}async ensure(e,t,a){const r=e[t];return"function"==typeof r?r.apply(e,a):r}requestRange(e,t){return Promise.resolve()}requestLoadedStream(e=!1){return this._loadedStreamPromise}terminate(e){}};t.NetworkPdfManager=class NetworkPdfManager extends BasePdfManager{constructor(e){super(e);this.streamManager=new n.ChunkedStreamManager(e.source,{msgHandler:e.handler,length:e.length,disableAutoFetch:e.disableAutoFetch,rangeChunkSize:e.rangeChunkSize});this.pdfDocument=new s.PDFDocument(this,this.streamManager.getStream())}async ensure(e,t,a){try{const r=e[t];return"function"==typeof r?r.apply(e,a):r}catch(r){if(!(r instanceof i.MissingDataException))throw r;await this.requestRange(r.begin,r.end);return this.ensure(e,t,a)}}requestRange(e,t){return this.streamManager.requestRange(e,t)}requestLoadedStream(e=!1){return this.streamManager.requestAllChunks(e)}sendProgressiveData(e){this.streamManager.onReceiveData({chunk:e})}terminate(e){this.streamManager.abort(e)}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.ChunkedStreamManager=t.ChunkedStream=void 0;var r=a(3),n=a(2),i=a(8);class ChunkedStream extends i.Stream{constructor(e,t,a){super(new Uint8Array(e),0,e,null);this.chunkSize=t;this._loadedChunks=new Set;this.numChunks=Math.ceil(e/t);this.manager=a;this.progressiveDataLength=0;this.lastSuccessfulEnsureByteChunk=-1}getMissingChunks(){const e=[];for(let t=0,a=this.numChunks;t<a;++t)this._loadedChunks.has(t)||e.push(t);return e}get numChunksLoaded(){return this._loadedChunks.size}get isDataLoaded(){return this.numChunksLoaded===this.numChunks}onReceiveData(e,t){const a=this.chunkSize;if(e%a!=0)throw new Error(`Bad begin offset: ${e}`);const r=e+t.byteLength;if(r%a!=0&&r!==this.bytes.length)throw new Error(`Bad end offset: ${r}`);this.bytes.set(new Uint8Array(t),e);const n=Math.floor(e/a),i=Math.floor((r-1)/a)+1;for(let e=n;e<i;++e)this._loadedChunks.add(e)}onReceiveProgressiveData(e){let t=this.progressiveDataLength;const a=Math.floor(t/this.chunkSize);this.bytes.set(new Uint8Array(e),t);t+=e.byteLength;this.progressiveDataLength=t;const r=t>=this.end?this.numChunks:Math.floor(t/this.chunkSize);for(let e=a;e<r;++e)this._loadedChunks.add(e)}ensureByte(e){if(e<this.progressiveDataLength)return;const t=Math.floor(e/this.chunkSize);if(!(t>this.numChunks)&&t!==this.lastSuccessfulEnsureByteChunk){if(!this._loadedChunks.has(t))throw new r.MissingDataException(e,e+1);this.lastSuccessfulEnsureByteChunk=t}}ensureRange(e,t){if(e>=t)return;if(t<=this.progressiveDataLength)return;const a=Math.floor(e/this.chunkSize);if(a>this.numChunks)return;const n=Math.min(Math.floor((t-1)/this.chunkSize)+1,this.numChunks);for(let i=a;i<n;++i)if(!this._loadedChunks.has(i))throw new r.MissingDataException(e,t)}nextEmptyChunk(e){const t=this.numChunks;for(let a=0;a<t;++a){const r=(e+a)%t;if(!this._loadedChunks.has(r))return r}return null}hasChunk(e){return this._loadedChunks.has(e)}getByte(){const e=this.pos;if(e>=this.end)return-1;e>=this.progressiveDataLength&&this.ensureByte(e);return this.bytes[this.pos++]}getBytes(e){const t=this.bytes,a=this.pos,r=this.end;if(!e){r>this.progressiveDataLength&&this.ensureRange(a,r);return t.subarray(a,r)}let n=a+e;n>r&&(n=r);n>this.progressiveDataLength&&this.ensureRange(a,n);this.pos=n;return t.subarray(a,n)}getByteRange(e,t){e<0&&(e=0);t>this.end&&(t=this.end);t>this.progressiveDataLength&&this.ensureRange(e,t);return this.bytes.subarray(e,t)}makeSubStream(e,t,a=null){t?e+t>this.progressiveDataLength&&this.ensureRange(e,e+t):e>=this.progressiveDataLength&&this.ensureByte(e);function ChunkedStreamSubstream(){}ChunkedStreamSubstream.prototype=Object.create(this);ChunkedStreamSubstream.prototype.getMissingChunks=function(){const e=this.chunkSize,t=Math.floor(this.start/e),a=Math.floor((this.end-1)/e)+1,r=[];for(let e=t;e<a;++e)this._loadedChunks.has(e)||r.push(e);return r};Object.defineProperty(ChunkedStreamSubstream.prototype,"isDataLoaded",{get(){return this.numChunksLoaded===this.numChunks||0===this.getMissingChunks().length},configurable:!0});const r=new ChunkedStreamSubstream;r.pos=r.start=e;r.end=e+t||this.end;r.dict=a;return r}getBaseStreams(){return[this]}}t.ChunkedStream=ChunkedStream;t.ChunkedStreamManager=class ChunkedStreamManager{constructor(e,t){this.length=t.length;this.chunkSize=t.rangeChunkSize;this.stream=new ChunkedStream(this.length,this.chunkSize,this);this.pdfNetworkStream=e;this.disableAutoFetch=t.disableAutoFetch;this.msgHandler=t.msgHandler;this.currRequestId=0;this._chunksNeededByRequest=new Map;this._requestsByChunk=new Map;this._promisesByRequest=new Map;this.progressiveDataLength=0;this.aborted=!1;this._loadedStreamCapability=(0,n.createPromiseCapability)()}sendRequest(e,t){const a=this.pdfNetworkStream.getRangeReader(e,t);a.isStreamingSupported||(a.onProgress=this.onProgress.bind(this));let n=[],i=0;return new Promise(((e,t)=>{const readChunk=({value:s,done:o})=>{try{if(o){const t=(0,r.arrayBuffersToBytes)(n);n=null;e(t);return}i+=s.byteLength;a.isStreamingSupported&&this.onProgress({loaded:i});n.push(s);a.read().then(readChunk,t)}catch(e){t(e)}};a.read().then(readChunk,t)})).then((t=>{this.aborted||this.onReceiveData({chunk:t,begin:e})}))}requestAllChunks(e=!1){if(!e){const e=this.stream.getMissingChunks();this._requestChunks(e)}return this._loadedStreamCapability.promise}_requestChunks(e){const t=this.currRequestId++,a=new Set;this._chunksNeededByRequest.set(t,a);for(const t of e)this.stream.hasChunk(t)||a.add(t);if(0===a.size)return Promise.resolve();const r=(0,n.createPromiseCapability)();this._promisesByRequest.set(t,r);const i=[];for(const e of a){let a=this._requestsByChunk.get(e);if(!a){a=[];this._requestsByChunk.set(e,a);i.push(e)}a.push(t)}if(i.length>0){const e=this.groupChunks(i);for(const t of e){const e=t.beginChunk*this.chunkSize,a=Math.min(t.endChunk*this.chunkSize,this.length);this.sendRequest(e,a).catch(r.reject)}}return r.promise.catch((e=>{if(!this.aborted)throw e}))}getStream(){return this.stream}requestRange(e,t){t=Math.min(t,this.length);const a=this.getBeginChunk(e),r=this.getEndChunk(t),n=[];for(let e=a;e<r;++e)n.push(e);return this._requestChunks(n)}requestRanges(e=[]){const t=[];for(const a of e){const e=this.getBeginChunk(a.begin),r=this.getEndChunk(a.end);for(let a=e;a<r;++a)t.includes(a)||t.push(a)}t.sort((function(e,t){return e-t}));return this._requestChunks(t)}groupChunks(e){const t=[];let a=-1,r=-1;for(let n=0,i=e.length;n<i;++n){const i=e[n];a<0&&(a=i);if(r>=0&&r+1!==i){t.push({beginChunk:a,endChunk:r+1});a=i}n+1===e.length&&t.push({beginChunk:a,endChunk:i+1});r=i}return t}onProgress(e){this.msgHandler.send("DocProgress",{loaded:this.stream.numChunksLoaded*this.chunkSize+e.loaded,total:this.length})}onReceiveData(e){const t=e.chunk,a=void 0===e.begin,r=a?this.progressiveDataLength:e.begin,n=r+t.byteLength,i=Math.floor(r/this.chunkSize),s=n<this.length?Math.floor(n/this.chunkSize):Math.ceil(n/this.chunkSize);if(a){this.stream.onReceiveProgressiveData(t);this.progressiveDataLength=n}else this.stream.onReceiveData(r,t);this.stream.isDataLoaded&&this._loadedStreamCapability.resolve(this.stream);const o=[];for(let e=i;e<s;++e){const t=this._requestsByChunk.get(e);if(t){this._requestsByChunk.delete(e);for(const a of t){const t=this._chunksNeededByRequest.get(a);t.has(e)&&t.delete(e);t.size>0||o.push(a)}}}if(!this.disableAutoFetch&&0===this._requestsByChunk.size){let e;if(1===this.stream.numChunksLoaded){const t=this.stream.numChunks-1;this.stream.hasChunk(t)||(e=t)}else e=this.stream.nextEmptyChunk(s);Number.isInteger(e)&&this._requestChunks([e])}for(const e of o){const t=this._promisesByRequest.get(e);this._promisesByRequest.delete(e);t.resolve()}this.msgHandler.send("DocProgress",{loaded:this.stream.numChunksLoaded*this.chunkSize,total:this.length})}onError(e){this._loadedStreamCapability.reject(e)}getBeginChunk(e){return Math.floor(e/this.chunkSize)}getEndChunk(e){return Math.floor((e-1)/this.chunkSize)+1}abort(e){this.aborted=!0;this.pdfNetworkStream&&this.pdfNetworkStream.cancelAllRequests(e);for(const t of this._promisesByRequest.values())t.reject(e)}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.StringStream=t.Stream=t.NullStream=void 0;var r=a(5),n=a(2);class Stream extends r.BaseStream{constructor(e,t,a,r){super();this.bytes=e instanceof Uint8Array?e:new Uint8Array(e);this.start=t||0;this.pos=this.start;this.end=t+a||this.bytes.length;this.dict=r}get length(){return this.end-this.start}get isEmpty(){return 0===this.length}getByte(){return this.pos>=this.end?-1:this.bytes[this.pos++]}getBytes(e){const t=this.bytes,a=this.pos,r=this.end;if(!e)return t.subarray(a,r);let n=a+e;n>r&&(n=r);this.pos=n;return t.subarray(a,n)}getByteRange(e,t){e<0&&(e=0);t>this.end&&(t=this.end);return this.bytes.subarray(e,t)}reset(){this.pos=this.start}moveStart(){this.start=this.pos}makeSubStream(e,t,a=null){return new Stream(this.bytes.buffer,e,t,a)}}t.Stream=Stream;t.StringStream=class StringStream extends Stream{constructor(e){super((0,n.stringToBytes)(e))}};t.NullStream=class NullStream extends Stream{constructor(){super(new Uint8Array(0))}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.Page=t.PDFDocument=void 0;var r=a(10),n=a(2),i=a(3),s=a(4),o=a(49),c=a(5),l=a(65),h=a(67),u=a(69),d=a(98),f=a(15),g=a(8),p=a(73),m=a(60),b=a(13),y=a(17),w=a(72),S=a(63),x=a(74),C=a(99);const k=[0,0,612,792];class Page{constructor({pdfManager:e,xref:t,pageIndex:a,pageDict:r,ref:n,globalIdFactory:i,fontCache:s,builtInCMapCache:o,standardFontDataCache:c,globalImageCache:l,nonBlendModesSet:h,xfaFactory:u}){this.pdfManager=e;this.pageIndex=a;this.pageDict=r;this.xref=t;this.ref=n;this.fontCache=s;this.builtInCMapCache=o;this.standardFontDataCache=c;this.globalImageCache=l;this.nonBlendModesSet=h;this.evaluatorOptions=e.evaluatorOptions;this.resourcesPromise=null;this.xfaFactory=u;const d={obj:0};this._localIdFactory=class extends i{static createObjId(){return`p${a}_${++d.obj}`}static getPageObjId(){return`page${n.toString()}`}}}_getInheritableProperty(e,t=!1){const a=(0,i.getInheritableProperty)({dict:this.pageDict,key:e,getArray:t,stopWhenFound:!1});return Array.isArray(a)?1!==a.length&&a[0]instanceof s.Dict?s.Dict.merge({xref:this.xref,dictArray:a}):a[0]:a}get content(){return this.pageDict.getArray("Contents")}get resources(){const e=this._getInheritableProperty("Resources");return(0,n.shadow)(this,"resources",e instanceof s.Dict?e:s.Dict.empty)}_getBoundingBox(e){if(this.xfaData)return this.xfaData.bbox;let t=this._getInheritableProperty(e,!0);if(Array.isArray(t)&&4===t.length){t=n.Util.normalizeRect(t);if(t[2]-t[0]>0&&t[3]-t[1]>0)return t;(0,n.warn)(`Empty, or invalid, /${e} entry.`)}return null}get mediaBox(){return(0,n.shadow)(this,"mediaBox",this._getBoundingBox("MediaBox")||k)}get cropBox(){return(0,n.shadow)(this,"cropBox",this._getBoundingBox("CropBox")||this.mediaBox)}get userUnit(){let e=this.pageDict.get("UserUnit");("number"!=typeof e||e<=0)&&(e=1);return(0,n.shadow)(this,"userUnit",e)}get view(){const{cropBox:e,mediaBox:t}=this;if(e!==t&&!(0,n.isArrayEqual)(e,t)){const a=n.Util.intersect(e,t);if(a&&a[2]-a[0]>0&&a[3]-a[1]>0)return(0,n.shadow)(this,"view",a);(0,n.warn)("Empty /CropBox and /MediaBox intersection.")}return(0,n.shadow)(this,"view",t)}get rotate(){let e=this._getInheritableProperty("Rotate")||0;e%90!=0?e=0:e>=360?e%=360:e<0&&(e=(e%360+360)%360);return(0,n.shadow)(this,"rotate",e)}_onSubStreamError(e,t,a){if(!this.evaluatorOptions.ignoreErrors)throw t;e.send("UnsupportedFeature",{featureId:n.UNSUPPORTED_FEATURES.errorContentSubStream});(0,n.warn)(`getContentStream - ignoring sub-stream (${a}): "${t}".`)}getContentStream(e){return this.pdfManager.ensure(this,"content").then((t=>t instanceof c.BaseStream?t:Array.isArray(t)?new y.StreamsSequenceStream(t,this._onSubStreamError.bind(this,e)):new g.NullStream))}get xfaData(){return(0,n.shadow)(this,"xfaData",this.xfaFactory?{bbox:this.xfaFactory.getBoundingBox(this.pageIndex)}:null)}async saveNewAnnotations(e,t,a){if(this.xfaFactory)throw new Error("XFA: Cannot save new annotations.");const n=new b.PartialEvaluator({xref:this.xref,handler:e,pageIndex:this.pageIndex,idFactory:this._localIdFactory,fontCache:this.fontCache,builtInCMapCache:this.builtInCMapCache,standardFontDataCache:this.standardFontDataCache,globalImageCache:this.globalImageCache,options:this.evaluatorOptions}),i=this.pageDict,s=this.annotations.slice(),o=await r.AnnotationFactory.saveNewAnnotations(n,t,a);for(const{ref:e}of o.annotations)s.push(e);const c=i.get("Annots");i.set("Annots",s);const l=[];let h=null;this.xref.encrypt&&(h=this.xref.encrypt.createCipherTransform(this.ref.num,this.ref.gen));(0,S.writeObject)(this.ref,i,l,h);c&&i.set("Annots",c);const u=o.dependencies;u.push({ref:this.ref,data:l.join("")},...o.annotations);return u}save(e,t,a){const r=new b.PartialEvaluator({xref:this.xref,handler:e,pageIndex:this.pageIndex,idFactory:this._localIdFactory,fontCache:this.fontCache,builtInCMapCache:this.builtInCMapCache,standardFontDataCache:this.standardFontDataCache,globalImageCache:this.globalImageCache,options:this.evaluatorOptions});return this._parsedAnnotations.then((function(e){const i=[];for(const s of e)s.mustBePrinted(a)&&i.push(s.save(r,t,a).catch((function(e){(0,n.warn)(`save - ignoring annotation data during "${t.name}" task: "${e}".`);return null})));return Promise.all(i).then((function(e){return e.filter((e=>!!e))}))}))}loadResources(e){this.resourcesPromise||(this.resourcesPromise=this.pdfManager.ensure(this,"resources"));return this.resourcesPromise.then((()=>new p.ObjectLoader(this.resources,e,this.xref).load()))}getOperatorList({handler:e,sink:t,task:a,intent:s,cacheKey:o,annotationStorage:c=null}){const l=this.getContentStream(e),h=this.loadResources(["ColorSpace","ExtGState","Font","Pattern","Properties","Shading","XObject"]),u=new b.PartialEvaluator({xref:this.xref,handler:e,pageIndex:this.pageIndex,idFactory:this._localIdFactory,fontCache:this.fontCache,builtInCMapCache:this.builtInCMapCache,standardFontDataCache:this.standardFontDataCache,globalImageCache:this.globalImageCache,options:this.evaluatorOptions}),d=this.xfaFactory?null:(0,i.getNewAnnotationsMap)(c);let f=Promise.resolve(null);if(d){const e=d.get(this.pageIndex);e&&(f=r.AnnotationFactory.printNewAnnotations(u,a,e))}const g=Promise.all([l,h]).then((([r])=>{const n=new m.OperatorList(s,t);e.send("StartRenderPage",{transparency:u.hasBlendModes(this.resources,this.nonBlendModesSet),pageIndex:this.pageIndex,cacheKey:o});return u.getOperatorList({stream:r,task:a,resources:this.resources,operatorList:n}).then((function(){return n}))}));return Promise.all([g,this._parsedAnnotations,f]).then((function([e,t,r]){r&&(t=t.concat(r));if(0===t.length||s&n.RenderingIntentFlag.ANNOTATIONS_DISABLE){e.flush(!0);return{length:e.totalLength}}const i=!!(s&n.RenderingIntentFlag.ANNOTATIONS_FORMS),o=!!(s&n.RenderingIntentFlag.ANY),l=!!(s&n.RenderingIntentFlag.DISPLAY),h=!!(s&n.RenderingIntentFlag.PRINT),d=[];for(const e of t)(o||l&&e.mustBeViewed(c)||h&&e.mustBePrinted(c))&&d.push(e.getOperatorList(u,a,s,i,c).catch((function(e){(0,n.warn)(`getOperatorList - ignoring annotation data during "${a.name}" task: "${e}".`);return{opList:null,separateForm:!1,separateCanvas:!1}})));return Promise.all(d).then((function(t){let a=!1,r=!1;for(const{opList:n,separateForm:i,separateCanvas:s}of t){e.addOpList(n);i&&(a=i);s&&(r=s)}e.flush(!0,{form:a,canvas:r});return{length:e.totalLength}}))}))}extractTextContent({handler:e,task:t,includeMarkedContent:a,sink:r,combineTextItems:n}){const i=this.getContentStream(e),s=this.loadResources(["ExtGState","Font","Properties","XObject"]);return Promise.all([i,s]).then((([i])=>new b.PartialEvaluator({xref:this.xref,handler:e,pageIndex:this.pageIndex,idFactory:this._localIdFactory,fontCache:this.fontCache,builtInCMapCache:this.builtInCMapCache,standardFontDataCache:this.standardFontDataCache,globalImageCache:this.globalImageCache,options:this.evaluatorOptions}).getTextContent({stream:i,task:t,resources:this.resources,includeMarkedContent:a,combineTextItems:n,sink:r,viewBox:this.view})))}async getStructTree(){const e=await this.pdfManager.ensureCatalog("structTreeRoot");if(!e)return null;return(await this.pdfManager.ensure(this,"_parseStructTree",[e])).serializable}_parseStructTree(e){const t=new w.StructTreePage(e,this.pageDict);t.parse();return t}async getAnnotationsData(e,t,a){const r=await this._parsedAnnotations;if(0===r.length)return[];const i=[],s=[];let o;const c=!!(a&n.RenderingIntentFlag.ANY),l=!!(a&n.RenderingIntentFlag.DISPLAY),h=!!(a&n.RenderingIntentFlag.PRINT);for(const a of r){const r=c||l&&a.viewable;(r||h&&a.printable)&&s.push(a.data);if(a.hasTextContent&&r){o||(o=new b.PartialEvaluator({xref:this.xref,handler:e,pageIndex:this.pageIndex,idFactory:this._localIdFactory,fontCache:this.fontCache,builtInCMapCache:this.builtInCMapCache,standardFontDataCache:this.standardFontDataCache,globalImageCache:this.globalImageCache,options:this.evaluatorOptions}));i.push(a.extractTextContent(o,t,this.view).catch((function(e){(0,n.warn)(`getAnnotationsData - ignoring textContent during "${t.name}" task: "${e}".`)})))}}await Promise.all(i);return s}get annotations(){const e=this._getInheritableProperty("Annots");return(0,n.shadow)(this,"annotations",Array.isArray(e)?e:[])}get _parsedAnnotations(){const e=this.pdfManager.ensure(this,"annotations").then((()=>{const e=[];for(const t of this.annotations)e.push(r.AnnotationFactory.create(this.xref,t,this.pdfManager,this._localIdFactory,!1).catch((function(e){(0,n.warn)(`_parsedAnnotations: "${e}".`);return null})));return Promise.all(e).then((function(e){if(0===e.length)return e;const t=[];let a;for(const n of e)if(n)if(n instanceof r.PopupAnnotation){a||(a=[]);a.push(n)}else t.push(n);a&&t.push(...a);return t}))}));return(0,n.shadow)(this,"_parsedAnnotations",e)}get jsActions(){const e=(0,i.collectActions)(this.xref,this.pageDict,n.PageActionEventType);return(0,n.shadow)(this,"jsActions",e)}}t.Page=Page;const v=new Uint8Array([37,80,68,70,45]),F=new Uint8Array([115,116,97,114,116,120,114,101,102]),O=new Uint8Array([101,110,100,111,98,106]),T="\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";function find(e,t,a=1024,r=!1){const n=t.length,i=e.peekBytes(a),s=i.length-n;if(s<=0)return!1;if(r){const a=n-1;let r=i.length-1;for(;r>=a;){let s=0;for(;s<n&&i[r-s]===t[a-s];)s++;if(s>=n){e.pos+=r-a;return!0}r--}}else{let a=0;for(;a<=s;){let r=0;for(;r<n&&i[a+r]===t[r];)r++;if(r>=n){e.pos+=a;return!0}a++}}return!1}t.PDFDocument=class PDFDocument{constructor(e,t){if(t.length<=0)throw new n.InvalidPDFException("The PDF file is empty, i.e. its size is zero bytes.");this.pdfManager=e;this.stream=t;this.xref=new C.XRef(t,e);this._pagePromises=new Map;this._version=null;const a={font:0};this._globalIdFactory=class{static getDocId(){return`g_${e.docId}`}static createFontId(){return"f"+ ++a.font}static createObjId(){(0,n.unreachable)("Abstract method `createObjId` called.")}static getPageObjId(){(0,n.unreachable)("Abstract method `getPageObjId` called.")}}}parse(e){this.xref.parse(e);this.catalog=new h.Catalog(this.pdfManager,this.xref)}get linearization(){let e=null;try{e=f.Linearization.create(this.stream)}catch(e){if(e instanceof i.MissingDataException)throw e;(0,n.info)(e)}return(0,n.shadow)(this,"linearization",e)}get startXRef(){const e=this.stream;let t=0;if(this.linearization){e.reset();find(e,O)&&(t=e.pos+6-e.start)}else{const a=1024,r=F.length;let n=!1,s=e.end;for(;!n&&s>0;){s-=a-r;s<0&&(s=0);e.pos=s;n=find(e,F,a,!0)}if(n){e.skip(9);let a;do{a=e.getByte()}while((0,i.isWhiteSpace)(a));let r="";for(;a>=32&&a<=57;){r+=String.fromCharCode(a);a=e.getByte()}t=parseInt(r,10);isNaN(t)&&(t=0)}}return(0,n.shadow)(this,"startXRef",t)}checkHeader(){const e=this.stream;e.reset();if(!find(e,v))return;e.moveStart();e.skip(v.length);let t,a="";for(;(t=e.getByte())>32&&a.length<7;)a+=String.fromCharCode(t);i.PDF_VERSION_REGEXP.test(a)?this._version=a:(0,n.warn)(`Invalid PDF header version: ${a}`)}parseStartXRef(){this.xref.setStartXRef(this.startXRef)}get numPages(){let e=0;e=this.catalog.hasActualNumPages?this.catalog.numPages:this.xfaFactory?this.xfaFactory.getNumPages():this.linearization?this.linearization.numPages:this.catalog.numPages;return(0,n.shadow)(this,"numPages",e)}_hasOnlyDocumentSignatures(e,t=0){return!!Array.isArray(e)&&e.every((e=>{if(!((e=this.xref.fetchIfRef(e))instanceof s.Dict))return!1;if(e.has("Kids")){if(++t>10){(0,n.warn)("_hasOnlyDocumentSignatures: maximum recursion depth reached");return!1}return this._hasOnlyDocumentSignatures(e.get("Kids"),t)}const a=(0,s.isName)(e.get("FT"),"Sig"),r=e.get("Rect"),i=Array.isArray(r)&&r.every((e=>0===e));return a&&i}))}get _xfaStreams(){const e=this.catalog.acroForm;if(!e)return null;const t=e.get("XFA"),a={"xdp:xdp":"",template:"",datasets:"",config:"",connectionSet:"",localeSet:"",stylesheet:"","/xdp:xdp":""};if(t instanceof c.BaseStream&&!t.isEmpty){a["xdp:xdp"]=t;return a}if(!Array.isArray(t)||0===t.length)return null;for(let e=0,r=t.length;e<r;e+=2){let n;n=0===e?"xdp:xdp":e===r-2?"/xdp:xdp":t[e];if(!a.hasOwnProperty(n))continue;const i=this.xref.fetchIfRef(t[e+1]);i instanceof c.BaseStream&&!i.isEmpty&&(a[n]=i)}return a}get xfaDatasets(){const e=this._xfaStreams;if(!e)return(0,n.shadow)(this,"xfaDatasets",null);for(const t of["datasets","xdp:xdp"]){const a=e[t];if(a)try{const e={[t]:(0,n.stringToUTF8String)(a.getString())};return(0,n.shadow)(this,"xfaDatasets",new d.DatasetReader(e))}catch(e){(0,n.warn)("XFA - Invalid utf-8 string.");break}}return(0,n.shadow)(this,"xfaDatasets",null)}get xfaData(){const e=this._xfaStreams;if(!e)return null;const t=Object.create(null);for(const[a,r]of Object.entries(e))if(r)try{t[a]=(0,n.stringToUTF8String)(r.getString())}catch(e){(0,n.warn)("XFA - Invalid utf-8 string.");return null}return t}get xfaFactory(){let e;this.pdfManager.enableXfa&&this.catalog.needsRendering&&this.formInfo.hasXfa&&!this.formInfo.hasAcroForm&&(e=this.xfaData);return(0,n.shadow)(this,"xfaFactory",e?new x.XFAFactory(e):null)}get isPureXfa(){return!!this.xfaFactory&&this.xfaFactory.isValid()}get htmlForXfa(){return this.xfaFactory?this.xfaFactory.getPages():null}async loadXfaImages(){const e=await this.pdfManager.ensureCatalog("xfaImages");if(!e)return;const t=e.getKeys(),a=new p.ObjectLoader(e,t,this.xref);await a.load();const r=new Map;for(const a of t){const t=e.get(a);t instanceof c.BaseStream&&r.set(a,t.getBytes())}this.xfaFactory.setImages(r)}async loadXfaFonts(e,t){const a=await this.pdfManager.ensureCatalog("acroForm");if(!a)return;const r=await a.getAsync("DR");if(!(r instanceof s.Dict))return;const c=new p.ObjectLoader(r,["Font"],this.xref);await c.load();const l=r.get("Font");if(!(l instanceof s.Dict))return;const h=Object.assign(Object.create(null),this.pdfManager.evaluatorOptions);h.useSystemFonts=!1;const u=new b.PartialEvaluator({xref:this.xref,handler:e,pageIndex:-1,idFactory:this._globalIdFactory,fontCache:this.catalog.fontCache,builtInCMapCache:this.catalog.builtInCMapCache,standardFontDataCache:this.catalog.standardFontDataCache,options:h}),d=new m.OperatorList,f=[],g={get font(){return f.at(-1)},set font(e){f.push(e)},clone(){return this}},y=new Map;l.forEach(((e,t)=>{y.set(e,t)}));const w=[];for(const[e,a]of y){const o=a.get("FontDescriptor");if(!(o instanceof s.Dict))continue;let c=o.get("FontFamily");c=c.replace(/[ ]+(\d)/g,"$1");const l={fontFamily:c,fontWeight:o.get("FontWeight"),italicAngle:-o.get("ItalicAngle")};(0,i.validateCSSFont)(l)&&w.push(u.handleSetFont(r,[s.Name.get(e),1],null,d,t,g,null,l).catch((function(e){(0,n.warn)(`loadXfaFonts: "${e}".`);return null})))}await Promise.all(w);const S=this.xfaFactory.setFonts(f);if(!S)return;h.ignoreErrors=!0;w.length=0;f.length=0;const x=new Set;for(const e of S)(0,o.getXfaFontName)(`${e}-Regular`)||x.add(e);x.size&&S.push("PdfJS-Fallback");for(const e of S)if(!x.has(e))for(const a of[{name:"Regular",fontWeight:400,italicAngle:0},{name:"Bold",fontWeight:700,italicAngle:0},{name:"Italic",fontWeight:400,italicAngle:12},{name:"BoldItalic",fontWeight:700,italicAngle:12}]){const i=`${e}-${a.name}`,c=(0,o.getXfaFontDict)(i);w.push(u.handleSetFont(r,[s.Name.get(i),1],null,d,t,g,c,{fontFamily:e,fontWeight:a.fontWeight,italicAngle:a.italicAngle}).catch((function(e){(0,n.warn)(`loadXfaFonts: "${e}".`);return null})))}await Promise.all(w);this.xfaFactory.appendFonts(f,x)}async serializeXfaData(e){return this.xfaFactory?this.xfaFactory.serializeData(e):null}get version(){return this.catalog.version||this._version}get formInfo(){const e={hasFields:!1,hasAcroForm:!1,hasXfa:!1,hasSignatures:!1},t=this.catalog.acroForm;if(!t)return(0,n.shadow)(this,"formInfo",e);try{const a=t.get("Fields"),r=Array.isArray(a)&&a.length>0;e.hasFields=r;const n=t.get("XFA");e.hasXfa=Array.isArray(n)&&n.length>0||n instanceof c.BaseStream&&!n.isEmpty;const i=!!(1&t.get("SigFlags")),s=i&&this._hasOnlyDocumentSignatures(a);e.hasAcroForm=r&&!s;e.hasSignatures=i}catch(e){if(e instanceof i.MissingDataException)throw e;(0,n.warn)(`Cannot fetch form information: "${e}".`)}return(0,n.shadow)(this,"formInfo",e)}get documentInfo(){const e={PDFFormatVersion:this.version,Language:this.catalog.lang,EncryptFilterName:this.xref.encrypt?this.xref.encrypt.filterName:null,IsLinearized:!!this.linearization,IsAcroFormPresent:this.formInfo.hasAcroForm,IsXFAPresent:this.formInfo.hasXfa,IsCollectionPresent:!!this.catalog.collection,IsSignaturesPresent:this.formInfo.hasSignatures};let t;try{t=this.xref.trailer.get("Info")}catch(e){if(e instanceof i.MissingDataException)throw e;(0,n.info)("The document information dictionary is invalid.")}if(!(t instanceof s.Dict))return(0,n.shadow)(this,"documentInfo",e);for(const a of t.getKeys()){const r=t.get(a);switch(a){case"Title":case"Author":case"Subject":case"Keywords":case"Creator":case"Producer":case"CreationDate":case"ModDate":if("string"==typeof r){e[a]=(0,n.stringToPDFString)(r);continue}break;case"Trapped":if(r instanceof s.Name){e[a]=r;continue}break;default:let t;switch(typeof r){case"string":t=(0,n.stringToPDFString)(r);break;case"number":case"boolean":t=r;break;default:r instanceof s.Name&&(t=r)}if(void 0===t){(0,n.warn)(`Bad value, for custom key "${a}", in Info: ${r}.`);continue}e.Custom||(e.Custom=Object.create(null));e.Custom[a]=t;continue}(0,n.warn)(`Bad value, for key "${a}", in Info: ${r}.`)}return(0,n.shadow)(this,"documentInfo",e)}get fingerprints(){function validate(e){return"string"==typeof e&&e.length>0&&e!==T}function hexString(e){const t=[];for(const a of e){const e=a.toString(16);t.push(e.padStart(2,"0"))}return t.join("")}const e=this.xref.trailer.get("ID");let t,a;if(Array.isArray(e)&&validate(e[0])){t=(0,n.stringToBytes)(e[0]);e[1]!==e[0]&&validate(e[1])&&(a=(0,n.stringToBytes)(e[1]))}else t=(0,l.calculateMD5)(this.stream.getByteRange(0,1024),0,1024);return(0,n.shadow)(this,"fingerprints",[hexString(t),a?hexString(a):null])}async _getLinearizationPage(e){const{catalog:t,linearization:a,xref:r}=this,i=s.Ref.get(a.objectNumberFirst,0);try{const e=await r.fetchAsync(i);if(e instanceof s.Dict){let a=e.getRaw("Type");a instanceof s.Ref&&(a=await r.fetchAsync(a));if((0,s.isName)(a,"Page")||!e.has("Type")&&!e.has("Kids")){t.pageKidsCountCache.has(i)||t.pageKidsCountCache.put(i,1);t.pageIndexCache.has(i)||t.pageIndexCache.put(i,0);return[e,i]}}throw new n.FormatError("The Linearization dictionary doesn't point to a valid Page dictionary.")}catch(a){(0,n.warn)(`_getLinearizationPage: "${a.message}".`);return t.getPageDict(e)}}getPage(e){const t=this._pagePromises.get(e);if(t)return t;const{catalog:a,linearization:r,xfaFactory:n}=this;let i;i=n?Promise.resolve([s.Dict.empty,null]):r&&r.pageFirst===e?this._getLinearizationPage(e):a.getPageDict(e);i=i.then((([t,r])=>new Page({pdfManager:this.pdfManager,xref:this.xref,pageIndex:e,pageDict:t,ref:r,globalIdFactory:this._globalIdFactory,fontCache:a.fontCache,builtInCMapCache:a.builtInCMapCache,standardFontDataCache:a.standardFontDataCache,globalImageCache:a.globalImageCache,nonBlendModesSet:a.nonBlendModesSet,xfaFactory:n})));this._pagePromises.set(e,i);return i}async checkFirstPage(e=!1){if(!e)try{await this.getPage(0)}catch(e){if(e instanceof i.XRefEntryException){this._pagePromises.delete(0);await this.cleanup();throw new i.XRefParseException}}}async checkLastPage(e=!1){const{catalog:t,pdfManager:a}=this;t.setActualNumPages();let r;try{await Promise.all([a.ensureDoc("xfaFactory"),a.ensureDoc("linearization"),a.ensureCatalog("numPages")]);if(this.xfaFactory)return;r=this.linearization?this.linearization.numPages:t.numPages;if(!Number.isInteger(r))throw new n.FormatError("Page count is not an integer.");if(r<=1)return;await this.getPage(r-1)}catch(s){this._pagePromises.delete(r-1);await this.cleanup();if(s instanceof i.XRefEntryException&&!e)throw new i.XRefParseException;(0,n.warn)(`checkLastPage - invalid /Pages tree /Count: ${r}.`);let o;try{o=await t.getAllPageDicts(e)}catch(a){if(a instanceof i.XRefEntryException&&!e)throw new i.XRefParseException;t.setActualNumPages(1);return}for(const[e,[r,n]]of o){let i;if(r instanceof Error){i=Promise.reject(r);i.catch((()=>{}))}else i=Promise.resolve(new Page({pdfManager:a,xref:this.xref,pageIndex:e,pageDict:r,ref:n,globalIdFactory:this._globalIdFactory,fontCache:t.fontCache,builtInCMapCache:t.builtInCMapCache,standardFontDataCache:t.standardFontDataCache,globalImageCache:t.globalImageCache,nonBlendModesSet:t.nonBlendModesSet,xfaFactory:null}));this._pagePromises.set(e,i)}t.setActualNumPages(o.size)}}fontFallback(e,t){return this.catalog.fontFallback(e,t)}async cleanup(e=!1){return this.catalog?this.catalog.cleanup(e):(0,u.clearGlobalCaches)()}_collectFieldObjects(e,t,a){const i=this.xref.fetchIfRef(t);if(i.has("T")){const t=(0,n.stringToPDFString)(i.get("T"));e=""===e?t:`${e}.${t}`}a.has(e)||a.set(e,[]);a.get(e).push(r.AnnotationFactory.create(this.xref,t,this.pdfManager,this._localIdFactory,!0).then((e=>e&&e.getFieldObject())).catch((function(e){(0,n.warn)(`_collectFieldObjects: "${e}".`);return null})));if(i.has("Kids")){const t=i.get("Kids");for(const r of t)this._collectFieldObjects(e,r,a)}}get fieldObjects(){if(!this.formInfo.hasFields)return(0,n.shadow)(this,"fieldObjects",Promise.resolve(null));const e=Object.create(null),t=new Map;for(const e of this.catalog.acroForm.get("Fields"))this._collectFieldObjects("",e,t);const a=[];for(const[r,n]of t)a.push(Promise.all(n).then((t=>{(t=t.filter((e=>!!e))).length>0&&(e[r]=t)})));return(0,n.shadow)(this,"fieldObjects",Promise.all(a).then((()=>e)))}get hasJSActions(){const e=this.pdfManager.ensureDoc("_parseHasJSActions");return(0,n.shadow)(this,"hasJSActions",e)}async _parseHasJSActions(){const[e,t]=await Promise.all([this.pdfManager.ensureCatalog("jsActions"),this.pdfManager.ensureDoc("fieldObjects")]);return!!e||!!t&&Object.values(t).some((e=>e.some((e=>null!==e.actions))))}get calculationOrderIds(){const e=this.catalog.acroForm;if(!e||!e.has("CO"))return(0,n.shadow)(this,"calculationOrderIds",null);const t=e.get("CO");if(!Array.isArray(t)||0===t.length)return(0,n.shadow)(this,"calculationOrderIds",null);const a=[];for(const e of t)e instanceof s.Ref&&a.push(e.toString());return 0===a.length?(0,n.shadow)(this,"calculationOrderIds",null):(0,n.shadow)(this,"calculationOrderIds",a)}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.PopupAnnotation=t.MarkupAnnotation=t.AnnotationFactory=t.AnnotationBorderStyle=t.Annotation=void 0;t.getQuadPoints=getQuadPoints;var r=a(2),n=a(3),i=a(11),s=a(4),o=a(63),c=a(5),l=a(58),h=a(67),u=a(12),d=a(70),f=a(73),g=a(60),p=a(8),m=a(74);t.AnnotationFactory=class AnnotationFactory{static create(e,t,a,r,n){return Promise.all([a.ensureCatalog("acroForm"),a.ensureCatalog("baseUrl"),a.ensureCatalog("attachments"),a.ensureDoc("xfaDatasets"),n?this._getPageIndex(e,t,a):-1]).then((([i,s,o,c,l])=>a.ensure(this,"_create",[e,t,a,r,i,o,c,n,l])))}static _create(e,t,a,i,o,c=null,l,h,u=-1){const d=e.fetchIfRef(t);if(!(d instanceof s.Dict))return;const f=t instanceof s.Ref?t.toString():`annot_${i.createObjId()}`;let g=d.get("Subtype");g=g instanceof s.Name?g.name:null;const p=o instanceof s.Dict?o:s.Dict.empty,m={xref:e,ref:t,dict:d,subtype:g,id:f,pdfManager:a,acroForm:p,attachments:c,xfaDatasets:l,collectFields:h,needAppearances:!h&&!0===p.get("NeedAppearances"),pageIndex:u,isOffscreenCanvasSupported:r.FeatureTest.isOffscreenCanvasSupported&&a.evaluatorOptions.isOffscreenCanvasSupported};switch(g){case"Link":return new LinkAnnotation(m);case"Text":return new TextAnnotation(m);case"Widget":let e=(0,n.getInheritableProperty)({dict:d,key:"FT"});e=e instanceof s.Name?e.name:null;switch(e){case"Tx":return new TextWidgetAnnotation(m);case"Btn":return new ButtonWidgetAnnotation(m);case"Ch":return new ChoiceWidgetAnnotation(m);case"Sig":return new SignatureWidgetAnnotation(m)}(0,r.warn)(`Unimplemented widget field type "${e}", falling back to base field type.`);return new WidgetAnnotation(m);case"Popup":return new PopupAnnotation(m);case"FreeText":return new FreeTextAnnotation(m);case"Line":return new LineAnnotation(m);case"Square":return new SquareAnnotation(m);case"Circle":return new CircleAnnotation(m);case"PolyLine":return new PolylineAnnotation(m);case"Polygon":return new PolygonAnnotation(m);case"Caret":return new CaretAnnotation(m);case"Ink":return new InkAnnotation(m);case"Highlight":return new HighlightAnnotation(m);case"Underline":return new UnderlineAnnotation(m);case"Squiggly":return new SquigglyAnnotation(m);case"StrikeOut":return new StrikeOutAnnotation(m);case"Stamp":return new StampAnnotation(m);case"FileAttachment":return new FileAttachmentAnnotation(m);default:h||(g?(0,r.warn)(`Unimplemented annotation type "${g}", falling back to base annotation.`):(0,r.warn)("Annotation is missing the required /Subtype."));return new Annotation(m)}}static async _getPageIndex(e,t,a){try{const r=await e.fetchIfRefAsync(t);if(!(r instanceof s.Dict))return-1;const n=r.getRaw("P");if(!(n instanceof s.Ref))return-1;return await a.ensureCatalog("getPageIndex",[n])}catch(e){(0,r.warn)(`_getPageIndex: "${e}".`);return-1}}static async saveNewAnnotations(e,t,a){const n=e.xref;let i;const c=[],l=[];for(const h of a)switch(h.annotationType){case r.AnnotationEditorType.FREETEXT:if(!i){const e=new s.Dict(n);e.set("BaseFont",s.Name.get("Helvetica"));e.set("Type",s.Name.get("Font"));e.set("Subtype",s.Name.get("Type1"));e.set("Encoding",s.Name.get("WinAnsiEncoding"));const t=[];i=n.getNewTemporaryRef();(0,o.writeObject)(i,e,t,null);c.push({ref:i,data:t.join("")})}l.push(FreeTextAnnotation.createNewAnnotation(n,h,c,{evaluator:e,task:t,baseFontRef:i}));break;case r.AnnotationEditorType.INK:l.push(InkAnnotation.createNewAnnotation(n,h,c))}return{annotations:await Promise.all(l),dependencies:c}}static async printNewAnnotations(e,t,a){if(!a)return null;const n=e.xref,i=[],s=r.FeatureTest.isOffscreenCanvasSupported&&e.options.isOffscreenCanvasSupported;for(const o of a)switch(o.annotationType){case r.AnnotationEditorType.FREETEXT:i.push(FreeTextAnnotation.createNewPrintAnnotation(n,o,{evaluator:e,task:t,isOffscreenCanvasSupported:s}));break;case r.AnnotationEditorType.INK:i.push(InkAnnotation.createNewPrintAnnotation(n,o,{isOffscreenCanvasSupported:s}))}return Promise.all(i)}};function getRgbColor(e,t=new Uint8ClampedArray(3)){if(!Array.isArray(e))return t;const a=t||new Uint8ClampedArray(3);switch(e.length){case 0:return null;case 1:u.ColorSpace.singletons.gray.getRgbItem(e,0,a,0);return a;case 3:u.ColorSpace.singletons.rgb.getRgbItem(e,0,a,0);return a;case 4:u.ColorSpace.singletons.cmyk.getRgbItem(e,0,a,0);return a;default:return t}}function getPdfColorArray(e){return Array.from(e,(e=>e/255))}function getQuadPoints(e,t){const a=e.getArray("QuadPoints");if(!Array.isArray(a)||0===a.length||a.length%8>0)return null;const r=[];for(let e=0,n=a.length/8;e<n;e++){let n=1/0,i=-1/0,s=1/0,o=-1/0;for(let t=8*e,r=8*e+8;t<r;t+=2){const e=a[t],r=a[t+1];n=Math.min(e,n);i=Math.max(e,i);s=Math.min(r,s);o=Math.max(r,o)}if(null!==t&&(n<t[0]||i>t[2]||s<t[1]||o>t[3]))return null;r.push([{x:n,y:o},{x:i,y:o},{x:n,y:s},{x:i,y:s}])}return r}function getTransformMatrix(e,t,a){const[n,i,s,o]=r.Util.getAxialAlignedBoundingBox(t,a);if(n===s||i===o)return[1,0,0,1,e[0],e[1]];const c=(e[2]-e[0])/(s-n),l=(e[3]-e[1])/(o-i);return[c,0,0,l,e[0]-n*c,e[1]-i*l]}class Annotation{constructor(e){const{dict:t,xref:a}=e;this.setTitle(t.get("T"));this.setContents(t.get("Contents"));this.setModificationDate(t.get("M"));this.setFlags(t.get("F"));this.setRectangle(t.getArray("Rect"));this.setColor(t.getArray("C"));this.setBorderStyle(t);this.setAppearance(t);this.setOptionalContent(t);const i=t.get("MK");this.setBorderAndBackgroundColors(i);this.setRotation(i);this._streams=[];this.appearance&&this._streams.push(this.appearance);this.data={annotationFlags:this.flags,borderStyle:this.borderStyle,color:this.color,backgroundColor:this.backgroundColor,borderColor:this.borderColor,rotation:this.rotation,contentsObj:this._contents,hasAppearance:!!this.appearance,id:e.id,modificationDate:this.modificationDate,rect:this.rectangle,subtype:e.subtype,hasOwnCanvas:!1};if(e.collectFields){const i=t.get("Kids");if(Array.isArray(i)){const e=[];for(const t of i)t instanceof s.Ref&&e.push(t.toString());0!==e.length&&(this.data.kidIds=e)}this.data.actions=(0,n.collectActions)(a,t,r.AnnotationActionEventType);this.data.fieldName=this._constructFieldName(t);this.data.pageIndex=e.pageIndex}this._isOffscreenCanvasSupported=e.isOffscreenCanvasSupported;this._fallbackFontDict=null;this._needAppearances=!1}_hasFlag(e,t){return!!(e&t)}_isViewable(e){return!this._hasFlag(e,r.AnnotationFlag.INVISIBLE)&&!this._hasFlag(e,r.AnnotationFlag.NOVIEW)}_isPrintable(e){return this._hasFlag(e,r.AnnotationFlag.PRINT)&&!this._hasFlag(e,r.AnnotationFlag.INVISIBLE)}mustBeViewed(e){const t=e&&e.get(this.data.id);return t&&void 0!==t.hidden?!t.hidden:this.viewable&&!this._hasFlag(this.flags,r.AnnotationFlag.HIDDEN)}mustBePrinted(e){const t=e&&e.get(this.data.id);return t&&void 0!==t.print?t.print:this.printable}get viewable(){return null!==this.data.quadPoints&&(0===this.flags||this._isViewable(this.flags))}get printable(){return null!==this.data.quadPoints&&(0!==this.flags&&this._isPrintable(this.flags))}_parseStringHelper(e){const t="string"==typeof e?(0,r.stringToPDFString)(e):"";return{str:t,dir:t&&"rtl"===(0,l.bidi)(t).dir?"rtl":"ltr"}}setDefaultAppearance(e){const t=(0,n.getInheritableProperty)({dict:e.dict,key:"DA"})||e.acroForm.get("DA");this._defaultAppearance="string"==typeof t?t:"";this.data.defaultAppearanceData=(0,i.parseDefaultAppearance)(this._defaultAppearance)}setTitle(e){this._title=this._parseStringHelper(e)}setContents(e){this._contents=this._parseStringHelper(e)}setModificationDate(e){this.modificationDate="string"==typeof e?e:null}setFlags(e){this.flags=Number.isInteger(e)&&e>0?e:0}hasFlag(e){return this._hasFlag(this.flags,e)}setRectangle(e){Array.isArray(e)&&4===e.length?this.rectangle=r.Util.normalizeRect(e):this.rectangle=[0,0,0,0]}setColor(e){this.color=getRgbColor(e)}setLineEndings(e){this.lineEndings=["None","None"];if(Array.isArray(e)&&2===e.length)for(let t=0;t<2;t++){const a=e[t];if(a instanceof s.Name)switch(a.name){case"None":continue;case"Square":case"Circle":case"Diamond":case"OpenArrow":case"ClosedArrow":case"Butt":case"ROpenArrow":case"RClosedArrow":case"Slash":this.lineEndings[t]=a.name;continue}(0,r.warn)(`Ignoring invalid lineEnding: ${a}`)}}setRotation(e){this.rotation=0;if(e instanceof s.Dict){let t=e.get("R")||0;if(Number.isInteger(t)&&0!==t){t%=360;t<0&&(t+=360);t%90==0&&(this.rotation=t)}}}setBorderAndBackgroundColors(e){if(e instanceof s.Dict){this.borderColor=getRgbColor(e.getArray("BC"),null);this.backgroundColor=getRgbColor(e.getArray("BG"),null)}else this.borderColor=this.backgroundColor=null}setBorderStyle(e){this.borderStyle=new AnnotationBorderStyle;if(e instanceof s.Dict)if(e.has("BS")){const t=e.get("BS"),a=t.get("Type");if(!a||(0,s.isName)(a,"Border")){this.borderStyle.setWidth(t.get("W"),this.rectangle);this.borderStyle.setStyle(t.get("S"));this.borderStyle.setDashArray(t.getArray("D"))}}else if(e.has("Border")){const t=e.getArray("Border");if(Array.isArray(t)&&t.length>=3){this.borderStyle.setHorizontalCornerRadius(t[0]);this.borderStyle.setVerticalCornerRadius(t[1]);this.borderStyle.setWidth(t[2],this.rectangle);4===t.length&&this.borderStyle.setDashArray(t[3],!0)}}else this.borderStyle.setWidth(0)}setAppearance(e){this.appearance=null;const t=e.get("AP");if(!(t instanceof s.Dict))return;const a=t.get("N");if(a instanceof c.BaseStream){this.appearance=a;return}if(!(a instanceof s.Dict))return;const r=e.get("AS");if(!(r instanceof s.Name&&a.has(r.name)))return;const n=a.get(r.name);n instanceof c.BaseStream&&(this.appearance=n)}setOptionalContent(e){this.oc=null;const t=e.get("OC");t instanceof s.Name?(0,r.warn)("setOptionalContent: Support for /Name-entry is not implemented."):t instanceof s.Dict&&(this.oc=t)}loadResources(e,t){return t.dict.getAsync("Resources").then((t=>{if(!t)return;return new f.ObjectLoader(t,e,t.xref).load().then((function(){return t}))}))}async getOperatorList(e,t,a,n,i){const o=this.data;let c=this.appearance;const l=!!(this.data.hasOwnCanvas&&a&r.RenderingIntentFlag.DISPLAY);if(!c){if(!l)return{opList:new g.OperatorList,separateForm:!1,separateCanvas:!1};c=new p.StringStream("");c.dict=new s.Dict}const h=c.dict,u=await this.loadResources(["ExtGState","ColorSpace","Pattern","Shading","XObject","Font"],c),d=h.getArray("BBox")||[0,0,1,1],f=h.getArray("Matrix")||[1,0,0,1,0,0],m=getTransformMatrix(o.rect,d,f),b=new g.OperatorList;let y;this.oc&&(y=await e.parseMarkedContentProps(this.oc,null));void 0!==y&&b.addOp(r.OPS.beginMarkedContentProps,["OC",y]);b.addOp(r.OPS.beginAnnotation,[o.id,o.rect,m,f,l]);await e.getOperatorList({stream:c,task:t,resources:u,operatorList:b,fallbackFontDict:this._fallbackFontDict});b.addOp(r.OPS.endAnnotation,[]);void 0!==y&&b.addOp(r.OPS.endMarkedContent,[]);this.reset();return{opList:b,separateForm:!1,separateCanvas:l}}async save(e,t,a){return null}get hasTextContent(){return!1}async extractTextContent(e,t,a){if(!this.appearance)return;const r=await this.loadResources(["ExtGState","Font","Properties","XObject"],this.appearance),n=[],i=[],s={desiredSize:Math.Infinity,ready:!0,enqueue(e,t){for(const t of e.items){i.push(t.str);if(t.hasEOL){n.push(i.join(""));i.length=0}}}};await e.getTextContent({stream:this.appearance,task:t,resources:r,includeMarkedContent:!0,combineTextItems:!0,sink:s,viewBox:a});this.reset();i.length&&n.push(i.join(""));n.length>0&&(this.data.textContent=n)}getFieldObject(){return this.data.kidIds?{id:this.data.id,actions:this.data.actions,name:this.data.fieldName,strokeColor:this.data.borderColor,fillColor:this.data.backgroundColor,type:"",kidIds:this.data.kidIds,page:this.data.pageIndex,rotation:this.rotation}:null}reset(){for(const e of this._streams)e.reset()}_constructFieldName(e){if(!e.has("T")&&!e.has("Parent")){(0,r.warn)("Unknown field name, falling back to empty field name.");return""}if(!e.has("Parent"))return(0,r.stringToPDFString)(e.get("T"));const t=[];e.has("T")&&t.unshift((0,r.stringToPDFString)(e.get("T")));let a=e;const n=new s.RefSet;e.objId&&n.put(e.objId);for(;a.has("Parent");){a=a.get("Parent");if(!(a instanceof s.Dict)||a.objId&&n.has(a.objId))break;a.objId&&n.put(a.objId);if(a.has("T")){const e=(0,r.stringToPDFString)(a.get("T"));e.startsWith("#")||t.unshift(e)}}return t.join(".")}}t.Annotation=Annotation;class AnnotationBorderStyle{constructor(){this.width=1;this.style=r.AnnotationBorderStyleType.SOLID;this.dashArray=[3];this.horizontalCornerRadius=0;this.verticalCornerRadius=0}setWidth(e,t=[0,0,0,0]){if(e instanceof s.Name)this.width=0;else if("number"==typeof e){if(e>0){const a=(t[2]-t[0])/2,n=(t[3]-t[1])/2;if(a>0&&n>0&&(e>a||e>n)){(0,r.warn)(`AnnotationBorderStyle.setWidth - ignoring width: ${e}`);e=1}}this.width=e}}setStyle(e){if(e instanceof s.Name)switch(e.name){case"S":this.style=r.AnnotationBorderStyleType.SOLID;break;case"D":this.style=r.AnnotationBorderStyleType.DASHED;break;case"B":this.style=r.AnnotationBorderStyleType.BEVELED;break;case"I":this.style=r.AnnotationBorderStyleType.INSET;break;case"U":this.style=r.AnnotationBorderStyleType.UNDERLINE}}setDashArray(e,t=!1){if(Array.isArray(e)&&e.length>0){let a=!0,r=!0;for(const t of e){if(!(+t>=0)){a=!1;break}t>0&&(r=!1)}if(a&&!r){this.dashArray=e;t&&this.setStyle(s.Name.get("D"))}else this.width=0}else e&&(this.width=0)}setHorizontalCornerRadius(e){Number.isInteger(e)&&(this.horizontalCornerRadius=e)}setVerticalCornerRadius(e){Number.isInteger(e)&&(this.verticalCornerRadius=e)}}t.AnnotationBorderStyle=AnnotationBorderStyle;class MarkupAnnotation extends Annotation{constructor(e){super(e);const{dict:t}=e;if(t.has("IRT")){const e=t.getRaw("IRT");this.data.inReplyTo=e instanceof s.Ref?e.toString():null;const a=t.get("RT");this.data.replyType=a instanceof s.Name?a.name:r.AnnotationReplyType.REPLY}if(this.data.replyType===r.AnnotationReplyType.GROUP){const e=t.get("IRT");this.setTitle(e.get("T"));this.data.titleObj=this._title;this.setContents(e.get("Contents"));this.data.contentsObj=this._contents;if(e.has("CreationDate")){this.setCreationDate(e.get("CreationDate"));this.data.creationDate=this.creationDate}else this.data.creationDate=null;if(e.has("M")){this.setModificationDate(e.get("M"));this.data.modificationDate=this.modificationDate}else this.data.modificationDate=null;this.data.hasPopup=e.has("Popup");if(e.has("C")){this.setColor(e.getArray("C"));this.data.color=this.color}else this.data.color=null}else{this.data.titleObj=this._title;this.setCreationDate(t.get("CreationDate"));this.data.creationDate=this.creationDate;this.data.hasPopup=t.has("Popup");t.has("C")||(this.data.color=null)}t.has("RC")&&(this.data.richText=m.XFAFactory.getRichTextAsHtml(t.get("RC")))}setCreationDate(e){this.creationDate="string"==typeof e?e:null}_setDefaultAppearance({xref:e,extra:t,strokeColor:a,fillColor:r,blendMode:n,strokeAlpha:i,fillAlpha:o,pointsCallback:c}){let l=Number.MAX_VALUE,h=Number.MAX_VALUE,u=Number.MIN_VALUE,d=Number.MIN_VALUE;const f=["q"];t&&f.push(t);a&&f.push(`${a[0]} ${a[1]} ${a[2]} RG`);r&&f.push(`${r[0]} ${r[1]} ${r[2]} rg`);let g=this.data.quadPoints;g||(g=[[{x:this.rectangle[0],y:this.rectangle[3]},{x:this.rectangle[2],y:this.rectangle[3]},{x:this.rectangle[0],y:this.rectangle[1]},{x:this.rectangle[2],y:this.rectangle[1]}]]);for(const e of g){const[t,a,r,n]=c(f,e);l=Math.min(l,t);u=Math.max(u,a);h=Math.min(h,r);d=Math.max(d,n)}f.push("Q");const m=new s.Dict(e),b=new s.Dict(e);b.set("Subtype",s.Name.get("Form"));const y=new p.StringStream(f.join(" "));y.dict=b;m.set("Fm0",y);const w=new s.Dict(e);n&&w.set("BM",s.Name.get(n));"number"==typeof i&&w.set("CA",i);"number"==typeof o&&w.set("ca",o);const S=new s.Dict(e);S.set("GS0",w);const x=new s.Dict(e);x.set("ExtGState",S);x.set("XObject",m);const C=new s.Dict(e);C.set("Resources",x);const k=this.data.rect=[l,h,u,d];C.set("BBox",k);this.appearance=new p.StringStream("/GS0 gs /Fm0 Do");this.appearance.dict=C;this._streams.push(this.appearance,y)}static async createNewAnnotation(e,t,a,r){const n=e.getNewTemporaryRef(),i=await this.createNewAppearanceStream(t,e,r),s=[];let c;if(i){const r=e.getNewTemporaryRef();c=this.createNewDict(t,e,{apRef:r});const n=e.encrypt?e.encrypt.createCipherTransform(r.num,r.gen):null;(0,o.writeObject)(r,i,s,n);a.push({ref:r,data:s.join("")})}else c=this.createNewDict(t,e,{});s.length=0;const l=e.encrypt?e.encrypt.createCipherTransform(n.num,n.gen):null;(0,o.writeObject)(n,c,s,l);return{ref:n,data:s.join("")}}static async createNewPrintAnnotation(e,t,a){const r=await this.createNewAppearanceStream(t,e,a),n=this.createNewDict(t,e,{ap:r});return new this.prototype.constructor({dict:n,xref:e,isOffscreenCanvasSupported:a.isOffscreenCanvasSupported})}}t.MarkupAnnotation=MarkupAnnotation;class WidgetAnnotation extends Annotation{constructor(e){super(e);const{dict:t,xref:a}=e,i=this.data;this.ref=e.ref;this._needAppearances=e.needAppearances;i.annotationType=r.AnnotationType.WIDGET;void 0===i.fieldName&&(i.fieldName=this._constructFieldName(t));void 0===i.actions&&(i.actions=(0,n.collectActions)(a,t,r.AnnotationActionEventType));let o=(0,n.getInheritableProperty)({dict:t,key:"V",getArray:!0});i.fieldValue=this._decodeFormValue(o);const c=(0,n.getInheritableProperty)({dict:t,key:"DV",getArray:!0});i.defaultFieldValue=this._decodeFormValue(c);if(void 0===o&&e.xfaDatasets){const t=this._title.str;if(t){this._hasValueFromXFA=!0;i.fieldValue=o=e.xfaDatasets.getValue(t)}}void 0===o&&null!==i.defaultFieldValue&&(i.fieldValue=i.defaultFieldValue);i.alternativeText=(0,r.stringToPDFString)(t.get("TU")||"");this.setDefaultAppearance(e);i.hasAppearance=this._needAppearances&&void 0!==i.fieldValue&&null!==i.fieldValue||i.hasAppearance;const l=(0,n.getInheritableProperty)({dict:t,key:"FT"});i.fieldType=l instanceof s.Name?l.name:null;const h=(0,n.getInheritableProperty)({dict:t,key:"DR"}),u=e.acroForm.get("DR"),d=this.appearance&&this.appearance.dict.get("Resources");this._fieldResources={localResources:h,acroFormResources:u,appearanceResources:d,mergedResources:s.Dict.merge({xref:a,dictArray:[h,d,u],mergeSubDicts:!0})};i.fieldFlags=(0,n.getInheritableProperty)({dict:t,key:"Ff"});(!Number.isInteger(i.fieldFlags)||i.fieldFlags<0)&&(i.fieldFlags=0);i.readOnly=this.hasFieldFlag(r.AnnotationFieldFlag.READONLY);i.required=this.hasFieldFlag(r.AnnotationFieldFlag.REQUIRED);i.hidden=this._hasFlag(i.annotationFlags,r.AnnotationFlag.HIDDEN)}_decodeFormValue(e){return Array.isArray(e)?e.filter((e=>"string"==typeof e)).map((e=>(0,r.stringToPDFString)(e))):e instanceof s.Name?(0,r.stringToPDFString)(e.name):"string"==typeof e?(0,r.stringToPDFString)(e):null}hasFieldFlag(e){return!!(this.data.fieldFlags&e)}getRotationMatrix(e){const t=e?e.get(this.data.id):void 0;let a=t&&t.rotation;void 0===a&&(a=this.rotation);if(0===a)return r.IDENTITY_MATRIX;const i=this.data.rect[2]-this.data.rect[0],s=this.data.rect[3]-this.data.rect[1];return(0,n.getRotationMatrix)(a,i,s)}getBorderAndBackgroundAppearances(e){const t=e?e.get(this.data.id):void 0;let a=t&&t.rotation;void 0===a&&(a=this.rotation);if(!this.backgroundColor&&!this.borderColor)return"";const r=this.data.rect[2]-this.data.rect[0],n=this.data.rect[3]-this.data.rect[1],s=0===a||180===a?`0 0 ${r} ${n} re`:`0 0 ${n} ${r} re`;let o="";this.backgroundColor&&(o=`${(0,i.getPdfColor)(this.backgroundColor,!0)} ${s} f `);if(this.borderColor){o+=`${this.borderStyle.width||1} w ${(0,i.getPdfColor)(this.borderColor,!1)} ${s} S `}return o}async getOperatorList(e,t,a,n,i){if(n&&!(this instanceof SignatureWidgetAnnotation))return{opList:new g.OperatorList,separateForm:!0,separateCanvas:!1};if(!this._hasText)return super.getOperatorList(e,t,a,n,i);const s=await this._getAppearance(e,t,a,i);if(this.appearance&&null===s)return super.getOperatorList(e,t,a,n,i);const o=new g.OperatorList;if(!this._defaultAppearance||null===s)return{opList:o,separateForm:!1,separateCanvas:!1};const c=[0,0,this.data.rect[2]-this.data.rect[0],this.data.rect[3]-this.data.rect[1]],l=getTransformMatrix(this.data.rect,c,[1,0,0,1,0,0]);let h;this.oc&&(h=await e.parseMarkedContentProps(this.oc,null));void 0!==h&&o.addOp(r.OPS.beginMarkedContentProps,["OC",h]);o.addOp(r.OPS.beginAnnotation,[this.data.id,this.data.rect,l,this.getRotationMatrix(i),!1]);const u=new p.StringStream(s);await e.getOperatorList({stream:u,task:t,resources:this._fieldResources.mergedResources,operatorList:o});o.addOp(r.OPS.endAnnotation,[]);void 0!==h&&o.addOp(r.OPS.endMarkedContent,[]);return{opList:o,separateForm:!1,separateCanvas:!1}}_getMKDict(e){const t=new s.Dict(null);e&&t.set("R",e);this.borderColor&&t.set("BC",getPdfColorArray(this.borderColor));this.backgroundColor&&t.set("BG",getPdfColorArray(this.backgroundColor));return t.size>0?t:null}amendSavedDict(e,t){}async save(e,t,a){const i=a?a.get(this.data.id):void 0;let c=i&&i.value,l=i&&i.rotation;if(c===this.data.fieldValue||void 0===c){if(!this._hasValueFromXFA&&void 0===l)return null;c=c||this.data.fieldValue}if(void 0===l&&!this._hasValueFromXFA&&Array.isArray(c)&&Array.isArray(this.data.fieldValue)&&c.length===this.data.fieldValue.length&&c.every(((e,t)=>e===this.data.fieldValue[t])))return null;void 0===l&&(l=this.rotation);let h=null;if(!this._needAppearances){h=await this._getAppearance(e,t,r.RenderingIntentFlag.SAVE,a);if(null===h)return null}let u=!1;if(h&&h.needAppearances){u=!0;h=null}const{xref:d}=e,f=d.fetchIfRef(this.ref);if(!(f instanceof s.Dict))return null;const g=new s.Dict(d);for(const e of f.getKeys())"AP"!==e&&g.set(e,f.getRaw(e));const m={path:this.data.fieldName,value:c},encoder=e=>(0,n.isAscii)(e)?e:(0,n.stringToUTF16String)(e,!0);g.set("V",Array.isArray(c)?c.map(encoder):encoder(c));this.amendSavedDict(a,g);const b=this._getMKDict(l);b&&g.set("MK",b);const y=d.encrypt,w=y?y.createCipherTransform(this.ref.num,this.ref.gen):null,S=[],x=[{ref:this.ref,data:"",xfa:m,needAppearances:u}];if(null!==h){const e=d.getNewTemporaryRef(),t=new s.Dict(d);g.set("AP",t);t.set("N",e);let n=null;y&&(n=y.createCipherTransform(e.num,e.gen));const i=this._getSaveFieldResources(d),c=new p.StringStream(h),l=c.dict=new s.Dict(d);l.set("Subtype",s.Name.get("Form"));l.set("Resources",i);l.set("BBox",[0,0,this.data.rect[2]-this.data.rect[0],this.data.rect[3]-this.data.rect[1]]);const u=this.getRotationMatrix(a);u!==r.IDENTITY_MATRIX&&l.set("Matrix",u);(0,o.writeObject)(e,c,S,n);x.push({ref:e,data:S.join(""),xfa:null,needAppearances:!1});S.length=0}g.set("M",`D:${(0,r.getModificationDate)()}`);(0,o.writeObject)(this.ref,g,S,w);x[0].data=S.join("");return x}async _getAppearance(e,t,a,s){if(this.hasFieldFlag(r.AnnotationFieldFlag.PASSWORD))return null;const o=s?s.get(this.data.id):void 0;let c,l;if(o){c=o.formattedValue||o.value;l=o.rotation}if(void 0===l&&void 0===c&&!this._needAppearances&&(!this._hasValueFromXFA||this.appearance))return null;const h=this.getBorderAndBackgroundAppearances(s);if(void 0===c){c=this.data.fieldValue;if(!c)return`/Tx BMC q ${h}Q EMC`}Array.isArray(c)&&1===c.length&&(c=c[0]);(0,r.assert)("string"==typeof c,"Expected `value` to be a string.");c=c.trim();if(this.data.combo){const e=this.data.options.find((({exportValue:e})=>c===e));c=e&&e.displayValue||c}if(""===c)return`/Tx BMC q ${h}Q EMC`;void 0===l&&(l=this.rotation);let u,d=-1;if(this.data.multiLine){u=c.split(/\r\n?|\n/).map((e=>e.normalize("NFC")));d=u.length}else u=[c.replace(/\r\n?|\n/,"").normalize("NFC")];let f=this.data.rect[3]-this.data.rect[1],g=this.data.rect[2]-this.data.rect[0];90!==l&&270!==l||([g,f]=[f,g]);this._defaultAppearance||(this.data.defaultAppearanceData=(0,i.parseDefaultAppearance)(this._defaultAppearance="/Helvetica 0 Tf 0 g"));let p,m,b,y=await WidgetAnnotation._getFontData(e,t,this.data.defaultAppearanceData,this._fieldResources.mergedResources);const w=[];let S=!1;for(const e of u){const t=y.encodeString(e);t.length>1&&(S=!0);w.push(t.join(""))}if(S&&a&r.RenderingIntentFlag.SAVE)return{needAppearances:!0};if(S&&this._isOffscreenCanvasSupported){const a=this.data.comb?"monospace":"sans-serif",r=new i.FakeUnicodeFont(e.xref,a),s=r.createFontResources(u.join("")),o=s.getRaw("Font");if(this._fieldResources.mergedResources.has("Font")){const e=this._fieldResources.mergedResources.get("Font");for(const t of o.getKeys())e.set(t,o.getRaw(t))}else this._fieldResources.mergedResources.set("Font",o);const l=r.fontName.name;y=await WidgetAnnotation._getFontData(e,t,{fontName:l,fontSize:0},s);for(let e=0,t=w.length;e<t;e++)w[e]=(0,n.stringToUTF16String)(u[e]);const h=Object.assign(Object.create(null),this.data.defaultAppearanceData);this.data.defaultAppearanceData.fontSize=0;this.data.defaultAppearanceData.fontName=l;[p,m,b]=this._computeFontSize(f-2,g-4,c,y,d);this.data.defaultAppearanceData=h}else{this._isOffscreenCanvasSupported||(0,r.warn)("_getAppearance: OffscreenCanvas is not supported, annotation may not render correctly.");[p,m,b]=this._computeFontSize(f-2,g-4,c,y,d)}let x=y.descent;x=isNaN(x)?r.BASELINE_FACTOR*b:Math.max(r.BASELINE_FACTOR*b,Math.abs(x)*m);const C=Math.min(Math.floor((f-m)/2),1),k=this.data.textAlignment;if(this.data.multiLine)return this._getMultilineAppearance(p,w,y,m,g,f,k,2,C,x,b,s);if(this.data.comb)return this._getCombAppearance(p,y,w[0],m,g,f,2,C,x,b,s);const v=C+x;if(0===k||k>2)return`/Tx BMC q ${h}BT `+p+` 1 0 0 1 ${(0,n.numberToString)(2)} ${(0,n.numberToString)(v)} Tm (${(0,n.escapeString)(w[0])}) Tj ET Q EMC`;return`/Tx BMC q ${h}BT `+p+` 1 0 0 1 0 0 Tm ${this._renderText(w[0],y,m,g,k,{shift:0},2,v)} ET Q EMC`}static async _getFontData(e,t,a,r){const n=new g.OperatorList,i={font:null,clone(){return this}},{fontName:o,fontSize:c}=a;await e.handleSetFont(r,[o&&s.Name.get(o),c],null,n,t,i,null);return i.font}_getTextWidth(e,t){return t.charsToGlyphs(e).reduce(((e,t)=>e+t.width),0)/1e3}_computeFontSize(e,t,a,n,s){let{fontSize:o}=this.data.defaultAppearanceData,c=(o||12)*r.LINE_FACTOR,l=Math.round(e/c);if(!o){const roundWithTwoDigits=e=>Math.floor(100*e)/100;if(-1===s){const i=this._getTextWidth(a,n);o=roundWithTwoDigits(Math.min(e/r.LINE_FACTOR,i>t?t/i:1/0));l=1}else{const i=a.split(/\r\n?|\n/),h=[];for(const e of i){const t=n.encodeString(e).join(""),a=n.charsToGlyphs(t),r=n.getCharPositions(t);h.push({line:t,glyphs:a,positions:r})}const isTooBig=a=>{let r=0;for(const i of h){r+=this._splitLine(null,n,a,t,i).length*a;if(r>e)return!0}return!1};l=Math.max(l,s);for(;;){c=e/l;o=roundWithTwoDigits(c/r.LINE_FACTOR);if(!isTooBig(o))break;l++}}const{fontName:h,fontColor:u}=this.data.defaultAppearanceData;this._defaultAppearance=(0,i.createDefaultAppearance)({fontSize:o,fontName:h,fontColor:u})}return[this._defaultAppearance,o,e/l]}_renderText(e,t,a,r,i,s,o,c){let l;if(1===i){l=(r-this._getTextWidth(e,t)*a)/2}else if(2===i){l=r-this._getTextWidth(e,t)*a-o}else l=o;const h=(0,n.numberToString)(l-s.shift);s.shift=l;return`${h} ${c=(0,n.numberToString)(c)} Td (${(0,n.escapeString)(e)}) Tj`}_getSaveFieldResources(e){const{localResources:t,appearanceResources:a,acroFormResources:r}=this._fieldResources,n=this.data.defaultAppearanceData&&this.data.defaultAppearanceData.fontName;if(!n)return t||s.Dict.empty;for(const e of[t,a])if(e instanceof s.Dict){const t=e.get("Font");if(t instanceof s.Dict&&t.has(n))return e}if(r instanceof s.Dict){const a=r.get("Font");if(a instanceof s.Dict&&a.has(n)){const r=new s.Dict(e);r.set(n,a.getRaw(n));const i=new s.Dict(e);i.set("Font",r);return s.Dict.merge({xref:e,dictArray:[i,t],mergeSubDicts:!0})}}return t||s.Dict.empty}getFieldObject(){return null}}class TextWidgetAnnotation extends WidgetAnnotation{constructor(e){super(e);this._hasText=!0;const t=e.dict;"string"!=typeof this.data.fieldValue&&(this.data.fieldValue="");let a=(0,n.getInheritableProperty)({dict:t,key:"Q"});(!Number.isInteger(a)||a<0||a>2)&&(a=null);this.data.textAlignment=a;let i=(0,n.getInheritableProperty)({dict:t,key:"MaxLen"});(!Number.isInteger(i)||i<0)&&(i=0);this.data.maxLen=i;this.data.multiLine=this.hasFieldFlag(r.AnnotationFieldFlag.MULTILINE);this.data.comb=this.hasFieldFlag(r.AnnotationFieldFlag.COMB)&&!this.hasFieldFlag(r.AnnotationFieldFlag.MULTILINE)&&!this.hasFieldFlag(r.AnnotationFieldFlag.PASSWORD)&&!this.hasFieldFlag(r.AnnotationFieldFlag.FILESELECT)&&0!==this.data.maxLen;this.data.doNotScroll=this.hasFieldFlag(r.AnnotationFieldFlag.DONOTSCROLL)}_getCombAppearance(e,t,a,r,i,s,o,c,l,h,u){const d=i/this.data.maxLen,f=this.getBorderAndBackgroundAppearances(u),g=[],p=t.getCharPositions(a);for(const[e,t]of p)g.push(`(${(0,n.escapeString)(a.substring(e,t))}) Tj`);const m=g.join(` ${(0,n.numberToString)(d)} 0 Td `);return`/Tx BMC q ${f}BT `+e+` 1 0 0 1 ${(0,n.numberToString)(o)} ${(0,n.numberToString)(c+l)} Tm ${m} ET Q EMC`}_getMultilineAppearance(e,t,a,r,i,s,o,c,l,h,u,d){const f=[],g=i-2*c,p={shift:0};for(let e=0,n=t.length;e<n;e++){const n=t[e],s=this._splitLine(n,a,r,g);for(let t=0,n=s.length;t<n;t++){const n=s[t],d=0===e&&0===t?-l-(u-h):-u;f.push(this._renderText(n,a,r,i,o,p,c,d))}}const m=this.getBorderAndBackgroundAppearances(d),b=f.join("\n");return`/Tx BMC q ${m}BT `+e+` 1 0 0 1 0 ${(0,n.numberToString)(s)} Tm ${b} ET Q EMC`}_splitLine(e,t,a,r,n={}){e=n.line||e;const i=n.glyphs||t.charsToGlyphs(e);if(i.length<=1)return[e];const s=n.positions||t.getCharPositions(e),o=a/1e3,c=[];let l=-1,h=-1,u=-1,d=0,f=0;for(let t=0,a=i.length;t<a;t++){const[a,n]=s[t],g=i[t],p=g.width*o;if(" "===g.unicode)if(f+p>r){c.push(e.substring(d,a));d=a;f=p;l=-1;u=-1}else{f+=p;l=a;h=n;u=t}else if(f+p>r)if(-1!==l){c.push(e.substring(d,h));d=h;t=u+1;l=-1;f=0}else{c.push(e.substring(d,a));d=a;f=p}else f+=p}d<e.length&&c.push(e.substring(d,e.length));return c}getFieldObject(){return{id:this.data.id,value:this.data.fieldValue,defaultValue:this.data.defaultFieldValue||"",multiline:this.data.multiLine,password:this.hasFieldFlag(r.AnnotationFieldFlag.PASSWORD),charLimit:this.data.maxLen,comb:this.data.comb,editable:!this.data.readOnly,hidden:this.data.hidden,name:this.data.fieldName,rect:this.data.rect,actions:this.data.actions,page:this.data.pageIndex,strokeColor:this.data.borderColor,fillColor:this.data.backgroundColor,rotation:this.rotation,type:"text"}}}class ButtonWidgetAnnotation extends WidgetAnnotation{constructor(e){super(e);this.checkedAppearance=null;this.uncheckedAppearance=null;this.data.checkBox=!this.hasFieldFlag(r.AnnotationFieldFlag.RADIO)&&!this.hasFieldFlag(r.AnnotationFieldFlag.PUSHBUTTON);this.data.radioButton=this.hasFieldFlag(r.AnnotationFieldFlag.RADIO)&&!this.hasFieldFlag(r.AnnotationFieldFlag.PUSHBUTTON);this.data.pushButton=this.hasFieldFlag(r.AnnotationFieldFlag.PUSHBUTTON);this.data.isTooltipOnly=!1;if(this.data.checkBox)this._processCheckBox(e);else if(this.data.radioButton)this._processRadioButton(e);else if(this.data.pushButton){this.data.hasOwnCanvas=!0;this._processPushButton(e)}else(0,r.warn)("Invalid field flags for button widget annotation")}async getOperatorList(e,t,a,n,i){if(this.data.pushButton)return super.getOperatorList(e,t,a,!1,i);let s=null,o=null;if(i){const e=i.get(this.data.id);s=e?e.value:null;o=e?e.rotation:null}if(null===s&&this.appearance)return super.getOperatorList(e,t,a,n,i);null==s&&(s=this.data.checkBox?this.data.fieldValue===this.data.exportValue:this.data.fieldValue===this.data.buttonValue);const c=s?this.checkedAppearance:this.uncheckedAppearance;if(c){const s=this.appearance,l=c.dict.getArray("Matrix")||r.IDENTITY_MATRIX;o&&c.dict.set("Matrix",this.getRotationMatrix(i));this.appearance=c;const h=super.getOperatorList(e,t,a,n,i);this.appearance=s;c.dict.set("Matrix",l);return h}return{opList:new g.OperatorList,separateForm:!1,separateCanvas:!1}}async save(e,t,a){return this.data.checkBox?this._saveCheckbox(e,t,a):this.data.radioButton?this._saveRadioButton(e,t,a):null}async _saveCheckbox(e,t,a){if(!a)return null;const n=a.get(this.data.id);let i=n&&n.rotation,c=n&&n.value;if(void 0===i){if(void 0===c)return null;if(this.data.fieldValue===this.data.exportValue===c)return null}const l=e.xref.fetchIfRef(this.ref);if(!(l instanceof s.Dict))return null;void 0===i&&(i=this.rotation);void 0===c&&(c=this.data.fieldValue===this.data.exportValue);const h={path:this.data.fieldName,value:c?this.data.exportValue:""},u=s.Name.get(c?this.data.exportValue:"Off");l.set("V",u);l.set("AS",u);l.set("M",`D:${(0,r.getModificationDate)()}`);const d=this._getMKDict(i);d&&l.set("MK",d);const f=e.xref.encrypt;let g=null;f&&(g=f.createCipherTransform(this.ref.num,this.ref.gen));const p=[`${this.ref.num} ${this.ref.gen} obj\n`];(0,o.writeDict)(l,p,g);p.push("\nendobj\n");return[{ref:this.ref,data:p.join(""),xfa:h}]}async _saveRadioButton(e,t,a){if(!a)return null;const n=a.get(this.data.id);let i=n&&n.rotation,c=n&&n.value;if(void 0===i){if(void 0===c)return null;if(this.data.fieldValue===this.data.buttonValue===c)return null}const l=e.xref.fetchIfRef(this.ref);if(!(l instanceof s.Dict))return null;void 0===c&&(c=this.data.fieldValue===this.data.buttonValue);void 0===i&&(i=this.rotation);const h={path:this.data.fieldName,value:c?this.data.buttonValue:""},u=s.Name.get(c?this.data.buttonValue:"Off");let d=null;const f=e.xref.encrypt;if(c)if(this.parent instanceof s.Ref){const t=e.xref.fetch(this.parent);let a=null;f&&(a=f.createCipherTransform(this.parent.num,this.parent.gen));t.set("V",u);d=[`${this.parent.num} ${this.parent.gen} obj\n`];(0,o.writeDict)(t,d,a);d.push("\nendobj\n")}else this.parent instanceof s.Dict&&this.parent.set("V",u);l.set("AS",u);l.set("M",`D:${(0,r.getModificationDate)()}`);const g=this._getMKDict(i);g&&l.set("MK",g);let p=null;f&&(p=f.createCipherTransform(this.ref.num,this.ref.gen));const m=[`${this.ref.num} ${this.ref.gen} obj\n`];(0,o.writeDict)(l,m,p);m.push("\nendobj\n");const b=[{ref:this.ref,data:m.join(""),xfa:h}];null!==d&&b.push({ref:this.parent,data:d.join(""),xfa:null});return b}_getDefaultCheckedAppearance(e,t){const a=this.data.rect[2]-this.data.rect[0],i=this.data.rect[3]-this.data.rect[1],o=[0,0,a,i],c=.8*Math.min(a,i);let l,h;if("check"===t){l={width:.755*c,height:.705*c};h="3"}else if("disc"===t){l={width:.791*c,height:.705*c};h="l"}else(0,r.unreachable)(`_getDefaultCheckedAppearance - unsupported type: ${t}`);const u=`q BT /PdfJsZaDb ${c} Tf 0 g ${(0,n.numberToString)((a-l.width)/2)} ${(0,n.numberToString)((i-l.height)/2)} Td (${h}) Tj ET Q`,d=new s.Dict(e.xref);d.set("FormType",1);d.set("Subtype",s.Name.get("Form"));d.set("Type",s.Name.get("XObject"));d.set("BBox",o);d.set("Matrix",[1,0,0,1,0,0]);d.set("Length",u.length);const f=new s.Dict(e.xref),g=new s.Dict(e.xref);g.set("PdfJsZaDb",this.fallbackFontDict);f.set("Font",g);d.set("Resources",f);this.checkedAppearance=new p.StringStream(u);this.checkedAppearance.dict=d;this._streams.push(this.checkedAppearance)}_processCheckBox(e){const t=e.dict.get("AP");if(!(t instanceof s.Dict))return;const a=t.get("N");if(!(a instanceof s.Dict))return;const r=this._decodeFormValue(e.dict.get("AS"));"string"==typeof r&&(this.data.fieldValue=r);const n=null!==this.data.fieldValue&&"Off"!==this.data.fieldValue?this.data.fieldValue:"Yes",i=a.getKeys();if(0===i.length)i.push("Off",n);else if(1===i.length)"Off"===i[0]?i.push(n):i.unshift("Off");else if(i.includes(n)){i.length=0;i.push("Off",n)}else{const e=i.find((e=>"Off"!==e));i.length=0;i.push("Off",e)}i.includes(this.data.fieldValue)||(this.data.fieldValue="Off");this.data.exportValue=i[1];const o=a.get(this.data.exportValue);this.checkedAppearance=o instanceof c.BaseStream?o:null;const l=a.get("Off");this.uncheckedAppearance=l instanceof c.BaseStream?l:null;this.checkedAppearance?this._streams.push(this.checkedAppearance):this._getDefaultCheckedAppearance(e,"check");this.uncheckedAppearance&&this._streams.push(this.uncheckedAppearance);this._fallbackFontDict=this.fallbackFontDict}_processRadioButton(e){this.data.fieldValue=this.data.buttonValue=null;const t=e.dict.get("Parent");if(t instanceof s.Dict){this.parent=e.dict.getRaw("Parent");const a=t.get("V");a instanceof s.Name&&(this.data.fieldValue=this._decodeFormValue(a))}const a=e.dict.get("AP");if(!(a instanceof s.Dict))return;const r=a.get("N");if(!(r instanceof s.Dict))return;for(const e of r.getKeys())if("Off"!==e){this.data.buttonValue=this._decodeFormValue(e);break}const n=r.get(this.data.buttonValue);this.checkedAppearance=n instanceof c.BaseStream?n:null;const i=r.get("Off");this.uncheckedAppearance=i instanceof c.BaseStream?i:null;this.checkedAppearance?this._streams.push(this.checkedAppearance):this._getDefaultCheckedAppearance(e,"disc");this.uncheckedAppearance&&this._streams.push(this.uncheckedAppearance);this._fallbackFontDict=this.fallbackFontDict}_processPushButton(e){if(e.dict.has("A")||e.dict.has("AA")||this.data.alternativeText){this.data.isTooltipOnly=!e.dict.has("A")&&!e.dict.has("AA");h.Catalog.parseDestDictionary({destDict:e.dict,resultObj:this.data,docBaseUrl:e.pdfManager.docBaseUrl,docAttachments:e.attachments})}else(0,r.warn)("Push buttons without action dictionaries are not supported")}getFieldObject(){let e,t="button";if(this.data.checkBox){t="checkbox";e=this.data.exportValue}else if(this.data.radioButton){t="radiobutton";e=this.data.buttonValue}return{id:this.data.id,value:this.data.fieldValue||"Off",defaultValue:this.data.defaultFieldValue,exportValues:e,editable:!this.data.readOnly,name:this.data.fieldName,rect:this.data.rect,hidden:this.data.hidden,actions:this.data.actions,page:this.data.pageIndex,strokeColor:this.data.borderColor,fillColor:this.data.backgroundColor,rotation:this.rotation,type:t}}get fallbackFontDict(){const e=new s.Dict;e.set("BaseFont",s.Name.get("ZapfDingbats"));e.set("Type",s.Name.get("FallbackType"));e.set("Subtype",s.Name.get("FallbackType"));e.set("Encoding",s.Name.get("ZapfDingbatsEncoding"));return(0,r.shadow)(this,"fallbackFontDict",e)}}class ChoiceWidgetAnnotation extends WidgetAnnotation{constructor(e){super(e);const{dict:t,xref:a}=e;this.indices=t.getArray("I");this.hasIndices=Array.isArray(this.indices)&&this.indices.length>0;this.data.options=[];const i=(0,n.getInheritableProperty)({dict:t,key:"Opt"});if(Array.isArray(i))for(let e=0,t=i.length;e<t;e++){const t=a.fetchIfRef(i[e]),r=Array.isArray(t);this.data.options[e]={exportValue:this._decodeFormValue(r?a.fetchIfRef(t[0]):t),displayValue:this._decodeFormValue(r?a.fetchIfRef(t[1]):t)}}if(this.hasIndices){this.data.fieldValue=[];const e=this.data.options.length;for(const t of this.indices)Number.isInteger(t)&&t>=0&&t<e&&this.data.fieldValue.push(this.data.options[t].exportValue)}else"string"==typeof this.data.fieldValue?this.data.fieldValue=[this.data.fieldValue]:this.data.fieldValue||(this.data.fieldValue=[]);this.data.combo=this.hasFieldFlag(r.AnnotationFieldFlag.COMBO);this.data.multiSelect=this.hasFieldFlag(r.AnnotationFieldFlag.MULTISELECT);this._hasText=!0}getFieldObject(){const e=this.data.combo?"combobox":"listbox",t=this.data.fieldValue.length>0?this.data.fieldValue[0]:null;return{id:this.data.id,value:t,defaultValue:this.data.defaultFieldValue,editable:!this.data.readOnly,name:this.data.fieldName,rect:this.data.rect,numItems:this.data.fieldValue.length,multipleSelection:this.data.multiSelect,hidden:this.data.hidden,actions:this.data.actions,items:this.data.options,page:this.data.pageIndex,strokeColor:this.data.borderColor,fillColor:this.data.backgroundColor,rotation:this.rotation,type:e}}amendSavedDict(e,t){if(!this.hasIndices)return;const a=e?e.get(this.data.id):void 0;let r=a&&a.value;Array.isArray(r)||(r=[r]);const n=[],{options:i}=this.data;for(let e=0,t=0,a=i.length;e<a;e++)if(i[e].exportValue===r[t]){n.push(e);t+=1}t.set("I",n)}async _getAppearance(e,t,a,n){if(this.data.combo)return super._getAppearance(e,t,a,n);let s,o;const c=n?n.get(this.data.id):void 0;if(c){o=c.rotation;s=c.value}if(void 0===o&&void 0===s&&!this._needAppearances)return null;void 0===s?s=this.data.fieldValue:Array.isArray(s)||(s=[s]);let l=this.data.rect[3]-this.data.rect[1],h=this.data.rect[2]-this.data.rect[0];90!==o&&270!==o||([h,l]=[l,h]);const u=this.data.options.length,d=[];for(let e=0;e<u;e++){const{exportValue:t}=this.data.options[e];s.includes(t)&&d.push(e)}this._defaultAppearance||(this.data.defaultAppearanceData=(0,i.parseDefaultAppearance)(this._defaultAppearance="/Helvetica 0 Tf 0 g"));const f=await WidgetAnnotation._getFontData(e,t,this.data.defaultAppearanceData,this._fieldResources.mergedResources);let g,{fontSize:p}=this.data.defaultAppearanceData;if(p)g=this._defaultAppearance;else{const e=(l-1)/u;let t,a=-1;for(const{displayValue:e}of this.data.options){const r=this._getTextWidth(e,f);if(r>a){a=r;t=e}}[g,p]=this._computeFontSize(e,h-4,t,f,-1)}const m=p*r.LINE_FACTOR,b=(m-p)/2,y=Math.floor(l/m);let w;if(1===d.length){const e=d[0];w=e-e%y}else w=d.length?d[0]:0;const S=Math.min(w+y+1,u),x=["/Tx BMC q",`1 1 ${h} ${l} re W n`];if(d.length){x.push("0.600006 0.756866 0.854904 rg");for(const e of d)w<=e&&e<S&&x.push(`1 ${l-(e-w+1)*m} ${h} ${m} re f`)}x.push("BT",g,`1 0 0 1 0 ${l} Tm`);const C={shift:0};for(let e=w;e<S;e++){const{displayValue:t}=this.data.options[e],a=e===w?b:0;x.push(this._renderText(t,f,p,h,0,C,2,-m+a))}x.push("ET Q EMC");return x.join("\n")}}class SignatureWidgetAnnotation extends WidgetAnnotation{constructor(e){super(e);this.data.fieldValue=null}getFieldObject(){return{id:this.data.id,value:null,page:this.data.pageIndex,type:"signature"}}}class TextAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t}=e;this.data.annotationType=r.AnnotationType.TEXT;if(this.data.hasAppearance)this.data.name="NoIcon";else{this.data.rect[1]=this.data.rect[3]-22;this.data.rect[2]=this.data.rect[0]+22;this.data.name=t.has("Name")?t.get("Name").name:"Note"}if(t.has("State")){this.data.state=t.get("State")||null;this.data.stateModel=t.get("StateModel")||null}else{this.data.state=null;this.data.stateModel=null}}}class LinkAnnotation extends Annotation{constructor(e){super(e);this.data.annotationType=r.AnnotationType.LINK;const t=getQuadPoints(e.dict,this.rectangle);t&&(this.data.quadPoints=t);this.data.borderColor=this.data.borderColor||this.data.color;h.Catalog.parseDestDictionary({destDict:e.dict,resultObj:this.data,docBaseUrl:e.pdfManager.docBaseUrl,docAttachments:e.attachments})}}class PopupAnnotation extends Annotation{constructor(e){super(e);const{dict:t}=e;this.data.annotationType=r.AnnotationType.POPUP;let a=t.get("Parent");if(!a){(0,r.warn)("Popup annotation has a missing or invalid parent annotation.");return}const n=a.get("Subtype");this.data.parentType=n instanceof s.Name?n.name:null;const i=t.getRaw("Parent");this.data.parentId=i instanceof s.Ref?i.toString():null;const o=a.getArray("Rect");Array.isArray(o)&&4===o.length?this.data.parentRect=r.Util.normalizeRect(o):this.data.parentRect=[0,0,0,0];const c=a.get("RT");(0,s.isName)(c,r.AnnotationReplyType.GROUP)&&(a=a.get("IRT"));if(a.has("M")){this.setModificationDate(a.get("M"));this.data.modificationDate=this.modificationDate}else this.data.modificationDate=null;if(a.has("C")){this.setColor(a.getArray("C"));this.data.color=this.color}else this.data.color=null;if(!this.viewable){const e=a.get("F");this._isViewable(e)&&this.setFlags(e)}this.setTitle(a.get("T"));this.data.titleObj=this._title;this.setContents(a.get("Contents"));this.data.contentsObj=this._contents;a.has("RC")&&(this.data.richText=m.XFAFactory.getRichTextAsHtml(a.get("RC")))}}t.PopupAnnotation=PopupAnnotation;class FreeTextAnnotation extends MarkupAnnotation{constructor(e){super(e);const{xref:t}=e;this.data.annotationType=r.AnnotationType.FREETEXT;this.setDefaultAppearance(e);if(!this.appearance&&this._isOffscreenCanvasSupported){const a=e.dict.get("CA"),r=new i.FakeUnicodeFont(t,"sans-serif"),n=this.data.defaultAppearanceData;this.appearance=r.createAppearance(this._contents.str,this.rectangle,this.rotation,n.fontSize||10,n.fontColor,a);this._streams.push(this.appearance,i.FakeUnicodeFont.toUnicodeStream)}else this._isOffscreenCanvasSupported||(0,r.warn)("FreeTextAnnotation: OffscreenCanvas is not supported, annotation may not render correctly.")}get hasTextContent(){return!!this.appearance}static createNewDict(e,t,{apRef:a,ap:o}){const{color:c,fontSize:l,rect:h,rotation:u,user:d,value:f}=e,g=new s.Dict(t);g.set("Type",s.Name.get("Annot"));g.set("Subtype",s.Name.get("FreeText"));g.set("CreationDate",`D:${(0,r.getModificationDate)()}`);g.set("Rect",h);const p=`/Helv ${l} Tf ${(0,i.getPdfColor)(c,!0)}`;g.set("DA",p);g.set("Contents",(0,n.isAscii)(f)?f:(0,n.stringToUTF16String)(f,!0));g.set("F",4);g.set("Border",[0,0,0]);g.set("Rotate",u);d&&g.set("T",(0,n.isAscii)(d)?d:(0,n.stringToUTF16String)(d,!0));if(a||o){const e=new s.Dict(t);g.set("AP",e);a?e.set("N",a):e.set("N",o)}return g}static async createNewAppearanceStream(e,t,a){const{baseFontRef:o,evaluator:c,task:l}=a,{color:h,fontSize:u,rect:d,rotation:f,value:g}=e,m=new s.Dict(t),b=new s.Dict(t);if(o)b.set("Helv",o);else{const e=new s.Dict(t);e.set("BaseFont",s.Name.get("Helvetica"));e.set("Type",s.Name.get("Font"));e.set("Subtype",s.Name.get("Type1"));e.set("Encoding",s.Name.get("WinAnsiEncoding"));b.set("Helv",e)}m.set("Font",b);const y=await WidgetAnnotation._getFontData(c,l,{fontName:"Helvetica",fontSize:u},m),[w,S,x,C]=d;let k=x-w,v=C-S;f%180!=0&&([k,v]=[v,k]);const F=g.split("\n"),O=u/1e3;let T=-1/0;const M=[];for(let e of F){const t=y.encodeString(e);if(t.length>1)return null;e=t.join("");M.push(e);let a=0;const r=y.charsToGlyphs(e);for(const e of r)a+=e.width*O;T=Math.max(T,a)}let E=1;T>k&&(E=k/T);let D=1;const N=r.LINE_FACTOR*u,R=r.LINE_DESCENT_FACTOR*u,L=N*F.length;L>v&&(D=v/L);const j=u*Math.min(E,D),$=["q",`0 0 ${(0,n.numberToString)(k)} ${(0,n.numberToString)(v)} re W n`,"BT",`1 0 0 1 0 ${(0,n.numberToString)(v+R)} Tm 0 Tc ${(0,i.getPdfColor)(h,!0)}`,`/Helv ${(0,n.numberToString)(j)} Tf`],_=(0,n.numberToString)(N);for(const e of M)$.push(`0 -${_} Td (${(0,n.escapeString)(e)}) Tj`);$.push("ET","Q");const U=$.join("\n"),X=new s.Dict(t);X.set("FormType",1);X.set("Subtype",s.Name.get("Form"));X.set("Type",s.Name.get("XObject"));X.set("BBox",[0,0,k,v]);X.set("Resources",m);if(f){const e=(0,n.getRotationMatrix)(f,k,v);X.set("Matrix",e)}const H=new p.StringStream(U);H.dict=X;return H}}class LineAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:a}=e;this.data.annotationType=r.AnnotationType.LINE;const n=t.getArray("L");this.data.lineCoordinates=r.Util.normalizeRect(n);this.setLineEndings(t.getArray("LE"));this.data.lineEndings=this.lineEndings;if(!this.appearance){const e=this.color?getPdfColorArray(this.color):[0,0,0],i=t.get("CA"),s=getRgbColor(t.getArray("IC"),null),o=s?getPdfColorArray(s):null,c=o?i:null,l=this.borderStyle.width||1,h=2*l,u=[this.data.lineCoordinates[0]-h,this.data.lineCoordinates[1]-h,this.data.lineCoordinates[2]+h,this.data.lineCoordinates[3]+h];r.Util.intersect(this.rectangle,u)||(this.rectangle=u);this._setDefaultAppearance({xref:a,extra:`${l} w`,strokeColor:e,fillColor:o,strokeAlpha:i,fillAlpha:c,pointsCallback:(e,t)=>{e.push(`${n[0]} ${n[1]} m`,`${n[2]} ${n[3]} l`,"S");return[t[0].x-l,t[1].x+l,t[3].y-l,t[1].y+l]}})}}}class SquareAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:a}=e;this.data.annotationType=r.AnnotationType.SQUARE;if(!this.appearance){const e=this.color?getPdfColorArray(this.color):[0,0,0],r=t.get("CA"),n=getRgbColor(t.getArray("IC"),null),i=n?getPdfColorArray(n):null,s=i?r:null;if(0===this.borderStyle.width&&!i)return;this._setDefaultAppearance({xref:a,extra:`${this.borderStyle.width} w`,strokeColor:e,fillColor:i,strokeAlpha:r,fillAlpha:s,pointsCallback:(e,t)=>{const a=t[2].x+this.borderStyle.width/2,r=t[2].y+this.borderStyle.width/2,n=t[3].x-t[2].x-this.borderStyle.width,s=t[1].y-t[3].y-this.borderStyle.width;e.push(`${a} ${r} ${n} ${s} re`);i?e.push("B"):e.push("S");return[t[0].x,t[1].x,t[3].y,t[1].y]}})}}}class CircleAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:a}=e;this.data.annotationType=r.AnnotationType.CIRCLE;if(!this.appearance){const e=this.color?getPdfColorArray(this.color):[0,0,0],r=t.get("CA"),n=getRgbColor(t.getArray("IC"),null),i=n?getPdfColorArray(n):null,s=i?r:null;if(0===this.borderStyle.width&&!i)return;const o=4/3*Math.tan(Math.PI/8);this._setDefaultAppearance({xref:a,extra:`${this.borderStyle.width} w`,strokeColor:e,fillColor:i,strokeAlpha:r,fillAlpha:s,pointsCallback:(e,t)=>{const a=t[0].x+this.borderStyle.width/2,r=t[0].y-this.borderStyle.width/2,n=t[3].x-this.borderStyle.width/2,s=t[3].y+this.borderStyle.width/2,c=a+(n-a)/2,l=r+(s-r)/2,h=(n-a)/2*o,u=(s-r)/2*o;e.push(`${c} ${s} m`,`${c+h} ${s} ${n} ${l+u} ${n} ${l} c`,`${n} ${l-u} ${c+h} ${r} ${c} ${r} c`,`${c-h} ${r} ${a} ${l-u} ${a} ${l} c`,`${a} ${l+u} ${c-h} ${s} ${c} ${s} c`,"h");i?e.push("B"):e.push("S");return[t[0].x,t[1].x,t[3].y,t[1].y]}})}}}class PolylineAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:a}=e;this.data.annotationType=r.AnnotationType.POLYLINE;this.data.vertices=[];if(!(this instanceof PolygonAnnotation)){this.setLineEndings(t.getArray("LE"));this.data.lineEndings=this.lineEndings}const n=t.getArray("Vertices");if(Array.isArray(n)){for(let e=0,t=n.length;e<t;e+=2)this.data.vertices.push({x:n[e],y:n[e+1]});if(!this.appearance){const e=this.color?getPdfColorArray(this.color):[0,0,0],n=t.get("CA"),i=this.borderStyle.width||1,s=2*i,o=[1/0,1/0,-1/0,-1/0];for(const e of this.data.vertices){o[0]=Math.min(o[0],e.x-s);o[1]=Math.min(o[1],e.y-s);o[2]=Math.max(o[2],e.x+s);o[3]=Math.max(o[3],e.y+s)}r.Util.intersect(this.rectangle,o)||(this.rectangle=o);this._setDefaultAppearance({xref:a,extra:`${i} w`,strokeColor:e,strokeAlpha:n,pointsCallback:(e,t)=>{const a=this.data.vertices;for(let t=0,r=a.length;t<r;t++)e.push(`${a[t].x} ${a[t].y} ${0===t?"m":"l"}`);e.push("S");return[t[0].x,t[1].x,t[3].y,t[1].y]}})}}}}class PolygonAnnotation extends PolylineAnnotation{constructor(e){super(e);this.data.annotationType=r.AnnotationType.POLYGON}}class CaretAnnotation extends MarkupAnnotation{constructor(e){super(e);this.data.annotationType=r.AnnotationType.CARET}}class InkAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:a}=e;this.data.annotationType=r.AnnotationType.INK;this.data.inkLists=[];const n=t.getArray("InkList");if(Array.isArray(n)){for(let e=0,t=n.length;e<t;++e){this.data.inkLists.push([]);for(let t=0,r=n[e].length;t<r;t+=2)this.data.inkLists[e].push({x:a.fetchIfRef(n[e][t]),y:a.fetchIfRef(n[e][t+1])})}if(!this.appearance){const e=this.color?getPdfColorArray(this.color):[0,0,0],n=t.get("CA"),i=this.borderStyle.width||1,s=2*i,o=[1/0,1/0,-1/0,-1/0];for(const e of this.data.inkLists)for(const t of e){o[0]=Math.min(o[0],t.x-s);o[1]=Math.min(o[1],t.y-s);o[2]=Math.max(o[2],t.x+s);o[3]=Math.max(o[3],t.y+s)}r.Util.intersect(this.rectangle,o)||(this.rectangle=o);this._setDefaultAppearance({xref:a,extra:`${i} w`,strokeColor:e,strokeAlpha:n,pointsCallback:(e,t)=>{for(const t of this.data.inkLists){for(let a=0,r=t.length;a<r;a++)e.push(`${t[a].x} ${t[a].y} ${0===a?"m":"l"}`);e.push("S")}return[t[0].x,t[1].x,t[3].y,t[1].y]}})}}}static createNewDict(e,t,{apRef:a,ap:n}){const{paths:i,rect:o,rotation:c}=e,l=new s.Dict(t);l.set("Type",s.Name.get("Annot"));l.set("Subtype",s.Name.get("Ink"));l.set("CreationDate",`D:${(0,r.getModificationDate)()}`);l.set("Rect",o);l.set("InkList",i.map((e=>e.points)));l.set("F",4);l.set("Border",[0,0,0]);l.set("Rotate",c);const h=new s.Dict(t);l.set("AP",h);a?h.set("N",a):h.set("N",n);return l}static async createNewAppearanceStream(e,t,a){const{color:r,rect:o,rotation:c,paths:l,thickness:h,opacity:u}=e,[d,f,g,m]=o;let b=g-d,y=m-f;c%180!=0&&([b,y]=[y,b]);const w=[`${h} w 1 J 1 j`,`${(0,i.getPdfColor)(r,!1)}`];1!==u&&w.push("/R0 gs");const S=[];for(const{bezier:e}of l){S.length=0;S.push(`${(0,n.numberToString)(e[0])} ${(0,n.numberToString)(e[1])} m`);for(let t=2,a=e.length;t<a;t+=6){const a=e.slice(t,t+6).map(n.numberToString).join(" ");S.push(`${a} c`)}S.push("S");w.push(S.join("\n"))}const x=w.join("\n"),C=new s.Dict(t);C.set("FormType",1);C.set("Subtype",s.Name.get("Form"));C.set("Type",s.Name.get("XObject"));C.set("BBox",[0,0,b,y]);C.set("Length",x.length);if(c){const e=(0,n.getRotationMatrix)(c,b,y);C.set("Matrix",e)}if(1!==u){const e=new s.Dict(t),a=new s.Dict(t),r=new s.Dict(t);r.set("CA",u);r.set("Type",s.Name.get("ExtGState"));a.set("R0",r);e.set("ExtGState",a);C.set("Resources",e)}const k=new p.StringStream(x);k.dict=C;return k}}class HighlightAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:a}=e;this.data.annotationType=r.AnnotationType.HIGHLIGHT;if(this.data.quadPoints=getQuadPoints(t,null)){const e=this.appearance&&this.appearance.dict.get("Resources");if(!this.appearance||!e||!e.has("ExtGState")){this.appearance&&(0,r.warn)("HighlightAnnotation - ignoring built-in appearance stream.");const e=this.color?getPdfColorArray(this.color):[1,1,0],n=t.get("CA");this._setDefaultAppearance({xref:a,fillColor:e,blendMode:"Multiply",fillAlpha:n,pointsCallback:(e,t)=>{e.push(`${t[0].x} ${t[0].y} m`,`${t[1].x} ${t[1].y} l`,`${t[3].x} ${t[3].y} l`,`${t[2].x} ${t[2].y} l`,"f");return[t[0].x,t[1].x,t[3].y,t[1].y]}})}}else this.data.hasPopup=!1}}class UnderlineAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:a}=e;this.data.annotationType=r.AnnotationType.UNDERLINE;if(this.data.quadPoints=getQuadPoints(t,null)){if(!this.appearance){const e=this.color?getPdfColorArray(this.color):[0,0,0],r=t.get("CA");this._setDefaultAppearance({xref:a,extra:"[] 0 d 1 w",strokeColor:e,strokeAlpha:r,pointsCallback:(e,t)=>{e.push(`${t[2].x} ${t[2].y} m`,`${t[3].x} ${t[3].y} l`,"S");return[t[0].x,t[1].x,t[3].y,t[1].y]}})}}else this.data.hasPopup=!1}}class SquigglyAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:a}=e;this.data.annotationType=r.AnnotationType.SQUIGGLY;if(this.data.quadPoints=getQuadPoints(t,null)){if(!this.appearance){const e=this.color?getPdfColorArray(this.color):[0,0,0],r=t.get("CA");this._setDefaultAppearance({xref:a,extra:"[] 0 d 1 w",strokeColor:e,strokeAlpha:r,pointsCallback:(e,t)=>{const a=(t[0].y-t[2].y)/6;let r=a,n=t[2].x;const i=t[2].y,s=t[3].x;e.push(`${n} ${i+r} m`);do{n+=2;r=0===r?a:0;e.push(`${n} ${i+r} l`)}while(n<s);e.push("S");return[t[2].x,s,i-2*a,i+2*a]}})}}else this.data.hasPopup=!1}}class StrikeOutAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:a}=e;this.data.annotationType=r.AnnotationType.STRIKEOUT;if(this.data.quadPoints=getQuadPoints(t,null)){if(!this.appearance){const e=this.color?getPdfColorArray(this.color):[0,0,0],r=t.get("CA");this._setDefaultAppearance({xref:a,extra:"[] 0 d 1 w",strokeColor:e,strokeAlpha:r,pointsCallback:(e,t)=>{e.push((t[0].x+t[2].x)/2+" "+(t[0].y+t[2].y)/2+" m",(t[1].x+t[3].x)/2+" "+(t[1].y+t[3].y)/2+" l","S");return[t[0].x,t[1].x,t[3].y,t[1].y]}})}}else this.data.hasPopup=!1}}class StampAnnotation extends MarkupAnnotation{constructor(e){super(e);this.data.annotationType=r.AnnotationType.STAMP}}class FileAttachmentAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t,xref:a}=e,n=new d.FileSpec(t.get("FS"),a);this.data.annotationType=r.AnnotationType.FILEATTACHMENT;this.data.file=n.serializable;const i=t.get("Name");this.data.name=i instanceof s.Name?(0,r.stringToPDFString)(i.name):"PushPin"}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.FakeUnicodeFont=void 0;t.createDefaultAppearance=function createDefaultAppearance({fontSize:e,fontName:t,fontColor:a}){return`/${(0,n.escapePDFName)(t)} ${e} Tf ${getPdfColor(a,!0)}`};t.getPdfColor=getPdfColor;t.parseDefaultAppearance=function parseDefaultAppearance(e){return new DefaultAppearanceEvaluator(e).parse()};var r=a(4),n=a(3),i=a(2),s=a(12),o=a(13),c=a(8);class DefaultAppearanceEvaluator extends o.EvaluatorPreprocessor{constructor(e){super(new c.StringStream(e))}parse(){const e={fn:0,args:[]},t={fontSize:0,fontName:"",fontColor:new Uint8ClampedArray(3)};try{for(;;){e.args.length=0;if(!this.read(e))break;if(0!==this.savedStatesDepth)continue;const{fn:a,args:n}=e;switch(0|a){case i.OPS.setFont:const[e,a]=n;e instanceof r.Name&&(t.fontName=e.name);"number"==typeof a&&a>0&&(t.fontSize=a);break;case i.OPS.setFillRGBColor:s.ColorSpace.singletons.rgb.getRgbItem(n,0,t.fontColor,0);break;case i.OPS.setFillGray:s.ColorSpace.singletons.gray.getRgbItem(n,0,t.fontColor,0);break;case i.OPS.setFillColorSpace:s.ColorSpace.singletons.cmyk.getRgbItem(n,0,t.fontColor,0)}}}catch(e){(0,i.warn)(`parseDefaultAppearance - ignoring errors: "${e}".`)}return t}}function getPdfColor(e,t){if(e[0]===e[1]&&e[1]===e[2]){const a=e[0]/255;return`${(0,n.numberToString)(a)} ${t?"g":"G"}`}return Array.from(e,(e=>(0,n.numberToString)(e/255))).join(" ")+" "+(t?"rg":"RG")}class FakeUnicodeFont{constructor(e,t){this.xref=e;this.widths=null;this.firstChar=1/0;this.lastChar=-1/0;this.fontFamily=t;const a=new OffscreenCanvas(1,1);this.ctxMeasure=a.getContext("2d");FakeUnicodeFont._fontNameId||(FakeUnicodeFont._fontNameId=1);this.fontName=r.Name.get(`InvalidPDFjsFont_${t}_${FakeUnicodeFont._fontNameId++}`)}get toUnicodeRef(){if(!FakeUnicodeFont._toUnicodeRef){const e="/CIDInit /ProcSet findresource begin\n12 dict begin\nbegincmap\n/CIDSystemInfo\n<< /Registry (Adobe)\n/Ordering (UCS) /Supplement 0 >> def\n/CMapName /Adobe-Identity-UCS def\n/CMapType 2 def\n1 begincodespacerange\n<0000> <FFFF>\nendcodespacerange\n1 beginbfrange\n<0000> <FFFF> <0000>\nendbfrange\nendcmap CMapName currentdict /CMap defineresource pop end end",t=FakeUnicodeFont.toUnicodeStream=new c.StringStream(e),a=new r.Dict(this.xref);t.dict=a;a.set("Length",e.length);FakeUnicodeFont._toUnicodeRef=this.xref.getNewPersistentRef(t)}return FakeUnicodeFont._toUnicodeRef}get fontDescriptorRef(){if(!FakeUnicodeFont._fontDescriptorRef){const e=new r.Dict(this.xref);e.set("Type",r.Name.get("FontDescriptor"));e.set("FontName",this.fontName);e.set("FontFamily","MyriadPro Regular");e.set("FontBBox",[0,0,0,0]);e.set("FontStretch",r.Name.get("Normal"));e.set("FontWeight",400);e.set("ItalicAngle",0);FakeUnicodeFont._fontDescriptorRef=this.xref.getNewPersistentRef(e)}return FakeUnicodeFont._fontDescriptorRef}get descendantFontRef(){const e=new r.Dict(this.xref);e.set("BaseFont",this.fontName);e.set("Type",r.Name.get("Font"));e.set("Subtype",r.Name.get("CIDFontType0"));e.set("CIDToGIDMap",r.Name.get("Identity"));e.set("FirstChar",this.firstChar);e.set("LastChar",this.lastChar);e.set("FontDescriptor",this.fontDescriptorRef);e.set("DW",1e3);const t=[],a=[...this.widths.entries()].sort();let n=null,i=null;for(const[e,r]of a)if(n)if(e===n+i.length)i.push(r);else{t.push(n,i);n=e;i=[r]}else{n=e;i=[r]}n&&t.push(n,i);e.set("W",t);const s=new r.Dict(this.xref);s.set("Ordering","Identity");s.set("Registry","Adobe");s.set("Supplement",0);e.set("CIDSystemInfo",s);return this.xref.getNewPersistentRef(e)}get baseFontRef(){const e=new r.Dict(this.xref);e.set("BaseFont",this.fontName);e.set("Type",r.Name.get("Font"));e.set("Subtype",r.Name.get("Type0"));e.set("Encoding",r.Name.get("Identity-H"));e.set("DescendantFonts",[this.descendantFontRef]);e.set("ToUnicode",this.toUnicodeRef);return this.xref.getNewPersistentRef(e)}get resources(){const e=new r.Dict(this.xref),t=new r.Dict(this.xref);t.set(this.fontName.name,this.baseFontRef);e.set("Font",t);return e}_createContext(){this.widths=new Map;this.ctxMeasure.font=`1000px ${this.fontFamily}`;return this.ctxMeasure}createFontResources(e){const t=this._createContext();for(const a of e.split(/\r\n?|\n/))for(const e of a.split("")){const a=e.charCodeAt(0);if(this.widths.has(a))continue;const r=t.measureText(e),n=Math.ceil(r.width);this.widths.set(a,n);this.firstChar=Math.min(a,this.firstChar);this.lastChar=Math.max(a,this.lastChar)}return this.resources}createAppearance(e,t,a,s,o,l){const h=this._createContext(),u=[];let d=-1/0;for(const t of e.split(/\r\n?|\n/)){u.push(t);const e=h.measureText(t).width;d=Math.max(d,e);for(const e of t.split("")){const t=e.charCodeAt(0);let a=this.widths.get(t);if(void 0===a){const r=h.measureText(e);a=Math.ceil(r.width);this.widths.set(t,a);this.firstChar=Math.min(t,this.firstChar);this.lastChar=Math.max(t,this.lastChar)}}}d*=s/1e3;const[f,g,p,m]=t;let b=p-f,y=m-g;a%180!=0&&([b,y]=[y,b]);let w=1;d>b&&(w=b/d);let S=1;const x=i.LINE_FACTOR*s,C=i.LINE_DESCENT_FACTOR*s,k=x*u.length;k>y&&(S=y/k);const v=s*Math.min(w,S),F=["q",`0 0 ${(0,n.numberToString)(b)} ${(0,n.numberToString)(y)} re W n`,"BT",`1 0 0 1 0 ${(0,n.numberToString)(y+C)} Tm 0 Tc ${getPdfColor(o,!0)}`,`/${this.fontName.name} ${(0,n.numberToString)(v)} Tf`],{resources:O}=this;if(1!==(l="number"==typeof l&&l>=0&&l<=1?l:1)){F.push("/R0 gs");const e=new r.Dict(this.xref),t=new r.Dict(this.xref);t.set("ca",l);t.set("CA",l);t.set("Type",r.Name.get("ExtGState"));e.set("R0",t);O.set("ExtGState",e)}const T=(0,n.numberToString)(x);for(const e of u)F.push(`0 -${T} Td <${(0,n.stringToUTF16HexString)(e)}> Tj`);F.push("ET","Q");const M=F.join("\n"),E=new r.Dict(this.xref);E.set("Subtype",r.Name.get("Form"));E.set("Type",r.Name.get("XObject"));E.set("BBox",[0,0,b,y]);E.set("Length",M.length);E.set("Resources",O);if(a){const e=(0,n.getRotationMatrix)(a,b,y);E.set("Matrix",e)}const D=new c.StringStream(M);D.dict=E;return D}}t.FakeUnicodeFont=FakeUnicodeFont},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.ColorSpace=void 0;var r=a(2),n=a(4),i=a(5),s=a(3);class ColorSpace{constructor(e,t){this.constructor===ColorSpace&&(0,r.unreachable)("Cannot initialize ColorSpace.");this.name=e;this.numComps=t}getRgb(e,t){const a=new Uint8ClampedArray(3);this.getRgbItem(e,t,a,0);return a}getRgbItem(e,t,a,n){(0,r.unreachable)("Should not call ColorSpace.getRgbItem")}getRgbBuffer(e,t,a,n,i,s,o){(0,r.unreachable)("Should not call ColorSpace.getRgbBuffer")}getOutputLength(e,t){(0,r.unreachable)("Should not call ColorSpace.getOutputLength")}isPassthrough(e){return!1}isDefaultDecode(e,t){return ColorSpace.isDefaultDecode(e,this.numComps)}fillRgb(e,t,a,r,n,i,s,o,c){const l=t*a;let h=null;const u=1<<s,d=a!==n||t!==r;if(this.isPassthrough(s))h=o;else if(1===this.numComps&&l>u&&"DeviceGray"!==this.name&&"DeviceRGB"!==this.name){const t=s<=8?new Uint8Array(u):new Uint16Array(u);for(let e=0;e<u;e++)t[e]=e;const a=new Uint8ClampedArray(3*u);this.getRgbBuffer(t,0,u,a,0,s,0);if(d){h=new Uint8Array(3*l);let e=0;for(let t=0;t<l;++t){const r=3*o[t];h[e++]=a[r];h[e++]=a[r+1];h[e++]=a[r+2]}}else{let t=0;for(let r=0;r<l;++r){const n=3*o[r];e[t++]=a[n];e[t++]=a[n+1];e[t++]=a[n+2];t+=c}}}else if(d){h=new Uint8ClampedArray(3*l);this.getRgbBuffer(o,0,l,h,0,s,0)}else this.getRgbBuffer(o,0,r*i,e,0,s,c);if(h)if(d)!function resizeRgbImage(e,t,a,r,n,i,s){s=1!==s?0:s;const o=a/n,c=r/i;let l,h=0;const u=new Uint16Array(n),d=3*a;for(let e=0;e<n;e++)u[e]=3*Math.floor(e*o);for(let a=0;a<i;a++){const r=Math.floor(a*c)*d;for(let a=0;a<n;a++){l=r+u[a];t[h++]=e[l++];t[h++]=e[l++];t[h++]=e[l++];h+=s}}}(h,e,t,a,r,n,c);else{let t=0,a=0;for(let n=0,s=r*i;n<s;n++){e[t++]=h[a++];e[t++]=h[a++];e[t++]=h[a++];t+=c}}}get usesZeroToOneRange(){return(0,r.shadow)(this,"usesZeroToOneRange",!0)}static _cache(e,t,a,r){if(!a)throw new Error('ColorSpace._cache - expected "localColorSpaceCache" argument.');if(!r)throw new Error('ColorSpace._cache - expected "parsedColorSpace" argument.');let i,s;if(e instanceof n.Ref){s=e;e=t.fetch(e)}e instanceof n.Name&&(i=e.name);(i||s)&&a.set(i,s,r)}static getCached(e,t,a){if(!a)throw new Error('ColorSpace.getCached - expected "localColorSpaceCache" argument.');if(e instanceof n.Ref){const r=a.getByRef(e);if(r)return r;try{e=t.fetch(e)}catch(e){if(e instanceof s.MissingDataException)throw e}}if(e instanceof n.Name){const t=a.getByName(e.name);if(t)return t}return null}static async parseAsync({cs:e,xref:t,resources:a=null,pdfFunctionFactory:r,localColorSpaceCache:n}){const i=this._parse(e,t,a,r);this._cache(e,t,n,i);return i}static parse({cs:e,xref:t,resources:a=null,pdfFunctionFactory:r,localColorSpaceCache:n}){const i=this.getCached(e,t,n);if(i)return i;const s=this._parse(e,t,a,r);this._cache(e,t,n,s);return s}static _parse(e,t,a=null,i){if((e=t.fetchIfRef(e))instanceof n.Name)switch(e.name){case"G":case"DeviceGray":return this.singletons.gray;case"RGB":case"DeviceRGB":return this.singletons.rgb;case"CMYK":case"DeviceCMYK":return this.singletons.cmyk;case"Pattern":return new PatternCS(null);default:if(a instanceof n.Dict){const r=a.get("ColorSpace");if(r instanceof n.Dict){const s=r.get(e.name);if(s){if(s instanceof n.Name)return this._parse(s,t,a,i);e=s;break}}}throw new r.FormatError(`Unrecognized ColorSpace: ${e.name}`)}if(Array.isArray(e)){const n=t.fetchIfRef(e[0]).name;let s,o,u,d,f,g;switch(n){case"G":case"DeviceGray":return this.singletons.gray;case"RGB":case"DeviceRGB":return this.singletons.rgb;case"CMYK":case"DeviceCMYK":return this.singletons.cmyk;case"CalGray":s=t.fetchIfRef(e[1]);d=s.getArray("WhitePoint");f=s.getArray("BlackPoint");g=s.get("Gamma");return new c(d,f,g);case"CalRGB":s=t.fetchIfRef(e[1]);d=s.getArray("WhitePoint");f=s.getArray("BlackPoint");g=s.getArray("Gamma");const p=s.getArray("Matrix");return new l(d,f,g,p);case"ICCBased":const m=t.fetchIfRef(e[1]).dict;o=m.get("N");const b=m.get("Alternate");if(b){const e=this._parse(b,t,a,i);if(e.numComps===o)return e;(0,r.warn)("ICCBased color space: Ignoring incorrect /Alternate entry.")}if(1===o)return this.singletons.gray;if(3===o)return this.singletons.rgb;if(4===o)return this.singletons.cmyk;break;case"Pattern":u=e[1]||null;u&&(u=this._parse(u,t,a,i));return new PatternCS(u);case"I":case"Indexed":u=this._parse(e[1],t,a,i);const y=t.fetchIfRef(e[2])+1,w=t.fetchIfRef(e[3]);return new IndexedCS(u,y,w);case"Separation":case"DeviceN":const S=t.fetchIfRef(e[1]);o=Array.isArray(S)?S.length:1;u=this._parse(e[2],t,a,i);const x=i.create(e[3]);return new AlternateCS(o,u,x);case"Lab":s=t.fetchIfRef(e[1]);d=s.getArray("WhitePoint");f=s.getArray("BlackPoint");const C=s.getArray("Range");return new h(d,f,C);default:throw new r.FormatError(`Unimplemented ColorSpace object: ${n}`)}}throw new r.FormatError(`Unrecognized ColorSpace object: ${e}`)}static isDefaultDecode(e,t){if(!Array.isArray(e))return!0;if(2*t!==e.length){(0,r.warn)("The decode map is not the correct length");return!0}for(let t=0,a=e.length;t<a;t+=2)if(0!==e[t]||1!==e[t+1])return!1;return!0}static get singletons(){return(0,r.shadow)(this,"singletons",{get gray(){return(0,r.shadow)(this,"gray",new DeviceGrayCS)},get rgb(){return(0,r.shadow)(this,"rgb",new DeviceRgbCS)},get cmyk(){return(0,r.shadow)(this,"cmyk",new o)}})}}t.ColorSpace=ColorSpace;class AlternateCS extends ColorSpace{constructor(e,t,a){super("Alternate",e);this.base=t;this.tintFn=a;this.tmpBuf=new Float32Array(t.numComps)}getRgbItem(e,t,a,r){const n=this.tmpBuf;this.tintFn(e,t,n,0);this.base.getRgbItem(n,0,a,r)}getRgbBuffer(e,t,a,r,n,i,s){const o=this.tintFn,c=this.base,l=1/((1<<i)-1),h=c.numComps,u=c.usesZeroToOneRange,d=(c.isPassthrough(8)||!u)&&0===s;let f=d?n:0;const g=d?r:new Uint8ClampedArray(h*a),p=this.numComps,m=new Float32Array(p),b=new Float32Array(h);let y,w;for(y=0;y<a;y++){for(w=0;w<p;w++)m[w]=e[t++]*l;o(m,0,b,0);if(u)for(w=0;w<h;w++)g[f++]=255*b[w];else{c.getRgbItem(b,0,g,f);f+=h}}d||c.getRgbBuffer(g,0,a,r,n,8,s)}getOutputLength(e,t){return this.base.getOutputLength(e*this.base.numComps/this.numComps,t)}}class PatternCS extends ColorSpace{constructor(e){super("Pattern",null);this.base=e}isDefaultDecode(e,t){(0,r.unreachable)("Should not call PatternCS.isDefaultDecode")}}class IndexedCS extends ColorSpace{constructor(e,t,a){super("Indexed",1);this.base=e;this.highVal=t;const n=e.numComps*t;this.lookup=new Uint8Array(n);if(a instanceof i.BaseStream){const e=a.getBytes(n);this.lookup.set(e)}else{if("string"!=typeof a)throw new r.FormatError(`IndexedCS - unrecognized lookup table: ${a}`);for(let e=0;e<n;++e)this.lookup[e]=255&a.charCodeAt(e)}}getRgbItem(e,t,a,r){const n=this.base.numComps,i=e[t]*n;this.base.getRgbBuffer(this.lookup,i,1,a,r,8,0)}getRgbBuffer(e,t,a,r,n,i,s){const o=this.base,c=o.numComps,l=o.getOutputLength(c,s),h=this.lookup;for(let i=0;i<a;++i){const a=e[t++]*c;o.getRgbBuffer(h,a,1,r,n,8,s);n+=l}}getOutputLength(e,t){return this.base.getOutputLength(e*this.base.numComps,t)}isDefaultDecode(e,t){if(!Array.isArray(e))return!0;if(2!==e.length){(0,r.warn)("Decode map length is not correct");return!0}if(!Number.isInteger(t)||t<1){(0,r.warn)("Bits per component is not correct");return!0}return 0===e[0]&&e[1]===(1<<t)-1}}class DeviceGrayCS extends ColorSpace{constructor(){super("DeviceGray",1)}getRgbItem(e,t,a,r){const n=255*e[t];a[r]=a[r+1]=a[r+2]=n}getRgbBuffer(e,t,a,r,n,i,s){const o=255/((1<<i)-1);let c=t,l=n;for(let t=0;t<a;++t){const t=o*e[c++];r[l++]=t;r[l++]=t;r[l++]=t;l+=s}}getOutputLength(e,t){return e*(3+t)}}class DeviceRgbCS extends ColorSpace{constructor(){super("DeviceRGB",3)}getRgbItem(e,t,a,r){a[r]=255*e[t];a[r+1]=255*e[t+1];a[r+2]=255*e[t+2]}getRgbBuffer(e,t,a,r,n,i,s){if(8===i&&0===s){r.set(e.subarray(t,t+3*a),n);return}const o=255/((1<<i)-1);let c=t,l=n;for(let t=0;t<a;++t){r[l++]=o*e[c++];r[l++]=o*e[c++];r[l++]=o*e[c++];l+=s}}getOutputLength(e,t){return e*(3+t)/3|0}isPassthrough(e){return 8===e}}const o=function DeviceCmykCSClosure(){function convertToRgb(e,t,a,r,n){const i=e[t]*a,s=e[t+1]*a,o=e[t+2]*a,c=e[t+3]*a;r[n]=255+i*(-4.387332384609988*i+54.48615194189176*s+18.82290502165302*o+212.25662451639585*c-285.2331026137004)+s*(1.7149763477362134*s-5.6096736904047315*o+-17.873870861415444*c-5.497006427196366)+o*(-2.5217340131683033*o-21.248923337353073*c+17.5119270841813)+c*(-21.86122147463605*c-189.48180835922747);r[n+1]=255+i*(8.841041422036149*i+60.118027045597366*s+6.871425592049007*o+31.159100130055922*c-79.2970844816548)+s*(-15.310361306967817*s+17.575251261109482*o+131.35250912493976*c-190.9453302588951)+o*(4.444339102852739*o+9.8632861493405*c-24.86741582555878)+c*(-20.737325471181034*c-187.80453709719578);r[n+2]=255+i*(.8842522430003296*i+8.078677503112928*s+30.89978309703729*o-.23883238689178934*c-14.183576799673286)+s*(10.49593273432072*s+63.02378494754052*o+50.606957656360734*c-112.23884253719248)+o*(.03296041114873217*o+115.60384449646641*c-193.58209356861505)+c*(-22.33816807309886*c-180.12613974708367)}return class DeviceCmykCS extends ColorSpace{constructor(){super("DeviceCMYK",4)}getRgbItem(e,t,a,r){convertToRgb(e,t,1,a,r)}getRgbBuffer(e,t,a,r,n,i,s){const o=1/((1<<i)-1);for(let i=0;i<a;i++){convertToRgb(e,t,o,r,n);t+=4;n+=3+s}}getOutputLength(e,t){return e/4*(3+t)|0}}}(),c=function CalGrayCSClosure(){function convertToRgb(e,t,a,r,n,i){const s=(t[a]*i)**e.G,o=e.YW*s,c=Math.max(295.8*o**.3333333333333333-40.8,0);r[n]=c;r[n+1]=c;r[n+2]=c}return class CalGrayCS extends ColorSpace{constructor(e,t,a){super("CalGray",1);if(!e)throw new r.FormatError("WhitePoint missing - required for color space CalGray");t=t||[0,0,0];a=a||1;this.XW=e[0];this.YW=e[1];this.ZW=e[2];this.XB=t[0];this.YB=t[1];this.ZB=t[2];this.G=a;if(this.XW<0||this.ZW<0||1!==this.YW)throw new r.FormatError(`Invalid WhitePoint components for ${this.name}, no fallback available`);if(this.XB<0||this.YB<0||this.ZB<0){(0,r.info)(`Invalid BlackPoint for ${this.name}, falling back to default.`);this.XB=this.YB=this.ZB=0}0===this.XB&&0===this.YB&&0===this.ZB||(0,r.warn)(`${this.name}, BlackPoint: XB: ${this.XB}, YB: ${this.YB}, ZB: ${this.ZB}, only default values are supported.`);if(this.G<1){(0,r.info)(`Invalid Gamma: ${this.G} for ${this.name}, falling back to default.`);this.G=1}}getRgbItem(e,t,a,r){convertToRgb(this,e,t,a,r,1)}getRgbBuffer(e,t,a,r,n,i,s){const o=1/((1<<i)-1);for(let i=0;i<a;++i){convertToRgb(this,e,t,r,n,o);t+=1;n+=3+s}}getOutputLength(e,t){return e*(3+t)}}}(),l=function CalRGBCSClosure(){const e=new Float32Array([.8951,.2664,-.1614,-.7502,1.7135,.0367,.0389,-.0685,1.0296]),t=new Float32Array([.9869929,-.1470543,.1599627,.4323053,.5183603,.0492912,-.0085287,.0400428,.9684867]),a=new Float32Array([3.2404542,-1.5371385,-.4985314,-.969266,1.8760108,.041556,.0556434,-.2040259,1.0572252]),n=new Float32Array([1,1,1]),i=new Float32Array(3),s=new Float32Array(3),o=new Float32Array(3),c=(24/116)**3/8;function matrixProduct(e,t,a){a[0]=e[0]*t[0]+e[1]*t[1]+e[2]*t[2];a[1]=e[3]*t[0]+e[4]*t[1]+e[5]*t[2];a[2]=e[6]*t[0]+e[7]*t[1]+e[8]*t[2]}function sRGBTransferFunction(e){return e<=.0031308?adjustToRange(0,1,12.92*e):e>=.99554525?1:adjustToRange(0,1,1.055*e**(1/2.4)-.055)}function adjustToRange(e,t,a){return Math.max(e,Math.min(t,a))}function decodeL(e){return e<0?-decodeL(-e):e>8?((e+16)/116)**3:e*c}function convertToRgb(r,c,l,h,u,d){const f=adjustToRange(0,1,c[l]*d),g=adjustToRange(0,1,c[l+1]*d),p=adjustToRange(0,1,c[l+2]*d),m=1===f?1:f**r.GR,b=1===g?1:g**r.GG,y=1===p?1:p**r.GB,w=r.MXA*m+r.MXB*b+r.MXC*y,S=r.MYA*m+r.MYB*b+r.MYC*y,x=r.MZA*m+r.MZB*b+r.MZC*y,C=s;C[0]=w;C[1]=S;C[2]=x;const k=o;!function normalizeWhitePointToFlat(a,r,n){if(1===a[0]&&1===a[2]){n[0]=r[0];n[1]=r[1];n[2]=r[2];return}const s=n;matrixProduct(e,r,s);const o=i;!function convertToFlat(e,t,a){a[0]=1*t[0]/e[0];a[1]=1*t[1]/e[1];a[2]=1*t[2]/e[2]}(a,s,o);matrixProduct(t,o,n)}(r.whitePoint,C,k);const v=s;!function compensateBlackPoint(e,t,a){if(0===e[0]&&0===e[1]&&0===e[2]){a[0]=t[0];a[1]=t[1];a[2]=t[2];return}const r=decodeL(0),n=(1-r)/(1-decodeL(e[0])),i=1-n,s=(1-r)/(1-decodeL(e[1])),o=1-s,c=(1-r)/(1-decodeL(e[2])),l=1-c;a[0]=t[0]*n+i;a[1]=t[1]*s+o;a[2]=t[2]*c+l}(r.blackPoint,k,v);const F=o;!function normalizeWhitePointToD65(a,r,n){const s=n;matrixProduct(e,r,s);const o=i;!function convertToD65(e,t,a){a[0]=.95047*t[0]/e[0];a[1]=1*t[1]/e[1];a[2]=1.08883*t[2]/e[2]}(a,s,o);matrixProduct(t,o,n)}(n,v,F);const O=s;matrixProduct(a,F,O);h[u]=255*sRGBTransferFunction(O[0]);h[u+1]=255*sRGBTransferFunction(O[1]);h[u+2]=255*sRGBTransferFunction(O[2])}return class CalRGBCS extends ColorSpace{constructor(e,t,a,n){super("CalRGB",3);if(!e)throw new r.FormatError("WhitePoint missing - required for color space CalRGB");t=t||new Float32Array(3);a=a||new Float32Array([1,1,1]);n=n||new Float32Array([1,0,0,0,1,0,0,0,1]);const i=e[0],s=e[1],o=e[2];this.whitePoint=e;const c=t[0],l=t[1],h=t[2];this.blackPoint=t;this.GR=a[0];this.GG=a[1];this.GB=a[2];this.MXA=n[0];this.MYA=n[1];this.MZA=n[2];this.MXB=n[3];this.MYB=n[4];this.MZB=n[5];this.MXC=n[6];this.MYC=n[7];this.MZC=n[8];if(i<0||o<0||1!==s)throw new r.FormatError(`Invalid WhitePoint components for ${this.name}, no fallback available`);if(c<0||l<0||h<0){(0,r.info)(`Invalid BlackPoint for ${this.name} [${c}, ${l}, ${h}], falling back to default.`);this.blackPoint=new Float32Array(3)}if(this.GR<0||this.GG<0||this.GB<0){(0,r.info)(`Invalid Gamma [${this.GR}, ${this.GG}, ${this.GB}] for ${this.name}, falling back to default.`);this.GR=this.GG=this.GB=1}}getRgbItem(e,t,a,r){convertToRgb(this,e,t,a,r,1)}getRgbBuffer(e,t,a,r,n,i,s){const o=1/((1<<i)-1);for(let i=0;i<a;++i){convertToRgb(this,e,t,r,n,o);t+=3;n+=3+s}}getOutputLength(e,t){return e*(3+t)/3|0}}}(),h=function LabCSClosure(){function fn_g(e){let t;t=e>=6/29?e**3:108/841*(e-4/29);return t}function decode(e,t,a,r){return a+e*(r-a)/t}function convertToRgb(e,t,a,r,n,i){let s=t[a],o=t[a+1],c=t[a+2];if(!1!==r){s=decode(s,r,0,100);o=decode(o,r,e.amin,e.amax);c=decode(c,r,e.bmin,e.bmax)}o>e.amax?o=e.amax:o<e.amin&&(o=e.amin);c>e.bmax?c=e.bmax:c<e.bmin&&(c=e.bmin);const l=(s+16)/116,h=l+o/500,u=l-c/200,d=e.XW*fn_g(h),f=e.YW*fn_g(l),g=e.ZW*fn_g(u);let p,m,b;if(e.ZW<1){p=3.1339*d+-1.617*f+-.4906*g;m=-.9785*d+1.916*f+.0333*g;b=.072*d+-.229*f+1.4057*g}else{p=3.2406*d+-1.5372*f+-.4986*g;m=-.9689*d+1.8758*f+.0415*g;b=.0557*d+-.204*f+1.057*g}n[i]=255*Math.sqrt(p);n[i+1]=255*Math.sqrt(m);n[i+2]=255*Math.sqrt(b)}return class LabCS extends ColorSpace{constructor(e,t,a){super("Lab",3);if(!e)throw new r.FormatError("WhitePoint missing - required for color space Lab");t=t||[0,0,0];a=a||[-100,100,-100,100];this.XW=e[0];this.YW=e[1];this.ZW=e[2];this.amin=a[0];this.amax=a[1];this.bmin=a[2];this.bmax=a[3];this.XB=t[0];this.YB=t[1];this.ZB=t[2];if(this.XW<0||this.ZW<0||1!==this.YW)throw new r.FormatError("Invalid WhitePoint components, no fallback available");if(this.XB<0||this.YB<0||this.ZB<0){(0,r.info)("Invalid BlackPoint, falling back to default");this.XB=this.YB=this.ZB=0}if(this.amin>this.amax||this.bmin>this.bmax){(0,r.info)("Invalid Range, falling back to defaults");this.amin=-100;this.amax=100;this.bmin=-100;this.bmax=100}}getRgbItem(e,t,a,r){convertToRgb(this,e,t,!1,a,r)}getRgbBuffer(e,t,a,r,n,i,s){const o=(1<<i)-1;for(let i=0;i<a;i++){convertToRgb(this,e,t,o,r,n);t+=3;n+=3+s}}getOutputLength(e,t){return e*(3+t)/3|0}isDefaultDecode(e,t){return!0}get usesZeroToOneRange(){return(0,r.shadow)(this,"usesZeroToOneRange",!1)}}}()},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.PartialEvaluator=t.EvaluatorPreprocessor=void 0;var r=a(2),n=a(14),i=a(4),s=a(32),o=a(35),c=a(39),l=a(48),h=a(49),u=a(40),d=a(55),f=a(15),g=a(57),p=a(8),m=a(5),b=a(58),y=a(12),w=a(17),S=a(36),x=a(37),C=a(3),k=a(43),v=a(38),F=a(59),O=a(60),T=a(61);const M=Object.freeze({maxImageSize:-1,disableFontFace:!1,ignoreErrors:!1,isEvalSupported:!0,isOffscreenCanvasSupported:!0,fontExtraProperties:!1,useSystemFonts:!0,cMapUrl:null,standardFontDataUrl:null}),E=1,D=2,N=10,R=Promise.resolve();function normalizeBlendMode(e,t=!1){if(Array.isArray(e)){for(const t of e){const e=normalizeBlendMode(t,!0);if(e)return e}(0,r.warn)(`Unsupported blend mode Array: ${e}`);return"source-over"}if(!(e instanceof i.Name))return t?null:"source-over";switch(e.name){case"Normal":case"Compatible":return"source-over";case"Multiply":return"multiply";case"Screen":return"screen";case"Overlay":return"overlay";case"Darken":return"darken";case"Lighten":return"lighten";case"ColorDodge":return"color-dodge";case"ColorBurn":return"color-burn";case"HardLight":return"hard-light";case"SoftLight":return"soft-light";case"Difference":return"difference";case"Exclusion":return"exclusion";case"Hue":return"hue";case"Saturation":return"saturation";case"Color":return"color";case"Luminosity":return"luminosity"}if(t)return null;(0,r.warn)(`Unsupported blend mode: ${e.name}`);return"source-over"}function incrementCachedImageMaskCount(e){e.fn===r.OPS.paintImageMaskXObject&&e.args[0]&&e.args[0].count>0&&e.args[0].count++}class TimeSlotManager{static get TIME_SLOT_DURATION_MS(){return(0,r.shadow)(this,"TIME_SLOT_DURATION_MS",20)}static get CHECK_TIME_EVERY(){return(0,r.shadow)(this,"CHECK_TIME_EVERY",100)}constructor(){this.reset()}check(){if(++this.checked<TimeSlotManager.CHECK_TIME_EVERY)return!1;this.checked=0;return this.endTime<=Date.now()}reset(){this.endTime=Date.now()+TimeSlotManager.TIME_SLOT_DURATION_MS;this.checked=0}}class PartialEvaluator{constructor({xref:e,handler:t,pageIndex:a,idFactory:r,fontCache:n,builtInCMapCache:i,standardFontDataCache:s,globalImageCache:o,options:c=null}){this.xref=e;this.handler=t;this.pageIndex=a;this.idFactory=r;this.fontCache=n;this.builtInCMapCache=i;this.standardFontDataCache=s;this.globalImageCache=o;this.options=c||M;this.parsingType3Font=!1;this._fetchBuiltInCMapBound=this.fetchBuiltInCMap.bind(this)}get _pdfFunctionFactory(){const e=new d.PDFFunctionFactory({xref:this.xref,isEvalSupported:this.options.isEvalSupported});return(0,r.shadow)(this,"_pdfFunctionFactory",e)}clone(e=null){const t=Object.create(this);t.options=Object.assign(Object.create(null),this.options,e);return t}hasBlendModes(e,t){if(!(e instanceof i.Dict))return!1;if(e.objId&&t.has(e.objId))return!1;const a=new i.RefSet(t);e.objId&&a.put(e.objId);const n=[e],s=this.xref;for(;n.length;){const e=n.shift(),t=e.get("ExtGState");if(t instanceof i.Dict)for(let e of t.getRawValues()){if(e instanceof i.Ref){if(a.has(e))continue;try{e=s.fetch(e)}catch(t){a.put(e);(0,r.info)(`hasBlendModes - ignoring ExtGState: "${t}".`);continue}}if(!(e instanceof i.Dict))continue;e.objId&&a.put(e.objId);const t=e.get("BM");if(t instanceof i.Name){if("Normal"!==t.name)return!0}else if(void 0!==t&&Array.isArray(t))for(const e of t)if(e instanceof i.Name&&"Normal"!==e.name)return!0}const o=e.get("XObject");if(o instanceof i.Dict)for(let e of o.getRawValues()){if(e instanceof i.Ref){if(a.has(e))continue;try{e=s.fetch(e)}catch(t){a.put(e);(0,r.info)(`hasBlendModes - ignoring XObject: "${t}".`);continue}}if(!(e instanceof m.BaseStream))continue;e.dict.objId&&a.put(e.dict.objId);const t=e.dict.get("Resources");if(t instanceof i.Dict&&(!t.objId||!a.has(t.objId))){n.push(t);t.objId&&a.put(t.objId)}}}for(const e of a)t.put(e);return!1}async fetchBuiltInCMap(e){const t=this.builtInCMapCache.get(e);if(t)return t;let a;if(null!==this.options.cMapUrl){const t=`${this.options.cMapUrl}${e}.bcmap`,n=await fetch(t);if(!n.ok)throw new Error(`fetchBuiltInCMap: failed to fetch file "${t}" with "${n.statusText}".`);a={cMapData:new Uint8Array(await n.arrayBuffer()),compressionType:r.CMapCompressionType.BINARY}}else a=await this.handler.sendWithPromise("FetchBuiltInCMap",{name:e});a.compressionType!==r.CMapCompressionType.NONE&&this.builtInCMapCache.set(e,a);return a}async fetchStandardFontData(e){const t=this.standardFontDataCache.get(e);if(t)return new p.Stream(t);if(this.options.useSystemFonts&&"Symbol"!==e&&"ZapfDingbats"!==e)return null;const a=(0,c.getFontNameToFileMap)()[e];let n;if(null!==this.options.standardFontDataUrl){const e=`${this.options.standardFontDataUrl}${a}`,t=await fetch(e);t.ok?n=await t.arrayBuffer():(0,r.warn)(`fetchStandardFontData: failed to fetch file "${e}" with "${t.statusText}".`)}else try{n=await this.handler.sendWithPromise("FetchStandardFontData",{filename:a})}catch(e){(0,r.warn)(`fetchStandardFontData: failed to fetch file "${a}" with "${e}".`)}if(!n)return null;this.standardFontDataCache.set(e,n);return new p.Stream(n)}async buildFormXObject(e,t,a,n,s,o,c){const l=t.dict,h=l.getArray("Matrix");let u,d,f=l.getArray("BBox");f=Array.isArray(f)&&4===f.length?r.Util.normalizeRect(f):null;l.has("OC")&&(u=await this.parseMarkedContentProps(l.get("OC"),e));void 0!==u&&n.addOp(r.OPS.beginMarkedContentProps,["OC",u]);const g=l.get("Group");if(g){d={matrix:h,bbox:f,smask:a,isolated:!1,knockout:!1};const t=g.get("S");let s=null;if((0,i.isName)(t,"Transparency")){d.isolated=g.get("I")||!1;d.knockout=g.get("K")||!1;if(g.has("CS")){const t=g.getRaw("CS"),a=y.ColorSpace.getCached(t,this.xref,c);s=a||await this.parseColorSpace({cs:t,resources:e,localColorSpaceCache:c})}}if(a&&a.backdrop){s=s||y.ColorSpace.singletons.rgb;a.backdrop=s.getRgb(a.backdrop,0)}n.addOp(r.OPS.beginGroup,[d])}const p=g?[h,null]:[h,f];n.addOp(r.OPS.paintFormXObjectBegin,p);return this.getOperatorList({stream:t,task:s,resources:l.get("Resources")||e,operatorList:n,initialState:o}).then((function(){n.addOp(r.OPS.paintFormXObjectEnd,[]);g&&n.addOp(r.OPS.endGroup,[d]);void 0!==u&&n.addOp(r.OPS.endMarkedContent,[])}))}_sendImgData(e,t,a=!1){const r=t?[t.bitmap||t.data.buffer]:null;return this.parsingType3Font||a?this.handler.send("commonobj",[e,"Image",t],r):this.handler.send("obj",[e,this.pageIndex,"Image",t],r)}async buildPaintImageXObject({resources:e,image:t,isInline:a=!1,operatorList:n,cacheKey:i,localImageCache:s,localColorSpaceCache:o}){const c=t.dict,l=c.objId,h=c.get("W","Width"),u=c.get("H","Height");if(!h||"number"!=typeof h||!u||"number"!=typeof u){(0,r.warn)("Image dimensions are missing, or not numbers.");return}const d=this.options.maxImageSize;if(-1!==d&&h*u>d){const e="Image exceeded maximum allowed size and was removed.";if(this.options.ignoreErrors){(0,r.warn)(e);return}throw new Error(e)}let f;c.has("OC")&&(f=await this.parseMarkedContentProps(c.get("OC"),e));let g,p;if(c.get("IM","ImageMask")||!1){const e=c.get("I","Interpolate"),a=h+7>>3,o=t.getBytes(a*u),d=c.getArray("D","Decode");if(this.parsingType3Font){g=T.PDFImage.createRawMask({imgArray:o,width:h,height:u,imageIsFromDecodeStream:t instanceof w.DecodeStream,inverseDecode:!!d&&d[0]>0,interpolate:e});g.cached=!!i;p=[g];n.addImageOps(r.OPS.paintImageMaskXObject,p,f);i&&s.set(i,l,{fn:r.OPS.paintImageMaskXObject,args:p,optionalContent:f});return}g=T.PDFImage.createMask({imgArray:o,width:h,height:u,imageIsFromDecodeStream:t instanceof w.DecodeStream,inverseDecode:!!d&&d[0]>0,interpolate:e,isOffscreenCanvasSupported:this.options.isOffscreenCanvasSupported});if(g.isSingleOpaquePixel){n.addImageOps(r.OPS.paintSolidColorImageMask,[],f);i&&s.set(i,l,{fn:r.OPS.paintSolidColorImageMask,args:[],optionalContent:f});return}const m=`mask_${this.idFactory.createObjId()}`;n.addDependency(m);this._sendImgData(m,g);p=[{data:m,width:g.width,height:g.height,interpolate:g.interpolate,count:1}];n.addImageOps(r.OPS.paintImageMaskXObject,p,f);i&&s.set(i,l,{fn:r.OPS.paintImageMaskXObject,args:p,optionalContent:f});return}const m=c.get("SM","SMask")||!1,b=c.get("Mask")||!1;if(a&&!m&&!b&&h+u<200){const i=new T.PDFImage({xref:this.xref,res:e,image:t,isInline:a,pdfFunctionFactory:this._pdfFunctionFactory,localColorSpaceCache:o});g=i.createImageData(!0);n.addImageOps(r.OPS.paintInlineImageXObject,[g],f);return}let y=`img_${this.idFactory.createObjId()}`,S=!1;if(this.parsingType3Font)y=`${this.idFactory.getDocId()}_type3_${y}`;else if(l){S=this.globalImageCache.shouldCache(l,this.pageIndex);S&&(y=`${this.idFactory.getDocId()}_${y}`)}n.addDependency(y);p=[y,h,u];T.PDFImage.buildImage({xref:this.xref,res:e,image:t,isInline:a,pdfFunctionFactory:this._pdfFunctionFactory,localColorSpaceCache:o}).then((e=>{g=e.createImageData(!1);i&&l&&S&&this.globalImageCache.addByteSize(l,g.data.length);return this._sendImgData(y,g,S)})).catch((e=>{(0,r.warn)(`Unable to decode image "${y}": "${e}".`);return this._sendImgData(y,null,S)}));n.addImageOps(r.OPS.paintImageXObject,p,f);if(i){s.set(i,l,{fn:r.OPS.paintImageXObject,args:p,optionalContent:f});if(l){(0,r.assert)(!a,"Cannot cache an inline image globally.");this.globalImageCache.addPageIndex(l,this.pageIndex);S&&this.globalImageCache.setData(l,{objId:y,fn:r.OPS.paintImageXObject,args:p,optionalContent:f,byteSize:0})}}}handleSMask(e,t,a,r,n,i){const s=e.get("G"),o={subtype:e.get("S").name,backdrop:e.get("BC")},c=e.get("TR");if((0,d.isPDFFunction)(c)){const e=this._pdfFunctionFactory.create(c),t=new Uint8Array(256),a=new Float32Array(1);for(let r=0;r<256;r++){a[0]=r/255;e(a,0,a,0);t[r]=255*a[0]|0}o.transferMap=t}return this.buildFormXObject(t,s,o,a,r,n.state.clone(),i)}handleTransferFunction(e){let t;if(Array.isArray(e))t=e;else{if(!(0,d.isPDFFunction)(e))return null;t=[e]}const a=[];let r=0,n=0;for(const e of t){const t=this.xref.fetchIfRef(e);r++;if((0,i.isName)(t,"Identity")){a.push(null);continue}if(!(0,d.isPDFFunction)(t))return null;const s=this._pdfFunctionFactory.create(t),o=new Uint8Array(256),c=new Float32Array(1);for(let e=0;e<256;e++){c[0]=e/255;s(c,0,c,0);o[e]=255*c[0]|0}a.push(o);n++}return 1!==r&&4!==r||0===n?null:a}handleTilingType(e,t,a,n,s,o,c,h){const u=new O.OperatorList,d=i.Dict.merge({xref:this.xref,dictArray:[s.get("Resources"),a]});return this.getOperatorList({stream:n,task:c,resources:d,operatorList:u}).then((function(){const a=u.getIR(),r=(0,l.getTilingPatternIR)(a,s,t);o.addDependencies(u.dependencies);o.addOp(e,r);s.objId&&h.set(null,s.objId,{operatorListIR:a,dict:s})})).catch((e=>{if(!(e instanceof r.AbortException)){if(!this.options.ignoreErrors)throw e;this.handler.send("UnsupportedFeature",{featureId:r.UNSUPPORTED_FEATURES.errorTilingPattern});(0,r.warn)(`handleTilingType - ignoring pattern: "${e}".`)}}))}handleSetFont(e,t,a,n,o,c,l=null,h=null){const u=t&&t[0]instanceof i.Name?t[0].name:null;return this.loadFont(u,a,e,l,h).then((t=>t.font.isType3Font?t.loadType3Data(this,e,o).then((function(){n.addDependencies(t.type3Dependencies);return t})).catch((e=>{this.handler.send("UnsupportedFeature",{featureId:r.UNSUPPORTED_FEATURES.errorFontLoadType3});return new TranslatedFont({loadedName:"g_font_error",font:new s.ErrorFont(`Type3 font load error: ${e}`),dict:t.font,evaluatorOptions:this.options})})):t)).then((e=>{c.font=e.font;e.send(this.handler);return e.loadedName}))}handleText(e,t){const a=t.font,n=a.charsToGlyphs(e);if(a.data){(!!(t.textRenderingMode&r.TextRenderingMode.ADD_TO_PATH_FLAG)||"Pattern"===t.fillColorSpace.name||a.disableFontFace||this.options.disableFontFace)&&PartialEvaluator.buildFontPaths(a,n,this.handler,this.options)}return n}ensureStateFont(e){if(e.font)return;const t=new r.FormatError("Missing setFont (Tf) operator before text rendering operator.");if(!this.options.ignoreErrors)throw t;this.handler.send("UnsupportedFeature",{featureId:r.UNSUPPORTED_FEATURES.errorFontState});(0,r.warn)(`ensureStateFont: "${t}".`)}async setGState({resources:e,gState:t,operatorList:a,cacheKey:n,task:s,stateManager:o,localGStateCache:c,localColorSpaceCache:l}){const h=t.objId;let u=!0;const d=[];let f=Promise.resolve();for(const n of t.getKeys()){const c=t.get(n);switch(n){case"Type":break;case"LW":case"LC":case"LJ":case"ML":case"D":case"RI":case"FL":case"CA":case"ca":d.push([n,c]);break;case"Font":u=!1;f=f.then((()=>this.handleSetFont(e,null,c[0],a,s,o.state).then((function(e){a.addDependency(e);d.push([n,[e,c[1]]])}))));break;case"BM":d.push([n,normalizeBlendMode(c)]);break;case"SMask":if((0,i.isName)(c,"None")){d.push([n,!1]);break}if(c instanceof i.Dict){u=!1;f=f.then((()=>this.handleSMask(c,e,a,s,o,l)));d.push([n,!0])}else(0,r.warn)("Unsupported SMask type");break;case"TR":const t=this.handleTransferFunction(c);d.push([n,t]);break;case"OP":case"op":case"OPM":case"BG":case"BG2":case"UCR":case"UCR2":case"TR2":case"HT":case"SM":case"SA":case"AIS":case"TK":(0,r.info)("graphic state operator "+n);break;default:(0,r.info)("Unknown graphic state operator "+n)}}return f.then((function(){d.length>0&&a.addOp(r.OPS.setGState,[d]);u&&c.set(n,h,d)}))}loadFont(e,t,a,n=null,o=null){const errorFont=async()=>new TranslatedFont({loadedName:"g_font_error",font:new s.ErrorFont(`Font "${e}" is not available.`),dict:t,evaluatorOptions:this.options}),c=this.xref;let l;if(t)t instanceof i.Ref&&(l=t);else{const t=a.get("Font");t&&(l=t.getRaw(e))}if(!l){const a=`Font "${e||t&&t.toString()}" is not available`;if(!this.options.ignoreErrors&&!this.parsingType3Font){(0,r.warn)(`${a}.`);return errorFont()}this.handler.send("UnsupportedFeature",{featureId:r.UNSUPPORTED_FEATURES.errorFontMissing});(0,r.warn)(`${a} -- attempting to fallback to a default font.`);l=n||PartialEvaluator.fallbackFontDict}if(this.parsingType3Font&&this.type3FontRefs.has(l))return errorFont();if(this.fontCache.has(l))return this.fontCache.get(l);if(!((t=c.fetchIfRef(l))instanceof i.Dict))return errorFont();if(t.cacheKey&&this.fontCache.has(t.cacheKey))return this.fontCache.get(t.cacheKey);const h=(0,r.createPromiseCapability)();let u;try{u=this.preEvaluateFont(t);u.cssFontInfo=o}catch(e){(0,r.warn)(`loadFont - preEvaluateFont failed: "${e}".`);return errorFont()}const{descriptor:d,hash:f}=u,g=l instanceof i.Ref;let p;g&&(p=`f${l.toString()}`);if(f&&d instanceof i.Dict){d.fontAliases||(d.fontAliases=Object.create(null));const e=d.fontAliases;if(e[f]){const t=e[f].aliasRef;if(g&&t&&this.fontCache.has(t)){this.fontCache.putAlias(l,t);return this.fontCache.get(l)}}else e[f]={fontID:this.idFactory.createFontId()};g&&(e[f].aliasRef=l);p=e[f].fontID}if(g)this.fontCache.put(l,h.promise);else{p||(p=this.idFactory.createFontId());t.cacheKey=`cacheKey_${p}`;this.fontCache.put(t.cacheKey,h.promise)}(0,r.assert)(p&&p.startsWith("f"),'The "fontID" must be (correctly) defined.');t.loadedName=`${this.idFactory.getDocId()}_${p}`;this.translateFont(u).then((e=>{h.resolve(new TranslatedFont({loadedName:t.loadedName,font:e,dict:t,evaluatorOptions:this.options}))})).catch((e=>{this.handler.send("UnsupportedFeature",{featureId:r.UNSUPPORTED_FEATURES.errorFontTranslate});(0,r.warn)(`loadFont - translateFont failed: "${e}".`);h.resolve(new TranslatedFont({loadedName:t.loadedName,font:new s.ErrorFont(e instanceof Error?e.message:e),dict:t,evaluatorOptions:this.options}))}));return h.promise}buildPath(e,t,a,n=!1){const i=e.length-1;a||(a=[]);if(i<0||e.fnArray[i]!==r.OPS.constructPath){if(n){(0,r.warn)(`Encountered path operator "${t}" inside of a text object.`);e.addOp(r.OPS.save,null)}let i;switch(t){case r.OPS.rectangle:const e=a[0]+a[2],t=a[1]+a[3];i=[Math.min(a[0],e),Math.max(a[0],e),Math.min(a[1],t),Math.max(a[1],t)];break;case r.OPS.moveTo:case r.OPS.lineTo:i=[a[0],a[0],a[1],a[1]];break;default:i=[1/0,-1/0,1/0,-1/0]}e.addOp(r.OPS.constructPath,[[t],a,i]);n&&e.addOp(r.OPS.restore,null)}else{const n=e.argsArray[i];n[0].push(t);n[1].push(...a);const s=n[2];switch(t){case r.OPS.rectangle:const e=a[0]+a[2],t=a[1]+a[3];s[0]=Math.min(s[0],a[0],e);s[1]=Math.max(s[1],a[0],e);s[2]=Math.min(s[2],a[1],t);s[3]=Math.max(s[3],a[1],t);break;case r.OPS.moveTo:case r.OPS.lineTo:s[0]=Math.min(s[0],a[0]);s[1]=Math.max(s[1],a[0]);s[2]=Math.min(s[2],a[1]);s[3]=Math.max(s[3],a[1])}}}parseColorSpace({cs:e,resources:t,localColorSpaceCache:a}){return y.ColorSpace.parseAsync({cs:e,xref:this.xref,resources:t,pdfFunctionFactory:this._pdfFunctionFactory,localColorSpaceCache:a}).catch((e=>{if(e instanceof r.AbortException)return null;if(this.options.ignoreErrors){this.handler.send("UnsupportedFeature",{featureId:r.UNSUPPORTED_FEATURES.errorColorSpace});(0,r.warn)(`parseColorSpace - ignoring ColorSpace: "${e}".`);return null}throw e}))}parseShading({shading:e,resources:t,localColorSpaceCache:a,localShadingPatternCache:r}){let n=r.get(e);if(!n){const i=l.Pattern.parseShading(e,this.xref,t,this.handler,this._pdfFunctionFactory,a).getIR();n=`pattern_${this.idFactory.createObjId()}`;r.set(e,n);this.handler.send("obj",[n,this.pageIndex,"Pattern",i])}return n}handleColorN(e,t,a,n,s,o,c,h,u,d){const f=a.pop();if(f instanceof i.Name){const g=s.getRaw(f.name),p=g instanceof i.Ref&&u.getByRef(g);if(p)try{const r=n.base?n.base.getRgb(a,0):null,i=(0,l.getTilingPatternIR)(p.operatorListIR,p.dict,r);e.addOp(t,i);return}catch(e){}const b=this.xref.fetchIfRef(g);if(b){const i=b instanceof m.BaseStream?b.dict:b,s=i.get("PatternType");if(s===E){const r=n.base?n.base.getRgb(a,0):null;return this.handleTilingType(t,r,o,b,i,e,c,u)}if(s===D){const a=i.get("Shading"),r=i.getArray("Matrix"),n=this.parseShading({shading:a,resources:o,localColorSpaceCache:h,localShadingPatternCache:d});e.addOp(t,["Shading",n,r]);return}throw new r.FormatError(`Unknown PatternType: ${s}`)}}throw new r.FormatError(`Unknown PatternName: ${f}`)}_parseVisibilityExpression(e,t,a){if(++t>10){(0,r.warn)("Visibility expression is too deeply nested");return}const n=e.length,s=this.xref.fetchIfRef(e[0]);if(!(n<2)&&s instanceof i.Name){switch(s.name){case"And":case"Or":case"Not":a.push(s.name);break;default:(0,r.warn)(`Invalid operator ${s.name} in visibility expression`);return}for(let r=1;r<n;r++){const n=e[r],s=this.xref.fetchIfRef(n);if(Array.isArray(s)){const e=[];a.push(e);this._parseVisibilityExpression(s,t,e)}else n instanceof i.Ref&&a.push(n.toString())}}else(0,r.warn)("Invalid visibility expression")}async parseMarkedContentProps(e,t){let a;if(e instanceof i.Name){a=t.get("Properties").get(e.name)}else{if(!(e instanceof i.Dict))throw new r.FormatError("Optional content properties malformed.");a=e}const n=a.get("Type").name;if("OCG"===n)return{type:n,id:a.objId};if("OCMD"===n){const e=a.get("VE");if(Array.isArray(e)){const t=[];this._parseVisibilityExpression(e,0,t);if(t.length>0)return{type:"OCMD",expression:t}}const t=a.get("OCGs");if(Array.isArray(t)||t instanceof i.Dict){const e=[];if(Array.isArray(t))for(const a of t)e.push(a.toString());else e.push(t.objId);return{type:n,ids:e,policy:a.get("P")instanceof i.Name?a.get("P").name:null,expression:null}}if(t instanceof i.Ref)return{type:n,id:t.toString()}}return null}getOperatorList({stream:e,task:t,resources:a,operatorList:n,initialState:s=null,fallbackFontDict:o=null}){a=a||i.Dict.empty;s=s||new EvalState;if(!n)throw new Error('getOperatorList: missing "operatorList" parameter');const c=this,l=this.xref;let h=!1;const u=new g.LocalImageCache,d=new g.LocalColorSpaceCache,f=new g.LocalGStateCache,p=new g.LocalTilingPatternCache,b=new Map,w=a.get("XObject")||i.Dict.empty,S=a.get("Pattern")||i.Dict.empty,x=new StateManager(s),C=new EvaluatorPreprocessor(e,l,x),k=new TimeSlotManager;function closePendingRestoreOPS(e){for(let e=0,t=C.savedStatesDepth;e<t;e++)n.addOp(r.OPS.restore,[])}return new Promise((function promiseBody(e,s){const next=function(t){Promise.all([t,n.ready]).then((function(){try{promiseBody(e,s)}catch(e){s(e)}}),s)};t.ensureNotTerminated();k.reset();const g={};let v,F,O,T,M,E;for(;!(v=k.check());){g.args=null;if(!C.read(g))break;let e=g.args,s=g.fn;switch(0|s){case r.OPS.paintXObject:E=e[0]instanceof i.Name;M=e[0].name;if(E){const t=u.getByName(M);if(t){n.addImageOps(t.fn,t.args,t.optionalContent);incrementCachedImageMaskCount(t);e=null;continue}}next(new Promise((function(e,s){if(!E)throw new r.FormatError("XObject must be referred to by name.");let o=w.getRaw(M);if(o instanceof i.Ref){const t=u.getByRef(o);if(t){n.addImageOps(t.fn,t.args,t.optionalContent);incrementCachedImageMaskCount(t);e();return}const a=c.globalImageCache.getData(o,c.pageIndex);if(a){n.addDependency(a.objId);n.addImageOps(a.fn,a.args,a.optionalContent);e();return}o=l.fetch(o)}if(!(o instanceof m.BaseStream))throw new r.FormatError("XObject should be a stream");const h=o.dict.get("Subtype");if(!(h instanceof i.Name))throw new r.FormatError("XObject should have a Name subtype");if("Form"!==h.name)if("Image"!==h.name){if("PS"!==h.name)throw new r.FormatError(`Unhandled XObject subtype ${h.name}`);(0,r.info)("Ignored XObject subtype PS");e()}else c.buildPaintImageXObject({resources:a,image:o,operatorList:n,cacheKey:M,localImageCache:u,localColorSpaceCache:d}).then(e,s);else{x.save();c.buildFormXObject(a,o,null,n,t,x.state.clone(),d).then((function(){x.restore();e()}),s)}})).catch((function(e){if(!(e instanceof r.AbortException)){if(!c.options.ignoreErrors)throw e;c.handler.send("UnsupportedFeature",{featureId:r.UNSUPPORTED_FEATURES.errorXObject});(0,r.warn)(`getOperatorList - ignoring XObject: "${e}".`)}})));return;case r.OPS.setFont:var D=e[1];next(c.handleSetFont(a,e,null,n,t,x.state,o).then((function(e){n.addDependency(e);n.addOp(r.OPS.setFont,[e,D])})));return;case r.OPS.beginText:h=!0;break;case r.OPS.endText:h=!1;break;case r.OPS.endInlineImage:var N=e[0].cacheKey;if(N){const t=u.getByName(N);if(t){n.addImageOps(t.fn,t.args,t.optionalContent);incrementCachedImageMaskCount(t);e=null;continue}}next(c.buildPaintImageXObject({resources:a,image:e[0],isInline:!0,operatorList:n,cacheKey:N,localImageCache:u,localColorSpaceCache:d}));return;case r.OPS.showText:if(!x.state.font){c.ensureStateFont(x.state);continue}e[0]=c.handleText(e[0],x.state);break;case r.OPS.showSpacedText:if(!x.state.font){c.ensureStateFont(x.state);continue}var L=[],j=x.state;for(const t of e[0])"string"==typeof t?L.push(...c.handleText(t,j)):"number"==typeof t&&L.push(t);e[0]=L;s=r.OPS.showText;break;case r.OPS.nextLineShowText:if(!x.state.font){c.ensureStateFont(x.state);continue}n.addOp(r.OPS.nextLine);e[0]=c.handleText(e[0],x.state);s=r.OPS.showText;break;case r.OPS.nextLineSetSpacingShowText:if(!x.state.font){c.ensureStateFont(x.state);continue}n.addOp(r.OPS.nextLine);n.addOp(r.OPS.setWordSpacing,[e.shift()]);n.addOp(r.OPS.setCharSpacing,[e.shift()]);e[0]=c.handleText(e[0],x.state);s=r.OPS.showText;break;case r.OPS.setTextRenderingMode:x.state.textRenderingMode=e[0];break;case r.OPS.setFillColorSpace:{const t=y.ColorSpace.getCached(e[0],l,d);if(t){x.state.fillColorSpace=t;continue}next(c.parseColorSpace({cs:e[0],resources:a,localColorSpaceCache:d}).then((function(e){e&&(x.state.fillColorSpace=e)})));return}case r.OPS.setStrokeColorSpace:{const t=y.ColorSpace.getCached(e[0],l,d);if(t){x.state.strokeColorSpace=t;continue}next(c.parseColorSpace({cs:e[0],resources:a,localColorSpaceCache:d}).then((function(e){e&&(x.state.strokeColorSpace=e)})));return}case r.OPS.setFillColor:T=x.state.fillColorSpace;e=T.getRgb(e,0);s=r.OPS.setFillRGBColor;break;case r.OPS.setStrokeColor:T=x.state.strokeColorSpace;e=T.getRgb(e,0);s=r.OPS.setStrokeRGBColor;break;case r.OPS.setFillGray:x.state.fillColorSpace=y.ColorSpace.singletons.gray;e=y.ColorSpace.singletons.gray.getRgb(e,0);s=r.OPS.setFillRGBColor;break;case r.OPS.setStrokeGray:x.state.strokeColorSpace=y.ColorSpace.singletons.gray;e=y.ColorSpace.singletons.gray.getRgb(e,0);s=r.OPS.setStrokeRGBColor;break;case r.OPS.setFillCMYKColor:x.state.fillColorSpace=y.ColorSpace.singletons.cmyk;e=y.ColorSpace.singletons.cmyk.getRgb(e,0);s=r.OPS.setFillRGBColor;break;case r.OPS.setStrokeCMYKColor:x.state.strokeColorSpace=y.ColorSpace.singletons.cmyk;e=y.ColorSpace.singletons.cmyk.getRgb(e,0);s=r.OPS.setStrokeRGBColor;break;case r.OPS.setFillRGBColor:x.state.fillColorSpace=y.ColorSpace.singletons.rgb;e=y.ColorSpace.singletons.rgb.getRgb(e,0);break;case r.OPS.setStrokeRGBColor:x.state.strokeColorSpace=y.ColorSpace.singletons.rgb;e=y.ColorSpace.singletons.rgb.getRgb(e,0);break;case r.OPS.setFillColorN:T=x.state.fillColorSpace;if("Pattern"===T.name){next(c.handleColorN(n,r.OPS.setFillColorN,e,T,S,a,t,d,p,b));return}e=T.getRgb(e,0);s=r.OPS.setFillRGBColor;break;case r.OPS.setStrokeColorN:T=x.state.strokeColorSpace;if("Pattern"===T.name){next(c.handleColorN(n,r.OPS.setStrokeColorN,e,T,S,a,t,d,p,b));return}e=T.getRgb(e,0);s=r.OPS.setStrokeRGBColor;break;case r.OPS.shadingFill:var $=a.get("Shading");if(!$)throw new r.FormatError("No shading resource found");var _=$.get(e[0].name);if(!_)throw new r.FormatError("No shading object found");e=[c.parseShading({shading:_,resources:a,localColorSpaceCache:d,localShadingPatternCache:b})];s=r.OPS.shadingFill;break;case r.OPS.setGState:E=e[0]instanceof i.Name;M=e[0].name;if(E){const t=f.getByName(M);if(t){t.length>0&&n.addOp(r.OPS.setGState,[t]);e=null;continue}}next(new Promise((function(e,s){if(!E)throw new r.FormatError("GState must be referred to by name.");const o=a.get("ExtGState");if(!(o instanceof i.Dict))throw new r.FormatError("ExtGState should be a dictionary.");const l=o.get(M);if(!(l instanceof i.Dict))throw new r.FormatError("GState should be a dictionary.");c.setGState({resources:a,gState:l,operatorList:n,cacheKey:M,task:t,stateManager:x,localGStateCache:f,localColorSpaceCache:d}).then(e,s)})).catch((function(e){if(!(e instanceof r.AbortException)){if(!c.options.ignoreErrors)throw e;c.handler.send("UnsupportedFeature",{featureId:r.UNSUPPORTED_FEATURES.errorExtGState});(0,r.warn)(`getOperatorList - ignoring ExtGState: "${e}".`)}})));return;case r.OPS.moveTo:case r.OPS.lineTo:case r.OPS.curveTo:case r.OPS.curveTo2:case r.OPS.curveTo3:case r.OPS.closePath:case r.OPS.rectangle:c.buildPath(n,s,e,h);continue;case r.OPS.markPoint:case r.OPS.markPointProps:case r.OPS.beginCompat:case r.OPS.endCompat:continue;case r.OPS.beginMarkedContentProps:if(!(e[0]instanceof i.Name)){(0,r.warn)(`Expected name for beginMarkedContentProps arg0=${e[0]}`);continue}if("OC"===e[0].name){next(c.parseMarkedContentProps(e[1],a).then((e=>{n.addOp(r.OPS.beginMarkedContentProps,["OC",e])})).catch((e=>{if(!(e instanceof r.AbortException)){if(!c.options.ignoreErrors)throw e;c.handler.send("UnsupportedFeature",{featureId:r.UNSUPPORTED_FEATURES.errorMarkedContent});(0,r.warn)(`getOperatorList - ignoring beginMarkedContentProps: "${e}".`)}})));return}e=[e[0].name,e[1]instanceof i.Dict?e[1].get("MCID"):null];break;case r.OPS.beginMarkedContent:case r.OPS.endMarkedContent:default:if(null!==e){for(F=0,O=e.length;F<O&&!(e[F]instanceof i.Dict);F++);if(F<O){(0,r.warn)("getOperatorList - ignoring operator: "+s);continue}}}n.addOp(s,e)}if(v)next(R);else{closePendingRestoreOPS();e()}})).catch((e=>{if(!(e instanceof r.AbortException)){if(!this.options.ignoreErrors)throw e;this.handler.send("UnsupportedFeature",{featureId:r.UNSUPPORTED_FEATURES.errorOperatorList});(0,r.warn)(`getOperatorList - ignoring errors during "${t.name}" task: "${e}".`);closePendingRestoreOPS()}}))}getTextContent({stream:e,task:t,resources:a,stateManager:n=null,combineTextItems:s=!1,includeMarkedContent:o=!1,sink:c,seenStyles:l=new Set,viewBox:h,markedContentData:u=null}){a=a||i.Dict.empty;n=n||new StateManager(new TextState);o&&(u=u||{level:0});const d={items:[],styles:Object.create(null)},f={initialized:!1,str:[],totalWidth:0,totalHeight:0,width:0,height:0,vertical:!1,prevTransform:null,textAdvanceScale:0,spaceInFlowMin:0,spaceInFlowMax:0,trackingSpaceMin:1/0,negativeSpaceMax:-1/0,notASpace:-1/0,transform:null,fontName:null,hasEOL:!1},p=[" "," "];let y=0;function saveLastChar(e){const t=(y+1)%2,a=" "!==p[y]&&" "===p[t];p[y]=e;y=t;return a}function resetLastChars(){p[0]=p[1]=" ";y=0}const w=.1,S=.03,x=-.2,C=.1,k=.6,v=this,F=this.xref,O=[];let T=null;const M=new g.LocalImageCache,E=new g.LocalGStateCache,D=new EvaluatorPreprocessor(e,F,n);let L;function getCurrentTextTransform(){const e=L.font,t=[L.fontSize*L.textHScale,0,0,L.fontSize,0,L.textRise];if(e.isType3Font&&(L.fontSize<=1||e.isCharBBox)&&!(0,r.isArrayEqual)(L.fontMatrix,r.FONT_IDENTITY_MATRIX)){const a=e.bbox[3]-e.bbox[1];a>0&&(t[3]*=a*L.fontMatrix[3])}return r.Util.transform(L.ctm,r.Util.transform(L.textMatrix,t))}function ensureTextContentItem(){if(f.initialized)return f;const{font:e,loadedName:t}=L;if(!l.has(t)){l.add(t);d.styles[t]={fontFamily:e.fallbackName,ascent:e.ascent,descent:e.descent,vertical:e.vertical}}f.fontName=t;const a=f.transform=getCurrentTextTransform();if(e.vertical){f.width=f.totalWidth=Math.hypot(a[0],a[1]);f.height=f.totalHeight=0;f.vertical=!0}else{f.width=f.totalWidth=0;f.height=f.totalHeight=Math.hypot(a[2],a[3]);f.vertical=!1}const r=Math.hypot(L.textLineMatrix[0],L.textLineMatrix[1]),n=Math.hypot(L.ctm[0],L.ctm[1]);f.textAdvanceScale=n*r;f.trackingSpaceMin=L.fontSize*w;f.notASpace=L.fontSize*S;f.negativeSpaceMax=L.fontSize*x;f.spaceInFlowMin=L.fontSize*C;f.spaceInFlowMax=L.fontSize*k;f.hasEOL=!1;f.initialized=!0;return f}function updateAdvanceScale(){if(!f.initialized)return;const e=Math.hypot(L.textLineMatrix[0],L.textLineMatrix[1]),t=Math.hypot(L.ctm[0],L.ctm[1])*e;if(t!==f.textAdvanceScale){if(f.vertical){f.totalHeight+=f.height*f.textAdvanceScale;f.height=0}else{f.totalWidth+=f.width*f.textAdvanceScale;f.width=0}f.textAdvanceScale=t}}function handleSetFont(e,n){return v.loadFont(e,n,a).then((function(e){return e.font.isType3Font?e.loadType3Data(v,a,t).catch((function(){})).then((function(){return e})):e})).then((function(e){L.loadedName=e.loadedName;L.font=e.font;L.fontMatrix=e.font.fontMatrix||r.FONT_IDENTITY_MATRIX}))}function applyInverseRotation(e,t,a){const r=Math.hypot(a[0],a[1]);return[(a[0]*e+a[1]*t)/r,(a[2]*e+a[3]*t)/r]}function compareWithLastPosition(){const e=getCurrentTextTransform();let t=e[4],a=e[5];const r=t-h[0],n=a-h[1];if(r<0||r>h[2]||n<0||n>h[3])return!1;if(!s||!L.font||!f.prevTransform)return!0;let i=f.prevTransform[4],o=f.prevTransform[5];if(i===t&&o===a)return!0;let c=-1;e[0]&&0===e[1]&&0===e[2]?c=e[0]>0?0:180:e[1]&&0===e[0]&&0===e[3]&&(c=e[1]>0?90:270);switch(c){case 0:break;case 90:[t,a]=[a,t];[i,o]=[o,i];break;case 180:[t,a,i,o]=[-t,-a,-i,-o];break;case 270:[t,a]=[-a,-t];[i,o]=[-o,-i];break;default:[t,a]=applyInverseRotation(t,a,e);[i,o]=applyInverseRotation(i,o,f.prevTransform)}if(L.font.vertical){const e=(o-a)/f.textAdvanceScale,r=t-i,n=Math.sign(f.height);if(e<n*f.negativeSpaceMax){if(Math.abs(r)>.5*f.width){appendEOL();return!0}resetLastChars();flushTextContentItem();return!0}if(Math.abs(r)>f.width){appendEOL();return!0}e<=n*f.notASpace&&resetLastChars();if(e<=n*f.trackingSpaceMin)f.height+=e;else if(!addFakeSpaces(e,f.prevTransform,n))if(0===f.str.length){resetLastChars();d.items.push({str:" ",dir:"ltr",width:0,height:Math.abs(e),transform:f.prevTransform,fontName:f.fontName,hasEOL:!1})}else f.height+=e;return!0}const l=(t-i)/f.textAdvanceScale,u=a-o,g=Math.sign(f.width);if(l<g*f.negativeSpaceMax){if(Math.abs(u)>.5*f.height){appendEOL();return!0}resetLastChars();flushTextContentItem();return!0}if(Math.abs(u)>f.height){appendEOL();return!0}l<=g*f.notASpace&&resetLastChars();if(l<=g*f.trackingSpaceMin)f.width+=l;else if(!addFakeSpaces(l,f.prevTransform,g))if(0===f.str.length){resetLastChars();d.items.push({str:" ",dir:"ltr",width:Math.abs(l),height:0,transform:f.prevTransform,fontName:f.fontName,hasEOL:!1})}else f.width+=l;return!0}function buildTextContentItem({chars:e,extraSpacing:t}){const a=L.font;if(!e){const e=L.charSpacing+t;e&&(a.vertical?L.translateTextMatrix(0,-e):L.translateTextMatrix(e*L.textHScale,0));return}const r=a.charsToGlyphs(e),n=L.fontMatrix[0]*L.fontSize;for(let e=0,i=r.length;e<i;e++){const s=r[e],{category:o}=s;if(o.isInvisibleFormatMark)continue;let c=L.charSpacing+(e+1===i?t:0),l=s.width;a.vertical&&(l=s.vmetric?s.vmetric[0]:-l);let h=l*n;if(o.isWhitespace){if(a.vertical){c+=-h+L.wordSpacing;L.translateTextMatrix(0,-c)}else{c+=h+L.wordSpacing;L.translateTextMatrix(c*L.textHScale,0)}saveLastChar(" ");continue}if(!o.isZeroWidthDiacritic&&!compareWithLastPosition())continue;const u=ensureTextContentItem();o.isZeroWidthDiacritic&&(h=0);if(a.vertical){L.translateTextMatrix(0,h);h=Math.abs(h);u.height+=h}else{h*=L.textHScale;L.translateTextMatrix(h,0);u.width+=h}h&&(u.prevTransform=getCurrentTextTransform());const d=s.normalizedUnicode;saveLastChar(d)&&u.str.push(" ");u.str.push(d);c&&(a.vertical?L.translateTextMatrix(0,-c):L.translateTextMatrix(c*L.textHScale,0))}}function appendEOL(){resetLastChars();if(f.initialized){f.hasEOL=!0;flushTextContentItem()}else d.items.push({str:"",dir:"ltr",width:0,height:0,transform:getCurrentTextTransform(),fontName:L.loadedName,hasEOL:!0})}function addFakeSpaces(e,t,a){if(a*f.spaceInFlowMin<=e&&e<=a*f.spaceInFlowMax){if(f.initialized){resetLastChars();f.str.push(" ")}return!1}const r=f.fontName;let n=0;if(f.vertical){n=e;e=0}flushTextContentItem();resetLastChars();d.items.push({str:" ",dir:"ltr",width:Math.abs(e),height:Math.abs(n),transform:t||getCurrentTextTransform(),fontName:r,hasEOL:!1});return!0}function flushTextContentItem(){if(f.initialized&&f.str){f.vertical?f.totalHeight+=f.height*f.textAdvanceScale:f.totalWidth+=f.width*f.textAdvanceScale;d.items.push(function runBidiTransform(e){const t=e.str.join(""),a=(0,b.bidi)(t,-1,e.vertical);return{str:a.str,dir:a.dir,width:Math.abs(e.totalWidth),height:Math.abs(e.totalHeight),transform:e.transform,fontName:e.fontName,hasEOL:e.hasEOL}}(f));f.initialized=!1;f.str.length=0}}function enqueueChunk(e=!1){const t=d.items.length;if(0!==t&&!(e&&t<N)){c.enqueue(d,t);d.items=[];d.styles=Object.create(null)}}const j=new TimeSlotManager;return new Promise((function promiseBody(e,f){const next=function(t){enqueueChunk(!0);Promise.all([t,c.ready]).then((function(){try{promiseBody(e,f)}catch(e){f(e)}}),f)};t.ensureNotTerminated();j.reset();const g={};let p,b=[];for(;!(p=j.check());){b.length=0;g.args=b;if(!D.read(g))break;L=n.state;const e=g.fn;b=g.args;switch(0|e){case r.OPS.setFont:var y=b[0].name,w=b[1];if(L.font&&y===L.fontName&&w===L.fontSize)break;flushTextContentItem();L.fontName=y;L.fontSize=w;next(handleSetFont(y,null));return;case r.OPS.setTextRise:L.textRise=b[0];break;case r.OPS.setHScale:L.textHScale=b[0]/100;break;case r.OPS.setLeading:L.leading=b[0];break;case r.OPS.moveText:L.translateTextLineMatrix(b[0],b[1]);L.textMatrix=L.textLineMatrix.slice();break;case r.OPS.setLeadingMoveText:L.leading=-b[1];L.translateTextLineMatrix(b[0],b[1]);L.textMatrix=L.textLineMatrix.slice();break;case r.OPS.nextLine:L.carriageReturn();break;case r.OPS.setTextMatrix:L.setTextMatrix(b[0],b[1],b[2],b[3],b[4],b[5]);L.setTextLineMatrix(b[0],b[1],b[2],b[3],b[4],b[5]);updateAdvanceScale();break;case r.OPS.setCharSpacing:L.charSpacing=b[0];break;case r.OPS.setWordSpacing:L.wordSpacing=b[0];break;case r.OPS.beginText:L.textMatrix=r.IDENTITY_MATRIX.slice();L.textLineMatrix=r.IDENTITY_MATRIX.slice();break;case r.OPS.showSpacedText:if(!n.state.font){v.ensureStateFont(n.state);continue}const e=(L.font.vertical?1:-1)*L.fontSize/1e3,f=b[0];for(let t=0,a=f.length;t<a-1;t++){const a=f[t];if("string"==typeof a)O.push(a);else if("number"==typeof a&&0!==a){const t=O.join("");O.length=0;buildTextContentItem({chars:t,extraSpacing:a*e})}}const g=f.at(-1);"string"==typeof g&&O.push(g);if(O.length>0){const e=O.join("");O.length=0;buildTextContentItem({chars:e,extraSpacing:0})}break;case r.OPS.showText:if(!n.state.font){v.ensureStateFont(n.state);continue}buildTextContentItem({chars:b[0],extraSpacing:0});break;case r.OPS.nextLineShowText:if(!n.state.font){v.ensureStateFont(n.state);continue}L.carriageReturn();buildTextContentItem({chars:b[0],extraSpacing:0});break;case r.OPS.nextLineSetSpacingShowText:if(!n.state.font){v.ensureStateFont(n.state);continue}L.wordSpacing=b[0];L.charSpacing=b[1];L.carriageReturn();buildTextContentItem({chars:b[2],extraSpacing:0});break;case r.OPS.paintXObject:flushTextContentItem();T||(T=a.get("XObject")||i.Dict.empty);var S=b[0]instanceof i.Name,x=b[0].name;if(S&&M.getByName(x))break;next(new Promise((function(e,d){if(!S)throw new r.FormatError("XObject must be referred to by name.");let f=T.getRaw(x);if(f instanceof i.Ref){if(M.getByRef(f)){e();return}if(v.globalImageCache.getData(f,v.pageIndex)){e();return}f=F.fetch(f)}if(!(f instanceof m.BaseStream))throw new r.FormatError("XObject should be a stream");const g=f.dict.get("Subtype");if(!(g instanceof i.Name))throw new r.FormatError("XObject should have a Name subtype");if("Form"!==g.name){M.set(x,f.dict.objId,!0);e();return}const p=n.state.clone(),b=new StateManager(p),y=f.dict.getArray("Matrix");Array.isArray(y)&&6===y.length&&b.transform(y);enqueueChunk();const w={enqueueInvoked:!1,enqueue(e,t){this.enqueueInvoked=!0;c.enqueue(e,t)},get desiredSize(){return c.desiredSize},get ready(){return c.ready}};v.getTextContent({stream:f,task:t,resources:f.dict.get("Resources")||a,stateManager:b,combineTextItems:s,includeMarkedContent:o,sink:w,seenStyles:l,viewBox:h,markedContentData:u}).then((function(){w.enqueueInvoked||M.set(x,f.dict.objId,!0);e()}),d)})).catch((function(e){if(!(e instanceof r.AbortException)){if(!v.options.ignoreErrors)throw e;(0,r.warn)(`getTextContent - ignoring XObject: "${e}".`)}})));return;case r.OPS.setGState:S=b[0]instanceof i.Name;x=b[0].name;if(S&&E.getByName(x))break;next(new Promise((function(e,t){if(!S)throw new r.FormatError("GState must be referred to by name.");const n=a.get("ExtGState");if(!(n instanceof i.Dict))throw new r.FormatError("ExtGState should be a dictionary.");const s=n.get(x);if(!(s instanceof i.Dict))throw new r.FormatError("GState should be a dictionary.");const o=s.get("Font");if(o){flushTextContentItem();L.fontName=null;L.fontSize=o[1];handleSetFont(null,o[0]).then(e,t)}else{E.set(x,s.objId,!0);e()}})).catch((function(e){if(!(e instanceof r.AbortException)){if(!v.options.ignoreErrors)throw e;(0,r.warn)(`getTextContent - ignoring ExtGState: "${e}".`)}})));return;case r.OPS.beginMarkedContent:flushTextContentItem();if(o){u.level++;d.items.push({type:"beginMarkedContent",tag:b[0]instanceof i.Name?b[0].name:null})}break;case r.OPS.beginMarkedContentProps:flushTextContentItem();if(o){u.level++;let e=null;b[1]instanceof i.Dict&&(e=b[1].get("MCID"));d.items.push({type:"beginMarkedContentProps",id:Number.isInteger(e)?`${v.idFactory.getPageObjId()}_mcid${e}`:null,tag:b[0]instanceof i.Name?b[0].name:null})}break;case r.OPS.endMarkedContent:flushTextContentItem();if(o){if(0===u.level)break;u.level--;d.items.push({type:"endMarkedContent"})}}if(d.items.length>=c.desiredSize){p=!0;break}}if(p)next(R);else{flushTextContentItem();enqueueChunk();e()}})).catch((e=>{if(!(e instanceof r.AbortException)){if(!this.options.ignoreErrors)throw e;(0,r.warn)(`getTextContent - ignoring errors during "${t.name}" task: "${e}".`);flushTextContentItem();enqueueChunk()}}))}extractDataStructures(e,t,a){const n=this.xref;let s;const c=this.readToUnicode(a.toUnicode||e.get("ToUnicode")||t.get("ToUnicode"));if(a.composite){const t=e.get("CIDSystemInfo");t instanceof i.Dict&&(a.cidSystemInfo={registry:(0,r.stringToPDFString)(t.get("Registry")),ordering:(0,r.stringToPDFString)(t.get("Ordering")),supplement:t.get("Supplement")});try{const t=e.get("CIDToGIDMap");t instanceof m.BaseStream&&(s=t.getBytes())}catch(e){if(!this.options.ignoreErrors)throw e;(0,r.warn)(`extractDataStructures - ignoring CIDToGIDMap data: "${e}".`)}}const l=[];let h,u=null;if(e.has("Encoding")){h=e.get("Encoding");if(h instanceof i.Dict){u=h.get("BaseEncoding");u=u instanceof i.Name?u.name:null;if(h.has("Differences")){const e=h.get("Differences");let t=0;for(const a of e){const e=n.fetchIfRef(a);if("number"==typeof e)t=e;else{if(!(e instanceof i.Name))throw new r.FormatError(`Invalid entry in 'Differences' array: ${e}`);l[t++]=e.name}}}}else if(h instanceof i.Name)u=h.name;else{const e="Encoding is not a Name nor a Dict";if(!this.options.ignoreErrors)throw new r.FormatError(e);(0,r.warn)(e)}"MacRomanEncoding"!==u&&"MacExpertEncoding"!==u&&"WinAnsiEncoding"!==u&&(u=null)}if(u)a.defaultEncoding=(0,o.getEncoding)(u);else{const e=!!(a.flags&S.FontFlags.Symbolic),t=!!(a.flags&S.FontFlags.Nonsymbolic);h=o.StandardEncoding;"TrueType"!==a.type||t||(h=o.WinAnsiEncoding);if(e){h=o.MacRomanEncoding;a.file&&!a.isInternalFont||(/Symbol/i.test(a.name)?h=o.SymbolSetEncoding:/Dingbats|Wingdings/i.test(a.name)&&(h=o.ZapfDingbatsEncoding))}a.defaultEncoding=h}a.differences=l;a.baseEncodingName=u;a.hasEncoding=!!u||l.length>0;a.dict=e;return c.then((e=>{a.toUnicode=e;return this.buildToUnicode(a)})).then((e=>{a.toUnicode=e;s&&(a.cidToGidMap=this.readCidToGidMap(s,e));return a}))}_simpleFontToUnicode(e,t=!1){(0,r.assert)(!e.composite,"Must be a simple font.");const a=[],n=e.defaultEncoding.slice(),i=e.baseEncodingName,s=e.differences;for(const e in s){const t=s[e];".notdef"!==t&&(n[e]=t)}const c=(0,x.getGlyphsUnicode)();for(const r in n){let s=n[r];if(""===s)continue;let l=c[s];if(void 0!==l){a[r]=String.fromCharCode(l);continue}let h=0;switch(s[0]){case"G":3===s.length&&(h=parseInt(s.substring(1),16));break;case"g":5===s.length&&(h=parseInt(s.substring(1),16));break;case"C":case"c":if(s.length>=3&&s.length<=4){const a=s.substring(1);if(t){h=parseInt(a,16);break}h=+a;if(Number.isNaN(h)&&Number.isInteger(parseInt(a,16)))return this._simpleFontToUnicode(e,!0)}break;case"u":l=(0,v.getUnicodeForGlyph)(s,c);-1!==l&&(h=l)}if(h>0&&h<=1114111&&Number.isInteger(h)){if(i&&h===+r){const e=(0,o.getEncoding)(i);if(e&&(s=e[r])){a[r]=String.fromCharCode(c[s]);continue}}a[r]=String.fromCodePoint(h)}}return a}async buildToUnicode(e){e.hasIncludedToUnicodeMap=!!e.toUnicode&&e.toUnicode.length>0;if(e.hasIncludedToUnicodeMap){!e.composite&&e.hasEncoding&&(e.fallbackToUnicode=this._simpleFontToUnicode(e));return e.toUnicode}if(!e.composite)return new u.ToUnicodeMap(this._simpleFontToUnicode(e));if(e.composite&&(e.cMap.builtInCMap&&!(e.cMap instanceof n.IdentityCMap)||"Adobe"===e.cidSystemInfo.registry&&("GB1"===e.cidSystemInfo.ordering||"CNS1"===e.cidSystemInfo.ordering||"Japan1"===e.cidSystemInfo.ordering||"Korea1"===e.cidSystemInfo.ordering))){const{registry:t,ordering:a}=e.cidSystemInfo,s=i.Name.get(`${t}-${a}-UCS2`),o=await n.CMapFactory.create({encoding:s,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null}),c=[];e.cMap.forEach((function(e,t){if(t>65535)throw new r.FormatError("Max size of CID is 65,535");const a=o.lookup(t);a&&(c[e]=String.fromCharCode((a.charCodeAt(0)<<8)+a.charCodeAt(1)))}));return new u.ToUnicodeMap(c)}return new u.IdentityToUnicodeMap(e.firstChar,e.lastChar)}readToUnicode(e){return e?e instanceof i.Name?n.CMapFactory.create({encoding:e,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null}).then((function(e){return e instanceof n.IdentityCMap?new u.IdentityToUnicodeMap(0,65535):new u.ToUnicodeMap(e.getMap())})):e instanceof m.BaseStream?n.CMapFactory.create({encoding:e,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null}).then((function(e){if(e instanceof n.IdentityCMap)return new u.IdentityToUnicodeMap(0,65535);const t=new Array(e.length);e.forEach((function(e,a){if("number"==typeof a){t[e]=String.fromCodePoint(a);return}const r=[];for(let e=0;e<a.length;e+=2){const t=a.charCodeAt(e)<<8|a.charCodeAt(e+1);if(55296!=(63488&t)){r.push(t);continue}e+=2;const n=a.charCodeAt(e)<<8|a.charCodeAt(e+1);r.push(((1023&t)<<10)+(1023&n)+65536)}t[e]=String.fromCodePoint(...r)}));return new u.ToUnicodeMap(t)}),(e=>{if(e instanceof r.AbortException)return null;if(this.options.ignoreErrors){this.handler.send("UnsupportedFeature",{featureId:r.UNSUPPORTED_FEATURES.errorFontToUnicode});(0,r.warn)(`readToUnicode - ignoring ToUnicode data: "${e}".`);return null}throw e})):Promise.resolve(null):Promise.resolve(null)}readCidToGidMap(e,t){const a=[];for(let r=0,n=e.length;r<n;r++){const n=e[r++]<<8|e[r],i=r>>1;(0!==n||t.has(i))&&(a[i]=n)}return a}extractWidths(e,t,a){const r=this.xref;let n=[],s=0;const o=[];let c,l,h,u,d,f,g,p;if(a.composite){s=e.has("DW")?e.get("DW"):1e3;p=e.get("W");if(p)for(l=0,h=p.length;l<h;l++){f=r.fetchIfRef(p[l++]);g=r.fetchIfRef(p[l]);if(Array.isArray(g))for(u=0,d=g.length;u<d;u++)n[f++]=r.fetchIfRef(g[u]);else{const e=r.fetchIfRef(p[++l]);for(u=f;u<=g;u++)n[u]=e}}if(a.vertical){let t=e.getArray("DW2")||[880,-1e3];c=[t[1],.5*s,t[0]];t=e.get("W2");if(t)for(l=0,h=t.length;l<h;l++){f=r.fetchIfRef(t[l++]);g=r.fetchIfRef(t[l]);if(Array.isArray(g))for(u=0,d=g.length;u<d;u++)o[f++]=[r.fetchIfRef(g[u++]),r.fetchIfRef(g[u++]),r.fetchIfRef(g[u])];else{const e=[r.fetchIfRef(t[++l]),r.fetchIfRef(t[++l]),r.fetchIfRef(t[++l])];for(u=f;u<=g;u++)o[u]=e}}}}else{const o=a.firstChar;p=e.get("Widths");if(p){u=o;for(l=0,h=p.length;l<h;l++)n[u++]=r.fetchIfRef(p[l]);s=parseFloat(t.get("MissingWidth"))||0}else{const t=e.get("BaseFont");if(t instanceof i.Name){const e=this.getBaseFontMetrics(t.name);n=this.buildCharCodeToWidth(e.widths,a);s=e.defaultWidth}}}let m=!0,b=s;for(const e in n){const t=n[e];if(t)if(b){if(b!==t){m=!1;break}}else b=t}m&&(a.flags|=S.FontFlags.FixedPitch);a.defaultWidth=s;a.widths=n;a.defaultVMetrics=c;a.vmetrics=o}isSerifFont(e){const t=e.split("-")[0];return t in(0,c.getSerifFonts)()||/serif/gi.test(t)}getBaseFontMetrics(e){let t=0,a=Object.create(null),r=!1;let n=(0,c.getStdFontMap)()[e]||e;const i=(0,k.getMetrics)();n in i||(n=this.isSerifFont(e)?"Times-Roman":"Helvetica");const s=i[n];if("number"==typeof s){t=s;r=!0}else a=s();return{defaultWidth:t,monospace:r,widths:a}}buildCharCodeToWidth(e,t){const a=Object.create(null),r=t.differences,n=t.defaultEncoding;for(let t=0;t<256;t++)t in r&&e[r[t]]?a[t]=e[r[t]]:t in n&&e[n[t]]&&(a[t]=e[n[t]]);return a}preEvaluateFont(e){const t=e;let a=e.get("Subtype");if(!(a instanceof i.Name))throw new r.FormatError("invalid font Subtype");let n,s,o=!1;if("Type0"===a.name){const t=e.get("DescendantFonts");if(!t)throw new r.FormatError("Descendant fonts are not specified");if(!((e=Array.isArray(t)?this.xref.fetchIfRef(t[0]):t)instanceof i.Dict))throw new r.FormatError("Descendant font is not a dictionary.");a=e.get("Subtype");if(!(a instanceof i.Name))throw new r.FormatError("invalid font Subtype");o=!0}const c=e.get("FirstChar")||0,l=e.get("LastChar")||(o?65535:255),h=e.get("FontDescriptor");if(h){n=new F.MurmurHash3_64;const a=t.getRaw("Encoding");if(a instanceof i.Name)n.update(a.name);else if(a instanceof i.Ref)n.update(a.toString());else if(a instanceof i.Dict)for(const e of a.getRawValues())if(e instanceof i.Name)n.update(e.name);else if(e instanceof i.Ref)n.update(e.toString());else if(Array.isArray(e)){const t=e.length,a=new Array(t);for(let r=0;r<t;r++){const t=e[r];t instanceof i.Name?a[r]=t.name:("number"==typeof t||t instanceof i.Ref)&&(a[r]=t.toString())}n.update(a.join())}n.update(`${c}-${l}`);s=e.get("ToUnicode")||t.get("ToUnicode");if(s instanceof m.BaseStream){const e=s.str||s,t=e.buffer?new Uint8Array(e.buffer.buffer,0,e.bufferLength):new Uint8Array(e.bytes.buffer,e.start,e.end-e.start);n.update(t)}else s instanceof i.Name&&n.update(s.name);const r=e.get("Widths")||t.get("Widths");if(Array.isArray(r)){const e=[];for(const t of r)("number"==typeof t||t instanceof i.Ref)&&e.push(t.toString());n.update(e.join())}if(o){n.update("compositeFont");const a=e.get("W")||t.get("W");if(Array.isArray(a)){const e=[];for(const t of a)if("number"==typeof t||t instanceof i.Ref)e.push(t.toString());else if(Array.isArray(t)){const a=[];for(const e of t)("number"==typeof e||e instanceof i.Ref)&&a.push(e.toString());e.push(`[${a.join()}]`)}n.update(e.join())}const r=e.getRaw("CIDToGIDMap")||t.getRaw("CIDToGIDMap");r instanceof i.Name?n.update(r.name):r instanceof i.Ref?n.update(r.toString()):r instanceof m.BaseStream&&n.update(r.peekBytes())}}return{descriptor:h,dict:e,baseDict:t,composite:o,type:a.name,firstChar:c,lastChar:l,toUnicode:s,hash:n?n.hexdigest():""}}async translateFont({descriptor:e,dict:t,baseDict:a,composite:o,type:l,firstChar:u,lastChar:d,toUnicode:f,cssFontInfo:g}){const m="Type3"===l;let b;if(!e){if(!m){let e=t.get("BaseFont");if(!(e instanceof i.Name))throw new r.FormatError("Base font is not specified");e=e.name.replace(/[,_]/g,"-");const n=this.getBaseFontMetrics(e),o=e.split("-")[0],h=(this.isSerifFont(o)?S.FontFlags.Serif:0)|(n.monospace?S.FontFlags.FixedPitch:0)|((0,c.getSymbolsFonts)()[o]?S.FontFlags.Symbolic:S.FontFlags.Nonsymbolic);b={type:l,name:e,loadedName:a.loadedName,widths:n.widths,defaultWidth:n.defaultWidth,isSimulatedFlags:!0,flags:h,firstChar:u,lastChar:d,toUnicode:f,xHeight:0,capHeight:0,italicAngle:0,isType3Font:m};const g=t.get("Widths"),p=(0,c.getStandardFontName)(e);let y=null;if(p){b.isStandardFont=!0;y=await this.fetchStandardFontData(p);b.isInternalFont=!!y}return this.extractDataStructures(t,t,b).then((t=>{if(g){const e=[];let a=u;for(const t of g)e[a++]=this.xref.fetchIfRef(t);t.widths=e}else t.widths=this.buildCharCodeToWidth(n.widths,t);return new s.Font(e,y,t)}))}(e=new i.Dict(null)).set("FontName",i.Name.get(l));e.set("FontBBox",t.getArray("FontBBox")||[0,0,0,0])}let y,w,x,C,k,v=e.get("FontName"),F=t.get("BaseFont");"string"==typeof v&&(v=i.Name.get(v));"string"==typeof F&&(F=i.Name.get(F));if(!m){const e=v&&v.name,t=F&&F.name;if(e!==t){(0,r.info)(`The FontDescriptor's FontName is "${e}" but should be the same as the Font's BaseFont "${t}".`);e&&t&&t.startsWith(e)&&(v=F)}}v=v||F;if(!(v instanceof i.Name))throw new r.FormatError("invalid font name");try{y=e.get("FontFile","FontFile2","FontFile3")}catch(e){if(!this.options.ignoreErrors)throw e;(0,r.warn)(`translateFont - fetching "${v.name}" font file: "${e}".`);y=new p.NullStream}let O=!1,T=!1,M=null;if(y){if(y.dict){const e=y.dict.get("Subtype");e instanceof i.Name&&(w=e.name);x=y.dict.get("Length1");C=y.dict.get("Length2");k=y.dict.get("Length3")}}else if(g){const e=(0,h.getXfaFontName)(v.name);if(e){g.fontFamily=`${g.fontFamily}-PdfJS-XFA`;g.metrics=e.metrics||null;M=e.factors||null;y=await this.fetchStandardFontData(e.name);T=!!y;a=t=(0,h.getXfaFontDict)(v.name);o=!0}}else if(!m){const e=(0,c.getStandardFontName)(v.name);if(e){O=!0;y=await this.fetchStandardFontData(e);T=!!y}}b={type:l,name:v.name,subtype:w,file:y,length1:x,length2:C,length3:k,isStandardFont:O,isInternalFont:T,loadedName:a.loadedName,composite:o,fixedPitch:!1,fontMatrix:t.getArray("FontMatrix")||r.FONT_IDENTITY_MATRIX,firstChar:u,lastChar:d,toUnicode:f,bbox:e.getArray("FontBBox")||t.getArray("FontBBox"),ascent:e.get("Ascent"),descent:e.get("Descent"),xHeight:e.get("XHeight")||0,capHeight:e.get("CapHeight")||0,flags:e.get("Flags"),italicAngle:e.get("ItalicAngle")||0,isType3Font:m,cssFontInfo:g,scaleFactors:M};if(o){const e=a.get("Encoding");e instanceof i.Name&&(b.cidEncoding=e.name);const t=await n.CMapFactory.create({encoding:e,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null});b.cMap=t;b.vertical=b.cMap.vertical}return this.extractDataStructures(t,a,b).then((a=>{this.extractWidths(t,e,a);return new s.Font(v.name,y,a)}))}static buildFontPaths(e,t,a,n){function buildPath(t){const i=`${e.loadedName}_path_${t}`;try{if(e.renderer.hasBuiltPath(t))return;a.send("commonobj",[i,"FontPath",e.renderer.getPathJs(t)])}catch(e){if(n.ignoreErrors){a.send("UnsupportedFeature",{featureId:r.UNSUPPORTED_FEATURES.errorFontBuildPath});(0,r.warn)(`buildFontPaths - ignoring ${i} glyph: "${e}".`);return}throw e}}for(const e of t){buildPath(e.fontChar);const t=e.accent;t&&t.fontChar&&buildPath(t.fontChar)}}static get fallbackFontDict(){const e=new i.Dict;e.set("BaseFont",i.Name.get("PDFJS-FallbackFont"));e.set("Type",i.Name.get("FallbackType"));e.set("Subtype",i.Name.get("FallbackType"));e.set("Encoding",i.Name.get("WinAnsiEncoding"));return(0,r.shadow)(this,"fallbackFontDict",e)}}t.PartialEvaluator=PartialEvaluator;class TranslatedFont{constructor({loadedName:e,font:t,dict:a,evaluatorOptions:r}){this.loadedName=e;this.font=t;this.dict=a;this._evaluatorOptions=r||M;this.type3Loaded=null;this.type3Dependencies=t.isType3Font?new Set:null;this.sent=!1}send(e){if(!this.sent){this.sent=!0;e.send("commonobj",[this.loadedName,"Font",this.font.exportData(this._evaluatorOptions.fontExtraProperties)])}}fallback(e){if(this.font.data){this.font.disableFontFace=!0;PartialEvaluator.buildFontPaths(this.font,this.font.glyphCacheValues,e,this._evaluatorOptions)}}loadType3Data(e,t,a){if(this.type3Loaded)return this.type3Loaded;if(!this.font.isType3Font)throw new Error("Must be a Type3 font.");const n=e.clone({ignoreErrors:!1});n.parsingType3Font=!0;const s=new i.RefSet(e.type3FontRefs);this.dict.objId&&!s.has(this.dict.objId)&&s.put(this.dict.objId);n.type3FontRefs=s;const o=this.font,c=this.type3Dependencies;let l=Promise.resolve();const h=this.dict.get("CharProcs"),u=this.dict.get("Resources")||t,d=Object.create(null),f=r.Util.normalizeRect(o.bbox||[0,0,0,0]),g=f[2]-f[0],p=f[3]-f[1],m=Math.hypot(g,p);for(const e of h.getKeys())l=l.then((()=>{const t=h.get(e),i=new O.OperatorList;return n.getOperatorList({stream:t,task:a,resources:u,operatorList:i}).then((()=>{i.fnArray[0]===r.OPS.setCharWidthAndBounds&&this._removeType3ColorOperators(i,m);d[e]=i.getIR();for(const e of i.dependencies)c.add(e)})).catch((function(t){(0,r.warn)(`Type3 font resource "${e}" is not available.`);const a=new O.OperatorList;d[e]=a.getIR()}))}));this.type3Loaded=l.then((()=>{o.charProcOperatorList=d;if(this._bbox){o.isCharBBox=!0;o.bbox=this._bbox}}));return this.type3Loaded}_removeType3ColorOperators(e,t=NaN){const a=r.Util.normalizeRect(e.argsArray[0].slice(2)),n=a[2]-a[0],i=a[3]-a[1],s=Math.hypot(n,i);if(0===n||0===i){e.fnArray.splice(0,1);e.argsArray.splice(0,1)}else if(0===t||Math.round(s/t)>=10){this._bbox||(this._bbox=[1/0,1/0,-1/0,-1/0]);this._bbox[0]=Math.min(this._bbox[0],a[0]);this._bbox[1]=Math.min(this._bbox[1],a[1]);this._bbox[2]=Math.max(this._bbox[2],a[2]);this._bbox[3]=Math.max(this._bbox[3],a[3])}let o=0,c=e.length;for(;o<c;){switch(e.fnArray[o]){case r.OPS.setCharWidthAndBounds:break;case r.OPS.setStrokeColorSpace:case r.OPS.setFillColorSpace:case r.OPS.setStrokeColor:case r.OPS.setStrokeColorN:case r.OPS.setFillColor:case r.OPS.setFillColorN:case r.OPS.setStrokeGray:case r.OPS.setFillGray:case r.OPS.setStrokeRGBColor:case r.OPS.setFillRGBColor:case r.OPS.setStrokeCMYKColor:case r.OPS.setFillCMYKColor:case r.OPS.shadingFill:case r.OPS.setRenderingIntent:e.fnArray.splice(o,1);e.argsArray.splice(o,1);c--;continue;case r.OPS.setGState:const[t]=e.argsArray[o];let a=0,n=t.length;for(;a<n;){const[e]=t[a];switch(e){case"TR":case"TR2":case"HT":case"BG":case"BG2":case"UCR":case"UCR2":t.splice(a,1);n--;continue}a++}}o++}}}class StateManager{constructor(e=new EvalState){this.state=e;this.stateStack=[]}save(){const e=this.state;this.stateStack.push(this.state);this.state=e.clone()}restore(){const e=this.stateStack.pop();e&&(this.state=e)}transform(e){this.state.ctm=r.Util.transform(this.state.ctm,e)}}class TextState{constructor(){this.ctm=new Float32Array(r.IDENTITY_MATRIX);this.fontName=null;this.fontSize=0;this.loadedName=null;this.font=null;this.fontMatrix=r.FONT_IDENTITY_MATRIX;this.textMatrix=r.IDENTITY_MATRIX.slice();this.textLineMatrix=r.IDENTITY_MATRIX.slice();this.charSpacing=0;this.wordSpacing=0;this.leading=0;this.textHScale=1;this.textRise=0}setTextMatrix(e,t,a,r,n,i){const s=this.textMatrix;s[0]=e;s[1]=t;s[2]=a;s[3]=r;s[4]=n;s[5]=i}setTextLineMatrix(e,t,a,r,n,i){const s=this.textLineMatrix;s[0]=e;s[1]=t;s[2]=a;s[3]=r;s[4]=n;s[5]=i}translateTextMatrix(e,t){const a=this.textMatrix;a[4]=a[0]*e+a[2]*t+a[4];a[5]=a[1]*e+a[3]*t+a[5]}translateTextLineMatrix(e,t){const a=this.textLineMatrix;a[4]=a[0]*e+a[2]*t+a[4];a[5]=a[1]*e+a[3]*t+a[5]}carriageReturn(){this.translateTextLineMatrix(0,-this.leading);this.textMatrix=this.textLineMatrix.slice()}clone(){const e=Object.create(this);e.textMatrix=this.textMatrix.slice();e.textLineMatrix=this.textLineMatrix.slice();e.fontMatrix=this.fontMatrix.slice();return e}}class EvalState{constructor(){this.ctm=new Float32Array(r.IDENTITY_MATRIX);this.font=null;this.textRenderingMode=r.TextRenderingMode.FILL;this.fillColorSpace=y.ColorSpace.singletons.gray;this.strokeColorSpace=y.ColorSpace.singletons.gray}clone(){return Object.create(this)}}class EvaluatorPreprocessor{static get opMap(){const e=(0,C.getLookupTableFactory)((function(e){e.w={id:r.OPS.setLineWidth,numArgs:1,variableArgs:!1};e.J={id:r.OPS.setLineCap,numArgs:1,variableArgs:!1};e.j={id:r.OPS.setLineJoin,numArgs:1,variableArgs:!1};e.M={id:r.OPS.setMiterLimit,numArgs:1,variableArgs:!1};e.d={id:r.OPS.setDash,numArgs:2,variableArgs:!1};e.ri={id:r.OPS.setRenderingIntent,numArgs:1,variableArgs:!1};e.i={id:r.OPS.setFlatness,numArgs:1,variableArgs:!1};e.gs={id:r.OPS.setGState,numArgs:1,variableArgs:!1};e.q={id:r.OPS.save,numArgs:0,variableArgs:!1};e.Q={id:r.OPS.restore,numArgs:0,variableArgs:!1};e.cm={id:r.OPS.transform,numArgs:6,variableArgs:!1};e.m={id:r.OPS.moveTo,numArgs:2,variableArgs:!1};e.l={id:r.OPS.lineTo,numArgs:2,variableArgs:!1};e.c={id:r.OPS.curveTo,numArgs:6,variableArgs:!1};e.v={id:r.OPS.curveTo2,numArgs:4,variableArgs:!1};e.y={id:r.OPS.curveTo3,numArgs:4,variableArgs:!1};e.h={id:r.OPS.closePath,numArgs:0,variableArgs:!1};e.re={id:r.OPS.rectangle,numArgs:4,variableArgs:!1};e.S={id:r.OPS.stroke,numArgs:0,variableArgs:!1};e.s={id:r.OPS.closeStroke,numArgs:0,variableArgs:!1};e.f={id:r.OPS.fill,numArgs:0,variableArgs:!1};e.F={id:r.OPS.fill,numArgs:0,variableArgs:!1};e["f*"]={id:r.OPS.eoFill,numArgs:0,variableArgs:!1};e.B={id:r.OPS.fillStroke,numArgs:0,variableArgs:!1};e["B*"]={id:r.OPS.eoFillStroke,numArgs:0,variableArgs:!1};e.b={id:r.OPS.closeFillStroke,numArgs:0,variableArgs:!1};e["b*"]={id:r.OPS.closeEOFillStroke,numArgs:0,variableArgs:!1};e.n={id:r.OPS.endPath,numArgs:0,variableArgs:!1};e.W={id:r.OPS.clip,numArgs:0,variableArgs:!1};e["W*"]={id:r.OPS.eoClip,numArgs:0,variableArgs:!1};e.BT={id:r.OPS.beginText,numArgs:0,variableArgs:!1};e.ET={id:r.OPS.endText,numArgs:0,variableArgs:!1};e.Tc={id:r.OPS.setCharSpacing,numArgs:1,variableArgs:!1};e.Tw={id:r.OPS.setWordSpacing,numArgs:1,variableArgs:!1};e.Tz={id:r.OPS.setHScale,numArgs:1,variableArgs:!1};e.TL={id:r.OPS.setLeading,numArgs:1,variableArgs:!1};e.Tf={id:r.OPS.setFont,numArgs:2,variableArgs:!1};e.Tr={id:r.OPS.setTextRenderingMode,numArgs:1,variableArgs:!1};e.Ts={id:r.OPS.setTextRise,numArgs:1,variableArgs:!1};e.Td={id:r.OPS.moveText,numArgs:2,variableArgs:!1};e.TD={id:r.OPS.setLeadingMoveText,numArgs:2,variableArgs:!1};e.Tm={id:r.OPS.setTextMatrix,numArgs:6,variableArgs:!1};e["T*"]={id:r.OPS.nextLine,numArgs:0,variableArgs:!1};e.Tj={id:r.OPS.showText,numArgs:1,variableArgs:!1};e.TJ={id:r.OPS.showSpacedText,numArgs:1,variableArgs:!1};e["'"]={id:r.OPS.nextLineShowText,numArgs:1,variableArgs:!1};e['"']={id:r.OPS.nextLineSetSpacingShowText,numArgs:3,variableArgs:!1};e.d0={id:r.OPS.setCharWidth,numArgs:2,variableArgs:!1};e.d1={id:r.OPS.setCharWidthAndBounds,numArgs:6,variableArgs:!1};e.CS={id:r.OPS.setStrokeColorSpace,numArgs:1,variableArgs:!1};e.cs={id:r.OPS.setFillColorSpace,numArgs:1,variableArgs:!1};e.SC={id:r.OPS.setStrokeColor,numArgs:4,variableArgs:!0};e.SCN={id:r.OPS.setStrokeColorN,numArgs:33,variableArgs:!0};e.sc={id:r.OPS.setFillColor,numArgs:4,variableArgs:!0};e.scn={id:r.OPS.setFillColorN,numArgs:33,variableArgs:!0};e.G={id:r.OPS.setStrokeGray,numArgs:1,variableArgs:!1};e.g={id:r.OPS.setFillGray,numArgs:1,variableArgs:!1};e.RG={id:r.OPS.setStrokeRGBColor,numArgs:3,variableArgs:!1};e.rg={id:r.OPS.setFillRGBColor,numArgs:3,variableArgs:!1};e.K={id:r.OPS.setStrokeCMYKColor,numArgs:4,variableArgs:!1};e.k={id:r.OPS.setFillCMYKColor,numArgs:4,variableArgs:!1};e.sh={id:r.OPS.shadingFill,numArgs:1,variableArgs:!1};e.BI={id:r.OPS.beginInlineImage,numArgs:0,variableArgs:!1};e.ID={id:r.OPS.beginImageData,numArgs:0,variableArgs:!1};e.EI={id:r.OPS.endInlineImage,numArgs:1,variableArgs:!1};e.Do={id:r.OPS.paintXObject,numArgs:1,variableArgs:!1};e.MP={id:r.OPS.markPoint,numArgs:1,variableArgs:!1};e.DP={id:r.OPS.markPointProps,numArgs:2,variableArgs:!1};e.BMC={id:r.OPS.beginMarkedContent,numArgs:1,variableArgs:!1};e.BDC={id:r.OPS.beginMarkedContentProps,numArgs:2,variableArgs:!1};e.EMC={id:r.OPS.endMarkedContent,numArgs:0,variableArgs:!1};e.BX={id:r.OPS.beginCompat,numArgs:0,variableArgs:!1};e.EX={id:r.OPS.endCompat,numArgs:0,variableArgs:!1};e.BM=null;e.BD=null;e.true=null;e.fa=null;e.fal=null;e.fals=null;e.false=null;e.nu=null;e.nul=null;e.null=null}));return(0,r.shadow)(this,"opMap",e())}static get MAX_INVALID_PATH_OPS(){return(0,r.shadow)(this,"MAX_INVALID_PATH_OPS",10)}constructor(e,t,a=new StateManager){this.parser=new f.Parser({lexer:new f.Lexer(e,EvaluatorPreprocessor.opMap),xref:t});this.stateManager=a;this.nonProcessedArgs=[];this._isPathOp=!1;this._numInvalidPathOPS=0}get savedStatesDepth(){return this.stateManager.stateStack.length}read(e){let t=e.args;for(;;){const a=this.parser.getObj();if(a instanceof i.Cmd){const n=a.cmd,i=EvaluatorPreprocessor.opMap[n];if(!i){(0,r.warn)(`Unknown command "${n}".`);continue}const s=i.id,o=i.numArgs;let c=null!==t?t.length:0;this._isPathOp||(this._numInvalidPathOPS=0);this._isPathOp=s>=r.OPS.moveTo&&s<=r.OPS.endPath;if(i.variableArgs)c>o&&(0,r.info)(`Command ${n}: expected [0, ${o}] args, but received ${c} args.`);else{if(c!==o){const e=this.nonProcessedArgs;for(;c>o;){e.push(t.shift());c--}for(;c<o&&0!==e.length;){null===t&&(t=[]);t.unshift(e.pop());c++}}if(c<o){const e=`command ${n}: expected ${o} args, but received ${c} args.`;if(this._isPathOp&&++this._numInvalidPathOPS>EvaluatorPreprocessor.MAX_INVALID_PATH_OPS)throw new r.FormatError(`Invalid ${e}`);(0,r.warn)(`Skipping ${e}`);null!==t&&(t.length=0);continue}}this.preprocessCommand(s,t);e.fn=s;e.args=t;return!0}if(a===i.EOF)return!1;if(null!==a){null===t&&(t=[]);t.push(a);if(t.length>33)throw new r.FormatError("Too many arguments")}}}preprocessCommand(e,t){switch(0|e){case r.OPS.save:this.stateManager.save();break;case r.OPS.restore:this.stateManager.restore();break;case r.OPS.transform:this.stateManager.transform(t)}}}t.EvaluatorPreprocessor=EvaluatorPreprocessor},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.IdentityCMap=t.CMapFactory=t.CMap=void 0;var r=a(2),n=a(4),i=a(5),s=a(15),o=a(3),c=a(8);const l=["Adobe-GB1-UCS2","Adobe-CNS1-UCS2","Adobe-Japan1-UCS2","Adobe-Korea1-UCS2","78-EUC-H","78-EUC-V","78-H","78-RKSJ-H","78-RKSJ-V","78-V","78ms-RKSJ-H","78ms-RKSJ-V","83pv-RKSJ-H","90ms-RKSJ-H","90ms-RKSJ-V","90msp-RKSJ-H","90msp-RKSJ-V","90pv-RKSJ-H","90pv-RKSJ-V","Add-H","Add-RKSJ-H","Add-RKSJ-V","Add-V","Adobe-CNS1-0","Adobe-CNS1-1","Adobe-CNS1-2","Adobe-CNS1-3","Adobe-CNS1-4","Adobe-CNS1-5","Adobe-CNS1-6","Adobe-GB1-0","Adobe-GB1-1","Adobe-GB1-2","Adobe-GB1-3","Adobe-GB1-4","Adobe-GB1-5","Adobe-Japan1-0","Adobe-Japan1-1","Adobe-Japan1-2","Adobe-Japan1-3","Adobe-Japan1-4","Adobe-Japan1-5","Adobe-Japan1-6","Adobe-Korea1-0","Adobe-Korea1-1","Adobe-Korea1-2","B5-H","B5-V","B5pc-H","B5pc-V","CNS-EUC-H","CNS-EUC-V","CNS1-H","CNS1-V","CNS2-H","CNS2-V","ETHK-B5-H","ETHK-B5-V","ETen-B5-H","ETen-B5-V","ETenms-B5-H","ETenms-B5-V","EUC-H","EUC-V","Ext-H","Ext-RKSJ-H","Ext-RKSJ-V","Ext-V","GB-EUC-H","GB-EUC-V","GB-H","GB-V","GBK-EUC-H","GBK-EUC-V","GBK2K-H","GBK2K-V","GBKp-EUC-H","GBKp-EUC-V","GBT-EUC-H","GBT-EUC-V","GBT-H","GBT-V","GBTpc-EUC-H","GBTpc-EUC-V","GBpc-EUC-H","GBpc-EUC-V","H","HKdla-B5-H","HKdla-B5-V","HKdlb-B5-H","HKdlb-B5-V","HKgccs-B5-H","HKgccs-B5-V","HKm314-B5-H","HKm314-B5-V","HKm471-B5-H","HKm471-B5-V","HKscs-B5-H","HKscs-B5-V","Hankaku","Hiragana","KSC-EUC-H","KSC-EUC-V","KSC-H","KSC-Johab-H","KSC-Johab-V","KSC-V","KSCms-UHC-H","KSCms-UHC-HW-H","KSCms-UHC-HW-V","KSCms-UHC-V","KSCpc-EUC-H","KSCpc-EUC-V","Katakana","NWP-H","NWP-V","RKSJ-H","RKSJ-V","Roman","UniCNS-UCS2-H","UniCNS-UCS2-V","UniCNS-UTF16-H","UniCNS-UTF16-V","UniCNS-UTF32-H","UniCNS-UTF32-V","UniCNS-UTF8-H","UniCNS-UTF8-V","UniGB-UCS2-H","UniGB-UCS2-V","UniGB-UTF16-H","UniGB-UTF16-V","UniGB-UTF32-H","UniGB-UTF32-V","UniGB-UTF8-H","UniGB-UTF8-V","UniJIS-UCS2-H","UniJIS-UCS2-HW-H","UniJIS-UCS2-HW-V","UniJIS-UCS2-V","UniJIS-UTF16-H","UniJIS-UTF16-V","UniJIS-UTF32-H","UniJIS-UTF32-V","UniJIS-UTF8-H","UniJIS-UTF8-V","UniJIS2004-UTF16-H","UniJIS2004-UTF16-V","UniJIS2004-UTF32-H","UniJIS2004-UTF32-V","UniJIS2004-UTF8-H","UniJIS2004-UTF8-V","UniJISPro-UCS2-HW-V","UniJISPro-UCS2-V","UniJISPro-UTF8-V","UniJISX0213-UTF32-H","UniJISX0213-UTF32-V","UniJISX02132004-UTF32-H","UniJISX02132004-UTF32-V","UniKS-UCS2-H","UniKS-UCS2-V","UniKS-UTF16-H","UniKS-UTF16-V","UniKS-UTF32-H","UniKS-UTF32-V","UniKS-UTF8-H","UniKS-UTF8-V","V","WP-Symbol"],h=2**24-1;class CMap{constructor(e=!1){this.codespaceRanges=[[],[],[],[]];this.numCodespaceRanges=0;this._map=[];this.name="";this.vertical=!1;this.useCMap=null;this.builtInCMap=e}addCodespaceRange(e,t,a){this.codespaceRanges[e-1].push(t,a);this.numCodespaceRanges++}mapCidRange(e,t,a){if(t-e>h)throw new Error("mapCidRange - ignoring data above MAX_MAP_RANGE.");for(;e<=t;)this._map[e++]=a++}mapBfRange(e,t,a){if(t-e>h)throw new Error("mapBfRange - ignoring data above MAX_MAP_RANGE.");const r=a.length-1;for(;e<=t;){this._map[e++]=a;const t=a.charCodeAt(r)+1;t>255?a=a.substring(0,r-1)+String.fromCharCode(a.charCodeAt(r-1)+1)+"\0":a=a.substring(0,r)+String.fromCharCode(t)}}mapBfRangeToArray(e,t,a){if(t-e>h)throw new Error("mapBfRangeToArray - ignoring data above MAX_MAP_RANGE.");const r=a.length;let n=0;for(;e<=t&&n<r;){this._map[e]=a[n++];++e}}mapOne(e,t){this._map[e]=t}lookup(e){return this._map[e]}contains(e){return void 0!==this._map[e]}forEach(e){const t=this._map,a=t.length;if(a<=65536)for(let r=0;r<a;r++)void 0!==t[r]&&e(r,t[r]);else for(const a in t)e(a,t[a])}charCodeOf(e){const t=this._map;if(t.length<=65536)return t.indexOf(e);for(const a in t)if(t[a]===e)return 0|a;return-1}getMap(){return this._map}readCharCode(e,t,a){let r=0;const n=this.codespaceRanges;for(let i=0,s=n.length;i<s;i++){r=(r<<8|e.charCodeAt(t+i))>>>0;const s=n[i];for(let e=0,t=s.length;e<t;){const t=s[e++],n=s[e++];if(r>=t&&r<=n){a.charcode=r;a.length=i+1;return}}}a.charcode=0;a.length=1}getCharCodeLength(e){const t=this.codespaceRanges;for(let a=0,r=t.length;a<r;a++){const r=t[a];for(let t=0,n=r.length;t<n;){const n=r[t++],i=r[t++];if(e>=n&&e<=i)return a+1}}return 1}get length(){return this._map.length}get isIdentityCMap(){if("Identity-H"!==this.name&&"Identity-V"!==this.name)return!1;if(65536!==this._map.length)return!1;for(let e=0;e<65536;e++)if(this._map[e]!==e)return!1;return!0}}t.CMap=CMap;class IdentityCMap extends CMap{constructor(e,t){super();this.vertical=e;this.addCodespaceRange(t,0,65535)}mapCidRange(e,t,a){(0,r.unreachable)("should not call mapCidRange")}mapBfRange(e,t,a){(0,r.unreachable)("should not call mapBfRange")}mapBfRangeToArray(e,t,a){(0,r.unreachable)("should not call mapBfRangeToArray")}mapOne(e,t){(0,r.unreachable)("should not call mapCidOne")}lookup(e){return Number.isInteger(e)&&e<=65535?e:void 0}contains(e){return Number.isInteger(e)&&e<=65535}forEach(e){for(let t=0;t<=65535;t++)e(t,t)}charCodeOf(e){return Number.isInteger(e)&&e<=65535?e:-1}getMap(){const e=new Array(65536);for(let t=0;t<=65535;t++)e[t]=t;return e}get length(){return 65536}get isIdentityCMap(){(0,r.unreachable)("should not access .isIdentityCMap")}}t.IdentityCMap=IdentityCMap;const u=function BinaryCMapReaderClosure(){function hexToInt(e,t){let a=0;for(let r=0;r<=t;r++)a=a<<8|e[r];return a>>>0}function hexToStr(e,t){return 1===t?String.fromCharCode(e[0],e[1]):3===t?String.fromCharCode(e[0],e[1],e[2],e[3]):String.fromCharCode.apply(null,e.subarray(0,t+1))}function addHex(e,t,a){let r=0;for(let n=a;n>=0;n--){r+=e[n]+t[n];e[n]=255&r;r>>=8}}function incHex(e,t){let a=1;for(let r=t;r>=0&&a>0;r--){a+=e[r];e[r]=255&a;a>>=8}}const e=16;class BinaryCMapStream{constructor(e){this.buffer=e;this.pos=0;this.end=e.length;this.tmpBuf=new Uint8Array(19)}readByte(){return this.pos>=this.end?-1:this.buffer[this.pos++]}readNumber(){let e,t=0;do{const a=this.readByte();if(a<0)throw new r.FormatError("unexpected EOF in bcmap");e=!(128&a);t=t<<7|127&a}while(!e);return t}readSigned(){const e=this.readNumber();return 1&e?~(e>>>1):e>>>1}readHex(e,t){e.set(this.buffer.subarray(this.pos,this.pos+t+1));this.pos+=t+1}readHexNumber(e,t){let a;const n=this.tmpBuf;let i=0;do{const e=this.readByte();if(e<0)throw new r.FormatError("unexpected EOF in bcmap");a=!(128&e);n[i++]=127&e}while(!a);let s=t,o=0,c=0;for(;s>=0;){for(;c<8&&n.length>0;){o|=n[--i]<<c;c+=7}e[s]=255&o;s--;o>>=8;c-=8}}readHexSigned(e,t){this.readHexNumber(e,t);const a=1&e[t]?255:0;let r=0;for(let n=0;n<=t;n++){r=(1&r)<<8|e[n];e[n]=r>>1^a}}readString(){const e=this.readNumber();let t="";for(let a=0;a<e;a++)t+=String.fromCharCode(this.readNumber());return t}}return class BinaryCMapReader{async process(t,a,r){const n=new BinaryCMapStream(t),i=n.readByte();a.vertical=!!(1&i);let s=null;const o=new Uint8Array(e),c=new Uint8Array(e),l=new Uint8Array(e),h=new Uint8Array(e),u=new Uint8Array(e);let d,f;for(;(f=n.readByte())>=0;){const t=f>>5;if(7===t){switch(31&f){case 0:n.readString();break;case 1:s=n.readString()}continue}const r=!!(16&f),i=15&f;if(i+1>e)throw new Error("BinaryCMapReader.process: Invalid dataSize.");const g=1,p=n.readNumber();switch(t){case 0:n.readHex(o,i);n.readHexNumber(c,i);addHex(c,o,i);a.addCodespaceRange(i+1,hexToInt(o,i),hexToInt(c,i));for(let e=1;e<p;e++){incHex(c,i);n.readHexNumber(o,i);addHex(o,c,i);n.readHexNumber(c,i);addHex(c,o,i);a.addCodespaceRange(i+1,hexToInt(o,i),hexToInt(c,i))}break;case 1:n.readHex(o,i);n.readHexNumber(c,i);addHex(c,o,i);n.readNumber();for(let e=1;e<p;e++){incHex(c,i);n.readHexNumber(o,i);addHex(o,c,i);n.readHexNumber(c,i);addHex(c,o,i);n.readNumber()}break;case 2:n.readHex(l,i);d=n.readNumber();a.mapOne(hexToInt(l,i),d);for(let e=1;e<p;e++){incHex(l,i);if(!r){n.readHexNumber(u,i);addHex(l,u,i)}d=n.readSigned()+(d+1);a.mapOne(hexToInt(l,i),d)}break;case 3:n.readHex(o,i);n.readHexNumber(c,i);addHex(c,o,i);d=n.readNumber();a.mapCidRange(hexToInt(o,i),hexToInt(c,i),d);for(let e=1;e<p;e++){incHex(c,i);if(r)o.set(c);else{n.readHexNumber(o,i);addHex(o,c,i)}n.readHexNumber(c,i);addHex(c,o,i);d=n.readNumber();a.mapCidRange(hexToInt(o,i),hexToInt(c,i),d)}break;case 4:n.readHex(l,g);n.readHex(h,i);a.mapOne(hexToInt(l,g),hexToStr(h,i));for(let e=1;e<p;e++){incHex(l,g);if(!r){n.readHexNumber(u,g);addHex(l,u,g)}incHex(h,i);n.readHexSigned(u,i);addHex(h,u,i);a.mapOne(hexToInt(l,g),hexToStr(h,i))}break;case 5:n.readHex(o,g);n.readHexNumber(c,g);addHex(c,o,g);n.readHex(h,i);a.mapBfRange(hexToInt(o,g),hexToInt(c,g),hexToStr(h,i));for(let e=1;e<p;e++){incHex(c,g);if(r)o.set(c);else{n.readHexNumber(o,g);addHex(o,c,g)}n.readHexNumber(c,g);addHex(c,o,g);n.readHex(h,i);a.mapBfRange(hexToInt(o,g),hexToInt(c,g),hexToStr(h,i))}break;default:throw new Error(`BinaryCMapReader.process - unknown type: ${t}`)}}return s?r(s):a}}}(),d=function CMapFactoryClosure(){function strToInt(e){let t=0;for(let a=0;a<e.length;a++)t=t<<8|e.charCodeAt(a);return t>>>0}function expectString(e){if("string"!=typeof e)throw new r.FormatError("Malformed CMap: expected string.")}function expectInt(e){if(!Number.isInteger(e))throw new r.FormatError("Malformed CMap: expected int.")}function parseBfChar(e,t){for(;;){let a=t.getObj();if(a===n.EOF)break;if((0,n.isCmd)(a,"endbfchar"))return;expectString(a);const r=strToInt(a);a=t.getObj();expectString(a);const i=a;e.mapOne(r,i)}}function parseBfRange(e,t){for(;;){let a=t.getObj();if(a===n.EOF)break;if((0,n.isCmd)(a,"endbfrange"))return;expectString(a);const r=strToInt(a);a=t.getObj();expectString(a);const i=strToInt(a);a=t.getObj();if(Number.isInteger(a)||"string"==typeof a){const t=Number.isInteger(a)?String.fromCharCode(a):a;e.mapBfRange(r,i,t)}else{if(!(0,n.isCmd)(a,"["))break;{a=t.getObj();const s=[];for(;!(0,n.isCmd)(a,"]")&&a!==n.EOF;){s.push(a);a=t.getObj()}e.mapBfRangeToArray(r,i,s)}}}throw new r.FormatError("Invalid bf range.")}function parseCidChar(e,t){for(;;){let a=t.getObj();if(a===n.EOF)break;if((0,n.isCmd)(a,"endcidchar"))return;expectString(a);const r=strToInt(a);a=t.getObj();expectInt(a);const i=a;e.mapOne(r,i)}}function parseCidRange(e,t){for(;;){let a=t.getObj();if(a===n.EOF)break;if((0,n.isCmd)(a,"endcidrange"))return;expectString(a);const r=strToInt(a);a=t.getObj();expectString(a);const i=strToInt(a);a=t.getObj();expectInt(a);const s=a;e.mapCidRange(r,i,s)}}function parseCodespaceRange(e,t){for(;;){let a=t.getObj();if(a===n.EOF)break;if((0,n.isCmd)(a,"endcodespacerange"))return;if("string"!=typeof a)break;const r=strToInt(a);a=t.getObj();if("string"!=typeof a)break;const i=strToInt(a);e.addCodespaceRange(a.length,r,i)}throw new r.FormatError("Invalid codespace range.")}function parseWMode(e,t){const a=t.getObj();Number.isInteger(a)&&(e.vertical=!!a)}function parseCMapName(e,t){const a=t.getObj();a instanceof n.Name&&(e.name=a.name)}async function parseCMap(e,t,a,i){let s,c;e:for(;;)try{const a=t.getObj();if(a===n.EOF)break;if(a instanceof n.Name){"WMode"===a.name?parseWMode(e,t):"CMapName"===a.name&&parseCMapName(e,t);s=a}else if(a instanceof n.Cmd)switch(a.cmd){case"endcmap":break e;case"usecmap":s instanceof n.Name&&(c=s.name);break;case"begincodespacerange":parseCodespaceRange(e,t);break;case"beginbfchar":parseBfChar(e,t);break;case"begincidchar":parseCidChar(e,t);break;case"beginbfrange":parseBfRange(e,t);break;case"begincidrange":parseCidRange(e,t)}}catch(e){if(e instanceof o.MissingDataException)throw e;(0,r.warn)("Invalid cMap data: "+e);continue}!i&&c&&(i=c);return i?extendCMap(e,a,i):e}async function extendCMap(e,t,a){e.useCMap=await createBuiltInCMap(a,t);if(0===e.numCodespaceRanges){const t=e.useCMap.codespaceRanges;for(let a=0;a<t.length;a++)e.codespaceRanges[a]=t[a].slice();e.numCodespaceRanges=e.useCMap.numCodespaceRanges}e.useCMap.forEach((function(t,a){e.contains(t)||e.mapOne(t,e.useCMap.lookup(t))}));return e}async function createBuiltInCMap(e,t){if("Identity-H"===e)return new IdentityCMap(!1,2);if("Identity-V"===e)return new IdentityCMap(!0,2);if(!l.includes(e))throw new Error("Unknown CMap name: "+e);if(!t)throw new Error("Built-in CMap parameters are not provided.");const{cMapData:a,compressionType:n}=await t(e),i=new CMap(!0);if(n===r.CMapCompressionType.BINARY)return(new u).process(a,i,(e=>extendCMap(i,t,e)));if(n===r.CMapCompressionType.NONE){const e=new s.Lexer(new c.Stream(a));return parseCMap(i,e,t,null)}throw new Error(`Invalid CMap "compressionType" value: ${n}`)}return{async create(e){const t=e.encoding,a=e.fetchBuiltInCMap,r=e.useCMap;if(t instanceof n.Name)return createBuiltInCMap(t.name,a);if(t instanceof i.BaseStream){const e=await parseCMap(new CMap,new s.Lexer(t),a,r);return e.isIdentityCMap?createBuiltInCMap(e.name,a):e}throw new Error("Encoding required.")}}}();t.CMapFactory=d},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.Parser=t.Linearization=t.Lexer=void 0;var r=a(2),n=a(4),i=a(3),s=a(16),o=a(18),c=a(19),l=a(21),h=a(22),u=a(25),d=a(27),f=a(29),g=a(8),p=a(30),m=a(31);class Parser{constructor({lexer:e,xref:t,allowStreams:a=!1,recoveryMode:r=!1}){this.lexer=e;this.xref=t;this.allowStreams=a;this.recoveryMode=r;this.imageCache=Object.create(null);this._imageId=0;this.refill()}refill(){this.buf1=this.lexer.getObj();this.buf2=this.lexer.getObj()}shift(){if(this.buf2 instanceof n.Cmd&&"ID"===this.buf2.cmd){this.buf1=this.buf2;this.buf2=null}else{this.buf1=this.buf2;this.buf2=this.lexer.getObj()}}tryShift(){try{this.shift();return!0}catch(e){if(e instanceof i.MissingDataException)throw e;return!1}}getObj(e=null){const t=this.buf1;this.shift();if(t instanceof n.Cmd)switch(t.cmd){case"BI":return this.makeInlineImage(e);case"[":const a=[];for(;!(0,n.isCmd)(this.buf1,"]")&&this.buf1!==n.EOF;)a.push(this.getObj(e));if(this.buf1===n.EOF){if(this.recoveryMode)return a;throw new i.ParserEOFException("End of file inside array.")}this.shift();return a;case"<<":const s=new n.Dict(this.xref);for(;!(0,n.isCmd)(this.buf1,">>")&&this.buf1!==n.EOF;){if(!(this.buf1 instanceof n.Name)){(0,r.info)("Malformed dictionary: key must be a name object");this.shift();continue}const t=this.buf1.name;this.shift();if(this.buf1===n.EOF)break;s.set(t,this.getObj(e))}if(this.buf1===n.EOF){if(this.recoveryMode)return s;throw new i.ParserEOFException("End of file inside dictionary.")}if((0,n.isCmd)(this.buf2,"stream"))return this.allowStreams?this.makeStream(s,e):s;this.shift();return s;default:return t}if(Number.isInteger(t)){if(Number.isInteger(this.buf1)&&(0,n.isCmd)(this.buf2,"R")){const e=n.Ref.get(t,this.buf1);this.shift();this.shift();return e}return t}return"string"==typeof t&&e?e.decryptString(t):t}findDefaultInlineStreamEnd(e){const t=this.lexer,a=e.pos;let s,o,c=0;for(;-1!==(s=e.getByte());)if(0===c)c=69===s?1:0;else if(1===c)c=73===s?2:0;else if(32===s||10===s||13===s){o=e.pos;const a=e.peekBytes(10);for(let e=0,t=a.length;e<t;e++){s=a[e];if((0!==s||0===a[e+1])&&(10!==s&&13!==s&&(s<32||s>127))){c=0;break}}if(2!==c)continue;if(t.knownCommands){const e=t.peekObj();e instanceof n.Cmd&&!t.knownCommands[e.cmd]&&(c=0)}else(0,r.warn)("findDefaultInlineStreamEnd - `lexer.knownCommands` is undefined.");if(2===c)break}else c=0;if(-1===s){(0,r.warn)("findDefaultInlineStreamEnd: Reached the end of the stream without finding a valid EI marker");if(o){(0,r.warn)('... trying to recover by using the last "EI" occurrence.');e.skip(-(e.pos-o))}}let l=4;e.skip(-l);s=e.peekByte();e.skip(l);(0,i.isWhiteSpace)(s)||l--;return e.pos-l-a}findDCTDecodeInlineStreamEnd(e){const t=e.pos;let a,n,i=!1;for(;-1!==(a=e.getByte());)if(255===a){switch(e.getByte()){case 0:break;case 255:e.skip(-1);break;case 217:i=!0;break;case 192:case 193:case 194:case 195:case 197:case 198:case 199:case 201:case 202:case 203:case 205:case 206:case 207:case 196:case 204:case 218:case 219:case 220:case 221:case 222:case 223:case 224:case 225:case 226:case 227:case 228:case 229:case 230:case 231:case 232:case 233:case 234:case 235:case 236:case 237:case 238:case 239:case 254:n=e.getUint16();n>2?e.skip(n-2):e.skip(-2)}if(i)break}const s=e.pos-t;if(-1===a){(0,r.warn)("Inline DCTDecode image stream: EOI marker not found, searching for /EI/ instead.");e.skip(-s);return this.findDefaultInlineStreamEnd(e)}this.inlineStreamSkipEI(e);return s}findASCII85DecodeInlineStreamEnd(e){const t=e.pos;let a;for(;-1!==(a=e.getByte());)if(126===a){const t=e.pos;a=e.peekByte();for(;(0,i.isWhiteSpace)(a);){e.skip();a=e.peekByte()}if(62===a){e.skip();break}if(e.pos>t){const t=e.peekBytes(2);if(69===t[0]&&73===t[1])break}}const n=e.pos-t;if(-1===a){(0,r.warn)("Inline ASCII85Decode image stream: EOD marker not found, searching for /EI/ instead.");e.skip(-n);return this.findDefaultInlineStreamEnd(e)}this.inlineStreamSkipEI(e);return n}findASCIIHexDecodeInlineStreamEnd(e){const t=e.pos;let a;for(;-1!==(a=e.getByte())&&62!==a;);const n=e.pos-t;if(-1===a){(0,r.warn)("Inline ASCIIHexDecode image stream: EOD marker not found, searching for /EI/ instead.");e.skip(-n);return this.findDefaultInlineStreamEnd(e)}this.inlineStreamSkipEI(e);return n}inlineStreamSkipEI(e){let t,a=0;for(;-1!==(t=e.getByte());)if(0===a)a=69===t?1:0;else if(1===a)a=73===t?2:0;else if(2===a)break}makeInlineImage(e){const t=this.lexer,a=t.stream,i=Object.create(null);let s;for(;!(0,n.isCmd)(this.buf1,"ID")&&this.buf1!==n.EOF;){if(!(this.buf1 instanceof n.Name))throw new r.FormatError("Dictionary key must be a name object");const t=this.buf1.name;this.shift();if(this.buf1===n.EOF)break;i[t]=this.getObj(e)}-1!==t.beginInlineImagePos&&(s=a.pos-t.beginInlineImagePos);const o=this.xref.fetchIfRef(i.F||i.Filter);let c;if(o instanceof n.Name)c=o.name;else if(Array.isArray(o)){const e=this.xref.fetchIfRef(o[0]);e instanceof n.Name&&(c=e.name)}const l=a.pos;let h,u;switch(c){case"DCT":case"DCTDecode":h=this.findDCTDecodeInlineStreamEnd(a);break;case"A85":case"ASCII85Decode":h=this.findASCII85DecodeInlineStreamEnd(a);break;case"AHx":case"ASCIIHexDecode":h=this.findASCIIHexDecodeInlineStreamEnd(a);break;default:h=this.findDefaultInlineStreamEnd(a)}if(h<1e3&&s>0){const e=a.pos;a.pos=t.beginInlineImagePos;u=function getInlineImageCacheKey(e){const t=[],a=e.length;let r=0;for(;r<a-1;)t.push(e[r++]<<8|e[r++]);r<a&&t.push(e[r]);return a+"_"+String.fromCharCode.apply(null,t)}(a.getBytes(s+h));a.pos=e;const r=this.imageCache[u];if(void 0!==r){this.buf2=n.Cmd.get("EI");this.shift();r.reset();return r}}const d=new n.Dict(this.xref);for(const e in i)d.set(e,i[e]);let f=a.makeSubStream(l,h,d);e&&(f=e.createStream(f,h));f=this.filter(f,d,h);f.dict=d;if(void 0!==u){f.cacheKey="inline_img_"+ ++this._imageId;this.imageCache[u]=f}this.buf2=n.Cmd.get("EI");this.shift();return f}_findStreamLength(e,t){const{stream:a}=this.lexer;a.pos=e;const r=t.length;for(;a.pos<a.end;){const n=a.peekBytes(2048),i=n.length-r;if(i<=0)break;let s=0;for(;s<i;){let i=0;for(;i<r&&n[s+i]===t[i];)i++;if(i>=r){a.pos+=s;return a.pos-e}s++}a.pos+=i}return-1}makeStream(e,t){const a=this.lexer;let s=a.stream;a.skipToNextLine();const o=s.pos-1;let c=e.get("Length");if(!Number.isInteger(c)){(0,r.info)(`Bad length "${c&&c.toString()}" in stream.`);c=0}s.pos=o+c;a.nextChar();if(this.tryShift()&&(0,n.isCmd)(this.buf2,"endstream"))this.shift();else{const e=new Uint8Array([101,110,100,115,116,114,101,97,109]);let t=this._findStreamLength(o,e);if(t<0){const a=1;for(let n=1;n<=a;n++){const a=e.length-n,c=e.slice(0,a),l=this._findStreamLength(o,c);if(l>=0){const e=s.peekBytes(a+1)[a];if(!(0,i.isWhiteSpace)(e))break;(0,r.info)(`Found "${(0,r.bytesToString)(c)}" when searching for endstream command.`);t=l;break}}if(t<0)throw new r.FormatError("Missing endstream command.")}c=t;a.nextChar();this.shift();this.shift()}this.shift();s=s.makeSubStream(o,c,e);t&&(s=t.createStream(s,c));s=this.filter(s,e,c);s.dict=e;return s}filter(e,t,a){let i=t.get("F","Filter"),s=t.get("DP","DecodeParms");if(i instanceof n.Name){Array.isArray(s)&&(0,r.warn)("/DecodeParms should not be an Array, when /Filter is a Name.");return this.makeFilter(e,i.name,a,s)}let o=a;if(Array.isArray(i)){const t=i,a=s;for(let c=0,l=t.length;c<l;++c){i=this.xref.fetchIfRef(t[c]);if(!(i instanceof n.Name))throw new r.FormatError(`Bad filter name "${i}"`);s=null;Array.isArray(a)&&c in a&&(s=this.xref.fetchIfRef(a[c]));e=this.makeFilter(e,i.name,o,s);o=null}}return e}makeFilter(e,t,a,n){if(0===a){(0,r.warn)(`Empty "${t}" stream.`);return new g.NullStream}try{switch(t){case"Fl":case"FlateDecode":return n?new p.PredictorStream(new l.FlateStream(e,a),a,n):new l.FlateStream(e,a);case"LZW":case"LZWDecode":let t=1;if(n){n.has("EarlyChange")&&(t=n.get("EarlyChange"));return new p.PredictorStream(new f.LZWStream(e,a,t),a,n)}return new f.LZWStream(e,a,t);case"DCT":case"DCTDecode":return new u.JpegStream(e,a,n);case"JPX":case"JPXDecode":return new d.JpxStream(e,a,n);case"A85":case"ASCII85Decode":return new s.Ascii85Stream(e,a);case"AHx":case"ASCIIHexDecode":return new o.AsciiHexStream(e,a);case"CCF":case"CCITTFaxDecode":return new c.CCITTFaxStream(e,a,n);case"RL":case"RunLengthDecode":return new m.RunLengthStream(e,a);case"JBIG2Decode":return new h.Jbig2Stream(e,a,n)}(0,r.warn)(`Filter "${t}" is not supported.`);return e}catch(e){if(e instanceof i.MissingDataException)throw e;(0,r.warn)(`Invalid stream: "${e}"`);return new g.NullStream}}}t.Parser=Parser;const b=[1,0,0,0,0,0,0,0,0,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,2,0,0,2,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];function toHexDigit(e){return e>=48&&e<=57?15&e:e>=65&&e<=70||e>=97&&e<=102?9+(15&e):-1}class Lexer{constructor(e,t=null){this.stream=e;this.nextChar();this.strBuf=[];this.knownCommands=t;this._hexStringNumWarn=0;this.beginInlineImagePos=-1}nextChar(){return this.currentChar=this.stream.getByte()}peekChar(){return this.stream.peekByte()}getNumber(){let e=this.currentChar,t=!1,a=0,n=0;if(45===e){n=-1;e=this.nextChar();45===e&&(e=this.nextChar())}else if(43===e){n=1;e=this.nextChar()}if(10===e||13===e)do{e=this.nextChar()}while(10===e||13===e);if(46===e){a=10;e=this.nextChar()}if(e<48||e>57){const t=`Invalid number: ${String.fromCharCode(e)} (charCode ${e})`;if((0,i.isWhiteSpace)(e)||-1===e){(0,r.info)(`Lexer.getNumber - "${t}".`);return 0}throw new r.FormatError(t)}n=n||1;let s=e-48,o=0,c=1;for(;(e=this.nextChar())>=0;)if(e>=48&&e<=57){const r=e-48;if(t)o=10*o+r;else{0!==a&&(a*=10);s=10*s+r}}else if(46===e){if(0!==a)break;a=1}else if(45===e)(0,r.warn)("Badly formatted number: minus sign in the middle");else{if(69!==e&&101!==e)break;e=this.peekChar();if(43===e||45===e){c=45===e?-1:1;this.nextChar()}else if(e<48||e>57)break;t=!0}0!==a&&(s/=a);t&&(s*=10**(c*o));return n*s}getString(){let e=1,t=!1;const a=this.strBuf;a.length=0;let n=this.nextChar();for(;;){let i=!1;switch(0|n){case-1:(0,r.warn)("Unterminated string");t=!0;break;case 40:++e;a.push("(");break;case 41:if(0==--e){this.nextChar();t=!0}else a.push(")");break;case 92:n=this.nextChar();switch(n){case-1:(0,r.warn)("Unterminated string");t=!0;break;case 110:a.push("\n");break;case 114:a.push("\r");break;case 116:a.push("\t");break;case 98:a.push("\b");break;case 102:a.push("\f");break;case 92:case 40:case 41:a.push(String.fromCharCode(n));break;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:let e=15&n;n=this.nextChar();i=!0;if(n>=48&&n<=55){e=(e<<3)+(15&n);n=this.nextChar();if(n>=48&&n<=55){i=!1;e=(e<<3)+(15&n)}}a.push(String.fromCharCode(e));break;case 13:10===this.peekChar()&&this.nextChar();break;case 10:break;default:a.push(String.fromCharCode(n))}break;default:a.push(String.fromCharCode(n))}if(t)break;i||(n=this.nextChar())}return a.join("")}getName(){let e,t;const a=this.strBuf;a.length=0;for(;(e=this.nextChar())>=0&&!b[e];)if(35===e){e=this.nextChar();if(b[e]){(0,r.warn)("Lexer_getName: NUMBER SIGN (#) should be followed by a hexadecimal number.");a.push("#");break}const n=toHexDigit(e);if(-1!==n){t=e;e=this.nextChar();const i=toHexDigit(e);if(-1===i){(0,r.warn)(`Lexer_getName: Illegal digit (${String.fromCharCode(e)}) in hexadecimal number.`);a.push("#",String.fromCharCode(t));if(b[e])break;a.push(String.fromCharCode(e));continue}a.push(String.fromCharCode(n<<4|i))}else a.push("#",String.fromCharCode(e))}else a.push(String.fromCharCode(e));a.length>127&&(0,r.warn)(`Name token is longer than allowed by the spec: ${a.length}`);return n.Name.get(a.join(""))}_hexStringWarn(e){5!=this._hexStringNumWarn++?this._hexStringNumWarn>5||(0,r.warn)(`getHexString - ignoring invalid character: ${e}`):(0,r.warn)("getHexString - ignoring additional invalid characters.")}getHexString(){const e=this.strBuf;e.length=0;let t,a,n=this.currentChar,i=!0;this._hexStringNumWarn=0;for(;;){if(n<0){(0,r.warn)("Unterminated hex string");break}if(62===n){this.nextChar();break}if(1!==b[n]){if(i){t=toHexDigit(n);if(-1===t){this._hexStringWarn(n);n=this.nextChar();continue}}else{a=toHexDigit(n);if(-1===a){this._hexStringWarn(n);n=this.nextChar();continue}e.push(String.fromCharCode(t<<4|a))}i=!i;n=this.nextChar()}else n=this.nextChar()}return e.join("")}getObj(){let e=!1,t=this.currentChar;for(;;){if(t<0)return n.EOF;if(e)10!==t&&13!==t||(e=!1);else if(37===t)e=!0;else if(1!==b[t])break;t=this.nextChar()}switch(0|t){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 43:case 45:case 46:return this.getNumber();case 40:return this.getString();case 47:return this.getName();case 91:this.nextChar();return n.Cmd.get("[");case 93:this.nextChar();return n.Cmd.get("]");case 60:t=this.nextChar();if(60===t){this.nextChar();return n.Cmd.get("<<")}return this.getHexString();case 62:t=this.nextChar();if(62===t){this.nextChar();return n.Cmd.get(">>")}return n.Cmd.get(">");case 123:this.nextChar();return n.Cmd.get("{");case 125:this.nextChar();return n.Cmd.get("}");case 41:this.nextChar();throw new r.FormatError(`Illegal character: ${t}`)}let a=String.fromCharCode(t);if(t<32||t>127){const e=this.peekChar();if(e>=32&&e<=127){this.nextChar();return n.Cmd.get(a)}}const i=this.knownCommands;let s=i&&void 0!==i[a];for(;(t=this.nextChar())>=0&&!b[t];){const e=a+String.fromCharCode(t);if(s&&void 0===i[e])break;if(128===a.length)throw new r.FormatError(`Command token too long: ${a.length}`);a=e;s=i&&void 0!==i[a]}if("true"===a)return!0;if("false"===a)return!1;if("null"===a)return null;"BI"===a&&(this.beginInlineImagePos=this.stream.pos);return n.Cmd.get(a)}peekObj(){const e=this.stream.pos,t=this.currentChar,a=this.beginInlineImagePos;let n;try{n=this.getObj()}catch(e){if(e instanceof i.MissingDataException)throw e;(0,r.warn)(`peekObj: ${e}`)}this.stream.pos=e;this.currentChar=t;this.beginInlineImagePos=a;return n}skipToNextLine(){let e=this.currentChar;for(;e>=0;){if(13===e){e=this.nextChar();10===e&&this.nextChar();break}if(10===e){this.nextChar();break}e=this.nextChar()}}}t.Lexer=Lexer;t.Linearization=class Linearization{static create(e){function getInt(e,t,a=!1){const r=e.get(t);if(Number.isInteger(r)&&(a?r>=0:r>0))return r;throw new Error(`The "${t}" parameter in the linearization dictionary is invalid.`)}const t=new Parser({lexer:new Lexer(e),xref:null}),a=t.getObj(),r=t.getObj(),i=t.getObj(),s=t.getObj();let o,c;if(!(Number.isInteger(a)&&Number.isInteger(r)&&(0,n.isCmd)(i,"obj")&&s instanceof n.Dict&&"number"==typeof(o=s.get("Linearized"))&&o>0))return null;if((c=getInt(s,"L"))!==e.length)throw new Error('The "L" parameter in the linearization dictionary does not equal the stream length.');return{length:c,hints:function getHints(e){const t=e.get("H");let a;if(Array.isArray(t)&&(2===(a=t.length)||4===a)){for(let e=0;e<a;e++){const a=t[e];if(!(Number.isInteger(a)&&a>0))throw new Error(`Hint (${e}) in the linearization dictionary is invalid.`)}return t}throw new Error("Hint array in the linearization dictionary is invalid.")}(s),objectNumberFirst:getInt(s,"O"),endFirst:getInt(s,"E"),numPages:getInt(s,"N"),mainXRefEntriesOffset:getInt(s,"T"),pageFirst:s.has("P")?getInt(s,"P",!0):0}}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.Ascii85Stream=void 0;var r=a(17),n=a(3);class Ascii85Stream extends r.DecodeStream{constructor(e,t){t&&(t*=.8);super(t);this.str=e;this.dict=e.dict;this.input=new Uint8Array(5)}readBlock(){const e=this.str;let t=e.getByte();for(;(0,n.isWhiteSpace)(t);)t=e.getByte();if(-1===t||126===t){this.eof=!0;return}const a=this.bufferLength;let r,i;if(122===t){r=this.ensureBuffer(a+4);for(i=0;i<4;++i)r[a+i]=0;this.bufferLength+=4}else{const s=this.input;s[0]=t;for(i=1;i<5;++i){t=e.getByte();for(;(0,n.isWhiteSpace)(t);)t=e.getByte();s[i]=t;if(-1===t||126===t)break}r=this.ensureBuffer(a+i-1);this.bufferLength+=i-1;if(i<5){for(;i<5;++i)s[i]=117;this.eof=!0}let o=0;for(i=0;i<5;++i)o=85*o+(s[i]-33);for(i=3;i>=0;--i){r[a+i]=255&o;o>>=8}}}}t.Ascii85Stream=Ascii85Stream},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.StreamsSequenceStream=t.DecodeStream=void 0;var r=a(5),n=a(8);const i=new Uint8Array(0);class DecodeStream extends r.BaseStream{constructor(e){super();this._rawMinBufferLength=e||0;this.pos=0;this.bufferLength=0;this.eof=!1;this.buffer=i;this.minBufferLength=512;if(e)for(;this.minBufferLength<e;)this.minBufferLength*=2}get isEmpty(){for(;!this.eof&&0===this.bufferLength;)this.readBlock();return 0===this.bufferLength}ensureBuffer(e){const t=this.buffer;if(e<=t.byteLength)return t;let a=this.minBufferLength;for(;a<e;)a*=2;const r=new Uint8Array(a);r.set(t);return this.buffer=r}getByte(){const e=this.pos;for(;this.bufferLength<=e;){if(this.eof)return-1;this.readBlock()}return this.buffer[this.pos++]}getBytes(e){const t=this.pos;let a;if(e){this.ensureBuffer(t+e);a=t+e;for(;!this.eof&&this.bufferLength<a;)this.readBlock();const r=this.bufferLength;a>r&&(a=r)}else{for(;!this.eof;)this.readBlock();a=this.bufferLength}this.pos=a;return this.buffer.subarray(t,a)}reset(){this.pos=0}makeSubStream(e,t,a=null){if(void 0===t)for(;!this.eof;)this.readBlock();else{const a=e+t;for(;this.bufferLength<=a&&!this.eof;)this.readBlock()}return new n.Stream(this.buffer,e,t,a)}getBaseStreams(){return this.str?this.str.getBaseStreams():null}}t.DecodeStream=DecodeStream;t.StreamsSequenceStream=class StreamsSequenceStream extends DecodeStream{constructor(e,t=null){let a=0;for(const t of e)a+=t instanceof DecodeStream?t._rawMinBufferLength:t.length;super(a);this.streams=e;this._onError=t}readBlock(){const e=this.streams;if(0===e.length){this.eof=!0;return}const t=e.shift();let a;try{a=t.getBytes()}catch(e){if(this._onError){this._onError(e,t.dict&&t.dict.objId);return}throw e}const r=this.bufferLength,n=r+a.length;this.ensureBuffer(n).set(a,r);this.bufferLength=n}getBaseStreams(){const e=[];for(const t of this.streams){const a=t.getBaseStreams();a&&e.push(...a)}return e.length>0?e:null}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.AsciiHexStream=void 0;var r=a(17);class AsciiHexStream extends r.DecodeStream{constructor(e,t){t&&(t*=.5);super(t);this.str=e;this.dict=e.dict;this.firstDigit=-1}readBlock(){const e=this.str.getBytes(8e3);if(!e.length){this.eof=!0;return}const t=e.length+1>>1,a=this.ensureBuffer(this.bufferLength+t);let r=this.bufferLength,n=this.firstDigit;for(const t of e){let e;if(t>=48&&t<=57)e=15&t;else{if(!(t>=65&&t<=70||t>=97&&t<=102)){if(62===t){this.eof=!0;break}continue}e=9+(15&t)}if(n<0)n=e;else{a[r++]=n<<4|e;n=-1}}if(n>=0&&this.eof){a[r++]=n<<4;n=-1}this.firstDigit=n;this.bufferLength=r}}t.AsciiHexStream=AsciiHexStream},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.CCITTFaxStream=void 0;var r=a(20),n=a(17),i=a(4);class CCITTFaxStream extends n.DecodeStream{constructor(e,t,a){super(t);this.str=e;this.dict=e.dict;a instanceof i.Dict||(a=i.Dict.empty);const n={next:()=>e.getByte()};this.ccittFaxDecoder=new r.CCITTFaxDecoder(n,{K:a.get("K"),EndOfLine:a.get("EndOfLine"),EncodedByteAlign:a.get("EncodedByteAlign"),Columns:a.get("Columns"),Rows:a.get("Rows"),EndOfBlock:a.get("EndOfBlock"),BlackIs1:a.get("BlackIs1")})}readBlock(){for(;!this.eof;){const e=this.ccittFaxDecoder.readNextChar();if(-1===e){this.eof=!0;return}this.ensureBuffer(this.bufferLength+1);this.buffer[this.bufferLength++]=e}}}t.CCITTFaxStream=CCITTFaxStream},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.CCITTFaxDecoder=void 0;var r=a(2);const n=-1,i=[[-1,-1],[-1,-1],[7,8],[7,7],[6,6],[6,6],[6,5],[6,5],[4,0],[4,0],[4,0],[4,0],[4,0],[4,0],[4,0],[4,0],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2]],s=[[-1,-1],[12,-2],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[11,1792],[11,1792],[12,1984],[12,2048],[12,2112],[12,2176],[12,2240],[12,2304],[11,1856],[11,1856],[11,1920],[11,1920],[12,2368],[12,2432],[12,2496],[12,2560]],o=[[-1,-1],[-1,-1],[-1,-1],[-1,-1],[8,29],[8,29],[8,30],[8,30],[8,45],[8,45],[8,46],[8,46],[7,22],[7,22],[7,22],[7,22],[7,23],[7,23],[7,23],[7,23],[8,47],[8,47],[8,48],[8,48],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[7,20],[7,20],[7,20],[7,20],[8,33],[8,33],[8,34],[8,34],[8,35],[8,35],[8,36],[8,36],[8,37],[8,37],[8,38],[8,38],[7,19],[7,19],[7,19],[7,19],[8,31],[8,31],[8,32],[8,32],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[8,53],[8,53],[8,54],[8,54],[7,26],[7,26],[7,26],[7,26],[8,39],[8,39],[8,40],[8,40],[8,41],[8,41],[8,42],[8,42],[8,43],[8,43],[8,44],[8,44],[7,21],[7,21],[7,21],[7,21],[7,28],[7,28],[7,28],[7,28],[8,61],[8,61],[8,62],[8,62],[8,63],[8,63],[8,0],[8,0],[8,320],[8,320],[8,384],[8,384],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[7,27],[7,27],[7,27],[7,27],[8,59],[8,59],[8,60],[8,60],[9,1472],[9,1536],[9,1600],[9,1728],[7,18],[7,18],[7,18],[7,18],[7,24],[7,24],[7,24],[7,24],[8,49],[8,49],[8,50],[8,50],[8,51],[8,51],[8,52],[8,52],[7,25],[7,25],[7,25],[7,25],[8,55],[8,55],[8,56],[8,56],[8,57],[8,57],[8,58],[8,58],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[8,448],[8,448],[8,512],[8,512],[9,704],[9,768],[8,640],[8,640],[8,576],[8,576],[9,832],[9,896],[9,960],[9,1024],[9,1088],[9,1152],[9,1216],[9,1280],[9,1344],[9,1408],[7,256],[7,256],[7,256],[7,256],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7]],c=[[-1,-1],[-1,-1],[12,-2],[12,-2],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[11,1792],[11,1792],[11,1792],[11,1792],[12,1984],[12,1984],[12,2048],[12,2048],[12,2112],[12,2112],[12,2176],[12,2176],[12,2240],[12,2240],[12,2304],[12,2304],[11,1856],[11,1856],[11,1856],[11,1856],[11,1920],[11,1920],[11,1920],[11,1920],[12,2368],[12,2368],[12,2432],[12,2432],[12,2496],[12,2496],[12,2560],[12,2560],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[12,52],[12,52],[13,640],[13,704],[13,768],[13,832],[12,55],[12,55],[12,56],[12,56],[13,1280],[13,1344],[13,1408],[13,1472],[12,59],[12,59],[12,60],[12,60],[13,1536],[13,1600],[11,24],[11,24],[11,24],[11,24],[11,25],[11,25],[11,25],[11,25],[13,1664],[13,1728],[12,320],[12,320],[12,384],[12,384],[12,448],[12,448],[13,512],[13,576],[12,53],[12,53],[12,54],[12,54],[13,896],[13,960],[13,1024],[13,1088],[13,1152],[13,1216],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64]],l=[[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[11,23],[11,23],[12,50],[12,51],[12,44],[12,45],[12,46],[12,47],[12,57],[12,58],[12,61],[12,256],[10,16],[10,16],[10,16],[10,16],[10,17],[10,17],[10,17],[10,17],[12,48],[12,49],[12,62],[12,63],[12,30],[12,31],[12,32],[12,33],[12,40],[12,41],[11,22],[11,22],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[12,128],[12,192],[12,26],[12,27],[12,28],[12,29],[11,19],[11,19],[11,20],[11,20],[12,34],[12,35],[12,36],[12,37],[12,38],[12,39],[11,21],[11,21],[12,42],[12,43],[10,0],[10,0],[10,0],[10,0],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12]],h=[[-1,-1],[-1,-1],[-1,-1],[-1,-1],[6,9],[6,8],[5,7],[5,7],[4,6],[4,6],[4,6],[4,6],[4,5],[4,5],[4,5],[4,5],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2]];t.CCITTFaxDecoder=class CCITTFaxDecoder{constructor(e,t={}){if(!e||"function"!=typeof e.next)throw new Error('CCITTFaxDecoder - invalid "source" parameter.');this.source=e;this.eof=!1;this.encoding=t.K||0;this.eoline=t.EndOfLine||!1;this.byteAlign=t.EncodedByteAlign||!1;this.columns=t.Columns||1728;this.rows=t.Rows||0;let a,r=t.EndOfBlock;null==r&&(r=!0);this.eoblock=r;this.black=t.BlackIs1||!1;this.codingLine=new Uint32Array(this.columns+1);this.refLine=new Uint32Array(this.columns+2);this.codingLine[0]=this.columns;this.codingPos=0;this.row=0;this.nextLine2D=this.encoding<0;this.inputBits=0;this.inputBuf=0;this.outputBits=0;this.rowsDone=!1;for(;0===(a=this._lookBits(12));)this._eatBits(1);1===a&&this._eatBits(12);if(this.encoding>0){this.nextLine2D=!this._lookBits(1);this._eatBits(1)}}readNextChar(){if(this.eof)return-1;const e=this.refLine,t=this.codingLine,a=this.columns;let i,s,o,c,l;if(0===this.outputBits){this.rowsDone&&(this.eof=!0);if(this.eof)return-1;this.err=!1;let o,l,h;if(this.nextLine2D){for(c=0;t[c]<a;++c)e[c]=t[c];e[c++]=a;e[c]=a;t[0]=0;this.codingPos=0;i=0;s=0;for(;t[this.codingPos]<a;){o=this._getTwoDimCode();switch(o){case 0:this._addPixels(e[i+1],s);e[i+1]<a&&(i+=2);break;case 1:o=l=0;if(s){do{o+=h=this._getBlackCode()}while(h>=64);do{l+=h=this._getWhiteCode()}while(h>=64)}else{do{o+=h=this._getWhiteCode()}while(h>=64);do{l+=h=this._getBlackCode()}while(h>=64)}this._addPixels(t[this.codingPos]+o,s);t[this.codingPos]<a&&this._addPixels(t[this.codingPos]+l,1^s);for(;e[i]<=t[this.codingPos]&&e[i]<a;)i+=2;break;case 7:this._addPixels(e[i]+3,s);s^=1;if(t[this.codingPos]<a){++i;for(;e[i]<=t[this.codingPos]&&e[i]<a;)i+=2}break;case 5:this._addPixels(e[i]+2,s);s^=1;if(t[this.codingPos]<a){++i;for(;e[i]<=t[this.codingPos]&&e[i]<a;)i+=2}break;case 3:this._addPixels(e[i]+1,s);s^=1;if(t[this.codingPos]<a){++i;for(;e[i]<=t[this.codingPos]&&e[i]<a;)i+=2}break;case 2:this._addPixels(e[i],s);s^=1;if(t[this.codingPos]<a){++i;for(;e[i]<=t[this.codingPos]&&e[i]<a;)i+=2}break;case 8:this._addPixelsNeg(e[i]-3,s);s^=1;if(t[this.codingPos]<a){i>0?--i:++i;for(;e[i]<=t[this.codingPos]&&e[i]<a;)i+=2}break;case 6:this._addPixelsNeg(e[i]-2,s);s^=1;if(t[this.codingPos]<a){i>0?--i:++i;for(;e[i]<=t[this.codingPos]&&e[i]<a;)i+=2}break;case 4:this._addPixelsNeg(e[i]-1,s);s^=1;if(t[this.codingPos]<a){i>0?--i:++i;for(;e[i]<=t[this.codingPos]&&e[i]<a;)i+=2}break;case n:this._addPixels(a,0);this.eof=!0;break;default:(0,r.info)("bad 2d code");this._addPixels(a,0);this.err=!0}}}else{t[0]=0;this.codingPos=0;s=0;for(;t[this.codingPos]<a;){o=0;if(s)do{o+=h=this._getBlackCode()}while(h>=64);else do{o+=h=this._getWhiteCode()}while(h>=64);this._addPixels(t[this.codingPos]+o,s);s^=1}}let u=!1;this.byteAlign&&(this.inputBits&=-8);if(this.eoblock||this.row!==this.rows-1){o=this._lookBits(12);if(this.eoline)for(;o!==n&&1!==o;){this._eatBits(1);o=this._lookBits(12)}else for(;0===o;){this._eatBits(1);o=this._lookBits(12)}if(1===o){this._eatBits(12);u=!0}else o===n&&(this.eof=!0)}else this.rowsDone=!0;if(!this.eof&&this.encoding>0&&!this.rowsDone){this.nextLine2D=!this._lookBits(1);this._eatBits(1)}if(this.eoblock&&u&&this.byteAlign){o=this._lookBits(12);if(1===o){this._eatBits(12);if(this.encoding>0){this._lookBits(1);this._eatBits(1)}if(this.encoding>=0)for(c=0;c<4;++c){o=this._lookBits(12);1!==o&&(0,r.info)("bad rtc code: "+o);this._eatBits(12);if(this.encoding>0){this._lookBits(1);this._eatBits(1)}}this.eof=!0}}else if(this.err&&this.eoline){for(;;){o=this._lookBits(13);if(o===n){this.eof=!0;return-1}if(o>>1==1)break;this._eatBits(1)}this._eatBits(12);if(this.encoding>0){this._eatBits(1);this.nextLine2D=!(1&o)}}t[0]>0?this.outputBits=t[this.codingPos=0]:this.outputBits=t[this.codingPos=1];this.row++}if(this.outputBits>=8){l=1&this.codingPos?0:255;this.outputBits-=8;if(0===this.outputBits&&t[this.codingPos]<a){this.codingPos++;this.outputBits=t[this.codingPos]-t[this.codingPos-1]}}else{o=8;l=0;do{if("number"!=typeof this.outputBits)throw new r.FormatError('Invalid /CCITTFaxDecode data, "outputBits" must be a number.');if(this.outputBits>o){l<<=o;1&this.codingPos||(l|=255>>8-o);this.outputBits-=o;o=0}else{l<<=this.outputBits;1&this.codingPos||(l|=255>>8-this.outputBits);o-=this.outputBits;this.outputBits=0;if(t[this.codingPos]<a){this.codingPos++;this.outputBits=t[this.codingPos]-t[this.codingPos-1]}else if(o>0){l<<=o;o=0}}}while(o)}this.black&&(l^=255);return l}_addPixels(e,t){const a=this.codingLine;let n=this.codingPos;if(e>a[n]){if(e>this.columns){(0,r.info)("row is wrong length");this.err=!0;e=this.columns}1&n^t&&++n;a[n]=e}this.codingPos=n}_addPixelsNeg(e,t){const a=this.codingLine;let n=this.codingPos;if(e>a[n]){if(e>this.columns){(0,r.info)("row is wrong length");this.err=!0;e=this.columns}1&n^t&&++n;a[n]=e}else if(e<a[n]){if(e<0){(0,r.info)("invalid code");this.err=!0;e=0}for(;n>0&&e<a[n-1];)--n;a[n]=e}this.codingPos=n}_findTableCode(e,t,a,r){const i=r||0;for(let r=e;r<=t;++r){let e=this._lookBits(r);if(e===n)return[!0,1,!1];r<t&&(e<<=t-r);if(!i||e>=i){const t=a[e-i];if(t[0]===r){this._eatBits(r);return[!0,t[1],!0]}}}return[!1,0,!1]}_getTwoDimCode(){let e,t=0;if(this.eoblock){t=this._lookBits(7);e=i[t];if(e&&e[0]>0){this._eatBits(e[0]);return e[1]}}else{const e=this._findTableCode(1,7,i);if(e[0]&&e[2])return e[1]}(0,r.info)("Bad two dim code");return n}_getWhiteCode(){let e,t=0;if(this.eoblock){t=this._lookBits(12);if(t===n)return 1;e=t>>5==0?s[t]:o[t>>3];if(e[0]>0){this._eatBits(e[0]);return e[1]}}else{let e=this._findTableCode(1,9,o);if(e[0])return e[1];e=this._findTableCode(11,12,s);if(e[0])return e[1]}(0,r.info)("bad white code");this._eatBits(1);return 1}_getBlackCode(){let e,t;if(this.eoblock){e=this._lookBits(13);if(e===n)return 1;t=e>>7==0?c[e]:e>>9==0&&e>>7!=0?l[(e>>1)-64]:h[e>>7];if(t[0]>0){this._eatBits(t[0]);return t[1]}}else{let e=this._findTableCode(2,6,h);if(e[0])return e[1];e=this._findTableCode(7,12,l,64);if(e[0])return e[1];e=this._findTableCode(10,13,c);if(e[0])return e[1]}(0,r.info)("bad black code");this._eatBits(1);return 1}_lookBits(e){let t;for(;this.inputBits<e;){if(-1===(t=this.source.next()))return 0===this.inputBits?n:this.inputBuf<<e-this.inputBits&65535>>16-e;this.inputBuf=this.inputBuf<<8|t;this.inputBits+=8}return this.inputBuf>>this.inputBits-e&65535>>16-e}_eatBits(e){(this.inputBits-=e)<0&&(this.inputBits=0)}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.FlateStream=void 0;var r=a(17),n=a(2);const i=new Int32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=new Int32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),o=new Int32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),c=[new Int32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],l=[new Int32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5];class FlateStream extends r.DecodeStream{constructor(e,t){super(t);this.str=e;this.dict=e.dict;const a=e.getByte(),r=e.getByte();if(-1===a||-1===r)throw new n.FormatError(`Invalid header in flate stream: ${a}, ${r}`);if(8!=(15&a))throw new n.FormatError(`Unknown compression method in flate stream: ${a}, ${r}`);if(((a<<8)+r)%31!=0)throw new n.FormatError(`Bad FCHECK in flate stream: ${a}, ${r}`);if(32&r)throw new n.FormatError(`FDICT bit set in flate stream: ${a}, ${r}`);this.codeSize=0;this.codeBuf=0}getBits(e){const t=this.str;let a,r=this.codeSize,i=this.codeBuf;for(;r<e;){if(-1===(a=t.getByte()))throw new n.FormatError("Bad encoding in flate stream");i|=a<<r;r+=8}a=i&(1<<e)-1;this.codeBuf=i>>e;this.codeSize=r-=e;return a}getCode(e){const t=this.str,a=e[0],r=e[1];let i,s=this.codeSize,o=this.codeBuf;for(;s<r&&-1!==(i=t.getByte());){o|=i<<s;s+=8}const c=a[o&(1<<r)-1],l=c>>16,h=65535&c;if(l<1||s<l)throw new n.FormatError("Bad encoding in flate stream");this.codeBuf=o>>l;this.codeSize=s-l;return h}generateHuffmanTable(e){const t=e.length;let a,r=0;for(a=0;a<t;++a)e[a]>r&&(r=e[a]);const n=1<<r,i=new Int32Array(n);for(let s=1,o=0,c=2;s<=r;++s,o<<=1,c<<=1)for(let r=0;r<t;++r)if(e[r]===s){let e=0,t=o;for(a=0;a<s;++a){e=e<<1|1&t;t>>=1}for(a=e;a<n;a+=c)i[a]=s<<16|r;++o}return[i,r]}readBlock(){let e,t;const a=this.str;let r,h,u=this.getBits(3);1&u&&(this.eof=!0);u>>=1;if(0===u){let t;if(-1===(t=a.getByte()))throw new n.FormatError("Bad block header in flate stream");let r=t;if(-1===(t=a.getByte()))throw new n.FormatError("Bad block header in flate stream");r|=t<<8;if(-1===(t=a.getByte()))throw new n.FormatError("Bad block header in flate stream");let i=t;if(-1===(t=a.getByte()))throw new n.FormatError("Bad block header in flate stream");i|=t<<8;if(i!==(65535&~r)&&(0!==r||0!==i))throw new n.FormatError("Bad uncompressed block length in flate stream");this.codeBuf=0;this.codeSize=0;const s=this.bufferLength,o=s+r;e=this.ensureBuffer(o);this.bufferLength=o;if(0===r)-1===a.peekByte()&&(this.eof=!0);else{const t=a.getBytes(r);e.set(t,s);t.length<r&&(this.eof=!0)}return}if(1===u){r=c;h=l}else{if(2!==u)throw new n.FormatError("Unknown block type in flate stream");{const e=this.getBits(5)+257,a=this.getBits(5)+1,n=this.getBits(4)+4,s=new Uint8Array(i.length);let o;for(o=0;o<n;++o)s[i[o]]=this.getBits(3);const c=this.generateHuffmanTable(s);t=0;o=0;const l=e+a,u=new Uint8Array(l);let d,f,g;for(;o<l;){const e=this.getCode(c);if(16===e){d=2;f=3;g=t}else if(17===e){d=3;f=3;g=t=0}else{if(18!==e){u[o++]=t=e;continue}d=7;f=11;g=t=0}let a=this.getBits(d)+f;for(;a-- >0;)u[o++]=g}r=this.generateHuffmanTable(u.subarray(0,e));h=this.generateHuffmanTable(u.subarray(e,l))}}e=this.buffer;let d=e?e.length:0,f=this.bufferLength;for(;;){let a=this.getCode(r);if(a<256){if(f+1>=d){e=this.ensureBuffer(f+1);d=e.length}e[f++]=a;continue}if(256===a){this.bufferLength=f;return}a-=257;a=s[a];let n=a>>16;n>0&&(n=this.getBits(n));t=(65535&a)+n;a=this.getCode(h);a=o[a];n=a>>16;n>0&&(n=this.getBits(n));const i=(65535&a)+n;if(f+t>=d){e=this.ensureBuffer(f+t);d=e.length}for(let a=0;a<t;++a,++f)e[f]=e[f-i]}}}t.FlateStream=FlateStream},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.Jbig2Stream=void 0;var r=a(5),n=a(17),i=a(4),s=a(23),o=a(2);class Jbig2Stream extends n.DecodeStream{constructor(e,t,a){super(t);this.stream=e;this.dict=e.dict;this.maybeLength=t;this.params=a}get bytes(){return(0,o.shadow)(this,"bytes",this.stream.getBytes(this.maybeLength))}ensureBuffer(e){}readBlock(){if(this.eof)return;const e=new s.Jbig2Image,t=[];if(this.params instanceof i.Dict){const e=this.params.get("JBIG2Globals");if(e instanceof r.BaseStream){const a=e.getBytes();t.push({data:a,start:0,end:a.length})}}t.push({data:this.bytes,start:0,end:this.bytes.length});const a=e.parseChunks(t),n=a.length;for(let e=0;e<n;e++)a[e]^=255;this.buffer=a;this.bufferLength=n;this.eof=!0}}t.Jbig2Stream=Jbig2Stream},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.Jbig2Image=void 0;var r=a(2),n=a(3),i=a(24),s=a(20);class Jbig2Error extends r.BaseException{constructor(e){super(`JBIG2 error: ${e}`,"Jbig2Error")}}class ContextCache{getContexts(e){return e in this?this[e]:this[e]=new Int8Array(65536)}}class DecodingContext{constructor(e,t,a){this.data=e;this.start=t;this.end=a}get decoder(){const e=new i.ArithmeticDecoder(this.data,this.start,this.end);return(0,r.shadow)(this,"decoder",e)}get contextCache(){const e=new ContextCache;return(0,r.shadow)(this,"contextCache",e)}}const o=2**31-1,c=-(2**31);function decodeInteger(e,t,a){const r=e.getContexts(t);let n=1;function readBits(e){let t=0;for(let i=0;i<e;i++){const e=a.readBit(r,n);n=n<256?n<<1|e:511&(n<<1|e)|256;t=t<<1|e}return t>>>0}const i=readBits(1),s=readBits(1)?readBits(1)?readBits(1)?readBits(1)?readBits(1)?readBits(32)+4436:readBits(12)+340:readBits(8)+84:readBits(6)+20:readBits(4)+4:readBits(2);let l;0===i?l=s:s>0&&(l=-s);return l>=c&&l<=o?l:null}function decodeIAID(e,t,a){const r=e.getContexts("IAID");let n=1;for(let e=0;e<a;e++){n=n<<1|t.readBit(r,n)}return a<31?n&(1<<a)-1:2147483647&n}const l=["SymbolDictionary",null,null,null,"IntermediateTextRegion",null,"ImmediateTextRegion","ImmediateLosslessTextRegion",null,null,null,null,null,null,null,null,"PatternDictionary",null,null,null,"IntermediateHalftoneRegion",null,"ImmediateHalftoneRegion","ImmediateLosslessHalftoneRegion",null,null,null,null,null,null,null,null,null,null,null,null,"IntermediateGenericRegion",null,"ImmediateGenericRegion","ImmediateLosslessGenericRegion","IntermediateGenericRefinementRegion",null,"ImmediateGenericRefinementRegion","ImmediateLosslessGenericRefinementRegion",null,null,null,null,"PageInformation","EndOfPage","EndOfStripe","EndOfFile","Profiles","Tables",null,null,null,null,null,null,null,null,"Extension"],h=[[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:2,y:-1},{x:-4,y:0},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}],[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:2,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:2,y:-1},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}],[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-2,y:0},{x:-1,y:0}],[{x:-3,y:-1},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-4,y:0},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}]],u=[{coding:[{x:0,y:-1},{x:1,y:-1},{x:-1,y:0}],reference:[{x:0,y:-1},{x:1,y:-1},{x:-1,y:0},{x:0,y:0},{x:1,y:0},{x:-1,y:1},{x:0,y:1},{x:1,y:1}]},{coding:[{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-1,y:0}],reference:[{x:0,y:-1},{x:-1,y:0},{x:0,y:0},{x:1,y:0},{x:0,y:1},{x:1,y:1}]}],d=[39717,1941,229,405],f=[32,8];function decodeBitmap(e,t,a,r,n,i,s,o){if(e){return decodeMMRBitmap(new Reader(o.data,o.start,o.end),t,a,!1)}if(0===r&&!i&&!n&&4===s.length&&3===s[0].x&&-1===s[0].y&&-3===s[1].x&&-1===s[1].y&&2===s[2].x&&-2===s[2].y&&-2===s[3].x&&-2===s[3].y)return function decodeBitmapTemplate0(e,t,a){const r=a.decoder,n=a.contextCache.getContexts("GB"),i=[];let s,o,c,l,h,u,d;for(o=0;o<t;o++){h=i[o]=new Uint8Array(e);u=o<1?h:i[o-1];d=o<2?h:i[o-2];s=d[0]<<13|d[1]<<12|d[2]<<11|u[0]<<7|u[1]<<6|u[2]<<5|u[3]<<4;for(c=0;c<e;c++){h[c]=l=r.readBit(n,s);s=(31735&s)<<1|(c+3<e?d[c+3]<<11:0)|(c+4<e?u[c+4]<<4:0)|l}}return i}(t,a,o);const c=!!i,l=h[r].concat(s);l.sort((function(e,t){return e.y-t.y||e.x-t.x}));const u=l.length,f=new Int8Array(u),g=new Int8Array(u),p=[];let m,b,y=0,w=0,S=0,x=0;for(b=0;b<u;b++){f[b]=l[b].x;g[b]=l[b].y;w=Math.min(w,l[b].x);S=Math.max(S,l[b].x);x=Math.min(x,l[b].y);b<u-1&&l[b].y===l[b+1].y&&l[b].x===l[b+1].x-1?y|=1<<u-1-b:p.push(b)}const C=p.length,k=new Int8Array(C),v=new Int8Array(C),F=new Uint16Array(C);for(m=0;m<C;m++){b=p[m];k[m]=l[b].x;v[m]=l[b].y;F[m]=1<<u-1-b}const O=-w,T=-x,M=t-S,E=d[r];let D=new Uint8Array(t);const N=[],R=o.decoder,L=o.contextCache.getContexts("GB");let j,$,_,U,X,H=0,q=0;for(let e=0;e<a;e++){if(n){H^=R.readBit(L,E);if(H){N.push(D);continue}}D=new Uint8Array(D);N.push(D);for(j=0;j<t;j++){if(c&&i[e][j]){D[j]=0;continue}if(j>=O&&j<M&&e>=T){q=q<<1&y;for(b=0;b<C;b++){$=e+v[b];_=j+k[b];U=N[$][_];if(U){U=F[b];q|=U}}}else{q=0;X=u-1;for(b=0;b<u;b++,X--){_=j+f[b];if(_>=0&&_<t){$=e+g[b];if($>=0){U=N[$][_];U&&(q|=U<<X)}}}}const a=R.readBit(L,q);D[j]=a}}return N}function decodeRefinement(e,t,a,r,n,i,s,o,c){let l=u[a].coding;0===a&&(l=l.concat([o[0]]));const h=l.length,d=new Int32Array(h),g=new Int32Array(h);let p;for(p=0;p<h;p++){d[p]=l[p].x;g[p]=l[p].y}let m=u[a].reference;0===a&&(m=m.concat([o[1]]));const b=m.length,y=new Int32Array(b),w=new Int32Array(b);for(p=0;p<b;p++){y[p]=m[p].x;w[p]=m[p].y}const S=r[0].length,x=r.length,C=f[a],k=[],v=c.decoder,F=c.contextCache.getContexts("GR");let O=0;for(let a=0;a<t;a++){if(s){O^=v.readBit(F,C);if(O)throw new Jbig2Error("prediction is not supported")}const t=new Uint8Array(e);k.push(t);for(let s=0;s<e;s++){let o,c,l=0;for(p=0;p<h;p++){o=a+g[p];c=s+d[p];o<0||c<0||c>=e?l<<=1:l=l<<1|k[o][c]}for(p=0;p<b;p++){o=a+w[p]-i;c=s+y[p]-n;o<0||o>=x||c<0||c>=S?l<<=1:l=l<<1|r[o][c]}const u=v.readBit(F,l);t[s]=u}}return k}function decodeTextRegion(e,t,a,r,n,i,s,o,c,l,h,u,d,f,g,p,m,b,y){if(e&&t)throw new Jbig2Error("refinement with Huffman is not supported");const w=[];let S,x;for(S=0;S<r;S++){x=new Uint8Array(a);if(n)for(let e=0;e<a;e++)x[e]=n;w.push(x)}const C=m.decoder,k=m.contextCache;let v=e?-f.tableDeltaT.decode(y):-decodeInteger(k,"IADT",C),F=0;S=0;for(;S<i;){v+=e?f.tableDeltaT.decode(y):decodeInteger(k,"IADT",C);F+=e?f.tableFirstS.decode(y):decodeInteger(k,"IAFS",C);let r=F;for(;;){let n=0;s>1&&(n=e?y.readBits(b):decodeInteger(k,"IAIT",C));const i=s*v+n,F=e?f.symbolIDTable.decode(y):decodeIAID(k,C,c),O=t&&(e?y.readBit():decodeInteger(k,"IARI",C));let T=o[F],M=T[0].length,E=T.length;if(O){const e=decodeInteger(k,"IARDW",C),t=decodeInteger(k,"IARDH",C);M+=e;E+=t;T=decodeRefinement(M,E,g,T,(e>>1)+decodeInteger(k,"IARDX",C),(t>>1)+decodeInteger(k,"IARDY",C),!1,p,m)}const D=i-(1&u?0:E-1),N=r-(2&u?M-1:0);let R,L,j;if(l){for(R=0;R<E;R++){x=w[N+R];if(!x)continue;j=T[R];const e=Math.min(a-D,M);switch(d){case 0:for(L=0;L<e;L++)x[D+L]|=j[L];break;case 2:for(L=0;L<e;L++)x[D+L]^=j[L];break;default:throw new Jbig2Error(`operator ${d} is not supported`)}}r+=E-1}else{for(L=0;L<E;L++){x=w[D+L];if(x){j=T[L];switch(d){case 0:for(R=0;R<M;R++)x[N+R]|=j[R];break;case 2:for(R=0;R<M;R++)x[N+R]^=j[R];break;default:throw new Jbig2Error(`operator ${d} is not supported`)}}}r+=M-1}S++;const $=e?f.tableDeltaS.decode(y):decodeInteger(k,"IADS",C);if(null===$)break;r+=$+h}}return w}function readSegmentHeader(e,t){const a={};a.number=(0,n.readUint32)(e,t);const r=e[t+4],i=63&r;if(!l[i])throw new Jbig2Error("invalid segment type: "+i);a.type=i;a.typeName=l[i];a.deferredNonRetain=!!(128&r);const s=!!(64&r),o=e[t+5];let c=o>>5&7;const h=[31&o];let u=t+6;if(7===o){c=536870911&(0,n.readUint32)(e,u-1);u+=3;let t=c+7>>3;h[0]=e[u++];for(;--t>0;)h.push(e[u++])}else if(5===o||6===o)throw new Jbig2Error("invalid referred-to flags");a.retainBits=h;let d=4;a.number<=256?d=1:a.number<=65536&&(d=2);const f=[];let p,m;for(p=0;p<c;p++){let t;t=1===d?e[u]:2===d?(0,n.readUint16)(e,u):(0,n.readUint32)(e,u);f.push(t);u+=d}a.referredTo=f;if(s){a.pageAssociation=(0,n.readUint32)(e,u);u+=4}else a.pageAssociation=e[u++];a.length=(0,n.readUint32)(e,u);u+=4;if(4294967295===a.length){if(38!==i)throw new Jbig2Error("invalid unknown segment length");{const t=readRegionSegmentInformation(e,u),r=!!(1&e[u+g]),n=6,i=new Uint8Array(n);if(!r){i[0]=255;i[1]=172}i[2]=t.height>>>24&255;i[3]=t.height>>16&255;i[4]=t.height>>8&255;i[5]=255&t.height;for(p=u,m=e.length;p<m;p++){let t=0;for(;t<n&&i[t]===e[p+t];)t++;if(t===n){a.length=p+n;break}}if(4294967295===a.length)throw new Jbig2Error("segment end was not found")}}a.headerEnd=u;return a}function readSegments(e,t,a,r){const n=[];let i=a;for(;i<r;){const a=readSegmentHeader(t,i);i=a.headerEnd;const r={header:a,data:t};if(!e.randomAccess){r.start=i;i+=a.length;r.end=i}n.push(r);if(51===a.type)break}if(e.randomAccess)for(let e=0,t=n.length;e<t;e++){n[e].start=i;i+=n[e].header.length;n[e].end=i}return n}function readRegionSegmentInformation(e,t){return{width:(0,n.readUint32)(e,t),height:(0,n.readUint32)(e,t+4),x:(0,n.readUint32)(e,t+8),y:(0,n.readUint32)(e,t+12),combinationOperator:7&e[t+16]}}const g=17;function processSegment(e,t){const a=e.header,r=e.data,i=e.end;let s,o,c,l,h=e.start;switch(a.type){case 0:const e={},t=(0,n.readUint16)(r,h);e.huffman=!!(1&t);e.refinement=!!(2&t);e.huffmanDHSelector=t>>2&3;e.huffmanDWSelector=t>>4&3;e.bitmapSizeSelector=t>>6&1;e.aggregationInstancesSelector=t>>7&1;e.bitmapCodingContextUsed=!!(256&t);e.bitmapCodingContextRetained=!!(512&t);e.template=t>>10&3;e.refinementTemplate=t>>12&1;h+=2;if(!e.huffman){l=0===e.template?4:1;o=[];for(c=0;c<l;c++){o.push({x:(0,n.readInt8)(r,h),y:(0,n.readInt8)(r,h+1)});h+=2}e.at=o}if(e.refinement&&!e.refinementTemplate){o=[];for(c=0;c<2;c++){o.push({x:(0,n.readInt8)(r,h),y:(0,n.readInt8)(r,h+1)});h+=2}e.refinementAt=o}e.numberOfExportedSymbols=(0,n.readUint32)(r,h);h+=4;e.numberOfNewSymbols=(0,n.readUint32)(r,h);h+=4;s=[e,a.number,a.referredTo,r,h,i];break;case 6:case 7:const u={};u.info=readRegionSegmentInformation(r,h);h+=g;const d=(0,n.readUint16)(r,h);h+=2;u.huffman=!!(1&d);u.refinement=!!(2&d);u.logStripSize=d>>2&3;u.stripSize=1<<u.logStripSize;u.referenceCorner=d>>4&3;u.transposed=!!(64&d);u.combinationOperator=d>>7&3;u.defaultPixelValue=d>>9&1;u.dsOffset=d<<17>>27;u.refinementTemplate=d>>15&1;if(u.huffman){const e=(0,n.readUint16)(r,h);h+=2;u.huffmanFS=3&e;u.huffmanDS=e>>2&3;u.huffmanDT=e>>4&3;u.huffmanRefinementDW=e>>6&3;u.huffmanRefinementDH=e>>8&3;u.huffmanRefinementDX=e>>10&3;u.huffmanRefinementDY=e>>12&3;u.huffmanRefinementSizeSelector=!!(16384&e)}if(u.refinement&&!u.refinementTemplate){o=[];for(c=0;c<2;c++){o.push({x:(0,n.readInt8)(r,h),y:(0,n.readInt8)(r,h+1)});h+=2}u.refinementAt=o}u.numberOfSymbolInstances=(0,n.readUint32)(r,h);h+=4;s=[u,a.referredTo,r,h,i];break;case 16:const f={},p=r[h++];f.mmr=!!(1&p);f.template=p>>1&3;f.patternWidth=r[h++];f.patternHeight=r[h++];f.maxPatternIndex=(0,n.readUint32)(r,h);h+=4;s=[f,a.number,r,h,i];break;case 22:case 23:const m={};m.info=readRegionSegmentInformation(r,h);h+=g;const b=r[h++];m.mmr=!!(1&b);m.template=b>>1&3;m.enableSkip=!!(8&b);m.combinationOperator=b>>4&7;m.defaultPixelValue=b>>7&1;m.gridWidth=(0,n.readUint32)(r,h);h+=4;m.gridHeight=(0,n.readUint32)(r,h);h+=4;m.gridOffsetX=4294967295&(0,n.readUint32)(r,h);h+=4;m.gridOffsetY=4294967295&(0,n.readUint32)(r,h);h+=4;m.gridVectorX=(0,n.readUint16)(r,h);h+=2;m.gridVectorY=(0,n.readUint16)(r,h);h+=2;s=[m,a.referredTo,r,h,i];break;case 38:case 39:const y={};y.info=readRegionSegmentInformation(r,h);h+=g;const w=r[h++];y.mmr=!!(1&w);y.template=w>>1&3;y.prediction=!!(8&w);if(!y.mmr){l=0===y.template?4:1;o=[];for(c=0;c<l;c++){o.push({x:(0,n.readInt8)(r,h),y:(0,n.readInt8)(r,h+1)});h+=2}y.at=o}s=[y,r,h,i];break;case 48:const S={width:(0,n.readUint32)(r,h),height:(0,n.readUint32)(r,h+4),resolutionX:(0,n.readUint32)(r,h+8),resolutionY:(0,n.readUint32)(r,h+12)};4294967295===S.height&&delete S.height;const x=r[h+16];(0,n.readUint16)(r,h+17);S.lossless=!!(1&x);S.refinement=!!(2&x);S.defaultPixelValue=x>>2&1;S.combinationOperator=x>>3&3;S.requiresBuffer=!!(32&x);S.combinationOperatorOverride=!!(64&x);s=[S];break;case 49:case 50:case 51:case 62:break;case 53:s=[a.number,r,h,i];break;default:throw new Jbig2Error(`segment type ${a.typeName}(${a.type}) is not implemented`)}const u="on"+a.typeName;u in t&&t[u].apply(t,s)}function processSegments(e,t){for(let a=0,r=e.length;a<r;a++)processSegment(e[a],t)}class SimpleSegmentVisitor{onPageInformation(e){this.currentPageInfo=e;const t=e.width+7>>3,a=new Uint8ClampedArray(t*e.height);e.defaultPixelValue&&a.fill(255);this.buffer=a}drawBitmap(e,t){const a=this.currentPageInfo,r=e.width,n=e.height,i=a.width+7>>3,s=a.combinationOperatorOverride?e.combinationOperator:a.combinationOperator,o=this.buffer,c=128>>(7&e.x);let l,h,u,d,f=e.y*i+(e.x>>3);switch(s){case 0:for(l=0;l<n;l++){u=c;d=f;for(h=0;h<r;h++){t[l][h]&&(o[d]|=u);u>>=1;if(!u){u=128;d++}}f+=i}break;case 2:for(l=0;l<n;l++){u=c;d=f;for(h=0;h<r;h++){t[l][h]&&(o[d]^=u);u>>=1;if(!u){u=128;d++}}f+=i}break;default:throw new Jbig2Error(`operator ${s} is not supported`)}}onImmediateGenericRegion(e,t,a,r){const n=e.info,i=new DecodingContext(t,a,r),s=decodeBitmap(e.mmr,n.width,n.height,e.template,e.prediction,null,e.at,i);this.drawBitmap(n,s)}onImmediateLosslessGenericRegion(){this.onImmediateGenericRegion(...arguments)}onSymbolDictionary(e,t,a,r,i,s){let o,c;if(e.huffman){o=function getSymbolDictionaryHuffmanTables(e,t,a){let r,n,i,s,o=0;switch(e.huffmanDHSelector){case 0:case 1:r=getStandardTable(e.huffmanDHSelector+4);break;case 3:r=getCustomHuffmanTable(o,t,a);o++;break;default:throw new Jbig2Error("invalid Huffman DH selector")}switch(e.huffmanDWSelector){case 0:case 1:n=getStandardTable(e.huffmanDWSelector+2);break;case 3:n=getCustomHuffmanTable(o,t,a);o++;break;default:throw new Jbig2Error("invalid Huffman DW selector")}if(e.bitmapSizeSelector){i=getCustomHuffmanTable(o,t,a);o++}else i=getStandardTable(1);s=e.aggregationInstancesSelector?getCustomHuffmanTable(o,t,a):getStandardTable(1);return{tableDeltaHeight:r,tableDeltaWidth:n,tableBitmapSize:i,tableAggregateInstances:s}}(e,a,this.customTables);c=new Reader(r,i,s)}let l=this.symbols;l||(this.symbols=l={});const h=[];for(const e of a){const t=l[e];t&&h.push(...t)}const u=new DecodingContext(r,i,s);l[t]=function decodeSymbolDictionary(e,t,a,r,i,s,o,c,l,h,u,d){if(e&&t)throw new Jbig2Error("symbol refinement with Huffman is not supported");const f=[];let g=0,p=(0,n.log2)(a.length+r);const m=u.decoder,b=u.contextCache;let y,w;if(e){y=getStandardTable(1);w=[];p=Math.max(p,1)}for(;f.length<r;){g+=e?s.tableDeltaHeight.decode(d):decodeInteger(b,"IADH",m);let r=0,n=0;const i=e?w.length:0;for(;;){const i=e?s.tableDeltaWidth.decode(d):decodeInteger(b,"IADW",m);if(null===i)break;r+=i;n+=r;let y;if(t){const n=decodeInteger(b,"IAAI",m);if(n>1)y=decodeTextRegion(e,t,r,g,0,n,1,a.concat(f),p,0,0,1,0,s,l,h,u,0,d);else{const e=decodeIAID(b,m,p),t=decodeInteger(b,"IARDX",m),n=decodeInteger(b,"IARDY",m);y=decodeRefinement(r,g,l,e<a.length?a[e]:f[e-a.length],t,n,!1,h,u)}f.push(y)}else if(e)w.push(r);else{y=decodeBitmap(!1,r,g,o,!1,null,c,u);f.push(y)}}if(e&&!t){const e=s.tableBitmapSize.decode(d);d.byteAlign();let t;if(0===e)t=readUncompressedBitmap(d,n,g);else{const a=d.end,r=d.position+e;d.end=r;t=decodeMMRBitmap(d,n,g,!1);d.end=a;d.position=r}const a=w.length;if(i===a-1)f.push(t);else{let e,r,n,s,o,c=0;for(e=i;e<a;e++){s=w[e];n=c+s;o=[];for(r=0;r<g;r++)o.push(t[r].subarray(c,n));f.push(o);c=n}}}}const S=[],x=[];let C,k,v=!1;const F=a.length+r;for(;x.length<F;){let t=e?y.decode(d):decodeInteger(b,"IAEX",m);for(;t--;)x.push(v);v=!v}for(C=0,k=a.length;C<k;C++)x[C]&&S.push(a[C]);for(let e=0;e<r;C++,e++)x[C]&&S.push(f[e]);return S}(e.huffman,e.refinement,h,e.numberOfNewSymbols,e.numberOfExportedSymbols,o,e.template,e.at,e.refinementTemplate,e.refinementAt,u,c)}onImmediateTextRegion(e,t,a,r,i){const s=e.info;let o,c;const l=this.symbols,h=[];for(const e of t){const t=l[e];t&&h.push(...t)}const u=(0,n.log2)(h.length);if(e.huffman){c=new Reader(a,r,i);o=function getTextRegionHuffmanTables(e,t,a,r,n){const i=[];for(let e=0;e<=34;e++){const t=n.readBits(4);i.push(new HuffmanLine([e,t,0,0]))}const s=new HuffmanTable(i,!1);i.length=0;for(let e=0;e<r;){const t=s.decode(n);if(t>=32){let a,r,s;switch(t){case 32:if(0===e)throw new Jbig2Error("no previous value in symbol ID table");r=n.readBits(2)+3;a=i[e-1].prefixLength;break;case 33:r=n.readBits(3)+3;a=0;break;case 34:r=n.readBits(7)+11;a=0;break;default:throw new Jbig2Error("invalid code length in symbol ID table")}for(s=0;s<r;s++){i.push(new HuffmanLine([e,a,0,0]));e++}}else{i.push(new HuffmanLine([e,t,0,0]));e++}}n.byteAlign();const o=new HuffmanTable(i,!1);let c,l,h,u=0;switch(e.huffmanFS){case 0:case 1:c=getStandardTable(e.huffmanFS+6);break;case 3:c=getCustomHuffmanTable(u,t,a);u++;break;default:throw new Jbig2Error("invalid Huffman FS selector")}switch(e.huffmanDS){case 0:case 1:case 2:l=getStandardTable(e.huffmanDS+8);break;case 3:l=getCustomHuffmanTable(u,t,a);u++;break;default:throw new Jbig2Error("invalid Huffman DS selector")}switch(e.huffmanDT){case 0:case 1:case 2:h=getStandardTable(e.huffmanDT+11);break;case 3:h=getCustomHuffmanTable(u,t,a);u++;break;default:throw new Jbig2Error("invalid Huffman DT selector")}if(e.refinement)throw new Jbig2Error("refinement with Huffman is not supported");return{symbolIDTable:o,tableFirstS:c,tableDeltaS:l,tableDeltaT:h}}(e,t,this.customTables,h.length,c)}const d=new DecodingContext(a,r,i),f=decodeTextRegion(e.huffman,e.refinement,s.width,s.height,e.defaultPixelValue,e.numberOfSymbolInstances,e.stripSize,h,u,e.transposed,e.dsOffset,e.referenceCorner,e.combinationOperator,o,e.refinementTemplate,e.refinementAt,d,e.logStripSize,c);this.drawBitmap(s,f)}onImmediateLosslessTextRegion(){this.onImmediateTextRegion(...arguments)}onPatternDictionary(e,t,a,r,n){let i=this.patterns;i||(this.patterns=i={});const s=new DecodingContext(a,r,n);i[t]=function decodePatternDictionary(e,t,a,r,n,i){const s=[];if(!e){s.push({x:-t,y:0});0===n&&s.push({x:-3,y:-1},{x:2,y:-2},{x:-2,y:-2})}const o=decodeBitmap(e,(r+1)*t,a,n,!1,null,s,i),c=[];for(let e=0;e<=r;e++){const r=[],n=t*e,i=n+t;for(let e=0;e<a;e++)r.push(o[e].subarray(n,i));c.push(r)}return c}(e.mmr,e.patternWidth,e.patternHeight,e.maxPatternIndex,e.template,s)}onImmediateHalftoneRegion(e,t,a,r,i){const s=this.patterns[t[0]],o=e.info,c=new DecodingContext(a,r,i),l=function decodeHalftoneRegion(e,t,a,r,i,s,o,c,l,h,u,d,f,g,p){if(o)throw new Jbig2Error("skip is not supported");if(0!==c)throw new Jbig2Error(`operator "${c}" is not supported in halftone region`);const m=[];let b,y,w;for(b=0;b<i;b++){w=new Uint8Array(r);if(s)for(y=0;y<r;y++)w[y]=s;m.push(w)}const S=t.length,x=t[0],C=x[0].length,k=x.length,v=(0,n.log2)(S),F=[];if(!e){F.push({x:a<=1?3:2,y:-1});0===a&&F.push({x:-3,y:-1},{x:2,y:-2},{x:-2,y:-2})}const O=[];let T,M,E,D,N,R,L,j,$,_,U;e&&(T=new Reader(p.data,p.start,p.end));for(b=v-1;b>=0;b--){M=e?decodeMMRBitmap(T,l,h,!0):decodeBitmap(!1,l,h,a,!1,null,F,p);O[b]=M}for(E=0;E<h;E++)for(D=0;D<l;D++){N=0;R=0;for(y=v-1;y>=0;y--){N^=O[y][E][D];R|=N<<y}L=t[R];j=u+E*g+D*f>>8;$=d+E*f-D*g>>8;if(j>=0&&j+C<=r&&$>=0&&$+k<=i)for(b=0;b<k;b++){U=m[$+b];_=L[b];for(y=0;y<C;y++)U[j+y]|=_[y]}else{let e,t;for(b=0;b<k;b++){t=$+b;if(!(t<0||t>=i)){U=m[t];_=L[b];for(y=0;y<C;y++){e=j+y;e>=0&&e<r&&(U[e]|=_[y])}}}}}return m}(e.mmr,s,e.template,o.width,o.height,e.defaultPixelValue,e.enableSkip,e.combinationOperator,e.gridWidth,e.gridHeight,e.gridOffsetX,e.gridOffsetY,e.gridVectorX,e.gridVectorY,c);this.drawBitmap(o,l)}onImmediateLosslessHalftoneRegion(){this.onImmediateHalftoneRegion(...arguments)}onTables(e,t,a,r){let i=this.customTables;i||(this.customTables=i={});i[e]=function decodeTablesSegment(e,t,a){const r=e[t],i=4294967295&(0,n.readUint32)(e,t+1),s=4294967295&(0,n.readUint32)(e,t+5),o=new Reader(e,t+9,a),c=1+(r>>1&7),l=1+(r>>4&7),h=[];let u,d,f=i;do{u=o.readBits(c);d=o.readBits(l);h.push(new HuffmanLine([f,u,d,0]));f+=1<<d}while(f<s);u=o.readBits(c);h.push(new HuffmanLine([i-1,u,32,0,"lower"]));u=o.readBits(c);h.push(new HuffmanLine([s,u,32,0]));if(1&r){u=o.readBits(c);h.push(new HuffmanLine([u,0]))}return new HuffmanTable(h,!1)}(t,a,r)}}class HuffmanLine{constructor(e){if(2===e.length){this.isOOB=!0;this.rangeLow=0;this.prefixLength=e[0];this.rangeLength=0;this.prefixCode=e[1];this.isLowerRange=!1}else{this.isOOB=!1;this.rangeLow=e[0];this.prefixLength=e[1];this.rangeLength=e[2];this.prefixCode=e[3];this.isLowerRange="lower"===e[4]}}}class HuffmanTreeNode{constructor(e){this.children=[];if(e){this.isLeaf=!0;this.rangeLength=e.rangeLength;this.rangeLow=e.rangeLow;this.isLowerRange=e.isLowerRange;this.isOOB=e.isOOB}else this.isLeaf=!1}buildTree(e,t){const a=e.prefixCode>>t&1;if(t<=0)this.children[a]=new HuffmanTreeNode(e);else{let r=this.children[a];r||(this.children[a]=r=new HuffmanTreeNode(null));r.buildTree(e,t-1)}}decodeNode(e){if(this.isLeaf){if(this.isOOB)return null;const t=e.readBits(this.rangeLength);return this.rangeLow+(this.isLowerRange?-t:t)}const t=this.children[e.readBit()];if(!t)throw new Jbig2Error("invalid Huffman data");return t.decodeNode(e)}}class HuffmanTable{constructor(e,t){t||this.assignPrefixCodes(e);this.rootNode=new HuffmanTreeNode(null);for(let t=0,a=e.length;t<a;t++){const a=e[t];a.prefixLength>0&&this.rootNode.buildTree(a,a.prefixLength-1)}}decode(e){return this.rootNode.decodeNode(e)}assignPrefixCodes(e){const t=e.length;let a=0;for(let r=0;r<t;r++)a=Math.max(a,e[r].prefixLength);const r=new Uint32Array(a+1);for(let a=0;a<t;a++)r[e[a].prefixLength]++;let n,i,s,o=1,c=0;r[0]=0;for(;o<=a;){c=c+r[o-1]<<1;n=c;i=0;for(;i<t;){s=e[i];if(s.prefixLength===o){s.prefixCode=n;n++}i++}o++}}}const p={};function getStandardTable(e){let t,a=p[e];if(a)return a;switch(e){case 1:t=[[0,1,4,0],[16,2,8,2],[272,3,16,6],[65808,3,32,7]];break;case 2:t=[[0,1,0,0],[1,2,0,2],[2,3,0,6],[3,4,3,14],[11,5,6,30],[75,6,32,62],[6,63]];break;case 3:t=[[-256,8,8,254],[0,1,0,0],[1,2,0,2],[2,3,0,6],[3,4,3,14],[11,5,6,30],[-257,8,32,255,"lower"],[75,7,32,126],[6,62]];break;case 4:t=[[1,1,0,0],[2,2,0,2],[3,3,0,6],[4,4,3,14],[12,5,6,30],[76,5,32,31]];break;case 5:t=[[-255,7,8,126],[1,1,0,0],[2,2,0,2],[3,3,0,6],[4,4,3,14],[12,5,6,30],[-256,7,32,127,"lower"],[76,6,32,62]];break;case 6:t=[[-2048,5,10,28],[-1024,4,9,8],[-512,4,8,9],[-256,4,7,10],[-128,5,6,29],[-64,5,5,30],[-32,4,5,11],[0,2,7,0],[128,3,7,2],[256,3,8,3],[512,4,9,12],[1024,4,10,13],[-2049,6,32,62,"lower"],[2048,6,32,63]];break;case 7:t=[[-1024,4,9,8],[-512,3,8,0],[-256,4,7,9],[-128,5,6,26],[-64,5,5,27],[-32,4,5,10],[0,4,5,11],[32,5,5,28],[64,5,6,29],[128,4,7,12],[256,3,8,1],[512,3,9,2],[1024,3,10,3],[-1025,5,32,30,"lower"],[2048,5,32,31]];break;case 8:t=[[-15,8,3,252],[-7,9,1,508],[-5,8,1,253],[-3,9,0,509],[-2,7,0,124],[-1,4,0,10],[0,2,1,0],[2,5,0,26],[3,6,0,58],[4,3,4,4],[20,6,1,59],[22,4,4,11],[38,4,5,12],[70,5,6,27],[134,5,7,28],[262,6,7,60],[390,7,8,125],[646,6,10,61],[-16,9,32,510,"lower"],[1670,9,32,511],[2,1]];break;case 9:t=[[-31,8,4,252],[-15,9,2,508],[-11,8,2,253],[-7,9,1,509],[-5,7,1,124],[-3,4,1,10],[-1,3,1,2],[1,3,1,3],[3,5,1,26],[5,6,1,58],[7,3,5,4],[39,6,2,59],[43,4,5,11],[75,4,6,12],[139,5,7,27],[267,5,8,28],[523,6,8,60],[779,7,9,125],[1291,6,11,61],[-32,9,32,510,"lower"],[3339,9,32,511],[2,0]];break;case 10:t=[[-21,7,4,122],[-5,8,0,252],[-4,7,0,123],[-3,5,0,24],[-2,2,2,0],[2,5,0,25],[3,6,0,54],[4,7,0,124],[5,8,0,253],[6,2,6,1],[70,5,5,26],[102,6,5,55],[134,6,6,56],[198,6,7,57],[326,6,8,58],[582,6,9,59],[1094,6,10,60],[2118,7,11,125],[-22,8,32,254,"lower"],[4166,8,32,255],[2,2]];break;case 11:t=[[1,1,0,0],[2,2,1,2],[4,4,0,12],[5,4,1,13],[7,5,1,28],[9,5,2,29],[13,6,2,60],[17,7,2,122],[21,7,3,123],[29,7,4,124],[45,7,5,125],[77,7,6,126],[141,7,32,127]];break;case 12:t=[[1,1,0,0],[2,2,0,2],[3,3,1,6],[5,5,0,28],[6,5,1,29],[8,6,1,60],[10,7,0,122],[11,7,1,123],[13,7,2,124],[17,7,3,125],[25,7,4,126],[41,8,5,254],[73,8,32,255]];break;case 13:t=[[1,1,0,0],[2,3,0,4],[3,4,0,12],[4,5,0,28],[5,4,1,13],[7,3,3,5],[15,6,1,58],[17,6,2,59],[21,6,3,60],[29,6,4,61],[45,6,5,62],[77,7,6,126],[141,7,32,127]];break;case 14:t=[[-2,3,0,4],[-1,3,0,5],[0,1,0,0],[1,3,0,6],[2,3,0,7]];break;case 15:t=[[-24,7,4,124],[-8,6,2,60],[-4,5,1,28],[-2,4,0,12],[-1,3,0,4],[0,1,0,0],[1,3,0,5],[2,4,0,13],[3,5,1,29],[5,6,2,61],[9,7,4,125],[-25,7,32,126,"lower"],[25,7,32,127]];break;default:throw new Jbig2Error(`standard table B.${e} does not exist`)}for(let e=0,a=t.length;e<a;e++)t[e]=new HuffmanLine(t[e]);a=new HuffmanTable(t,!0);p[e]=a;return a}class Reader{constructor(e,t,a){this.data=e;this.start=t;this.end=a;this.position=t;this.shift=-1;this.currentByte=0}readBit(){if(this.shift<0){if(this.position>=this.end)throw new Jbig2Error("end of data while reading bit");this.currentByte=this.data[this.position++];this.shift=7}const e=this.currentByte>>this.shift&1;this.shift--;return e}readBits(e){let t,a=0;for(t=e-1;t>=0;t--)a|=this.readBit()<<t;return a}byteAlign(){this.shift=-1}next(){return this.position>=this.end?-1:this.data[this.position++]}}function getCustomHuffmanTable(e,t,a){let r=0;for(let n=0,i=t.length;n<i;n++){const i=a[t[n]];if(i){if(e===r)return i;r++}}throw new Jbig2Error("can't find custom Huffman table")}function readUncompressedBitmap(e,t,a){const r=[];for(let n=0;n<a;n++){const a=new Uint8Array(t);r.push(a);for(let r=0;r<t;r++)a[r]=e.readBit();e.byteAlign()}return r}function decodeMMRBitmap(e,t,a,r){const n={K:-1,Columns:t,Rows:a,BlackIs1:!0,EndOfBlock:r},i=new s.CCITTFaxDecoder(e,n),o=[];let c,l=!1;for(let e=0;e<a;e++){const e=new Uint8Array(t);o.push(e);let a=-1;for(let r=0;r<t;r++){if(a<0){c=i.readNextChar();if(-1===c){c=0;l=!0}a=7}e[r]=c>>a&1;a--}}if(r&&!l){const e=5;for(let t=0;t<e&&-1!==i.readNextChar();t++);}return o}t.Jbig2Image=class Jbig2Image{parseChunks(e){return function parseJbig2Chunks(e){const t=new SimpleSegmentVisitor;for(let a=0,r=e.length;a<r;a++){const r=e[a];processSegments(readSegments({},r.data,r.start,r.end),t)}return t.buffer}(e)}parse(e){throw new Error("Not implemented: Jbig2Image.parse")}}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.ArithmeticDecoder=void 0;const a=[{qe:22017,nmps:1,nlps:1,switchFlag:1},{qe:13313,nmps:2,nlps:6,switchFlag:0},{qe:6145,nmps:3,nlps:9,switchFlag:0},{qe:2753,nmps:4,nlps:12,switchFlag:0},{qe:1313,nmps:5,nlps:29,switchFlag:0},{qe:545,nmps:38,nlps:33,switchFlag:0},{qe:22017,nmps:7,nlps:6,switchFlag:1},{qe:21505,nmps:8,nlps:14,switchFlag:0},{qe:18433,nmps:9,nlps:14,switchFlag:0},{qe:14337,nmps:10,nlps:14,switchFlag:0},{qe:12289,nmps:11,nlps:17,switchFlag:0},{qe:9217,nmps:12,nlps:18,switchFlag:0},{qe:7169,nmps:13,nlps:20,switchFlag:0},{qe:5633,nmps:29,nlps:21,switchFlag:0},{qe:22017,nmps:15,nlps:14,switchFlag:1},{qe:21505,nmps:16,nlps:14,switchFlag:0},{qe:20737,nmps:17,nlps:15,switchFlag:0},{qe:18433,nmps:18,nlps:16,switchFlag:0},{qe:14337,nmps:19,nlps:17,switchFlag:0},{qe:13313,nmps:20,nlps:18,switchFlag:0},{qe:12289,nmps:21,nlps:19,switchFlag:0},{qe:10241,nmps:22,nlps:19,switchFlag:0},{qe:9217,nmps:23,nlps:20,switchFlag:0},{qe:8705,nmps:24,nlps:21,switchFlag:0},{qe:7169,nmps:25,nlps:22,switchFlag:0},{qe:6145,nmps:26,nlps:23,switchFlag:0},{qe:5633,nmps:27,nlps:24,switchFlag:0},{qe:5121,nmps:28,nlps:25,switchFlag:0},{qe:4609,nmps:29,nlps:26,switchFlag:0},{qe:4353,nmps:30,nlps:27,switchFlag:0},{qe:2753,nmps:31,nlps:28,switchFlag:0},{qe:2497,nmps:32,nlps:29,switchFlag:0},{qe:2209,nmps:33,nlps:30,switchFlag:0},{qe:1313,nmps:34,nlps:31,switchFlag:0},{qe:1089,nmps:35,nlps:32,switchFlag:0},{qe:673,nmps:36,nlps:33,switchFlag:0},{qe:545,nmps:37,nlps:34,switchFlag:0},{qe:321,nmps:38,nlps:35,switchFlag:0},{qe:273,nmps:39,nlps:36,switchFlag:0},{qe:133,nmps:40,nlps:37,switchFlag:0},{qe:73,nmps:41,nlps:38,switchFlag:0},{qe:37,nmps:42,nlps:39,switchFlag:0},{qe:21,nmps:43,nlps:40,switchFlag:0},{qe:9,nmps:44,nlps:41,switchFlag:0},{qe:5,nmps:45,nlps:42,switchFlag:0},{qe:1,nmps:45,nlps:43,switchFlag:0},{qe:22017,nmps:46,nlps:46,switchFlag:0}];t.ArithmeticDecoder=class ArithmeticDecoder{constructor(e,t,a){this.data=e;this.bp=t;this.dataEnd=a;this.chigh=e[t];this.clow=0;this.byteIn();this.chigh=this.chigh<<7&65535|this.clow>>9&127;this.clow=this.clow<<7&65535;this.ct-=7;this.a=32768}byteIn(){const e=this.data;let t=this.bp;if(255===e[t])if(e[t+1]>143){this.clow+=65280;this.ct=8}else{t++;this.clow+=e[t]<<9;this.ct=7;this.bp=t}else{t++;this.clow+=t<this.dataEnd?e[t]<<8:65280;this.ct=8;this.bp=t}if(this.clow>65535){this.chigh+=this.clow>>16;this.clow&=65535}}readBit(e,t){let r=e[t]>>1,n=1&e[t];const i=a[r],s=i.qe;let o,c=this.a-s;if(this.chigh<s)if(c<s){c=s;o=n;r=i.nmps}else{c=s;o=1^n;1===i.switchFlag&&(n=o);r=i.nlps}else{this.chigh-=s;if(0!=(32768&c)){this.a=c;return n}if(c<s){o=1^n;1===i.switchFlag&&(n=o);r=i.nlps}else{o=n;r=i.nmps}}do{0===this.ct&&this.byteIn();c<<=1;this.chigh=this.chigh<<1&65535|this.clow>>15&1;this.clow=this.clow<<1&65535;this.ct--}while(0==(32768&c));this.a=c;e[t]=r<<1|n;return o}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.JpegStream=void 0;var r=a(17),n=a(4),i=a(26),s=a(2);class JpegStream extends r.DecodeStream{constructor(e,t,a){let r;for(;-1!==(r=e.getByte());)if(255===r){e.skip(-1);break}super(t);this.stream=e;this.dict=e.dict;this.maybeLength=t;this.params=a}get bytes(){return(0,s.shadow)(this,"bytes",this.stream.getBytes(this.maybeLength))}ensureBuffer(e){}readBlock(){if(this.eof)return;const e={decodeTransform:void 0,colorTransform:void 0},t=this.dict.getArray("D","Decode");if(this.forceRGB&&Array.isArray(t)){const a=this.dict.get("BPC","BitsPerComponent")||8,r=t.length,n=new Int32Array(r);let i=!1;const s=(1<<a)-1;for(let e=0;e<r;e+=2){n[e]=256*(t[e+1]-t[e])|0;n[e+1]=t[e]*s|0;256===n[e]&&0===n[e+1]||(i=!0)}i&&(e.decodeTransform=n)}if(this.params instanceof n.Dict){const t=this.params.get("ColorTransform");Number.isInteger(t)&&(e.colorTransform=t)}const a=new i.JpegImage(e);a.parse(this.bytes);const r=a.getData({width:this.drawWidth,height:this.drawHeight,forceRGB:this.forceRGB,isSourcePDF:!0});this.buffer=r;this.bufferLength=r.length;this.eof=!0}}t.JpegStream=JpegStream},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.JpegImage=void 0;var r=a(2),n=a(3);class JpegError extends r.BaseException{constructor(e){super(`JPEG error: ${e}`,"JpegError")}}class DNLMarkerError extends r.BaseException{constructor(e,t){super(e,"DNLMarkerError");this.scanLines=t}}class EOIMarkerError extends r.BaseException{constructor(e){super(e,"EOIMarkerError")}}const i=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),s=4017,o=799,c=3406,l=2276,h=1567,u=3784,d=5793,f=2896;function buildHuffmanTable(e,t){let a,r,n=0,i=16;for(;i>0&&!e[i-1];)i--;const s=[{children:[],index:0}];let o,c=s[0];for(a=0;a<i;a++){for(r=0;r<e[a];r++){c=s.pop();c.children[c.index]=t[n];for(;c.index>0;)c=s.pop();c.index++;s.push(c);for(;s.length<=a;){s.push(o={children:[],index:0});c.children[c.index]=o.children;c=o}n++}if(a+1<i){s.push(o={children:[],index:0});c.children[c.index]=o.children;c=o}}return s[0].children}function getBlockBufferOffset(e,t,a){return 64*((e.blocksPerLine+1)*t+a)}function decodeScan(e,t,a,s,o,c,l,h,u,d=!1){const f=a.mcusPerLine,g=a.progressive,p=t;let m=0,b=0;function readBit(){if(b>0){b--;return m>>b&1}m=e[t++];if(255===m){const r=e[t++];if(r){if(220===r&&d){t+=2;const r=(0,n.readUint16)(e,t);t+=2;if(r>0&&r!==a.scanLines)throw new DNLMarkerError("Found DNL marker (0xFFDC) while parsing scan data",r)}else if(217===r){if(d){const e=x*(8===a.precision?8:0);if(e>0&&Math.round(a.scanLines/e)>=5)throw new DNLMarkerError("Found EOI marker (0xFFD9) while parsing scan data, possibly caused by incorrect `scanLines` parameter",e)}throw new EOIMarkerError("Found EOI marker (0xFFD9) while parsing scan data")}throw new JpegError(`unexpected marker ${(m<<8|r).toString(16)}`)}}b=7;return m>>>7}function decodeHuffman(e){let t=e;for(;;){t=t[readBit()];switch(typeof t){case"number":return t;case"object":continue}throw new JpegError("invalid huffman sequence")}}function receive(e){let t=0;for(;e>0;){t=t<<1|readBit();e--}return t}function receiveAndExtend(e){if(1===e)return 1===readBit()?1:-1;const t=receive(e);return t>=1<<e-1?t:t+(-1<<e)+1}let y=0;let w,S=0;let x=0;function decodeMcu(e,t,a,r,n){const i=a%f;x=(a/f|0)*e.v+r;const s=i*e.h+n;t(e,getBlockBufferOffset(e,x,s))}function decodeBlock(e,t,a){x=a/e.blocksPerLine|0;const r=a%e.blocksPerLine;t(e,getBlockBufferOffset(e,x,r))}const C=s.length;let k,v,F,O,T,M;M=g?0===c?0===h?function decodeDCFirst(e,t){const a=decodeHuffman(e.huffmanTableDC),r=0===a?0:receiveAndExtend(a)<<u;e.blockData[t]=e.pred+=r}:function decodeDCSuccessive(e,t){e.blockData[t]|=readBit()<<u}:0===h?function decodeACFirst(e,t){if(y>0){y--;return}let a=c;const r=l;for(;a<=r;){const r=decodeHuffman(e.huffmanTableAC),n=15&r,s=r>>4;if(0===n){if(s<15){y=receive(s)+(1<<s)-1;break}a+=16;continue}a+=s;const o=i[a];e.blockData[t+o]=receiveAndExtend(n)*(1<<u);a++}}:function decodeACSuccessive(e,t){let a=c;const r=l;let n,s,o=0;for(;a<=r;){const r=t+i[a],c=e.blockData[r]<0?-1:1;switch(S){case 0:s=decodeHuffman(e.huffmanTableAC);n=15&s;o=s>>4;if(0===n)if(o<15){y=receive(o)+(1<<o);S=4}else{o=16;S=1}else{if(1!==n)throw new JpegError("invalid ACn encoding");w=receiveAndExtend(n);S=o?2:3}continue;case 1:case 2:if(e.blockData[r])e.blockData[r]+=c*(readBit()<<u);else{o--;0===o&&(S=2===S?3:0)}break;case 3:if(e.blockData[r])e.blockData[r]+=c*(readBit()<<u);else{e.blockData[r]=w<<u;S=0}break;case 4:e.blockData[r]&&(e.blockData[r]+=c*(readBit()<<u))}a++}if(4===S){y--;0===y&&(S=0)}}:function decodeBaseline(e,t){const a=decodeHuffman(e.huffmanTableDC),r=0===a?0:receiveAndExtend(a);e.blockData[t]=e.pred+=r;let n=1;for(;n<64;){const a=decodeHuffman(e.huffmanTableAC),r=15&a,s=a>>4;if(0===r){if(s<15)break;n+=16;continue}n+=s;const o=i[n];e.blockData[t+o]=receiveAndExtend(r);n++}};let E,D,N,R,L=0;D=1===C?s[0].blocksPerLine*s[0].blocksPerColumn:f*a.mcusPerColumn;for(;L<=D;){const a=o?Math.min(D-L,o):D;if(a>0){for(v=0;v<C;v++)s[v].pred=0;y=0;if(1===C){k=s[0];for(T=0;T<a;T++){decodeBlock(k,M,L);L++}}else for(T=0;T<a;T++){for(v=0;v<C;v++){k=s[v];N=k.h;R=k.v;for(F=0;F<R;F++)for(O=0;O<N;O++)decodeMcu(k,M,L,F,O)}L++}}b=0;E=findNextFileMarker(e,t);if(!E)break;if(E.invalid){const e=a>0?"unexpected":"excessive";(0,r.warn)(`decodeScan - ${e} MCU data, current marker is: ${E.invalid}`);t=E.offset}if(!(E.marker>=65488&&E.marker<=65495))break;t+=2}return t-p}function quantizeAndInverse(e,t,a){const r=e.quantizationTable,n=e.blockData;let i,g,p,m,b,y,w,S,x,C,k,v,F,O,T,M,E;if(!r)throw new JpegError("missing required Quantization Table.");for(let e=0;e<64;e+=8){x=n[t+e];C=n[t+e+1];k=n[t+e+2];v=n[t+e+3];F=n[t+e+4];O=n[t+e+5];T=n[t+e+6];M=n[t+e+7];x*=r[e];if(0!=(C|k|v|F|O|T|M)){C*=r[e+1];k*=r[e+2];v*=r[e+3];F*=r[e+4];O*=r[e+5];T*=r[e+6];M*=r[e+7];i=d*x+128>>8;g=d*F+128>>8;p=k;m=T;b=f*(C-M)+128>>8;S=f*(C+M)+128>>8;y=v<<4;w=O<<4;i=i+g+1>>1;g=i-g;E=p*u+m*h+128>>8;p=p*h-m*u+128>>8;m=E;b=b+w+1>>1;w=b-w;S=S+y+1>>1;y=S-y;i=i+m+1>>1;m=i-m;g=g+p+1>>1;p=g-p;E=b*l+S*c+2048>>12;b=b*c-S*l+2048>>12;S=E;E=y*o+w*s+2048>>12;y=y*s-w*o+2048>>12;w=E;a[e]=i+S;a[e+7]=i-S;a[e+1]=g+w;a[e+6]=g-w;a[e+2]=p+y;a[e+5]=p-y;a[e+3]=m+b;a[e+4]=m-b}else{E=d*x+512>>10;a[e]=E;a[e+1]=E;a[e+2]=E;a[e+3]=E;a[e+4]=E;a[e+5]=E;a[e+6]=E;a[e+7]=E}}for(let e=0;e<8;++e){x=a[e];C=a[e+8];k=a[e+16];v=a[e+24];F=a[e+32];O=a[e+40];T=a[e+48];M=a[e+56];if(0!=(C|k|v|F|O|T|M)){i=d*x+2048>>12;g=d*F+2048>>12;p=k;m=T;b=f*(C-M)+2048>>12;S=f*(C+M)+2048>>12;y=v;w=O;i=4112+(i+g+1>>1);g=i-g;E=p*u+m*h+2048>>12;p=p*h-m*u+2048>>12;m=E;b=b+w+1>>1;w=b-w;S=S+y+1>>1;y=S-y;i=i+m+1>>1;m=i-m;g=g+p+1>>1;p=g-p;E=b*l+S*c+2048>>12;b=b*c-S*l+2048>>12;S=E;E=y*o+w*s+2048>>12;y=y*s-w*o+2048>>12;w=E;x=i+S;M=i-S;C=g+w;T=g-w;k=p+y;O=p-y;v=m+b;F=m-b;x<16?x=0:x>=4080?x=255:x>>=4;C<16?C=0:C>=4080?C=255:C>>=4;k<16?k=0:k>=4080?k=255:k>>=4;v<16?v=0:v>=4080?v=255:v>>=4;F<16?F=0:F>=4080?F=255:F>>=4;O<16?O=0:O>=4080?O=255:O>>=4;T<16?T=0:T>=4080?T=255:T>>=4;M<16?M=0:M>=4080?M=255:M>>=4;n[t+e]=x;n[t+e+8]=C;n[t+e+16]=k;n[t+e+24]=v;n[t+e+32]=F;n[t+e+40]=O;n[t+e+48]=T;n[t+e+56]=M}else{E=d*x+8192>>14;E=E<-2040?0:E>=2024?255:E+2056>>4;n[t+e]=E;n[t+e+8]=E;n[t+e+16]=E;n[t+e+24]=E;n[t+e+32]=E;n[t+e+40]=E;n[t+e+48]=E;n[t+e+56]=E}}}function buildComponentData(e,t){const a=t.blocksPerLine,r=t.blocksPerColumn,n=new Int16Array(64);for(let e=0;e<r;e++)for(let r=0;r<a;r++){quantizeAndInverse(t,getBlockBufferOffset(t,e,r),n)}return t.blockData}function findNextFileMarker(e,t,a=t){const r=e.length-1;let i=a<t?a:t;if(t>=r)return null;const s=(0,n.readUint16)(e,t);if(s>=65472&&s<=65534)return{invalid:null,marker:s,offset:t};let o=(0,n.readUint16)(e,i);for(;!(o>=65472&&o<=65534);){if(++i>=r)return null;o=(0,n.readUint16)(e,i)}return{invalid:s.toString(16),marker:o,offset:i}}t.JpegImage=class JpegImage{constructor({decodeTransform:e=null,colorTransform:t=-1}={}){this._decodeTransform=e;this._colorTransform=t}parse(e,{dnlScanLines:t=null}={}){function readDataBlock(){const t=(0,n.readUint16)(e,o);o+=2;let a=o+t-2;const i=findNextFileMarker(e,a,o);if(i&&i.invalid){(0,r.warn)("readDataBlock - incorrect length, current marker is: "+i.invalid);a=i.offset}const s=e.subarray(o,a);o+=s.length;return s}function prepareComponents(e){const t=Math.ceil(e.samplesPerLine/8/e.maxH),a=Math.ceil(e.scanLines/8/e.maxV);for(const r of e.components){const n=Math.ceil(Math.ceil(e.samplesPerLine/8)*r.h/e.maxH),i=Math.ceil(Math.ceil(e.scanLines/8)*r.v/e.maxV),s=t*r.h,o=64*(a*r.v)*(s+1);r.blockData=new Int16Array(o);r.blocksPerLine=n;r.blocksPerColumn=i}e.mcusPerLine=t;e.mcusPerColumn=a}let a,s,o=0,c=null,l=null,h=0;const u=[],d=[],f=[];let g=(0,n.readUint16)(e,o);o+=2;if(65496!==g)throw new JpegError("SOI not found");g=(0,n.readUint16)(e,o);o+=2;e:for(;65497!==g;){let p,m,b;switch(g){case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:const y=readDataBlock();65504===g&&74===y[0]&&70===y[1]&&73===y[2]&&70===y[3]&&0===y[4]&&(c={version:{major:y[5],minor:y[6]},densityUnits:y[7],xDensity:y[8]<<8|y[9],yDensity:y[10]<<8|y[11],thumbWidth:y[12],thumbHeight:y[13],thumbData:y.subarray(14,14+3*y[12]*y[13])});65518===g&&65===y[0]&&100===y[1]&&111===y[2]&&98===y[3]&&101===y[4]&&(l={version:y[5]<<8|y[6],flags0:y[7]<<8|y[8],flags1:y[9]<<8|y[10],transformCode:y[11]});break;case 65499:const w=(0,n.readUint16)(e,o);o+=2;const S=w+o-2;let x;for(;o<S;){const t=e[o++],a=new Uint16Array(64);if(t>>4==0)for(m=0;m<64;m++){x=i[m];a[x]=e[o++]}else{if(t>>4!=1)throw new JpegError("DQT - invalid table spec");for(m=0;m<64;m++){x=i[m];a[x]=(0,n.readUint16)(e,o);o+=2}}u[15&t]=a}break;case 65472:case 65473:case 65474:if(a)throw new JpegError("Only single frame JPEGs supported");o+=2;a={};a.extended=65473===g;a.progressive=65474===g;a.precision=e[o++];const C=(0,n.readUint16)(e,o);o+=2;a.scanLines=t||C;a.samplesPerLine=(0,n.readUint16)(e,o);o+=2;a.components=[];a.componentIds={};const k=e[o++];let v=0,F=0;for(p=0;p<k;p++){const t=e[o],r=e[o+1]>>4,n=15&e[o+1];v<r&&(v=r);F<n&&(F=n);const i=e[o+2];b=a.components.push({h:r,v:n,quantizationId:i,quantizationTable:null});a.componentIds[t]=b-1;o+=3}a.maxH=v;a.maxV=F;prepareComponents(a);break;case 65476:const O=(0,n.readUint16)(e,o);o+=2;for(p=2;p<O;){const t=e[o++],a=new Uint8Array(16);let r=0;for(m=0;m<16;m++,o++)r+=a[m]=e[o];const n=new Uint8Array(r);for(m=0;m<r;m++,o++)n[m]=e[o];p+=17+r;(t>>4==0?f:d)[15&t]=buildHuffmanTable(a,n)}break;case 65501:o+=2;s=(0,n.readUint16)(e,o);o+=2;break;case 65498:const T=1==++h&&!t;o+=2;const M=e[o++],E=[];for(p=0;p<M;p++){const t=e[o++],r=a.componentIds[t],n=a.components[r];n.index=t;const i=e[o++];n.huffmanTableDC=f[i>>4];n.huffmanTableAC=d[15&i];E.push(n)}const D=e[o++],N=e[o++],R=e[o++];try{const t=decodeScan(e,o,a,E,s,D,N,R>>4,15&R,T);o+=t}catch(t){if(t instanceof DNLMarkerError){(0,r.warn)(`${t.message} -- attempting to re-parse the JPEG image.`);return this.parse(e,{dnlScanLines:t.scanLines})}if(t instanceof EOIMarkerError){(0,r.warn)(`${t.message} -- ignoring the rest of the image data.`);break e}throw t}break;case 65500:o+=4;break;case 65535:255!==e[o]&&o--;break;default:const L=findNextFileMarker(e,o-2,o-3);if(L&&L.invalid){(0,r.warn)("JpegImage.parse - unexpected data, current marker is: "+L.invalid);o=L.offset;break}if(!L||o>=e.length-1){(0,r.warn)("JpegImage.parse - reached the end of the image data without finding an EOI marker (0xFFD9).");break e}throw new JpegError("JpegImage.parse - unknown marker: "+g.toString(16))}g=(0,n.readUint16)(e,o);o+=2}this.width=a.samplesPerLine;this.height=a.scanLines;this.jfif=c;this.adobe=l;this.components=[];for(const e of a.components){const t=u[e.quantizationId];t&&(e.quantizationTable=t);this.components.push({index:e.index,output:buildComponentData(0,e),scaleX:e.h/a.maxH,scaleY:e.v/a.maxV,blocksPerLine:e.blocksPerLine,blocksPerColumn:e.blocksPerColumn})}this.numComponents=this.components.length}_getLinearizedBlockData(e,t,a=!1){const r=this.width/e,n=this.height/t;let i,s,o,c,l,h,u,d,f,g,p,m=0;const b=this.components.length,y=e*t*b,w=new Uint8ClampedArray(y),S=new Uint32Array(e),x=4294967288;let C;for(u=0;u<b;u++){i=this.components[u];s=i.scaleX*r;o=i.scaleY*n;m=u;p=i.output;c=i.blocksPerLine+1<<3;if(s!==C){for(l=0;l<e;l++){d=0|l*s;S[l]=(d&x)<<3|7&d}C=s}for(h=0;h<t;h++){d=0|h*o;g=c*(d&x)|(7&d)<<3;for(l=0;l<e;l++){w[m]=p[g+S[l]];m+=b}}}let k=this._decodeTransform;a||4!==b||k||(k=new Int32Array([-256,255,-256,255,-256,255,-256,255]));if(k)for(u=0;u<y;)for(d=0,f=0;d<b;d++,u++,f+=2)w[u]=(w[u]*k[f]>>8)+k[f+1];return w}get _isColorConversionNeeded(){return this.adobe?!!this.adobe.transformCode:3===this.numComponents?0!==this._colorTransform&&(82!==this.components[0].index||71!==this.components[1].index||66!==this.components[2].index):1===this._colorTransform}_convertYccToRgb(e){let t,a,r;for(let n=0,i=e.length;n<i;n+=3){t=e[n];a=e[n+1];r=e[n+2];e[n]=t-179.456+1.402*r;e[n+1]=t+135.459-.344*a-.714*r;e[n+2]=t-226.816+1.772*a}return e}_convertYcckToRgb(e){let t,a,r,n,i=0;for(let s=0,o=e.length;s<o;s+=4){t=e[s];a=e[s+1];r=e[s+2];n=e[s+3];e[i++]=a*(-660635669420364e-19*a+.000437130475926232*r-54080610064599e-18*t+.00048449797120281*n-.154362151871126)-122.67195406894+r*(-.000957964378445773*r+.000817076911346625*t-.00477271405408747*n+1.53380253221734)+t*(.000961250184130688*t-.00266257332283933*n+.48357088451265)+n*(-.000336197177618394*n+.484791561490776);e[i++]=107.268039397724+a*(219927104525741e-19*a-.000640992018297945*r+.000659397001245577*t+.000426105652938837*n-.176491792462875)+r*(-.000778269941513683*r+.00130872261408275*t+.000770482631801132*n-.151051492775562)+t*(.00126935368114843*t-.00265090189010898*n+.25802910206845)+n*(-.000318913117588328*n-.213742400323665);e[i++]=a*(-.000570115196973677*a-263409051004589e-19*r+.0020741088115012*t-.00288260236853442*n+.814272968359295)-20.810012546947+r*(-153496057440975e-19*r-.000132689043961446*t+.000560833691242812*n-.195152027534049)+t*(.00174418132927582*t-.00255243321439347*n+.116935020465145)+n*(-.000343531996510555*n+.24165260232407)}return e.subarray(0,i)}_convertYcckToCmyk(e){let t,a,r;for(let n=0,i=e.length;n<i;n+=4){t=e[n];a=e[n+1];r=e[n+2];e[n]=434.456-t-1.402*r;e[n+1]=119.541-t+.344*a+.714*r;e[n+2]=481.816-t-1.772*a}return e}_convertCmykToRgb(e){let t,a,r,n,i=0;for(let s=0,o=e.length;s<o;s+=4){t=e[s];a=e[s+1];r=e[s+2];n=e[s+3];e[i++]=255+t*(-6747147073602441e-20*t+.0008379262121013727*a+.0002894718188643294*r+.003264231057537806*n-1.1185611867203937)+a*(26374107616089405e-21*a-8626949158638572e-20*r-.0002748769067499491*n-.02155688794978967)+r*(-3878099212869363e-20*r-.0003267808279485286*n+.0686742238595345)-n*(.0003361971776183937*n+.7430659151342254);e[i++]=255+t*(.00013596372813588848*t+.000924537132573585*a+.00010567359618683593*r+.0004791864687436512*n-.3109689587515875)+a*(-.00023545346108370344*a+.0002702845253534714*r+.0020200308977307156*n-.7488052167015494)+r*(6834815998235662e-20*r+.00015168452363460973*n-.09751927774728933)-n*(.0003189131175883281*n+.7364883807733168);e[i++]=255+t*(13598650411385307e-21*t+.00012423956175490851*a+.0004751985097583589*r-36729317476630422e-22*n-.05562186980264034)+a*(.00016141380598724676*a+.0009692239130725186*r+.0007782692450036253*n-.44015232367526463)+r*(5.068882914068769e-7*r+.0017778369011375071*n-.7591454649749609)-n*(.0003435319965105553*n+.7063770186160144)}return e.subarray(0,i)}getData({width:e,height:t,forceRGB:a=!1,isSourcePDF:r=!1}){if(this.numComponents>4)throw new JpegError("Unsupported color mode");const n=this._getLinearizedBlockData(e,t,r);if(1===this.numComponents&&a){const e=new Uint8ClampedArray(3*n.length);let t=0;for(const a of n){e[t++]=a;e[t++]=a;e[t++]=a}return e}if(3===this.numComponents&&this._isColorConversionNeeded)return this._convertYccToRgb(n);if(4===this.numComponents){if(this._isColorConversionNeeded)return a?this._convertYcckToRgb(n):this._convertYcckToCmyk(n);if(a)return this._convertCmykToRgb(n)}return n}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.JpxStream=void 0;var r=a(17),n=a(28),i=a(2);class JpxStream extends r.DecodeStream{constructor(e,t,a){super(t);this.stream=e;this.dict=e.dict;this.maybeLength=t;this.params=a}get bytes(){return(0,i.shadow)(this,"bytes",this.stream.getBytes(this.maybeLength))}ensureBuffer(e){}readBlock(){if(this.eof)return;const e=new n.JpxImage;e.parse(this.bytes);const t=e.width,a=e.height,r=e.componentsCount,i=e.tiles.length;if(1===i)this.buffer=e.tiles[0].items;else{const n=new Uint8ClampedArray(t*a*r);for(let a=0;a<i;a++){const i=e.tiles[a],s=i.width,o=i.height,c=i.left,l=i.top,h=i.items;let u=0,d=(t*l+c)*r;const f=t*r,g=s*r;for(let e=0;e<o;e++){const e=h.subarray(u,u+g);n.set(e,d);u+=g;d+=f}}this.buffer=n}this.bufferLength=this.buffer.length;this.eof=!0}}t.JpxStream=JpxStream},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.JpxImage=void 0;var r=a(2),n=a(3),i=a(24);class JpxError extends r.BaseException{constructor(e){super(`JPX error: ${e}`,"JpxError")}}const s={LL:0,LH:1,HL:1,HH:2};t.JpxImage=class JpxImage{constructor(){this.failOnCorruptedImage=!1}parse(e){if(65359===(0,n.readUint16)(e,0)){this.parseCodestream(e,0,e.length);return}const t=e.length;let a=0;for(;a<t;){let i=8,s=(0,n.readUint32)(e,a);const o=(0,n.readUint32)(e,a+4);a+=i;if(1===s){s=4294967296*(0,n.readUint32)(e,a)+(0,n.readUint32)(e,a+4);a+=8;i+=8}0===s&&(s=t-a+i);if(s<i)throw new JpxError("Invalid box field size");const c=s-i;let l=!0;switch(o){case 1785737832:l=!1;break;case 1668246642:const t=e[a];if(1===t){const t=(0,n.readUint32)(e,a+3);switch(t){case 16:case 17:case 18:break;default:(0,r.warn)("Unknown colorspace "+t)}}else 2===t&&(0,r.info)("ICC profile not supported");break;case 1785737827:this.parseCodestream(e,a,a+c);break;case 1783636e3:218793738!==(0,n.readUint32)(e,a)&&(0,r.warn)("Invalid JP2 signature");break;case 1783634458:case 1718909296:case 1920099697:case 1919251232:case 1768449138:break;default:const i=String.fromCharCode(o>>24&255,o>>16&255,o>>8&255,255&o);(0,r.warn)(`Unsupported header type ${o} (${i}).`)}l&&(a+=c)}}parseImageProperties(e){let t=e.getByte();for(;t>=0;){const a=t;t=e.getByte();if(65361===(a<<8|t)){e.skip(4);const t=e.getInt32()>>>0,a=e.getInt32()>>>0,r=e.getInt32()>>>0,n=e.getInt32()>>>0;e.skip(16);const i=e.getUint16();this.width=t-r;this.height=a-n;this.componentsCount=i;this.bitsPerComponent=8;return}}throw new JpxError("No size marker found in JPX stream")}parseCodestream(e,t,a){const i={};let s=!1;try{let o=t;for(;o+1<a;){const t=(0,n.readUint16)(e,o);o+=2;let a,c,l,h,u,d,f=0;switch(t){case 65359:i.mainHeader=!0;break;case 65497:break;case 65361:f=(0,n.readUint16)(e,o);const g={};g.Xsiz=(0,n.readUint32)(e,o+4);g.Ysiz=(0,n.readUint32)(e,o+8);g.XOsiz=(0,n.readUint32)(e,o+12);g.YOsiz=(0,n.readUint32)(e,o+16);g.XTsiz=(0,n.readUint32)(e,o+20);g.YTsiz=(0,n.readUint32)(e,o+24);g.XTOsiz=(0,n.readUint32)(e,o+28);g.YTOsiz=(0,n.readUint32)(e,o+32);const p=(0,n.readUint16)(e,o+36);g.Csiz=p;const m=[];a=o+38;for(let t=0;t<p;t++){const t={precision:1+(127&e[a]),isSigned:!!(128&e[a]),XRsiz:e[a+1],YRsiz:e[a+2]};a+=3;calculateComponentDimensions(t,g);m.push(t)}i.SIZ=g;i.components=m;calculateTileGrids(i,m);i.QCC=[];i.COC=[];break;case 65372:f=(0,n.readUint16)(e,o);const b={};a=o+2;c=e[a++];switch(31&c){case 0:h=8;u=!0;break;case 1:h=16;u=!1;break;case 2:h=16;u=!0;break;default:throw new Error("Invalid SQcd value "+c)}b.noQuantization=8===h;b.scalarExpounded=u;b.guardBits=c>>5;l=[];for(;a<f+o;){const t={};if(8===h){t.epsilon=e[a++]>>3;t.mu=0}else{t.epsilon=e[a]>>3;t.mu=(7&e[a])<<8|e[a+1];a+=2}l.push(t)}b.SPqcds=l;if(i.mainHeader)i.QCD=b;else{i.currentTile.QCD=b;i.currentTile.QCC=[]}break;case 65373:f=(0,n.readUint16)(e,o);const y={};a=o+2;let w;if(i.SIZ.Csiz<257)w=e[a++];else{w=(0,n.readUint16)(e,a);a+=2}c=e[a++];switch(31&c){case 0:h=8;u=!0;break;case 1:h=16;u=!1;break;case 2:h=16;u=!0;break;default:throw new Error("Invalid SQcd value "+c)}y.noQuantization=8===h;y.scalarExpounded=u;y.guardBits=c>>5;l=[];for(;a<f+o;){const t={};if(8===h){t.epsilon=e[a++]>>3;t.mu=0}else{t.epsilon=e[a]>>3;t.mu=(7&e[a])<<8|e[a+1];a+=2}l.push(t)}y.SPqcds=l;i.mainHeader?i.QCC[w]=y:i.currentTile.QCC[w]=y;break;case 65362:f=(0,n.readUint16)(e,o);const S={};a=o+2;const x=e[a++];S.entropyCoderWithCustomPrecincts=!!(1&x);S.sopMarkerUsed=!!(2&x);S.ephMarkerUsed=!!(4&x);S.progressionOrder=e[a++];S.layersCount=(0,n.readUint16)(e,a);a+=2;S.multipleComponentTransform=e[a++];S.decompositionLevelsCount=e[a++];S.xcb=2+(15&e[a++]);S.ycb=2+(15&e[a++]);const C=e[a++];S.selectiveArithmeticCodingBypass=!!(1&C);S.resetContextProbabilities=!!(2&C);S.terminationOnEachCodingPass=!!(4&C);S.verticallyStripe=!!(8&C);S.predictableTermination=!!(16&C);S.segmentationSymbolUsed=!!(32&C);S.reversibleTransformation=e[a++];if(S.entropyCoderWithCustomPrecincts){const t=[];for(;a<f+o;){const r=e[a++];t.push({PPx:15&r,PPy:r>>4})}S.precinctsSizes=t}const k=[];S.selectiveArithmeticCodingBypass&&k.push("selectiveArithmeticCodingBypass");S.terminationOnEachCodingPass&&k.push("terminationOnEachCodingPass");S.verticallyStripe&&k.push("verticallyStripe");S.predictableTermination&&k.push("predictableTermination");if(k.length>0){s=!0;(0,r.warn)(`JPX: Unsupported COD options (${k.join(", ")}).`)}if(i.mainHeader)i.COD=S;else{i.currentTile.COD=S;i.currentTile.COC=[]}break;case 65424:f=(0,n.readUint16)(e,o);d={};d.index=(0,n.readUint16)(e,o+2);d.length=(0,n.readUint32)(e,o+4);d.dataEnd=d.length+o-2;d.partIndex=e[o+8];d.partsCount=e[o+9];i.mainHeader=!1;if(0===d.partIndex){d.COD=i.COD;d.COC=i.COC.slice(0);d.QCD=i.QCD;d.QCC=i.QCC.slice(0)}i.currentTile=d;break;case 65427:d=i.currentTile;if(0===d.partIndex){initializeTile(i,d.index);buildPackets(i)}f=d.dataEnd-o;parseTilePackets(i,e,o,f);break;case 65363:(0,r.warn)("JPX: Codestream code 0xFF53 (COC) is not implemented.");case 65365:case 65367:case 65368:case 65380:f=(0,n.readUint16)(e,o);break;default:throw new Error("Unknown codestream code: "+t.toString(16))}o+=f}}catch(e){if(s||this.failOnCorruptedImage)throw new JpxError(e.message);(0,r.warn)(`JPX: Trying to recover from: "${e.message}".`)}this.tiles=function transformComponents(e){const t=e.SIZ,a=e.components,r=t.Csiz,n=[];for(let t=0,i=e.tiles.length;t<i;t++){const i=e.tiles[t],s=[];for(let t=0;t<r;t++)s[t]=transformTile(e,i,t);const o=s[0],c=new Uint8ClampedArray(o.items.length*r),l={left:o.left,top:o.top,width:o.width,height:o.height,items:c};let h,u,d,f,g,p,m,b=0;if(i.codingStyleDefaultParameters.multipleComponentTransform){const e=4===r,t=s[0].items,n=s[1].items,o=s[2].items,l=e?s[3].items:null;h=a[0].precision-8;u=.5+(128<<h);const y=i.components[0],w=r-3;f=t.length;if(y.codingStyleParameters.reversibleTransformation)for(d=0;d<f;d++,b+=w){g=t[d]+u;p=n[d];m=o[d];const e=g-(m+p>>2);c[b++]=e+m>>h;c[b++]=e>>h;c[b++]=e+p>>h}else for(d=0;d<f;d++,b+=w){g=t[d]+u;p=n[d];m=o[d];c[b++]=g+1.402*m>>h;c[b++]=g-.34413*p-.71414*m>>h;c[b++]=g+1.772*p>>h}if(e)for(d=0,b=3;d<f;d++,b+=4)c[b]=l[d]+u>>h}else for(let e=0;e<r;e++){const t=s[e].items;h=a[e].precision-8;u=.5+(128<<h);for(b=e,d=0,f=t.length;d<f;d++){c[b]=t[d]+u>>h;b+=r}}n.push(l)}return n}(i);this.width=i.SIZ.Xsiz-i.SIZ.XOsiz;this.height=i.SIZ.Ysiz-i.SIZ.YOsiz;this.componentsCount=i.SIZ.Csiz}};function calculateComponentDimensions(e,t){e.x0=Math.ceil(t.XOsiz/e.XRsiz);e.x1=Math.ceil(t.Xsiz/e.XRsiz);e.y0=Math.ceil(t.YOsiz/e.YRsiz);e.y1=Math.ceil(t.Ysiz/e.YRsiz);e.width=e.x1-e.x0;e.height=e.y1-e.y0}function calculateTileGrids(e,t){const a=e.SIZ,r=[];let n;const i=Math.ceil((a.Xsiz-a.XTOsiz)/a.XTsiz),s=Math.ceil((a.Ysiz-a.YTOsiz)/a.YTsiz);for(let e=0;e<s;e++)for(let t=0;t<i;t++){n={};n.tx0=Math.max(a.XTOsiz+t*a.XTsiz,a.XOsiz);n.ty0=Math.max(a.YTOsiz+e*a.YTsiz,a.YOsiz);n.tx1=Math.min(a.XTOsiz+(t+1)*a.XTsiz,a.Xsiz);n.ty1=Math.min(a.YTOsiz+(e+1)*a.YTsiz,a.Ysiz);n.width=n.tx1-n.tx0;n.height=n.ty1-n.ty0;n.components=[];r.push(n)}e.tiles=r;for(let e=0,i=a.Csiz;e<i;e++){const a=t[e];for(let t=0,i=r.length;t<i;t++){const i={};n=r[t];i.tcx0=Math.ceil(n.tx0/a.XRsiz);i.tcy0=Math.ceil(n.ty0/a.YRsiz);i.tcx1=Math.ceil(n.tx1/a.XRsiz);i.tcy1=Math.ceil(n.ty1/a.YRsiz);i.width=i.tcx1-i.tcx0;i.height=i.tcy1-i.tcy0;n.components[e]=i}}}function getBlocksDimensions(e,t,a){const r=t.codingStyleParameters,n={};if(r.entropyCoderWithCustomPrecincts){n.PPx=r.precinctsSizes[a].PPx;n.PPy=r.precinctsSizes[a].PPy}else{n.PPx=15;n.PPy=15}n.xcb_=a>0?Math.min(r.xcb,n.PPx-1):Math.min(r.xcb,n.PPx);n.ycb_=a>0?Math.min(r.ycb,n.PPy-1):Math.min(r.ycb,n.PPy);return n}function buildPrecincts(e,t,a){const r=1<<a.PPx,n=1<<a.PPy,i=0===t.resLevel,s=1<<a.PPx+(i?0:-1),o=1<<a.PPy+(i?0:-1),c=t.trx1>t.trx0?Math.ceil(t.trx1/r)-Math.floor(t.trx0/r):0,l=t.try1>t.try0?Math.ceil(t.try1/n)-Math.floor(t.try0/n):0,h=c*l;t.precinctParameters={precinctWidth:r,precinctHeight:n,numprecinctswide:c,numprecinctshigh:l,numprecincts:h,precinctWidthInSubband:s,precinctHeightInSubband:o}}function buildCodeblocks(e,t,a){const r=a.xcb_,n=a.ycb_,i=1<<r,s=1<<n,o=t.tbx0>>r,c=t.tby0>>n,l=t.tbx1+i-1>>r,h=t.tby1+s-1>>n,u=t.resolution.precinctParameters,d=[],f=[];let g,p,m,b;for(p=c;p<h;p++)for(g=o;g<l;g++){m={cbx:g,cby:p,tbx0:i*g,tby0:s*p,tbx1:i*(g+1),tby1:s*(p+1)};m.tbx0_=Math.max(t.tbx0,m.tbx0);m.tby0_=Math.max(t.tby0,m.tby0);m.tbx1_=Math.min(t.tbx1,m.tbx1);m.tby1_=Math.min(t.tby1,m.tby1);b=Math.floor((m.tbx0_-t.tbx0)/u.precinctWidthInSubband)+Math.floor((m.tby0_-t.tby0)/u.precinctHeightInSubband)*u.numprecinctswide;m.precinctNumber=b;m.subbandType=t.type;m.Lblock=3;if(m.tbx1_<=m.tbx0_||m.tby1_<=m.tby0_)continue;d.push(m);let e=f[b];if(void 0!==e){g<e.cbxMin?e.cbxMin=g:g>e.cbxMax&&(e.cbxMax=g);p<e.cbyMin?e.cbxMin=p:p>e.cbyMax&&(e.cbyMax=p)}else f[b]=e={cbxMin:g,cbyMin:p,cbxMax:g,cbyMax:p};m.precinct=e}t.codeblockParameters={codeblockWidth:r,codeblockHeight:n,numcodeblockwide:l-o+1,numcodeblockhigh:h-c+1};t.codeblocks=d;t.precincts=f}function createPacket(e,t,a){const r=[],n=e.subbands;for(let e=0,a=n.length;e<a;e++){const a=n[e].codeblocks;for(let e=0,n=a.length;e<n;e++){const n=a[e];n.precinctNumber===t&&r.push(n)}}return{layerNumber:a,codeblocks:r}}function LayerResolutionComponentPositionIterator(e){const t=e.SIZ,a=e.currentTile.index,r=e.tiles[a],n=r.codingStyleDefaultParameters.layersCount,i=t.Csiz;let s=0;for(let e=0;e<i;e++)s=Math.max(s,r.components[e].codingStyleParameters.decompositionLevelsCount);let o=0,c=0,l=0,h=0;this.nextPacket=function JpxImage_nextPacket(){for(;o<n;o++){for(;c<=s;c++){for(;l<i;l++){const e=r.components[l];if(c>e.codingStyleParameters.decompositionLevelsCount)continue;const t=e.resolutions[c],a=t.precinctParameters.numprecincts;for(;h<a;){const e=createPacket(t,h,o);h++;return e}h=0}l=0}c=0}throw new JpxError("Out of packets")}}function ResolutionLayerComponentPositionIterator(e){const t=e.SIZ,a=e.currentTile.index,r=e.tiles[a],n=r.codingStyleDefaultParameters.layersCount,i=t.Csiz;let s=0;for(let e=0;e<i;e++)s=Math.max(s,r.components[e].codingStyleParameters.decompositionLevelsCount);let o=0,c=0,l=0,h=0;this.nextPacket=function JpxImage_nextPacket(){for(;o<=s;o++){for(;c<n;c++){for(;l<i;l++){const e=r.components[l];if(o>e.codingStyleParameters.decompositionLevelsCount)continue;const t=e.resolutions[o],a=t.precinctParameters.numprecincts;for(;h<a;){const e=createPacket(t,h,c);h++;return e}h=0}l=0}c=0}throw new JpxError("Out of packets")}}function ResolutionPositionComponentLayerIterator(e){const t=e.SIZ,a=e.currentTile.index,r=e.tiles[a],n=r.codingStyleDefaultParameters.layersCount,i=t.Csiz;let s,o,c,l,h=0;for(c=0;c<i;c++){const e=r.components[c];h=Math.max(h,e.codingStyleParameters.decompositionLevelsCount)}const u=new Int32Array(h+1);for(o=0;o<=h;++o){let e=0;for(c=0;c<i;++c){const t=r.components[c].resolutions;o<t.length&&(e=Math.max(e,t[o].precinctParameters.numprecincts))}u[o]=e}s=0;o=0;c=0;l=0;this.nextPacket=function JpxImage_nextPacket(){for(;o<=h;o++){for(;l<u[o];l++){for(;c<i;c++){const e=r.components[c];if(o>e.codingStyleParameters.decompositionLevelsCount)continue;const t=e.resolutions[o],a=t.precinctParameters.numprecincts;if(!(l>=a)){for(;s<n;){const e=createPacket(t,l,s);s++;return e}s=0}}c=0}l=0}throw new JpxError("Out of packets")}}function PositionComponentResolutionLayerIterator(e){const t=e.SIZ,a=e.currentTile.index,r=e.tiles[a],n=r.codingStyleDefaultParameters.layersCount,i=t.Csiz,s=getPrecinctSizesInImageScale(r),o=s;let c=0,l=0,h=0,u=0,d=0;this.nextPacket=function JpxImage_nextPacket(){for(;d<o.maxNumHigh;d++){for(;u<o.maxNumWide;u++){for(;h<i;h++){const e=r.components[h],t=e.codingStyleParameters.decompositionLevelsCount;for(;l<=t;l++){const t=e.resolutions[l],a=s.components[h].resolutions[l],r=getPrecinctIndexIfExist(u,d,a,o,t);if(null!==r){for(;c<n;){const e=createPacket(t,r,c);c++;return e}c=0}}l=0}h=0}u=0}throw new JpxError("Out of packets")}}function ComponentPositionResolutionLayerIterator(e){const t=e.SIZ,a=e.currentTile.index,r=e.tiles[a],n=r.codingStyleDefaultParameters.layersCount,i=t.Csiz,s=getPrecinctSizesInImageScale(r);let o=0,c=0,l=0,h=0,u=0;this.nextPacket=function JpxImage_nextPacket(){for(;l<i;++l){const e=r.components[l],t=s.components[l],a=e.codingStyleParameters.decompositionLevelsCount;for(;u<t.maxNumHigh;u++){for(;h<t.maxNumWide;h++){for(;c<=a;c++){const a=e.resolutions[c],r=t.resolutions[c],i=getPrecinctIndexIfExist(h,u,r,t,a);if(null!==i){for(;o<n;){const e=createPacket(a,i,o);o++;return e}o=0}}c=0}h=0}u=0}throw new JpxError("Out of packets")}}function getPrecinctIndexIfExist(e,t,a,r,n){const i=e*r.minWidth,s=t*r.minHeight;if(i%a.width!=0||s%a.height!=0)return null;const o=s/a.width*n.precinctParameters.numprecinctswide;return i/a.height+o}function getPrecinctSizesInImageScale(e){const t=e.components.length;let a=Number.MAX_VALUE,r=Number.MAX_VALUE,n=0,i=0;const s=new Array(t);for(let o=0;o<t;o++){const t=e.components[o],c=t.codingStyleParameters.decompositionLevelsCount,l=new Array(c+1);let h=Number.MAX_VALUE,u=Number.MAX_VALUE,d=0,f=0,g=1;for(let e=c;e>=0;--e){const a=t.resolutions[e],r=g*a.precinctParameters.precinctWidth,n=g*a.precinctParameters.precinctHeight;h=Math.min(h,r);u=Math.min(u,n);d=Math.max(d,a.precinctParameters.numprecinctswide);f=Math.max(f,a.precinctParameters.numprecinctshigh);l[e]={width:r,height:n};g<<=1}a=Math.min(a,h);r=Math.min(r,u);n=Math.max(n,d);i=Math.max(i,f);s[o]={resolutions:l,minWidth:h,minHeight:u,maxNumWide:d,maxNumHigh:f}}return{components:s,minWidth:a,minHeight:r,maxNumWide:n,maxNumHigh:i}}function buildPackets(e){const t=e.SIZ,a=e.currentTile.index,r=e.tiles[a],n=t.Csiz;for(let e=0;e<n;e++){const t=r.components[e],a=t.codingStyleParameters.decompositionLevelsCount,n=[],i=[];for(let e=0;e<=a;e++){const r=getBlocksDimensions(0,t,e),s={},o=1<<a-e;s.trx0=Math.ceil(t.tcx0/o);s.try0=Math.ceil(t.tcy0/o);s.trx1=Math.ceil(t.tcx1/o);s.try1=Math.ceil(t.tcy1/o);s.resLevel=e;buildPrecincts(0,s,r);n.push(s);let c;if(0===e){c={};c.type="LL";c.tbx0=Math.ceil(t.tcx0/o);c.tby0=Math.ceil(t.tcy0/o);c.tbx1=Math.ceil(t.tcx1/o);c.tby1=Math.ceil(t.tcy1/o);c.resolution=s;buildCodeblocks(0,c,r);i.push(c);s.subbands=[c]}else{const n=1<<a-e+1,o=[];c={};c.type="HL";c.tbx0=Math.ceil(t.tcx0/n-.5);c.tby0=Math.ceil(t.tcy0/n);c.tbx1=Math.ceil(t.tcx1/n-.5);c.tby1=Math.ceil(t.tcy1/n);c.resolution=s;buildCodeblocks(0,c,r);i.push(c);o.push(c);c={};c.type="LH";c.tbx0=Math.ceil(t.tcx0/n);c.tby0=Math.ceil(t.tcy0/n-.5);c.tbx1=Math.ceil(t.tcx1/n);c.tby1=Math.ceil(t.tcy1/n-.5);c.resolution=s;buildCodeblocks(0,c,r);i.push(c);o.push(c);c={};c.type="HH";c.tbx0=Math.ceil(t.tcx0/n-.5);c.tby0=Math.ceil(t.tcy0/n-.5);c.tbx1=Math.ceil(t.tcx1/n-.5);c.tby1=Math.ceil(t.tcy1/n-.5);c.resolution=s;buildCodeblocks(0,c,r);i.push(c);o.push(c);s.subbands=o}}t.resolutions=n;t.subbands=i}const i=r.codingStyleDefaultParameters.progressionOrder;switch(i){case 0:r.packetsIterator=new LayerResolutionComponentPositionIterator(e);break;case 1:r.packetsIterator=new ResolutionLayerComponentPositionIterator(e);break;case 2:r.packetsIterator=new ResolutionPositionComponentLayerIterator(e);break;case 3:r.packetsIterator=new PositionComponentResolutionLayerIterator(e);break;case 4:r.packetsIterator=new ComponentPositionResolutionLayerIterator(e);break;default:throw new JpxError(`Unsupported progression order ${i}`)}}function parseTilePackets(e,t,a,r){let i,s=0,o=0,c=!1;function readBits(e){for(;o<e;){const e=t[a+s];s++;if(c){i=i<<7|e;o+=7;c=!1}else{i=i<<8|e;o+=8}255===e&&(c=!0)}o-=e;return i>>>o&(1<<e)-1}function skipMarkerIfEqual(e){if(255===t[a+s-1]&&t[a+s]===e){skipBytes(1);return!0}if(255===t[a+s]&&t[a+s+1]===e){skipBytes(2);return!0}return!1}function skipBytes(e){s+=e}function alignToByte(){o=0;if(c){s++;c=!1}}function readCodingpasses(){if(0===readBits(1))return 1;if(0===readBits(1))return 2;let e=readBits(2);if(e<3)return e+3;e=readBits(5);if(e<31)return e+6;e=readBits(7);return e+37}const l=e.currentTile.index,h=e.tiles[l],u=e.COD.sopMarkerUsed,d=e.COD.ephMarkerUsed,f=h.packetsIterator;for(;s<r;){alignToByte();u&&skipMarkerIfEqual(145)&&skipBytes(4);const e=f.nextPacket();if(!readBits(1))continue;const r=e.layerNumber,i=[];let o;for(let t=0,a=e.codeblocks.length;t<a;t++){o=e.codeblocks[t];let a=o.precinct;const s=o.cbx-a.cbxMin,c=o.cby-a.cbyMin;let l,h,u=!1,d=!1;if(void 0!==o.included)u=!!readBits(1);else{a=o.precinct;let e;if(void 0!==a.inclusionTree)e=a.inclusionTree;else{const t=a.cbxMax-a.cbxMin+1,n=a.cbyMax-a.cbyMin+1;e=new InclusionTree(t,n,r);h=new TagTree(t,n);a.inclusionTree=e;a.zeroBitPlanesTree=h;for(let e=0;e<r;e++)if(0!==readBits(1))throw new JpxError("Invalid tag tree")}if(e.reset(s,c,r))for(;;){if(!readBits(1)){e.incrementValue(r);break}l=!e.nextLevel();if(l){o.included=!0;u=d=!0;break}}}if(!u)continue;if(d){h=a.zeroBitPlanesTree;h.reset(s,c);for(;;)if(readBits(1)){l=!h.nextLevel();if(l)break}else h.incrementValue();o.zeroBitPlanes=h.value}const f=readCodingpasses();for(;readBits(1);)o.Lblock++;const g=(0,n.log2)(f),p=readBits((f<1<<g?g-1:g)+o.Lblock);i.push({codeblock:o,codingpasses:f,dataLength:p})}alignToByte();d&&skipMarkerIfEqual(146);for(;i.length>0;){const e=i.shift();o=e.codeblock;void 0===o.data&&(o.data=[]);o.data.push({data:t,start:a+s,end:a+s+e.dataLength,codingpasses:e.codingpasses});s+=e.dataLength}}return s}function copyCoefficients(e,t,a,r,n,s,c,l,h){const u=r.tbx0,d=r.tby0,f=r.tbx1-r.tbx0,g=r.codeblocks,p="H"===r.type.charAt(0)?1:0,m="H"===r.type.charAt(1)?t:0;for(let a=0,b=g.length;a<b;++a){const b=g[a],y=b.tbx1_-b.tbx0_,w=b.tby1_-b.tby0_;if(0===y||0===w)continue;if(void 0===b.data)continue;const S=new o(y,w,b.subbandType,b.zeroBitPlanes,s);let x=2;const C=b.data;let k,v,F,O=0,T=0;for(k=0,v=C.length;k<v;k++){F=C[k];O+=F.end-F.start;T+=F.codingpasses}const M=new Uint8Array(O);let E=0;for(k=0,v=C.length;k<v;k++){F=C[k];const e=F.data.subarray(F.start,F.end);M.set(e,E);E+=e.length}const D=new i.ArithmeticDecoder(M,0,O);S.setDecoder(D);for(k=0;k<T;k++){switch(x){case 0:S.runSignificancePropagationPass();break;case 1:S.runMagnitudeRefinementPass();break;case 2:S.runCleanupPass();l&&S.checkSegmentationSymbol()}h&&S.reset();x=(x+1)%3}let N=b.tbx0_-u+(b.tby0_-d)*f;const R=S.coefficentsSign,L=S.coefficentsMagnitude,j=S.bitsDecoded,$=c?0:.5;let _,U,X;E=0;const H="LL"!==r.type;for(k=0;k<w;k++){const a=2*(N/f|0)*(t-f)+p+m;for(_=0;_<y;_++){U=L[E];if(0!==U){U=(U+$)*n;0!==R[E]&&(U=-U);X=j[E];const t=H?a+(N<<1):N;e[t]=c&&X>=s?U:U*(1<<s-X)}N++;E++}N+=f-y}}}function transformTile(e,t,a){const r=t.components[a],n=r.codingStyleParameters,i=r.quantizationParameters,o=n.decompositionLevelsCount,c=i.SPqcds,l=i.scalarExpounded,h=i.guardBits,u=n.segmentationSymbolUsed,d=n.resetContextProbabilities,f=e.components[a].precision,g=n.reversibleTransformation,p=g?new ReversibleTransform:new IrreversibleTransform,m=[];let b=0;for(let e=0;e<=o;e++){const t=r.resolutions[e],a=t.trx1-t.trx0,n=t.try1-t.try0,i=new Float32Array(a*n);for(let r=0,n=t.subbands.length;r<n;r++){let n,o;if(l){n=c[b].mu;o=c[b].epsilon;b++}else{n=c[0].mu;o=c[0].epsilon+(e>0?1-e:0)}const p=t.subbands[r],m=s[p.type];copyCoefficients(i,a,0,p,g?1:2**(f+m-o)*(1+n/2048),h+o-1,g,u,d)}m.push({width:a,height:n,items:i})}const y=p.calculate(m,r.tcx0,r.tcy0);return{left:r.tcx0,top:r.tcy0,width:y.width,height:y.height,items:y.items}}function initializeTile(e,t){const a=e.SIZ.Csiz,r=e.tiles[t];for(let t=0;t<a;t++){const a=r.components[t],n=void 0!==e.currentTile.QCC[t]?e.currentTile.QCC[t]:e.currentTile.QCD;a.quantizationParameters=n;const i=void 0!==e.currentTile.COC[t]?e.currentTile.COC[t]:e.currentTile.COD;a.codingStyleParameters=i}r.codingStyleDefaultParameters=e.currentTile.COD}class TagTree{constructor(e,t){const a=(0,n.log2)(Math.max(e,t))+1;this.levels=[];for(let r=0;r<a;r++){const a={width:e,height:t,items:[]};this.levels.push(a);e=Math.ceil(e/2);t=Math.ceil(t/2)}}reset(e,t){let a,r=0,n=0;for(;r<this.levels.length;){a=this.levels[r];const i=e+t*a.width;if(void 0!==a.items[i]){n=a.items[i];break}a.index=i;e>>=1;t>>=1;r++}r--;a=this.levels[r];a.items[a.index]=n;this.currentLevel=r;delete this.value}incrementValue(){const e=this.levels[this.currentLevel];e.items[e.index]++}nextLevel(){let e=this.currentLevel,t=this.levels[e];const a=t.items[t.index];e--;if(e<0){this.value=a;return!1}this.currentLevel=e;t=this.levels[e];t.items[t.index]=a;return!0}}class InclusionTree{constructor(e,t,a){const r=(0,n.log2)(Math.max(e,t))+1;this.levels=[];for(let n=0;n<r;n++){const r=new Uint8Array(e*t);for(let e=0,t=r.length;e<t;e++)r[e]=a;const n={width:e,height:t,items:r};this.levels.push(n);e=Math.ceil(e/2);t=Math.ceil(t/2)}}reset(e,t,a){let r=0;for(;r<this.levels.length;){const n=this.levels[r],i=e+t*n.width;n.index=i;const s=n.items[i];if(255===s)break;if(s>a){this.currentLevel=r;this.propagateValues();return!1}e>>=1;t>>=1;r++}this.currentLevel=r-1;return!0}incrementValue(e){const t=this.levels[this.currentLevel];t.items[t.index]=e+1;this.propagateValues()}propagateValues(){let e=this.currentLevel,t=this.levels[e];const a=t.items[t.index];for(;--e>=0;){t=this.levels[e];t.items[t.index]=a}}nextLevel(){let e=this.currentLevel,t=this.levels[e];const a=t.items[t.index];t.items[t.index]=255;e--;if(e<0)return!1;this.currentLevel=e;t=this.levels[e];t.items[t.index]=a;return!0}}const o=function BitModelClosure(){const e=17,t=new Uint8Array([0,5,8,0,3,7,8,0,4,7,8,0,0,0,0,0,1,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8]),a=new Uint8Array([0,3,4,0,5,7,7,0,8,8,8,0,0,0,0,0,1,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8]),r=new Uint8Array([0,1,2,0,1,2,2,0,2,2,2,0,0,0,0,0,3,4,5,0,4,5,5,0,5,5,5,0,0,0,0,0,6,7,7,0,7,7,7,0,7,7,7,0,0,0,0,0,8,8,8,0,8,8,8,0,8,8,8,0,0,0,0,0,8,8,8,0,8,8,8,0,8,8,8]);return class BitModel{constructor(e,n,i,s,o){this.width=e;this.height=n;let c;c="HH"===i?r:"HL"===i?a:t;this.contextLabelTable=c;const l=e*n;this.neighborsSignificance=new Uint8Array(l);this.coefficentsSign=new Uint8Array(l);let h;h=o>14?new Uint32Array(l):o>6?new Uint16Array(l):new Uint8Array(l);this.coefficentsMagnitude=h;this.processingFlags=new Uint8Array(l);const u=new Uint8Array(l);if(0!==s)for(let e=0;e<l;e++)u[e]=s;this.bitsDecoded=u;this.reset()}setDecoder(e){this.decoder=e}reset(){this.contexts=new Int8Array(19);this.contexts[0]=8;this.contexts[17]=92;this.contexts[18]=6}setNeighborsSignificance(e,t,a){const r=this.neighborsSignificance,n=this.width,i=this.height,s=t>0,o=t+1<n;let c;if(e>0){c=a-n;s&&(r[c-1]+=16);o&&(r[c+1]+=16);r[c]+=4}if(e+1<i){c=a+n;s&&(r[c-1]+=16);o&&(r[c+1]+=16);r[c]+=4}s&&(r[a-1]+=1);o&&(r[a+1]+=1);r[a]|=128}runSignificancePropagationPass(){const e=this.decoder,t=this.width,a=this.height,r=this.coefficentsMagnitude,n=this.coefficentsSign,i=this.neighborsSignificance,s=this.processingFlags,o=this.contexts,c=this.contextLabelTable,l=this.bitsDecoded;for(let h=0;h<a;h+=4)for(let u=0;u<t;u++){let d=h*t+u;for(let f=0;f<4;f++,d+=t){const t=h+f;if(t>=a)break;s[d]&=-2;if(r[d]||!i[d])continue;const g=c[i[d]];if(e.readBit(o,g)){const e=this.decodeSignBit(t,u,d);n[d]=e;r[d]=1;this.setNeighborsSignificance(t,u,d);s[d]|=2}l[d]++;s[d]|=1}}}decodeSignBit(e,t,a){const r=this.width,n=this.height,i=this.coefficentsMagnitude,s=this.coefficentsSign;let o,c,l,h,u,d;h=t>0&&0!==i[a-1];if(t+1<r&&0!==i[a+1]){l=s[a+1];if(h){c=s[a-1];o=1-l-c}else o=1-l-l}else if(h){c=s[a-1];o=1-c-c}else o=0;const f=3*o;h=e>0&&0!==i[a-r];if(e+1<n&&0!==i[a+r]){l=s[a+r];if(h){c=s[a-r];o=1-l-c+f}else o=1-l-l+f}else if(h){c=s[a-r];o=1-c-c+f}else o=f;if(o>=0){u=9+o;d=this.decoder.readBit(this.contexts,u)}else{u=9-o;d=1^this.decoder.readBit(this.contexts,u)}return d}runMagnitudeRefinementPass(){const e=this.decoder,t=this.width,a=this.height,r=this.coefficentsMagnitude,n=this.neighborsSignificance,i=this.contexts,s=this.bitsDecoded,o=this.processingFlags,c=t*a,l=4*t;for(let a,h=0;h<c;h=a){a=Math.min(c,h+l);for(let c=0;c<t;c++)for(let l=h+c;l<a;l+=t){if(!r[l]||0!=(1&o[l]))continue;let t=16;if(0!=(2&o[l])){o[l]^=2;t=0===(127&n[l])?15:14}const a=e.readBit(i,t);r[l]=r[l]<<1|a;s[l]++;o[l]|=1}}}runCleanupPass(){const t=this.decoder,a=this.width,r=this.height,n=this.neighborsSignificance,i=this.coefficentsMagnitude,s=this.coefficentsSign,o=this.contexts,c=this.contextLabelTable,l=this.bitsDecoded,h=this.processingFlags,u=a,d=2*a,f=3*a;let g;for(let p=0;p<r;p=g){g=Math.min(p+4,r);const m=p*a,b=p+3<r;for(let r=0;r<a;r++){const y=m+r;let w,S=0,x=y,C=p;if(b&&0===h[y]&&0===h[y+u]&&0===h[y+d]&&0===h[y+f]&&0===n[y]&&0===n[y+u]&&0===n[y+d]&&0===n[y+f]){if(!t.readBit(o,18)){l[y]++;l[y+u]++;l[y+d]++;l[y+f]++;continue}S=t.readBit(o,e)<<1|t.readBit(o,e);if(0!==S){C=p+S;x+=S*a}w=this.decodeSignBit(C,r,x);s[x]=w;i[x]=1;this.setNeighborsSignificance(C,r,x);h[x]|=2;x=y;for(let e=p;e<=C;e++,x+=a)l[x]++;S++}for(C=p+S;C<g;C++,x+=a){if(i[x]||0!=(1&h[x]))continue;const e=c[n[x]];if(1===t.readBit(o,e)){w=this.decodeSignBit(C,r,x);s[x]=w;i[x]=1;this.setNeighborsSignificance(C,r,x);h[x]|=2}l[x]++}}}}checkSegmentationSymbol(){const t=this.decoder,a=this.contexts;if(10!==(t.readBit(a,e)<<3|t.readBit(a,e)<<2|t.readBit(a,e)<<1|t.readBit(a,e)))throw new JpxError("Invalid segmentation symbol")}}}();class Transform{constructor(){this.constructor===Transform&&(0,r.unreachable)("Cannot initialize Transform.")}calculate(e,t,a){let r=e[0];for(let n=1,i=e.length;n<i;n++)r=this.iterate(r,e[n],t,a);return r}extend(e,t,a){let r=t-1,n=t+1,i=t+a-2,s=t+a;e[r--]=e[n++];e[s++]=e[i--];e[r--]=e[n++];e[s++]=e[i--];e[r--]=e[n++];e[s++]=e[i--];e[r]=e[n];e[s]=e[i]}filter(e,t,a){(0,r.unreachable)("Abstract method `filter` called")}iterate(e,t,a,r){const n=e.width,i=e.height;let s=e.items;const o=t.width,c=t.height,l=t.items;let h,u,d,f,g,p;for(d=0,h=0;h<i;h++){f=2*h*o;for(u=0;u<n;u++,d++,f+=2)l[f]=s[d]}s=e.items=null;const m=new Float32Array(o+8);if(1===o){if(0!=(1&a))for(p=0,d=0;p<c;p++,d+=o)l[d]*=.5}else for(p=0,d=0;p<c;p++,d+=o){m.set(l.subarray(d,d+o),4);this.extend(m,4,o);this.filter(m,4,o);l.set(m.subarray(4,4+o),d)}let b=16;const y=[];for(h=0;h<b;h++)y.push(new Float32Array(c+8));let w,S=0;e=4+c;if(1===c){if(0!=(1&r))for(g=0;g<o;g++)l[g]*=.5}else for(g=0;g<o;g++){if(0===S){b=Math.min(o-g,b);for(d=g,f=4;f<e;d+=o,f++)for(w=0;w<b;w++)y[w][f]=l[d+w];S=b}S--;const t=y[S];this.extend(t,4,c);this.filter(t,4,c);if(0===S){d=g-b+1;for(f=4;f<e;d+=o,f++)for(w=0;w<b;w++)l[d+w]=y[w][f]}}return{width:o,height:c,items:l}}}class IrreversibleTransform extends Transform{filter(e,t,a){const r=a>>1;let n,i,s,o;const c=-1.586134342059924,l=-.052980118572961,h=.882911075530934,u=.443506852043971,d=1.230174104914001;n=(t|=0)-3;for(i=r+4;i--;n+=2)e[n]*=.8128930661159609;n=t-2;s=u*e[n-1];for(i=r+3;i--;n+=2){o=u*e[n+1];e[n]=d*e[n]-s-o;if(!i--)break;n+=2;s=u*e[n+1];e[n]=d*e[n]-s-o}n=t-1;s=h*e[n-1];for(i=r+2;i--;n+=2){o=h*e[n+1];e[n]-=s+o;if(!i--)break;n+=2;s=h*e[n+1];e[n]-=s+o}n=t;s=l*e[n-1];for(i=r+1;i--;n+=2){o=l*e[n+1];e[n]-=s+o;if(!i--)break;n+=2;s=l*e[n+1];e[n]-=s+o}if(0!==r){n=t+1;s=c*e[n-1];for(i=r;i--;n+=2){o=c*e[n+1];e[n]-=s+o;if(!i--)break;n+=2;s=c*e[n+1];e[n]-=s+o}}}}class ReversibleTransform extends Transform{filter(e,t,a){const r=a>>1;let n,i;for(n=t|=0,i=r+1;i--;n+=2)e[n]-=e[n-1]+e[n+1]+2>>2;for(n=t+1,i=r;i--;n+=2)e[n]+=e[n-1]+e[n+1]>>1}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.LZWStream=void 0;var r=a(17);class LZWStream extends r.DecodeStream{constructor(e,t,a){super(t);this.str=e;this.dict=e.dict;this.cachedData=0;this.bitsCached=0;const r=4096,n={earlyChange:a,codeLength:9,nextCode:258,dictionaryValues:new Uint8Array(r),dictionaryLengths:new Uint16Array(r),dictionaryPrevCodes:new Uint16Array(r),currentSequence:new Uint8Array(r),currentSequenceLength:0};for(let e=0;e<256;++e){n.dictionaryValues[e]=e;n.dictionaryLengths[e]=1}this.lzwState=n}readBits(e){let t=this.bitsCached,a=this.cachedData;for(;t<e;){const e=this.str.getByte();if(-1===e){this.eof=!0;return null}a=a<<8|e;t+=8}this.bitsCached=t-=e;this.cachedData=a;this.lastCode=null;return a>>>t&(1<<e)-1}readBlock(){let e,t,a,r=1024;const n=this.lzwState;if(!n)return;const i=n.earlyChange;let s=n.nextCode;const o=n.dictionaryValues,c=n.dictionaryLengths,l=n.dictionaryPrevCodes;let h=n.codeLength,u=n.prevCode;const d=n.currentSequence;let f=n.currentSequenceLength,g=0,p=this.bufferLength,m=this.ensureBuffer(this.bufferLength+r);for(e=0;e<512;e++){const e=this.readBits(h),n=f>0;if(e<256){d[0]=e;f=1}else{if(!(e>=258)){if(256===e){h=9;s=258;f=0;continue}this.eof=!0;delete this.lzwState;break}if(e<s){f=c[e];for(t=f-1,a=e;t>=0;t--){d[t]=o[a];a=l[a]}}else d[f++]=d[0]}if(n){l[s]=u;c[s]=c[u]+1;o[s]=d[0];s++;h=s+i&s+i-1?h:0|Math.min(Math.log(s+i)/.6931471805599453+1,12)}u=e;g+=f;if(r<g){do{r+=512}while(r<g);m=this.ensureBuffer(this.bufferLength+r)}for(t=0;t<f;t++)m[p++]=d[t]}n.nextCode=s;n.codeLength=h;n.prevCode=u;n.currentSequenceLength=f;this.bufferLength=p}}t.LZWStream=LZWStream},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.PredictorStream=void 0;var r=a(17),n=a(4),i=a(2);class PredictorStream extends r.DecodeStream{constructor(e,t,a){super(t);if(!(a instanceof n.Dict))return e;const r=this.predictor=a.get("Predictor")||1;if(r<=1)return e;if(2!==r&&(r<10||r>15))throw new i.FormatError(`Unsupported predictor: ${r}`);this.readBlock=2===r?this.readBlockTiff:this.readBlockPng;this.str=e;this.dict=e.dict;const s=this.colors=a.get("Colors")||1,o=this.bits=a.get("BPC","BitsPerComponent")||8,c=this.columns=a.get("Columns")||1;this.pixBytes=s*o+7>>3;this.rowBytes=c*s*o+7>>3;return this}readBlockTiff(){const e=this.rowBytes,t=this.bufferLength,a=this.ensureBuffer(t+e),r=this.bits,n=this.colors,i=this.str.getBytes(e);this.eof=!i.length;if(this.eof)return;let s,o=0,c=0,l=0,h=0,u=t;if(1===r&&1===n)for(s=0;s<e;++s){let e=i[s]^o;e^=e>>1;e^=e>>2;e^=e>>4;o=(1&e)<<7;a[u++]=e}else if(8===r){for(s=0;s<n;++s)a[u++]=i[s];for(;s<e;++s){a[u]=a[u-n]+i[s];u++}}else if(16===r){const t=2*n;for(s=0;s<t;++s)a[u++]=i[s];for(;s<e;s+=2){const e=((255&i[s])<<8)+(255&i[s+1])+((255&a[u-t])<<8)+(255&a[u-t+1]);a[u++]=e>>8&255;a[u++]=255&e}}else{const e=new Uint8Array(n+1),u=(1<<r)-1;let d=0,f=t;const g=this.columns;for(s=0;s<g;++s)for(let t=0;t<n;++t){if(l<r){o=o<<8|255&i[d++];l+=8}e[t]=e[t]+(o>>l-r)&u;l-=r;c=c<<r|e[t];h+=r;if(h>=8){a[f++]=c>>h-8&255;h-=8}}h>0&&(a[f++]=(c<<8-h)+(o&(1<<8-h)-1))}this.bufferLength+=e}readBlockPng(){const e=this.rowBytes,t=this.pixBytes,a=this.str.getByte(),r=this.str.getBytes(e);this.eof=!r.length;if(this.eof)return;const n=this.bufferLength,s=this.ensureBuffer(n+e);let o=s.subarray(n-e,n);0===o.length&&(o=new Uint8Array(e));let c,l,h,u=n;switch(a){case 0:for(c=0;c<e;++c)s[u++]=r[c];break;case 1:for(c=0;c<t;++c)s[u++]=r[c];for(;c<e;++c){s[u]=s[u-t]+r[c]&255;u++}break;case 2:for(c=0;c<e;++c)s[u++]=o[c]+r[c]&255;break;case 3:for(c=0;c<t;++c)s[u++]=(o[c]>>1)+r[c];for(;c<e;++c){s[u]=(o[c]+s[u-t]>>1)+r[c]&255;u++}break;case 4:for(c=0;c<t;++c){l=o[c];h=r[c];s[u++]=l+h}for(;c<e;++c){l=o[c];const e=o[c-t],a=s[u-t],n=a+l-e;let i=n-a;i<0&&(i=-i);let d=n-l;d<0&&(d=-d);let f=n-e;f<0&&(f=-f);h=r[c];s[u++]=i<=d&&i<=f?a+h:d<=f?l+h:e+h}break;default:throw new i.FormatError(`Unsupported predictor: ${a}`)}this.bufferLength+=e}}t.PredictorStream=PredictorStream},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.RunLengthStream=void 0;var r=a(17);class RunLengthStream extends r.DecodeStream{constructor(e,t){super(t);this.str=e;this.dict=e.dict}readBlock(){const e=this.str.getBytes(2);if(!e||e.length<2||128===e[0]){this.eof=!0;return}let t,a=this.bufferLength,r=e[0];if(r<128){t=this.ensureBuffer(a+r+1);t[a++]=e[1];if(r>0){const e=this.str.getBytes(r);t.set(e,a);a+=r}}else{r=257-r;const n=e[1];t=this.ensureBuffer(a+r+1);for(let e=0;e<r;e++)t[a++]=n}this.bufferLength=a}}t.RunLengthStream=RunLengthStream},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.Font=t.ErrorFont=void 0;var r=a(2),n=a(33),i=a(36),s=a(38),o=a(37),c=a(35),l=a(39),h=a(40),u=a(41),d=a(42),f=a(43),g=a(44),p=a(14),m=a(45),b=a(3),y=a(8),w=a(46);const S=[[57344,63743],[1048576,1114109]],x=1e3,C=["ascent","bbox","black","bold","charProcOperatorList","composite","cssFontInfo","data","defaultVMetrics","defaultWidth","descent","fallbackName","fontMatrix","isInvalidPDFjsFont","isType3Font","italic","loadedName","mimetype","missingFile","name","remeasure","subtype","type","vertical"],k=["cMap","defaultEncoding","differences","isMonospace","isSerifFont","isSymbolicFont","seacMap","toFontChar","toUnicode","vmetrics","widths"];function adjustWidths(e){if(!e.fontMatrix)return;if(e.fontMatrix[0]===r.FONT_IDENTITY_MATRIX[0])return;const t=.001/e.fontMatrix[0],a=e.widths;for(const e in a)a[e]*=t;e.defaultWidth*=t}function amendFallbackToUnicode(e){if(!e.fallbackToUnicode)return;if(e.toUnicode instanceof h.IdentityToUnicodeMap)return;const t=[];for(const a in e.fallbackToUnicode)e.toUnicode.has(a)||(t[a]=e.fallbackToUnicode[a]);t.length>0&&e.toUnicode.amend(t)}class Glyph{constructor(e,t,a,r,n,i,s,o,c){this.originalCharCode=e;this.fontChar=t;this.unicode=a;this.accent=r;this.width=n;this.vmetric=i;this.operatorListId=s;this.isSpace=o;this.isInFont=c}get category(){return(0,r.shadow)(this,"category",(0,s.getCharUnicodeCategory)(this.unicode),!0)}get normalizedUnicode(){return(0,r.shadow)(this,"normalizedUnicode",(0,s.reverseIfRtl)(Glyph._NormalizedUnicodes[this.unicode]||this.unicode),!0)}static get _NormalizedUnicodes(){return(0,r.shadow)(this,"_NormalizedUnicodes",(0,s.getNormalizedUnicodes)())}}function int16(e,t){return(e<<8)+t}function writeSignedInt16(e,t,a){e[t+1]=a;e[t]=a>>>8}function signedInt16(e,t){const a=(e<<8)+t;return 32768&a?a-65536:a}function string16(e){return String.fromCharCode(e>>8&255,255&e)}function safeString16(e){e>32767?e=32767:e<-32768&&(e=-32768);return String.fromCharCode(e>>8&255,255&e)}function isTrueTypeCollectionFile(e){const t=e.peekBytes(4);return"ttcf"===(0,r.bytesToString)(t)}function getFontFileType(e,{type:t,subtype:a,composite:n}){let i,s;if(function isTrueTypeFile(e){const t=e.peekBytes(4);return 65536===(0,b.readUint32)(t,0)||"true"===(0,r.bytesToString)(t)}(e)||isTrueTypeCollectionFile(e))i=n?"CIDFontType2":"TrueType";else if(function isOpenTypeFile(e){const t=e.peekBytes(4);return"OTTO"===(0,r.bytesToString)(t)}(e))i=n?"CIDFontType2":"OpenType";else if(function isType1File(e){const t=e.peekBytes(2);return 37===t[0]&&33===t[1]||128===t[0]&&1===t[1]}(e))i=n?"CIDFontType0":"MMType1"===t?"MMType1":"Type1";else if(function isCFFFile(e){const t=e.peekBytes(4);return t[0]>=1&&t[3]>=1&&t[3]<=4}(e))if(n){i="CIDFontType0";s="CIDFontType0C"}else{i="MMType1"===t?"MMType1":"Type1";s="Type1C"}else{(0,r.warn)("getFontFileType: Unable to detect correct font file Type/Subtype.");i=t;s=a}return[i,s]}function applyStandardFontGlyphMap(e,t){for(const a in t)e[+a]=t[a]}function buildToFontChar(e,t,a){const r=[];let n;for(let a=0,i=e.length;a<i;a++){n=(0,s.getUnicodeForGlyph)(e[a],t);-1!==n&&(r[a]=n)}for(const e in a){n=(0,s.getUnicodeForGlyph)(a[e],t);-1!==n&&(r[+e]=n)}return r}function isMacNameRecord(e){return 1===e.platform&&0===e.encoding&&0===e.language}function isWinNameRecord(e){return 3===e.platform&&1===e.encoding&&1033===e.language}function convertCidString(e,t,a=!1){switch(t.length){case 1:return t.charCodeAt(0);case 2:return t.charCodeAt(0)<<8|t.charCodeAt(1)}const n=`Unsupported CID string (charCode ${e}): "${t}".`;if(a)throw new r.FormatError(n);(0,r.warn)(n);return t}function adjustMapping(e,t,a,n){const i=Object.create(null),s=new Map,o=[],c=new Set;let l=0;const h=S[l][0];let u=h,d=S[l][1];for(let f in e){f|=0;let g=e[f];if(!t(g))continue;if(u>d){l++;if(l>=S.length){(0,r.warn)("Ran out of space in font private use area.");break}u=S[l][0];d=S[l][1]}const p=u++;0===g&&(g=a);let m=n.get(f);"string"==typeof m&&(m=m.codePointAt(0));if(m&&m<h&&!c.has(g)){s.set(m,g);c.add(g)}i[p]=g;o[f]=p}return{toFontChar:o,charCodeToGlyphId:i,toUnicodeExtraMap:s,nextAvailableFontCharCode:u}}function createCmapTable(e,t,a){const n=function getRanges(e,t,a){const r=[];for(const t in e)e[t]>=a||r.push({fontCharCode:0|t,glyphId:e[t]});if(t)for(const[e,n]of t)n>=a||r.push({fontCharCode:e,glyphId:n});0===r.length&&r.push({fontCharCode:0,glyphId:0});r.sort((function fontGetRangesSort(e,t){return e.fontCharCode-t.fontCharCode}));const n=[],i=r.length;for(let e=0;e<i;){const t=r[e].fontCharCode,a=[r[e].glyphId];++e;let s=t;for(;e<i&&s+1===r[e].fontCharCode;){a.push(r[e].glyphId);++s;++e;if(65535===s)break}n.push([t,s,a])}return n}(e,t,a),i=n.at(-1)[1]>65535?2:1;let s,o,c,l,h="\0\0"+string16(i)+"\0\0"+(0,r.string32)(4+8*i);for(s=n.length-1;s>=0&&!(n[s][0]<=65535);--s);const u=s+1;n[s][0]<65535&&65535===n[s][1]&&(n[s][1]=65534);const d=n[s][1]<65535?1:0,f=u+d,g=m.OpenTypeFileBuilder.getSearchParams(f,2);let p,b,y,w,S="",x="",C="",k="",v="",F=0;for(s=0,o=u;s<o;s++){p=n[s];b=p[0];y=p[1];S+=string16(b);x+=string16(y);w=p[2];let e=!0;for(c=1,l=w.length;c<l;++c)if(w[c]!==w[c-1]+1){e=!1;break}if(e){C+=string16(w[0]-b&65535);k+=string16(0)}else{const e=2*(f-s)+2*F;F+=y-b+1;C+=string16(0);k+=string16(e);for(c=0,l=w.length;c<l;++c)v+=string16(w[c])}}if(d>0){x+="ÿÿ";S+="ÿÿ";C+="\0";k+="\0\0"}const O="\0\0"+string16(2*f)+string16(g.range)+string16(g.entry)+string16(g.rangeShift)+x+"\0\0"+S+C+k+v;let T="",M="";if(i>1){h+="\0\0\n"+(0,r.string32)(4+8*i+4+O.length);T="";for(s=0,o=n.length;s<o;s++){p=n[s];b=p[0];w=p[2];let e=w[0];for(c=1,l=w.length;c<l;++c)if(w[c]!==w[c-1]+1){y=p[0]+c-1;T+=(0,r.string32)(b)+(0,r.string32)(y)+(0,r.string32)(e);b=y+1;e=w[c]}T+=(0,r.string32)(b)+(0,r.string32)(p[1])+(0,r.string32)(e)}M="\0\f\0\0"+(0,r.string32)(T.length+16)+"\0\0\0\0"+(0,r.string32)(T.length/12)}return h+"\0"+string16(O.length+4)+O+M+T}function createOS2Table(e,t,a){a=a||{unitsPerEm:0,yMax:0,yMin:0,ascent:0,descent:0};let n=0,i=0,o=0,c=0,l=null,h=0;if(t){for(let e in t){e|=0;(l>e||!l)&&(l=e);h<e&&(h=e);const t=(0,s.getUnicodeRangeFor)(e);if(t<32)n|=1<<t;else if(t<64)i|=1<<t-32;else if(t<96)o|=1<<t-64;else{if(!(t<123))throw new r.FormatError("Unicode ranges Bits > 123 are reserved for internal usage");c|=1<<t-96}}h>65535&&(h=65535)}else{l=0;h=255}const u=e.bbox||[0,0,0,0],d=a.unitsPerEm||1/(e.fontMatrix||r.FONT_IDENTITY_MATRIX)[0],f=e.ascentScaled?1:d/x,g=a.ascent||Math.round(f*(e.ascent||u[3]));let p=a.descent||Math.round(f*(e.descent||u[1]));p>0&&e.descent>0&&u[1]<0&&(p=-p);const m=a.yMax||g,b=-a.yMin||-p;return"\0$ô\0\0\0Š»\0\0\0ŒŠ»\0\0ß\x001\0\0\0\0"+String.fromCharCode(e.fixedPitch?9:0)+"\0\0\0\0\0\0"+(0,r.string32)(n)+(0,r.string32)(i)+(0,r.string32)(o)+(0,r.string32)(c)+"*21*"+string16(e.italicAngle?1:0)+string16(l||e.firstChar)+string16(h||e.lastChar)+string16(g)+string16(p)+"\0d"+string16(m)+string16(b)+"\0\0\0\0\0\0\0\0"+string16(e.xHeight)+string16(e.capHeight)+string16(0)+string16(l||e.firstChar)+"\0"}function createPostTable(e){const t=Math.floor(65536*e.italicAngle);return"\0\0\0"+(0,r.string32)(t)+"\0\0\0\0"+(0,r.string32)(e.fixedPitch?1:0)+"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}function createPostscriptName(e){return e.replace(/[^\x21-\x7E]|[[\](){}<>/%]/g,"").slice(0,63)}function createNameTable(e,t){t||(t=[[],[]]);const a=[t[0][0]||"Original licence",t[0][1]||e,t[0][2]||"Unknown",t[0][3]||"uniqueID",t[0][4]||e,t[0][5]||"Version 0.11",t[0][6]||createPostscriptName(e),t[0][7]||"Unknown",t[0][8]||"Unknown",t[0][9]||"Unknown"],r=[];let n,i,s,o,c;for(n=0,i=a.length;n<i;n++){c=t[1][n]||a[n];const e=[];for(s=0,o=c.length;s<o;s++)e.push(string16(c.charCodeAt(s)));r.push(e.join(""))}const l=[a,r],h=["\0","\0"],u=["\0\0","\0"],d=["\0\0","\t"],f=a.length*h.length;let g="\0\0"+string16(f)+string16(12*f+6),p=0;for(n=0,i=h.length;n<i;n++){const e=l[n];for(s=0,o=e.length;s<o;s++){c=e[s];g+=h[n]+u[n]+d[n]+string16(s)+string16(c.length)+string16(p);p+=c.length}}g+=a.join("")+r.join("");return g}t.Font=class Font{constructor(e,t,a){this.name=e;this.psName=null;this.mimetype=null;this.disableFontFace=!1;this.loadedName=a.loadedName;this.isType3Font=a.isType3Font;this.missingFile=!1;this.cssFontInfo=a.cssFontInfo;this._charsCache=Object.create(null);this._glyphCache=Object.create(null);let n=!!(a.flags&i.FontFlags.Serif);if(!n&&!a.isSimulatedFlags){const t=e.replace(/[,_]/g,"-").split("-")[0],a=(0,l.getSerifFonts)();for(const e of t.split("+"))if(a[e]){n=!0;break}}this.isSerifFont=n;this.isSymbolicFont=!!(a.flags&i.FontFlags.Symbolic);this.isMonospace=!!(a.flags&i.FontFlags.FixedPitch);let{type:s,subtype:o}=a;this.type=s;this.subtype=o;const c=e.match(/^InvalidPDFjsFont_(.*)_\d+$/);this.isInvalidPDFjsFont=!!c;this.isInvalidPDFjsFont?this.fallbackName=c[1]:this.isMonospace?this.fallbackName="monospace":this.isSerifFont?this.fallbackName="serif":this.fallbackName="sans-serif";this.differences=a.differences;this.widths=a.widths;this.defaultWidth=a.defaultWidth;this.composite=a.composite;this.cMap=a.cMap;this.capHeight=a.capHeight/x;this.ascent=a.ascent/x;this.descent=a.descent/x;this.lineHeight=this.ascent-this.descent;this.fontMatrix=a.fontMatrix;this.bbox=a.bbox;this.defaultEncoding=a.defaultEncoding;this.toUnicode=a.toUnicode;this.toFontChar=[];if("Type3"===a.type){for(let e=0;e<256;e++)this.toFontChar[e]=this.differences[e]||a.defaultEncoding[e];return}this.cidEncoding=a.cidEncoding||"";this.vertical=!!a.vertical;if(this.vertical){this.vmetrics=a.vmetrics;this.defaultVMetrics=a.defaultVMetrics}if(!t||t.isEmpty){t&&(0,r.warn)('Font file is empty in "'+e+'" ('+this.loadedName+")");this.fallbackToSystemFont(a);return}[s,o]=getFontFileType(t,a);s===this.type&&o===this.subtype||(0,r.info)(`Inconsistent font file Type/SubType, expected: ${this.type}/${this.subtype} but found: ${s}/${o}.`);let h;try{switch(s){case"MMType1":(0,r.info)("MMType1 font ("+e+"), falling back to Type1.");case"Type1":case"CIDFontType0":this.mimetype="font/opentype";const n="Type1C"===o||"CIDFontType0C"===o?new u.CFFFont(t,a):new w.Type1Font(e,t,a);adjustWidths(a);h=this.convert(e,n,a);break;case"OpenType":case"TrueType":case"CIDFontType2":this.mimetype="font/opentype";h=this.checkAndRepair(e,t,a);if(this.isOpenType){adjustWidths(a);s="OpenType"}break;default:throw new r.FormatError(`Font ${s} is not supported`)}}catch(e){(0,r.warn)(e);this.fallbackToSystemFont(a);return}amendFallbackToUnicode(a);this.data=h;this.type=s;this.subtype=o;this.fontMatrix=a.fontMatrix;this.widths=a.widths;this.defaultWidth=a.defaultWidth;this.toUnicode=a.toUnicode;this.seacMap=a.seacMap}get renderer(){const e=d.FontRendererFactory.create(this,i.SEAC_ANALYSIS_ENABLED);return(0,r.shadow)(this,"renderer",e)}exportData(e=!1){const t=e?[...C,...k]:C,a=Object.create(null);let r,n;for(r of t){n=this[r];void 0!==n&&(a[r]=n)}return a}fallbackToSystemFont(e){this.missingFile=!0;const{name:t,type:a}=this;let n=(0,i.normalizeFontName)(t);const u=(0,l.getStdFontMap)(),d=(0,l.getNonStdFontMap)(),g=!!u[n],p=!(!d[n]||!u[d[n]]);n=u[n]||d[n]||n;const m=(0,f.getFontBasicMetrics)()[n];if(m){isNaN(this.ascent)&&(this.ascent=m.ascent/x);isNaN(this.descent)&&(this.descent=m.descent/x);isNaN(this.capHeight)&&(this.capHeight=m.capHeight/x)}this.bold=/bold/gi.test(n);this.italic=/oblique|italic/gi.test(n);this.black=/Black/g.test(t);const b=/Narrow/g.test(t);this.remeasure=(!g||b)&&Object.keys(this.widths).length>0;if((g||p)&&"CIDFontType2"===a&&this.cidEncoding.startsWith("Identity-")){const a=e.cidToGidMap,r=[];applyStandardFontGlyphMap(r,(0,l.getGlyphMapForStandardFonts)());/Arial-?Black/i.test(t)?applyStandardFontGlyphMap(r,(0,l.getSupplementalGlyphMapForArialBlack)()):/Calibri/i.test(t)&&applyStandardFontGlyphMap(r,(0,l.getSupplementalGlyphMapForCalibri)());if(a){for(const e in r){const t=r[e];void 0!==a[t]&&(r[+e]=a[t])}a.length!==this.toUnicode.length&&e.hasIncludedToUnicodeMap&&this.toUnicode instanceof h.IdentityToUnicodeMap&&this.toUnicode.forEach((function(e,t){const n=r[e];void 0===a[n]&&(r[+e]=t)}))}this.toUnicode instanceof h.IdentityToUnicodeMap||this.toUnicode.forEach((function(e,t){r[+e]=t}));this.toFontChar=r;this.toUnicode=new h.ToUnicodeMap(r)}else if(/Symbol/i.test(n))this.toFontChar=buildToFontChar(c.SymbolSetEncoding,(0,o.getGlyphsUnicode)(),this.differences);else if(/Dingbats/i.test(n)){/Wingdings/i.test(t)&&(0,r.warn)("Non-embedded Wingdings font, falling back to ZapfDingbats.");this.toFontChar=buildToFontChar(c.ZapfDingbatsEncoding,(0,o.getDingbatsGlyphsUnicode)(),this.differences)}else if(g){const e=buildToFontChar(this.defaultEncoding,(0,o.getGlyphsUnicode)(),this.differences);"CIDFontType2"!==a||this.cidEncoding.startsWith("Identity-")||this.toUnicode instanceof h.IdentityToUnicodeMap||this.toUnicode.forEach((function(t,a){e[+t]=a}));this.toFontChar=e}else{const e=(0,o.getGlyphsUnicode)(),a=[];this.toUnicode.forEach(((t,r)=>{if(!this.composite){const a=this.differences[t]||this.defaultEncoding[t],n=(0,s.getUnicodeForGlyph)(a,e);-1!==n&&(r=n)}a[+t]=r}));this.composite&&this.toUnicode instanceof h.IdentityToUnicodeMap&&/Tahoma|Verdana/i.test(t)&&applyStandardFontGlyphMap(a,(0,l.getGlyphMapForStandardFonts)());this.toFontChar=a}amendFallbackToUnicode(e);this.loadedName=n.split("-")[0]}checkAndRepair(e,t,a){const s=["OS/2","cmap","head","hhea","hmtx","maxp","name","post","loca","glyf","fpgm","prep","cvt ","CFF "];function readTables(e,t){const a=Object.create(null);a["OS/2"]=null;a.cmap=null;a.head=null;a.hhea=null;a.hmtx=null;a.maxp=null;a.name=null;a.post=null;for(let r=0;r<t;r++){const t=readTableEntry(e);s.includes(t.tag)&&(0!==t.length&&(a[t.tag]=t))}return a}function readTableEntry(e){const t=e.getString(4),a=e.getInt32()>>>0,r=e.getInt32()>>>0,n=e.getInt32()>>>0,i=e.pos;e.pos=e.start||0;e.skip(r);const s=e.getBytes(n);e.pos=i;if("head"===t){s[8]=s[9]=s[10]=s[11]=0;s[17]|=32}return{tag:t,checksum:a,length:n,offset:r,data:s}}function readOpenTypeHeader(e){return{version:e.getString(4),numTables:e.getUint16(),searchRange:e.getUint16(),entrySelector:e.getUint16(),rangeShift:e.getUint16()}}function sanitizeGlyph(e,t,a,r,n,i){const s={length:0,sizeOfInstructions:0};if(a-t<=12)return s;const o=e.subarray(t,a);let c=signedInt16(o[0],o[1]);if(c<0){c=-1;writeSignedInt16(o,0,c);r.set(o,n);s.length=o.length;return s}let l,h=10,u=0;for(l=0;l<c;l++){u=(o[h]<<8|o[h+1])+1;h+=2}const d=h,f=o[h]<<8|o[h+1];s.sizeOfInstructions=f;h+=2+f;const g=h;let p=0;for(l=0;l<u;l++){const e=o[h++];192&e&&(o[h-1]=63&e);let t=2;2&e?t=1:16&e&&(t=0);let a=2;4&e?a=1:32&e&&(a=0);const r=t+a;p+=r;if(8&e){const e=o[h++];l+=e;p+=e*r}}if(0===p)return s;let m=h+p;if(m>o.length)return s;if(!i&&f>0){r.set(o.subarray(0,d),n);r.set([0,0],n+d);r.set(o.subarray(g,m),n+d+2);m-=f;o.length-m>3&&(m=m+3&-4);s.length=m;return s}if(o.length-m>3){m=m+3&-4;r.set(o.subarray(0,m),n);s.length=m;return s}r.set(o,n);s.length=o.length;return s}function readNameTable(e){const a=(t.start||0)+e.offset;t.pos=a;const r=[[],[]],n=[],i=e.length,s=a+i;if(0!==t.getUint16()||i<6)return[r,n];const o=t.getUint16(),c=t.getUint16();let l,h;for(l=0;l<o&&t.pos+12<=s;l++){const e={platform:t.getUint16(),encoding:t.getUint16(),language:t.getUint16(),name:t.getUint16(),length:t.getUint16(),offset:t.getUint16()};(isMacNameRecord(e)||isWinNameRecord(e))&&n.push(e)}for(l=0,h=n.length;l<h;l++){const e=n[l];if(e.length<=0)continue;const i=a+c+e.offset;if(i+e.length>s)continue;t.pos=i;const o=e.name;if(e.encoding){let a="";for(let r=0,n=e.length;r<n;r+=2)a+=String.fromCharCode(t.getUint16());r[1][o]=a}else r[0][o]=t.getString(e.length)}return[r,n]}const l=[0,0,0,0,0,0,0,0,-2,-2,-2,-2,0,0,-2,-5,-1,-1,-1,-1,-1,-1,-1,-1,0,0,-1,0,-1,-1,-1,-1,1,-1,-999,0,1,0,-1,-2,0,-1,-2,-1,-1,0,-1,-1,0,0,-999,-999,-1,-1,-1,-1,-2,-999,-2,-2,-999,0,-2,-2,0,0,-2,0,-2,0,0,0,-2,-1,-1,1,1,0,0,-1,-1,-1,-1,-1,-1,-1,0,0,-1,0,-1,-1,0,-999,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,0,0,0,0,0,-2,-999,-999,-999,-999,-999,-1,-1,-2,-2,0,0,0,0,-1,-1,-999,-2,-2,0,0,-1,-2,-2,0,0,0,-1,-1,-1,-2];function sanitizeTTProgram(e,t){let a,n,i,s,o,c=e.data,h=0,u=0,d=0;const f=[],g=[],p=[];let m=t.tooComplexToFollowFunctions,b=!1,y=0,w=0;for(let e=c.length;h<e;){const e=c[h++];if(64===e){n=c[h++];if(b||w)h+=n;else for(a=0;a<n;a++)f.push(c[h++])}else if(65===e){n=c[h++];if(b||w)h+=2*n;else for(a=0;a<n;a++){i=c[h++];f.push(i<<8|c[h++])}}else if(176==(248&e)){n=e-176+1;if(b||w)h+=n;else for(a=0;a<n;a++)f.push(c[h++])}else if(184==(248&e)){n=e-184+1;if(b||w)h+=2*n;else for(a=0;a<n;a++){i=c[h++];f.push(i<<8|c[h++])}}else if(43!==e||m)if(44!==e||m){if(45===e)if(b){b=!1;u=h}else{o=g.pop();if(!o){(0,r.warn)("TT: ENDF bad stack");t.hintsValid=!1;return}s=p.pop();c=o.data;h=o.i;t.functionsStackDeltas[s]=f.length-o.stackTop}else if(137===e){if(b||w){(0,r.warn)("TT: nested IDEFs not allowed");m=!0}b=!0;d=h}else if(88===e)++y;else if(27===e)w=y;else if(89===e){w===y&&(w=0);--y}else if(28===e&&!b&&!w){const e=f.at(-1);e>0&&(h+=e-1)}}else{if(b||w){(0,r.warn)("TT: nested FDEFs not allowed");m=!0}b=!0;d=h;s=f.pop();t.functionsDefined[s]={data:c,i:h}}else if(!b&&!w){s=f.at(-1);if(isNaN(s))(0,r.info)("TT: CALL empty stack (or invalid entry).");else{t.functionsUsed[s]=!0;if(s in t.functionsStackDeltas){const e=f.length+t.functionsStackDeltas[s];if(e<0){(0,r.warn)("TT: CALL invalid functions stack delta.");t.hintsValid=!1;return}f.length=e}else if(s in t.functionsDefined&&!p.includes(s)){g.push({data:c,i:h,stackTop:f.length-1});p.push(s);o=t.functionsDefined[s];if(!o){(0,r.warn)("TT: CALL non-existent function");t.hintsValid=!1;return}c=o.data;h=o.i}}}if(!b&&!w){let t=0;e<=142?t=l[e]:e>=192&&e<=223?t=-1:e>=224&&(t=-2);if(e>=113&&e<=117){n=f.pop();isNaN(n)||(t=2*-n)}for(;t<0&&f.length>0;){f.pop();t++}for(;t>0;){f.push(NaN);t--}}}t.tooComplexToFollowFunctions=m;const S=[c];h>c.length&&S.push(new Uint8Array(h-c.length));if(d>u){(0,r.warn)("TT: complementing a missing function tail");S.push(new Uint8Array([34,45]))}!function foldTTTable(e,t){if(t.length>1){let a,r,n=0;for(a=0,r=t.length;a<r;a++)n+=t[a].length;n=n+3&-4;const i=new Uint8Array(n);let s=0;for(a=0,r=t.length;a<r;a++){i.set(t[a],s);s+=t[a].length}e.data=i;e.length=n}}(e,S)}let d,f,b,w;if(isTrueTypeCollectionFile(t=new y.Stream(new Uint8Array(t.getBytes())))){const e=function readTrueTypeCollectionData(e,t){const{numFonts:a,offsetTable:n}=function readTrueTypeCollectionHeader(e){const t=e.getString(4);(0,r.assert)("ttcf"===t,"Must be a TrueType Collection font.");const a=e.getUint16(),n=e.getUint16(),i=e.getInt32()>>>0,s=[];for(let t=0;t<i;t++)s.push(e.getInt32()>>>0);const o={ttcTag:t,majorVersion:a,minorVersion:n,numFonts:i,offsetTable:s};switch(a){case 1:return o;case 2:o.dsigTag=e.getInt32()>>>0;o.dsigLength=e.getInt32()>>>0;o.dsigOffset=e.getInt32()>>>0;return o}throw new r.FormatError(`Invalid TrueType Collection majorVersion: ${a}.`)}(e),i=t.split("+");let s;for(let o=0;o<a;o++){e.pos=(e.start||0)+n[o];const a=readOpenTypeHeader(e),c=readTables(e,a.numTables);if(!c.name)throw new r.FormatError('TrueType Collection font must contain a "name" table.');const[l]=readNameTable(c.name);for(let e=0,r=l.length;e<r;e++)for(let r=0,n=l[e].length;r<n;r++){const n=l[e][r]&&l[e][r].replace(/\s/g,"");if(n){if(n===t)return{header:a,tables:c};if(!(i.length<2))for(const e of i)n===e&&(s={name:e,header:a,tables:c})}}}if(s){(0,r.warn)(`TrueType Collection does not contain "${t}" font, falling back to "${s.name}" font instead.`);return{header:s.header,tables:s.tables}}throw new r.FormatError(`TrueType Collection does not contain "${t}" font.`)}(t,this.name);d=e.header;f=e.tables}else{d=readOpenTypeHeader(t);f=readTables(t,d.numTables)}const S=!f["CFF "];if(S){if(!f.loca)throw new r.FormatError('Required "loca" table is not found');if(!f.glyf){(0,r.warn)('Required "glyf" table is not found -- trying to recover.');f.glyf={tag:"glyf",data:new Uint8Array(0)}}this.isOpenType=!1}else{const t=a.composite&&((a.cidToGidMap||[]).length>0||!(a.cMap instanceof p.IdentityCMap));if("OTTO"===d.version&&!t||!f.head||!f.hhea||!f.maxp||!f.post){w=new y.Stream(f["CFF "].data);b=new u.CFFFont(w,a);adjustWidths(a);return this.convert(e,b,a)}delete f.glyf;delete f.loca;delete f.fpgm;delete f.prep;delete f["cvt "];this.isOpenType=!0}if(!f.maxp)throw new r.FormatError('Required "maxp" table is not found');t.pos=(t.start||0)+f.maxp.offset;const x=t.getInt32(),C=t.getUint16();if(a.scaleFactors&&a.scaleFactors.length===C&&S){const{scaleFactors:e}=a,t=int16(f.head.data[50],f.head.data[51]),r=new g.GlyfTable({glyfTable:f.glyf.data,isGlyphLocationsLong:t,locaTable:f.loca.data,numGlyphs:C});r.scale(e);const{glyf:n,loca:i,isLocationLong:s}=r.write();f.glyf.data=n;f.loca.data=i;if(s!==!!t){f.head.data[50]=0;f.head.data[51]=s?1:0}const o=f.hmtx.data;for(let t=0;t<C;t++){const a=4*t,r=Math.round(e[t]*int16(o[a],o[a+1]));o[a]=r>>8&255;o[a+1]=255&r;writeSignedInt16(o,a+2,Math.round(e[t]*signedInt16(o[a+2],o[a+3])))}}let k=C+1,v=!0;if(k>65535){v=!1;k=C;(0,r.warn)("Not enough space in glyfs to duplicate first glyph.")}let F=0,O=0;if(x>=65536&&f.maxp.length>=22){t.pos+=8;if(t.getUint16()>2){f.maxp.data[14]=0;f.maxp.data[15]=2}t.pos+=4;F=t.getUint16();t.pos+=4;O=t.getUint16()}f.maxp.data[4]=k>>8;f.maxp.data[5]=255&k;const T=function sanitizeTTPrograms(e,t,a,n){const i={functionsDefined:[],functionsUsed:[],functionsStackDeltas:[],tooComplexToFollowFunctions:!1,hintsValid:!0};e&&sanitizeTTProgram(e,i);t&&sanitizeTTProgram(t,i);e&&function checkInvalidFunctions(e,t){if(!e.tooComplexToFollowFunctions)if(e.functionsDefined.length>t){(0,r.warn)("TT: more functions defined than expected");e.hintsValid=!1}else for(let a=0,n=e.functionsUsed.length;a<n;a++){if(a>t){(0,r.warn)("TT: invalid function id: "+a);e.hintsValid=!1;return}if(e.functionsUsed[a]&&!e.functionsDefined[a]){(0,r.warn)("TT: undefined function: "+a);e.hintsValid=!1;return}}}(i,n);if(a&&1&a.length){const e=new Uint8Array(a.length+1);e.set(a.data);a.data=e}return i.hintsValid}(f.fpgm,f.prep,f["cvt "],F);if(!T){delete f.fpgm;delete f.prep;delete f["cvt "]}!function sanitizeMetrics(e,t,a,n,i,s){if(!t){a&&(a.data=null);return}e.pos=(e.start||0)+t.offset;e.pos+=4;e.pos+=2;e.pos+=2;e.pos+=2;e.pos+=2;e.pos+=2;e.pos+=2;e.pos+=2;e.pos+=2;e.pos+=2;const o=e.getUint16();e.pos+=8;e.pos+=2;let c=e.getUint16();if(0!==o){if(!(2&int16(n.data[44],n.data[45]))){t.data[22]=0;t.data[23]=0}}if(c>i){(0,r.info)(`The numOfMetrics (${c}) should not be greater than the numGlyphs (${i}).`);c=i;t.data[34]=(65280&c)>>8;t.data[35]=255&c}const l=i-c-(a.length-4*c>>1);if(l>0){const e=new Uint8Array(a.length+2*l);e.set(a.data);if(s){e[a.length]=a.data[2];e[a.length+1]=a.data[3]}a.data=e}}(t,f.hhea,f.hmtx,f.head,k,v);if(!f.head)throw new r.FormatError('Required "head" table is not found');!function sanitizeHead(e,t,a){const n=e.data,i=function int32(e,t,a,r){return(e<<24)+(t<<16)+(a<<8)+r}(n[0],n[1],n[2],n[3]);if(i>>16!=1){(0,r.info)("Attempting to fix invalid version in head table: "+i);n[0]=0;n[1]=1;n[2]=0;n[3]=0}const s=int16(n[50],n[51]);if(s<0||s>1){(0,r.info)("Attempting to fix invalid indexToLocFormat in head table: "+s);const e=t+1;if(a===e<<1){n[50]=0;n[51]=0}else{if(a!==e<<2)throw new r.FormatError("Could not fix indexToLocFormat: "+s);n[50]=0;n[51]=1}}}(f.head,C,S?f.loca.length:0);let M=Object.create(null);if(S){const e=int16(f.head.data[50],f.head.data[51]),t=function sanitizeGlyphLocations(e,t,a,r,n,i,s){let o,c,l;if(r){o=4;c=function fontItemDecodeLong(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]};l=function fontItemEncodeLong(e,t,a){e[t]=a>>>24&255;e[t+1]=a>>16&255;e[t+2]=a>>8&255;e[t+3]=255&a}}else{o=2;c=function fontItemDecode(e,t){return e[t]<<9|e[t+1]<<1};l=function fontItemEncode(e,t,a){e[t]=a>>9&255;e[t+1]=a>>1&255}}const h=i?a+1:a,u=o*(1+h),d=new Uint8Array(u);d.set(e.data.subarray(0,u));e.data=d;const f=t.data,g=f.length,p=new Uint8Array(g);let m,b;const y=[];for(m=0,b=0;m<a+1;m++,b+=o){let e=c(d,b);e>g&&(e=g);y.push({index:m,offset:e,endOffset:0})}y.sort(((e,t)=>e.offset-t.offset));for(m=0;m<a;m++)y[m].endOffset=y[m+1].offset;y.sort(((e,t)=>e.index-t.index));for(m=0;m<a;m++){const{offset:e,endOffset:t}=y[m];if(0!==e||0!==t)break;const a=y[m+1].offset;if(0!==a){y[m].endOffset=a;break}}const w=Object.create(null);let S=0;l(d,0,S);for(m=0,b=o;m<a;m++,b+=o){const e=sanitizeGlyph(f,y[m].offset,y[m].endOffset,p,S,n),t=e.length;0===t&&(w[m]=!0);e.sizeOfInstructions>s&&(s=e.sizeOfInstructions);S+=t;l(d,b,S)}if(0===S){const e=new Uint8Array([0,1,0,0,0,0,0,0,0,0,0,0,0,0,49,0]);for(m=0,b=o;m<h;m++,b+=o)l(d,b,e.length);t.data=e}else if(i){const a=c(d,o);if(p.length>a+S)t.data=p.subarray(0,a+S);else{t.data=new Uint8Array(a+S);t.data.set(p.subarray(0,S))}t.data.set(p.subarray(0,a),S);l(e.data,d.length-o,S+a)}else t.data=p.subarray(0,S);return{missingGlyphs:w,maxSizeOfInstructions:s}}(f.loca,f.glyf,C,e,T,v,O);M=t.missingGlyphs;if(x>=65536&&f.maxp.length>=22){f.maxp.data[26]=t.maxSizeOfInstructions>>8;f.maxp.data[27]=255&t.maxSizeOfInstructions}}if(!f.hhea)throw new r.FormatError('Required "hhea" table is not found');if(0===f.hhea.data[10]&&0===f.hhea.data[11]){f.hhea.data[10]=255;f.hhea.data[11]=255}const E={unitsPerEm:int16(f.head.data[18],f.head.data[19]),yMax:int16(f.head.data[42],f.head.data[43]),yMin:signedInt16(f.head.data[38],f.head.data[39]),ascent:signedInt16(f.hhea.data[4],f.hhea.data[5]),descent:signedInt16(f.hhea.data[6],f.hhea.data[7]),lineGap:signedInt16(f.hhea.data[8],f.hhea.data[9])};this.ascent=E.ascent/E.unitsPerEm;this.descent=E.descent/E.unitsPerEm;this.lineGap=E.lineGap/E.unitsPerEm;if(this.cssFontInfo&&this.cssFontInfo.lineHeight){this.lineHeight=this.cssFontInfo.metrics.lineHeight;this.lineGap=this.cssFontInfo.metrics.lineGap}else this.lineHeight=this.ascent-this.descent+this.lineGap;f.post&&function readPostScriptTable(e,a,n){const s=(t.start||0)+e.offset;t.pos=s;const o=s+e.length,c=t.getInt32();t.skip(28);let l,h,u=!0;switch(c){case 65536:l=i.MacStandardGlyphOrdering;break;case 131072:const e=t.getUint16();if(e!==n){u=!1;break}const s=[];for(h=0;h<e;++h){const e=t.getUint16();if(e>=32768){u=!1;break}s.push(e)}if(!u)break;const d=[],f=[];for(;t.pos<o;){const e=t.getByte();f.length=e;for(h=0;h<e;++h)f[h]=String.fromCharCode(t.getByte());d.push(f.join(""))}l=[];for(h=0;h<e;++h){const e=s[h];e<258?l.push(i.MacStandardGlyphOrdering[e]):l.push(d[e-258])}break;case 196608:break;default:(0,r.warn)("Unknown/unsupported post table version "+c);u=!1;a.defaultEncoding&&(l=a.defaultEncoding)}a.glyphNames=l;return u}(f.post,a,C);f.post={tag:"post",data:createPostTable(a)};const D=[];function hasGlyph(e){return!M[e]}if(a.composite){const e=a.cidToGidMap||[],t=0===e.length;a.cMap.forEach((function(a,n){"string"==typeof n&&(n=convertCidString(a,n,!0));if(n>65535)throw new r.FormatError("Max size of CID is 65,535");let i=-1;t?i=n:void 0!==e[n]&&(i=e[n]);i>=0&&i<C&&hasGlyph(i)&&(D[a]=i)}))}else{const e=function readCmapTable(e,t,a,n){if(!e){(0,r.warn)("No cmap table available.");return{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1}}let i,s=(t.start||0)+e.offset;t.pos=s;t.skip(2);const o=t.getUint16();let c,l=!1;for(let e=0;e<o;e++){const r=t.getUint16(),i=t.getUint16(),s=t.getInt32()>>>0;let h=!1;if(!c||c.platformId!==r||c.encodingId!==i){if(0!==r||0!==i&&1!==i&&3!==i)if(1===r&&0===i)h=!0;else if(3!==r||1!==i||!n&&c){if(a&&3===r&&0===i){h=!0;let a=!0;if(e<o-1){const e=t.peekBytes(2);int16(e[0],e[1])<r&&(a=!1)}a&&(l=!0)}}else{h=!0;a||(l=!0)}else h=!0;h&&(c={platformId:r,encodingId:i,offset:s});if(l)break}}c&&(t.pos=s+c.offset);if(!c||-1===t.peekByte()){(0,r.warn)("Could not find a preferred cmap table.");return{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1}}const h=t.getUint16();let u=!1;const d=[];let f,g;if(0===h){t.skip(4);for(f=0;f<256;f++){const e=t.getByte();e&&d.push({charCode:f,glyphId:e})}u=!0}else if(2===h){t.skip(4);const e=[];let a=0;for(let r=0;r<256;r++){const r=t.getUint16()>>3;e.push(r);a=Math.max(r,a)}const r=[];for(let e=0;e<=a;e++)r.push({firstCode:t.getUint16(),entryCount:t.getUint16(),idDelta:signedInt16(t.getByte(),t.getByte()),idRangePos:t.pos+t.getUint16()});for(let a=0;a<256;a++)if(0===e[a]){t.pos=r[0].idRangePos+2*a;g=t.getUint16();d.push({charCode:a,glyphId:g})}else{const n=r[e[a]];for(f=0;f<n.entryCount;f++){const e=(a<<8)+f+n.firstCode;t.pos=n.idRangePos+2*f;g=t.getUint16();0!==g&&(g=(g+n.idDelta)%65536);d.push({charCode:e,glyphId:g})}}}else if(4===h){t.skip(4);const e=t.getUint16()>>1;t.skip(6);const a=[];let r;for(r=0;r<e;r++)a.push({end:t.getUint16()});t.skip(2);for(r=0;r<e;r++)a[r].start=t.getUint16();for(r=0;r<e;r++)a[r].delta=t.getUint16();let n,o=0;for(r=0;r<e;r++){i=a[r];const s=t.getUint16();if(s){n=(s>>1)-(e-r);i.offsetIndex=n;o=Math.max(o,n+i.end-i.start+1)}else i.offsetIndex=-1}const c=[];for(f=0;f<o;f++)c.push(t.getUint16());for(r=0;r<e;r++){i=a[r];s=i.start;const e=i.end,t=i.delta;n=i.offsetIndex;for(f=s;f<=e;f++)if(65535!==f){g=n<0?f:c[n+f-s];g=g+t&65535;d.push({charCode:f,glyphId:g})}}}else if(6===h){t.skip(4);const e=t.getUint16(),a=t.getUint16();for(f=0;f<a;f++){g=t.getUint16();const a=e+f;d.push({charCode:a,glyphId:g})}}else{if(12!==h){(0,r.warn)("cmap table has unsupported format: "+h);return{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1}}{t.skip(10);const e=t.getInt32()>>>0;for(f=0;f<e;f++){const e=t.getInt32()>>>0,a=t.getInt32()>>>0;let r=t.getInt32()>>>0;for(let t=e;t<=a;t++)d.push({charCode:t,glyphId:r++})}}}d.sort((function(e,t){return e.charCode-t.charCode}));for(let e=1;e<d.length;e++)if(d[e-1].charCode===d[e].charCode){d.splice(e,1);e--}return{platformId:c.platformId,encodingId:c.encodingId,mappings:d,hasShortCmap:u}}(f.cmap,t,this.isSymbolicFont,a.hasEncoding),n=e.platformId,s=e.encodingId,l=e.mappings;let u=[],d=!1;!a.hasEncoding||"MacRomanEncoding"!==a.baseEncodingName&&"WinAnsiEncoding"!==a.baseEncodingName||(u=(0,c.getEncoding)(a.baseEncodingName));if(a.hasEncoding&&!this.isSymbolicFont&&(3===n&&1===s||1===n&&0===s)){const e=(0,o.getGlyphsUnicode)();for(let t=0;t<256;t++){let r;r=void 0!==this.differences[t]?this.differences[t]:u.length&&""!==u[t]?u[t]:c.StandardEncoding[t];if(!r)continue;const o=(0,i.recoverGlyphName)(r,e);let d;3===n&&1===s?d=e[o]:1===n&&0===s&&(d=c.MacRomanEncoding.indexOf(o));if(void 0===d){if(!a.glyphNames&&a.hasIncludedToUnicodeMap&&!(this.toUnicode instanceof h.IdentityToUnicodeMap)){const e=this.toUnicode.get(t);e&&(d=e.codePointAt(0))}if(void 0===d)continue}for(const e of l)if(e.charCode===d){D[t]=e.glyphId;break}}}else if(0===n){for(const e of l)D[e.charCode]=e.glyphId;d=!0}else for(const e of l){let t=e.charCode;3===n&&t>=61440&&t<=61695&&(t&=255);D[t]=e.glyphId}if(a.glyphNames&&(u.length||this.differences.length))for(let e=0;e<256;++e){if(!d&&void 0!==D[e])continue;const t=this.differences[e]||u[e];if(!t)continue;const r=a.glyphNames.indexOf(t);r>0&&hasGlyph(r)&&(D[e]=r)}}0===D.length&&(D[0]=0);let N=k-1;v||(N=0);if(!a.cssFontInfo){const e=adjustMapping(D,hasGlyph,N,this.toUnicode);this.toFontChar=e.toFontChar;f.cmap={tag:"cmap",data:createCmapTable(e.charCodeToGlyphId,e.toUnicodeExtraMap,k)};f["OS/2"]&&function validateOS2Table(e,t){t.pos=(t.start||0)+e.offset;const a=t.getUint16();t.skip(60);const r=t.getUint16();if(a<4&&768&r)return!1;if(t.getUint16()>t.getUint16())return!1;t.skip(6);if(0===t.getUint16())return!1;e.data[8]=e.data[9]=0;return!0}(f["OS/2"],t)||(f["OS/2"]={tag:"OS/2",data:createOS2Table(a,e.charCodeToGlyphId,E)})}if(!S)try{w=new y.Stream(f["CFF "].data);b=new n.CFFParser(w,a,i.SEAC_ANALYSIS_ENABLED).parse();b.duplicateFirstGlyph();const e=new n.CFFCompiler(b);f["CFF "].data=e.compile()}catch(e){(0,r.warn)("Failed to compile font "+a.loadedName)}if(f.name){const[t,r]=readNameTable(f.name);f.name.data=createNameTable(e,t);this.psName=t[0][6]||null;a.composite||function adjustTrueTypeToUnicode(e,t,a){if(e.isInternalFont)return;if(e.hasIncludedToUnicodeMap)return;if(e.hasEncoding)return;if(e.toUnicode instanceof h.IdentityToUnicodeMap)return;if(!t)return;if(0===a.length)return;if(e.defaultEncoding===c.WinAnsiEncoding)return;for(const e of a)if(!isWinNameRecord(e))return;const r=c.WinAnsiEncoding,n=[],i=(0,o.getGlyphsUnicode)();for(const e in r){const t=r[e];if(""===t)continue;const a=i[t];void 0!==a&&(n[e]=String.fromCharCode(a))}n.length>0&&e.toUnicode.amend(n)}(a,this.isSymbolicFont,r)}else f.name={tag:"name",data:createNameTable(this.name)};const R=new m.OpenTypeFileBuilder(d.version);for(const e in f)R.addTable(e,f[e].data);return R.toArray()}convert(e,t,a){a.fixedPitch=!1;a.builtInEncoding&&function adjustType1ToUnicode(e,t){if(e.isInternalFont)return;if(e.hasIncludedToUnicodeMap)return;if(t===e.defaultEncoding)return;if(e.toUnicode instanceof h.IdentityToUnicodeMap)return;const a=[],r=(0,o.getGlyphsUnicode)();for(const n in t){if(e.hasEncoding&&(e.baseEncodingName||void 0!==e.differences[n]))continue;const i=t[n],o=(0,s.getUnicodeForGlyph)(i,r);-1!==o&&(a[n]=String.fromCharCode(o))}a.length>0&&e.toUnicode.amend(a)}(a,a.builtInEncoding);let n=1;t instanceof u.CFFFont&&(n=t.numGlyphs-1);const l=t.getGlyphMapping(a);let d=null,f=l,g=null;if(!a.cssFontInfo){d=adjustMapping(l,t.hasGlyphId.bind(t),n,this.toUnicode);this.toFontChar=d.toFontChar;f=d.charCodeToGlyphId;g=d.toUnicodeExtraMap}const p=t.numGlyphs;function getCharCodes(e,t){let a=null;for(const r in e)if(t===e[r]){a||(a=[]);a.push(0|r)}return a}function createCharCode(e,t){for(const a in e)if(t===e[a])return 0|a;d.charCodeToGlyphId[d.nextAvailableFontCharCode]=t;return d.nextAvailableFontCharCode++}const b=t.seacs;if(d&&i.SEAC_ANALYSIS_ENABLED&&b&&b.length){const e=a.fontMatrix||r.FONT_IDENTITY_MATRIX,n=t.getCharset(),i=Object.create(null);for(let t in b){t|=0;const a=b[t],r=c.StandardEncoding[a[2]],s=c.StandardEncoding[a[3]],o=n.indexOf(r),h=n.indexOf(s);if(o<0||h<0)continue;const u={x:a[0]*e[0]+a[1]*e[2]+e[4],y:a[0]*e[1]+a[1]*e[3]+e[5]},f=getCharCodes(l,t);if(f)for(const e of f){const t=d.charCodeToGlyphId,a=createCharCode(t,o),r=createCharCode(t,h);i[e]={baseFontCharCode:a,accentFontCharCode:r,accentOffset:u}}}a.seacMap=i}const y=1/(a.fontMatrix||r.FONT_IDENTITY_MATRIX)[0],w=new m.OpenTypeFileBuilder("OTTO");w.addTable("CFF ",t.data);w.addTable("OS/2",createOS2Table(a,f));w.addTable("cmap",createCmapTable(f,g,p));w.addTable("head","\0\0\0\0\0\0\0\0\0\0_<õ\0\0"+safeString16(y)+"\0\0\0\0ž\v~'\0\0\0\0ž\v~'\0\0"+safeString16(a.descent)+"ÿ"+safeString16(a.ascent)+string16(a.italicAngle?2:0)+"\0\0\0\0\0\0\0");w.addTable("hhea","\0\0\0"+safeString16(a.ascent)+safeString16(a.descent)+"\0\0ÿÿ\0\0\0\0\0\0"+safeString16(a.capHeight)+safeString16(Math.tan(a.italicAngle)*a.xHeight)+"\0\0\0\0\0\0\0\0\0\0\0\0"+string16(p));w.addTable("hmtx",function fontFieldsHmtx(){const e=t.charstrings,a=t.cff?t.cff.widths:null;let r="\0\0\0\0";for(let t=1,n=p;t<n;t++){let n=0;if(e){const a=e[t-1];n="width"in a?a.width:0}else a&&(n=Math.ceil(a[t]||0));r+=string16(n)+string16(0)}return r}());w.addTable("maxp","\0\0P\0"+string16(p));w.addTable("name",createNameTable(e));w.addTable("post",createPostTable(a));return w.toArray()}get spaceWidth(){const e=["space","minus","one","i","I"];let t;for(const a of e){if(a in this.widths){t=this.widths[a];break}const e=(0,o.getGlyphsUnicode)()[a];let r=0;if(this.composite&&this.cMap.contains(e)){r=this.cMap.lookup(e);"string"==typeof r&&(r=convertCidString(e,r))}!r&&this.toUnicode&&(r=this.toUnicode.charCodeOf(e));r<=0&&(r=e);t=this.widths[r];if(t)break}t=t||this.defaultWidth;return(0,r.shadow)(this,"spaceWidth",t)}_charToGlyph(e,t=!1){let a,n,i,o=this._glyphCache[e];if(o&&o.isSpace===t)return o;let c=e;if(this.cMap&&this.cMap.contains(e)){c=this.cMap.lookup(e);"string"==typeof c&&(c=convertCidString(e,c))}n=this.widths[c];"number"!=typeof n&&(n=this.defaultWidth);const l=this.vmetrics&&this.vmetrics[c];let h=this.toUnicode.get(e)||e;"number"==typeof h&&(h=String.fromCharCode(h));let u=void 0!==this.toFontChar[e];a=this.toFontChar[e]||e;if(this.missingFile){const t=this.differences[e]||this.defaultEncoding[e];".notdef"!==t&&""!==t||"Type1"!==this.type||(a=32);a=(0,s.mapSpecialUnicodeValues)(a)}this.isType3Font&&(i=a);let d=null;if(this.seacMap&&this.seacMap[e]){u=!0;const t=this.seacMap[e];a=t.baseFontCharCode;d={fontChar:String.fromCodePoint(t.accentFontCharCode),offset:t.accentOffset}}let f="";"number"==typeof a&&(a<=1114111?f=String.fromCodePoint(a):(0,r.warn)(`charToGlyph - invalid fontCharCode: ${a}`));o=new Glyph(e,f,h,d,n,l,i,t,u);return this._glyphCache[e]=o}charsToGlyphs(e){let t=this._charsCache[e];if(t)return t;t=[];if(this.cMap){const a=Object.create(null),r=e.length;let n=0;for(;n<r;){this.cMap.readCharCode(e,n,a);const{charcode:r,length:i}=a;n+=i;const s=this._charToGlyph(r,1===i&&32===e.charCodeAt(n-1));t.push(s)}}else for(let a=0,r=e.length;a<r;++a){const r=e.charCodeAt(a),n=this._charToGlyph(r,32===r);t.push(n)}return this._charsCache[e]=t}getCharPositions(e){const t=[];if(this.cMap){const a=Object.create(null);let r=0;for(;r<e.length;){this.cMap.readCharCode(e,r,a);const n=a.length;t.push([r,r+n]);r+=n}}else for(let a=0,r=e.length;a<r;++a)t.push([a,a+1]);return t}get glyphCacheValues(){return Object.values(this._glyphCache)}encodeString(e){const t=[],a=[],hasCurrentBufErrors=()=>t.length%2==1,r=this.toUnicode instanceof h.IdentityToUnicodeMap?e=>this.toUnicode.charCodeOf(e):e=>this.toUnicode.charCodeOf(String.fromCodePoint(e));for(let n=0,i=e.length;n<i;n++){const i=e.codePointAt(n);i>55295&&(i<57344||i>65533)&&n++;if(this.toUnicode){const e=r(i);if(-1!==e){if(hasCurrentBufErrors()){t.push(a.join(""));a.length=0}for(let t=(this.cMap?this.cMap.getCharCodeLength(e):1)-1;t>=0;t--)a.push(String.fromCharCode(e>>8*t&255));continue}}if(!hasCurrentBufErrors()){t.push(a.join(""));a.length=0}a.push(String.fromCodePoint(i))}t.push(a.join(""));return t}};t.ErrorFont=class ErrorFont{constructor(e){this.error=e;this.loadedName="g_font_error";this.missingFile=!0}charsToGlyphs(){return[]}encodeString(e){return[e]}exportData(e=!1){return{error:this.error}}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.CFFTopDict=t.CFFStrings=t.CFFStandardStrings=t.CFFPrivateDict=t.CFFParser=t.CFFIndex=t.CFFHeader=t.CFFFDSelect=t.CFFCompiler=t.CFFCharset=t.CFF=void 0;var r=a(2),n=a(34),i=a(35);const s=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall","001.000","001.001","001.002","001.003","Black","Bold","Book","Light","Medium","Regular","Roman","Semibold"];t.CFFStandardStrings=s;const o=391,c=[null,{id:"hstem",min:2,stackClearing:!0,stem:!0},null,{id:"vstem",min:2,stackClearing:!0,stem:!0},{id:"vmoveto",min:1,stackClearing:!0},{id:"rlineto",min:2,resetStack:!0},{id:"hlineto",min:1,resetStack:!0},{id:"vlineto",min:1,resetStack:!0},{id:"rrcurveto",min:6,resetStack:!0},null,{id:"callsubr",min:1,undefStack:!0},{id:"return",min:0,undefStack:!0},null,null,{id:"endchar",min:0,stackClearing:!0},null,null,null,{id:"hstemhm",min:2,stackClearing:!0,stem:!0},{id:"hintmask",min:0,stackClearing:!0},{id:"cntrmask",min:0,stackClearing:!0},{id:"rmoveto",min:2,stackClearing:!0},{id:"hmoveto",min:1,stackClearing:!0},{id:"vstemhm",min:2,stackClearing:!0,stem:!0},{id:"rcurveline",min:8,resetStack:!0},{id:"rlinecurve",min:8,resetStack:!0},{id:"vvcurveto",min:4,resetStack:!0},{id:"hhcurveto",min:4,resetStack:!0},null,{id:"callgsubr",min:1,undefStack:!0},{id:"vhcurveto",min:4,resetStack:!0},{id:"hvcurveto",min:4,resetStack:!0}],l=[null,null,null,{id:"and",min:2,stackDelta:-1},{id:"or",min:2,stackDelta:-1},{id:"not",min:1,stackDelta:0},null,null,null,{id:"abs",min:1,stackDelta:0},{id:"add",min:2,stackDelta:-1,stackFn(e,t){e[t-2]=e[t-2]+e[t-1]}},{id:"sub",min:2,stackDelta:-1,stackFn(e,t){e[t-2]=e[t-2]-e[t-1]}},{id:"div",min:2,stackDelta:-1,stackFn(e,t){e[t-2]=e[t-2]/e[t-1]}},null,{id:"neg",min:1,stackDelta:0,stackFn(e,t){e[t-1]=-e[t-1]}},{id:"eq",min:2,stackDelta:-1},null,null,{id:"drop",min:1,stackDelta:-1},null,{id:"put",min:2,stackDelta:-2},{id:"get",min:1,stackDelta:0},{id:"ifelse",min:4,stackDelta:-3},{id:"random",min:0,stackDelta:1},{id:"mul",min:2,stackDelta:-1,stackFn(e,t){e[t-2]=e[t-2]*e[t-1]}},null,{id:"sqrt",min:1,stackDelta:0},{id:"dup",min:1,stackDelta:1},{id:"exch",min:2,stackDelta:0},{id:"index",min:2,stackDelta:0},{id:"roll",min:3,stackDelta:-2},null,null,null,{id:"hflex",min:7,resetStack:!0},{id:"flex",min:13,resetStack:!0},{id:"hflex1",min:9,resetStack:!0},{id:"flex1",min:11,resetStack:!0}];t.CFFParser=class CFFParser{constructor(e,t,a){this.bytes=e.getBytes();this.properties=t;this.seacAnalysisEnabled=!!a}parse(){const e=this.properties,t=new CFF;this.cff=t;const a=this.parseHeader(),r=this.parseIndex(a.endPos),n=this.parseIndex(r.endPos),i=this.parseIndex(n.endPos),s=this.parseIndex(i.endPos),o=this.parseDict(n.obj.get(0)),c=this.createDict(CFFTopDict,o,t.strings);t.header=a.obj;t.names=this.parseNameIndex(r.obj);t.strings=this.parseStringIndex(i.obj);t.topDict=c;t.globalSubrIndex=s.obj;this.parsePrivateDict(t.topDict);t.isCIDFont=c.hasName("ROS");const l=c.getByName("CharStrings"),h=this.parseIndex(l).obj,u=c.getByName("FontMatrix");u&&(e.fontMatrix=u);const d=c.getByName("FontBBox");if(d){e.ascent=Math.max(d[3],d[1]);e.descent=Math.min(d[1],d[3]);e.ascentScaled=!0}let f,g;if(t.isCIDFont){const e=this.parseIndex(c.getByName("FDArray")).obj;for(let a=0,r=e.count;a<r;++a){const r=e.get(a),n=this.createDict(CFFTopDict,this.parseDict(r),t.strings);this.parsePrivateDict(n);t.fdArray.push(n)}g=null;f=this.parseCharsets(c.getByName("charset"),h.count,t.strings,!0);t.fdSelect=this.parseFDSelect(c.getByName("FDSelect"),h.count)}else{f=this.parseCharsets(c.getByName("charset"),h.count,t.strings,!1);g=this.parseEncoding(c.getByName("Encoding"),e,t.strings,f.charset)}t.charset=f;t.encoding=g;const p=this.parseCharStrings({charStrings:h,localSubrIndex:c.privateDict.subrsIndex,globalSubrIndex:s.obj,fdSelect:t.fdSelect,fdArray:t.fdArray,privateDict:c.privateDict});t.charStrings=p.charStrings;t.seacs=p.seacs;t.widths=p.widths;return t}parseHeader(){let e=this.bytes;const t=e.length;let a=0;for(;a<t&&1!==e[a];)++a;if(a>=t)throw new r.FormatError("Invalid CFF header");if(0!==a){(0,r.info)("cff data is shifted");e=e.subarray(a);this.bytes=e}const n=e[0],i=e[1],s=e[2],o=e[3];return{obj:new CFFHeader(n,i,s,o),endPos:s}}parseDict(e){let t=0;function parseOperand(){let a=e[t++];if(30===a)return function parseFloatOperand(){let a="";const r=15,n=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"],i=e.length;for(;t<i;){const i=e[t++],s=i>>4,o=15&i;if(s===r)break;a+=n[s];if(o===r)break;a+=n[o]}return parseFloat(a)}();if(28===a){a=e[t++];a=(a<<24|e[t++]<<16)>>16;return a}if(29===a){a=e[t++];a=a<<8|e[t++];a=a<<8|e[t++];a=a<<8|e[t++];return a}if(a>=32&&a<=246)return a-139;if(a>=247&&a<=250)return 256*(a-247)+e[t++]+108;if(a>=251&&a<=254)return-256*(a-251)-e[t++]-108;(0,r.warn)('CFFParser_parseDict: "'+a+'" is a reserved command.');return NaN}let a=[];const n=[];t=0;const i=e.length;for(;t<i;){let r=e[t];if(r<=21){12===r&&(r=r<<8|e[++t]);n.push([r,a]);a=[];++t}else a.push(parseOperand())}return n}parseIndex(e){const t=new CFFIndex,a=this.bytes,r=a[e++]<<8|a[e++],n=[];let i,s,o=e;if(0!==r){const t=a[e++],c=e+(r+1)*t-1;for(i=0,s=r+1;i<s;++i){let r=0;for(let n=0;n<t;++n){r<<=8;r+=a[e++]}n.push(c+r)}o=n[r]}for(i=0,s=n.length-1;i<s;++i){const e=n[i],r=n[i+1];t.add(a.subarray(e,r))}return{obj:t,endPos:o}}parseNameIndex(e){const t=[];for(let a=0,n=e.count;a<n;++a){const n=e.get(a);t.push((0,r.bytesToString)(n))}return t}parseStringIndex(e){const t=new CFFStrings;for(let a=0,n=e.count;a<n;++a){const n=e.get(a);t.add((0,r.bytesToString)(n))}return t}createDict(e,t,a){const r=new e(a);for(const[e,a]of t)r.setByKey(e,a);return r}parseCharString(e,t,a,n){if(!t||e.callDepth>10)return!1;let i=e.stackSize;const s=e.stack;let o=t.length;for(let h=0;h<o;){const u=t[h++];let d=null;if(12===u){const e=t[h++];if(0===e){t[h-2]=139;t[h-1]=22;i=0}else d=l[e]}else if(28===u){s[i]=(t[h]<<24|t[h+1]<<16)>>16;h+=2;i++}else if(14===u){if(i>=4){i-=4;if(this.seacAnalysisEnabled){e.seac=s.slice(i,i+4);return!1}}d=c[u]}else if(u>=32&&u<=246){s[i]=u-139;i++}else if(u>=247&&u<=254){s[i]=u<251?(u-247<<8)+t[h]+108:-(u-251<<8)-t[h]-108;h++;i++}else if(255===u){s[i]=(t[h]<<24|t[h+1]<<16|t[h+2]<<8|t[h+3])/65536;h+=4;i++}else if(19===u||20===u){e.hints+=i>>1;h+=e.hints+7>>3;i%=2;d=c[u]}else{if(10===u||29===u){let t;t=10===u?a:n;if(!t){d=c[u];(0,r.warn)("Missing subrsIndex for "+d.id);return!1}let o=32768;t.count<1240?o=107:t.count<33900&&(o=1131);const l=s[--i]+o;if(l<0||l>=t.count||isNaN(l)){d=c[u];(0,r.warn)("Out of bounds subrIndex for "+d.id);return!1}e.stackSize=i;e.callDepth++;if(!this.parseCharString(e,t.get(l),a,n))return!1;e.callDepth--;i=e.stackSize;continue}if(11===u){e.stackSize=i;return!0}if(0===u&&h===t.length){t[h-1]=14;d=c[14]}else{if(9===u){t.copyWithin(h-1,h,-1);h-=1;o-=1;continue}d=c[u]}}if(d){if(d.stem){e.hints+=i>>1;if(3===u||23===u)e.hasVStems=!0;else if(e.hasVStems&&(1===u||18===u)){(0,r.warn)("CFF stem hints are in wrong order");t[h-1]=1===u?3:23}}if("min"in d&&!e.undefStack&&i<d.min){(0,r.warn)("Not enough parameters for "+d.id+"; actual: "+i+", expected: "+d.min);if(0===i){t[h-1]=14;return!0}return!1}if(e.firstStackClearing&&d.stackClearing){e.firstStackClearing=!1;i-=d.min;i>=2&&d.stem?i%=2:i>1&&(0,r.warn)("Found too many parameters for stack-clearing command");i>0&&(e.width=s[i-1])}if("stackDelta"in d){"stackFn"in d&&d.stackFn(s,i);i+=d.stackDelta}else if(d.stackClearing)i=0;else if(d.resetStack){i=0;e.undefStack=!1}else if(d.undefStack){i=0;e.undefStack=!0;e.firstStackClearing=!1}}}o<t.length&&t.fill(14,o);e.stackSize=i;return!0}parseCharStrings({charStrings:e,localSubrIndex:t,globalSubrIndex:a,fdSelect:n,fdArray:i,privateDict:s}){const o=[],c=[],l=e.count;for(let h=0;h<l;h++){const l=e.get(h),u={callDepth:0,stackSize:0,stack:[],undefStack:!0,hints:0,firstStackClearing:!0,seac:null,width:null,hasVStems:!1};let d=!0,f=null,g=s;if(n&&i.length){const e=n.getFDIndex(h);if(-1===e){(0,r.warn)("Glyph index is not in fd select.");d=!1}if(e>=i.length){(0,r.warn)("Invalid fd index for glyph index.");d=!1}if(d){g=i[e].privateDict;f=g.subrsIndex}}else t&&(f=t);d&&(d=this.parseCharString(u,l,f,a));if(null!==u.width){const e=g.getByName("nominalWidthX");c[h]=e+u.width}else{const e=g.getByName("defaultWidthX");c[h]=e}null!==u.seac&&(o[h]=u.seac);d||e.set(h,new Uint8Array([14]))}return{charStrings:e,seacs:o,widths:c}}emptyPrivateDictionary(e){const t=this.createDict(CFFPrivateDict,[],e.strings);e.setByKey(18,[0,0]);e.privateDict=t}parsePrivateDict(e){if(!e.hasName("Private")){this.emptyPrivateDictionary(e);return}const t=e.getByName("Private");if(!Array.isArray(t)||2!==t.length){e.removeByName("Private");return}const a=t[0],r=t[1];if(0===a||r>=this.bytes.length){this.emptyPrivateDictionary(e);return}const n=r+a,i=this.bytes.subarray(r,n),s=this.parseDict(i),o=this.createDict(CFFPrivateDict,s,e.strings);e.privateDict=o;0===o.getByName("ExpansionFactor")&&o.setByName("ExpansionFactor",.06);if(!o.getByName("Subrs"))return;const c=o.getByName("Subrs"),l=r+c;if(0===c||l>=this.bytes.length){this.emptyPrivateDictionary(e);return}const h=this.parseIndex(l);o.subrsIndex=h.obj}parseCharsets(e,t,a,i){if(0===e)return new CFFCharset(!0,d.ISO_ADOBE,n.ISOAdobeCharset);if(1===e)return new CFFCharset(!0,d.EXPERT,n.ExpertCharset);if(2===e)return new CFFCharset(!0,d.EXPERT_SUBSET,n.ExpertSubsetCharset);const s=this.bytes,o=e,c=s[e++],l=[i?0:".notdef"];let h,u,f;t-=1;switch(c){case 0:for(f=0;f<t;f++){h=s[e++]<<8|s[e++];l.push(i?h:a.get(h))}break;case 1:for(;l.length<=t;){h=s[e++]<<8|s[e++];u=s[e++];for(f=0;f<=u;f++)l.push(i?h++:a.get(h++))}break;case 2:for(;l.length<=t;){h=s[e++]<<8|s[e++];u=s[e++]<<8|s[e++];for(f=0;f<=u;f++)l.push(i?h++:a.get(h++))}break;default:throw new r.FormatError("Unknown charset format")}const g=e,p=s.subarray(o,g);return new CFFCharset(!1,c,l,p)}parseEncoding(e,t,a,n){const s=Object.create(null),o=this.bytes;let c,l,h,u=!1,d=null;if(0===e||1===e){u=!0;c=e;const t=e?i.ExpertEncoding:i.StandardEncoding;for(l=0,h=n.length;l<h;l++){const e=t.indexOf(n[l]);-1!==e&&(s[e]=l)}}else{const t=e;c=o[e++];switch(127&c){case 0:const t=o[e++];for(l=1;l<=t;l++)s[o[e++]]=l;break;case 1:const a=o[e++];let n=1;for(l=0;l<a;l++){const t=o[e++],a=o[e++];for(let e=t;e<=t+a;e++)s[e]=n++}break;default:throw new r.FormatError(`Unknown encoding format: ${c} in CFF`)}const i=e;if(128&c){o[t]&=127;!function readSupplement(){const t=o[e++];for(l=0;l<t;l++){const t=o[e++],r=(o[e++]<<8)+(255&o[e++]);s[t]=n.indexOf(a.get(r))}}()}d=o.subarray(t,i)}c&=127;return new CFFEncoding(u,c,s,d)}parseFDSelect(e,t){const a=this.bytes,n=a[e++],i=[];let s;switch(n){case 0:for(s=0;s<t;++s){const t=a[e++];i.push(t)}break;case 3:const o=a[e++]<<8|a[e++];for(s=0;s<o;++s){let t=a[e++]<<8|a[e++];if(0===s&&0!==t){(0,r.warn)("parseFDSelect: The first range must have a first GID of 0 -- trying to recover.");t=0}const n=a[e++],o=a[e]<<8|a[e+1];for(let e=t;e<o;++e)i.push(n)}e+=2;break;default:throw new r.FormatError(`parseFDSelect: Unknown format "${n}".`)}if(i.length!==t)throw new r.FormatError("parseFDSelect: Invalid font data.");return new CFFFDSelect(n,i)}};class CFF{constructor(){this.header=null;this.names=[];this.topDict=null;this.strings=new CFFStrings;this.globalSubrIndex=null;this.encoding=null;this.charset=null;this.charStrings=null;this.fdArray=[];this.fdSelect=null;this.isCIDFont=!1}duplicateFirstGlyph(){if(this.charStrings.count>=65535){(0,r.warn)("Not enough space in charstrings to duplicate first glyph.");return}const e=this.charStrings.get(0);this.charStrings.add(e);this.isCIDFont&&this.fdSelect.fdSelect.push(this.fdSelect.fdSelect[0])}hasGlyphId(e){if(e<0||e>=this.charStrings.count)return!1;return this.charStrings.get(e).length>0}}t.CFF=CFF;class CFFHeader{constructor(e,t,a,r){this.major=e;this.minor=t;this.hdrSize=a;this.offSize=r}}t.CFFHeader=CFFHeader;class CFFStrings{constructor(){this.strings=[]}get(e){return e>=0&&e<=390?s[e]:e-o<=this.strings.length?this.strings[e-o]:s[0]}getSID(e){let t=s.indexOf(e);if(-1!==t)return t;t=this.strings.indexOf(e);return-1!==t?t+o:-1}add(e){this.strings.push(e)}get count(){return this.strings.length}}t.CFFStrings=CFFStrings;class CFFIndex{constructor(){this.objects=[];this.length=0}add(e){this.length+=e.length;this.objects.push(e)}set(e,t){this.length+=t.length-this.objects[e].length;this.objects[e]=t}get(e){return this.objects[e]}get count(){return this.objects.length}}t.CFFIndex=CFFIndex;class CFFDict{constructor(e,t){this.keyToNameMap=e.keyToNameMap;this.nameToKeyMap=e.nameToKeyMap;this.defaults=e.defaults;this.types=e.types;this.opcodes=e.opcodes;this.order=e.order;this.strings=t;this.values=Object.create(null)}setByKey(e,t){if(!(e in this.keyToNameMap))return!1;if(0===t.length)return!0;for(const a of t)if(isNaN(a)){(0,r.warn)(`Invalid CFFDict value: "${t}" for key "${e}".`);return!0}const a=this.types[e];"num"!==a&&"sid"!==a&&"offset"!==a||(t=t[0]);this.values[e]=t;return!0}setByName(e,t){if(!(e in this.nameToKeyMap))throw new r.FormatError(`Invalid dictionary name "${e}"`);this.values[this.nameToKeyMap[e]]=t}hasName(e){return this.nameToKeyMap[e]in this.values}getByName(e){if(!(e in this.nameToKeyMap))throw new r.FormatError(`Invalid dictionary name ${e}"`);const t=this.nameToKeyMap[e];return t in this.values?this.values[t]:this.defaults[t]}removeByName(e){delete this.values[this.nameToKeyMap[e]]}static createTables(e){const t={keyToNameMap:{},nameToKeyMap:{},defaults:{},types:{},opcodes:{},order:[]};for(const a of e){const e=Array.isArray(a[0])?(a[0][0]<<8)+a[0][1]:a[0];t.keyToNameMap[e]=a[1];t.nameToKeyMap[a[1]]=e;t.types[e]=a[2];t.defaults[e]=a[3];t.opcodes[e]=Array.isArray(a[0])?a[0]:[a[0]];t.order.push(e)}return t}}const h=[[[12,30],"ROS",["sid","sid","num"],null],[[12,20],"SyntheticBase","num",null],[0,"version","sid",null],[1,"Notice","sid",null],[[12,0],"Copyright","sid",null],[2,"FullName","sid",null],[3,"FamilyName","sid",null],[4,"Weight","sid",null],[[12,1],"isFixedPitch","num",0],[[12,2],"ItalicAngle","num",0],[[12,3],"UnderlinePosition","num",-100],[[12,4],"UnderlineThickness","num",50],[[12,5],"PaintType","num",0],[[12,6],"CharstringType","num",2],[[12,7],"FontMatrix",["num","num","num","num","num","num"],[.001,0,0,.001,0,0]],[13,"UniqueID","num",null],[5,"FontBBox",["num","num","num","num"],[0,0,0,0]],[[12,8],"StrokeWidth","num",0],[14,"XUID","array",null],[15,"charset","offset",0],[16,"Encoding","offset",0],[17,"CharStrings","offset",0],[18,"Private",["offset","offset"],null],[[12,21],"PostScript","sid",null],[[12,22],"BaseFontName","sid",null],[[12,23],"BaseFontBlend","delta",null],[[12,31],"CIDFontVersion","num",0],[[12,32],"CIDFontRevision","num",0],[[12,33],"CIDFontType","num",0],[[12,34],"CIDCount","num",8720],[[12,35],"UIDBase","num",null],[[12,37],"FDSelect","offset",null],[[12,36],"FDArray","offset",null],[[12,38],"FontName","sid",null]];class CFFTopDict extends CFFDict{static get tables(){return(0,r.shadow)(this,"tables",this.createTables(h))}constructor(e){super(CFFTopDict.tables,e);this.privateDict=null}}t.CFFTopDict=CFFTopDict;const u=[[6,"BlueValues","delta",null],[7,"OtherBlues","delta",null],[8,"FamilyBlues","delta",null],[9,"FamilyOtherBlues","delta",null],[[12,9],"BlueScale","num",.039625],[[12,10],"BlueShift","num",7],[[12,11],"BlueFuzz","num",1],[10,"StdHW","num",null],[11,"StdVW","num",null],[[12,12],"StemSnapH","delta",null],[[12,13],"StemSnapV","delta",null],[[12,14],"ForceBold","num",0],[[12,17],"LanguageGroup","num",0],[[12,18],"ExpansionFactor","num",.06],[[12,19],"initialRandomSeed","num",0],[20,"defaultWidthX","num",0],[21,"nominalWidthX","num",0],[19,"Subrs","offset",null]];class CFFPrivateDict extends CFFDict{static get tables(){return(0,r.shadow)(this,"tables",this.createTables(u))}constructor(e){super(CFFPrivateDict.tables,e);this.subrsIndex=null}}t.CFFPrivateDict=CFFPrivateDict;const d={ISO_ADOBE:0,EXPERT:1,EXPERT_SUBSET:2};class CFFCharset{constructor(e,t,a,r){this.predefined=e;this.format=t;this.charset=a;this.raw=r}}t.CFFCharset=CFFCharset;class CFFEncoding{constructor(e,t,a,r){this.predefined=e;this.format=t;this.encoding=a;this.raw=r}}class CFFFDSelect{constructor(e,t){this.format=e;this.fdSelect=t}getFDIndex(e){return e<0||e>=this.fdSelect.length?-1:this.fdSelect[e]}}t.CFFFDSelect=CFFFDSelect;class CFFOffsetTracker{constructor(){this.offsets=Object.create(null)}isTracking(e){return e in this.offsets}track(e,t){if(e in this.offsets)throw new r.FormatError(`Already tracking location of ${e}`);this.offsets[e]=t}offset(e){for(const t in this.offsets)this.offsets[t]+=e}setEntryLocation(e,t,a){if(!(e in this.offsets))throw new r.FormatError(`Not tracking location of ${e}`);const n=a.data,i=this.offsets[e];for(let e=0,a=t.length;e<a;++e){const a=5*e+i,s=a+1,o=a+2,c=a+3,l=a+4;if(29!==n[a]||0!==n[s]||0!==n[o]||0!==n[c]||0!==n[l])throw new r.FormatError("writing to an offset that is not empty");const h=t[e];n[a]=29;n[s]=h>>24&255;n[o]=h>>16&255;n[c]=h>>8&255;n[l]=255&h}}}class CFFCompiler{constructor(e){this.cff=e}compile(){const e=this.cff,t={data:[],length:0,add(e){this.data=this.data.concat(e);this.length=this.data.length}},a=this.compileHeader(e.header);t.add(a);const n=this.compileNameIndex(e.names);t.add(n);if(e.isCIDFont&&e.topDict.hasName("FontMatrix")){const t=e.topDict.getByName("FontMatrix");e.topDict.removeByName("FontMatrix");for(const a of e.fdArray){let e=t.slice(0);a.hasName("FontMatrix")&&(e=r.Util.transform(e,a.getByName("FontMatrix")));a.setByName("FontMatrix",e)}}const i=e.topDict.getByName("XUID");i&&i.length>16&&e.topDict.removeByName("XUID");e.topDict.setByName("charset",0);let s=this.compileTopDicts([e.topDict],t.length,e.isCIDFont);t.add(s.output);const o=s.trackers[0],c=this.compileStringIndex(e.strings.strings);t.add(c);const l=this.compileIndex(e.globalSubrIndex);t.add(l);if(e.encoding&&e.topDict.hasName("Encoding"))if(e.encoding.predefined)o.setEntryLocation("Encoding",[e.encoding.format],t);else{const a=this.compileEncoding(e.encoding);o.setEntryLocation("Encoding",[t.length],t);t.add(a)}const h=this.compileCharset(e.charset,e.charStrings.count,e.strings,e.isCIDFont);o.setEntryLocation("charset",[t.length],t);t.add(h);const u=this.compileCharStrings(e.charStrings);o.setEntryLocation("CharStrings",[t.length],t);t.add(u);if(e.isCIDFont){o.setEntryLocation("FDSelect",[t.length],t);const a=this.compileFDSelect(e.fdSelect);t.add(a);s=this.compileTopDicts(e.fdArray,t.length,!0);o.setEntryLocation("FDArray",[t.length],t);t.add(s.output);const r=s.trackers;this.compilePrivateDicts(e.fdArray,r,t)}this.compilePrivateDicts([e.topDict],[o],t);t.add([0]);return t.data}encodeNumber(e){return Number.isInteger(e)?this.encodeInteger(e):this.encodeFloat(e)}static get EncodeFloatRegExp(){return(0,r.shadow)(this,"EncodeFloatRegExp",/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/)}encodeFloat(e){let t=e.toString();const a=CFFCompiler.EncodeFloatRegExp.exec(t);if(a){const r=parseFloat("1e"+((a[2]?+a[2]:0)+a[1].length));t=(Math.round(e*r)/r).toString()}let r,n,i="";for(r=0,n=t.length;r<n;++r){const e=t[r];i+="e"===e?"-"===t[++r]?"c":"b":"."===e?"a":"-"===e?"e":e}i+=1&i.length?"f":"ff";const s=[30];for(r=0,n=i.length;r<n;r+=2)s.push(parseInt(i.substring(r,r+2),16));return s}encodeInteger(e){let t;t=e>=-107&&e<=107?[e+139]:e>=108&&e<=1131?[247+((e-=108)>>8),255&e]:e>=-1131&&e<=-108?[251+((e=-e-108)>>8),255&e]:e>=-32768&&e<=32767?[28,e>>8&255,255&e]:[29,e>>24&255,e>>16&255,e>>8&255,255&e];return t}compileHeader(e){return[e.major,e.minor,4,e.offSize]}compileNameIndex(e){const t=new CFFIndex;for(const a of e){const e=Math.min(a.length,127);let n=new Array(e);for(let t=0;t<e;t++){let e=a[t];(e<"!"||e>"~"||"["===e||"]"===e||"("===e||")"===e||"{"===e||"}"===e||"<"===e||">"===e||"/"===e||"%"===e)&&(e="_");n[t]=e}n=n.join("");""===n&&(n="Bad_Font_Name");t.add((0,r.stringToBytes)(n))}return this.compileIndex(t)}compileTopDicts(e,t,a){const r=[];let n=new CFFIndex;for(const i of e){if(a){i.removeByName("CIDFontVersion");i.removeByName("CIDFontRevision");i.removeByName("CIDFontType");i.removeByName("CIDCount");i.removeByName("UIDBase")}const e=new CFFOffsetTracker,s=this.compileDict(i,e);r.push(e);n.add(s);e.offset(t)}n=this.compileIndex(n,r);return{trackers:r,output:n}}compilePrivateDicts(e,t,a){for(let n=0,i=e.length;n<i;++n){const i=e[n],s=i.privateDict;if(!s||!i.hasName("Private"))throw new r.FormatError("There must be a private dictionary.");const o=new CFFOffsetTracker,c=this.compileDict(s,o);let l=a.length;o.offset(l);c.length||(l=0);t[n].setEntryLocation("Private",[c.length,l],a);a.add(c);if(s.subrsIndex&&s.hasName("Subrs")){const e=this.compileIndex(s.subrsIndex);o.setEntryLocation("Subrs",[c.length],a);a.add(e)}}}compileDict(e,t){const a=[];for(const n of e.order){if(!(n in e.values))continue;let i=e.values[n],s=e.types[n];Array.isArray(s)||(s=[s]);Array.isArray(i)||(i=[i]);if(0!==i.length){for(let o=0,c=s.length;o<c;++o){const c=s[o],l=i[o];switch(c){case"num":case"sid":a.push(...this.encodeNumber(l));break;case"offset":const s=e.keyToNameMap[n];t.isTracking(s)||t.track(s,a.length);a.push(29,0,0,0,0);break;case"array":case"delta":a.push(...this.encodeNumber(l));for(let e=1,t=i.length;e<t;++e)a.push(...this.encodeNumber(i[e]));break;default:throw new r.FormatError(`Unknown data type of ${c}`)}}a.push(...e.opcodes[n])}}return a}compileStringIndex(e){const t=new CFFIndex;for(const a of e)t.add((0,r.stringToBytes)(a));return this.compileIndex(t)}compileGlobalSubrIndex(){const e=this.cff.globalSubrIndex;this.out.writeByteArray(this.compileIndex(e))}compileCharStrings(e){const t=new CFFIndex;for(let a=0;a<e.count;a++){const r=e.get(a);0!==r.length?t.add(r):t.add(new Uint8Array([139,14]))}return this.compileIndex(t)}compileCharset(e,t,a,n){let i;const s=t-1;if(n)i=new Uint8Array([2,0,0,s>>8&255,255&s]);else{i=new Uint8Array(1+2*s);i[0]=0;let t=0;const n=e.charset.length;let o=!1;for(let s=1;s<i.length;s+=2){let c=0;if(t<n){const n=e.charset[t++];c=a.getSID(n);if(-1===c){c=0;if(!o){o=!0;(0,r.warn)(`Couldn't find ${n} in CFF strings`)}}}i[s]=c>>8&255;i[s+1]=255&c}}return this.compileTypedArray(i)}compileEncoding(e){return this.compileTypedArray(e.raw)}compileFDSelect(e){const t=e.format;let a,r;switch(t){case 0:a=new Uint8Array(1+e.fdSelect.length);a[0]=t;for(r=0;r<e.fdSelect.length;r++)a[r+1]=e.fdSelect[r];break;case 3:const n=0;let i=e.fdSelect[0];const s=[t,0,0,n>>8&255,255&n,i];for(r=1;r<e.fdSelect.length;r++){const t=e.fdSelect[r];if(t!==i){s.push(r>>8&255,255&r,t);i=t}}const o=(s.length-3)/3;s[1]=o>>8&255;s[2]=255&o;s.push(r>>8&255,255&r);a=new Uint8Array(s)}return this.compileTypedArray(a)}compileTypedArray(e){const t=[];for(let a=0,r=e.length;a<r;++a)t[a]=e[a];return t}compileIndex(e,t=[]){const a=e.objects,r=a.length;if(0===r)return[0,0];const n=[r>>8&255,255&r];let i,s,o=1;for(i=0;i<r;++i)o+=a[i].length;s=o<256?1:o<65536?2:o<16777216?3:4;n.push(s);let c=1;for(i=0;i<r+1;i++){1===s?n.push(255&c):2===s?n.push(c>>8&255,255&c):3===s?n.push(c>>16&255,c>>8&255,255&c):n.push(c>>>24&255,c>>16&255,c>>8&255,255&c);a[i]&&(c+=a[i].length)}for(i=0;i<r;i++){t[i]&&t[i].offset(n.length);n.push(...a[i])}return n}}t.CFFCompiler=CFFCompiler},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.ISOAdobeCharset=t.ExpertSubsetCharset=t.ExpertCharset=void 0;t.ISOAdobeCharset=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron"];t.ExpertCharset=[".notdef","space","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"];t.ExpertSubsetCharset=[".notdef","space","dollaroldstyle","dollarsuperior","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","hyphensuperior","colonmonetary","onefitted","rupiah","centoldstyle","figuredash","hypheninferior","onequarter","onehalf","threequarters","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior"]},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.ZapfDingbatsEncoding=t.WinAnsiEncoding=t.SymbolSetEncoding=t.StandardEncoding=t.MacRomanEncoding=t.ExpertEncoding=void 0;t.getEncoding=function getEncoding(e){switch(e){case"WinAnsiEncoding":return s;case"StandardEncoding":return i;case"MacRomanEncoding":return n;case"SymbolSetEncoding":return o;case"ZapfDingbatsEncoding":return c;case"ExpertEncoding":return a;case"MacExpertEncoding":return r;default:return null}};const a=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","","asuperior","bsuperior","centsuperior","dsuperior","esuperior","","","","isuperior","","","lsuperior","msuperior","nsuperior","osuperior","","","rsuperior","ssuperior","tsuperior","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdownsmall","centoldstyle","Lslashsmall","","","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","","Dotaccentsmall","","","Macronsmall","","","figuredash","hypheninferior","","","Ogoneksmall","Ringsmall","Cedillasmall","","","","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"];t.ExpertEncoding=a;const r=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","centoldstyle","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","","threequartersemdash","","questionsmall","","","","","Ethsmall","","","onequarter","onehalf","threequarters","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","","","","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hypheninferior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","asuperior","centsuperior","","","","","Aacutesmall","Agravesmall","Acircumflexsmall","Adieresissmall","Atildesmall","Aringsmall","Ccedillasmall","Eacutesmall","Egravesmall","Ecircumflexsmall","Edieresissmall","Iacutesmall","Igravesmall","Icircumflexsmall","Idieresissmall","Ntildesmall","Oacutesmall","Ogravesmall","Ocircumflexsmall","Odieresissmall","Otildesmall","Uacutesmall","Ugravesmall","Ucircumflexsmall","Udieresissmall","","eightsuperior","fourinferior","threeinferior","sixinferior","eightinferior","seveninferior","Scaronsmall","","centinferior","twoinferior","","Dieresissmall","","Caronsmall","osuperior","fiveinferior","","commainferior","periodinferior","Yacutesmall","","dollarinferior","","","Thornsmall","","nineinferior","zeroinferior","Zcaronsmall","AEsmall","Oslashsmall","questiondownsmall","oneinferior","Lslashsmall","","","","","","","Cedillasmall","","","","","","OEsmall","figuredash","hyphensuperior","","","","","exclamdownsmall","","Ydieresissmall","","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","ninesuperior","zerosuperior","","esuperior","rsuperior","tsuperior","","","isuperior","ssuperior","dsuperior","","","","","","lsuperior","Ogoneksmall","Brevesmall","Macronsmall","bsuperior","nsuperior","msuperior","commasuperior","periodsuperior","Dotaccentsmall","Ringsmall","","","",""],n=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","space","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron"];t.MacRomanEncoding=n;const i=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","","endash","dagger","daggerdbl","periodcentered","","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","","questiondown","","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","","ring","cedilla","","hungarumlaut","ogonek","caron","emdash","","","","","","","","","","","","","","","","","AE","","ordfeminine","","","","","Lslash","Oslash","OE","ordmasculine","","","","","","ae","","","","dotlessi","","","lslash","oslash","oe","germandbls","","","",""];t.StandardEncoding=i;const s=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","bullet","Euro","bullet","quotesinglbase","florin","quotedblbase","ellipsis","dagger","daggerdbl","circumflex","perthousand","Scaron","guilsinglleft","OE","bullet","Zcaron","bullet","bullet","quoteleft","quoteright","quotedblleft","quotedblright","bullet","endash","emdash","tilde","trademark","scaron","guilsinglright","oe","bullet","zcaron","Ydieresis","space","exclamdown","cent","sterling","currency","yen","brokenbar","section","dieresis","copyright","ordfeminine","guillemotleft","logicalnot","hyphen","registered","macron","degree","plusminus","twosuperior","threesuperior","acute","mu","paragraph","periodcentered","cedilla","onesuperior","ordmasculine","guillemotright","onequarter","onehalf","threequarters","questiondown","Agrave","Aacute","Acircumflex","Atilde","Adieresis","Aring","AE","Ccedilla","Egrave","Eacute","Ecircumflex","Edieresis","Igrave","Iacute","Icircumflex","Idieresis","Eth","Ntilde","Ograve","Oacute","Ocircumflex","Otilde","Odieresis","multiply","Oslash","Ugrave","Uacute","Ucircumflex","Udieresis","Yacute","Thorn","germandbls","agrave","aacute","acircumflex","atilde","adieresis","aring","ae","ccedilla","egrave","eacute","ecircumflex","edieresis","igrave","iacute","icircumflex","idieresis","eth","ntilde","ograve","oacute","ocircumflex","otilde","odieresis","divide","oslash","ugrave","uacute","ucircumflex","udieresis","yacute","thorn","ydieresis"];t.WinAnsiEncoding=s;const o=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","universal","numbersign","existential","percent","ampersand","suchthat","parenleft","parenright","asteriskmath","plus","comma","minus","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","congruent","Alpha","Beta","Chi","Delta","Epsilon","Phi","Gamma","Eta","Iota","theta1","Kappa","Lambda","Mu","Nu","Omicron","Pi","Theta","Rho","Sigma","Tau","Upsilon","sigma1","Omega","Xi","Psi","Zeta","bracketleft","therefore","bracketright","perpendicular","underscore","radicalex","alpha","beta","chi","delta","epsilon","phi","gamma","eta","iota","phi1","kappa","lambda","mu","nu","omicron","pi","theta","rho","sigma","tau","upsilon","omega1","omega","xi","psi","zeta","braceleft","bar","braceright","similar","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Euro","Upsilon1","minute","lessequal","fraction","infinity","florin","club","diamond","heart","spade","arrowboth","arrowleft","arrowup","arrowright","arrowdown","degree","plusminus","second","greaterequal","multiply","proportional","partialdiff","bullet","divide","notequal","equivalence","approxequal","ellipsis","arrowvertex","arrowhorizex","carriagereturn","aleph","Ifraktur","Rfraktur","weierstrass","circlemultiply","circleplus","emptyset","intersection","union","propersuperset","reflexsuperset","notsubset","propersubset","reflexsubset","element","notelement","angle","gradient","registerserif","copyrightserif","trademarkserif","product","radical","dotmath","logicalnot","logicaland","logicalor","arrowdblboth","arrowdblleft","arrowdblup","arrowdblright","arrowdbldown","lozenge","angleleft","registersans","copyrightsans","trademarksans","summation","parenlefttp","parenleftex","parenleftbt","bracketlefttp","bracketleftex","bracketleftbt","bracelefttp","braceleftmid","braceleftbt","braceex","","angleright","integral","integraltp","integralex","integralbt","parenrighttp","parenrightex","parenrightbt","bracketrighttp","bracketrightex","bracketrightbt","bracerighttp","bracerightmid","bracerightbt",""];t.SymbolSetEncoding=o;const c=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","a1","a2","a202","a3","a4","a5","a119","a118","a117","a11","a12","a13","a14","a15","a16","a105","a17","a18","a19","a20","a21","a22","a23","a24","a25","a26","a27","a28","a6","a7","a8","a9","a10","a29","a30","a31","a32","a33","a34","a35","a36","a37","a38","a39","a40","a41","a42","a43","a44","a45","a46","a47","a48","a49","a50","a51","a52","a53","a54","a55","a56","a57","a58","a59","a60","a61","a62","a63","a64","a65","a66","a67","a68","a69","a70","a71","a72","a73","a74","a203","a75","a204","a76","a77","a78","a79","a81","a82","a83","a84","a97","a98","a99","a100","","a89","a90","a93","a94","a91","a92","a205","a85","a206","a86","a87","a88","a95","a96","","","","","","","","","","","","","","","","","","","","a101","a102","a103","a104","a106","a107","a108","a112","a111","a110","a109","a120","a121","a122","a123","a124","a125","a126","a127","a128","a129","a130","a131","a132","a133","a134","a135","a136","a137","a138","a139","a140","a141","a142","a143","a144","a145","a146","a147","a148","a149","a150","a151","a152","a153","a154","a155","a156","a157","a158","a159","a160","a161","a163","a164","a196","a165","a192","a166","a167","a168","a169","a170","a171","a172","a173","a162","a174","a175","a176","a177","a178","a179","a193","a180","a199","a181","a200","a182","","a201","a183","a184","a197","a185","a194","a198","a186","a195","a187","a188","a189","a190","a191",""];t.ZapfDingbatsEncoding=c},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.SEAC_ANALYSIS_ENABLED=t.MacStandardGlyphOrdering=t.FontFlags=void 0;t.normalizeFontName=function normalizeFontName(e){return e.replace(/[,_]/g,"-").replace(/\s/g,"")};t.recoverGlyphName=recoverGlyphName;t.type1FontGlyphMapping=function type1FontGlyphMapping(e,t,a){const i=Object.create(null);let s,c,l;const h=!!(e.flags&o.Symbolic);if(e.isInternalFont){l=t;for(c=0;c<l.length;c++){s=a.indexOf(l[c]);i[c]=s>=0?s:0}}else if(e.baseEncodingName){l=(0,r.getEncoding)(e.baseEncodingName);for(c=0;c<l.length;c++){s=a.indexOf(l[c]);i[c]=s>=0?s:0}}else if(h)for(c in t)i[c]=t[c];else{l=r.StandardEncoding;for(c=0;c<l.length;c++){s=a.indexOf(l[c]);i[c]=s>=0?s:0}}const u=e.differences;let d;if(u)for(c in u){const e=u[c];s=a.indexOf(e);if(-1===s){d||(d=(0,n.getGlyphsUnicode)());const t=recoverGlyphName(e,d);t!==e&&(s=a.indexOf(t))}i[c]=s>=0?s:0}return i};var r=a(35),n=a(37),i=a(38),s=a(2);t.SEAC_ANALYSIS_ENABLED=!0;const o={FixedPitch:1,Serif:2,Symbolic:4,Script:8,Nonsymbolic:32,Italic:64,AllCap:65536,SmallCap:131072,ForceBold:262144};t.FontFlags=o;t.MacStandardGlyphOrdering=[".notdef",".null","nonmarkingreturn","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","nonbreakingspace","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron","Lslash","lslash","Scaron","scaron","Zcaron","zcaron","brokenbar","Eth","eth","Yacute","yacute","Thorn","thorn","minus","multiply","onesuperior","twosuperior","threesuperior","onehalf","onequarter","threequarters","franc","Gbreve","gbreve","Idotaccent","Scedilla","scedilla","Cacute","cacute","Ccaron","ccaron","dcroat"];function recoverGlyphName(e,t){if(void 0!==t[e])return e;const a=(0,i.getUnicodeForGlyph)(e,t);if(-1!==a)for(const e in t)if(t[e]===a)return e;(0,s.info)("Unable to recover a standard glyph name for: "+e);return e}},(e,t,a)=>{a.r(t);a.d(t,{getDingbatsGlyphsUnicode:()=>i,getGlyphsUnicode:()=>n});var r=a(3);const n=(0,r.getArrayLookupTableFactory)((function(){return["A",65,"AE",198,"AEacute",508,"AEmacron",482,"AEsmall",63462,"Aacute",193,"Aacutesmall",63457,"Abreve",258,"Abreveacute",7854,"Abrevecyrillic",1232,"Abrevedotbelow",7862,"Abrevegrave",7856,"Abrevehookabove",7858,"Abrevetilde",7860,"Acaron",461,"Acircle",9398,"Acircumflex",194,"Acircumflexacute",7844,"Acircumflexdotbelow",7852,"Acircumflexgrave",7846,"Acircumflexhookabove",7848,"Acircumflexsmall",63458,"Acircumflextilde",7850,"Acute",63177,"Acutesmall",63412,"Acyrillic",1040,"Adblgrave",512,"Adieresis",196,"Adieresiscyrillic",1234,"Adieresismacron",478,"Adieresissmall",63460,"Adotbelow",7840,"Adotmacron",480,"Agrave",192,"Agravesmall",63456,"Ahookabove",7842,"Aiecyrillic",1236,"Ainvertedbreve",514,"Alpha",913,"Alphatonos",902,"Amacron",256,"Amonospace",65313,"Aogonek",260,"Aring",197,"Aringacute",506,"Aringbelow",7680,"Aringsmall",63461,"Asmall",63329,"Atilde",195,"Atildesmall",63459,"Aybarmenian",1329,"B",66,"Bcircle",9399,"Bdotaccent",7682,"Bdotbelow",7684,"Becyrillic",1041,"Benarmenian",1330,"Beta",914,"Bhook",385,"Blinebelow",7686,"Bmonospace",65314,"Brevesmall",63220,"Bsmall",63330,"Btopbar",386,"C",67,"Caarmenian",1342,"Cacute",262,"Caron",63178,"Caronsmall",63221,"Ccaron",268,"Ccedilla",199,"Ccedillaacute",7688,"Ccedillasmall",63463,"Ccircle",9400,"Ccircumflex",264,"Cdot",266,"Cdotaccent",266,"Cedillasmall",63416,"Chaarmenian",1353,"Cheabkhasiancyrillic",1212,"Checyrillic",1063,"Chedescenderabkhasiancyrillic",1214,"Chedescendercyrillic",1206,"Chedieresiscyrillic",1268,"Cheharmenian",1347,"Chekhakassiancyrillic",1227,"Cheverticalstrokecyrillic",1208,"Chi",935,"Chook",391,"Circumflexsmall",63222,"Cmonospace",65315,"Coarmenian",1361,"Csmall",63331,"D",68,"DZ",497,"DZcaron",452,"Daarmenian",1332,"Dafrican",393,"Dcaron",270,"Dcedilla",7696,"Dcircle",9401,"Dcircumflexbelow",7698,"Dcroat",272,"Ddotaccent",7690,"Ddotbelow",7692,"Decyrillic",1044,"Deicoptic",1006,"Delta",8710,"Deltagreek",916,"Dhook",394,"Dieresis",63179,"DieresisAcute",63180,"DieresisGrave",63181,"Dieresissmall",63400,"Digammagreek",988,"Djecyrillic",1026,"Dlinebelow",7694,"Dmonospace",65316,"Dotaccentsmall",63223,"Dslash",272,"Dsmall",63332,"Dtopbar",395,"Dz",498,"Dzcaron",453,"Dzeabkhasiancyrillic",1248,"Dzecyrillic",1029,"Dzhecyrillic",1039,"E",69,"Eacute",201,"Eacutesmall",63465,"Ebreve",276,"Ecaron",282,"Ecedillabreve",7708,"Echarmenian",1333,"Ecircle",9402,"Ecircumflex",202,"Ecircumflexacute",7870,"Ecircumflexbelow",7704,"Ecircumflexdotbelow",7878,"Ecircumflexgrave",7872,"Ecircumflexhookabove",7874,"Ecircumflexsmall",63466,"Ecircumflextilde",7876,"Ecyrillic",1028,"Edblgrave",516,"Edieresis",203,"Edieresissmall",63467,"Edot",278,"Edotaccent",278,"Edotbelow",7864,"Efcyrillic",1060,"Egrave",200,"Egravesmall",63464,"Eharmenian",1335,"Ehookabove",7866,"Eightroman",8551,"Einvertedbreve",518,"Eiotifiedcyrillic",1124,"Elcyrillic",1051,"Elevenroman",8554,"Emacron",274,"Emacronacute",7702,"Emacrongrave",7700,"Emcyrillic",1052,"Emonospace",65317,"Encyrillic",1053,"Endescendercyrillic",1186,"Eng",330,"Enghecyrillic",1188,"Enhookcyrillic",1223,"Eogonek",280,"Eopen",400,"Epsilon",917,"Epsilontonos",904,"Ercyrillic",1056,"Ereversed",398,"Ereversedcyrillic",1069,"Escyrillic",1057,"Esdescendercyrillic",1194,"Esh",425,"Esmall",63333,"Eta",919,"Etarmenian",1336,"Etatonos",905,"Eth",208,"Ethsmall",63472,"Etilde",7868,"Etildebelow",7706,"Euro",8364,"Ezh",439,"Ezhcaron",494,"Ezhreversed",440,"F",70,"Fcircle",9403,"Fdotaccent",7710,"Feharmenian",1366,"Feicoptic",996,"Fhook",401,"Fitacyrillic",1138,"Fiveroman",8548,"Fmonospace",65318,"Fourroman",8547,"Fsmall",63334,"G",71,"GBsquare",13191,"Gacute",500,"Gamma",915,"Gammaafrican",404,"Gangiacoptic",1002,"Gbreve",286,"Gcaron",486,"Gcedilla",290,"Gcircle",9404,"Gcircumflex",284,"Gcommaaccent",290,"Gdot",288,"Gdotaccent",288,"Gecyrillic",1043,"Ghadarmenian",1346,"Ghemiddlehookcyrillic",1172,"Ghestrokecyrillic",1170,"Gheupturncyrillic",1168,"Ghook",403,"Gimarmenian",1331,"Gjecyrillic",1027,"Gmacron",7712,"Gmonospace",65319,"Grave",63182,"Gravesmall",63328,"Gsmall",63335,"Gsmallhook",667,"Gstroke",484,"H",72,"H18533",9679,"H18543",9642,"H18551",9643,"H22073",9633,"HPsquare",13259,"Haabkhasiancyrillic",1192,"Hadescendercyrillic",1202,"Hardsigncyrillic",1066,"Hbar",294,"Hbrevebelow",7722,"Hcedilla",7720,"Hcircle",9405,"Hcircumflex",292,"Hdieresis",7718,"Hdotaccent",7714,"Hdotbelow",7716,"Hmonospace",65320,"Hoarmenian",1344,"Horicoptic",1e3,"Hsmall",63336,"Hungarumlaut",63183,"Hungarumlautsmall",63224,"Hzsquare",13200,"I",73,"IAcyrillic",1071,"IJ",306,"IUcyrillic",1070,"Iacute",205,"Iacutesmall",63469,"Ibreve",300,"Icaron",463,"Icircle",9406,"Icircumflex",206,"Icircumflexsmall",63470,"Icyrillic",1030,"Idblgrave",520,"Idieresis",207,"Idieresisacute",7726,"Idieresiscyrillic",1252,"Idieresissmall",63471,"Idot",304,"Idotaccent",304,"Idotbelow",7882,"Iebrevecyrillic",1238,"Iecyrillic",1045,"Ifraktur",8465,"Igrave",204,"Igravesmall",63468,"Ihookabove",7880,"Iicyrillic",1048,"Iinvertedbreve",522,"Iishortcyrillic",1049,"Imacron",298,"Imacroncyrillic",1250,"Imonospace",65321,"Iniarmenian",1339,"Iocyrillic",1025,"Iogonek",302,"Iota",921,"Iotaafrican",406,"Iotadieresis",938,"Iotatonos",906,"Ismall",63337,"Istroke",407,"Itilde",296,"Itildebelow",7724,"Izhitsacyrillic",1140,"Izhitsadblgravecyrillic",1142,"J",74,"Jaarmenian",1345,"Jcircle",9407,"Jcircumflex",308,"Jecyrillic",1032,"Jheharmenian",1355,"Jmonospace",65322,"Jsmall",63338,"K",75,"KBsquare",13189,"KKsquare",13261,"Kabashkircyrillic",1184,"Kacute",7728,"Kacyrillic",1050,"Kadescendercyrillic",1178,"Kahookcyrillic",1219,"Kappa",922,"Kastrokecyrillic",1182,"Kaverticalstrokecyrillic",1180,"Kcaron",488,"Kcedilla",310,"Kcircle",9408,"Kcommaaccent",310,"Kdotbelow",7730,"Keharmenian",1364,"Kenarmenian",1343,"Khacyrillic",1061,"Kheicoptic",998,"Khook",408,"Kjecyrillic",1036,"Klinebelow",7732,"Kmonospace",65323,"Koppacyrillic",1152,"Koppagreek",990,"Ksicyrillic",1134,"Ksmall",63339,"L",76,"LJ",455,"LL",63167,"Lacute",313,"Lambda",923,"Lcaron",317,"Lcedilla",315,"Lcircle",9409,"Lcircumflexbelow",7740,"Lcommaaccent",315,"Ldot",319,"Ldotaccent",319,"Ldotbelow",7734,"Ldotbelowmacron",7736,"Liwnarmenian",1340,"Lj",456,"Ljecyrillic",1033,"Llinebelow",7738,"Lmonospace",65324,"Lslash",321,"Lslashsmall",63225,"Lsmall",63340,"M",77,"MBsquare",13190,"Macron",63184,"Macronsmall",63407,"Macute",7742,"Mcircle",9410,"Mdotaccent",7744,"Mdotbelow",7746,"Menarmenian",1348,"Mmonospace",65325,"Msmall",63341,"Mturned",412,"Mu",924,"N",78,"NJ",458,"Nacute",323,"Ncaron",327,"Ncedilla",325,"Ncircle",9411,"Ncircumflexbelow",7754,"Ncommaaccent",325,"Ndotaccent",7748,"Ndotbelow",7750,"Nhookleft",413,"Nineroman",8552,"Nj",459,"Njecyrillic",1034,"Nlinebelow",7752,"Nmonospace",65326,"Nowarmenian",1350,"Nsmall",63342,"Ntilde",209,"Ntildesmall",63473,"Nu",925,"O",79,"OE",338,"OEsmall",63226,"Oacute",211,"Oacutesmall",63475,"Obarredcyrillic",1256,"Obarreddieresiscyrillic",1258,"Obreve",334,"Ocaron",465,"Ocenteredtilde",415,"Ocircle",9412,"Ocircumflex",212,"Ocircumflexacute",7888,"Ocircumflexdotbelow",7896,"Ocircumflexgrave",7890,"Ocircumflexhookabove",7892,"Ocircumflexsmall",63476,"Ocircumflextilde",7894,"Ocyrillic",1054,"Odblacute",336,"Odblgrave",524,"Odieresis",214,"Odieresiscyrillic",1254,"Odieresissmall",63478,"Odotbelow",7884,"Ogoneksmall",63227,"Ograve",210,"Ogravesmall",63474,"Oharmenian",1365,"Ohm",8486,"Ohookabove",7886,"Ohorn",416,"Ohornacute",7898,"Ohorndotbelow",7906,"Ohorngrave",7900,"Ohornhookabove",7902,"Ohorntilde",7904,"Ohungarumlaut",336,"Oi",418,"Oinvertedbreve",526,"Omacron",332,"Omacronacute",7762,"Omacrongrave",7760,"Omega",8486,"Omegacyrillic",1120,"Omegagreek",937,"Omegaroundcyrillic",1146,"Omegatitlocyrillic",1148,"Omegatonos",911,"Omicron",927,"Omicrontonos",908,"Omonospace",65327,"Oneroman",8544,"Oogonek",490,"Oogonekmacron",492,"Oopen",390,"Oslash",216,"Oslashacute",510,"Oslashsmall",63480,"Osmall",63343,"Ostrokeacute",510,"Otcyrillic",1150,"Otilde",213,"Otildeacute",7756,"Otildedieresis",7758,"Otildesmall",63477,"P",80,"Pacute",7764,"Pcircle",9413,"Pdotaccent",7766,"Pecyrillic",1055,"Peharmenian",1354,"Pemiddlehookcyrillic",1190,"Phi",934,"Phook",420,"Pi",928,"Piwrarmenian",1363,"Pmonospace",65328,"Psi",936,"Psicyrillic",1136,"Psmall",63344,"Q",81,"Qcircle",9414,"Qmonospace",65329,"Qsmall",63345,"R",82,"Raarmenian",1356,"Racute",340,"Rcaron",344,"Rcedilla",342,"Rcircle",9415,"Rcommaaccent",342,"Rdblgrave",528,"Rdotaccent",7768,"Rdotbelow",7770,"Rdotbelowmacron",7772,"Reharmenian",1360,"Rfraktur",8476,"Rho",929,"Ringsmall",63228,"Rinvertedbreve",530,"Rlinebelow",7774,"Rmonospace",65330,"Rsmall",63346,"Rsmallinverted",641,"Rsmallinvertedsuperior",694,"S",83,"SF010000",9484,"SF020000",9492,"SF030000",9488,"SF040000",9496,"SF050000",9532,"SF060000",9516,"SF070000",9524,"SF080000",9500,"SF090000",9508,"SF100000",9472,"SF110000",9474,"SF190000",9569,"SF200000",9570,"SF210000",9558,"SF220000",9557,"SF230000",9571,"SF240000",9553,"SF250000",9559,"SF260000",9565,"SF270000",9564,"SF280000",9563,"SF360000",9566,"SF370000",9567,"SF380000",9562,"SF390000",9556,"SF400000",9577,"SF410000",9574,"SF420000",9568,"SF430000",9552,"SF440000",9580,"SF450000",9575,"SF460000",9576,"SF470000",9572,"SF480000",9573,"SF490000",9561,"SF500000",9560,"SF510000",9554,"SF520000",9555,"SF530000",9579,"SF540000",9578,"Sacute",346,"Sacutedotaccent",7780,"Sampigreek",992,"Scaron",352,"Scarondotaccent",7782,"Scaronsmall",63229,"Scedilla",350,"Schwa",399,"Schwacyrillic",1240,"Schwadieresiscyrillic",1242,"Scircle",9416,"Scircumflex",348,"Scommaaccent",536,"Sdotaccent",7776,"Sdotbelow",7778,"Sdotbelowdotaccent",7784,"Seharmenian",1357,"Sevenroman",8550,"Shaarmenian",1351,"Shacyrillic",1064,"Shchacyrillic",1065,"Sheicoptic",994,"Shhacyrillic",1210,"Shimacoptic",1004,"Sigma",931,"Sixroman",8549,"Smonospace",65331,"Softsigncyrillic",1068,"Ssmall",63347,"Stigmagreek",986,"T",84,"Tau",932,"Tbar",358,"Tcaron",356,"Tcedilla",354,"Tcircle",9417,"Tcircumflexbelow",7792,"Tcommaaccent",354,"Tdotaccent",7786,"Tdotbelow",7788,"Tecyrillic",1058,"Tedescendercyrillic",1196,"Tenroman",8553,"Tetsecyrillic",1204,"Theta",920,"Thook",428,"Thorn",222,"Thornsmall",63486,"Threeroman",8546,"Tildesmall",63230,"Tiwnarmenian",1359,"Tlinebelow",7790,"Tmonospace",65332,"Toarmenian",1337,"Tonefive",444,"Tonesix",388,"Tonetwo",423,"Tretroflexhook",430,"Tsecyrillic",1062,"Tshecyrillic",1035,"Tsmall",63348,"Twelveroman",8555,"Tworoman",8545,"U",85,"Uacute",218,"Uacutesmall",63482,"Ubreve",364,"Ucaron",467,"Ucircle",9418,"Ucircumflex",219,"Ucircumflexbelow",7798,"Ucircumflexsmall",63483,"Ucyrillic",1059,"Udblacute",368,"Udblgrave",532,"Udieresis",220,"Udieresisacute",471,"Udieresisbelow",7794,"Udieresiscaron",473,"Udieresiscyrillic",1264,"Udieresisgrave",475,"Udieresismacron",469,"Udieresissmall",63484,"Udotbelow",7908,"Ugrave",217,"Ugravesmall",63481,"Uhookabove",7910,"Uhorn",431,"Uhornacute",7912,"Uhorndotbelow",7920,"Uhorngrave",7914,"Uhornhookabove",7916,"Uhorntilde",7918,"Uhungarumlaut",368,"Uhungarumlautcyrillic",1266,"Uinvertedbreve",534,"Ukcyrillic",1144,"Umacron",362,"Umacroncyrillic",1262,"Umacrondieresis",7802,"Umonospace",65333,"Uogonek",370,"Upsilon",933,"Upsilon1",978,"Upsilonacutehooksymbolgreek",979,"Upsilonafrican",433,"Upsilondieresis",939,"Upsilondieresishooksymbolgreek",980,"Upsilonhooksymbol",978,"Upsilontonos",910,"Uring",366,"Ushortcyrillic",1038,"Usmall",63349,"Ustraightcyrillic",1198,"Ustraightstrokecyrillic",1200,"Utilde",360,"Utildeacute",7800,"Utildebelow",7796,"V",86,"Vcircle",9419,"Vdotbelow",7806,"Vecyrillic",1042,"Vewarmenian",1358,"Vhook",434,"Vmonospace",65334,"Voarmenian",1352,"Vsmall",63350,"Vtilde",7804,"W",87,"Wacute",7810,"Wcircle",9420,"Wcircumflex",372,"Wdieresis",7812,"Wdotaccent",7814,"Wdotbelow",7816,"Wgrave",7808,"Wmonospace",65335,"Wsmall",63351,"X",88,"Xcircle",9421,"Xdieresis",7820,"Xdotaccent",7818,"Xeharmenian",1341,"Xi",926,"Xmonospace",65336,"Xsmall",63352,"Y",89,"Yacute",221,"Yacutesmall",63485,"Yatcyrillic",1122,"Ycircle",9422,"Ycircumflex",374,"Ydieresis",376,"Ydieresissmall",63487,"Ydotaccent",7822,"Ydotbelow",7924,"Yericyrillic",1067,"Yerudieresiscyrillic",1272,"Ygrave",7922,"Yhook",435,"Yhookabove",7926,"Yiarmenian",1349,"Yicyrillic",1031,"Yiwnarmenian",1362,"Ymonospace",65337,"Ysmall",63353,"Ytilde",7928,"Yusbigcyrillic",1130,"Yusbigiotifiedcyrillic",1132,"Yuslittlecyrillic",1126,"Yuslittleiotifiedcyrillic",1128,"Z",90,"Zaarmenian",1334,"Zacute",377,"Zcaron",381,"Zcaronsmall",63231,"Zcircle",9423,"Zcircumflex",7824,"Zdot",379,"Zdotaccent",379,"Zdotbelow",7826,"Zecyrillic",1047,"Zedescendercyrillic",1176,"Zedieresiscyrillic",1246,"Zeta",918,"Zhearmenian",1338,"Zhebrevecyrillic",1217,"Zhecyrillic",1046,"Zhedescendercyrillic",1174,"Zhedieresiscyrillic",1244,"Zlinebelow",7828,"Zmonospace",65338,"Zsmall",63354,"Zstroke",437,"a",97,"aabengali",2438,"aacute",225,"aadeva",2310,"aagujarati",2694,"aagurmukhi",2566,"aamatragurmukhi",2622,"aarusquare",13059,"aavowelsignbengali",2494,"aavowelsigndeva",2366,"aavowelsigngujarati",2750,"abbreviationmarkarmenian",1375,"abbreviationsigndeva",2416,"abengali",2437,"abopomofo",12570,"abreve",259,"abreveacute",7855,"abrevecyrillic",1233,"abrevedotbelow",7863,"abrevegrave",7857,"abrevehookabove",7859,"abrevetilde",7861,"acaron",462,"acircle",9424,"acircumflex",226,"acircumflexacute",7845,"acircumflexdotbelow",7853,"acircumflexgrave",7847,"acircumflexhookabove",7849,"acircumflextilde",7851,"acute",180,"acutebelowcmb",791,"acutecmb",769,"acutecomb",769,"acutedeva",2388,"acutelowmod",719,"acutetonecmb",833,"acyrillic",1072,"adblgrave",513,"addakgurmukhi",2673,"adeva",2309,"adieresis",228,"adieresiscyrillic",1235,"adieresismacron",479,"adotbelow",7841,"adotmacron",481,"ae",230,"aeacute",509,"aekorean",12624,"aemacron",483,"afii00208",8213,"afii08941",8356,"afii10017",1040,"afii10018",1041,"afii10019",1042,"afii10020",1043,"afii10021",1044,"afii10022",1045,"afii10023",1025,"afii10024",1046,"afii10025",1047,"afii10026",1048,"afii10027",1049,"afii10028",1050,"afii10029",1051,"afii10030",1052,"afii10031",1053,"afii10032",1054,"afii10033",1055,"afii10034",1056,"afii10035",1057,"afii10036",1058,"afii10037",1059,"afii10038",1060,"afii10039",1061,"afii10040",1062,"afii10041",1063,"afii10042",1064,"afii10043",1065,"afii10044",1066,"afii10045",1067,"afii10046",1068,"afii10047",1069,"afii10048",1070,"afii10049",1071,"afii10050",1168,"afii10051",1026,"afii10052",1027,"afii10053",1028,"afii10054",1029,"afii10055",1030,"afii10056",1031,"afii10057",1032,"afii10058",1033,"afii10059",1034,"afii10060",1035,"afii10061",1036,"afii10062",1038,"afii10063",63172,"afii10064",63173,"afii10065",1072,"afii10066",1073,"afii10067",1074,"afii10068",1075,"afii10069",1076,"afii10070",1077,"afii10071",1105,"afii10072",1078,"afii10073",1079,"afii10074",1080,"afii10075",1081,"afii10076",1082,"afii10077",1083,"afii10078",1084,"afii10079",1085,"afii10080",1086,"afii10081",1087,"afii10082",1088,"afii10083",1089,"afii10084",1090,"afii10085",1091,"afii10086",1092,"afii10087",1093,"afii10088",1094,"afii10089",1095,"afii10090",1096,"afii10091",1097,"afii10092",1098,"afii10093",1099,"afii10094",1100,"afii10095",1101,"afii10096",1102,"afii10097",1103,"afii10098",1169,"afii10099",1106,"afii10100",1107,"afii10101",1108,"afii10102",1109,"afii10103",1110,"afii10104",1111,"afii10105",1112,"afii10106",1113,"afii10107",1114,"afii10108",1115,"afii10109",1116,"afii10110",1118,"afii10145",1039,"afii10146",1122,"afii10147",1138,"afii10148",1140,"afii10192",63174,"afii10193",1119,"afii10194",1123,"afii10195",1139,"afii10196",1141,"afii10831",63175,"afii10832",63176,"afii10846",1241,"afii299",8206,"afii300",8207,"afii301",8205,"afii57381",1642,"afii57388",1548,"afii57392",1632,"afii57393",1633,"afii57394",1634,"afii57395",1635,"afii57396",1636,"afii57397",1637,"afii57398",1638,"afii57399",1639,"afii57400",1640,"afii57401",1641,"afii57403",1563,"afii57407",1567,"afii57409",1569,"afii57410",1570,"afii57411",1571,"afii57412",1572,"afii57413",1573,"afii57414",1574,"afii57415",1575,"afii57416",1576,"afii57417",1577,"afii57418",1578,"afii57419",1579,"afii57420",1580,"afii57421",1581,"afii57422",1582,"afii57423",1583,"afii57424",1584,"afii57425",1585,"afii57426",1586,"afii57427",1587,"afii57428",1588,"afii57429",1589,"afii57430",1590,"afii57431",1591,"afii57432",1592,"afii57433",1593,"afii57434",1594,"afii57440",1600,"afii57441",1601,"afii57442",1602,"afii57443",1603,"afii57444",1604,"afii57445",1605,"afii57446",1606,"afii57448",1608,"afii57449",1609,"afii57450",1610,"afii57451",1611,"afii57452",1612,"afii57453",1613,"afii57454",1614,"afii57455",1615,"afii57456",1616,"afii57457",1617,"afii57458",1618,"afii57470",1607,"afii57505",1700,"afii57506",1662,"afii57507",1670,"afii57508",1688,"afii57509",1711,"afii57511",1657,"afii57512",1672,"afii57513",1681,"afii57514",1722,"afii57519",1746,"afii57534",1749,"afii57636",8362,"afii57645",1470,"afii57658",1475,"afii57664",1488,"afii57665",1489,"afii57666",1490,"afii57667",1491,"afii57668",1492,"afii57669",1493,"afii57670",1494,"afii57671",1495,"afii57672",1496,"afii57673",1497,"afii57674",1498,"afii57675",1499,"afii57676",1500,"afii57677",1501,"afii57678",1502,"afii57679",1503,"afii57680",1504,"afii57681",1505,"afii57682",1506,"afii57683",1507,"afii57684",1508,"afii57685",1509,"afii57686",1510,"afii57687",1511,"afii57688",1512,"afii57689",1513,"afii57690",1514,"afii57694",64298,"afii57695",64299,"afii57700",64331,"afii57705",64287,"afii57716",1520,"afii57717",1521,"afii57718",1522,"afii57723",64309,"afii57793",1460,"afii57794",1461,"afii57795",1462,"afii57796",1467,"afii57797",1464,"afii57798",1463,"afii57799",1456,"afii57800",1458,"afii57801",1457,"afii57802",1459,"afii57803",1474,"afii57804",1473,"afii57806",1465,"afii57807",1468,"afii57839",1469,"afii57841",1471,"afii57842",1472,"afii57929",700,"afii61248",8453,"afii61289",8467,"afii61352",8470,"afii61573",8236,"afii61574",8237,"afii61575",8238,"afii61664",8204,"afii63167",1645,"afii64937",701,"agrave",224,"agujarati",2693,"agurmukhi",2565,"ahiragana",12354,"ahookabove",7843,"aibengali",2448,"aibopomofo",12574,"aideva",2320,"aiecyrillic",1237,"aigujarati",2704,"aigurmukhi",2576,"aimatragurmukhi",2632,"ainarabic",1593,"ainfinalarabic",65226,"aininitialarabic",65227,"ainmedialarabic",65228,"ainvertedbreve",515,"aivowelsignbengali",2504,"aivowelsigndeva",2376,"aivowelsigngujarati",2760,"akatakana",12450,"akatakanahalfwidth",65393,"akorean",12623,"alef",1488,"alefarabic",1575,"alefdageshhebrew",64304,"aleffinalarabic",65166,"alefhamzaabovearabic",1571,"alefhamzaabovefinalarabic",65156,"alefhamzabelowarabic",1573,"alefhamzabelowfinalarabic",65160,"alefhebrew",1488,"aleflamedhebrew",64335,"alefmaddaabovearabic",1570,"alefmaddaabovefinalarabic",65154,"alefmaksuraarabic",1609,"alefmaksurafinalarabic",65264,"alefmaksurainitialarabic",65267,"alefmaksuramedialarabic",65268,"alefpatahhebrew",64302,"alefqamatshebrew",64303,"aleph",8501,"allequal",8780,"alpha",945,"alphatonos",940,"amacron",257,"amonospace",65345,"ampersand",38,"ampersandmonospace",65286,"ampersandsmall",63270,"amsquare",13250,"anbopomofo",12578,"angbopomofo",12580,"angbracketleft",12296,"angbracketright",12297,"angkhankhuthai",3674,"angle",8736,"anglebracketleft",12296,"anglebracketleftvertical",65087,"anglebracketright",12297,"anglebracketrightvertical",65088,"angleleft",9001,"angleright",9002,"angstrom",8491,"anoteleia",903,"anudattadeva",2386,"anusvarabengali",2434,"anusvaradeva",2306,"anusvaragujarati",2690,"aogonek",261,"apaatosquare",13056,"aparen",9372,"apostrophearmenian",1370,"apostrophemod",700,"apple",63743,"approaches",8784,"approxequal",8776,"approxequalorimage",8786,"approximatelyequal",8773,"araeaekorean",12686,"araeakorean",12685,"arc",8978,"arighthalfring",7834,"aring",229,"aringacute",507,"aringbelow",7681,"arrowboth",8596,"arrowdashdown",8675,"arrowdashleft",8672,"arrowdashright",8674,"arrowdashup",8673,"arrowdblboth",8660,"arrowdbldown",8659,"arrowdblleft",8656,"arrowdblright",8658,"arrowdblup",8657,"arrowdown",8595,"arrowdownleft",8601,"arrowdownright",8600,"arrowdownwhite",8681,"arrowheaddownmod",709,"arrowheadleftmod",706,"arrowheadrightmod",707,"arrowheadupmod",708,"arrowhorizex",63719,"arrowleft",8592,"arrowleftdbl",8656,"arrowleftdblstroke",8653,"arrowleftoverright",8646,"arrowleftwhite",8678,"arrowright",8594,"arrowrightdblstroke",8655,"arrowrightheavy",10142,"arrowrightoverleft",8644,"arrowrightwhite",8680,"arrowtableft",8676,"arrowtabright",8677,"arrowup",8593,"arrowupdn",8597,"arrowupdnbse",8616,"arrowupdownbase",8616,"arrowupleft",8598,"arrowupleftofdown",8645,"arrowupright",8599,"arrowupwhite",8679,"arrowvertex",63718,"asciicircum",94,"asciicircummonospace",65342,"asciitilde",126,"asciitildemonospace",65374,"ascript",593,"ascriptturned",594,"asmallhiragana",12353,"asmallkatakana",12449,"asmallkatakanahalfwidth",65383,"asterisk",42,"asteriskaltonearabic",1645,"asteriskarabic",1645,"asteriskmath",8727,"asteriskmonospace",65290,"asterisksmall",65121,"asterism",8258,"asuperior",63209,"asymptoticallyequal",8771,"at",64,"atilde",227,"atmonospace",65312,"atsmall",65131,"aturned",592,"aubengali",2452,"aubopomofo",12576,"audeva",2324,"augujarati",2708,"augurmukhi",2580,"aulengthmarkbengali",2519,"aumatragurmukhi",2636,"auvowelsignbengali",2508,"auvowelsigndeva",2380,"auvowelsigngujarati",2764,"avagrahadeva",2365,"aybarmenian",1377,"ayin",1506,"ayinaltonehebrew",64288,"ayinhebrew",1506,"b",98,"babengali",2476,"backslash",92,"backslashmonospace",65340,"badeva",2348,"bagujarati",2732,"bagurmukhi",2604,"bahiragana",12400,"bahtthai",3647,"bakatakana",12496,"bar",124,"barmonospace",65372,"bbopomofo",12549,"bcircle",9425,"bdotaccent",7683,"bdotbelow",7685,"beamedsixteenthnotes",9836,"because",8757,"becyrillic",1073,"beharabic",1576,"behfinalarabic",65168,"behinitialarabic",65169,"behiragana",12409,"behmedialarabic",65170,"behmeeminitialarabic",64671,"behmeemisolatedarabic",64520,"behnoonfinalarabic",64621,"bekatakana",12505,"benarmenian",1378,"bet",1489,"beta",946,"betasymbolgreek",976,"betdagesh",64305,"betdageshhebrew",64305,"bethebrew",1489,"betrafehebrew",64332,"bhabengali",2477,"bhadeva",2349,"bhagujarati",2733,"bhagurmukhi",2605,"bhook",595,"bihiragana",12403,"bikatakana",12499,"bilabialclick",664,"bindigurmukhi",2562,"birusquare",13105,"blackcircle",9679,"blackdiamond",9670,"blackdownpointingtriangle",9660,"blackleftpointingpointer",9668,"blackleftpointingtriangle",9664,"blacklenticularbracketleft",12304,"blacklenticularbracketleftvertical",65083,"blacklenticularbracketright",12305,"blacklenticularbracketrightvertical",65084,"blacklowerlefttriangle",9699,"blacklowerrighttriangle",9698,"blackrectangle",9644,"blackrightpointingpointer",9658,"blackrightpointingtriangle",9654,"blacksmallsquare",9642,"blacksmilingface",9787,"blacksquare",9632,"blackstar",9733,"blackupperlefttriangle",9700,"blackupperrighttriangle",9701,"blackuppointingsmalltriangle",9652,"blackuppointingtriangle",9650,"blank",9251,"blinebelow",7687,"block",9608,"bmonospace",65346,"bobaimaithai",3610,"bohiragana",12412,"bokatakana",12508,"bparen",9373,"bqsquare",13251,"braceex",63732,"braceleft",123,"braceleftbt",63731,"braceleftmid",63730,"braceleftmonospace",65371,"braceleftsmall",65115,"bracelefttp",63729,"braceleftvertical",65079,"braceright",125,"bracerightbt",63742,"bracerightmid",63741,"bracerightmonospace",65373,"bracerightsmall",65116,"bracerighttp",63740,"bracerightvertical",65080,"bracketleft",91,"bracketleftbt",63728,"bracketleftex",63727,"bracketleftmonospace",65339,"bracketlefttp",63726,"bracketright",93,"bracketrightbt",63739,"bracketrightex",63738,"bracketrightmonospace",65341,"bracketrighttp",63737,"breve",728,"brevebelowcmb",814,"brevecmb",774,"breveinvertedbelowcmb",815,"breveinvertedcmb",785,"breveinverteddoublecmb",865,"bridgebelowcmb",810,"bridgeinvertedbelowcmb",826,"brokenbar",166,"bstroke",384,"bsuperior",63210,"btopbar",387,"buhiragana",12406,"bukatakana",12502,"bullet",8226,"bulletinverse",9688,"bulletoperator",8729,"bullseye",9678,"c",99,"caarmenian",1390,"cabengali",2458,"cacute",263,"cadeva",2330,"cagujarati",2714,"cagurmukhi",2586,"calsquare",13192,"candrabindubengali",2433,"candrabinducmb",784,"candrabindudeva",2305,"candrabindugujarati",2689,"capslock",8682,"careof",8453,"caron",711,"caronbelowcmb",812,"caroncmb",780,"carriagereturn",8629,"cbopomofo",12568,"ccaron",269,"ccedilla",231,"ccedillaacute",7689,"ccircle",9426,"ccircumflex",265,"ccurl",597,"cdot",267,"cdotaccent",267,"cdsquare",13253,"cedilla",184,"cedillacmb",807,"cent",162,"centigrade",8451,"centinferior",63199,"centmonospace",65504,"centoldstyle",63394,"centsuperior",63200,"chaarmenian",1401,"chabengali",2459,"chadeva",2331,"chagujarati",2715,"chagurmukhi",2587,"chbopomofo",12564,"cheabkhasiancyrillic",1213,"checkmark",10003,"checyrillic",1095,"chedescenderabkhasiancyrillic",1215,"chedescendercyrillic",1207,"chedieresiscyrillic",1269,"cheharmenian",1395,"chekhakassiancyrillic",1228,"cheverticalstrokecyrillic",1209,"chi",967,"chieuchacirclekorean",12919,"chieuchaparenkorean",12823,"chieuchcirclekorean",12905,"chieuchkorean",12618,"chieuchparenkorean",12809,"chochangthai",3594,"chochanthai",3592,"chochingthai",3593,"chochoethai",3596,"chook",392,"cieucacirclekorean",12918,"cieucaparenkorean",12822,"cieuccirclekorean",12904,"cieuckorean",12616,"cieucparenkorean",12808,"cieucuparenkorean",12828,"circle",9675,"circlecopyrt",169,"circlemultiply",8855,"circleot",8857,"circleplus",8853,"circlepostalmark",12342,"circlewithlefthalfblack",9680,"circlewithrighthalfblack",9681,"circumflex",710,"circumflexbelowcmb",813,"circumflexcmb",770,"clear",8999,"clickalveolar",450,"clickdental",448,"clicklateral",449,"clickretroflex",451,"club",9827,"clubsuitblack",9827,"clubsuitwhite",9831,"cmcubedsquare",13220,"cmonospace",65347,"cmsquaredsquare",13216,"coarmenian",1409,"colon",58,"colonmonetary",8353,"colonmonospace",65306,"colonsign",8353,"colonsmall",65109,"colontriangularhalfmod",721,"colontriangularmod",720,"comma",44,"commaabovecmb",787,"commaaboverightcmb",789,"commaaccent",63171,"commaarabic",1548,"commaarmenian",1373,"commainferior",63201,"commamonospace",65292,"commareversedabovecmb",788,"commareversedmod",701,"commasmall",65104,"commasuperior",63202,"commaturnedabovecmb",786,"commaturnedmod",699,"compass",9788,"congruent",8773,"contourintegral",8750,"control",8963,"controlACK",6,"controlBEL",7,"controlBS",8,"controlCAN",24,"controlCR",13,"controlDC1",17,"controlDC2",18,"controlDC3",19,"controlDC4",20,"controlDEL",127,"controlDLE",16,"controlEM",25,"controlENQ",5,"controlEOT",4,"controlESC",27,"controlETB",23,"controlETX",3,"controlFF",12,"controlFS",28,"controlGS",29,"controlHT",9,"controlLF",10,"controlNAK",21,"controlNULL",0,"controlRS",30,"controlSI",15,"controlSO",14,"controlSOT",2,"controlSTX",1,"controlSUB",26,"controlSYN",22,"controlUS",31,"controlVT",11,"copyright",169,"copyrightsans",63721,"copyrightserif",63193,"cornerbracketleft",12300,"cornerbracketlefthalfwidth",65378,"cornerbracketleftvertical",65089,"cornerbracketright",12301,"cornerbracketrighthalfwidth",65379,"cornerbracketrightvertical",65090,"corporationsquare",13183,"cosquare",13255,"coverkgsquare",13254,"cparen",9374,"cruzeiro",8354,"cstretched",663,"curlyand",8911,"curlyor",8910,"currency",164,"cyrBreve",63185,"cyrFlex",63186,"cyrbreve",63188,"cyrflex",63189,"d",100,"daarmenian",1380,"dabengali",2470,"dadarabic",1590,"dadeva",2342,"dadfinalarabic",65214,"dadinitialarabic",65215,"dadmedialarabic",65216,"dagesh",1468,"dageshhebrew",1468,"dagger",8224,"daggerdbl",8225,"dagujarati",2726,"dagurmukhi",2598,"dahiragana",12384,"dakatakana",12480,"dalarabic",1583,"dalet",1491,"daletdagesh",64307,"daletdageshhebrew",64307,"dalethebrew",1491,"dalfinalarabic",65194,"dammaarabic",1615,"dammalowarabic",1615,"dammatanaltonearabic",1612,"dammatanarabic",1612,"danda",2404,"dargahebrew",1447,"dargalefthebrew",1447,"dasiapneumatacyrilliccmb",1157,"dblGrave",63187,"dblanglebracketleft",12298,"dblanglebracketleftvertical",65085,"dblanglebracketright",12299,"dblanglebracketrightvertical",65086,"dblarchinvertedbelowcmb",811,"dblarrowleft",8660,"dblarrowright",8658,"dbldanda",2405,"dblgrave",63190,"dblgravecmb",783,"dblintegral",8748,"dbllowline",8215,"dbllowlinecmb",819,"dbloverlinecmb",831,"dblprimemod",698,"dblverticalbar",8214,"dblverticallineabovecmb",782,"dbopomofo",12553,"dbsquare",13256,"dcaron",271,"dcedilla",7697,"dcircle",9427,"dcircumflexbelow",7699,"dcroat",273,"ddabengali",2465,"ddadeva",2337,"ddagujarati",2721,"ddagurmukhi",2593,"ddalarabic",1672,"ddalfinalarabic",64393,"dddhadeva",2396,"ddhabengali",2466,"ddhadeva",2338,"ddhagujarati",2722,"ddhagurmukhi",2594,"ddotaccent",7691,"ddotbelow",7693,"decimalseparatorarabic",1643,"decimalseparatorpersian",1643,"decyrillic",1076,"degree",176,"dehihebrew",1453,"dehiragana",12391,"deicoptic",1007,"dekatakana",12487,"deleteleft",9003,"deleteright",8998,"delta",948,"deltaturned",397,"denominatorminusonenumeratorbengali",2552,"dezh",676,"dhabengali",2471,"dhadeva",2343,"dhagujarati",2727,"dhagurmukhi",2599,"dhook",599,"dialytikatonos",901,"dialytikatonoscmb",836,"diamond",9830,"diamondsuitwhite",9826,"dieresis",168,"dieresisacute",63191,"dieresisbelowcmb",804,"dieresiscmb",776,"dieresisgrave",63192,"dieresistonos",901,"dihiragana",12386,"dikatakana",12482,"dittomark",12291,"divide",247,"divides",8739,"divisionslash",8725,"djecyrillic",1106,"dkshade",9619,"dlinebelow",7695,"dlsquare",13207,"dmacron",273,"dmonospace",65348,"dnblock",9604,"dochadathai",3598,"dodekthai",3604,"dohiragana",12393,"dokatakana",12489,"dollar",36,"dollarinferior",63203,"dollarmonospace",65284,"dollaroldstyle",63268,"dollarsmall",65129,"dollarsuperior",63204,"dong",8363,"dorusquare",13094,"dotaccent",729,"dotaccentcmb",775,"dotbelowcmb",803,"dotbelowcomb",803,"dotkatakana",12539,"dotlessi",305,"dotlessj",63166,"dotlessjstrokehook",644,"dotmath",8901,"dottedcircle",9676,"doubleyodpatah",64287,"doubleyodpatahhebrew",64287,"downtackbelowcmb",798,"downtackmod",725,"dparen",9375,"dsuperior",63211,"dtail",598,"dtopbar",396,"duhiragana",12389,"dukatakana",12485,"dz",499,"dzaltone",675,"dzcaron",454,"dzcurl",677,"dzeabkhasiancyrillic",1249,"dzecyrillic",1109,"dzhecyrillic",1119,"e",101,"eacute",233,"earth",9793,"ebengali",2447,"ebopomofo",12572,"ebreve",277,"ecandradeva",2317,"ecandragujarati",2701,"ecandravowelsigndeva",2373,"ecandravowelsigngujarati",2757,"ecaron",283,"ecedillabreve",7709,"echarmenian",1381,"echyiwnarmenian",1415,"ecircle",9428,"ecircumflex",234,"ecircumflexacute",7871,"ecircumflexbelow",7705,"ecircumflexdotbelow",7879,"ecircumflexgrave",7873,"ecircumflexhookabove",7875,"ecircumflextilde",7877,"ecyrillic",1108,"edblgrave",517,"edeva",2319,"edieresis",235,"edot",279,"edotaccent",279,"edotbelow",7865,"eegurmukhi",2575,"eematragurmukhi",2631,"efcyrillic",1092,"egrave",232,"egujarati",2703,"eharmenian",1383,"ehbopomofo",12573,"ehiragana",12360,"ehookabove",7867,"eibopomofo",12575,"eight",56,"eightarabic",1640,"eightbengali",2542,"eightcircle",9319,"eightcircleinversesansserif",10129,"eightdeva",2414,"eighteencircle",9329,"eighteenparen",9349,"eighteenperiod",9369,"eightgujarati",2798,"eightgurmukhi",2670,"eighthackarabic",1640,"eighthangzhou",12328,"eighthnotebeamed",9835,"eightideographicparen",12839,"eightinferior",8328,"eightmonospace",65304,"eightoldstyle",63288,"eightparen",9339,"eightperiod",9359,"eightpersian",1784,"eightroman",8567,"eightsuperior",8312,"eightthai",3672,"einvertedbreve",519,"eiotifiedcyrillic",1125,"ekatakana",12456,"ekatakanahalfwidth",65396,"ekonkargurmukhi",2676,"ekorean",12628,"elcyrillic",1083,"element",8712,"elevencircle",9322,"elevenparen",9342,"elevenperiod",9362,"elevenroman",8570,"ellipsis",8230,"ellipsisvertical",8942,"emacron",275,"emacronacute",7703,"emacrongrave",7701,"emcyrillic",1084,"emdash",8212,"emdashvertical",65073,"emonospace",65349,"emphasismarkarmenian",1371,"emptyset",8709,"enbopomofo",12579,"encyrillic",1085,"endash",8211,"endashvertical",65074,"endescendercyrillic",1187,"eng",331,"engbopomofo",12581,"enghecyrillic",1189,"enhookcyrillic",1224,"enspace",8194,"eogonek",281,"eokorean",12627,"eopen",603,"eopenclosed",666,"eopenreversed",604,"eopenreversedclosed",606,"eopenreversedhook",605,"eparen",9376,"epsilon",949,"epsilontonos",941,"equal",61,"equalmonospace",65309,"equalsmall",65126,"equalsuperior",8316,"equivalence",8801,"erbopomofo",12582,"ercyrillic",1088,"ereversed",600,"ereversedcyrillic",1101,"escyrillic",1089,"esdescendercyrillic",1195,"esh",643,"eshcurl",646,"eshortdeva",2318,"eshortvowelsigndeva",2374,"eshreversedloop",426,"eshsquatreversed",645,"esmallhiragana",12359,"esmallkatakana",12455,"esmallkatakanahalfwidth",65386,"estimated",8494,"esuperior",63212,"eta",951,"etarmenian",1384,"etatonos",942,"eth",240,"etilde",7869,"etildebelow",7707,"etnahtafoukhhebrew",1425,"etnahtafoukhlefthebrew",1425,"etnahtahebrew",1425,"etnahtalefthebrew",1425,"eturned",477,"eukorean",12641,"euro",8364,"evowelsignbengali",2503,"evowelsigndeva",2375,"evowelsigngujarati",2759,"exclam",33,"exclamarmenian",1372,"exclamdbl",8252,"exclamdown",161,"exclamdownsmall",63393,"exclammonospace",65281,"exclamsmall",63265,"existential",8707,"ezh",658,"ezhcaron",495,"ezhcurl",659,"ezhreversed",441,"ezhtail",442,"f",102,"fadeva",2398,"fagurmukhi",2654,"fahrenheit",8457,"fathaarabic",1614,"fathalowarabic",1614,"fathatanarabic",1611,"fbopomofo",12552,"fcircle",9429,"fdotaccent",7711,"feharabic",1601,"feharmenian",1414,"fehfinalarabic",65234,"fehinitialarabic",65235,"fehmedialarabic",65236,"feicoptic",997,"female",9792,"ff",64256,"f_f",64256,"ffi",64259,"f_f_i",64259,"ffl",64260,"f_f_l",64260,"fi",64257,"f_i",64257,"fifteencircle",9326,"fifteenparen",9346,"fifteenperiod",9366,"figuredash",8210,"filledbox",9632,"filledrect",9644,"finalkaf",1498,"finalkafdagesh",64314,"finalkafdageshhebrew",64314,"finalkafhebrew",1498,"finalmem",1501,"finalmemhebrew",1501,"finalnun",1503,"finalnunhebrew",1503,"finalpe",1507,"finalpehebrew",1507,"finaltsadi",1509,"finaltsadihebrew",1509,"firsttonechinese",713,"fisheye",9673,"fitacyrillic",1139,"five",53,"fivearabic",1637,"fivebengali",2539,"fivecircle",9316,"fivecircleinversesansserif",10126,"fivedeva",2411,"fiveeighths",8541,"fivegujarati",2795,"fivegurmukhi",2667,"fivehackarabic",1637,"fivehangzhou",12325,"fiveideographicparen",12836,"fiveinferior",8325,"fivemonospace",65301,"fiveoldstyle",63285,"fiveparen",9336,"fiveperiod",9356,"fivepersian",1781,"fiveroman",8564,"fivesuperior",8309,"fivethai",3669,"fl",64258,"f_l",64258,"florin",402,"fmonospace",65350,"fmsquare",13209,"fofanthai",3615,"fofathai",3613,"fongmanthai",3663,"forall",8704,"four",52,"fourarabic",1636,"fourbengali",2538,"fourcircle",9315,"fourcircleinversesansserif",10125,"fourdeva",2410,"fourgujarati",2794,"fourgurmukhi",2666,"fourhackarabic",1636,"fourhangzhou",12324,"fourideographicparen",12835,"fourinferior",8324,"fourmonospace",65300,"fournumeratorbengali",2551,"fouroldstyle",63284,"fourparen",9335,"fourperiod",9355,"fourpersian",1780,"fourroman",8563,"foursuperior",8308,"fourteencircle",9325,"fourteenparen",9345,"fourteenperiod",9365,"fourthai",3668,"fourthtonechinese",715,"fparen",9377,"fraction",8260,"franc",8355,"g",103,"gabengali",2455,"gacute",501,"gadeva",2327,"gafarabic",1711,"gaffinalarabic",64403,"gafinitialarabic",64404,"gafmedialarabic",64405,"gagujarati",2711,"gagurmukhi",2583,"gahiragana",12364,"gakatakana",12460,"gamma",947,"gammalatinsmall",611,"gammasuperior",736,"gangiacoptic",1003,"gbopomofo",12557,"gbreve",287,"gcaron",487,"gcedilla",291,"gcircle",9430,"gcircumflex",285,"gcommaaccent",291,"gdot",289,"gdotaccent",289,"gecyrillic",1075,"gehiragana",12370,"gekatakana",12466,"geometricallyequal",8785,"gereshaccenthebrew",1436,"gereshhebrew",1523,"gereshmuqdamhebrew",1437,"germandbls",223,"gershayimaccenthebrew",1438,"gershayimhebrew",1524,"getamark",12307,"ghabengali",2456,"ghadarmenian",1394,"ghadeva",2328,"ghagujarati",2712,"ghagurmukhi",2584,"ghainarabic",1594,"ghainfinalarabic",65230,"ghaininitialarabic",65231,"ghainmedialarabic",65232,"ghemiddlehookcyrillic",1173,"ghestrokecyrillic",1171,"gheupturncyrillic",1169,"ghhadeva",2394,"ghhagurmukhi",2650,"ghook",608,"ghzsquare",13203,"gihiragana",12366,"gikatakana",12462,"gimarmenian",1379,"gimel",1490,"gimeldagesh",64306,"gimeldageshhebrew",64306,"gimelhebrew",1490,"gjecyrillic",1107,"glottalinvertedstroke",446,"glottalstop",660,"glottalstopinverted",662,"glottalstopmod",704,"glottalstopreversed",661,"glottalstopreversedmod",705,"glottalstopreversedsuperior",740,"glottalstopstroke",673,"glottalstopstrokereversed",674,"gmacron",7713,"gmonospace",65351,"gohiragana",12372,"gokatakana",12468,"gparen",9378,"gpasquare",13228,"gradient",8711,"grave",96,"gravebelowcmb",790,"gravecmb",768,"gravecomb",768,"gravedeva",2387,"gravelowmod",718,"gravemonospace",65344,"gravetonecmb",832,"greater",62,"greaterequal",8805,"greaterequalorless",8923,"greatermonospace",65310,"greaterorequivalent",8819,"greaterorless",8823,"greateroverequal",8807,"greatersmall",65125,"gscript",609,"gstroke",485,"guhiragana",12368,"guillemotleft",171,"guillemotright",187,"guilsinglleft",8249,"guilsinglright",8250,"gukatakana",12464,"guramusquare",13080,"gysquare",13257,"h",104,"haabkhasiancyrillic",1193,"haaltonearabic",1729,"habengali",2489,"hadescendercyrillic",1203,"hadeva",2361,"hagujarati",2745,"hagurmukhi",2617,"haharabic",1581,"hahfinalarabic",65186,"hahinitialarabic",65187,"hahiragana",12399,"hahmedialarabic",65188,"haitusquare",13098,"hakatakana",12495,"hakatakanahalfwidth",65418,"halantgurmukhi",2637,"hamzaarabic",1569,"hamzalowarabic",1569,"hangulfiller",12644,"hardsigncyrillic",1098,"harpoonleftbarbup",8636,"harpoonrightbarbup",8640,"hasquare",13258,"hatafpatah",1458,"hatafpatah16",1458,"hatafpatah23",1458,"hatafpatah2f",1458,"hatafpatahhebrew",1458,"hatafpatahnarrowhebrew",1458,"hatafpatahquarterhebrew",1458,"hatafpatahwidehebrew",1458,"hatafqamats",1459,"hatafqamats1b",1459,"hatafqamats28",1459,"hatafqamats34",1459,"hatafqamatshebrew",1459,"hatafqamatsnarrowhebrew",1459,"hatafqamatsquarterhebrew",1459,"hatafqamatswidehebrew",1459,"hatafsegol",1457,"hatafsegol17",1457,"hatafsegol24",1457,"hatafsegol30",1457,"hatafsegolhebrew",1457,"hatafsegolnarrowhebrew",1457,"hatafsegolquarterhebrew",1457,"hatafsegolwidehebrew",1457,"hbar",295,"hbopomofo",12559,"hbrevebelow",7723,"hcedilla",7721,"hcircle",9431,"hcircumflex",293,"hdieresis",7719,"hdotaccent",7715,"hdotbelow",7717,"he",1492,"heart",9829,"heartsuitblack",9829,"heartsuitwhite",9825,"hedagesh",64308,"hedageshhebrew",64308,"hehaltonearabic",1729,"heharabic",1607,"hehebrew",1492,"hehfinalaltonearabic",64423,"hehfinalalttwoarabic",65258,"hehfinalarabic",65258,"hehhamzaabovefinalarabic",64421,"hehhamzaaboveisolatedarabic",64420,"hehinitialaltonearabic",64424,"hehinitialarabic",65259,"hehiragana",12408,"hehmedialaltonearabic",64425,"hehmedialarabic",65260,"heiseierasquare",13179,"hekatakana",12504,"hekatakanahalfwidth",65421,"hekutaarusquare",13110,"henghook",615,"herutusquare",13113,"het",1495,"hethebrew",1495,"hhook",614,"hhooksuperior",689,"hieuhacirclekorean",12923,"hieuhaparenkorean",12827,"hieuhcirclekorean",12909,"hieuhkorean",12622,"hieuhparenkorean",12813,"hihiragana",12402,"hikatakana",12498,"hikatakanahalfwidth",65419,"hiriq",1460,"hiriq14",1460,"hiriq21",1460,"hiriq2d",1460,"hiriqhebrew",1460,"hiriqnarrowhebrew",1460,"hiriqquarterhebrew",1460,"hiriqwidehebrew",1460,"hlinebelow",7830,"hmonospace",65352,"hoarmenian",1392,"hohipthai",3627,"hohiragana",12411,"hokatakana",12507,"hokatakanahalfwidth",65422,"holam",1465,"holam19",1465,"holam26",1465,"holam32",1465,"holamhebrew",1465,"holamnarrowhebrew",1465,"holamquarterhebrew",1465,"holamwidehebrew",1465,"honokhukthai",3630,"hookabovecomb",777,"hookcmb",777,"hookpalatalizedbelowcmb",801,"hookretroflexbelowcmb",802,"hoonsquare",13122,"horicoptic",1001,"horizontalbar",8213,"horncmb",795,"hotsprings",9832,"house",8962,"hparen",9379,"hsuperior",688,"hturned",613,"huhiragana",12405,"huiitosquare",13107,"hukatakana",12501,"hukatakanahalfwidth",65420,"hungarumlaut",733,"hungarumlautcmb",779,"hv",405,"hyphen",45,"hypheninferior",63205,"hyphenmonospace",65293,"hyphensmall",65123,"hyphensuperior",63206,"hyphentwo",8208,"i",105,"iacute",237,"iacyrillic",1103,"ibengali",2439,"ibopomofo",12583,"ibreve",301,"icaron",464,"icircle",9432,"icircumflex",238,"icyrillic",1110,"idblgrave",521,"ideographearthcircle",12943,"ideographfirecircle",12939,"ideographicallianceparen",12863,"ideographiccallparen",12858,"ideographiccentrecircle",12965,"ideographicclose",12294,"ideographiccomma",12289,"ideographiccommaleft",65380,"ideographiccongratulationparen",12855,"ideographiccorrectcircle",12963,"ideographicearthparen",12847,"ideographicenterpriseparen",12861,"ideographicexcellentcircle",12957,"ideographicfestivalparen",12864,"ideographicfinancialcircle",12950,"ideographicfinancialparen",12854,"ideographicfireparen",12843,"ideographichaveparen",12850,"ideographichighcircle",12964,"ideographiciterationmark",12293,"ideographiclaborcircle",12952,"ideographiclaborparen",12856,"ideographicleftcircle",12967,"ideographiclowcircle",12966,"ideographicmedicinecircle",12969,"ideographicmetalparen",12846,"ideographicmoonparen",12842,"ideographicnameparen",12852,"ideographicperiod",12290,"ideographicprintcircle",12958,"ideographicreachparen",12867,"ideographicrepresentparen",12857,"ideographicresourceparen",12862,"ideographicrightcircle",12968,"ideographicsecretcircle",12953,"ideographicselfparen",12866,"ideographicsocietyparen",12851,"ideographicspace",12288,"ideographicspecialparen",12853,"ideographicstockparen",12849,"ideographicstudyparen",12859,"ideographicsunparen",12848,"ideographicsuperviseparen",12860,"ideographicwaterparen",12844,"ideographicwoodparen",12845,"ideographiczero",12295,"ideographmetalcircle",12942,"ideographmooncircle",12938,"ideographnamecircle",12948,"ideographsuncircle",12944,"ideographwatercircle",12940,"ideographwoodcircle",12941,"ideva",2311,"idieresis",239,"idieresisacute",7727,"idieresiscyrillic",1253,"idotbelow",7883,"iebrevecyrillic",1239,"iecyrillic",1077,"ieungacirclekorean",12917,"ieungaparenkorean",12821,"ieungcirclekorean",12903,"ieungkorean",12615,"ieungparenkorean",12807,"igrave",236,"igujarati",2695,"igurmukhi",2567,"ihiragana",12356,"ihookabove",7881,"iibengali",2440,"iicyrillic",1080,"iideva",2312,"iigujarati",2696,"iigurmukhi",2568,"iimatragurmukhi",2624,"iinvertedbreve",523,"iishortcyrillic",1081,"iivowelsignbengali",2496,"iivowelsigndeva",2368,"iivowelsigngujarati",2752,"ij",307,"ikatakana",12452,"ikatakanahalfwidth",65394,"ikorean",12643,"ilde",732,"iluyhebrew",1452,"imacron",299,"imacroncyrillic",1251,"imageorapproximatelyequal",8787,"imatragurmukhi",2623,"imonospace",65353,"increment",8710,"infinity",8734,"iniarmenian",1387,"integral",8747,"integralbottom",8993,"integralbt",8993,"integralex",63733,"integraltop",8992,"integraltp",8992,"intersection",8745,"intisquare",13061,"invbullet",9688,"invcircle",9689,"invsmileface",9787,"iocyrillic",1105,"iogonek",303,"iota",953,"iotadieresis",970,"iotadieresistonos",912,"iotalatin",617,"iotatonos",943,"iparen",9380,"irigurmukhi",2674,"ismallhiragana",12355,"ismallkatakana",12451,"ismallkatakanahalfwidth",65384,"issharbengali",2554,"istroke",616,"isuperior",63213,"iterationhiragana",12445,"iterationkatakana",12541,"itilde",297,"itildebelow",7725,"iubopomofo",12585,"iucyrillic",1102,"ivowelsignbengali",2495,"ivowelsigndeva",2367,"ivowelsigngujarati",2751,"izhitsacyrillic",1141,"izhitsadblgravecyrillic",1143,"j",106,"jaarmenian",1393,"jabengali",2460,"jadeva",2332,"jagujarati",2716,"jagurmukhi",2588,"jbopomofo",12560,"jcaron",496,"jcircle",9433,"jcircumflex",309,"jcrossedtail",669,"jdotlessstroke",607,"jecyrillic",1112,"jeemarabic",1580,"jeemfinalarabic",65182,"jeeminitialarabic",65183,"jeemmedialarabic",65184,"jeharabic",1688,"jehfinalarabic",64395,"jhabengali",2461,"jhadeva",2333,"jhagujarati",2717,"jhagurmukhi",2589,"jheharmenian",1403,"jis",12292,"jmonospace",65354,"jparen",9381,"jsuperior",690,"k",107,"kabashkircyrillic",1185,"kabengali",2453,"kacute",7729,"kacyrillic",1082,"kadescendercyrillic",1179,"kadeva",2325,"kaf",1499,"kafarabic",1603,"kafdagesh",64315,"kafdageshhebrew",64315,"kaffinalarabic",65242,"kafhebrew",1499,"kafinitialarabic",65243,"kafmedialarabic",65244,"kafrafehebrew",64333,"kagujarati",2709,"kagurmukhi",2581,"kahiragana",12363,"kahookcyrillic",1220,"kakatakana",12459,"kakatakanahalfwidth",65398,"kappa",954,"kappasymbolgreek",1008,"kapyeounmieumkorean",12657,"kapyeounphieuphkorean",12676,"kapyeounpieupkorean",12664,"kapyeounssangpieupkorean",12665,"karoriisquare",13069,"kashidaautoarabic",1600,"kashidaautonosidebearingarabic",1600,"kasmallkatakana",12533,"kasquare",13188,"kasraarabic",1616,"kasratanarabic",1613,"kastrokecyrillic",1183,"katahiraprolongmarkhalfwidth",65392,"kaverticalstrokecyrillic",1181,"kbopomofo",12558,"kcalsquare",13193,"kcaron",489,"kcedilla",311,"kcircle",9434,"kcommaaccent",311,"kdotbelow",7731,"keharmenian",1412,"kehiragana",12369,"kekatakana",12465,"kekatakanahalfwidth",65401,"kenarmenian",1391,"kesmallkatakana",12534,"kgreenlandic",312,"khabengali",2454,"khacyrillic",1093,"khadeva",2326,"khagujarati",2710,"khagurmukhi",2582,"khaharabic",1582,"khahfinalarabic",65190,"khahinitialarabic",65191,"khahmedialarabic",65192,"kheicoptic",999,"khhadeva",2393,"khhagurmukhi",2649,"khieukhacirclekorean",12920,"khieukhaparenkorean",12824,"khieukhcirclekorean",12906,"khieukhkorean",12619,"khieukhparenkorean",12810,"khokhaithai",3586,"khokhonthai",3589,"khokhuatthai",3587,"khokhwaithai",3588,"khomutthai",3675,"khook",409,"khorakhangthai",3590,"khzsquare",13201,"kihiragana",12365,"kikatakana",12461,"kikatakanahalfwidth",65399,"kiroguramusquare",13077,"kiromeetorusquare",13078,"kirosquare",13076,"kiyeokacirclekorean",12910,"kiyeokaparenkorean",12814,"kiyeokcirclekorean",12896,"kiyeokkorean",12593,"kiyeokparenkorean",12800,"kiyeoksioskorean",12595,"kjecyrillic",1116,"klinebelow",7733,"klsquare",13208,"kmcubedsquare",13222,"kmonospace",65355,"kmsquaredsquare",13218,"kohiragana",12371,"kohmsquare",13248,"kokaithai",3585,"kokatakana",12467,"kokatakanahalfwidth",65402,"kooposquare",13086,"koppacyrillic",1153,"koreanstandardsymbol",12927,"koroniscmb",835,"kparen",9382,"kpasquare",13226,"ksicyrillic",1135,"ktsquare",13263,"kturned",670,"kuhiragana",12367,"kukatakana",12463,"kukatakanahalfwidth",65400,"kvsquare",13240,"kwsquare",13246,"l",108,"labengali",2482,"lacute",314,"ladeva",2354,"lagujarati",2738,"lagurmukhi",2610,"lakkhangyaothai",3653,"lamaleffinalarabic",65276,"lamalefhamzaabovefinalarabic",65272,"lamalefhamzaaboveisolatedarabic",65271,"lamalefhamzabelowfinalarabic",65274,"lamalefhamzabelowisolatedarabic",65273,"lamalefisolatedarabic",65275,"lamalefmaddaabovefinalarabic",65270,"lamalefmaddaaboveisolatedarabic",65269,"lamarabic",1604,"lambda",955,"lambdastroke",411,"lamed",1500,"lameddagesh",64316,"lameddageshhebrew",64316,"lamedhebrew",1500,"lamfinalarabic",65246,"lamhahinitialarabic",64714,"laminitialarabic",65247,"lamjeeminitialarabic",64713,"lamkhahinitialarabic",64715,"lamlamhehisolatedarabic",65010,"lammedialarabic",65248,"lammeemhahinitialarabic",64904,"lammeeminitialarabic",64716,"largecircle",9711,"lbar",410,"lbelt",620,"lbopomofo",12556,"lcaron",318,"lcedilla",316,"lcircle",9435,"lcircumflexbelow",7741,"lcommaaccent",316,"ldot",320,"ldotaccent",320,"ldotbelow",7735,"ldotbelowmacron",7737,"leftangleabovecmb",794,"lefttackbelowcmb",792,"less",60,"lessequal",8804,"lessequalorgreater",8922,"lessmonospace",65308,"lessorequivalent",8818,"lessorgreater",8822,"lessoverequal",8806,"lesssmall",65124,"lezh",622,"lfblock",9612,"lhookretroflex",621,"lira",8356,"liwnarmenian",1388,"lj",457,"ljecyrillic",1113,"ll",63168,"lladeva",2355,"llagujarati",2739,"llinebelow",7739,"llladeva",2356,"llvocalicbengali",2529,"llvocalicdeva",2401,"llvocalicvowelsignbengali",2531,"llvocalicvowelsigndeva",2403,"lmiddletilde",619,"lmonospace",65356,"lmsquare",13264,"lochulathai",3628,"logicaland",8743,"logicalnot",172,"logicalnotreversed",8976,"logicalor",8744,"lolingthai",3621,"longs",383,"lowlinecenterline",65102,"lowlinecmb",818,"lowlinedashed",65101,"lozenge",9674,"lparen",9383,"lslash",322,"lsquare",8467,"lsuperior",63214,"ltshade",9617,"luthai",3622,"lvocalicbengali",2444,"lvocalicdeva",2316,"lvocalicvowelsignbengali",2530,"lvocalicvowelsigndeva",2402,"lxsquare",13267,"m",109,"mabengali",2478,"macron",175,"macronbelowcmb",817,"macroncmb",772,"macronlowmod",717,"macronmonospace",65507,"macute",7743,"madeva",2350,"magujarati",2734,"magurmukhi",2606,"mahapakhhebrew",1444,"mahapakhlefthebrew",1444,"mahiragana",12414,"maichattawalowleftthai",63637,"maichattawalowrightthai",63636,"maichattawathai",3659,"maichattawaupperleftthai",63635,"maieklowleftthai",63628,"maieklowrightthai",63627,"maiekthai",3656,"maiekupperleftthai",63626,"maihanakatleftthai",63620,"maihanakatthai",3633,"maitaikhuleftthai",63625,"maitaikhuthai",3655,"maitholowleftthai",63631,"maitholowrightthai",63630,"maithothai",3657,"maithoupperleftthai",63629,"maitrilowleftthai",63634,"maitrilowrightthai",63633,"maitrithai",3658,"maitriupperleftthai",63632,"maiyamokthai",3654,"makatakana",12510,"makatakanahalfwidth",65423,"male",9794,"mansyonsquare",13127,"maqafhebrew",1470,"mars",9794,"masoracirclehebrew",1455,"masquare",13187,"mbopomofo",12551,"mbsquare",13268,"mcircle",9436,"mcubedsquare",13221,"mdotaccent",7745,"mdotbelow",7747,"meemarabic",1605,"meemfinalarabic",65250,"meeminitialarabic",65251,"meemmedialarabic",65252,"meemmeeminitialarabic",64721,"meemmeemisolatedarabic",64584,"meetorusquare",13133,"mehiragana",12417,"meizierasquare",13182,"mekatakana",12513,"mekatakanahalfwidth",65426,"mem",1502,"memdagesh",64318,"memdageshhebrew",64318,"memhebrew",1502,"menarmenian",1396,"merkhahebrew",1445,"merkhakefulahebrew",1446,"merkhakefulalefthebrew",1446,"merkhalefthebrew",1445,"mhook",625,"mhzsquare",13202,"middledotkatakanahalfwidth",65381,"middot",183,"mieumacirclekorean",12914,"mieumaparenkorean",12818,"mieumcirclekorean",12900,"mieumkorean",12609,"mieumpansioskorean",12656,"mieumparenkorean",12804,"mieumpieupkorean",12654,"mieumsioskorean",12655,"mihiragana",12415,"mikatakana",12511,"mikatakanahalfwidth",65424,"minus",8722,"minusbelowcmb",800,"minuscircle",8854,"minusmod",727,"minusplus",8723,"minute",8242,"miribaarusquare",13130,"mirisquare",13129,"mlonglegturned",624,"mlsquare",13206,"mmcubedsquare",13219,"mmonospace",65357,"mmsquaredsquare",13215,"mohiragana",12418,"mohmsquare",13249,"mokatakana",12514,"mokatakanahalfwidth",65427,"molsquare",13270,"momathai",3617,"moverssquare",13223,"moverssquaredsquare",13224,"mparen",9384,"mpasquare",13227,"mssquare",13235,"msuperior",63215,"mturned",623,"mu",181,"mu1",181,"muasquare",13186,"muchgreater",8811,"muchless",8810,"mufsquare",13196,"mugreek",956,"mugsquare",13197,"muhiragana",12416,"mukatakana",12512,"mukatakanahalfwidth",65425,"mulsquare",13205,"multiply",215,"mumsquare",13211,"munahhebrew",1443,"munahlefthebrew",1443,"musicalnote",9834,"musicalnotedbl",9835,"musicflatsign",9837,"musicsharpsign",9839,"mussquare",13234,"muvsquare",13238,"muwsquare",13244,"mvmegasquare",13241,"mvsquare",13239,"mwmegasquare",13247,"mwsquare",13245,"n",110,"nabengali",2472,"nabla",8711,"nacute",324,"nadeva",2344,"nagujarati",2728,"nagurmukhi",2600,"nahiragana",12394,"nakatakana",12490,"nakatakanahalfwidth",65413,"napostrophe",329,"nasquare",13185,"nbopomofo",12555,"nbspace",160,"ncaron",328,"ncedilla",326,"ncircle",9437,"ncircumflexbelow",7755,"ncommaaccent",326,"ndotaccent",7749,"ndotbelow",7751,"nehiragana",12397,"nekatakana",12493,"nekatakanahalfwidth",65416,"newsheqelsign",8362,"nfsquare",13195,"ngabengali",2457,"ngadeva",2329,"ngagujarati",2713,"ngagurmukhi",2585,"ngonguthai",3591,"nhiragana",12435,"nhookleft",626,"nhookretroflex",627,"nieunacirclekorean",12911,"nieunaparenkorean",12815,"nieuncieuckorean",12597,"nieuncirclekorean",12897,"nieunhieuhkorean",12598,"nieunkorean",12596,"nieunpansioskorean",12648,"nieunparenkorean",12801,"nieunsioskorean",12647,"nieuntikeutkorean",12646,"nihiragana",12395,"nikatakana",12491,"nikatakanahalfwidth",65414,"nikhahitleftthai",63641,"nikhahitthai",3661,"nine",57,"ninearabic",1641,"ninebengali",2543,"ninecircle",9320,"ninecircleinversesansserif",10130,"ninedeva",2415,"ninegujarati",2799,"ninegurmukhi",2671,"ninehackarabic",1641,"ninehangzhou",12329,"nineideographicparen",12840,"nineinferior",8329,"ninemonospace",65305,"nineoldstyle",63289,"nineparen",9340,"nineperiod",9360,"ninepersian",1785,"nineroman",8568,"ninesuperior",8313,"nineteencircle",9330,"nineteenparen",9350,"nineteenperiod",9370,"ninethai",3673,"nj",460,"njecyrillic",1114,"nkatakana",12531,"nkatakanahalfwidth",65437,"nlegrightlong",414,"nlinebelow",7753,"nmonospace",65358,"nmsquare",13210,"nnabengali",2467,"nnadeva",2339,"nnagujarati",2723,"nnagurmukhi",2595,"nnnadeva",2345,"nohiragana",12398,"nokatakana",12494,"nokatakanahalfwidth",65417,"nonbreakingspace",160,"nonenthai",3603,"nonuthai",3609,"noonarabic",1606,"noonfinalarabic",65254,"noonghunnaarabic",1722,"noonghunnafinalarabic",64415,"nooninitialarabic",65255,"noonjeeminitialarabic",64722,"noonjeemisolatedarabic",64587,"noonmedialarabic",65256,"noonmeeminitialarabic",64725,"noonmeemisolatedarabic",64590,"noonnoonfinalarabic",64653,"notcontains",8716,"notelement",8713,"notelementof",8713,"notequal",8800,"notgreater",8815,"notgreaternorequal",8817,"notgreaternorless",8825,"notidentical",8802,"notless",8814,"notlessnorequal",8816,"notparallel",8742,"notprecedes",8832,"notsubset",8836,"notsucceeds",8833,"notsuperset",8837,"nowarmenian",1398,"nparen",9385,"nssquare",13233,"nsuperior",8319,"ntilde",241,"nu",957,"nuhiragana",12396,"nukatakana",12492,"nukatakanahalfwidth",65415,"nuktabengali",2492,"nuktadeva",2364,"nuktagujarati",2748,"nuktagurmukhi",2620,"numbersign",35,"numbersignmonospace",65283,"numbersignsmall",65119,"numeralsigngreek",884,"numeralsignlowergreek",885,"numero",8470,"nun",1504,"nundagesh",64320,"nundageshhebrew",64320,"nunhebrew",1504,"nvsquare",13237,"nwsquare",13243,"nyabengali",2462,"nyadeva",2334,"nyagujarati",2718,"nyagurmukhi",2590,"o",111,"oacute",243,"oangthai",3629,"obarred",629,"obarredcyrillic",1257,"obarreddieresiscyrillic",1259,"obengali",2451,"obopomofo",12571,"obreve",335,"ocandradeva",2321,"ocandragujarati",2705,"ocandravowelsigndeva",2377,"ocandravowelsigngujarati",2761,"ocaron",466,"ocircle",9438,"ocircumflex",244,"ocircumflexacute",7889,"ocircumflexdotbelow",7897,"ocircumflexgrave",7891,"ocircumflexhookabove",7893,"ocircumflextilde",7895,"ocyrillic",1086,"odblacute",337,"odblgrave",525,"odeva",2323,"odieresis",246,"odieresiscyrillic",1255,"odotbelow",7885,"oe",339,"oekorean",12634,"ogonek",731,"ogonekcmb",808,"ograve",242,"ogujarati",2707,"oharmenian",1413,"ohiragana",12362,"ohookabove",7887,"ohorn",417,"ohornacute",7899,"ohorndotbelow",7907,"ohorngrave",7901,"ohornhookabove",7903,"ohorntilde",7905,"ohungarumlaut",337,"oi",419,"oinvertedbreve",527,"okatakana",12458,"okatakanahalfwidth",65397,"okorean",12631,"olehebrew",1451,"omacron",333,"omacronacute",7763,"omacrongrave",7761,"omdeva",2384,"omega",969,"omega1",982,"omegacyrillic",1121,"omegalatinclosed",631,"omegaroundcyrillic",1147,"omegatitlocyrillic",1149,"omegatonos",974,"omgujarati",2768,"omicron",959,"omicrontonos",972,"omonospace",65359,"one",49,"onearabic",1633,"onebengali",2535,"onecircle",9312,"onecircleinversesansserif",10122,"onedeva",2407,"onedotenleader",8228,"oneeighth",8539,"onefitted",63196,"onegujarati",2791,"onegurmukhi",2663,"onehackarabic",1633,"onehalf",189,"onehangzhou",12321,"oneideographicparen",12832,"oneinferior",8321,"onemonospace",65297,"onenumeratorbengali",2548,"oneoldstyle",63281,"oneparen",9332,"oneperiod",9352,"onepersian",1777,"onequarter",188,"oneroman",8560,"onesuperior",185,"onethai",3665,"onethird",8531,"oogonek",491,"oogonekmacron",493,"oogurmukhi",2579,"oomatragurmukhi",2635,"oopen",596,"oparen",9386,"openbullet",9702,"option",8997,"ordfeminine",170,"ordmasculine",186,"orthogonal",8735,"oshortdeva",2322,"oshortvowelsigndeva",2378,"oslash",248,"oslashacute",511,"osmallhiragana",12361,"osmallkatakana",12457,"osmallkatakanahalfwidth",65387,"ostrokeacute",511,"osuperior",63216,"otcyrillic",1151,"otilde",245,"otildeacute",7757,"otildedieresis",7759,"oubopomofo",12577,"overline",8254,"overlinecenterline",65098,"overlinecmb",773,"overlinedashed",65097,"overlinedblwavy",65100,"overlinewavy",65099,"overscore",175,"ovowelsignbengali",2507,"ovowelsigndeva",2379,"ovowelsigngujarati",2763,"p",112,"paampssquare",13184,"paasentosquare",13099,"pabengali",2474,"pacute",7765,"padeva",2346,"pagedown",8671,"pageup",8670,"pagujarati",2730,"pagurmukhi",2602,"pahiragana",12401,"paiyannoithai",3631,"pakatakana",12497,"palatalizationcyrilliccmb",1156,"palochkacyrillic",1216,"pansioskorean",12671,"paragraph",182,"parallel",8741,"parenleft",40,"parenleftaltonearabic",64830,"parenleftbt",63725,"parenleftex",63724,"parenleftinferior",8333,"parenleftmonospace",65288,"parenleftsmall",65113,"parenleftsuperior",8317,"parenlefttp",63723,"parenleftvertical",65077,"parenright",41,"parenrightaltonearabic",64831,"parenrightbt",63736,"parenrightex",63735,"parenrightinferior",8334,"parenrightmonospace",65289,"parenrightsmall",65114,"parenrightsuperior",8318,"parenrighttp",63734,"parenrightvertical",65078,"partialdiff",8706,"paseqhebrew",1472,"pashtahebrew",1433,"pasquare",13225,"patah",1463,"patah11",1463,"patah1d",1463,"patah2a",1463,"patahhebrew",1463,"patahnarrowhebrew",1463,"patahquarterhebrew",1463,"patahwidehebrew",1463,"pazerhebrew",1441,"pbopomofo",12550,"pcircle",9439,"pdotaccent",7767,"pe",1508,"pecyrillic",1087,"pedagesh",64324,"pedageshhebrew",64324,"peezisquare",13115,"pefinaldageshhebrew",64323,"peharabic",1662,"peharmenian",1402,"pehebrew",1508,"pehfinalarabic",64343,"pehinitialarabic",64344,"pehiragana",12410,"pehmedialarabic",64345,"pekatakana",12506,"pemiddlehookcyrillic",1191,"perafehebrew",64334,"percent",37,"percentarabic",1642,"percentmonospace",65285,"percentsmall",65130,"period",46,"periodarmenian",1417,"periodcentered",183,"periodhalfwidth",65377,"periodinferior",63207,"periodmonospace",65294,"periodsmall",65106,"periodsuperior",63208,"perispomenigreekcmb",834,"perpendicular",8869,"perthousand",8240,"peseta",8359,"pfsquare",13194,"phabengali",2475,"phadeva",2347,"phagujarati",2731,"phagurmukhi",2603,"phi",966,"phi1",981,"phieuphacirclekorean",12922,"phieuphaparenkorean",12826,"phieuphcirclekorean",12908,"phieuphkorean",12621,"phieuphparenkorean",12812,"philatin",632,"phinthuthai",3642,"phisymbolgreek",981,"phook",421,"phophanthai",3614,"phophungthai",3612,"phosamphaothai",3616,"pi",960,"pieupacirclekorean",12915,"pieupaparenkorean",12819,"pieupcieuckorean",12662,"pieupcirclekorean",12901,"pieupkiyeokkorean",12658,"pieupkorean",12610,"pieupparenkorean",12805,"pieupsioskiyeokkorean",12660,"pieupsioskorean",12612,"pieupsiostikeutkorean",12661,"pieupthieuthkorean",12663,"pieuptikeutkorean",12659,"pihiragana",12404,"pikatakana",12500,"pisymbolgreek",982,"piwrarmenian",1411,"plus",43,"plusbelowcmb",799,"pluscircle",8853,"plusminus",177,"plusmod",726,"plusmonospace",65291,"plussmall",65122,"plussuperior",8314,"pmonospace",65360,"pmsquare",13272,"pohiragana",12413,"pointingindexdownwhite",9759,"pointingindexleftwhite",9756,"pointingindexrightwhite",9758,"pointingindexupwhite",9757,"pokatakana",12509,"poplathai",3611,"postalmark",12306,"postalmarkface",12320,"pparen",9387,"precedes",8826,"prescription",8478,"primemod",697,"primereversed",8245,"product",8719,"projective",8965,"prolongedkana",12540,"propellor",8984,"propersubset",8834,"propersuperset",8835,"proportion",8759,"proportional",8733,"psi",968,"psicyrillic",1137,"psilipneumatacyrilliccmb",1158,"pssquare",13232,"puhiragana",12407,"pukatakana",12503,"pvsquare",13236,"pwsquare",13242,"q",113,"qadeva",2392,"qadmahebrew",1448,"qafarabic",1602,"qaffinalarabic",65238,"qafinitialarabic",65239,"qafmedialarabic",65240,"qamats",1464,"qamats10",1464,"qamats1a",1464,"qamats1c",1464,"qamats27",1464,"qamats29",1464,"qamats33",1464,"qamatsde",1464,"qamatshebrew",1464,"qamatsnarrowhebrew",1464,"qamatsqatanhebrew",1464,"qamatsqatannarrowhebrew",1464,"qamatsqatanquarterhebrew",1464,"qamatsqatanwidehebrew",1464,"qamatsquarterhebrew",1464,"qamatswidehebrew",1464,"qarneyparahebrew",1439,"qbopomofo",12561,"qcircle",9440,"qhook",672,"qmonospace",65361,"qof",1511,"qofdagesh",64327,"qofdageshhebrew",64327,"qofhebrew",1511,"qparen",9388,"quarternote",9833,"qubuts",1467,"qubuts18",1467,"qubuts25",1467,"qubuts31",1467,"qubutshebrew",1467,"qubutsnarrowhebrew",1467,"qubutsquarterhebrew",1467,"qubutswidehebrew",1467,"question",63,"questionarabic",1567,"questionarmenian",1374,"questiondown",191,"questiondownsmall",63423,"questiongreek",894,"questionmonospace",65311,"questionsmall",63295,"quotedbl",34,"quotedblbase",8222,"quotedblleft",8220,"quotedblmonospace",65282,"quotedblprime",12318,"quotedblprimereversed",12317,"quotedblright",8221,"quoteleft",8216,"quoteleftreversed",8219,"quotereversed",8219,"quoteright",8217,"quoterightn",329,"quotesinglbase",8218,"quotesingle",39,"quotesinglemonospace",65287,"r",114,"raarmenian",1404,"rabengali",2480,"racute",341,"radeva",2352,"radical",8730,"radicalex",63717,"radoverssquare",13230,"radoverssquaredsquare",13231,"radsquare",13229,"rafe",1471,"rafehebrew",1471,"ragujarati",2736,"ragurmukhi",2608,"rahiragana",12425,"rakatakana",12521,"rakatakanahalfwidth",65431,"ralowerdiagonalbengali",2545,"ramiddlediagonalbengali",2544,"ramshorn",612,"ratio",8758,"rbopomofo",12566,"rcaron",345,"rcedilla",343,"rcircle",9441,"rcommaaccent",343,"rdblgrave",529,"rdotaccent",7769,"rdotbelow",7771,"rdotbelowmacron",7773,"referencemark",8251,"reflexsubset",8838,"reflexsuperset",8839,"registered",174,"registersans",63720,"registerserif",63194,"reharabic",1585,"reharmenian",1408,"rehfinalarabic",65198,"rehiragana",12428,"rekatakana",12524,"rekatakanahalfwidth",65434,"resh",1512,"reshdageshhebrew",64328,"reshhebrew",1512,"reversedtilde",8765,"reviahebrew",1431,"reviamugrashhebrew",1431,"revlogicalnot",8976,"rfishhook",638,"rfishhookreversed",639,"rhabengali",2525,"rhadeva",2397,"rho",961,"rhook",637,"rhookturned",635,"rhookturnedsuperior",693,"rhosymbolgreek",1009,"rhotichookmod",734,"rieulacirclekorean",12913,"rieulaparenkorean",12817,"rieulcirclekorean",12899,"rieulhieuhkorean",12608,"rieulkiyeokkorean",12602,"rieulkiyeoksioskorean",12649,"rieulkorean",12601,"rieulmieumkorean",12603,"rieulpansioskorean",12652,"rieulparenkorean",12803,"rieulphieuphkorean",12607,"rieulpieupkorean",12604,"rieulpieupsioskorean",12651,"rieulsioskorean",12605,"rieulthieuthkorean",12606,"rieultikeutkorean",12650,"rieulyeorinhieuhkorean",12653,"rightangle",8735,"righttackbelowcmb",793,"righttriangle",8895,"rihiragana",12426,"rikatakana",12522,"rikatakanahalfwidth",65432,"ring",730,"ringbelowcmb",805,"ringcmb",778,"ringhalfleft",703,"ringhalfleftarmenian",1369,"ringhalfleftbelowcmb",796,"ringhalfleftcentered",723,"ringhalfright",702,"ringhalfrightbelowcmb",825,"ringhalfrightcentered",722,"rinvertedbreve",531,"rittorusquare",13137,"rlinebelow",7775,"rlongleg",636,"rlonglegturned",634,"rmonospace",65362,"rohiragana",12429,"rokatakana",12525,"rokatakanahalfwidth",65435,"roruathai",3619,"rparen",9389,"rrabengali",2524,"rradeva",2353,"rragurmukhi",2652,"rreharabic",1681,"rrehfinalarabic",64397,"rrvocalicbengali",2528,"rrvocalicdeva",2400,"rrvocalicgujarati",2784,"rrvocalicvowelsignbengali",2500,"rrvocalicvowelsigndeva",2372,"rrvocalicvowelsigngujarati",2756,"rsuperior",63217,"rtblock",9616,"rturned",633,"rturnedsuperior",692,"ruhiragana",12427,"rukatakana",12523,"rukatakanahalfwidth",65433,"rupeemarkbengali",2546,"rupeesignbengali",2547,"rupiah",63197,"ruthai",3620,"rvocalicbengali",2443,"rvocalicdeva",2315,"rvocalicgujarati",2699,"rvocalicvowelsignbengali",2499,"rvocalicvowelsigndeva",2371,"rvocalicvowelsigngujarati",2755,"s",115,"sabengali",2488,"sacute",347,"sacutedotaccent",7781,"sadarabic",1589,"sadeva",2360,"sadfinalarabic",65210,"sadinitialarabic",65211,"sadmedialarabic",65212,"sagujarati",2744,"sagurmukhi",2616,"sahiragana",12373,"sakatakana",12469,"sakatakanahalfwidth",65403,"sallallahoualayhewasallamarabic",65018,"samekh",1505,"samekhdagesh",64321,"samekhdageshhebrew",64321,"samekhhebrew",1505,"saraaathai",3634,"saraaethai",3649,"saraaimaimalaithai",3652,"saraaimaimuanthai",3651,"saraamthai",3635,"saraathai",3632,"saraethai",3648,"saraiileftthai",63622,"saraiithai",3637,"saraileftthai",63621,"saraithai",3636,"saraothai",3650,"saraueeleftthai",63624,"saraueethai",3639,"saraueleftthai",63623,"sarauethai",3638,"sarauthai",3640,"sarauuthai",3641,"sbopomofo",12569,"scaron",353,"scarondotaccent",7783,"scedilla",351,"schwa",601,"schwacyrillic",1241,"schwadieresiscyrillic",1243,"schwahook",602,"scircle",9442,"scircumflex",349,"scommaaccent",537,"sdotaccent",7777,"sdotbelow",7779,"sdotbelowdotaccent",7785,"seagullbelowcmb",828,"second",8243,"secondtonechinese",714,"section",167,"seenarabic",1587,"seenfinalarabic",65202,"seeninitialarabic",65203,"seenmedialarabic",65204,"segol",1462,"segol13",1462,"segol1f",1462,"segol2c",1462,"segolhebrew",1462,"segolnarrowhebrew",1462,"segolquarterhebrew",1462,"segoltahebrew",1426,"segolwidehebrew",1462,"seharmenian",1405,"sehiragana",12379,"sekatakana",12475,"sekatakanahalfwidth",65406,"semicolon",59,"semicolonarabic",1563,"semicolonmonospace",65307,"semicolonsmall",65108,"semivoicedmarkkana",12444,"semivoicedmarkkanahalfwidth",65439,"sentisquare",13090,"sentosquare",13091,"seven",55,"sevenarabic",1639,"sevenbengali",2541,"sevencircle",9318,"sevencircleinversesansserif",10128,"sevendeva",2413,"seveneighths",8542,"sevengujarati",2797,"sevengurmukhi",2669,"sevenhackarabic",1639,"sevenhangzhou",12327,"sevenideographicparen",12838,"seveninferior",8327,"sevenmonospace",65303,"sevenoldstyle",63287,"sevenparen",9338,"sevenperiod",9358,"sevenpersian",1783,"sevenroman",8566,"sevensuperior",8311,"seventeencircle",9328,"seventeenparen",9348,"seventeenperiod",9368,"seventhai",3671,"sfthyphen",173,"shaarmenian",1399,"shabengali",2486,"shacyrillic",1096,"shaddaarabic",1617,"shaddadammaarabic",64609,"shaddadammatanarabic",64606,"shaddafathaarabic",64608,"shaddakasraarabic",64610,"shaddakasratanarabic",64607,"shade",9618,"shadedark",9619,"shadelight",9617,"shademedium",9618,"shadeva",2358,"shagujarati",2742,"shagurmukhi",2614,"shalshelethebrew",1427,"shbopomofo",12565,"shchacyrillic",1097,"sheenarabic",1588,"sheenfinalarabic",65206,"sheeninitialarabic",65207,"sheenmedialarabic",65208,"sheicoptic",995,"sheqel",8362,"sheqelhebrew",8362,"sheva",1456,"sheva115",1456,"sheva15",1456,"sheva22",1456,"sheva2e",1456,"shevahebrew",1456,"shevanarrowhebrew",1456,"shevaquarterhebrew",1456,"shevawidehebrew",1456,"shhacyrillic",1211,"shimacoptic",1005,"shin",1513,"shindagesh",64329,"shindageshhebrew",64329,"shindageshshindot",64300,"shindageshshindothebrew",64300,"shindageshsindot",64301,"shindageshsindothebrew",64301,"shindothebrew",1473,"shinhebrew",1513,"shinshindot",64298,"shinshindothebrew",64298,"shinsindot",64299,"shinsindothebrew",64299,"shook",642,"sigma",963,"sigma1",962,"sigmafinal",962,"sigmalunatesymbolgreek",1010,"sihiragana",12375,"sikatakana",12471,"sikatakanahalfwidth",65404,"siluqhebrew",1469,"siluqlefthebrew",1469,"similar",8764,"sindothebrew",1474,"siosacirclekorean",12916,"siosaparenkorean",12820,"sioscieuckorean",12670,"sioscirclekorean",12902,"sioskiyeokkorean",12666,"sioskorean",12613,"siosnieunkorean",12667,"siosparenkorean",12806,"siospieupkorean",12669,"siostikeutkorean",12668,"six",54,"sixarabic",1638,"sixbengali",2540,"sixcircle",9317,"sixcircleinversesansserif",10127,"sixdeva",2412,"sixgujarati",2796,"sixgurmukhi",2668,"sixhackarabic",1638,"sixhangzhou",12326,"sixideographicparen",12837,"sixinferior",8326,"sixmonospace",65302,"sixoldstyle",63286,"sixparen",9337,"sixperiod",9357,"sixpersian",1782,"sixroman",8565,"sixsuperior",8310,"sixteencircle",9327,"sixteencurrencydenominatorbengali",2553,"sixteenparen",9347,"sixteenperiod",9367,"sixthai",3670,"slash",47,"slashmonospace",65295,"slong",383,"slongdotaccent",7835,"smileface",9786,"smonospace",65363,"sofpasuqhebrew",1475,"softhyphen",173,"softsigncyrillic",1100,"sohiragana",12381,"sokatakana",12477,"sokatakanahalfwidth",65407,"soliduslongoverlaycmb",824,"solidusshortoverlaycmb",823,"sorusithai",3625,"sosalathai",3624,"sosothai",3595,"sosuathai",3626,"space",32,"spacehackarabic",32,"spade",9824,"spadesuitblack",9824,"spadesuitwhite",9828,"sparen",9390,"squarebelowcmb",827,"squarecc",13252,"squarecm",13213,"squarediagonalcrosshatchfill",9641,"squarehorizontalfill",9636,"squarekg",13199,"squarekm",13214,"squarekmcapital",13262,"squareln",13265,"squarelog",13266,"squaremg",13198,"squaremil",13269,"squaremm",13212,"squaremsquared",13217,"squareorthogonalcrosshatchfill",9638,"squareupperlefttolowerrightfill",9639,"squareupperrighttolowerleftfill",9640,"squareverticalfill",9637,"squarewhitewithsmallblack",9635,"srsquare",13275,"ssabengali",2487,"ssadeva",2359,"ssagujarati",2743,"ssangcieuckorean",12617,"ssanghieuhkorean",12677,"ssangieungkorean",12672,"ssangkiyeokkorean",12594,"ssangnieunkorean",12645,"ssangpieupkorean",12611,"ssangsioskorean",12614,"ssangtikeutkorean",12600,"ssuperior",63218,"sterling",163,"sterlingmonospace",65505,"strokelongoverlaycmb",822,"strokeshortoverlaycmb",821,"subset",8834,"subsetnotequal",8842,"subsetorequal",8838,"succeeds",8827,"suchthat",8715,"suhiragana",12377,"sukatakana",12473,"sukatakanahalfwidth",65405,"sukunarabic",1618,"summation",8721,"sun",9788,"superset",8835,"supersetnotequal",8843,"supersetorequal",8839,"svsquare",13276,"syouwaerasquare",13180,"t",116,"tabengali",2468,"tackdown",8868,"tackleft",8867,"tadeva",2340,"tagujarati",2724,"tagurmukhi",2596,"taharabic",1591,"tahfinalarabic",65218,"tahinitialarabic",65219,"tahiragana",12383,"tahmedialarabic",65220,"taisyouerasquare",13181,"takatakana",12479,"takatakanahalfwidth",65408,"tatweelarabic",1600,"tau",964,"tav",1514,"tavdages",64330,"tavdagesh",64330,"tavdageshhebrew",64330,"tavhebrew",1514,"tbar",359,"tbopomofo",12554,"tcaron",357,"tccurl",680,"tcedilla",355,"tcheharabic",1670,"tchehfinalarabic",64379,"tchehinitialarabic",64380,"tchehmedialarabic",64381,"tcircle",9443,"tcircumflexbelow",7793,"tcommaaccent",355,"tdieresis",7831,"tdotaccent",7787,"tdotbelow",7789,"tecyrillic",1090,"tedescendercyrillic",1197,"teharabic",1578,"tehfinalarabic",65174,"tehhahinitialarabic",64674,"tehhahisolatedarabic",64524,"tehinitialarabic",65175,"tehiragana",12390,"tehjeeminitialarabic",64673,"tehjeemisolatedarabic",64523,"tehmarbutaarabic",1577,"tehmarbutafinalarabic",65172,"tehmedialarabic",65176,"tehmeeminitialarabic",64676,"tehmeemisolatedarabic",64526,"tehnoonfinalarabic",64627,"tekatakana",12486,"tekatakanahalfwidth",65411,"telephone",8481,"telephoneblack",9742,"telishagedolahebrew",1440,"telishaqetanahebrew",1449,"tencircle",9321,"tenideographicparen",12841,"tenparen",9341,"tenperiod",9361,"tenroman",8569,"tesh",679,"tet",1496,"tetdagesh",64312,"tetdageshhebrew",64312,"tethebrew",1496,"tetsecyrillic",1205,"tevirhebrew",1435,"tevirlefthebrew",1435,"thabengali",2469,"thadeva",2341,"thagujarati",2725,"thagurmukhi",2597,"thalarabic",1584,"thalfinalarabic",65196,"thanthakhatlowleftthai",63640,"thanthakhatlowrightthai",63639,"thanthakhatthai",3660,"thanthakhatupperleftthai",63638,"theharabic",1579,"thehfinalarabic",65178,"thehinitialarabic",65179,"thehmedialarabic",65180,"thereexists",8707,"therefore",8756,"theta",952,"theta1",977,"thetasymbolgreek",977,"thieuthacirclekorean",12921,"thieuthaparenkorean",12825,"thieuthcirclekorean",12907,"thieuthkorean",12620,"thieuthparenkorean",12811,"thirteencircle",9324,"thirteenparen",9344,"thirteenperiod",9364,"thonangmonthothai",3601,"thook",429,"thophuthaothai",3602,"thorn",254,"thothahanthai",3607,"thothanthai",3600,"thothongthai",3608,"thothungthai",3606,"thousandcyrillic",1154,"thousandsseparatorarabic",1644,"thousandsseparatorpersian",1644,"three",51,"threearabic",1635,"threebengali",2537,"threecircle",9314,"threecircleinversesansserif",10124,"threedeva",2409,"threeeighths",8540,"threegujarati",2793,"threegurmukhi",2665,"threehackarabic",1635,"threehangzhou",12323,"threeideographicparen",12834,"threeinferior",8323,"threemonospace",65299,"threenumeratorbengali",2550,"threeoldstyle",63283,"threeparen",9334,"threeperiod",9354,"threepersian",1779,"threequarters",190,"threequartersemdash",63198,"threeroman",8562,"threesuperior",179,"threethai",3667,"thzsquare",13204,"tihiragana",12385,"tikatakana",12481,"tikatakanahalfwidth",65409,"tikeutacirclekorean",12912,"tikeutaparenkorean",12816,"tikeutcirclekorean",12898,"tikeutkorean",12599,"tikeutparenkorean",12802,"tilde",732,"tildebelowcmb",816,"tildecmb",771,"tildecomb",771,"tildedoublecmb",864,"tildeoperator",8764,"tildeoverlaycmb",820,"tildeverticalcmb",830,"timescircle",8855,"tipehahebrew",1430,"tipehalefthebrew",1430,"tippigurmukhi",2672,"titlocyrilliccmb",1155,"tiwnarmenian",1407,"tlinebelow",7791,"tmonospace",65364,"toarmenian",1385,"tohiragana",12392,"tokatakana",12488,"tokatakanahalfwidth",65412,"tonebarextrahighmod",741,"tonebarextralowmod",745,"tonebarhighmod",742,"tonebarlowmod",744,"tonebarmidmod",743,"tonefive",445,"tonesix",389,"tonetwo",424,"tonos",900,"tonsquare",13095,"topatakthai",3599,"tortoiseshellbracketleft",12308,"tortoiseshellbracketleftsmall",65117,"tortoiseshellbracketleftvertical",65081,"tortoiseshellbracketright",12309,"tortoiseshellbracketrightsmall",65118,"tortoiseshellbracketrightvertical",65082,"totaothai",3605,"tpalatalhook",427,"tparen",9391,"trademark",8482,"trademarksans",63722,"trademarkserif",63195,"tretroflexhook",648,"triagdn",9660,"triaglf",9668,"triagrt",9658,"triagup",9650,"ts",678,"tsadi",1510,"tsadidagesh",64326,"tsadidageshhebrew",64326,"tsadihebrew",1510,"tsecyrillic",1094,"tsere",1461,"tsere12",1461,"tsere1e",1461,"tsere2b",1461,"tserehebrew",1461,"tserenarrowhebrew",1461,"tserequarterhebrew",1461,"tserewidehebrew",1461,"tshecyrillic",1115,"tsuperior",63219,"ttabengali",2463,"ttadeva",2335,"ttagujarati",2719,"ttagurmukhi",2591,"tteharabic",1657,"ttehfinalarabic",64359,"ttehinitialarabic",64360,"ttehmedialarabic",64361,"tthabengali",2464,"tthadeva",2336,"tthagujarati",2720,"tthagurmukhi",2592,"tturned",647,"tuhiragana",12388,"tukatakana",12484,"tukatakanahalfwidth",65410,"tusmallhiragana",12387,"tusmallkatakana",12483,"tusmallkatakanahalfwidth",65391,"twelvecircle",9323,"twelveparen",9343,"twelveperiod",9363,"twelveroman",8571,"twentycircle",9331,"twentyhangzhou",21316,"twentyparen",9351,"twentyperiod",9371,"two",50,"twoarabic",1634,"twobengali",2536,"twocircle",9313,"twocircleinversesansserif",10123,"twodeva",2408,"twodotenleader",8229,"twodotleader",8229,"twodotleadervertical",65072,"twogujarati",2792,"twogurmukhi",2664,"twohackarabic",1634,"twohangzhou",12322,"twoideographicparen",12833,"twoinferior",8322,"twomonospace",65298,"twonumeratorbengali",2549,"twooldstyle",63282,"twoparen",9333,"twoperiod",9353,"twopersian",1778,"tworoman",8561,"twostroke",443,"twosuperior",178,"twothai",3666,"twothirds",8532,"u",117,"uacute",250,"ubar",649,"ubengali",2441,"ubopomofo",12584,"ubreve",365,"ucaron",468,"ucircle",9444,"ucircumflex",251,"ucircumflexbelow",7799,"ucyrillic",1091,"udattadeva",2385,"udblacute",369,"udblgrave",533,"udeva",2313,"udieresis",252,"udieresisacute",472,"udieresisbelow",7795,"udieresiscaron",474,"udieresiscyrillic",1265,"udieresisgrave",476,"udieresismacron",470,"udotbelow",7909,"ugrave",249,"ugujarati",2697,"ugurmukhi",2569,"uhiragana",12358,"uhookabove",7911,"uhorn",432,"uhornacute",7913,"uhorndotbelow",7921,"uhorngrave",7915,"uhornhookabove",7917,"uhorntilde",7919,"uhungarumlaut",369,"uhungarumlautcyrillic",1267,"uinvertedbreve",535,"ukatakana",12454,"ukatakanahalfwidth",65395,"ukcyrillic",1145,"ukorean",12636,"umacron",363,"umacroncyrillic",1263,"umacrondieresis",7803,"umatragurmukhi",2625,"umonospace",65365,"underscore",95,"underscoredbl",8215,"underscoremonospace",65343,"underscorevertical",65075,"underscorewavy",65103,"union",8746,"universal",8704,"uogonek",371,"uparen",9392,"upblock",9600,"upperdothebrew",1476,"upsilon",965,"upsilondieresis",971,"upsilondieresistonos",944,"upsilonlatin",650,"upsilontonos",973,"uptackbelowcmb",797,"uptackmod",724,"uragurmukhi",2675,"uring",367,"ushortcyrillic",1118,"usmallhiragana",12357,"usmallkatakana",12453,"usmallkatakanahalfwidth",65385,"ustraightcyrillic",1199,"ustraightstrokecyrillic",1201,"utilde",361,"utildeacute",7801,"utildebelow",7797,"uubengali",2442,"uudeva",2314,"uugujarati",2698,"uugurmukhi",2570,"uumatragurmukhi",2626,"uuvowelsignbengali",2498,"uuvowelsigndeva",2370,"uuvowelsigngujarati",2754,"uvowelsignbengali",2497,"uvowelsigndeva",2369,"uvowelsigngujarati",2753,"v",118,"vadeva",2357,"vagujarati",2741,"vagurmukhi",2613,"vakatakana",12535,"vav",1493,"vavdagesh",64309,"vavdagesh65",64309,"vavdageshhebrew",64309,"vavhebrew",1493,"vavholam",64331,"vavholamhebrew",64331,"vavvavhebrew",1520,"vavyodhebrew",1521,"vcircle",9445,"vdotbelow",7807,"vecyrillic",1074,"veharabic",1700,"vehfinalarabic",64363,"vehinitialarabic",64364,"vehmedialarabic",64365,"vekatakana",12537,"venus",9792,"verticalbar",124,"verticallineabovecmb",781,"verticallinebelowcmb",809,"verticallinelowmod",716,"verticallinemod",712,"vewarmenian",1406,"vhook",651,"vikatakana",12536,"viramabengali",2509,"viramadeva",2381,"viramagujarati",2765,"visargabengali",2435,"visargadeva",2307,"visargagujarati",2691,"vmonospace",65366,"voarmenian",1400,"voicediterationhiragana",12446,"voicediterationkatakana",12542,"voicedmarkkana",12443,"voicedmarkkanahalfwidth",65438,"vokatakana",12538,"vparen",9393,"vtilde",7805,"vturned",652,"vuhiragana",12436,"vukatakana",12532,"w",119,"wacute",7811,"waekorean",12633,"wahiragana",12431,"wakatakana",12527,"wakatakanahalfwidth",65436,"wakorean",12632,"wasmallhiragana",12430,"wasmallkatakana",12526,"wattosquare",13143,"wavedash",12316,"wavyunderscorevertical",65076,"wawarabic",1608,"wawfinalarabic",65262,"wawhamzaabovearabic",1572,"wawhamzaabovefinalarabic",65158,"wbsquare",13277,"wcircle",9446,"wcircumflex",373,"wdieresis",7813,"wdotaccent",7815,"wdotbelow",7817,"wehiragana",12433,"weierstrass",8472,"wekatakana",12529,"wekorean",12638,"weokorean",12637,"wgrave",7809,"whitebullet",9702,"whitecircle",9675,"whitecircleinverse",9689,"whitecornerbracketleft",12302,"whitecornerbracketleftvertical",65091,"whitecornerbracketright",12303,"whitecornerbracketrightvertical",65092,"whitediamond",9671,"whitediamondcontainingblacksmalldiamond",9672,"whitedownpointingsmalltriangle",9663,"whitedownpointingtriangle",9661,"whiteleftpointingsmalltriangle",9667,"whiteleftpointingtriangle",9665,"whitelenticularbracketleft",12310,"whitelenticularbracketright",12311,"whiterightpointingsmalltriangle",9657,"whiterightpointingtriangle",9655,"whitesmallsquare",9643,"whitesmilingface",9786,"whitesquare",9633,"whitestar",9734,"whitetelephone",9743,"whitetortoiseshellbracketleft",12312,"whitetortoiseshellbracketright",12313,"whiteuppointingsmalltriangle",9653,"whiteuppointingtriangle",9651,"wihiragana",12432,"wikatakana",12528,"wikorean",12639,"wmonospace",65367,"wohiragana",12434,"wokatakana",12530,"wokatakanahalfwidth",65382,"won",8361,"wonmonospace",65510,"wowaenthai",3623,"wparen",9394,"wring",7832,"wsuperior",695,"wturned",653,"wynn",447,"x",120,"xabovecmb",829,"xbopomofo",12562,"xcircle",9447,"xdieresis",7821,"xdotaccent",7819,"xeharmenian",1389,"xi",958,"xmonospace",65368,"xparen",9395,"xsuperior",739,"y",121,"yaadosquare",13134,"yabengali",2479,"yacute",253,"yadeva",2351,"yaekorean",12626,"yagujarati",2735,"yagurmukhi",2607,"yahiragana",12420,"yakatakana",12516,"yakatakanahalfwidth",65428,"yakorean",12625,"yamakkanthai",3662,"yasmallhiragana",12419,"yasmallkatakana",12515,"yasmallkatakanahalfwidth",65388,"yatcyrillic",1123,"ycircle",9448,"ycircumflex",375,"ydieresis",255,"ydotaccent",7823,"ydotbelow",7925,"yeharabic",1610,"yehbarreearabic",1746,"yehbarreefinalarabic",64431,"yehfinalarabic",65266,"yehhamzaabovearabic",1574,"yehhamzaabovefinalarabic",65162,"yehhamzaaboveinitialarabic",65163,"yehhamzaabovemedialarabic",65164,"yehinitialarabic",65267,"yehmedialarabic",65268,"yehmeeminitialarabic",64733,"yehmeemisolatedarabic",64600,"yehnoonfinalarabic",64660,"yehthreedotsbelowarabic",1745,"yekorean",12630,"yen",165,"yenmonospace",65509,"yeokorean",12629,"yeorinhieuhkorean",12678,"yerahbenyomohebrew",1450,"yerahbenyomolefthebrew",1450,"yericyrillic",1099,"yerudieresiscyrillic",1273,"yesieungkorean",12673,"yesieungpansioskorean",12675,"yesieungsioskorean",12674,"yetivhebrew",1434,"ygrave",7923,"yhook",436,"yhookabove",7927,"yiarmenian",1397,"yicyrillic",1111,"yikorean",12642,"yinyang",9775,"yiwnarmenian",1410,"ymonospace",65369,"yod",1497,"yoddagesh",64313,"yoddageshhebrew",64313,"yodhebrew",1497,"yodyodhebrew",1522,"yodyodpatahhebrew",64287,"yohiragana",12424,"yoikorean",12681,"yokatakana",12520,"yokatakanahalfwidth",65430,"yokorean",12635,"yosmallhiragana",12423,"yosmallkatakana",12519,"yosmallkatakanahalfwidth",65390,"yotgreek",1011,"yoyaekorean",12680,"yoyakorean",12679,"yoyakthai",3618,"yoyingthai",3597,"yparen",9396,"ypogegrammeni",890,"ypogegrammenigreekcmb",837,"yr",422,"yring",7833,"ysuperior",696,"ytilde",7929,"yturned",654,"yuhiragana",12422,"yuikorean",12684,"yukatakana",12518,"yukatakanahalfwidth",65429,"yukorean",12640,"yusbigcyrillic",1131,"yusbigiotifiedcyrillic",1133,"yuslittlecyrillic",1127,"yuslittleiotifiedcyrillic",1129,"yusmallhiragana",12421,"yusmallkatakana",12517,"yusmallkatakanahalfwidth",65389,"yuyekorean",12683,"yuyeokorean",12682,"yyabengali",2527,"yyadeva",2399,"z",122,"zaarmenian",1382,"zacute",378,"zadeva",2395,"zagurmukhi",2651,"zaharabic",1592,"zahfinalarabic",65222,"zahinitialarabic",65223,"zahiragana",12374,"zahmedialarabic",65224,"zainarabic",1586,"zainfinalarabic",65200,"zakatakana",12470,"zaqefgadolhebrew",1429,"zaqefqatanhebrew",1428,"zarqahebrew",1432,"zayin",1494,"zayindagesh",64310,"zayindageshhebrew",64310,"zayinhebrew",1494,"zbopomofo",12567,"zcaron",382,"zcircle",9449,"zcircumflex",7825,"zcurl",657,"zdot",380,"zdotaccent",380,"zdotbelow",7827,"zecyrillic",1079,"zedescendercyrillic",1177,"zedieresiscyrillic",1247,"zehiragana",12380,"zekatakana",12476,"zero",48,"zeroarabic",1632,"zerobengali",2534,"zerodeva",2406,"zerogujarati",2790,"zerogurmukhi",2662,"zerohackarabic",1632,"zeroinferior",8320,"zeromonospace",65296,"zerooldstyle",63280,"zeropersian",1776,"zerosuperior",8304,"zerothai",3664,"zerowidthjoiner",65279,"zerowidthnonjoiner",8204,"zerowidthspace",8203,"zeta",950,"zhbopomofo",12563,"zhearmenian",1386,"zhebrevecyrillic",1218,"zhecyrillic",1078,"zhedescendercyrillic",1175,"zhedieresiscyrillic",1245,"zihiragana",12376,"zikatakana",12472,"zinorhebrew",1454,"zlinebelow",7829,"zmonospace",65370,"zohiragana",12382,"zokatakana",12478,"zparen",9397,"zretroflexhook",656,"zstroke",438,"zuhiragana",12378,"zukatakana",12474,".notdef",0,"angbracketleftbig",9001,"angbracketleftBig",9001,"angbracketleftbigg",9001,"angbracketleftBigg",9001,"angbracketrightBig",9002,"angbracketrightbig",9002,"angbracketrightBigg",9002,"angbracketrightbigg",9002,"arrowhookleft",8618,"arrowhookright",8617,"arrowlefttophalf",8636,"arrowleftbothalf",8637,"arrownortheast",8599,"arrownorthwest",8598,"arrowrighttophalf",8640,"arrowrightbothalf",8641,"arrowsoutheast",8600,"arrowsouthwest",8601,"backslashbig",8726,"backslashBig",8726,"backslashBigg",8726,"backslashbigg",8726,"bardbl",8214,"bracehtipdownleft",65079,"bracehtipdownright",65079,"bracehtipupleft",65080,"bracehtipupright",65080,"braceleftBig",123,"braceleftbig",123,"braceleftbigg",123,"braceleftBigg",123,"bracerightBig",125,"bracerightbig",125,"bracerightbigg",125,"bracerightBigg",125,"bracketleftbig",91,"bracketleftBig",91,"bracketleftbigg",91,"bracketleftBigg",91,"bracketrightBig",93,"bracketrightbig",93,"bracketrightbigg",93,"bracketrightBigg",93,"ceilingleftbig",8968,"ceilingleftBig",8968,"ceilingleftBigg",8968,"ceilingleftbigg",8968,"ceilingrightbig",8969,"ceilingrightBig",8969,"ceilingrightbigg",8969,"ceilingrightBigg",8969,"circledotdisplay",8857,"circledottext",8857,"circlemultiplydisplay",8855,"circlemultiplytext",8855,"circleplusdisplay",8853,"circleplustext",8853,"contintegraldisplay",8750,"contintegraltext",8750,"coproductdisplay",8720,"coproducttext",8720,"floorleftBig",8970,"floorleftbig",8970,"floorleftbigg",8970,"floorleftBigg",8970,"floorrightbig",8971,"floorrightBig",8971,"floorrightBigg",8971,"floorrightbigg",8971,"hatwide",770,"hatwider",770,"hatwidest",770,"intercal",7488,"integraldisplay",8747,"integraltext",8747,"intersectiondisplay",8898,"intersectiontext",8898,"logicalanddisplay",8743,"logicalandtext",8743,"logicalordisplay",8744,"logicalortext",8744,"parenleftBig",40,"parenleftbig",40,"parenleftBigg",40,"parenleftbigg",40,"parenrightBig",41,"parenrightbig",41,"parenrightBigg",41,"parenrightbigg",41,"prime",8242,"productdisplay",8719,"producttext",8719,"radicalbig",8730,"radicalBig",8730,"radicalBigg",8730,"radicalbigg",8730,"radicalbt",8730,"radicaltp",8730,"radicalvertex",8730,"slashbig",47,"slashBig",47,"slashBigg",47,"slashbigg",47,"summationdisplay",8721,"summationtext",8721,"tildewide",732,"tildewider",732,"tildewidest",732,"uniondisplay",8899,"unionmultidisplay",8846,"unionmultitext",8846,"unionsqdisplay",8852,"unionsqtext",8852,"uniontext",8899,"vextenddouble",8741,"vextendsingle",8739]})),i=(0,r.getArrayLookupTableFactory)((function(){return["space",32,"a1",9985,"a2",9986,"a202",9987,"a3",9988,"a4",9742,"a5",9990,"a119",9991,"a118",9992,"a117",9993,"a11",9755,"a12",9758,"a13",9996,"a14",9997,"a15",9998,"a16",9999,"a105",1e4,"a17",10001,"a18",10002,"a19",10003,"a20",10004,"a21",10005,"a22",10006,"a23",10007,"a24",10008,"a25",10009,"a26",10010,"a27",10011,"a28",10012,"a6",10013,"a7",10014,"a8",10015,"a9",10016,"a10",10017,"a29",10018,"a30",10019,"a31",10020,"a32",10021,"a33",10022,"a34",10023,"a35",9733,"a36",10025,"a37",10026,"a38",10027,"a39",10028,"a40",10029,"a41",10030,"a42",10031,"a43",10032,"a44",10033,"a45",10034,"a46",10035,"a47",10036,"a48",10037,"a49",10038,"a50",10039,"a51",10040,"a52",10041,"a53",10042,"a54",10043,"a55",10044,"a56",10045,"a57",10046,"a58",10047,"a59",10048,"a60",10049,"a61",10050,"a62",10051,"a63",10052,"a64",10053,"a65",10054,"a66",10055,"a67",10056,"a68",10057,"a69",10058,"a70",10059,"a71",9679,"a72",10061,"a73",9632,"a74",10063,"a203",10064,"a75",10065,"a204",10066,"a76",9650,"a77",9660,"a78",9670,"a79",10070,"a81",9687,"a82",10072,"a83",10073,"a84",10074,"a97",10075,"a98",10076,"a99",10077,"a100",10078,"a101",10081,"a102",10082,"a103",10083,"a104",10084,"a106",10085,"a107",10086,"a108",10087,"a112",9827,"a111",9830,"a110",9829,"a109",9824,"a120",9312,"a121",9313,"a122",9314,"a123",9315,"a124",9316,"a125",9317,"a126",9318,"a127",9319,"a128",9320,"a129",9321,"a130",10102,"a131",10103,"a132",10104,"a133",10105,"a134",10106,"a135",10107,"a136",10108,"a137",10109,"a138",10110,"a139",10111,"a140",10112,"a141",10113,"a142",10114,"a143",10115,"a144",10116,"a145",10117,"a146",10118,"a147",10119,"a148",10120,"a149",10121,"a150",10122,"a151",10123,"a152",10124,"a153",10125,"a154",10126,"a155",10127,"a156",10128,"a157",10129,"a158",10130,"a159",10131,"a160",10132,"a161",8594,"a163",8596,"a164",8597,"a196",10136,"a165",10137,"a192",10138,"a166",10139,"a167",10140,"a168",10141,"a169",10142,"a170",10143,"a171",10144,"a172",10145,"a173",10146,"a162",10147,"a174",10148,"a175",10149,"a176",10150,"a177",10151,"a178",10152,"a179",10153,"a193",10154,"a180",10155,"a199",10156,"a181",10157,"a200",10158,"a182",10159,"a201",10161,"a183",10162,"a184",10163,"a197",10164,"a185",10165,"a194",10166,"a198",10167,"a186",10168,"a195",10169,"a187",10170,"a188",10171,"a189",10172,"a190",10173,"a191",10174,"a89",10088,"a90",10089,"a93",10090,"a94",10091,"a91",10092,"a92",10093,"a205",10094,"a85",10095,"a206",10096,"a86",10097,"a87",10098,"a88",10099,"a95",10100,"a96",10101,".notdef",0]}))},(e,t,a)=>{a.r(t);a.d(t,{clearUnicodeCaches:()=>clearUnicodeCaches,getCharUnicodeCategory:()=>getCharUnicodeCategory,getNormalizedUnicodes:()=>s,getUnicodeForGlyph:()=>getUnicodeForGlyph,getUnicodeRangeFor:()=>getUnicodeRangeFor,mapSpecialUnicodeValues:()=>mapSpecialUnicodeValues,reverseIfRtl:()=>reverseIfRtl});var r=a(3);const n=(0,r.getLookupTableFactory)((function(e){e[63721]=169;e[63193]=169;e[63720]=174;e[63194]=174;e[63722]=8482;e[63195]=8482;e[63729]=9127;e[63730]=9128;e[63731]=9129;e[63740]=9131;e[63741]=9132;e[63742]=9133;e[63726]=9121;e[63727]=9122;e[63728]=9123;e[63737]=9124;e[63738]=9125;e[63739]=9126;e[63723]=9115;e[63724]=9116;e[63725]=9117;e[63734]=9118;e[63735]=9119;e[63736]=9120}));function mapSpecialUnicodeValues(e){return e>=65520&&e<=65535?0:e>=62976&&e<=63743?n()[e]||e:173===e?45:e}function getUnicodeForGlyph(e,t){let a=t[e];if(void 0!==a)return a;if(!e)return-1;if("u"===e[0]){const t=e.length;let r;if(7===t&&"n"===e[1]&&"i"===e[2])r=e.substring(3);else{if(!(t>=5&&t<=7))return-1;r=e.substring(1)}if(r===r.toUpperCase()){a=parseInt(r,16);if(a>=0)return a}}return-1}const i=[{begin:0,end:127},{begin:128,end:255},{begin:256,end:383},{begin:384,end:591},{begin:592,end:687},{begin:688,end:767},{begin:768,end:879},{begin:880,end:1023},{begin:11392,end:11519},{begin:1024,end:1279},{begin:1328,end:1423},{begin:1424,end:1535},{begin:42240,end:42559},{begin:1536,end:1791},{begin:1984,end:2047},{begin:2304,end:2431},{begin:2432,end:2559},{begin:2560,end:2687},{begin:2688,end:2815},{begin:2816,end:2943},{begin:2944,end:3071},{begin:3072,end:3199},{begin:3200,end:3327},{begin:3328,end:3455},{begin:3584,end:3711},{begin:3712,end:3839},{begin:4256,end:4351},{begin:6912,end:7039},{begin:4352,end:4607},{begin:7680,end:7935},{begin:7936,end:8191},{begin:8192,end:8303},{begin:8304,end:8351},{begin:8352,end:8399},{begin:8400,end:8447},{begin:8448,end:8527},{begin:8528,end:8591},{begin:8592,end:8703},{begin:8704,end:8959},{begin:8960,end:9215},{begin:9216,end:9279},{begin:9280,end:9311},{begin:9312,end:9471},{begin:9472,end:9599},{begin:9600,end:9631},{begin:9632,end:9727},{begin:9728,end:9983},{begin:9984,end:10175},{begin:12288,end:12351},{begin:12352,end:12447},{begin:12448,end:12543},{begin:12544,end:12591},{begin:12592,end:12687},{begin:43072,end:43135},{begin:12800,end:13055},{begin:13056,end:13311},{begin:44032,end:55215},{begin:55296,end:57343},{begin:67840,end:67871},{begin:19968,end:40959},{begin:57344,end:63743},{begin:12736,end:12783},{begin:64256,end:64335},{begin:64336,end:65023},{begin:65056,end:65071},{begin:65040,end:65055},{begin:65104,end:65135},{begin:65136,end:65279},{begin:65280,end:65519},{begin:65520,end:65535},{begin:3840,end:4095},{begin:1792,end:1871},{begin:1920,end:1983},{begin:3456,end:3583},{begin:4096,end:4255},{begin:4608,end:4991},{begin:5024,end:5119},{begin:5120,end:5759},{begin:5760,end:5791},{begin:5792,end:5887},{begin:6016,end:6143},{begin:6144,end:6319},{begin:10240,end:10495},{begin:40960,end:42127},{begin:5888,end:5919},{begin:66304,end:66351},{begin:66352,end:66383},{begin:66560,end:66639},{begin:118784,end:119039},{begin:119808,end:120831},{begin:1044480,end:1048573},{begin:65024,end:65039},{begin:917504,end:917631},{begin:6400,end:6479},{begin:6480,end:6527},{begin:6528,end:6623},{begin:6656,end:6687},{begin:11264,end:11359},{begin:11568,end:11647},{begin:19904,end:19967},{begin:43008,end:43055},{begin:65536,end:65663},{begin:65856,end:65935},{begin:66432,end:66463},{begin:66464,end:66527},{begin:66640,end:66687},{begin:66688,end:66735},{begin:67584,end:67647},{begin:68096,end:68191},{begin:119552,end:119647},{begin:73728,end:74751},{begin:119648,end:119679},{begin:7040,end:7103},{begin:7168,end:7247},{begin:7248,end:7295},{begin:43136,end:43231},{begin:43264,end:43311},{begin:43312,end:43359},{begin:43520,end:43615},{begin:65936,end:65999},{begin:66e3,end:66047},{begin:66208,end:66271},{begin:127024,end:127135}];function getUnicodeRangeFor(e){for(let t=0,a=i.length;t<a;t++){const a=i[t];if(e>=a.begin&&e<a.end)return t}return-1}const s=(0,r.getArrayLookupTableFactory)((function(){return["¨"," ̈","¯"," ̄","´"," ́","µ","μ","¸"," ̧","IJ","IJ","ij","ij","Ŀ","L·","ŀ","l·","ʼn","ʼn","ſ","s","DŽ","DŽ","Dž","Dž","dž","dž","LJ","LJ","Lj","Lj","lj","lj","NJ","NJ","Nj","Nj","nj","nj","DZ","DZ","Dz","Dz","dz","dz","˘"," ̆","˙"," ̇","˚"," ̊","˛"," ̨","˜"," ̃","˝"," ̋","ͺ"," ͅ","΄"," ́","ϐ","β","ϑ","θ","ϒ","Υ","ϕ","φ","ϖ","π","ϰ","κ","ϱ","ρ","ϲ","ς","ϴ","Θ","ϵ","ε","Ϲ","Σ","և","եւ","ٵ","اٴ","ٶ","وٴ","ٷ","ۇٴ","ٸ","يٴ","ำ","ํา","ຳ","ໍາ","ໜ","ຫນ","ໝ","ຫມ","ཷ","ྲཱྀ","ཹ","ླཱྀ","ẚ","aʾ","᾽"," ̓","᾿"," ̓","῀"," ͂","῾"," ̔"," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," ","‗"," ̳","․",".","‥","..","…","...","″","′′","‴","′′′","‶","‵‵","‷","‵‵‵","‼","!!","‾"," ̅","⁇","??","⁈","?!","⁉","!?","⁗","′′′′"," "," ","₨","Rs","℀","a/c","℁","a/s","℃","°C","℅","c/o","℆","c/u","ℇ","Ɛ","℉","°F","№","No","℡","TEL","ℵ","א","ℶ","ב","ℷ","ג","ℸ","ד","℻","FAX","Ⅰ","I","Ⅱ","II","Ⅲ","III","Ⅳ","IV","Ⅴ","V","Ⅵ","VI","Ⅶ","VII","Ⅷ","VIII","Ⅸ","IX","Ⅹ","X","Ⅺ","XI","Ⅻ","XII","Ⅼ","L","Ⅽ","C","Ⅾ","D","Ⅿ","M","ⅰ","i","ⅱ","ii","ⅲ","iii","ⅳ","iv","ⅴ","v","ⅵ","vi","ⅶ","vii","ⅷ","viii","ⅸ","ix","ⅹ","x","ⅺ","xi","ⅻ","xii","ⅼ","l","ⅽ","c","ⅾ","d","ⅿ","m","∬","∫∫","∭","∫∫∫","∯","∮∮","∰","∮∮∮","⑴","(1)","⑵","(2)","⑶","(3)","⑷","(4)","⑸","(5)","⑹","(6)","⑺","(7)","⑻","(8)","⑼","(9)","⑽","(10)","⑾","(11)","⑿","(12)","⒀","(13)","⒁","(14)","⒂","(15)","⒃","(16)","⒄","(17)","⒅","(18)","⒆","(19)","⒇","(20)","⒈","1.","⒉","2.","⒊","3.","⒋","4.","⒌","5.","⒍","6.","⒎","7.","⒏","8.","⒐","9.","⒑","10.","⒒","11.","⒓","12.","⒔","13.","⒕","14.","⒖","15.","⒗","16.","⒘","17.","⒙","18.","⒚","19.","⒛","20.","⒜","(a)","⒝","(b)","⒞","(c)","⒟","(d)","⒠","(e)","⒡","(f)","⒢","(g)","⒣","(h)","⒤","(i)","⒥","(j)","⒦","(k)","⒧","(l)","⒨","(m)","⒩","(n)","⒪","(o)","⒫","(p)","⒬","(q)","⒭","(r)","⒮","(s)","⒯","(t)","⒰","(u)","⒱","(v)","⒲","(w)","⒳","(x)","⒴","(y)","⒵","(z)","⨌","∫∫∫∫","⩴","::=","⩵","==","⩶","===","⺟","母","⻳","龟","⼀","一","⼁","丨","⼂","丶","⼃","丿","⼄","乙","⼅","亅","⼆","二","⼇","亠","⼈","人","⼉","儿","⼊","入","⼋","八","⼌","冂","⼍","冖","⼎","冫","⼏","几","⼐","凵","⼑","刀","⼒","力","⼓","勹","⼔","匕","⼕","匚","⼖","匸","⼗","十","⼘","卜","⼙","卩","⼚","厂","⼛","厶","⼜","又","⼝","口","⼞","囗","⼟","土","⼠","士","⼡","夂","⼢","夊","⼣","夕","⼤","大","⼥","女","⼦","子","⼧","宀","⼨","寸","⼩","小","⼪","尢","⼫","尸","⼬","屮","⼭","山","⼮","巛","⼯","工","⼰","己","⼱","巾","⼲","干","⼳","幺","⼴","广","⼵","廴","⼶","廾","⼷","弋","⼸","弓","⼹","彐","⼺","彡","⼻","彳","⼼","心","⼽","戈","⼾","戶","⼿","手","⽀","支","⽁","攴","⽂","文","⽃","斗","⽄","斤","⽅","方","⽆","无","⽇","日","⽈","曰","⽉","月","⽊","木","⽋","欠","⽌","止","⽍","歹","⽎","殳","⽏","毋","⽐","比","⽑","毛","⽒","氏","⽓","气","⽔","水","⽕","火","⽖","爪","⽗","父","⽘","爻","⽙","爿","⽚","片","⽛","牙","⽜","牛","⽝","犬","⽞","玄","⽟","玉","⽠","瓜","⽡","瓦","⽢","甘","⽣","生","⽤","用","⽥","田","⽦","疋","⽧","疒","⽨","癶","⽩","白","⽪","皮","⽫","皿","⽬","目","⽭","矛","⽮","矢","⽯","石","⽰","示","⽱","禸","⽲","禾","⽳","穴","⽴","立","⽵","竹","⽶","米","⽷","糸","⽸","缶","⽹","网","⽺","羊","⽻","羽","⽼","老","⽽","而","⽾","耒","⽿","耳","⾀","聿","⾁","肉","⾂","臣","⾃","自","⾄","至","⾅","臼","⾆","舌","⾇","舛","⾈","舟","⾉","艮","⾊","色","⾋","艸","⾌","虍","⾍","虫","⾎","血","⾏","行","⾐","衣","⾑","襾","⾒","見","⾓","角","⾔","言","⾕","谷","⾖","豆","⾗","豕","⾘","豸","⾙","貝","⾚","赤","⾛","走","⾜","足","⾝","身","⾞","車","⾟","辛","⾠","辰","⾡","辵","⾢","邑","⾣","酉","⾤","釆","⾥","里","⾦","金","⾧","長","⾨","門","⾩","阜","⾪","隶","⾫","隹","⾬","雨","⾭","靑","⾮","非","⾯","面","⾰","革","⾱","韋","⾲","韭","⾳","音","⾴","頁","⾵","風","⾶","飛","⾷","食","⾸","首","⾹","香","⾺","馬","⾻","骨","⾼","高","⾽","髟","⾾","鬥","⾿","鬯","⿀","鬲","⿁","鬼","⿂","魚","⿃","鳥","⿄","鹵","⿅","鹿","⿆","麥","⿇","麻","⿈","黃","⿉","黍","⿊","黑","⿋","黹","⿌","黽","⿍","鼎","⿎","鼓","⿏","鼠","⿐","鼻","⿑","齊","⿒","齒","⿓","龍","⿔","龜","⿕","龠","〶","〒","〸","十","〹","卄","〺","卅","゛"," ゙","゜"," ゚","ㄱ","ᄀ","ㄲ","ᄁ","ㄳ","ᆪ","ㄴ","ᄂ","ㄵ","ᆬ","ㄶ","ᆭ","ㄷ","ᄃ","ㄸ","ᄄ","ㄹ","ᄅ","ㄺ","ᆰ","ㄻ","ᆱ","ㄼ","ᆲ","ㄽ","ᆳ","ㄾ","ᆴ","ㄿ","ᆵ","ㅀ","ᄚ","ㅁ","ᄆ","ㅂ","ᄇ","ㅃ","ᄈ","ㅄ","ᄡ","ㅅ","ᄉ","ㅆ","ᄊ","ㅇ","ᄋ","ㅈ","ᄌ","ㅉ","ᄍ","ㅊ","ᄎ","ㅋ","ᄏ","ㅌ","ᄐ","ㅍ","ᄑ","ㅎ","ᄒ","ㅏ","ᅡ","ㅐ","ᅢ","ㅑ","ᅣ","ㅒ","ᅤ","ㅓ","ᅥ","ㅔ","ᅦ","ㅕ","ᅧ","ㅖ","ᅨ","ㅗ","ᅩ","ㅘ","ᅪ","ㅙ","ᅫ","ㅚ","ᅬ","ㅛ","ᅭ","ㅜ","ᅮ","ㅝ","ᅯ","ㅞ","ᅰ","ㅟ","ᅱ","ㅠ","ᅲ","ㅡ","ᅳ","ㅢ","ᅴ","ㅣ","ᅵ","ㅤ","ᅠ","ㅥ","ᄔ","ㅦ","ᄕ","ㅧ","ᇇ","ㅨ","ᇈ","ㅩ","ᇌ","ㅪ","ᇎ","ㅫ","ᇓ","ㅬ","ᇗ","ㅭ","ᇙ","ㅮ","ᄜ","ㅯ","ᇝ","ㅰ","ᇟ","ㅱ","ᄝ","ㅲ","ᄞ","ㅳ","ᄠ","ㅴ","ᄢ","ㅵ","ᄣ","ㅶ","ᄧ","ㅷ","ᄩ","ㅸ","ᄫ","ㅹ","ᄬ","ㅺ","ᄭ","ㅻ","ᄮ","ㅼ","ᄯ","ㅽ","ᄲ","ㅾ","ᄶ","ㅿ","ᅀ","ㆀ","ᅇ","ㆁ","ᅌ","ㆂ","ᇱ","ㆃ","ᇲ","ㆄ","ᅗ","ㆅ","ᅘ","ㆆ","ᅙ","ㆇ","ᆄ","ㆈ","ᆅ","ㆉ","ᆈ","ㆊ","ᆑ","ㆋ","ᆒ","ㆌ","ᆔ","ㆍ","ᆞ","ㆎ","ᆡ","㈀","(ᄀ)","㈁","(ᄂ)","㈂","(ᄃ)","㈃","(ᄅ)","㈄","(ᄆ)","㈅","(ᄇ)","㈆","(ᄉ)","㈇","(ᄋ)","㈈","(ᄌ)","㈉","(ᄎ)","㈊","(ᄏ)","㈋","(ᄐ)","㈌","(ᄑ)","㈍","(ᄒ)","㈎","(가)","㈏","(나)","㈐","(다)","㈑","(라)","㈒","(마)","㈓","(바)","㈔","(사)","㈕","(아)","㈖","(자)","㈗","(차)","㈘","(카)","㈙","(타)","㈚","(파)","㈛","(하)","㈜","(주)","㈝","(오전)","㈞","(오후)","㈠","(一)","㈡","(二)","㈢","(三)","㈣","(四)","㈤","(五)","㈥","(六)","㈦","(七)","㈧","(八)","㈨","(九)","㈩","(十)","㈪","(月)","㈫","(火)","㈬","(水)","㈭","(木)","㈮","(金)","㈯","(土)","㈰","(日)","㈱","(株)","㈲","(有)","㈳","(社)","㈴","(名)","㈵","(特)","㈶","(財)","㈷","(祝)","㈸","(労)","㈹","(代)","㈺","(呼)","㈻","(学)","㈼","(監)","㈽","(企)","㈾","(資)","㈿","(協)","㉀","(祭)","㉁","(休)","㉂","(自)","㉃","(至)","㋀","1月","㋁","2月","㋂","3月","㋃","4月","㋄","5月","㋅","6月","㋆","7月","㋇","8月","㋈","9月","㋉","10月","㋊","11月","㋋","12月","㍘","0点","㍙","1点","㍚","2点","㍛","3点","㍜","4点","㍝","5点","㍞","6点","㍟","7点","㍠","8点","㍡","9点","㍢","10点","㍣","11点","㍤","12点","㍥","13点","㍦","14点","㍧","15点","㍨","16点","㍩","17点","㍪","18点","㍫","19点","㍬","20点","㍭","21点","㍮","22点","㍯","23点","㍰","24点","㏠","1日","㏡","2日","㏢","3日","㏣","4日","㏤","5日","㏥","6日","㏦","7日","㏧","8日","㏨","9日","㏩","10日","㏪","11日","㏫","12日","㏬","13日","㏭","14日","㏮","15日","㏯","16日","㏰","17日","㏱","18日","㏲","19日","㏳","20日","㏴","21日","㏵","22日","㏶","23日","㏷","24日","㏸","25日","㏹","26日","㏺","27日","㏻","28日","㏼","29日","㏽","30日","㏾","31日","ff","ff","fi","fi","fl","fl","ffi","ffi","ffl","ffl","ſt","ſt","st","st","ﬓ","մն","ﬔ","մե","ﬕ","մի","ﬖ","վն","ﬗ","մխ","ﭏ","אל","ﭐ","ٱ","ﭑ","ٱ","ﭒ","ٻ","ﭓ","ٻ","ﭔ","ٻ","ﭕ","ٻ","ﭖ","پ","ﭗ","پ","ﭘ","پ","ﭙ","پ","ﭚ","ڀ","ﭛ","ڀ","ﭜ","ڀ","ﭝ","ڀ","ﭞ","ٺ","ﭟ","ٺ","ﭠ","ٺ","ﭡ","ٺ","ﭢ","ٿ","ﭣ","ٿ","ﭤ","ٿ","ﭥ","ٿ","ﭦ","ٹ","ﭧ","ٹ","ﭨ","ٹ","ﭩ","ٹ","ﭪ","ڤ","ﭫ","ڤ","ﭬ","ڤ","ﭭ","ڤ","ﭮ","ڦ","ﭯ","ڦ","ﭰ","ڦ","ﭱ","ڦ","ﭲ","ڄ","ﭳ","ڄ","ﭴ","ڄ","ﭵ","ڄ","ﭶ","ڃ","ﭷ","ڃ","ﭸ","ڃ","ﭹ","ڃ","ﭺ","چ","ﭻ","چ","ﭼ","چ","ﭽ","چ","ﭾ","ڇ","ﭿ","ڇ","ﮀ","ڇ","ﮁ","ڇ","ﮂ","ڍ","ﮃ","ڍ","ﮄ","ڌ","ﮅ","ڌ","ﮆ","ڎ","ﮇ","ڎ","ﮈ","ڈ","ﮉ","ڈ","ﮊ","ژ","ﮋ","ژ","ﮌ","ڑ","ﮍ","ڑ","ﮎ","ک","ﮏ","ک","ﮐ","ک","ﮑ","ک","ﮒ","گ","ﮓ","گ","ﮔ","گ","ﮕ","گ","ﮖ","ڳ","ﮗ","ڳ","ﮘ","ڳ","ﮙ","ڳ","ﮚ","ڱ","ﮛ","ڱ","ﮜ","ڱ","ﮝ","ڱ","ﮞ","ں","ﮟ","ں","ﮠ","ڻ","ﮡ","ڻ","ﮢ","ڻ","ﮣ","ڻ","ﮤ","ۀ","ﮥ","ۀ","ﮦ","ہ","ﮧ","ہ","ﮨ","ہ","ﮩ","ہ","ﮪ","ھ","ﮫ","ھ","ﮬ","ھ","ﮭ","ھ","ﮮ","ے","ﮯ","ے","ﮰ","ۓ","ﮱ","ۓ","ﯓ","ڭ","ﯔ","ڭ","ﯕ","ڭ","ﯖ","ڭ","ﯗ","ۇ","ﯘ","ۇ","ﯙ","ۆ","ﯚ","ۆ","ﯛ","ۈ","ﯜ","ۈ","ﯝ","ٷ","ﯞ","ۋ","ﯟ","ۋ","ﯠ","ۅ","ﯡ","ۅ","ﯢ","ۉ","ﯣ","ۉ","ﯤ","ې","ﯥ","ې","ﯦ","ې","ﯧ","ې","ﯨ","ى","ﯩ","ى","ﯪ","ئا","ﯫ","ئا","ﯬ","ئە","ﯭ","ئە","ﯮ","ئو","ﯯ","ئو","ﯰ","ئۇ","ﯱ","ئۇ","ﯲ","ئۆ","ﯳ","ئۆ","ﯴ","ئۈ","ﯵ","ئۈ","ﯶ","ئې","ﯷ","ئې","ﯸ","ئې","ﯹ","ئى","ﯺ","ئى","ﯻ","ئى","ﯼ","ی","ﯽ","ی","ﯾ","ی","ﯿ","ی","ﰀ","ئج","ﰁ","ئح","ﰂ","ئم","ﰃ","ئى","ﰄ","ئي","ﰅ","بج","ﰆ","بح","ﰇ","بخ","ﰈ","بم","ﰉ","بى","ﰊ","بي","ﰋ","تج","ﰌ","تح","ﰍ","تخ","ﰎ","تم","ﰏ","تى","ﰐ","تي","ﰑ","ثج","ﰒ","ثم","ﰓ","ثى","ﰔ","ثي","ﰕ","جح","ﰖ","جم","ﰗ","حج","ﰘ","حم","ﰙ","خج","ﰚ","خح","ﰛ","خم","ﰜ","سج","ﰝ","سح","ﰞ","سخ","ﰟ","سم","ﰠ","صح","ﰡ","صم","ﰢ","ضج","ﰣ","ضح","ﰤ","ضخ","ﰥ","ضم","ﰦ","طح","ﰧ","طم","ﰨ","ظم","ﰩ","عج","ﰪ","عم","ﰫ","غج","ﰬ","غم","ﰭ","فج","ﰮ","فح","ﰯ","فخ","ﰰ","فم","ﰱ","فى","ﰲ","في","ﰳ","قح","ﰴ","قم","ﰵ","قى","ﰶ","قي","ﰷ","كا","ﰸ","كج","ﰹ","كح","ﰺ","كخ","ﰻ","كل","ﰼ","كم","ﰽ","كى","ﰾ","كي","ﰿ","لج","ﱀ","لح","ﱁ","لخ","ﱂ","لم","ﱃ","لى","ﱄ","لي","ﱅ","مج","ﱆ","مح","ﱇ","مخ","ﱈ","مم","ﱉ","مى","ﱊ","مي","ﱋ","نج","ﱌ","نح","ﱍ","نخ","ﱎ","نم","ﱏ","نى","ﱐ","ني","ﱑ","هج","ﱒ","هم","ﱓ","هى","ﱔ","هي","ﱕ","يج","ﱖ","يح","ﱗ","يخ","ﱘ","يم","ﱙ","يى","ﱚ","يي","ﱛ","ذٰ","ﱜ","رٰ","ﱝ","ىٰ","ﱞ"," ٌّ","ﱟ"," ٍّ","ﱠ"," َّ","ﱡ"," ُّ","ﱢ"," ِّ","ﱣ"," ّٰ","ﱤ","ئر","ﱥ","ئز","ﱦ","ئم","ﱧ","ئن","ﱨ","ئى","ﱩ","ئي","ﱪ","بر","ﱫ","بز","ﱬ","بم","ﱭ","بن","ﱮ","بى","ﱯ","بي","ﱰ","تر","ﱱ","تز","ﱲ","تم","ﱳ","تن","ﱴ","تى","ﱵ","تي","ﱶ","ثر","ﱷ","ثز","ﱸ","ثم","ﱹ","ثن","ﱺ","ثى","ﱻ","ثي","ﱼ","فى","ﱽ","في","ﱾ","قى","ﱿ","قي","ﲀ","كا","ﲁ","كل","ﲂ","كم","ﲃ","كى","ﲄ","كي","ﲅ","لم","ﲆ","لى","ﲇ","لي","ﲈ","ما","ﲉ","مم","ﲊ","نر","ﲋ","نز","ﲌ","نم","ﲍ","نن","ﲎ","نى","ﲏ","ني","ﲐ","ىٰ","ﲑ","ير","ﲒ","يز","ﲓ","يم","ﲔ","ين","ﲕ","يى","ﲖ","يي","ﲗ","ئج","ﲘ","ئح","ﲙ","ئخ","ﲚ","ئم","ﲛ","ئه","ﲜ","بج","ﲝ","بح","ﲞ","بخ","ﲟ","بم","ﲠ","به","ﲡ","تج","ﲢ","تح","ﲣ","تخ","ﲤ","تم","ﲥ","ته","ﲦ","ثم","ﲧ","جح","ﲨ","جم","ﲩ","حج","ﲪ","حم","ﲫ","خج","ﲬ","خم","ﲭ","سج","ﲮ","سح","ﲯ","سخ","ﲰ","سم","ﲱ","صح","ﲲ","صخ","ﲳ","صم","ﲴ","ضج","ﲵ","ضح","ﲶ","ضخ","ﲷ","ضم","ﲸ","طح","ﲹ","ظم","ﲺ","عج","ﲻ","عم","ﲼ","غج","ﲽ","غم","ﲾ","فج","ﲿ","فح","ﳀ","فخ","ﳁ","فم","ﳂ","قح","ﳃ","قم","ﳄ","كج","ﳅ","كح","ﳆ","كخ","ﳇ","كل","ﳈ","كم","ﳉ","لج","ﳊ","لح","ﳋ","لخ","ﳌ","لم","ﳍ","له","ﳎ","مج","ﳏ","مح","ﳐ","مخ","ﳑ","مم","ﳒ","نج","ﳓ","نح","ﳔ","نخ","ﳕ","نم","ﳖ","نه","ﳗ","هج","ﳘ","هم","ﳙ","هٰ","ﳚ","يج","ﳛ","يح","ﳜ","يخ","ﳝ","يم","ﳞ","يه","ﳟ","ئم","ﳠ","ئه","ﳡ","بم","ﳢ","به","ﳣ","تم","ﳤ","ته","ﳥ","ثم","ﳦ","ثه","ﳧ","سم","ﳨ","سه","ﳩ","شم","ﳪ","شه","ﳫ","كل","ﳬ","كم","ﳭ","لم","ﳮ","نم","ﳯ","نه","ﳰ","يم","ﳱ","يه","ﳲ","ـَّ","ﳳ","ـُّ","ﳴ","ـِّ","ﳵ","طى","ﳶ","طي","ﳷ","عى","ﳸ","عي","ﳹ","غى","ﳺ","غي","ﳻ","سى","ﳼ","سي","ﳽ","شى","ﳾ","شي","ﳿ","حى","ﴀ","حي","ﴁ","جى","ﴂ","جي","ﴃ","خى","ﴄ","خي","ﴅ","صى","ﴆ","صي","ﴇ","ضى","ﴈ","ضي","ﴉ","شج","ﴊ","شح","ﴋ","شخ","ﴌ","شم","ﴍ","شر","ﴎ","سر","ﴏ","صر","ﴐ","ضر","ﴑ","طى","ﴒ","طي","ﴓ","عى","ﴔ","عي","ﴕ","غى","ﴖ","غي","ﴗ","سى","ﴘ","سي","ﴙ","شى","ﴚ","شي","ﴛ","حى","ﴜ","حي","ﴝ","جى","ﴞ","جي","ﴟ","خى","ﴠ","خي","ﴡ","صى","ﴢ","صي","ﴣ","ضى","ﴤ","ضي","ﴥ","شج","ﴦ","شح","ﴧ","شخ","ﴨ","شم","ﴩ","شر","ﴪ","سر","ﴫ","صر","ﴬ","ضر","ﴭ","شج","ﴮ","شح","ﴯ","شخ","ﴰ","شم","ﴱ","سه","ﴲ","شه","ﴳ","طم","ﴴ","سج","ﴵ","سح","ﴶ","سخ","ﴷ","شج","ﴸ","شح","ﴹ","شخ","ﴺ","طم","ﴻ","ظم","ﴼ","اً","ﴽ","اً","ﵐ","تجم","ﵑ","تحج","ﵒ","تحج","ﵓ","تحم","ﵔ","تخم","ﵕ","تمج","ﵖ","تمح","ﵗ","تمخ","ﵘ","جمح","ﵙ","جمح","ﵚ","حمي","ﵛ","حمى","ﵜ","سحج","ﵝ","سجح","ﵞ","سجى","ﵟ","سمح","ﵠ","سمح","ﵡ","سمج","ﵢ","سمم","ﵣ","سمم","ﵤ","صحح","ﵥ","صحح","ﵦ","صمم","ﵧ","شحم","ﵨ","شحم","ﵩ","شجي","ﵪ","شمخ","ﵫ","شمخ","ﵬ","شمم","ﵭ","شمم","ﵮ","ضحى","ﵯ","ضخم","ﵰ","ضخم","ﵱ","طمح","ﵲ","طمح","ﵳ","طمم","ﵴ","طمي","ﵵ","عجم","ﵶ","عمم","ﵷ","عمم","ﵸ","عمى","ﵹ","غمم","ﵺ","غمي","ﵻ","غمى","ﵼ","فخم","ﵽ","فخم","ﵾ","قمح","ﵿ","قمم","ﶀ","لحم","ﶁ","لحي","ﶂ","لحى","ﶃ","لجج","ﶄ","لجج","ﶅ","لخم","ﶆ","لخم","ﶇ","لمح","ﶈ","لمح","ﶉ","محج","ﶊ","محم","ﶋ","محي","ﶌ","مجح","ﶍ","مجم","ﶎ","مخج","ﶏ","مخم","ﶒ","مجخ","ﶓ","همج","ﶔ","همم","ﶕ","نحم","ﶖ","نحى","ﶗ","نجم","ﶘ","نجم","ﶙ","نجى","ﶚ","نمي","ﶛ","نمى","ﶜ","يمم","ﶝ","يمم","ﶞ","بخي","ﶟ","تجي","ﶠ","تجى","ﶡ","تخي","ﶢ","تخى","ﶣ","تمي","ﶤ","تمى","ﶥ","جمي","ﶦ","جحى","ﶧ","جمى","ﶨ","سخى","ﶩ","صحي","ﶪ","شحي","ﶫ","ضحي","ﶬ","لجي","ﶭ","لمي","ﶮ","يحي","ﶯ","يجي","ﶰ","يمي","ﶱ","ممي","ﶲ","قمي","ﶳ","نحي","ﶴ","قمح","ﶵ","لحم","ﶶ","عمي","ﶷ","كمي","ﶸ","نجح","ﶹ","مخي","ﶺ","لجم","ﶻ","كمم","ﶼ","لجم","ﶽ","نجح","ﶾ","جحي","ﶿ","حجي","ﷀ","مجي","ﷁ","فمي","ﷂ","بحي","ﷃ","كمم","ﷄ","عجم","ﷅ","صمم","ﷆ","سخي","ﷇ","نجي","﹉","‾","﹊","‾","﹋","‾","﹌","‾","﹍","_","﹎","_","﹏","_","ﺀ","ء","ﺁ","آ","ﺂ","آ","ﺃ","أ","ﺄ","أ","ﺅ","ؤ","ﺆ","ؤ","ﺇ","إ","ﺈ","إ","ﺉ","ئ","ﺊ","ئ","ﺋ","ئ","ﺌ","ئ","ﺍ","ا","ﺎ","ا","ﺏ","ب","ﺐ","ب","ﺑ","ب","ﺒ","ب","ﺓ","ة","ﺔ","ة","ﺕ","ت","ﺖ","ت","ﺗ","ت","ﺘ","ت","ﺙ","ث","ﺚ","ث","ﺛ","ث","ﺜ","ث","ﺝ","ج","ﺞ","ج","ﺟ","ج","ﺠ","ج","ﺡ","ح","ﺢ","ح","ﺣ","ح","ﺤ","ح","ﺥ","خ","ﺦ","خ","ﺧ","خ","ﺨ","خ","ﺩ","د","ﺪ","د","ﺫ","ذ","ﺬ","ذ","ﺭ","ر","ﺮ","ر","ﺯ","ز","ﺰ","ز","ﺱ","س","ﺲ","س","ﺳ","س","ﺴ","س","ﺵ","ش","ﺶ","ش","ﺷ","ش","ﺸ","ش","ﺹ","ص","ﺺ","ص","ﺻ","ص","ﺼ","ص","ﺽ","ض","ﺾ","ض","ﺿ","ض","ﻀ","ض","ﻁ","ط","ﻂ","ط","ﻃ","ط","ﻄ","ط","ﻅ","ظ","ﻆ","ظ","ﻇ","ظ","ﻈ","ظ","ﻉ","ع","ﻊ","ع","ﻋ","ع","ﻌ","ع","ﻍ","غ","ﻎ","غ","ﻏ","غ","ﻐ","غ","ﻑ","ف","ﻒ","ف","ﻓ","ف","ﻔ","ف","ﻕ","ق","ﻖ","ق","ﻗ","ق","ﻘ","ق","ﻙ","ك","ﻚ","ك","ﻛ","ك","ﻜ","ك","ﻝ","ل","ﻞ","ل","ﻟ","ل","ﻠ","ل","ﻡ","م","ﻢ","م","ﻣ","م","ﻤ","م","ﻥ","ن","ﻦ","ن","ﻧ","ن","ﻨ","ن","ﻩ","ه","ﻪ","ه","ﻫ","ه","ﻬ","ه","ﻭ","و","ﻮ","و","ﻯ","ى","ﻰ","ى","ﻱ","ي","ﻲ","ي","ﻳ","ي","ﻴ","ي","ﻵ","لآ","ﻶ","لآ","ﻷ","لأ","ﻸ","لأ","ﻹ","لإ","ﻺ","لإ","ﻻ","لا","ﻼ","لا"]}));function reverseIfRtl(e){const t=e.length;if(t<=1||!function isRTLRangeFor(e){let t=i[13];if(e>=t.begin&&e<t.end)return!0;t=i[11];return e>=t.begin&&e<t.end}(e.charCodeAt(0)))return e;const a=[];for(let r=t-1;r>=0;r--)a.push(e[r]);return a.join("")}const o=new RegExp("^(\\s)|(\\p{Mn})|(\\p{Cf})$","u"),c=new Map;function getCharUnicodeCategory(e){const t=c.get(e);if(t)return t;const a=e.match(o),r={isWhitespace:!(!a||!a[1]),isZeroWidthDiacritic:!(!a||!a[2]),isInvisibleFormatMark:!(!a||!a[3])};c.set(e,r);return r}function clearUnicodeCaches(){c.clear()}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.getSerifFonts=t.getNonStdFontMap=t.getGlyphMapForStandardFonts=t.getFontNameToFileMap=void 0;t.getStandardFontName=function getStandardFontName(e){const t=(0,n.normalizeFontName)(e);return i()[t]};t.getSymbolsFonts=t.getSupplementalGlyphMapForCalibri=t.getSupplementalGlyphMapForArialBlack=t.getStdFontMap=void 0;var r=a(3),n=a(36);const i=(0,r.getLookupTableFactory)((function(e){e["Times-Roman"]="Times-Roman";e.Helvetica="Helvetica";e.Courier="Courier";e.Symbol="Symbol";e["Times-Bold"]="Times-Bold";e["Helvetica-Bold"]="Helvetica-Bold";e["Courier-Bold"]="Courier-Bold";e.ZapfDingbats="ZapfDingbats";e["Times-Italic"]="Times-Italic";e["Helvetica-Oblique"]="Helvetica-Oblique";e["Courier-Oblique"]="Courier-Oblique";e["Times-BoldItalic"]="Times-BoldItalic";e["Helvetica-BoldOblique"]="Helvetica-BoldOblique";e["Courier-BoldOblique"]="Courier-BoldOblique";e.ArialNarrow="Helvetica";e["ArialNarrow-Bold"]="Helvetica-Bold";e["ArialNarrow-BoldItalic"]="Helvetica-BoldOblique";e["ArialNarrow-Italic"]="Helvetica-Oblique";e.ArialBlack="Helvetica";e["ArialBlack-Bold"]="Helvetica-Bold";e["ArialBlack-BoldItalic"]="Helvetica-BoldOblique";e["ArialBlack-Italic"]="Helvetica-Oblique";e["Arial-Black"]="Helvetica";e["Arial-Black-Bold"]="Helvetica-Bold";e["Arial-Black-BoldItalic"]="Helvetica-BoldOblique";e["Arial-Black-Italic"]="Helvetica-Oblique";e.Arial="Helvetica";e["Arial-Bold"]="Helvetica-Bold";e["Arial-BoldItalic"]="Helvetica-BoldOblique";e["Arial-Italic"]="Helvetica-Oblique";e.ArialMT="Helvetica";e["Arial-BoldItalicMT"]="Helvetica-BoldOblique";e["Arial-BoldMT"]="Helvetica-Bold";e["Arial-ItalicMT"]="Helvetica-Oblique";e.ArialUnicodeMS="Helvetica";e["ArialUnicodeMS-Bold"]="Helvetica-Bold";e["ArialUnicodeMS-BoldItalic"]="Helvetica-BoldOblique";e["ArialUnicodeMS-Italic"]="Helvetica-Oblique";e["Courier-BoldItalic"]="Courier-BoldOblique";e["Courier-Italic"]="Courier-Oblique";e.CourierNew="Courier";e["CourierNew-Bold"]="Courier-Bold";e["CourierNew-BoldItalic"]="Courier-BoldOblique";e["CourierNew-Italic"]="Courier-Oblique";e["CourierNewPS-BoldItalicMT"]="Courier-BoldOblique";e["CourierNewPS-BoldMT"]="Courier-Bold";e["CourierNewPS-ItalicMT"]="Courier-Oblique";e.CourierNewPSMT="Courier";e["Helvetica-BoldItalic"]="Helvetica-BoldOblique";e["Helvetica-Italic"]="Helvetica-Oblique";e["Symbol-Bold"]="Symbol";e["Symbol-BoldItalic"]="Symbol";e["Symbol-Italic"]="Symbol";e.TimesNewRoman="Times-Roman";e["TimesNewRoman-Bold"]="Times-Bold";e["TimesNewRoman-BoldItalic"]="Times-BoldItalic";e["TimesNewRoman-Italic"]="Times-Italic";e.TimesNewRomanPS="Times-Roman";e["TimesNewRomanPS-Bold"]="Times-Bold";e["TimesNewRomanPS-BoldItalic"]="Times-BoldItalic";e["TimesNewRomanPS-BoldItalicMT"]="Times-BoldItalic";e["TimesNewRomanPS-BoldMT"]="Times-Bold";e["TimesNewRomanPS-Italic"]="Times-Italic";e["TimesNewRomanPS-ItalicMT"]="Times-Italic";e.TimesNewRomanPSMT="Times-Roman";e["TimesNewRomanPSMT-Bold"]="Times-Bold";e["TimesNewRomanPSMT-BoldItalic"]="Times-BoldItalic";e["TimesNewRomanPSMT-Italic"]="Times-Italic"}));t.getStdFontMap=i;const s=(0,r.getLookupTableFactory)((function(e){e.Courier="FoxitFixed.pfb";e["Courier-Bold"]="FoxitFixedBold.pfb";e["Courier-BoldOblique"]="FoxitFixedBoldItalic.pfb";e["Courier-Oblique"]="FoxitFixedItalic.pfb";e.Helvetica="FoxitSans.pfb";e["Helvetica-Bold"]="FoxitSansBold.pfb";e["Helvetica-BoldOblique"]="FoxitSansBoldItalic.pfb";e["Helvetica-Oblique"]="FoxitSansItalic.pfb";e["Times-Roman"]="FoxitSerif.pfb";e["Times-Bold"]="FoxitSerifBold.pfb";e["Times-BoldItalic"]="FoxitSerifBoldItalic.pfb";e["Times-Italic"]="FoxitSerifItalic.pfb";e.Symbol="FoxitSymbol.pfb";e.ZapfDingbats="FoxitDingbats.pfb";e["LiberationSans-Regular"]="LiberationSans-Regular.ttf";e["LiberationSans-Bold"]="LiberationSans-Bold.ttf";e["LiberationSans-Italic"]="LiberationSans-Italic.ttf";e["LiberationSans-BoldItalic"]="LiberationSans-BoldItalic.ttf"}));t.getFontNameToFileMap=s;const o=(0,r.getLookupTableFactory)((function(e){e.Calibri="Helvetica";e["Calibri-Bold"]="Helvetica-Bold";e["Calibri-BoldItalic"]="Helvetica-BoldOblique";e["Calibri-Italic"]="Helvetica-Oblique";e.CenturyGothic="Helvetica";e["CenturyGothic-Bold"]="Helvetica-Bold";e["CenturyGothic-BoldItalic"]="Helvetica-BoldOblique";e["CenturyGothic-Italic"]="Helvetica-Oblique";e.ComicSansMS="Comic Sans MS";e["ComicSansMS-Bold"]="Comic Sans MS-Bold";e["ComicSansMS-BoldItalic"]="Comic Sans MS-BoldItalic";e["ComicSansMS-Italic"]="Comic Sans MS-Italic";e["ItcSymbol-Bold"]="Helvetica-Bold";e["ItcSymbol-BoldItalic"]="Helvetica-BoldOblique";e["ItcSymbol-Book"]="Helvetica";e["ItcSymbol-BookItalic"]="Helvetica-Oblique";e["ItcSymbol-Medium"]="Helvetica";e["ItcSymbol-MediumItalic"]="Helvetica-Oblique";e.LucidaConsole="Courier";e["LucidaConsole-Bold"]="Courier-Bold";e["LucidaConsole-BoldItalic"]="Courier-BoldOblique";e["LucidaConsole-Italic"]="Courier-Oblique";e["LucidaSans-Demi"]="Helvetica-Bold";e["MS-Gothic"]="MS Gothic";e["MS-Gothic-Bold"]="MS Gothic-Bold";e["MS-Gothic-BoldItalic"]="MS Gothic-BoldItalic";e["MS-Gothic-Italic"]="MS Gothic-Italic";e["MS-Mincho"]="MS Mincho";e["MS-Mincho-Bold"]="MS Mincho-Bold";e["MS-Mincho-BoldItalic"]="MS Mincho-BoldItalic";e["MS-Mincho-Italic"]="MS Mincho-Italic";e["MS-PGothic"]="MS PGothic";e["MS-PGothic-Bold"]="MS PGothic-Bold";e["MS-PGothic-BoldItalic"]="MS PGothic-BoldItalic";e["MS-PGothic-Italic"]="MS PGothic-Italic";e["MS-PMincho"]="MS PMincho";e["MS-PMincho-Bold"]="MS PMincho-Bold";e["MS-PMincho-BoldItalic"]="MS PMincho-BoldItalic";e["MS-PMincho-Italic"]="MS PMincho-Italic";e.NuptialScript="Times-Italic";e.SegoeUISymbol="Helvetica";e.Wingdings="ZapfDingbats";e["Wingdings-Regular"]="ZapfDingbats"}));t.getNonStdFontMap=o;const c=(0,r.getLookupTableFactory)((function(e){e["Adobe Jenson"]=!0;e["Adobe Text"]=!0;e.Albertus=!0;e.Aldus=!0;e.Alexandria=!0;e.Algerian=!0;e["American Typewriter"]=!0;e.Antiqua=!0;e.Apex=!0;e.Arno=!0;e.Aster=!0;e.Aurora=!0;e.Baskerville=!0;e.Bell=!0;e.Bembo=!0;e["Bembo Schoolbook"]=!0;e.Benguiat=!0;e["Berkeley Old Style"]=!0;e["Bernhard Modern"]=!0;e["Berthold City"]=!0;e.Bodoni=!0;e["Bauer Bodoni"]=!0;e["Book Antiqua"]=!0;e.Bookman=!0;e["Bordeaux Roman"]=!0;e["Californian FB"]=!0;e.Calisto=!0;e.Calvert=!0;e.Capitals=!0;e.Cambria=!0;e.Cartier=!0;e.Caslon=!0;e.Catull=!0;e.Centaur=!0;e["Century Old Style"]=!0;e["Century Schoolbook"]=!0;e.Chaparral=!0;e["Charis SIL"]=!0;e.Cheltenham=!0;e["Cholla Slab"]=!0;e.Clarendon=!0;e.Clearface=!0;e.Cochin=!0;e.Colonna=!0;e["Computer Modern"]=!0;e["Concrete Roman"]=!0;e.Constantia=!0;e["Cooper Black"]=!0;e.Corona=!0;e.Ecotype=!0;e.Egyptienne=!0;e.Elephant=!0;e.Excelsior=!0;e.Fairfield=!0;e["FF Scala"]=!0;e.Folkard=!0;e.Footlight=!0;e.FreeSerif=!0;e["Friz Quadrata"]=!0;e.Garamond=!0;e.Gentium=!0;e.Georgia=!0;e.Gloucester=!0;e["Goudy Old Style"]=!0;e["Goudy Schoolbook"]=!0;e["Goudy Pro Font"]=!0;e.Granjon=!0;e["Guardian Egyptian"]=!0;e.Heather=!0;e.Hercules=!0;e["High Tower Text"]=!0;e.Hiroshige=!0;e["Hoefler Text"]=!0;e["Humana Serif"]=!0;e.Imprint=!0;e["Ionic No. 5"]=!0;e.Janson=!0;e.Joanna=!0;e.Korinna=!0;e.Lexicon=!0;e.LiberationSerif=!0;e["Liberation Serif"]=!0;e["Linux Libertine"]=!0;e.Literaturnaya=!0;e.Lucida=!0;e["Lucida Bright"]=!0;e.Melior=!0;e.Memphis=!0;e.Miller=!0;e.Minion=!0;e.Modern=!0;e["Mona Lisa"]=!0;e["Mrs Eaves"]=!0;e["MS Serif"]=!0;e["Museo Slab"]=!0;e["New York"]=!0;e["Nimbus Roman"]=!0;e["NPS Rawlinson Roadway"]=!0;e.NuptialScript=!0;e.Palatino=!0;e.Perpetua=!0;e.Plantin=!0;e["Plantin Schoolbook"]=!0;e.Playbill=!0;e["Poor Richard"]=!0;e["Rawlinson Roadway"]=!0;e.Renault=!0;e.Requiem=!0;e.Rockwell=!0;e.Roman=!0;e["Rotis Serif"]=!0;e.Sabon=!0;e.Scala=!0;e.Seagull=!0;e.Sistina=!0;e.Souvenir=!0;e.STIX=!0;e["Stone Informal"]=!0;e["Stone Serif"]=!0;e.Sylfaen=!0;e.Times=!0;e.Trajan=!0;e["Trinité"]=!0;e["Trump Mediaeval"]=!0;e.Utopia=!0;e["Vale Type"]=!0;e["Bitstream Vera"]=!0;e["Vera Serif"]=!0;e.Versailles=!0;e.Wanted=!0;e.Weiss=!0;e["Wide Latin"]=!0;e.Windsor=!0;e.XITS=!0}));t.getSerifFonts=c;const l=(0,r.getLookupTableFactory)((function(e){e.Dingbats=!0;e.Symbol=!0;e.ZapfDingbats=!0}));t.getSymbolsFonts=l;const h=(0,r.getLookupTableFactory)((function(e){e[2]=10;e[3]=32;e[4]=33;e[5]=34;e[6]=35;e[7]=36;e[8]=37;e[9]=38;e[10]=39;e[11]=40;e[12]=41;e[13]=42;e[14]=43;e[15]=44;e[16]=45;e[17]=46;e[18]=47;e[19]=48;e[20]=49;e[21]=50;e[22]=51;e[23]=52;e[24]=53;e[25]=54;e[26]=55;e[27]=56;e[28]=57;e[29]=58;e[30]=894;e[31]=60;e[32]=61;e[33]=62;e[34]=63;e[35]=64;e[36]=65;e[37]=66;e[38]=67;e[39]=68;e[40]=69;e[41]=70;e[42]=71;e[43]=72;e[44]=73;e[45]=74;e[46]=75;e[47]=76;e[48]=77;e[49]=78;e[50]=79;e[51]=80;e[52]=81;e[53]=82;e[54]=83;e[55]=84;e[56]=85;e[57]=86;e[58]=87;e[59]=88;e[60]=89;e[61]=90;e[62]=91;e[63]=92;e[64]=93;e[65]=94;e[66]=95;e[67]=96;e[68]=97;e[69]=98;e[70]=99;e[71]=100;e[72]=101;e[73]=102;e[74]=103;e[75]=104;e[76]=105;e[77]=106;e[78]=107;e[79]=108;e[80]=109;e[81]=110;e[82]=111;e[83]=112;e[84]=113;e[85]=114;e[86]=115;e[87]=116;e[88]=117;e[89]=118;e[90]=119;e[91]=120;e[92]=121;e[93]=122;e[94]=123;e[95]=124;e[96]=125;e[97]=126;e[98]=196;e[99]=197;e[100]=199;e[101]=201;e[102]=209;e[103]=214;e[104]=220;e[105]=225;e[106]=224;e[107]=226;e[108]=228;e[109]=227;e[110]=229;e[111]=231;e[112]=233;e[113]=232;e[114]=234;e[115]=235;e[116]=237;e[117]=236;e[118]=238;e[119]=239;e[120]=241;e[121]=243;e[122]=242;e[123]=244;e[124]=246;e[125]=245;e[126]=250;e[127]=249;e[128]=251;e[129]=252;e[130]=8224;e[131]=176;e[132]=162;e[133]=163;e[134]=167;e[135]=8226;e[136]=182;e[137]=223;e[138]=174;e[139]=169;e[140]=8482;e[141]=180;e[142]=168;e[143]=8800;e[144]=198;e[145]=216;e[146]=8734;e[147]=177;e[148]=8804;e[149]=8805;e[150]=165;e[151]=181;e[152]=8706;e[153]=8721;e[154]=8719;e[156]=8747;e[157]=170;e[158]=186;e[159]=8486;e[160]=230;e[161]=248;e[162]=191;e[163]=161;e[164]=172;e[165]=8730;e[166]=402;e[167]=8776;e[168]=8710;e[169]=171;e[170]=187;e[171]=8230;e[179]=8220;e[180]=8221;e[181]=8216;e[182]=8217;e[200]=193;e[203]=205;e[207]=211;e[210]=218;e[223]=711;e[224]=321;e[225]=322;e[226]=352;e[227]=353;e[228]=381;e[229]=382;e[233]=221;e[234]=253;e[252]=263;e[253]=268;e[254]=269;e[258]=258;e[260]=260;e[261]=261;e[265]=280;e[266]=281;e[267]=282;e[268]=283;e[269]=313;e[275]=323;e[276]=324;e[278]=328;e[283]=344;e[284]=345;e[285]=346;e[286]=347;e[292]=367;e[295]=377;e[296]=378;e[298]=380;e[305]=963;e[306]=964;e[307]=966;e[308]=8215;e[309]=8252;e[310]=8319;e[311]=8359;e[312]=8592;e[313]=8593;e[337]=9552;e[493]=1039;e[494]=1040;e[672]=1488;e[673]=1489;e[674]=1490;e[675]=1491;e[676]=1492;e[677]=1493;e[678]=1494;e[679]=1495;e[680]=1496;e[681]=1497;e[682]=1498;e[683]=1499;e[684]=1500;e[685]=1501;e[686]=1502;e[687]=1503;e[688]=1504;e[689]=1505;e[690]=1506;e[691]=1507;e[692]=1508;e[693]=1509;e[694]=1510;e[695]=1511;e[696]=1512;e[697]=1513;e[698]=1514;e[705]=1524;e[706]=8362;e[710]=64288;e[711]=64298;e[759]=1617;e[761]=1776;e[763]=1778;e[775]=1652;e[777]=1764;e[778]=1780;e[779]=1781;e[780]=1782;e[782]=771;e[783]=64726;e[786]=8363;e[788]=8532;e[790]=768;e[791]=769;e[792]=768;e[795]=803;e[797]=64336;e[798]=64337;e[799]=64342;e[800]=64343;e[801]=64344;e[802]=64345;e[803]=64362;e[804]=64363;e[805]=64364;e[2424]=7821;e[2425]=7822;e[2426]=7823;e[2427]=7824;e[2428]=7825;e[2429]=7826;e[2430]=7827;e[2433]=7682;e[2678]=8045;e[2679]=8046;e[2830]=1552;e[2838]=686;e[2840]=751;e[2842]=753;e[2843]=754;e[2844]=755;e[2846]=757;e[2856]=767;e[2857]=848;e[2858]=849;e[2862]=853;e[2863]=854;e[2864]=855;e[2865]=861;e[2866]=862;e[2906]=7460;e[2908]=7462;e[2909]=7463;e[2910]=7464;e[2912]=7466;e[2913]=7467;e[2914]=7468;e[2916]=7470;e[2917]=7471;e[2918]=7472;e[2920]=7474;e[2921]=7475;e[2922]=7476;e[2924]=7478;e[2925]=7479;e[2926]=7480;e[2928]=7482;e[2929]=7483;e[2930]=7484;e[2932]=7486;e[2933]=7487;e[2934]=7488;e[2936]=7490;e[2937]=7491;e[2938]=7492;e[2940]=7494;e[2941]=7495;e[2942]=7496;e[2944]=7498;e[2946]=7500;e[2948]=7502;e[2950]=7504;e[2951]=7505;e[2952]=7506;e[2954]=7508;e[2955]=7509;e[2956]=7510;e[2958]=7512;e[2959]=7513;e[2960]=7514;e[2962]=7516;e[2963]=7517;e[2964]=7518;e[2966]=7520;e[2967]=7521;e[2968]=7522;e[2970]=7524;e[2971]=7525;e[2972]=7526;e[2974]=7528;e[2975]=7529;e[2976]=7530;e[2978]=1537;e[2979]=1538;e[2980]=1539;e[2982]=1549;e[2983]=1551;e[2984]=1552;e[2986]=1554;e[2987]=1555;e[2988]=1556;e[2990]=1623;e[2991]=1624;e[2995]=1775;e[2999]=1791;e[3002]=64290;e[3003]=64291;e[3004]=64292;e[3006]=64294;e[3007]=64295;e[3008]=64296;e[3011]=1900;e[3014]=8223;e[3015]=8244;e[3017]=7532;e[3018]=7533;e[3019]=7534;e[3075]=7590;e[3076]=7591;e[3079]=7594;e[3080]=7595;e[3083]=7598;e[3084]=7599;e[3087]=7602;e[3088]=7603;e[3091]=7606;e[3092]=7607;e[3095]=7610;e[3096]=7611;e[3099]=7614;e[3100]=7615;e[3103]=7618;e[3104]=7619;e[3107]=8337;e[3108]=8338;e[3116]=1884;e[3119]=1885;e[3120]=1885;e[3123]=1886;e[3124]=1886;e[3127]=1887;e[3128]=1887;e[3131]=1888;e[3132]=1888;e[3135]=1889;e[3136]=1889;e[3139]=1890;e[3140]=1890;e[3143]=1891;e[3144]=1891;e[3147]=1892;e[3148]=1892;e[3153]=580;e[3154]=581;e[3157]=584;e[3158]=585;e[3161]=588;e[3162]=589;e[3165]=891;e[3166]=892;e[3169]=1274;e[3170]=1275;e[3173]=1278;e[3174]=1279;e[3181]=7622;e[3182]=7623;e[3282]=11799;e[3316]=578;e[3379]=42785;e[3393]=1159;e[3416]=8377}));t.getGlyphMapForStandardFonts=h;const u=(0,r.getLookupTableFactory)((function(e){e[227]=322;e[264]=261;e[291]=346}));t.getSupplementalGlyphMapForArialBlack=u;const d=(0,r.getLookupTableFactory)((function(e){e[1]=32;e[4]=65;e[5]=192;e[6]=193;e[9]=196;e[17]=66;e[18]=67;e[21]=268;e[24]=68;e[28]=69;e[29]=200;e[30]=201;e[32]=282;e[38]=70;e[39]=71;e[44]=72;e[47]=73;e[48]=204;e[49]=205;e[58]=74;e[60]=75;e[62]=76;e[68]=77;e[69]=78;e[75]=79;e[76]=210;e[80]=214;e[87]=80;e[89]=81;e[90]=82;e[92]=344;e[94]=83;e[97]=352;e[100]=84;e[104]=85;e[109]=220;e[115]=86;e[116]=87;e[121]=88;e[122]=89;e[124]=221;e[127]=90;e[129]=381;e[258]=97;e[259]=224;e[260]=225;e[263]=228;e[268]=261;e[271]=98;e[272]=99;e[273]=263;e[275]=269;e[282]=100;e[286]=101;e[287]=232;e[288]=233;e[290]=283;e[295]=281;e[296]=102;e[336]=103;e[346]=104;e[349]=105;e[350]=236;e[351]=237;e[361]=106;e[364]=107;e[367]=108;e[371]=322;e[373]=109;e[374]=110;e[381]=111;e[382]=242;e[383]=243;e[386]=246;e[393]=112;e[395]=113;e[396]=114;e[398]=345;e[400]=115;e[401]=347;e[403]=353;e[410]=116;e[437]=117;e[442]=252;e[448]=118;e[449]=119;e[454]=120;e[455]=121;e[457]=253;e[460]=122;e[462]=382;e[463]=380;e[853]=44;e[855]=58;e[856]=46;e[876]=47;e[878]=45;e[882]=45;e[894]=40;e[895]=41;e[896]=91;e[897]=93;e[923]=64;e[1004]=48;e[1005]=49;e[1006]=50;e[1007]=51;e[1008]=52;e[1009]=53;e[1010]=54;e[1011]=55;e[1012]=56;e[1013]=57;e[1081]=37;e[1085]=43;e[1086]=45}));t.getSupplementalGlyphMapForCalibri=d},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.ToUnicodeMap=t.IdentityToUnicodeMap=void 0;var r=a(2);t.ToUnicodeMap=class ToUnicodeMap{constructor(e=[]){this._map=e}get length(){return this._map.length}forEach(e){for(const t in this._map)e(t,this._map[t].charCodeAt(0))}has(e){return void 0!==this._map[e]}get(e){return this._map[e]}charCodeOf(e){const t=this._map;if(t.length<=65536)return t.indexOf(e);for(const a in t)if(t[a]===e)return 0|a;return-1}amend(e){for(const t in e)this._map[t]=e[t]}};t.IdentityToUnicodeMap=class IdentityToUnicodeMap{constructor(e,t){this.firstChar=e;this.lastChar=t}get length(){return this.lastChar+1-this.firstChar}forEach(e){for(let t=this.firstChar,a=this.lastChar;t<=a;t++)e(t,t)}has(e){return this.firstChar<=e&&e<=this.lastChar}get(e){if(this.firstChar<=e&&e<=this.lastChar)return String.fromCharCode(e)}charCodeOf(e){return Number.isInteger(e)&&e>=this.firstChar&&e<=this.lastChar?e:-1}amend(e){(0,r.unreachable)("Should not call amend()")}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.CFFFont=void 0;var r=a(33),n=a(36),i=a(2);t.CFFFont=class CFFFont{constructor(e,t){this.properties=t;const a=new r.CFFParser(e,t,n.SEAC_ANALYSIS_ENABLED);this.cff=a.parse();this.cff.duplicateFirstGlyph();const s=new r.CFFCompiler(this.cff);this.seacs=this.cff.seacs;try{this.data=s.compile()}catch(a){(0,i.warn)("Failed to compile font "+t.loadedName);this.data=e}this._createBuiltInEncoding()}get numGlyphs(){return this.cff.charStrings.count}getCharset(){return this.cff.charset.charset}getGlyphMapping(){const e=this.cff,t=this.properties,{cidToGidMap:a,cMap:r}=t,i=e.charset.charset;let s,o;if(t.composite){let t,n;if(a&&a.length>0){t=Object.create(null);for(let e=0,r=a.length;e<r;e++){const r=a[e];void 0!==r&&(t[r]=e)}}s=Object.create(null);if(e.isCIDFont)for(o=0;o<i.length;o++){const e=i[o];n=r.charCodeOf(e);t&&void 0!==t[n]&&(n=t[n]);s[n]=o}else for(o=0;o<e.charStrings.count;o++){n=r.charCodeOf(o);s[n]=o}return s}let c=e.encoding?e.encoding.encoding:null;t.isInternalFont&&(c=t.defaultEncoding);s=(0,n.type1FontGlyphMapping)(t,c,i);return s}hasGlyphId(e){return this.cff.hasGlyphId(e)}_createBuiltInEncoding(){const{charset:e,encoding:t}=this.cff;if(!e||!t)return;const a=e.charset,r=t.encoding,n=[];for(const e in r){const t=r[e];if(t>=0){const r=a[t];r&&(n[e]=r)}}n.length>0&&(this.properties.builtInEncoding=n)}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.FontRendererFactory=void 0;var r=a(2),n=a(33),i=a(37),s=a(35),o=a(8);function getUint32(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function getUint16(e,t){return e[t]<<8|e[t+1]}function getInt16(e,t){return(e[t]<<24|e[t+1]<<16)>>16}function getInt8(e,t){return e[t]<<24>>24}function getFloat214(e,t){return getInt16(e,t)/16384}function getSubroutineBias(e){const t=e.length;let a=32768;t<1240?a=107:t<33900&&(a=1131);return a}function parseCmap(e,t,a){const n=1===getUint16(e,t+2)?getUint32(e,t+8):getUint32(e,t+16),i=getUint16(e,t+n);let s,o,c;if(4===i){getUint16(e,t+n+2);const a=getUint16(e,t+n+6)>>1;o=t+n+14;s=[];for(c=0;c<a;c++,o+=2)s[c]={end:getUint16(e,o)};o+=2;for(c=0;c<a;c++,o+=2)s[c].start=getUint16(e,o);for(c=0;c<a;c++,o+=2)s[c].idDelta=getUint16(e,o);for(c=0;c<a;c++,o+=2){let t=getUint16(e,o);if(0!==t){s[c].ids=[];for(let a=0,r=s[c].end-s[c].start+1;a<r;a++){s[c].ids[a]=getUint16(e,o+t);t+=2}}}return s}if(12===i){const a=getUint32(e,t+n+12);o=t+n+16;s=[];for(c=0;c<a;c++){t=getUint32(e,o);s.push({start:t,end:getUint32(e,o+4),idDelta:getUint32(e,o+8)-t});o+=12}return s}throw new r.FormatError(`unsupported cmap: ${i}`)}function parseCff(e,t,a,r){const i=new n.CFFParser(new o.Stream(e,t,a-t),{},r).parse();return{glyphs:i.charStrings.objects,subrs:i.topDict.privateDict&&i.topDict.privateDict.subrsIndex&&i.topDict.privateDict.subrsIndex.objects,gsubrs:i.globalSubrIndex&&i.globalSubrIndex.objects,isCFFCIDFont:i.isCIDFont,fdSelect:i.fdSelect,fdArray:i.fdArray}}function lookupCmap(e,t){const a=t.codePointAt(0);let r=0,n=0,i=e.length-1;for(;n<i;){const t=n+i+1>>1;a<e[t].start?i=t-1:n=t}e[n].start<=a&&a<=e[n].end&&(r=e[n].idDelta+(e[n].ids?e[n].ids[a-e[n].start]:a)&65535);return{charCode:a,glyphId:r}}function compileGlyf(e,t,a){function moveTo(e,a){t.push({cmd:"moveTo",args:[e,a]})}function lineTo(e,a){t.push({cmd:"lineTo",args:[e,a]})}function quadraticCurveTo(e,a,r,n){t.push({cmd:"quadraticCurveTo",args:[e,a,r,n]})}let r=0;const n=getInt16(e,r);let i,s=0,o=0;r+=10;if(n<0)do{i=getUint16(e,r);const n=getUint16(e,r+2);r+=4;let c,l;if(1&i){if(2&i){c=getInt16(e,r);l=getInt16(e,r+2)}else{c=getUint16(e,r);l=getUint16(e,r+2)}r+=4}else if(2&i){c=getInt8(e,r++);l=getInt8(e,r++)}else{c=e[r++];l=e[r++]}if(2&i){s=c;o=l}else{s=0;o=0}let h=1,u=1,d=0,f=0;if(8&i){h=u=getFloat214(e,r);r+=2}else if(64&i){h=getFloat214(e,r);u=getFloat214(e,r+2);r+=4}else if(128&i){h=getFloat214(e,r);d=getFloat214(e,r+2);f=getFloat214(e,r+4);u=getFloat214(e,r+6);r+=8}const g=a.glyphs[n];if(g){t.push({cmd:"save"},{cmd:"transform",args:[h,d,f,u,s,o]});compileGlyf(g,t,a);t.push({cmd:"restore"})}}while(32&i);else{const t=[];let a,c;for(a=0;a<n;a++){t.push(getUint16(e,r));r+=2}r+=2+getUint16(e,r);const l=t.at(-1)+1,h=[];for(;h.length<l;){i=e[r++];let t=1;8&i&&(t+=e[r++]);for(;t-- >0;)h.push({flags:i})}for(a=0;a<l;a++){switch(18&h[a].flags){case 0:s+=getInt16(e,r);r+=2;break;case 2:s-=e[r++];break;case 18:s+=e[r++]}h[a].x=s}for(a=0;a<l;a++){switch(36&h[a].flags){case 0:o+=getInt16(e,r);r+=2;break;case 4:o-=e[r++];break;case 36:o+=e[r++]}h[a].y=o}let u=0;for(r=0;r<n;r++){const e=t[r],n=h.slice(u,e+1);if(1&n[0].flags)n.push(n[0]);else if(1&n.at(-1).flags)n.unshift(n.at(-1));else{const e={flags:1,x:(n[0].x+n.at(-1).x)/2,y:(n[0].y+n.at(-1).y)/2};n.unshift(e);n.push(e)}moveTo(n[0].x,n[0].y);for(a=1,c=n.length;a<c;a++)if(1&n[a].flags)lineTo(n[a].x,n[a].y);else if(1&n[a+1].flags){quadraticCurveTo(n[a].x,n[a].y,n[a+1].x,n[a+1].y);a++}else quadraticCurveTo(n[a].x,n[a].y,(n[a].x+n[a+1].x)/2,(n[a].y+n[a+1].y)/2);u=e+1}}}function compileCharString(e,t,a,n){function moveTo(e,a){t.push({cmd:"moveTo",args:[e,a]})}function lineTo(e,a){t.push({cmd:"lineTo",args:[e,a]})}function bezierCurveTo(e,a,r,n,i,s){t.push({cmd:"bezierCurveTo",args:[e,a,r,n,i,s]})}const i=[];let o=0,c=0,l=0;!function parse(e){let h=0;for(;h<e.length;){let u,d,f,g,p,m,b,y,w,S=!1,x=e[h++];switch(x){case 1:case 3:case 18:case 23:l+=i.length>>1;S=!0;break;case 4:c+=i.pop();moveTo(o,c);S=!0;break;case 5:for(;i.length>0;){o+=i.shift();c+=i.shift();lineTo(o,c)}break;case 6:for(;i.length>0;){o+=i.shift();lineTo(o,c);if(0===i.length)break;c+=i.shift();lineTo(o,c)}break;case 7:for(;i.length>0;){c+=i.shift();lineTo(o,c);if(0===i.length)break;o+=i.shift();lineTo(o,c)}break;case 8:for(;i.length>0;){u=o+i.shift();f=c+i.shift();d=u+i.shift();g=f+i.shift();o=d+i.shift();c=g+i.shift();bezierCurveTo(u,f,d,g,o,c)}break;case 10:y=i.pop();w=null;if(a.isCFFCIDFont){const e=a.fdSelect.getFDIndex(n);if(e>=0&&e<a.fdArray.length){const t=a.fdArray[e];let r;t.privateDict&&t.privateDict.subrsIndex&&(r=t.privateDict.subrsIndex.objects);if(r){y+=getSubroutineBias(r);w=r[y]}}else(0,r.warn)("Invalid fd index for glyph index.")}else w=a.subrs[y+a.subrsBias];w&&parse(w);break;case 11:return;case 12:x=e[h++];switch(x){case 34:u=o+i.shift();d=u+i.shift();p=c+i.shift();o=d+i.shift();bezierCurveTo(u,c,d,p,o,p);u=o+i.shift();d=u+i.shift();o=d+i.shift();bezierCurveTo(u,p,d,c,o,c);break;case 35:u=o+i.shift();f=c+i.shift();d=u+i.shift();g=f+i.shift();o=d+i.shift();c=g+i.shift();bezierCurveTo(u,f,d,g,o,c);u=o+i.shift();f=c+i.shift();d=u+i.shift();g=f+i.shift();o=d+i.shift();c=g+i.shift();bezierCurveTo(u,f,d,g,o,c);i.pop();break;case 36:u=o+i.shift();p=c+i.shift();d=u+i.shift();m=p+i.shift();o=d+i.shift();bezierCurveTo(u,p,d,m,o,m);u=o+i.shift();d=u+i.shift();b=m+i.shift();o=d+i.shift();bezierCurveTo(u,m,d,b,o,c);break;case 37:const e=o,t=c;u=o+i.shift();f=c+i.shift();d=u+i.shift();g=f+i.shift();o=d+i.shift();c=g+i.shift();bezierCurveTo(u,f,d,g,o,c);u=o+i.shift();f=c+i.shift();d=u+i.shift();g=f+i.shift();o=d;c=g;Math.abs(o-e)>Math.abs(c-t)?o+=i.shift():c+=i.shift();bezierCurveTo(u,f,d,g,o,c);break;default:throw new r.FormatError(`unknown operator: 12 ${x}`)}break;case 14:if(i.length>=4){const e=i.pop(),r=i.pop();c=i.pop();o=i.pop();t.push({cmd:"save"},{cmd:"translate",args:[o,c]});let n=lookupCmap(a.cmap,String.fromCharCode(a.glyphNameMap[s.StandardEncoding[e]]));compileCharString(a.glyphs[n.glyphId],t,a,n.glyphId);t.push({cmd:"restore"});n=lookupCmap(a.cmap,String.fromCharCode(a.glyphNameMap[s.StandardEncoding[r]]));compileCharString(a.glyphs[n.glyphId],t,a,n.glyphId)}return;case 19:case 20:l+=i.length>>1;h+=l+7>>3;S=!0;break;case 21:c+=i.pop();o+=i.pop();moveTo(o,c);S=!0;break;case 22:o+=i.pop();moveTo(o,c);S=!0;break;case 24:for(;i.length>2;){u=o+i.shift();f=c+i.shift();d=u+i.shift();g=f+i.shift();o=d+i.shift();c=g+i.shift();bezierCurveTo(u,f,d,g,o,c)}o+=i.shift();c+=i.shift();lineTo(o,c);break;case 25:for(;i.length>6;){o+=i.shift();c+=i.shift();lineTo(o,c)}u=o+i.shift();f=c+i.shift();d=u+i.shift();g=f+i.shift();o=d+i.shift();c=g+i.shift();bezierCurveTo(u,f,d,g,o,c);break;case 26:i.length%2&&(o+=i.shift());for(;i.length>0;){u=o;f=c+i.shift();d=u+i.shift();g=f+i.shift();o=d;c=g+i.shift();bezierCurveTo(u,f,d,g,o,c)}break;case 27:i.length%2&&(c+=i.shift());for(;i.length>0;){u=o+i.shift();f=c;d=u+i.shift();g=f+i.shift();o=d+i.shift();c=g;bezierCurveTo(u,f,d,g,o,c)}break;case 28:i.push((e[h]<<24|e[h+1]<<16)>>16);h+=2;break;case 29:y=i.pop()+a.gsubrsBias;w=a.gsubrs[y];w&&parse(w);break;case 30:for(;i.length>0;){u=o;f=c+i.shift();d=u+i.shift();g=f+i.shift();o=d+i.shift();c=g+(1===i.length?i.shift():0);bezierCurveTo(u,f,d,g,o,c);if(0===i.length)break;u=o+i.shift();f=c;d=u+i.shift();g=f+i.shift();c=g+i.shift();o=d+(1===i.length?i.shift():0);bezierCurveTo(u,f,d,g,o,c)}break;case 31:for(;i.length>0;){u=o+i.shift();f=c;d=u+i.shift();g=f+i.shift();c=g+i.shift();o=d+(1===i.length?i.shift():0);bezierCurveTo(u,f,d,g,o,c);if(0===i.length)break;u=o;f=c+i.shift();d=u+i.shift();g=f+i.shift();o=d+i.shift();c=g+(1===i.length?i.shift():0);bezierCurveTo(u,f,d,g,o,c)}break;default:if(x<32)throw new r.FormatError(`unknown operator: ${x}`);if(x<247)i.push(x-139);else if(x<251)i.push(256*(x-247)+e[h++]+108);else if(x<255)i.push(256*-(x-251)-e[h++]-108);else{i.push((e[h]<<24|e[h+1]<<16|e[h+2]<<8|e[h+3])/65536);h+=4}}S&&(i.length=0)}}(e)}const c=[];class CompiledFont{constructor(e){this.constructor===CompiledFont&&(0,r.unreachable)("Cannot initialize CompiledFont.");this.fontMatrix=e;this.compiledGlyphs=Object.create(null);this.compiledCharCodeToGlyphId=Object.create(null)}getPathJs(e){const{charCode:t,glyphId:a}=lookupCmap(this.cmap,e);let r=this.compiledGlyphs[a];if(!r)try{r=this.compileGlyph(this.glyphs[a],a);this.compiledGlyphs[a]=r}catch(e){this.compiledGlyphs[a]=c;void 0===this.compiledCharCodeToGlyphId[t]&&(this.compiledCharCodeToGlyphId[t]=a);throw e}void 0===this.compiledCharCodeToGlyphId[t]&&(this.compiledCharCodeToGlyphId[t]=a);return r}compileGlyph(e,t){if(!e||0===e.length||14===e[0])return c;let a=this.fontMatrix;if(this.isCFFCIDFont){const e=this.fdSelect.getFDIndex(t);if(e>=0&&e<this.fdArray.length){a=this.fdArray[e].getByName("FontMatrix")||r.FONT_IDENTITY_MATRIX}else(0,r.warn)("Invalid fd index for glyph index.")}const n=[{cmd:"save"},{cmd:"transform",args:a.slice()},{cmd:"scale",args:["size","-size"]}];this.compileGlyphImpl(e,n,t);n.push({cmd:"restore"});return n}compileGlyphImpl(){(0,r.unreachable)("Children classes should implement this.")}hasBuiltPath(e){const{charCode:t,glyphId:a}=lookupCmap(this.cmap,e);return void 0!==this.compiledGlyphs[a]&&void 0!==this.compiledCharCodeToGlyphId[t]}}class TrueTypeCompiled extends CompiledFont{constructor(e,t,a){super(a||[488e-6,0,0,488e-6,0,0]);this.glyphs=e;this.cmap=t}compileGlyphImpl(e,t){compileGlyf(e,t,this)}}class Type2Compiled extends CompiledFont{constructor(e,t,a,r){super(a||[.001,0,0,.001,0,0]);this.glyphs=e.glyphs;this.gsubrs=e.gsubrs||[];this.subrs=e.subrs||[];this.cmap=t;this.glyphNameMap=r||(0,i.getGlyphsUnicode)();this.gsubrsBias=getSubroutineBias(this.gsubrs);this.subrsBias=getSubroutineBias(this.subrs);this.isCFFCIDFont=e.isCFFCIDFont;this.fdSelect=e.fdSelect;this.fdArray=e.fdArray}compileGlyphImpl(e,t,a){compileCharString(e,t,this,a)}}t.FontRendererFactory=class FontRendererFactory{static create(e,t){const a=new Uint8Array(e.data);let n,i,s,o,c,l;const h=getUint16(a,4);for(let e=0,u=12;e<h;e++,u+=16){const e=(0,r.bytesToString)(a.subarray(u,u+4)),h=getUint32(a,u+8),d=getUint32(a,u+12);switch(e){case"cmap":n=parseCmap(a,h);break;case"glyf":i=a.subarray(h,h+d);break;case"loca":s=a.subarray(h,h+d);break;case"head":l=getUint16(a,h+18);c=getUint16(a,h+50);break;case"CFF ":o=parseCff(a,h,h+d,t)}}if(i){const t=l?[1/l,0,0,1/l,0,0]:e.fontMatrix;return new TrueTypeCompiled(function parseGlyfTable(e,t,a){let r,n;if(a){r=4;n=getUint32}else{r=2;n=(e,t)=>2*getUint16(e,t)}const i=[];let s=n(t,0);for(let a=r;a<t.length;a+=r){const r=n(t,a);i.push(e.subarray(s,r));s=r}return i}(i,s,c),n,t)}return new Type2Compiled(o,n,e.fontMatrix,e.glyphNameMap)}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.getMetrics=t.getFontBasicMetrics=void 0;var r=a(3);const n=(0,r.getLookupTableFactory)((function(e){e.Courier=600;e["Courier-Bold"]=600;e["Courier-BoldOblique"]=600;e["Courier-Oblique"]=600;e.Helvetica=(0,r.getLookupTableFactory)((function(e){e.space=278;e.exclam=278;e.quotedbl=355;e.numbersign=556;e.dollar=556;e.percent=889;e.ampersand=667;e.quoteright=222;e.parenleft=333;e.parenright=333;e.asterisk=389;e.plus=584;e.comma=278;e.hyphen=333;e.period=278;e.slash=278;e.zero=556;e.one=556;e.two=556;e.three=556;e.four=556;e.five=556;e.six=556;e.seven=556;e.eight=556;e.nine=556;e.colon=278;e.semicolon=278;e.less=584;e.equal=584;e.greater=584;e.question=556;e.at=1015;e.A=667;e.B=667;e.C=722;e.D=722;e.E=667;e.F=611;e.G=778;e.H=722;e.I=278;e.J=500;e.K=667;e.L=556;e.M=833;e.N=722;e.O=778;e.P=667;e.Q=778;e.R=722;e.S=667;e.T=611;e.U=722;e.V=667;e.W=944;e.X=667;e.Y=667;e.Z=611;e.bracketleft=278;e.backslash=278;e.bracketright=278;e.asciicircum=469;e.underscore=556;e.quoteleft=222;e.a=556;e.b=556;e.c=500;e.d=556;e.e=556;e.f=278;e.g=556;e.h=556;e.i=222;e.j=222;e.k=500;e.l=222;e.m=833;e.n=556;e.o=556;e.p=556;e.q=556;e.r=333;e.s=500;e.t=278;e.u=556;e.v=500;e.w=722;e.x=500;e.y=500;e.z=500;e.braceleft=334;e.bar=260;e.braceright=334;e.asciitilde=584;e.exclamdown=333;e.cent=556;e.sterling=556;e.fraction=167;e.yen=556;e.florin=556;e.section=556;e.currency=556;e.quotesingle=191;e.quotedblleft=333;e.guillemotleft=556;e.guilsinglleft=333;e.guilsinglright=333;e.fi=500;e.fl=500;e.endash=556;e.dagger=556;e.daggerdbl=556;e.periodcentered=278;e.paragraph=537;e.bullet=350;e.quotesinglbase=222;e.quotedblbase=333;e.quotedblright=333;e.guillemotright=556;e.ellipsis=1e3;e.perthousand=1e3;e.questiondown=611;e.grave=333;e.acute=333;e.circumflex=333;e.tilde=333;e.macron=333;e.breve=333;e.dotaccent=333;e.dieresis=333;e.ring=333;e.cedilla=333;e.hungarumlaut=333;e.ogonek=333;e.caron=333;e.emdash=1e3;e.AE=1e3;e.ordfeminine=370;e.Lslash=556;e.Oslash=778;e.OE=1e3;e.ordmasculine=365;e.ae=889;e.dotlessi=278;e.lslash=222;e.oslash=611;e.oe=944;e.germandbls=611;e.Idieresis=278;e.eacute=556;e.abreve=556;e.uhungarumlaut=556;e.ecaron=556;e.Ydieresis=667;e.divide=584;e.Yacute=667;e.Acircumflex=667;e.aacute=556;e.Ucircumflex=722;e.yacute=500;e.scommaaccent=500;e.ecircumflex=556;e.Uring=722;e.Udieresis=722;e.aogonek=556;e.Uacute=722;e.uogonek=556;e.Edieresis=667;e.Dcroat=722;e.commaaccent=250;e.copyright=737;e.Emacron=667;e.ccaron=500;e.aring=556;e.Ncommaaccent=722;e.lacute=222;e.agrave=556;e.Tcommaaccent=611;e.Cacute=722;e.atilde=556;e.Edotaccent=667;e.scaron=500;e.scedilla=500;e.iacute=278;e.lozenge=471;e.Rcaron=722;e.Gcommaaccent=778;e.ucircumflex=556;e.acircumflex=556;e.Amacron=667;e.rcaron=333;e.ccedilla=500;e.Zdotaccent=611;e.Thorn=667;e.Omacron=778;e.Racute=722;e.Sacute=667;e.dcaron=643;e.Umacron=722;e.uring=556;e.threesuperior=333;e.Ograve=778;e.Agrave=667;e.Abreve=667;e.multiply=584;e.uacute=556;e.Tcaron=611;e.partialdiff=476;e.ydieresis=500;e.Nacute=722;e.icircumflex=278;e.Ecircumflex=667;e.adieresis=556;e.edieresis=556;e.cacute=500;e.nacute=556;e.umacron=556;e.Ncaron=722;e.Iacute=278;e.plusminus=584;e.brokenbar=260;e.registered=737;e.Gbreve=778;e.Idotaccent=278;e.summation=600;e.Egrave=667;e.racute=333;e.omacron=556;e.Zacute=611;e.Zcaron=611;e.greaterequal=549;e.Eth=722;e.Ccedilla=722;e.lcommaaccent=222;e.tcaron=317;e.eogonek=556;e.Uogonek=722;e.Aacute=667;e.Adieresis=667;e.egrave=556;e.zacute=500;e.iogonek=222;e.Oacute=778;e.oacute=556;e.amacron=556;e.sacute=500;e.idieresis=278;e.Ocircumflex=778;e.Ugrave=722;e.Delta=612;e.thorn=556;e.twosuperior=333;e.Odieresis=778;e.mu=556;e.igrave=278;e.ohungarumlaut=556;e.Eogonek=667;e.dcroat=556;e.threequarters=834;e.Scedilla=667;e.lcaron=299;e.Kcommaaccent=667;e.Lacute=556;e.trademark=1e3;e.edotaccent=556;e.Igrave=278;e.Imacron=278;e.Lcaron=556;e.onehalf=834;e.lessequal=549;e.ocircumflex=556;e.ntilde=556;e.Uhungarumlaut=722;e.Eacute=667;e.emacron=556;e.gbreve=556;e.onequarter=834;e.Scaron=667;e.Scommaaccent=667;e.Ohungarumlaut=778;e.degree=400;e.ograve=556;e.Ccaron=722;e.ugrave=556;e.radical=453;e.Dcaron=722;e.rcommaaccent=333;e.Ntilde=722;e.otilde=556;e.Rcommaaccent=722;e.Lcommaaccent=556;e.Atilde=667;e.Aogonek=667;e.Aring=667;e.Otilde=778;e.zdotaccent=500;e.Ecaron=667;e.Iogonek=278;e.kcommaaccent=500;e.minus=584;e.Icircumflex=278;e.ncaron=556;e.tcommaaccent=278;e.logicalnot=584;e.odieresis=556;e.udieresis=556;e.notequal=549;e.gcommaaccent=556;e.eth=556;e.zcaron=500;e.ncommaaccent=556;e.onesuperior=333;e.imacron=278;e.Euro=556}));e["Helvetica-Bold"]=(0,r.getLookupTableFactory)((function(e){e.space=278;e.exclam=333;e.quotedbl=474;e.numbersign=556;e.dollar=556;e.percent=889;e.ampersand=722;e.quoteright=278;e.parenleft=333;e.parenright=333;e.asterisk=389;e.plus=584;e.comma=278;e.hyphen=333;e.period=278;e.slash=278;e.zero=556;e.one=556;e.two=556;e.three=556;e.four=556;e.five=556;e.six=556;e.seven=556;e.eight=556;e.nine=556;e.colon=333;e.semicolon=333;e.less=584;e.equal=584;e.greater=584;e.question=611;e.at=975;e.A=722;e.B=722;e.C=722;e.D=722;e.E=667;e.F=611;e.G=778;e.H=722;e.I=278;e.J=556;e.K=722;e.L=611;e.M=833;e.N=722;e.O=778;e.P=667;e.Q=778;e.R=722;e.S=667;e.T=611;e.U=722;e.V=667;e.W=944;e.X=667;e.Y=667;e.Z=611;e.bracketleft=333;e.backslash=278;e.bracketright=333;e.asciicircum=584;e.underscore=556;e.quoteleft=278;e.a=556;e.b=611;e.c=556;e.d=611;e.e=556;e.f=333;e.g=611;e.h=611;e.i=278;e.j=278;e.k=556;e.l=278;e.m=889;e.n=611;e.o=611;e.p=611;e.q=611;e.r=389;e.s=556;e.t=333;e.u=611;e.v=556;e.w=778;e.x=556;e.y=556;e.z=500;e.braceleft=389;e.bar=280;e.braceright=389;e.asciitilde=584;e.exclamdown=333;e.cent=556;e.sterling=556;e.fraction=167;e.yen=556;e.florin=556;e.section=556;e.currency=556;e.quotesingle=238;e.quotedblleft=500;e.guillemotleft=556;e.guilsinglleft=333;e.guilsinglright=333;e.fi=611;e.fl=611;e.endash=556;e.dagger=556;e.daggerdbl=556;e.periodcentered=278;e.paragraph=556;e.bullet=350;e.quotesinglbase=278;e.quotedblbase=500;e.quotedblright=500;e.guillemotright=556;e.ellipsis=1e3;e.perthousand=1e3;e.questiondown=611;e.grave=333;e.acute=333;e.circumflex=333;e.tilde=333;e.macron=333;e.breve=333;e.dotaccent=333;e.dieresis=333;e.ring=333;e.cedilla=333;e.hungarumlaut=333;e.ogonek=333;e.caron=333;e.emdash=1e3;e.AE=1e3;e.ordfeminine=370;e.Lslash=611;e.Oslash=778;e.OE=1e3;e.ordmasculine=365;e.ae=889;e.dotlessi=278;e.lslash=278;e.oslash=611;e.oe=944;e.germandbls=611;e.Idieresis=278;e.eacute=556;e.abreve=556;e.uhungarumlaut=611;e.ecaron=556;e.Ydieresis=667;e.divide=584;e.Yacute=667;e.Acircumflex=722;e.aacute=556;e.Ucircumflex=722;e.yacute=556;e.scommaaccent=556;e.ecircumflex=556;e.Uring=722;e.Udieresis=722;e.aogonek=556;e.Uacute=722;e.uogonek=611;e.Edieresis=667;e.Dcroat=722;e.commaaccent=250;e.copyright=737;e.Emacron=667;e.ccaron=556;e.aring=556;e.Ncommaaccent=722;e.lacute=278;e.agrave=556;e.Tcommaaccent=611;e.Cacute=722;e.atilde=556;e.Edotaccent=667;e.scaron=556;e.scedilla=556;e.iacute=278;e.lozenge=494;e.Rcaron=722;e.Gcommaaccent=778;e.ucircumflex=611;e.acircumflex=556;e.Amacron=722;e.rcaron=389;e.ccedilla=556;e.Zdotaccent=611;e.Thorn=667;e.Omacron=778;e.Racute=722;e.Sacute=667;e.dcaron=743;e.Umacron=722;e.uring=611;e.threesuperior=333;e.Ograve=778;e.Agrave=722;e.Abreve=722;e.multiply=584;e.uacute=611;e.Tcaron=611;e.partialdiff=494;e.ydieresis=556;e.Nacute=722;e.icircumflex=278;e.Ecircumflex=667;e.adieresis=556;e.edieresis=556;e.cacute=556;e.nacute=611;e.umacron=611;e.Ncaron=722;e.Iacute=278;e.plusminus=584;e.brokenbar=280;e.registered=737;e.Gbreve=778;e.Idotaccent=278;e.summation=600;e.Egrave=667;e.racute=389;e.omacron=611;e.Zacute=611;e.Zcaron=611;e.greaterequal=549;e.Eth=722;e.Ccedilla=722;e.lcommaaccent=278;e.tcaron=389;e.eogonek=556;e.Uogonek=722;e.Aacute=722;e.Adieresis=722;e.egrave=556;e.zacute=500;e.iogonek=278;e.Oacute=778;e.oacute=611;e.amacron=556;e.sacute=556;e.idieresis=278;e.Ocircumflex=778;e.Ugrave=722;e.Delta=612;e.thorn=611;e.twosuperior=333;e.Odieresis=778;e.mu=611;e.igrave=278;e.ohungarumlaut=611;e.Eogonek=667;e.dcroat=611;e.threequarters=834;e.Scedilla=667;e.lcaron=400;e.Kcommaaccent=722;e.Lacute=611;e.trademark=1e3;e.edotaccent=556;e.Igrave=278;e.Imacron=278;e.Lcaron=611;e.onehalf=834;e.lessequal=549;e.ocircumflex=611;e.ntilde=611;e.Uhungarumlaut=722;e.Eacute=667;e.emacron=556;e.gbreve=611;e.onequarter=834;e.Scaron=667;e.Scommaaccent=667;e.Ohungarumlaut=778;e.degree=400;e.ograve=611;e.Ccaron=722;e.ugrave=611;e.radical=549;e.Dcaron=722;e.rcommaaccent=389;e.Ntilde=722;e.otilde=611;e.Rcommaaccent=722;e.Lcommaaccent=611;e.Atilde=722;e.Aogonek=722;e.Aring=722;e.Otilde=778;e.zdotaccent=500;e.Ecaron=667;e.Iogonek=278;e.kcommaaccent=556;e.minus=584;e.Icircumflex=278;e.ncaron=611;e.tcommaaccent=333;e.logicalnot=584;e.odieresis=611;e.udieresis=611;e.notequal=549;e.gcommaaccent=611;e.eth=611;e.zcaron=500;e.ncommaaccent=611;e.onesuperior=333;e.imacron=278;e.Euro=556}));e["Helvetica-BoldOblique"]=(0,r.getLookupTableFactory)((function(e){e.space=278;e.exclam=333;e.quotedbl=474;e.numbersign=556;e.dollar=556;e.percent=889;e.ampersand=722;e.quoteright=278;e.parenleft=333;e.parenright=333;e.asterisk=389;e.plus=584;e.comma=278;e.hyphen=333;e.period=278;e.slash=278;e.zero=556;e.one=556;e.two=556;e.three=556;e.four=556;e.five=556;e.six=556;e.seven=556;e.eight=556;e.nine=556;e.colon=333;e.semicolon=333;e.less=584;e.equal=584;e.greater=584;e.question=611;e.at=975;e.A=722;e.B=722;e.C=722;e.D=722;e.E=667;e.F=611;e.G=778;e.H=722;e.I=278;e.J=556;e.K=722;e.L=611;e.M=833;e.N=722;e.O=778;e.P=667;e.Q=778;e.R=722;e.S=667;e.T=611;e.U=722;e.V=667;e.W=944;e.X=667;e.Y=667;e.Z=611;e.bracketleft=333;e.backslash=278;e.bracketright=333;e.asciicircum=584;e.underscore=556;e.quoteleft=278;e.a=556;e.b=611;e.c=556;e.d=611;e.e=556;e.f=333;e.g=611;e.h=611;e.i=278;e.j=278;e.k=556;e.l=278;e.m=889;e.n=611;e.o=611;e.p=611;e.q=611;e.r=389;e.s=556;e.t=333;e.u=611;e.v=556;e.w=778;e.x=556;e.y=556;e.z=500;e.braceleft=389;e.bar=280;e.braceright=389;e.asciitilde=584;e.exclamdown=333;e.cent=556;e.sterling=556;e.fraction=167;e.yen=556;e.florin=556;e.section=556;e.currency=556;e.quotesingle=238;e.quotedblleft=500;e.guillemotleft=556;e.guilsinglleft=333;e.guilsinglright=333;e.fi=611;e.fl=611;e.endash=556;e.dagger=556;e.daggerdbl=556;e.periodcentered=278;e.paragraph=556;e.bullet=350;e.quotesinglbase=278;e.quotedblbase=500;e.quotedblright=500;e.guillemotright=556;e.ellipsis=1e3;e.perthousand=1e3;e.questiondown=611;e.grave=333;e.acute=333;e.circumflex=333;e.tilde=333;e.macron=333;e.breve=333;e.dotaccent=333;e.dieresis=333;e.ring=333;e.cedilla=333;e.hungarumlaut=333;e.ogonek=333;e.caron=333;e.emdash=1e3;e.AE=1e3;e.ordfeminine=370;e.Lslash=611;e.Oslash=778;e.OE=1e3;e.ordmasculine=365;e.ae=889;e.dotlessi=278;e.lslash=278;e.oslash=611;e.oe=944;e.germandbls=611;e.Idieresis=278;e.eacute=556;e.abreve=556;e.uhungarumlaut=611;e.ecaron=556;e.Ydieresis=667;e.divide=584;e.Yacute=667;e.Acircumflex=722;e.aacute=556;e.Ucircumflex=722;e.yacute=556;e.scommaaccent=556;e.ecircumflex=556;e.Uring=722;e.Udieresis=722;e.aogonek=556;e.Uacute=722;e.uogonek=611;e.Edieresis=667;e.Dcroat=722;e.commaaccent=250;e.copyright=737;e.Emacron=667;e.ccaron=556;e.aring=556;e.Ncommaaccent=722;e.lacute=278;e.agrave=556;e.Tcommaaccent=611;e.Cacute=722;e.atilde=556;e.Edotaccent=667;e.scaron=556;e.scedilla=556;e.iacute=278;e.lozenge=494;e.Rcaron=722;e.Gcommaaccent=778;e.ucircumflex=611;e.acircumflex=556;e.Amacron=722;e.rcaron=389;e.ccedilla=556;e.Zdotaccent=611;e.Thorn=667;e.Omacron=778;e.Racute=722;e.Sacute=667;e.dcaron=743;e.Umacron=722;e.uring=611;e.threesuperior=333;e.Ograve=778;e.Agrave=722;e.Abreve=722;e.multiply=584;e.uacute=611;e.Tcaron=611;e.partialdiff=494;e.ydieresis=556;e.Nacute=722;e.icircumflex=278;e.Ecircumflex=667;e.adieresis=556;e.edieresis=556;e.cacute=556;e.nacute=611;e.umacron=611;e.Ncaron=722;e.Iacute=278;e.plusminus=584;e.brokenbar=280;e.registered=737;e.Gbreve=778;e.Idotaccent=278;e.summation=600;e.Egrave=667;e.racute=389;e.omacron=611;e.Zacute=611;e.Zcaron=611;e.greaterequal=549;e.Eth=722;e.Ccedilla=722;e.lcommaaccent=278;e.tcaron=389;e.eogonek=556;e.Uogonek=722;e.Aacute=722;e.Adieresis=722;e.egrave=556;e.zacute=500;e.iogonek=278;e.Oacute=778;e.oacute=611;e.amacron=556;e.sacute=556;e.idieresis=278;e.Ocircumflex=778;e.Ugrave=722;e.Delta=612;e.thorn=611;e.twosuperior=333;e.Odieresis=778;e.mu=611;e.igrave=278;e.ohungarumlaut=611;e.Eogonek=667;e.dcroat=611;e.threequarters=834;e.Scedilla=667;e.lcaron=400;e.Kcommaaccent=722;e.Lacute=611;e.trademark=1e3;e.edotaccent=556;e.Igrave=278;e.Imacron=278;e.Lcaron=611;e.onehalf=834;e.lessequal=549;e.ocircumflex=611;e.ntilde=611;e.Uhungarumlaut=722;e.Eacute=667;e.emacron=556;e.gbreve=611;e.onequarter=834;e.Scaron=667;e.Scommaaccent=667;e.Ohungarumlaut=778;e.degree=400;e.ograve=611;e.Ccaron=722;e.ugrave=611;e.radical=549;e.Dcaron=722;e.rcommaaccent=389;e.Ntilde=722;e.otilde=611;e.Rcommaaccent=722;e.Lcommaaccent=611;e.Atilde=722;e.Aogonek=722;e.Aring=722;e.Otilde=778;e.zdotaccent=500;e.Ecaron=667;e.Iogonek=278;e.kcommaaccent=556;e.minus=584;e.Icircumflex=278;e.ncaron=611;e.tcommaaccent=333;e.logicalnot=584;e.odieresis=611;e.udieresis=611;e.notequal=549;e.gcommaaccent=611;e.eth=611;e.zcaron=500;e.ncommaaccent=611;e.onesuperior=333;e.imacron=278;e.Euro=556}));e["Helvetica-Oblique"]=(0,r.getLookupTableFactory)((function(e){e.space=278;e.exclam=278;e.quotedbl=355;e.numbersign=556;e.dollar=556;e.percent=889;e.ampersand=667;e.quoteright=222;e.parenleft=333;e.parenright=333;e.asterisk=389;e.plus=584;e.comma=278;e.hyphen=333;e.period=278;e.slash=278;e.zero=556;e.one=556;e.two=556;e.three=556;e.four=556;e.five=556;e.six=556;e.seven=556;e.eight=556;e.nine=556;e.colon=278;e.semicolon=278;e.less=584;e.equal=584;e.greater=584;e.question=556;e.at=1015;e.A=667;e.B=667;e.C=722;e.D=722;e.E=667;e.F=611;e.G=778;e.H=722;e.I=278;e.J=500;e.K=667;e.L=556;e.M=833;e.N=722;e.O=778;e.P=667;e.Q=778;e.R=722;e.S=667;e.T=611;e.U=722;e.V=667;e.W=944;e.X=667;e.Y=667;e.Z=611;e.bracketleft=278;e.backslash=278;e.bracketright=278;e.asciicircum=469;e.underscore=556;e.quoteleft=222;e.a=556;e.b=556;e.c=500;e.d=556;e.e=556;e.f=278;e.g=556;e.h=556;e.i=222;e.j=222;e.k=500;e.l=222;e.m=833;e.n=556;e.o=556;e.p=556;e.q=556;e.r=333;e.s=500;e.t=278;e.u=556;e.v=500;e.w=722;e.x=500;e.y=500;e.z=500;e.braceleft=334;e.bar=260;e.braceright=334;e.asciitilde=584;e.exclamdown=333;e.cent=556;e.sterling=556;e.fraction=167;e.yen=556;e.florin=556;e.section=556;e.currency=556;e.quotesingle=191;e.quotedblleft=333;e.guillemotleft=556;e.guilsinglleft=333;e.guilsinglright=333;e.fi=500;e.fl=500;e.endash=556;e.dagger=556;e.daggerdbl=556;e.periodcentered=278;e.paragraph=537;e.bullet=350;e.quotesinglbase=222;e.quotedblbase=333;e.quotedblright=333;e.guillemotright=556;e.ellipsis=1e3;e.perthousand=1e3;e.questiondown=611;e.grave=333;e.acute=333;e.circumflex=333;e.tilde=333;e.macron=333;e.breve=333;e.dotaccent=333;e.dieresis=333;e.ring=333;e.cedilla=333;e.hungarumlaut=333;e.ogonek=333;e.caron=333;e.emdash=1e3;e.AE=1e3;e.ordfeminine=370;e.Lslash=556;e.Oslash=778;e.OE=1e3;e.ordmasculine=365;e.ae=889;e.dotlessi=278;e.lslash=222;e.oslash=611;e.oe=944;e.germandbls=611;e.Idieresis=278;e.eacute=556;e.abreve=556;e.uhungarumlaut=556;e.ecaron=556;e.Ydieresis=667;e.divide=584;e.Yacute=667;e.Acircumflex=667;e.aacute=556;e.Ucircumflex=722;e.yacute=500;e.scommaaccent=500;e.ecircumflex=556;e.Uring=722;e.Udieresis=722;e.aogonek=556;e.Uacute=722;e.uogonek=556;e.Edieresis=667;e.Dcroat=722;e.commaaccent=250;e.copyright=737;e.Emacron=667;e.ccaron=500;e.aring=556;e.Ncommaaccent=722;e.lacute=222;e.agrave=556;e.Tcommaaccent=611;e.Cacute=722;e.atilde=556;e.Edotaccent=667;e.scaron=500;e.scedilla=500;e.iacute=278;e.lozenge=471;e.Rcaron=722;e.Gcommaaccent=778;e.ucircumflex=556;e.acircumflex=556;e.Amacron=667;e.rcaron=333;e.ccedilla=500;e.Zdotaccent=611;e.Thorn=667;e.Omacron=778;e.Racute=722;e.Sacute=667;e.dcaron=643;e.Umacron=722;e.uring=556;e.threesuperior=333;e.Ograve=778;e.Agrave=667;e.Abreve=667;e.multiply=584;e.uacute=556;e.Tcaron=611;e.partialdiff=476;e.ydieresis=500;e.Nacute=722;e.icircumflex=278;e.Ecircumflex=667;e.adieresis=556;e.edieresis=556;e.cacute=500;e.nacute=556;e.umacron=556;e.Ncaron=722;e.Iacute=278;e.plusminus=584;e.brokenbar=260;e.registered=737;e.Gbreve=778;e.Idotaccent=278;e.summation=600;e.Egrave=667;e.racute=333;e.omacron=556;e.Zacute=611;e.Zcaron=611;e.greaterequal=549;e.Eth=722;e.Ccedilla=722;e.lcommaaccent=222;e.tcaron=317;e.eogonek=556;e.Uogonek=722;e.Aacute=667;e.Adieresis=667;e.egrave=556;e.zacute=500;e.iogonek=222;e.Oacute=778;e.oacute=556;e.amacron=556;e.sacute=500;e.idieresis=278;e.Ocircumflex=778;e.Ugrave=722;e.Delta=612;e.thorn=556;e.twosuperior=333;e.Odieresis=778;e.mu=556;e.igrave=278;e.ohungarumlaut=556;e.Eogonek=667;e.dcroat=556;e.threequarters=834;e.Scedilla=667;e.lcaron=299;e.Kcommaaccent=667;e.Lacute=556;e.trademark=1e3;e.edotaccent=556;e.Igrave=278;e.Imacron=278;e.Lcaron=556;e.onehalf=834;e.lessequal=549;e.ocircumflex=556;e.ntilde=556;e.Uhungarumlaut=722;e.Eacute=667;e.emacron=556;e.gbreve=556;e.onequarter=834;e.Scaron=667;e.Scommaaccent=667;e.Ohungarumlaut=778;e.degree=400;e.ograve=556;e.Ccaron=722;e.ugrave=556;e.radical=453;e.Dcaron=722;e.rcommaaccent=333;e.Ntilde=722;e.otilde=556;e.Rcommaaccent=722;e.Lcommaaccent=556;e.Atilde=667;e.Aogonek=667;e.Aring=667;e.Otilde=778;e.zdotaccent=500;e.Ecaron=667;e.Iogonek=278;e.kcommaaccent=500;e.minus=584;e.Icircumflex=278;e.ncaron=556;e.tcommaaccent=278;e.logicalnot=584;e.odieresis=556;e.udieresis=556;e.notequal=549;e.gcommaaccent=556;e.eth=556;e.zcaron=500;e.ncommaaccent=556;e.onesuperior=333;e.imacron=278;e.Euro=556}));e.Symbol=(0,r.getLookupTableFactory)((function(e){e.space=250;e.exclam=333;e.universal=713;e.numbersign=500;e.existential=549;e.percent=833;e.ampersand=778;e.suchthat=439;e.parenleft=333;e.parenright=333;e.asteriskmath=500;e.plus=549;e.comma=250;e.minus=549;e.period=250;e.slash=278;e.zero=500;e.one=500;e.two=500;e.three=500;e.four=500;e.five=500;e.six=500;e.seven=500;e.eight=500;e.nine=500;e.colon=278;e.semicolon=278;e.less=549;e.equal=549;e.greater=549;e.question=444;e.congruent=549;e.Alpha=722;e.Beta=667;e.Chi=722;e.Delta=612;e.Epsilon=611;e.Phi=763;e.Gamma=603;e.Eta=722;e.Iota=333;e.theta1=631;e.Kappa=722;e.Lambda=686;e.Mu=889;e.Nu=722;e.Omicron=722;e.Pi=768;e.Theta=741;e.Rho=556;e.Sigma=592;e.Tau=611;e.Upsilon=690;e.sigma1=439;e.Omega=768;e.Xi=645;e.Psi=795;e.Zeta=611;e.bracketleft=333;e.therefore=863;e.bracketright=333;e.perpendicular=658;e.underscore=500;e.radicalex=500;e.alpha=631;e.beta=549;e.chi=549;e.delta=494;e.epsilon=439;e.phi=521;e.gamma=411;e.eta=603;e.iota=329;e.phi1=603;e.kappa=549;e.lambda=549;e.mu=576;e.nu=521;e.omicron=549;e.pi=549;e.theta=521;e.rho=549;e.sigma=603;e.tau=439;e.upsilon=576;e.omega1=713;e.omega=686;e.xi=493;e.psi=686;e.zeta=494;e.braceleft=480;e.bar=200;e.braceright=480;e.similar=549;e.Euro=750;e.Upsilon1=620;e.minute=247;e.lessequal=549;e.fraction=167;e.infinity=713;e.florin=500;e.club=753;e.diamond=753;e.heart=753;e.spade=753;e.arrowboth=1042;e.arrowleft=987;e.arrowup=603;e.arrowright=987;e.arrowdown=603;e.degree=400;e.plusminus=549;e.second=411;e.greaterequal=549;e.multiply=549;e.proportional=713;e.partialdiff=494;e.bullet=460;e.divide=549;e.notequal=549;e.equivalence=549;e.approxequal=549;e.ellipsis=1e3;e.arrowvertex=603;e.arrowhorizex=1e3;e.carriagereturn=658;e.aleph=823;e.Ifraktur=686;e.Rfraktur=795;e.weierstrass=987;e.circlemultiply=768;e.circleplus=768;e.emptyset=823;e.intersection=768;e.union=768;e.propersuperset=713;e.reflexsuperset=713;e.notsubset=713;e.propersubset=713;e.reflexsubset=713;e.element=713;e.notelement=713;e.angle=768;e.gradient=713;e.registerserif=790;e.copyrightserif=790;e.trademarkserif=890;e.product=823;e.radical=549;e.dotmath=250;e.logicalnot=713;e.logicaland=603;e.logicalor=603;e.arrowdblboth=1042;e.arrowdblleft=987;e.arrowdblup=603;e.arrowdblright=987;e.arrowdbldown=603;e.lozenge=494;e.angleleft=329;e.registersans=790;e.copyrightsans=790;e.trademarksans=786;e.summation=713;e.parenlefttp=384;e.parenleftex=384;e.parenleftbt=384;e.bracketlefttp=384;e.bracketleftex=384;e.bracketleftbt=384;e.bracelefttp=494;e.braceleftmid=494;e.braceleftbt=494;e.braceex=494;e.angleright=329;e.integral=274;e.integraltp=686;e.integralex=686;e.integralbt=686;e.parenrighttp=384;e.parenrightex=384;e.parenrightbt=384;e.bracketrighttp=384;e.bracketrightex=384;e.bracketrightbt=384;e.bracerighttp=494;e.bracerightmid=494;e.bracerightbt=494;e.apple=790}));e["Times-Roman"]=(0,r.getLookupTableFactory)((function(e){e.space=250;e.exclam=333;e.quotedbl=408;e.numbersign=500;e.dollar=500;e.percent=833;e.ampersand=778;e.quoteright=333;e.parenleft=333;e.parenright=333;e.asterisk=500;e.plus=564;e.comma=250;e.hyphen=333;e.period=250;e.slash=278;e.zero=500;e.one=500;e.two=500;e.three=500;e.four=500;e.five=500;e.six=500;e.seven=500;e.eight=500;e.nine=500;e.colon=278;e.semicolon=278;e.less=564;e.equal=564;e.greater=564;e.question=444;e.at=921;e.A=722;e.B=667;e.C=667;e.D=722;e.E=611;e.F=556;e.G=722;e.H=722;e.I=333;e.J=389;e.K=722;e.L=611;e.M=889;e.N=722;e.O=722;e.P=556;e.Q=722;e.R=667;e.S=556;e.T=611;e.U=722;e.V=722;e.W=944;e.X=722;e.Y=722;e.Z=611;e.bracketleft=333;e.backslash=278;e.bracketright=333;e.asciicircum=469;e.underscore=500;e.quoteleft=333;e.a=444;e.b=500;e.c=444;e.d=500;e.e=444;e.f=333;e.g=500;e.h=500;e.i=278;e.j=278;e.k=500;e.l=278;e.m=778;e.n=500;e.o=500;e.p=500;e.q=500;e.r=333;e.s=389;e.t=278;e.u=500;e.v=500;e.w=722;e.x=500;e.y=500;e.z=444;e.braceleft=480;e.bar=200;e.braceright=480;e.asciitilde=541;e.exclamdown=333;e.cent=500;e.sterling=500;e.fraction=167;e.yen=500;e.florin=500;e.section=500;e.currency=500;e.quotesingle=180;e.quotedblleft=444;e.guillemotleft=500;e.guilsinglleft=333;e.guilsinglright=333;e.fi=556;e.fl=556;e.endash=500;e.dagger=500;e.daggerdbl=500;e.periodcentered=250;e.paragraph=453;e.bullet=350;e.quotesinglbase=333;e.quotedblbase=444;e.quotedblright=444;e.guillemotright=500;e.ellipsis=1e3;e.perthousand=1e3;e.questiondown=444;e.grave=333;e.acute=333;e.circumflex=333;e.tilde=333;e.macron=333;e.breve=333;e.dotaccent=333;e.dieresis=333;e.ring=333;e.cedilla=333;e.hungarumlaut=333;e.ogonek=333;e.caron=333;e.emdash=1e3;e.AE=889;e.ordfeminine=276;e.Lslash=611;e.Oslash=722;e.OE=889;e.ordmasculine=310;e.ae=667;e.dotlessi=278;e.lslash=278;e.oslash=500;e.oe=722;e.germandbls=500;e.Idieresis=333;e.eacute=444;e.abreve=444;e.uhungarumlaut=500;e.ecaron=444;e.Ydieresis=722;e.divide=564;e.Yacute=722;e.Acircumflex=722;e.aacute=444;e.Ucircumflex=722;e.yacute=500;e.scommaaccent=389;e.ecircumflex=444;e.Uring=722;e.Udieresis=722;e.aogonek=444;e.Uacute=722;e.uogonek=500;e.Edieresis=611;e.Dcroat=722;e.commaaccent=250;e.copyright=760;e.Emacron=611;e.ccaron=444;e.aring=444;e.Ncommaaccent=722;e.lacute=278;e.agrave=444;e.Tcommaaccent=611;e.Cacute=667;e.atilde=444;e.Edotaccent=611;e.scaron=389;e.scedilla=389;e.iacute=278;e.lozenge=471;e.Rcaron=667;e.Gcommaaccent=722;e.ucircumflex=500;e.acircumflex=444;e.Amacron=722;e.rcaron=333;e.ccedilla=444;e.Zdotaccent=611;e.Thorn=556;e.Omacron=722;e.Racute=667;e.Sacute=556;e.dcaron=588;e.Umacron=722;e.uring=500;e.threesuperior=300;e.Ograve=722;e.Agrave=722;e.Abreve=722;e.multiply=564;e.uacute=500;e.Tcaron=611;e.partialdiff=476;e.ydieresis=500;e.Nacute=722;e.icircumflex=278;e.Ecircumflex=611;e.adieresis=444;e.edieresis=444;e.cacute=444;e.nacute=500;e.umacron=500;e.Ncaron=722;e.Iacute=333;e.plusminus=564;e.brokenbar=200;e.registered=760;e.Gbreve=722;e.Idotaccent=333;e.summation=600;e.Egrave=611;e.racute=333;e.omacron=500;e.Zacute=611;e.Zcaron=611;e.greaterequal=549;e.Eth=722;e.Ccedilla=667;e.lcommaaccent=278;e.tcaron=326;e.eogonek=444;e.Uogonek=722;e.Aacute=722;e.Adieresis=722;e.egrave=444;e.zacute=444;e.iogonek=278;e.Oacute=722;e.oacute=500;e.amacron=444;e.sacute=389;e.idieresis=278;e.Ocircumflex=722;e.Ugrave=722;e.Delta=612;e.thorn=500;e.twosuperior=300;e.Odieresis=722;e.mu=500;e.igrave=278;e.ohungarumlaut=500;e.Eogonek=611;e.dcroat=500;e.threequarters=750;e.Scedilla=556;e.lcaron=344;e.Kcommaaccent=722;e.Lacute=611;e.trademark=980;e.edotaccent=444;e.Igrave=333;e.Imacron=333;e.Lcaron=611;e.onehalf=750;e.lessequal=549;e.ocircumflex=500;e.ntilde=500;e.Uhungarumlaut=722;e.Eacute=611;e.emacron=444;e.gbreve=500;e.onequarter=750;e.Scaron=556;e.Scommaaccent=556;e.Ohungarumlaut=722;e.degree=400;e.ograve=500;e.Ccaron=667;e.ugrave=500;e.radical=453;e.Dcaron=722;e.rcommaaccent=333;e.Ntilde=722;e.otilde=500;e.Rcommaaccent=667;e.Lcommaaccent=611;e.Atilde=722;e.Aogonek=722;e.Aring=722;e.Otilde=722;e.zdotaccent=444;e.Ecaron=611;e.Iogonek=333;e.kcommaaccent=500;e.minus=564;e.Icircumflex=333;e.ncaron=500;e.tcommaaccent=278;e.logicalnot=564;e.odieresis=500;e.udieresis=500;e.notequal=549;e.gcommaaccent=500;e.eth=500;e.zcaron=444;e.ncommaaccent=500;e.onesuperior=300;e.imacron=278;e.Euro=500}));e["Times-Bold"]=(0,r.getLookupTableFactory)((function(e){e.space=250;e.exclam=333;e.quotedbl=555;e.numbersign=500;e.dollar=500;e.percent=1e3;e.ampersand=833;e.quoteright=333;e.parenleft=333;e.parenright=333;e.asterisk=500;e.plus=570;e.comma=250;e.hyphen=333;e.period=250;e.slash=278;e.zero=500;e.one=500;e.two=500;e.three=500;e.four=500;e.five=500;e.six=500;e.seven=500;e.eight=500;e.nine=500;e.colon=333;e.semicolon=333;e.less=570;e.equal=570;e.greater=570;e.question=500;e.at=930;e.A=722;e.B=667;e.C=722;e.D=722;e.E=667;e.F=611;e.G=778;e.H=778;e.I=389;e.J=500;e.K=778;e.L=667;e.M=944;e.N=722;e.O=778;e.P=611;e.Q=778;e.R=722;e.S=556;e.T=667;e.U=722;e.V=722;e.W=1e3;e.X=722;e.Y=722;e.Z=667;e.bracketleft=333;e.backslash=278;e.bracketright=333;e.asciicircum=581;e.underscore=500;e.quoteleft=333;e.a=500;e.b=556;e.c=444;e.d=556;e.e=444;e.f=333;e.g=500;e.h=556;e.i=278;e.j=333;e.k=556;e.l=278;e.m=833;e.n=556;e.o=500;e.p=556;e.q=556;e.r=444;e.s=389;e.t=333;e.u=556;e.v=500;e.w=722;e.x=500;e.y=500;e.z=444;e.braceleft=394;e.bar=220;e.braceright=394;e.asciitilde=520;e.exclamdown=333;e.cent=500;e.sterling=500;e.fraction=167;e.yen=500;e.florin=500;e.section=500;e.currency=500;e.quotesingle=278;e.quotedblleft=500;e.guillemotleft=500;e.guilsinglleft=333;e.guilsinglright=333;e.fi=556;e.fl=556;e.endash=500;e.dagger=500;e.daggerdbl=500;e.periodcentered=250;e.paragraph=540;e.bullet=350;e.quotesinglbase=333;e.quotedblbase=500;e.quotedblright=500;e.guillemotright=500;e.ellipsis=1e3;e.perthousand=1e3;e.questiondown=500;e.grave=333;e.acute=333;e.circumflex=333;e.tilde=333;e.macron=333;e.breve=333;e.dotaccent=333;e.dieresis=333;e.ring=333;e.cedilla=333;e.hungarumlaut=333;e.ogonek=333;e.caron=333;e.emdash=1e3;e.AE=1e3;e.ordfeminine=300;e.Lslash=667;e.Oslash=778;e.OE=1e3;e.ordmasculine=330;e.ae=722;e.dotlessi=278;e.lslash=278;e.oslash=500;e.oe=722;e.germandbls=556;e.Idieresis=389;e.eacute=444;e.abreve=500;e.uhungarumlaut=556;e.ecaron=444;e.Ydieresis=722;e.divide=570;e.Yacute=722;e.Acircumflex=722;e.aacute=500;e.Ucircumflex=722;e.yacute=500;e.scommaaccent=389;e.ecircumflex=444;e.Uring=722;e.Udieresis=722;e.aogonek=500;e.Uacute=722;e.uogonek=556;e.Edieresis=667;e.Dcroat=722;e.commaaccent=250;e.copyright=747;e.Emacron=667;e.ccaron=444;e.aring=500;e.Ncommaaccent=722;e.lacute=278;e.agrave=500;e.Tcommaaccent=667;e.Cacute=722;e.atilde=500;e.Edotaccent=667;e.scaron=389;e.scedilla=389;e.iacute=278;e.lozenge=494;e.Rcaron=722;e.Gcommaaccent=778;e.ucircumflex=556;e.acircumflex=500;e.Amacron=722;e.rcaron=444;e.ccedilla=444;e.Zdotaccent=667;e.Thorn=611;e.Omacron=778;e.Racute=722;e.Sacute=556;e.dcaron=672;e.Umacron=722;e.uring=556;e.threesuperior=300;e.Ograve=778;e.Agrave=722;e.Abreve=722;e.multiply=570;e.uacute=556;e.Tcaron=667;e.partialdiff=494;e.ydieresis=500;e.Nacute=722;e.icircumflex=278;e.Ecircumflex=667;e.adieresis=500;e.edieresis=444;e.cacute=444;e.nacute=556;e.umacron=556;e.Ncaron=722;e.Iacute=389;e.plusminus=570;e.brokenbar=220;e.registered=747;e.Gbreve=778;e.Idotaccent=389;e.summation=600;e.Egrave=667;e.racute=444;e.omacron=500;e.Zacute=667;e.Zcaron=667;e.greaterequal=549;e.Eth=722;e.Ccedilla=722;e.lcommaaccent=278;e.tcaron=416;e.eogonek=444;e.Uogonek=722;e.Aacute=722;e.Adieresis=722;e.egrave=444;e.zacute=444;e.iogonek=278;e.Oacute=778;e.oacute=500;e.amacron=500;e.sacute=389;e.idieresis=278;e.Ocircumflex=778;e.Ugrave=722;e.Delta=612;e.thorn=556;e.twosuperior=300;e.Odieresis=778;e.mu=556;e.igrave=278;e.ohungarumlaut=500;e.Eogonek=667;e.dcroat=556;e.threequarters=750;e.Scedilla=556;e.lcaron=394;e.Kcommaaccent=778;e.Lacute=667;e.trademark=1e3;e.edotaccent=444;e.Igrave=389;e.Imacron=389;e.Lcaron=667;e.onehalf=750;e.lessequal=549;e.ocircumflex=500;e.ntilde=556;e.Uhungarumlaut=722;e.Eacute=667;e.emacron=444;e.gbreve=500;e.onequarter=750;e.Scaron=556;e.Scommaaccent=556;e.Ohungarumlaut=778;e.degree=400;e.ograve=500;e.Ccaron=722;e.ugrave=556;e.radical=549;e.Dcaron=722;e.rcommaaccent=444;e.Ntilde=722;e.otilde=500;e.Rcommaaccent=722;e.Lcommaaccent=667;e.Atilde=722;e.Aogonek=722;e.Aring=722;e.Otilde=778;e.zdotaccent=444;e.Ecaron=667;e.Iogonek=389;e.kcommaaccent=556;e.minus=570;e.Icircumflex=389;e.ncaron=556;e.tcommaaccent=333;e.logicalnot=570;e.odieresis=500;e.udieresis=556;e.notequal=549;e.gcommaaccent=500;e.eth=500;e.zcaron=444;e.ncommaaccent=556;e.onesuperior=300;e.imacron=278;e.Euro=500}));e["Times-BoldItalic"]=(0,r.getLookupTableFactory)((function(e){e.space=250;e.exclam=389;e.quotedbl=555;e.numbersign=500;e.dollar=500;e.percent=833;e.ampersand=778;e.quoteright=333;e.parenleft=333;e.parenright=333;e.asterisk=500;e.plus=570;e.comma=250;e.hyphen=333;e.period=250;e.slash=278;e.zero=500;e.one=500;e.two=500;e.three=500;e.four=500;e.five=500;e.six=500;e.seven=500;e.eight=500;e.nine=500;e.colon=333;e.semicolon=333;e.less=570;e.equal=570;e.greater=570;e.question=500;e.at=832;e.A=667;e.B=667;e.C=667;e.D=722;e.E=667;e.F=667;e.G=722;e.H=778;e.I=389;e.J=500;e.K=667;e.L=611;e.M=889;e.N=722;e.O=722;e.P=611;e.Q=722;e.R=667;e.S=556;e.T=611;e.U=722;e.V=667;e.W=889;e.X=667;e.Y=611;e.Z=611;e.bracketleft=333;e.backslash=278;e.bracketright=333;e.asciicircum=570;e.underscore=500;e.quoteleft=333;e.a=500;e.b=500;e.c=444;e.d=500;e.e=444;e.f=333;e.g=500;e.h=556;e.i=278;e.j=278;e.k=500;e.l=278;e.m=778;e.n=556;e.o=500;e.p=500;e.q=500;e.r=389;e.s=389;e.t=278;e.u=556;e.v=444;e.w=667;e.x=500;e.y=444;e.z=389;e.braceleft=348;e.bar=220;e.braceright=348;e.asciitilde=570;e.exclamdown=389;e.cent=500;e.sterling=500;e.fraction=167;e.yen=500;e.florin=500;e.section=500;e.currency=500;e.quotesingle=278;e.quotedblleft=500;e.guillemotleft=500;e.guilsinglleft=333;e.guilsinglright=333;e.fi=556;e.fl=556;e.endash=500;e.dagger=500;e.daggerdbl=500;e.periodcentered=250;e.paragraph=500;e.bullet=350;e.quotesinglbase=333;e.quotedblbase=500;e.quotedblright=500;e.guillemotright=500;e.ellipsis=1e3;e.perthousand=1e3;e.questiondown=500;e.grave=333;e.acute=333;e.circumflex=333;e.tilde=333;e.macron=333;e.breve=333;e.dotaccent=333;e.dieresis=333;e.ring=333;e.cedilla=333;e.hungarumlaut=333;e.ogonek=333;e.caron=333;e.emdash=1e3;e.AE=944;e.ordfeminine=266;e.Lslash=611;e.Oslash=722;e.OE=944;e.ordmasculine=300;e.ae=722;e.dotlessi=278;e.lslash=278;e.oslash=500;e.oe=722;e.germandbls=500;e.Idieresis=389;e.eacute=444;e.abreve=500;e.uhungarumlaut=556;e.ecaron=444;e.Ydieresis=611;e.divide=570;e.Yacute=611;e.Acircumflex=667;e.aacute=500;e.Ucircumflex=722;e.yacute=444;e.scommaaccent=389;e.ecircumflex=444;e.Uring=722;e.Udieresis=722;e.aogonek=500;e.Uacute=722;e.uogonek=556;e.Edieresis=667;e.Dcroat=722;e.commaaccent=250;e.copyright=747;e.Emacron=667;e.ccaron=444;e.aring=500;e.Ncommaaccent=722;e.lacute=278;e.agrave=500;e.Tcommaaccent=611;e.Cacute=667;e.atilde=500;e.Edotaccent=667;e.scaron=389;e.scedilla=389;e.iacute=278;e.lozenge=494;e.Rcaron=667;e.Gcommaaccent=722;e.ucircumflex=556;e.acircumflex=500;e.Amacron=667;e.rcaron=389;e.ccedilla=444;e.Zdotaccent=611;e.Thorn=611;e.Omacron=722;e.Racute=667;e.Sacute=556;e.dcaron=608;e.Umacron=722;e.uring=556;e.threesuperior=300;e.Ograve=722;e.Agrave=667;e.Abreve=667;e.multiply=570;e.uacute=556;e.Tcaron=611;e.partialdiff=494;e.ydieresis=444;e.Nacute=722;e.icircumflex=278;e.Ecircumflex=667;e.adieresis=500;e.edieresis=444;e.cacute=444;e.nacute=556;e.umacron=556;e.Ncaron=722;e.Iacute=389;e.plusminus=570;e.brokenbar=220;e.registered=747;e.Gbreve=722;e.Idotaccent=389;e.summation=600;e.Egrave=667;e.racute=389;e.omacron=500;e.Zacute=611;e.Zcaron=611;e.greaterequal=549;e.Eth=722;e.Ccedilla=667;e.lcommaaccent=278;e.tcaron=366;e.eogonek=444;e.Uogonek=722;e.Aacute=667;e.Adieresis=667;e.egrave=444;e.zacute=389;e.iogonek=278;e.Oacute=722;e.oacute=500;e.amacron=500;e.sacute=389;e.idieresis=278;e.Ocircumflex=722;e.Ugrave=722;e.Delta=612;e.thorn=500;e.twosuperior=300;e.Odieresis=722;e.mu=576;e.igrave=278;e.ohungarumlaut=500;e.Eogonek=667;e.dcroat=500;e.threequarters=750;e.Scedilla=556;e.lcaron=382;e.Kcommaaccent=667;e.Lacute=611;e.trademark=1e3;e.edotaccent=444;e.Igrave=389;e.Imacron=389;e.Lcaron=611;e.onehalf=750;e.lessequal=549;e.ocircumflex=500;e.ntilde=556;e.Uhungarumlaut=722;e.Eacute=667;e.emacron=444;e.gbreve=500;e.onequarter=750;e.Scaron=556;e.Scommaaccent=556;e.Ohungarumlaut=722;e.degree=400;e.ograve=500;e.Ccaron=667;e.ugrave=556;e.radical=549;e.Dcaron=722;e.rcommaaccent=389;e.Ntilde=722;e.otilde=500;e.Rcommaaccent=667;e.Lcommaaccent=611;e.Atilde=667;e.Aogonek=667;e.Aring=667;e.Otilde=722;e.zdotaccent=389;e.Ecaron=667;e.Iogonek=389;e.kcommaaccent=500;e.minus=606;e.Icircumflex=389;e.ncaron=556;e.tcommaaccent=278;e.logicalnot=606;e.odieresis=500;e.udieresis=556;e.notequal=549;e.gcommaaccent=500;e.eth=500;e.zcaron=389;e.ncommaaccent=556;e.onesuperior=300;e.imacron=278;e.Euro=500}));e["Times-Italic"]=(0,r.getLookupTableFactory)((function(e){e.space=250;e.exclam=333;e.quotedbl=420;e.numbersign=500;e.dollar=500;e.percent=833;e.ampersand=778;e.quoteright=333;e.parenleft=333;e.parenright=333;e.asterisk=500;e.plus=675;e.comma=250;e.hyphen=333;e.period=250;e.slash=278;e.zero=500;e.one=500;e.two=500;e.three=500;e.four=500;e.five=500;e.six=500;e.seven=500;e.eight=500;e.nine=500;e.colon=333;e.semicolon=333;e.less=675;e.equal=675;e.greater=675;e.question=500;e.at=920;e.A=611;e.B=611;e.C=667;e.D=722;e.E=611;e.F=611;e.G=722;e.H=722;e.I=333;e.J=444;e.K=667;e.L=556;e.M=833;e.N=667;e.O=722;e.P=611;e.Q=722;e.R=611;e.S=500;e.T=556;e.U=722;e.V=611;e.W=833;e.X=611;e.Y=556;e.Z=556;e.bracketleft=389;e.backslash=278;e.bracketright=389;e.asciicircum=422;e.underscore=500;e.quoteleft=333;e.a=500;e.b=500;e.c=444;e.d=500;e.e=444;e.f=278;e.g=500;e.h=500;e.i=278;e.j=278;e.k=444;e.l=278;e.m=722;e.n=500;e.o=500;e.p=500;e.q=500;e.r=389;e.s=389;e.t=278;e.u=500;e.v=444;e.w=667;e.x=444;e.y=444;e.z=389;e.braceleft=400;e.bar=275;e.braceright=400;e.asciitilde=541;e.exclamdown=389;e.cent=500;e.sterling=500;e.fraction=167;e.yen=500;e.florin=500;e.section=500;e.currency=500;e.quotesingle=214;e.quotedblleft=556;e.guillemotleft=500;e.guilsinglleft=333;e.guilsinglright=333;e.fi=500;e.fl=500;e.endash=500;e.dagger=500;e.daggerdbl=500;e.periodcentered=250;e.paragraph=523;e.bullet=350;e.quotesinglbase=333;e.quotedblbase=556;e.quotedblright=556;e.guillemotright=500;e.ellipsis=889;e.perthousand=1e3;e.questiondown=500;e.grave=333;e.acute=333;e.circumflex=333;e.tilde=333;e.macron=333;e.breve=333;e.dotaccent=333;e.dieresis=333;e.ring=333;e.cedilla=333;e.hungarumlaut=333;e.ogonek=333;e.caron=333;e.emdash=889;e.AE=889;e.ordfeminine=276;e.Lslash=556;e.Oslash=722;e.OE=944;e.ordmasculine=310;e.ae=667;e.dotlessi=278;e.lslash=278;e.oslash=500;e.oe=667;e.germandbls=500;e.Idieresis=333;e.eacute=444;e.abreve=500;e.uhungarumlaut=500;e.ecaron=444;e.Ydieresis=556;e.divide=675;e.Yacute=556;e.Acircumflex=611;e.aacute=500;e.Ucircumflex=722;e.yacute=444;e.scommaaccent=389;e.ecircumflex=444;e.Uring=722;e.Udieresis=722;e.aogonek=500;e.Uacute=722;e.uogonek=500;e.Edieresis=611;e.Dcroat=722;e.commaaccent=250;e.copyright=760;e.Emacron=611;e.ccaron=444;e.aring=500;e.Ncommaaccent=667;e.lacute=278;e.agrave=500;e.Tcommaaccent=556;e.Cacute=667;e.atilde=500;e.Edotaccent=611;e.scaron=389;e.scedilla=389;e.iacute=278;e.lozenge=471;e.Rcaron=611;e.Gcommaaccent=722;e.ucircumflex=500;e.acircumflex=500;e.Amacron=611;e.rcaron=389;e.ccedilla=444;e.Zdotaccent=556;e.Thorn=611;e.Omacron=722;e.Racute=611;e.Sacute=500;e.dcaron=544;e.Umacron=722;e.uring=500;e.threesuperior=300;e.Ograve=722;e.Agrave=611;e.Abreve=611;e.multiply=675;e.uacute=500;e.Tcaron=556;e.partialdiff=476;e.ydieresis=444;e.Nacute=667;e.icircumflex=278;e.Ecircumflex=611;e.adieresis=500;e.edieresis=444;e.cacute=444;e.nacute=500;e.umacron=500;e.Ncaron=667;e.Iacute=333;e.plusminus=675;e.brokenbar=275;e.registered=760;e.Gbreve=722;e.Idotaccent=333;e.summation=600;e.Egrave=611;e.racute=389;e.omacron=500;e.Zacute=556;e.Zcaron=556;e.greaterequal=549;e.Eth=722;e.Ccedilla=667;e.lcommaaccent=278;e.tcaron=300;e.eogonek=444;e.Uogonek=722;e.Aacute=611;e.Adieresis=611;e.egrave=444;e.zacute=389;e.iogonek=278;e.Oacute=722;e.oacute=500;e.amacron=500;e.sacute=389;e.idieresis=278;e.Ocircumflex=722;e.Ugrave=722;e.Delta=612;e.thorn=500;e.twosuperior=300;e.Odieresis=722;e.mu=500;e.igrave=278;e.ohungarumlaut=500;e.Eogonek=611;e.dcroat=500;e.threequarters=750;e.Scedilla=500;e.lcaron=300;e.Kcommaaccent=667;e.Lacute=556;e.trademark=980;e.edotaccent=444;e.Igrave=333;e.Imacron=333;e.Lcaron=611;e.onehalf=750;e.lessequal=549;e.ocircumflex=500;e.ntilde=500;e.Uhungarumlaut=722;e.Eacute=611;e.emacron=444;e.gbreve=500;e.onequarter=750;e.Scaron=500;e.Scommaaccent=500;e.Ohungarumlaut=722;e.degree=400;e.ograve=500;e.Ccaron=667;e.ugrave=500;e.radical=453;e.Dcaron=722;e.rcommaaccent=389;e.Ntilde=667;e.otilde=500;e.Rcommaaccent=611;e.Lcommaaccent=556;e.Atilde=611;e.Aogonek=611;e.Aring=611;e.Otilde=722;e.zdotaccent=389;e.Ecaron=611;e.Iogonek=333;e.kcommaaccent=444;e.minus=675;e.Icircumflex=333;e.ncaron=500;e.tcommaaccent=278;e.logicalnot=675;e.odieresis=500;e.udieresis=500;e.notequal=549;e.gcommaaccent=500;e.eth=500;e.zcaron=389;e.ncommaaccent=500;e.onesuperior=300;e.imacron=278;e.Euro=500}));e.ZapfDingbats=(0,r.getLookupTableFactory)((function(e){e.space=278;e.a1=974;e.a2=961;e.a202=974;e.a3=980;e.a4=719;e.a5=789;e.a119=790;e.a118=791;e.a117=690;e.a11=960;e.a12=939;e.a13=549;e.a14=855;e.a15=911;e.a16=933;e.a105=911;e.a17=945;e.a18=974;e.a19=755;e.a20=846;e.a21=762;e.a22=761;e.a23=571;e.a24=677;e.a25=763;e.a26=760;e.a27=759;e.a28=754;e.a6=494;e.a7=552;e.a8=537;e.a9=577;e.a10=692;e.a29=786;e.a30=788;e.a31=788;e.a32=790;e.a33=793;e.a34=794;e.a35=816;e.a36=823;e.a37=789;e.a38=841;e.a39=823;e.a40=833;e.a41=816;e.a42=831;e.a43=923;e.a44=744;e.a45=723;e.a46=749;e.a47=790;e.a48=792;e.a49=695;e.a50=776;e.a51=768;e.a52=792;e.a53=759;e.a54=707;e.a55=708;e.a56=682;e.a57=701;e.a58=826;e.a59=815;e.a60=789;e.a61=789;e.a62=707;e.a63=687;e.a64=696;e.a65=689;e.a66=786;e.a67=787;e.a68=713;e.a69=791;e.a70=785;e.a71=791;e.a72=873;e.a73=761;e.a74=762;e.a203=762;e.a75=759;e.a204=759;e.a76=892;e.a77=892;e.a78=788;e.a79=784;e.a81=438;e.a82=138;e.a83=277;e.a84=415;e.a97=392;e.a98=392;e.a99=668;e.a100=668;e.a89=390;e.a90=390;e.a93=317;e.a94=317;e.a91=276;e.a92=276;e.a205=509;e.a85=509;e.a206=410;e.a86=410;e.a87=234;e.a88=234;e.a95=334;e.a96=334;e.a101=732;e.a102=544;e.a103=544;e.a104=910;e.a106=667;e.a107=760;e.a108=760;e.a112=776;e.a111=595;e.a110=694;e.a109=626;e.a120=788;e.a121=788;e.a122=788;e.a123=788;e.a124=788;e.a125=788;e.a126=788;e.a127=788;e.a128=788;e.a129=788;e.a130=788;e.a131=788;e.a132=788;e.a133=788;e.a134=788;e.a135=788;e.a136=788;e.a137=788;e.a138=788;e.a139=788;e.a140=788;e.a141=788;e.a142=788;e.a143=788;e.a144=788;e.a145=788;e.a146=788;e.a147=788;e.a148=788;e.a149=788;e.a150=788;e.a151=788;e.a152=788;e.a153=788;e.a154=788;e.a155=788;e.a156=788;e.a157=788;e.a158=788;e.a159=788;e.a160=894;e.a161=838;e.a163=1016;e.a164=458;e.a196=748;e.a165=924;e.a192=748;e.a166=918;e.a167=927;e.a168=928;e.a169=928;e.a170=834;e.a171=873;e.a172=828;e.a173=924;e.a162=924;e.a174=917;e.a175=930;e.a176=931;e.a177=463;e.a178=883;e.a179=836;e.a193=836;e.a180=867;e.a199=867;e.a181=696;e.a200=696;e.a182=874;e.a201=874;e.a183=760;e.a184=946;e.a197=771;e.a185=865;e.a194=771;e.a198=888;e.a186=967;e.a195=888;e.a187=831;e.a188=873;e.a189=927;e.a190=970;e.a191=918}))}));t.getMetrics=n;const i=(0,r.getLookupTableFactory)((function(e){e.Courier={ascent:629,descent:-157,capHeight:562,xHeight:-426};e["Courier-Bold"]={ascent:629,descent:-157,capHeight:562,xHeight:439};e["Courier-Oblique"]={ascent:629,descent:-157,capHeight:562,xHeight:426};e["Courier-BoldOblique"]={ascent:629,descent:-157,capHeight:562,xHeight:426};e.Helvetica={ascent:718,descent:-207,capHeight:718,xHeight:523};e["Helvetica-Bold"]={ascent:718,descent:-207,capHeight:718,xHeight:532};e["Helvetica-Oblique"]={ascent:718,descent:-207,capHeight:718,xHeight:523};e["Helvetica-BoldOblique"]={ascent:718,descent:-207,capHeight:718,xHeight:532};e["Times-Roman"]={ascent:683,descent:-217,capHeight:662,xHeight:450};e["Times-Bold"]={ascent:683,descent:-217,capHeight:676,xHeight:461};e["Times-Italic"]={ascent:683,descent:-217,capHeight:653,xHeight:441};e["Times-BoldItalic"]={ascent:683,descent:-217,capHeight:669,xHeight:462};e.Symbol={ascent:Math.NaN,descent:Math.NaN,capHeight:Math.NaN,xHeight:Math.NaN};e.ZapfDingbats={ascent:Math.NaN,descent:Math.NaN,capHeight:Math.NaN,xHeight:Math.NaN}}));t.getFontBasicMetrics=i},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.GlyfTable=void 0;t.GlyfTable=class GlyfTable{constructor({glyfTable:e,isGlyphLocationsLong:t,locaTable:a,numGlyphs:r}){this.glyphs=[];const n=new DataView(a.buffer,a.byteOffset,a.byteLength),i=new DataView(e.buffer,e.byteOffset,e.byteLength),s=t?4:2;let o=t?n.getUint32(0):2*n.getUint16(0),c=0;for(let e=0;e<r;e++){c+=s;const e=t?n.getUint32(c):2*n.getUint16(c);if(e===o){this.glyphs.push(new Glyph({}));continue}const a=Glyph.parse(o,i);this.glyphs.push(a);o=e}}getSize(){return this.glyphs.reduce(((e,t)=>e+(t.getSize()+3&-4)),0)}write(){const e=this.getSize(),t=new DataView(new ArrayBuffer(e)),a=e>131070,r=a?4:2,n=new DataView(new ArrayBuffer((this.glyphs.length+1)*r));a?n.setUint32(0,0):n.setUint16(0,0);let i=0,s=0;for(const e of this.glyphs){i+=e.write(i,t);i=i+3&-4;s+=r;a?n.setUint32(s,i):n.setUint16(s,i>>1)}return{isLocationLong:a,loca:new Uint8Array(n.buffer),glyf:new Uint8Array(t.buffer)}}scale(e){for(let t=0,a=this.glyphs.length;t<a;t++)this.glyphs[t].scale(e[t])}};class Glyph{constructor({header:e=null,simple:t=null,composites:a=null}){this.header=e;this.simple=t;this.composites=a}static parse(e,t){const[a,r]=GlyphHeader.parse(e,t);e+=a;if(r.numberOfContours<0){const a=[];for(;;){const[r,n]=CompositeGlyph.parse(e,t);e+=r;a.push(n);if(!(32&n.flags))break}return new Glyph({header:r,composites:a})}const n=SimpleGlyph.parse(e,t,r.numberOfContours);return new Glyph({header:r,simple:n})}getSize(){if(!this.header)return 0;const e=this.simple?this.simple.getSize():this.composites.reduce(((e,t)=>e+t.getSize()),0);return this.header.getSize()+e}write(e,t){if(!this.header)return 0;const a=e;e+=this.header.write(e,t);if(this.simple)e+=this.simple.write(e,t);else for(const a of this.composites)e+=a.write(e,t);return e-a}scale(e){if(!this.header)return;const t=(this.header.xMin+this.header.xMax)/2;this.header.scale(t,e);if(this.simple)this.simple.scale(t,e);else for(const a of this.composites)a.scale(t,e)}}class GlyphHeader{constructor({numberOfContours:e,xMin:t,yMin:a,xMax:r,yMax:n}){this.numberOfContours=e;this.xMin=t;this.yMin=a;this.xMax=r;this.yMax=n}static parse(e,t){return[10,new GlyphHeader({numberOfContours:t.getInt16(e),xMin:t.getInt16(e+2),yMin:t.getInt16(e+4),xMax:t.getInt16(e+6),yMax:t.getInt16(e+8)})]}getSize(){return 10}write(e,t){t.setInt16(e,this.numberOfContours);t.setInt16(e+2,this.xMin);t.setInt16(e+4,this.yMin);t.setInt16(e+6,this.xMax);t.setInt16(e+8,this.yMax);return 10}scale(e,t){this.xMin=Math.round(e+(this.xMin-e)*t);this.xMax=Math.round(e+(this.xMax-e)*t)}}class Contour{constructor({flags:e,xCoordinates:t,yCoordinates:a}){this.xCoordinates=t;this.yCoordinates=a;this.flags=e}}class SimpleGlyph{constructor({contours:e,instructions:t}){this.contours=e;this.instructions=t}static parse(e,t,a){const r=[];for(let n=0;n<a;n++){const a=t.getUint16(e);e+=2;r.push(a)}const n=r[a-1]+1,i=t.getUint16(e);e+=2;const s=new Uint8Array(t).slice(e,e+i);e+=i;const o=[];for(let a=0;a<n;e++,a++){let r=t.getUint8(e);o.push(r);if(8&r){const n=t.getUint8(++e);r^=8;for(let e=0;e<n;e++)o.push(r);a+=n}}const c=[];let l=[],h=[],u=[];const d=[];let f=0,g=0;for(let a=0;a<n;a++){const n=o[a];if(2&n){const a=t.getUint8(e++);g+=16&n?a:-a;l.push(g)}else if(16&n)l.push(g);else{g+=t.getInt16(e);e+=2;l.push(g)}if(r[f]===a){f++;c.push(l);l=[]}}g=0;f=0;for(let a=0;a<n;a++){const n=o[a];if(4&n){const a=t.getUint8(e++);g+=32&n?a:-a;h.push(g)}else if(32&n)h.push(g);else{g+=t.getInt16(e);e+=2;h.push(g)}u.push(1&n|64&n);if(r[f]===a){l=c[f];f++;d.push(new Contour({flags:u,xCoordinates:l,yCoordinates:h}));h=[];u=[]}}return new SimpleGlyph({contours:d,instructions:s})}getSize(){let e=2*this.contours.length+2+this.instructions.length,t=0,a=0;for(const r of this.contours){e+=r.flags.length;for(let n=0,i=r.xCoordinates.length;n<i;n++){const i=r.xCoordinates[n],s=r.yCoordinates[n];let o=Math.abs(i-t);o>255?e+=2:o>0&&(e+=1);t=i;o=Math.abs(s-a);o>255?e+=2:o>0&&(e+=1);a=s}}return e}write(e,t){const a=e,r=[],n=[],i=[];let s=0,o=0;for(const a of this.contours){for(let e=0,t=a.xCoordinates.length;e<t;e++){let t=a.flags[e];const c=a.xCoordinates[e];let l=c-s;if(0===l){t|=16;r.push(0)}else{const e=Math.abs(l);if(e<=255){t|=l>=0?18:2;r.push(e)}else r.push(l)}s=c;const h=a.yCoordinates[e];l=h-o;if(0===l){t|=32;n.push(0)}else{const e=Math.abs(l);if(e<=255){t|=l>=0?36:4;n.push(e)}else n.push(l)}o=h;i.push(t)}t.setUint16(e,r.length-1);e+=2}t.setUint16(e,this.instructions.length);e+=2;if(this.instructions.length){new Uint8Array(t.buffer,0,t.buffer.byteLength).set(this.instructions,e);e+=this.instructions.length}for(const a of i)t.setUint8(e++,a);for(let a=0,n=r.length;a<n;a++){const n=r[a],s=i[a];if(2&s)t.setUint8(e++,n);else if(!(16&s)){t.setInt16(e,n);e+=2}}for(let a=0,r=n.length;a<r;a++){const r=n[a],s=i[a];if(4&s)t.setUint8(e++,r);else if(!(32&s)){t.setInt16(e,r);e+=2}}return e-a}scale(e,t){for(const a of this.contours)if(0!==a.xCoordinates.length)for(let r=0,n=a.xCoordinates.length;r<n;r++)a.xCoordinates[r]=Math.round(e+(a.xCoordinates[r]-e)*t)}}class CompositeGlyph{constructor({flags:e,glyphIndex:t,argument1:a,argument2:r,transf:n,instructions:i}){this.flags=e;this.glyphIndex=t;this.argument1=a;this.argument2=r;this.transf=n;this.instructions=i}static parse(e,t){const a=e,r=[];let n=t.getUint16(e);const i=t.getUint16(e+2);e+=4;let s,o;if(1&n){if(2&n){s=t.getInt16(e);o=t.getInt16(e+2)}else{s=t.getUint16(e);o=t.getUint16(e+2)}e+=4;n^=1}else{if(2&n){s=t.getInt8(e);o=t.getInt8(e+1)}else{s=t.getUint8(e);o=t.getUint8(e+1)}e+=2}if(8&n){r.push(t.getUint16(e));e+=2}else if(64&n){r.push(t.getUint16(e),t.getUint16(e+2));e+=4}else if(128&n){r.push(t.getUint16(e),t.getUint16(e+2),t.getUint16(e+4),t.getUint16(e+6));e+=8}let c=null;if(256&n){const a=t.getUint16(e);e+=2;c=new Uint8Array(t).slice(e,e+a);e+=a}return[e-a,new CompositeGlyph({flags:n,glyphIndex:i,argument1:s,argument2:o,transf:r,instructions:c})]}getSize(){let e=4+2*this.transf.length;256&this.flags&&(e+=2+this.instructions.length);e+=2;2&this.flags?this.argument1>=-128&&this.argument1<=127&&this.argument2>=-128&&this.argument2<=127||(e+=2):this.argument1>=0&&this.argument1<=255&&this.argument2>=0&&this.argument2<=255||(e+=2);return e}write(e,t){const a=e;2&this.flags?this.argument1>=-128&&this.argument1<=127&&this.argument2>=-128&&this.argument2<=127||(this.flags|=1):this.argument1>=0&&this.argument1<=255&&this.argument2>=0&&this.argument2<=255||(this.flags|=1);t.setUint16(e,this.flags);t.setUint16(e+2,this.glyphIndex);e+=4;if(1&this.flags){if(2&this.flags){t.setInt16(e,this.argument1);t.setInt16(e+2,this.argument2)}else{t.setUint16(e,this.argument1);t.setUint16(e+2,this.argument2)}e+=4}else{t.setUint8(e,this.argument1);t.setUint8(e+1,this.argument2);e+=2}if(256&this.flags){t.setUint16(e,this.instructions.length);e+=2;if(this.instructions.length){new Uint8Array(t.buffer,0,t.buffer.byteLength).set(this.instructions,e);e+=this.instructions.length}}return e-a}scale(e,t){}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.OpenTypeFileBuilder=void 0;var r=a(3),n=a(2);function writeInt16(e,t,a){e[t]=a>>8&255;e[t+1]=255&a}function writeInt32(e,t,a){e[t]=a>>24&255;e[t+1]=a>>16&255;e[t+2]=a>>8&255;e[t+3]=255&a}function writeData(e,t,a){if(a instanceof Uint8Array)e.set(a,t);else if("string"==typeof a)for(let r=0,n=a.length;r<n;r++)e[t++]=255&a.charCodeAt(r);else for(const r of a)e[t++]=255&r}class OpenTypeFileBuilder{constructor(e){this.sfnt=e;this.tables=Object.create(null)}static getSearchParams(e,t){let a=1,r=0;for(;(a^e)>a;){a<<=1;r++}const n=a*t;return{range:n,entry:r,rangeShift:t*e-n}}toArray(){let e=this.sfnt;const t=this.tables,a=Object.keys(t);a.sort();const i=a.length;let s,o,c,l,h,u=12+16*i;const d=[u];for(s=0;s<i;s++){l=t[a[s]];u+=(l.length+3&-4)>>>0;d.push(u)}const f=new Uint8Array(u);for(s=0;s<i;s++){l=t[a[s]];writeData(f,d[s],l)}"true"===e&&(e=(0,n.string32)(65536));f[0]=255&e.charCodeAt(0);f[1]=255&e.charCodeAt(1);f[2]=255&e.charCodeAt(2);f[3]=255&e.charCodeAt(3);writeInt16(f,4,i);const g=OpenTypeFileBuilder.getSearchParams(i,16);writeInt16(f,6,g.range);writeInt16(f,8,g.entry);writeInt16(f,10,g.rangeShift);u=12;for(s=0;s<i;s++){h=a[s];f[u]=255&h.charCodeAt(0);f[u+1]=255&h.charCodeAt(1);f[u+2]=255&h.charCodeAt(2);f[u+3]=255&h.charCodeAt(3);let e=0;for(o=d[s],c=d[s+1];o<c;o+=4){e=e+(0,r.readUint32)(f,o)>>>0}writeInt32(f,u+4,e);writeInt32(f,u+8,d[s]);writeInt32(f,u+12,t[h].length);u+=16}return f}addTable(e,t){if(e in this.tables)throw new Error("Table "+e+" already exists");this.tables[e]=t}}t.OpenTypeFileBuilder=OpenTypeFileBuilder},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.Type1Font=void 0;var r=a(33),n=a(2),i=a(36),s=a(3),o=a(8),c=a(47);function findBlock(e,t,a){const r=e.length,n=t.length,i=r-n;let o=a,c=!1;for(;o<i;){let a=0;for(;a<n&&e[o+a]===t[a];)a++;if(a>=n){o+=a;for(;o<r&&(0,s.isWhiteSpace)(e[o]);)o++;c=!0;break}o++}return{found:c,length:o}}t.Type1Font=class Type1Font{constructor(e,t,a){let r=a.length1,s=a.length2,l=t.peekBytes(6);const h=128===l[0]&&1===l[1];if(h){t.skip(6);r=l[5]<<24|l[4]<<16|l[3]<<8|l[2]}const u=function getHeaderBlock(e,t){const a=[101,101,120,101,99],r=e.pos;let i,s,c,l;try{i=e.getBytes(t);s=i.length}catch(e){}if(s===t){c=findBlock(i,a,t-2*a.length);if(c.found&&c.length===t)return{stream:new o.Stream(i),length:t}}(0,n.warn)('Invalid "Length1" property in Type1 font -- trying to recover.');e.pos=r;for(;;){c=findBlock(e.peekBytes(2048),a,0);if(0===c.length)break;e.pos+=c.length;if(c.found){l=e.pos-r;break}}e.pos=r;if(l)return{stream:new o.Stream(e.getBytes(l)),length:l};(0,n.warn)('Unable to recover "Length1" property in Type1 font -- using as is.');return{stream:new o.Stream(e.getBytes(t)),length:t}}(t,r);new c.Type1Parser(u.stream,!1,i.SEAC_ANALYSIS_ENABLED).extractFontHeader(a);if(h){l=t.getBytes(6);s=l[5]<<24|l[4]<<16|l[3]<<8|l[2]}const d=function getEexecBlock(e,t){const a=e.getBytes();if(0===a.length)throw new n.FormatError("getEexecBlock - no font program found.");return{stream:new o.Stream(a),length:a.length}}(t),f=new c.Type1Parser(d.stream,!0,i.SEAC_ANALYSIS_ENABLED).extractFontProgram(a);for(const e in f.properties)a[e]=f.properties[e];const g=f.charstrings,p=this.getType2Charstrings(g),m=this.getType2Subrs(f.subrs);this.charstrings=g;this.data=this.wrap(e,p,this.charstrings,m,a);this.seacs=this.getSeacs(f.charstrings)}get numGlyphs(){return this.charstrings.length+1}getCharset(){const e=[".notdef"];for(const{glyphName:t}of this.charstrings)e.push(t);return e}getGlyphMapping(e){const t=this.charstrings;if(e.composite){const a=Object.create(null);for(let r=0,n=t.length;r<n;r++){a[e.cMap.charCodeOf(r)]=r+1}return a}const a=[".notdef"];let r,n;for(n=0;n<t.length;n++)a.push(t[n].glyphName);const s=e.builtInEncoding;if(s){r=Object.create(null);for(const e in s){n=a.indexOf(s[e]);n>=0&&(r[e]=n)}}return(0,i.type1FontGlyphMapping)(e,r,a)}hasGlyphId(e){if(e<0||e>=this.numGlyphs)return!1;if(0===e)return!0;return this.charstrings[e-1].charstring.length>0}getSeacs(e){const t=[];for(let a=0,r=e.length;a<r;a++){const r=e[a];r.seac&&(t[a+1]=r.seac)}return t}getType2Charstrings(e){const t=[];for(const a of e)t.push(a.charstring);return t}getType2Subrs(e){let t=0;const a=e.length;t=a<1133?107:a<33769?1131:32768;const r=[];let n;for(n=0;n<t;n++)r.push([11]);for(n=0;n<a;n++)r.push(e[n]);return r}wrap(e,t,a,n,i){const s=new r.CFF;s.header=new r.CFFHeader(1,0,4,4);s.names=[e];const o=new r.CFFTopDict;o.setByName("version",391);o.setByName("Notice",392);o.setByName("FullName",393);o.setByName("FamilyName",394);o.setByName("Weight",395);o.setByName("Encoding",null);o.setByName("FontMatrix",i.fontMatrix);o.setByName("FontBBox",i.bbox);o.setByName("charset",null);o.setByName("CharStrings",null);o.setByName("Private",null);s.topDict=o;const c=new r.CFFStrings;c.add("Version 0.11");c.add("See original notice");c.add(e);c.add(e);c.add("Medium");s.strings=c;s.globalSubrIndex=new r.CFFIndex;const l=t.length,h=[".notdef"];let u,d;for(u=0;u<l;u++){const e=a[u].glyphName;-1===r.CFFStandardStrings.indexOf(e)&&c.add(e);h.push(e)}s.charset=new r.CFFCharset(!1,0,h);const f=new r.CFFIndex;f.add([139,14]);for(u=0;u<l;u++)f.add(t[u]);s.charStrings=f;const g=new r.CFFPrivateDict;g.setByName("Subrs",null);const p=["BlueValues","OtherBlues","FamilyBlues","FamilyOtherBlues","StemSnapH","StemSnapV","BlueShift","BlueFuzz","BlueScale","LanguageGroup","ExpansionFactor","ForceBold","StdHW","StdVW"];for(u=0,d=p.length;u<d;u++){const e=p[u];if(!(e in i.privateData))continue;const t=i.privateData[e];if(Array.isArray(t))for(let e=t.length-1;e>0;e--)t[e]-=t[e-1];g.setByName(e,t)}s.topDict.privateDict=g;const m=new r.CFFIndex;for(u=0,d=n.length;u<d;u++)m.add(n[u]);g.subrsIndex=m;return new r.CFFCompiler(s).compile()}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.Type1Parser=void 0;var r=a(35),n=a(3),i=a(8),s=a(2);const o=[4],c=[5],l=[6],h=[7],u=[8],d=[12,35],f=[14],g=[21],p=[22],m=[30],b=[31];class Type1CharString{constructor(){this.width=0;this.lsb=0;this.flexing=!1;this.output=[];this.stack=[]}convert(e,t,a){const r=e.length;let n,i,y,w=!1;for(let S=0;S<r;S++){let r=e[S];if(r<32){12===r&&(r=(r<<8)+e[++S]);switch(r){case 1:case 3:case 9:case 3072:case 3073:case 3074:case 3105:this.stack=[];break;case 4:if(this.flexing){if(this.stack.length<1){w=!0;break}const e=this.stack.pop();this.stack.push(0,e);break}w=this.executeCommand(1,o);break;case 5:w=this.executeCommand(2,c);break;case 6:w=this.executeCommand(1,l);break;case 7:w=this.executeCommand(1,h);break;case 8:w=this.executeCommand(6,u);break;case 10:if(this.stack.length<1){w=!0;break}y=this.stack.pop();if(!t[y]){w=!0;break}w=this.convert(t[y],t,a);break;case 11:return w;case 13:if(this.stack.length<2){w=!0;break}n=this.stack.pop();i=this.stack.pop();this.lsb=i;this.width=n;this.stack.push(n,i);w=this.executeCommand(2,p);break;case 14:this.output.push(f[0]);break;case 21:if(this.flexing)break;w=this.executeCommand(2,g);break;case 22:if(this.flexing){this.stack.push(0);break}w=this.executeCommand(1,p);break;case 30:w=this.executeCommand(4,m);break;case 31:w=this.executeCommand(4,b);break;case 3078:if(a){const e=this.stack.at(-5);this.seac=this.stack.splice(-4,4);this.seac[0]+=this.lsb-e;w=this.executeCommand(0,f)}else w=this.executeCommand(4,f);break;case 3079:if(this.stack.length<4){w=!0;break}this.stack.pop();n=this.stack.pop();const e=this.stack.pop();i=this.stack.pop();this.lsb=i;this.width=n;this.stack.push(n,i,e);w=this.executeCommand(3,g);break;case 3084:if(this.stack.length<2){w=!0;break}const S=this.stack.pop(),x=this.stack.pop();this.stack.push(x/S);break;case 3088:if(this.stack.length<2){w=!0;break}y=this.stack.pop();const C=this.stack.pop();if(0===y&&3===C){const e=this.stack.splice(this.stack.length-17,17);this.stack.push(e[2]+e[0],e[3]+e[1],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14]);w=this.executeCommand(13,d,!0);this.flexing=!1;this.stack.push(e[15],e[16])}else 1===y&&0===C&&(this.flexing=!0);break;case 3089:break;default:(0,s.warn)('Unknown type 1 charstring command of "'+r+'"')}if(w)break}else{r<=246?r-=139:r=r<=250?256*(r-247)+e[++S]+108:r<=254?-256*(r-251)-e[++S]-108:(255&e[++S])<<24|(255&e[++S])<<16|(255&e[++S])<<8|(255&e[++S])<<0;this.stack.push(r)}}return w}executeCommand(e,t,a){const r=this.stack.length;if(e>r)return!0;const n=r-e;for(let e=n;e<r;e++){let t=this.stack[e];if(Number.isInteger(t))this.output.push(28,t>>8&255,255&t);else{t=65536*t|0;this.output.push(255,t>>24&255,t>>16&255,t>>8&255,255&t)}}this.output.push(...t);a?this.stack.splice(n,e):this.stack.length=0;return!1}}function isHexDigit(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function decrypt(e,t,a){if(a>=e.length)return new Uint8Array(0);let r,n,i=0|t;for(r=0;r<a;r++)i=52845*(e[r]+i)+22719&65535;const s=e.length-a,o=new Uint8Array(s);for(r=a,n=0;n<s;r++,n++){const t=e[r];o[n]=t^i>>8;i=52845*(t+i)+22719&65535}return o}function isSpecial(e){return 47===e||91===e||93===e||123===e||125===e||40===e||41===e}t.Type1Parser=class Type1Parser{constructor(e,t,a){if(t){const t=e.getBytes(),a=!((isHexDigit(t[0])||(0,n.isWhiteSpace)(t[0]))&&isHexDigit(t[1])&&isHexDigit(t[2])&&isHexDigit(t[3])&&isHexDigit(t[4])&&isHexDigit(t[5])&&isHexDigit(t[6])&&isHexDigit(t[7]));e=new i.Stream(a?decrypt(t,55665,4):function decryptAscii(e,t,a){let r=0|t;const n=e.length,i=new Uint8Array(n>>>1);let s,o;for(s=0,o=0;s<n;s++){const t=e[s];if(!isHexDigit(t))continue;s++;let a;for(;s<n&&!isHexDigit(a=e[s]);)s++;if(s<n){const e=parseInt(String.fromCharCode(t,a),16);i[o++]=e^r>>8;r=52845*(e+r)+22719&65535}}return i.slice(a,o)}(t,55665,4))}this.seacAnalysisEnabled=!!a;this.stream=e;this.nextChar()}readNumberArray(){this.getToken();const e=[];for(;;){const t=this.getToken();if(null===t||"]"===t||"}"===t)break;e.push(parseFloat(t||0))}return e}readNumber(){const e=this.getToken();return parseFloat(e||0)}readInt(){const e=this.getToken();return 0|parseInt(e||0,10)}readBoolean(){return"true"===this.getToken()?1:0}nextChar(){return this.currentChar=this.stream.getByte()}prevChar(){this.stream.skip(-2);return this.currentChar=this.stream.getByte()}getToken(){let e=!1,t=this.currentChar;for(;;){if(-1===t)return null;if(e)10!==t&&13!==t||(e=!1);else if(37===t)e=!0;else if(!(0,n.isWhiteSpace)(t))break;t=this.nextChar()}if(isSpecial(t)){this.nextChar();return String.fromCharCode(t)}let a="";do{a+=String.fromCharCode(t);t=this.nextChar()}while(t>=0&&!(0,n.isWhiteSpace)(t)&&!isSpecial(t));return a}readCharStrings(e,t){return-1===t?e:decrypt(e,4330,t)}extractFontProgram(e){const t=this.stream,a=[],r=[],n=Object.create(null);n.lenIV=4;const i={subrs:[],charstrings:[],properties:{privateData:n}};let s,o,c,l;for(;null!==(s=this.getToken());)if("/"===s){s=this.getToken();switch(s){case"CharStrings":this.getToken();this.getToken();this.getToken();this.getToken();for(;;){s=this.getToken();if(null===s||"end"===s)break;if("/"!==s)continue;const e=this.getToken();o=this.readInt();this.getToken();c=o>0?t.getBytes(o):new Uint8Array(0);l=i.properties.privateData.lenIV;const a=this.readCharStrings(c,l);this.nextChar();s=this.getToken();"noaccess"===s?this.getToken():"/"===s&&this.prevChar();r.push({glyph:e,encoded:a})}break;case"Subrs":this.readInt();this.getToken();for(;"dup"===this.getToken();){const e=this.readInt();o=this.readInt();this.getToken();c=o>0?t.getBytes(o):new Uint8Array(0);l=i.properties.privateData.lenIV;const r=this.readCharStrings(c,l);this.nextChar();s=this.getToken();"noaccess"===s&&this.getToken();a[e]=r}break;case"BlueValues":case"OtherBlues":case"FamilyBlues":case"FamilyOtherBlues":const e=this.readNumberArray();e.length>0&&e.length,0;break;case"StemSnapH":case"StemSnapV":i.properties.privateData[s]=this.readNumberArray();break;case"StdHW":case"StdVW":i.properties.privateData[s]=this.readNumberArray()[0];break;case"BlueShift":case"lenIV":case"BlueFuzz":case"BlueScale":case"LanguageGroup":i.properties.privateData[s]=this.readNumber();break;case"ExpansionFactor":i.properties.privateData[s]=this.readNumber()||.06;break;case"ForceBold":i.properties.privateData[s]=this.readBoolean()}}for(const{encoded:t,glyph:n}of r){const r=new Type1CharString,s=r.convert(t,a,this.seacAnalysisEnabled);let o=r.output;s&&(o=[14]);const c={glyphName:n,charstring:o,width:r.width,lsb:r.lsb,seac:r.seac};".notdef"===n?i.charstrings.unshift(c):i.charstrings.push(c);if(e.builtInEncoding){const t=e.builtInEncoding.indexOf(n);t>-1&&void 0===e.widths[t]&&t>=e.firstChar&&t<=e.lastChar&&(e.widths[t]=r.width)}}return i}extractFontHeader(e){let t;for(;null!==(t=this.getToken());)if("/"===t){t=this.getToken();switch(t){case"FontMatrix":const a=this.readNumberArray();e.fontMatrix=a;break;case"Encoding":const n=this.getToken();let i;if(/^\d+$/.test(n)){i=[];const e=0|parseInt(n,10);this.getToken();for(let a=0;a<e;a++){t=this.getToken();for(;"dup"!==t&&"def"!==t;){t=this.getToken();if(null===t)return}if("def"===t)break;const e=this.readInt();this.getToken();const a=this.getToken();i[e]=a;this.getToken()}}else i=(0,r.getEncoding)(n);e.builtInEncoding=i;break;case"FontBBox":const s=this.readNumberArray();e.ascent=Math.max(s[3],s[1]);e.descent=Math.min(s[1],s[3]);e.ascentScaled=!0}}}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.Pattern=void 0;t.getTilingPatternIR=function getTilingPatternIR(e,t,a){const n=t.getArray("Matrix"),i=r.Util.normalizeRect(t.getArray("BBox")),s=t.get("XStep"),o=t.get("YStep"),c=t.get("PaintType"),l=t.get("TilingType");if(i[2]-i[0]==0||i[3]-i[1]==0)throw new r.FormatError(`Invalid getTilingPatternIR /BBox array: [${i}].`);return["TilingPattern",a,e,n,i,s,o,c,l]};var r=a(2),n=a(5),i=a(12),s=a(3);const o=2,c=3,l=4,h=5,u=6,d=7;t.Pattern=class Pattern{constructor(){(0,r.unreachable)("Cannot initialize Pattern.")}static parseShading(e,t,a,i,f,g){const p=e instanceof n.BaseStream?e.dict:e,m=p.get("ShadingType");try{switch(m){case o:case c:return new RadialAxialShading(p,t,a,f,g);case l:case h:case u:case d:return new MeshShading(e,t,a,f,g);default:throw new r.FormatError("Unsupported ShadingType: "+m)}}catch(e){if(e instanceof s.MissingDataException)throw e;i.send("UnsupportedFeature",{featureId:r.UNSUPPORTED_FEATURES.shadingPattern});(0,r.warn)(e);return new DummyShading}}};class BaseShading{static get SMALL_NUMBER(){return(0,r.shadow)(this,"SMALL_NUMBER",1e-6)}constructor(){this.constructor===BaseShading&&(0,r.unreachable)("Cannot initialize BaseShading.")}getIR(){(0,r.unreachable)("Abstract method `getIR` called.")}}class RadialAxialShading extends BaseShading{constructor(e,t,a,n,s){super();this.coordsArr=e.getArray("Coords");this.shadingType=e.get("ShadingType");const o=i.ColorSpace.parse({cs:e.getRaw("CS")||e.getRaw("ColorSpace"),xref:t,resources:a,pdfFunctionFactory:n,localColorSpaceCache:s}),l=e.getArray("BBox");Array.isArray(l)&&4===l.length?this.bbox=r.Util.normalizeRect(l):this.bbox=null;let h=0,u=1;if(e.has("Domain")){const t=e.getArray("Domain");h=t[0];u=t[1]}let d=!1,f=!1;if(e.has("Extend")){const t=e.getArray("Extend");d=t[0];f=t[1]}if(!(this.shadingType!==c||d&&f)){const[e,t,a,n,i,s]=this.coordsArr,o=Math.hypot(e-n,t-i);a<=s+o&&s<=a+o&&(0,r.warn)("Unsupported radial gradient.")}this.extendStart=d;this.extendEnd=f;const g=e.getRaw("Function"),p=n.createFromArray(g),m=(u-h)/10,b=this.colorStops=[];if(h>=u||m<=0){(0,r.info)("Bad shading domain.");return}const y=new Float32Array(o.numComps),w=new Float32Array(1);let S;for(let e=0;e<=10;e++){w[0]=h+e*m;p(w,0,y,0);S=o.getRgb(y,0);const t=r.Util.makeHexColor(S[0],S[1],S[2]);b.push([e/10,t])}let x="transparent";if(e.has("Background")){S=o.getRgb(e.get("Background"),0);x=r.Util.makeHexColor(S[0],S[1],S[2])}if(!d){b.unshift([0,x]);b[1][0]+=BaseShading.SMALL_NUMBER}if(!f){b.at(-1)[0]-=BaseShading.SMALL_NUMBER;b.push([1,x])}this.colorStops=b}getIR(){const e=this.coordsArr,t=this.shadingType;let a,n,i,s,l;if(t===o){n=[e[0],e[1]];i=[e[2],e[3]];s=null;l=null;a="axial"}else if(t===c){n=[e[0],e[1]];i=[e[3],e[4]];s=e[2];l=e[5];a="radial"}else(0,r.unreachable)(`getPattern type unknown: ${t}`);return["RadialAxial",a,this.bbox,this.colorStops,n,i,s,l]}}class MeshStreamReader{constructor(e,t){this.stream=e;this.context=t;this.buffer=0;this.bufferLength=0;const a=t.numComps;this.tmpCompsBuf=new Float32Array(a);const r=t.colorSpace.numComps;this.tmpCsCompsBuf=t.colorFn?new Float32Array(r):this.tmpCompsBuf}get hasData(){if(this.stream.end)return this.stream.pos<this.stream.end;if(this.bufferLength>0)return!0;const e=this.stream.getByte();if(e<0)return!1;this.buffer=e;this.bufferLength=8;return!0}readBits(e){let t=this.buffer,a=this.bufferLength;if(32===e){if(0===a)return(this.stream.getByte()<<24|this.stream.getByte()<<16|this.stream.getByte()<<8|this.stream.getByte())>>>0;t=t<<24|this.stream.getByte()<<16|this.stream.getByte()<<8|this.stream.getByte();const e=this.stream.getByte();this.buffer=e&(1<<a)-1;return(t<<8-a|(255&e)>>a)>>>0}if(8===e&&0===a)return this.stream.getByte();for(;a<e;){t=t<<8|this.stream.getByte();a+=8}a-=e;this.bufferLength=a;this.buffer=t&(1<<a)-1;return t>>a}align(){this.buffer=0;this.bufferLength=0}readFlag(){return this.readBits(this.context.bitsPerFlag)}readCoordinate(){const e=this.context.bitsPerCoordinate,t=this.readBits(e),a=this.readBits(e),r=this.context.decode,n=e<32?1/((1<<e)-1):2.3283064365386963e-10;return[t*n*(r[1]-r[0])+r[0],a*n*(r[3]-r[2])+r[2]]}readComponents(){const e=this.context.numComps,t=this.context.bitsPerComponent,a=t<32?1/((1<<t)-1):2.3283064365386963e-10,r=this.context.decode,n=this.tmpCompsBuf;for(let i=0,s=4;i<e;i++,s+=2){const e=this.readBits(t);n[i]=e*a*(r[s+1]-r[s])+r[s]}const i=this.tmpCsCompsBuf;this.context.colorFn&&this.context.colorFn(n,0,i,0);return this.context.colorSpace.getRgb(i,0)}}const f=function getBClosure(){const e=[];return function(t){e[t]||(e[t]=function buildB(e){const t=[];for(let a=0;a<=e;a++){const r=a/e,n=1-r;t.push(new Float32Array([n*n*n,3*r*n*n,3*r*r*n,r*r*r]))}return t}(t));return e[t]}}();class MeshShading extends BaseShading{static get MIN_SPLIT_PATCH_CHUNKS_AMOUNT(){return(0,r.shadow)(this,"MIN_SPLIT_PATCH_CHUNKS_AMOUNT",3)}static get MAX_SPLIT_PATCH_CHUNKS_AMOUNT(){return(0,r.shadow)(this,"MAX_SPLIT_PATCH_CHUNKS_AMOUNT",20)}static get TRIANGLE_DENSITY(){return(0,r.shadow)(this,"TRIANGLE_DENSITY",20)}constructor(e,t,a,s,o){super();if(!(e instanceof n.BaseStream))throw new r.FormatError("Mesh data is not a stream");const c=e.dict;this.shadingType=c.get("ShadingType");const f=c.getArray("BBox");Array.isArray(f)&&4===f.length?this.bbox=r.Util.normalizeRect(f):this.bbox=null;const g=i.ColorSpace.parse({cs:c.getRaw("CS")||c.getRaw("ColorSpace"),xref:t,resources:a,pdfFunctionFactory:s,localColorSpaceCache:o});this.background=c.has("Background")?g.getRgb(c.get("Background"),0):null;const p=c.getRaw("Function"),m=p?s.createFromArray(p):null;this.coords=[];this.colors=[];this.figures=[];const b={bitsPerCoordinate:c.get("BitsPerCoordinate"),bitsPerComponent:c.get("BitsPerComponent"),bitsPerFlag:c.get("BitsPerFlag"),decode:c.getArray("Decode"),colorFn:m,colorSpace:g,numComps:m?1:g.numComps},y=new MeshStreamReader(e,b);let w=!1;switch(this.shadingType){case l:this._decodeType4Shading(y);break;case h:const e=0|c.get("VerticesPerRow");if(e<2)throw new r.FormatError("Invalid VerticesPerRow");this._decodeType5Shading(y,e);break;case u:this._decodeType6Shading(y);w=!0;break;case d:this._decodeType7Shading(y);w=!0;break;default:(0,r.unreachable)("Unsupported mesh type.")}if(w){this._updateBounds();for(let e=0,t=this.figures.length;e<t;e++)this._buildFigureFromPatch(e)}this._updateBounds();this._packData()}_decodeType4Shading(e){const t=this.coords,a=this.colors,n=[],i=[];let s=0;for(;e.hasData;){const o=e.readFlag(),c=e.readCoordinate(),l=e.readComponents();if(0===s){if(!(0<=o&&o<=2))throw new r.FormatError("Unknown type4 flag");switch(o){case 0:s=3;break;case 1:i.push(i.at(-2),i.at(-1));s=1;break;case 2:i.push(i.at(-3),i.at(-1));s=1}n.push(o)}i.push(t.length);t.push(c);a.push(l);s--;e.align()}this.figures.push({type:"triangles",coords:new Int32Array(i),colors:new Int32Array(i)})}_decodeType5Shading(e,t){const a=this.coords,r=this.colors,n=[];for(;e.hasData;){const t=e.readCoordinate(),i=e.readComponents();n.push(a.length);a.push(t);r.push(i)}this.figures.push({type:"lattice",coords:new Int32Array(n),colors:new Int32Array(n),verticesPerRow:t})}_decodeType6Shading(e){const t=this.coords,a=this.colors,n=new Int32Array(16),i=new Int32Array(4);for(;e.hasData;){const s=e.readFlag();if(!(0<=s&&s<=3))throw new r.FormatError("Unknown type6 flag");const o=t.length;for(let a=0,r=0!==s?8:12;a<r;a++)t.push(e.readCoordinate());const c=a.length;for(let t=0,r=0!==s?2:4;t<r;t++)a.push(e.readComponents());let l,h,u,d;switch(s){case 0:n[12]=o+3;n[13]=o+4;n[14]=o+5;n[15]=o+6;n[8]=o+2;n[11]=o+7;n[4]=o+1;n[7]=o+8;n[0]=o;n[1]=o+11;n[2]=o+10;n[3]=o+9;i[2]=c+1;i[3]=c+2;i[0]=c;i[1]=c+3;break;case 1:l=n[12];h=n[13];u=n[14];d=n[15];n[12]=d;n[13]=o+0;n[14]=o+1;n[15]=o+2;n[8]=u;n[11]=o+3;n[4]=h;n[7]=o+4;n[0]=l;n[1]=o+7;n[2]=o+6;n[3]=o+5;l=i[2];h=i[3];i[2]=h;i[3]=c;i[0]=l;i[1]=c+1;break;case 2:l=n[15];h=n[11];n[12]=n[3];n[13]=o+0;n[14]=o+1;n[15]=o+2;n[8]=n[7];n[11]=o+3;n[4]=h;n[7]=o+4;n[0]=l;n[1]=o+7;n[2]=o+6;n[3]=o+5;l=i[3];i[2]=i[1];i[3]=c;i[0]=l;i[1]=c+1;break;case 3:n[12]=n[0];n[13]=o+0;n[14]=o+1;n[15]=o+2;n[8]=n[1];n[11]=o+3;n[4]=n[2];n[7]=o+4;n[0]=n[3];n[1]=o+7;n[2]=o+6;n[3]=o+5;i[2]=i[0];i[3]=c;i[0]=i[1];i[1]=c+1}n[5]=t.length;t.push([(-4*t[n[0]][0]-t[n[15]][0]+6*(t[n[4]][0]+t[n[1]][0])-2*(t[n[12]][0]+t[n[3]][0])+3*(t[n[13]][0]+t[n[7]][0]))/9,(-4*t[n[0]][1]-t[n[15]][1]+6*(t[n[4]][1]+t[n[1]][1])-2*(t[n[12]][1]+t[n[3]][1])+3*(t[n[13]][1]+t[n[7]][1]))/9]);n[6]=t.length;t.push([(-4*t[n[3]][0]-t[n[12]][0]+6*(t[n[2]][0]+t[n[7]][0])-2*(t[n[0]][0]+t[n[15]][0])+3*(t[n[4]][0]+t[n[14]][0]))/9,(-4*t[n[3]][1]-t[n[12]][1]+6*(t[n[2]][1]+t[n[7]][1])-2*(t[n[0]][1]+t[n[15]][1])+3*(t[n[4]][1]+t[n[14]][1]))/9]);n[9]=t.length;t.push([(-4*t[n[12]][0]-t[n[3]][0]+6*(t[n[8]][0]+t[n[13]][0])-2*(t[n[0]][0]+t[n[15]][0])+3*(t[n[11]][0]+t[n[1]][0]))/9,(-4*t[n[12]][1]-t[n[3]][1]+6*(t[n[8]][1]+t[n[13]][1])-2*(t[n[0]][1]+t[n[15]][1])+3*(t[n[11]][1]+t[n[1]][1]))/9]);n[10]=t.length;t.push([(-4*t[n[15]][0]-t[n[0]][0]+6*(t[n[11]][0]+t[n[14]][0])-2*(t[n[12]][0]+t[n[3]][0])+3*(t[n[2]][0]+t[n[8]][0]))/9,(-4*t[n[15]][1]-t[n[0]][1]+6*(t[n[11]][1]+t[n[14]][1])-2*(t[n[12]][1]+t[n[3]][1])+3*(t[n[2]][1]+t[n[8]][1]))/9]);this.figures.push({type:"patch",coords:new Int32Array(n),colors:new Int32Array(i)})}}_decodeType7Shading(e){const t=this.coords,a=this.colors,n=new Int32Array(16),i=new Int32Array(4);for(;e.hasData;){const s=e.readFlag();if(!(0<=s&&s<=3))throw new r.FormatError("Unknown type7 flag");const o=t.length;for(let a=0,r=0!==s?12:16;a<r;a++)t.push(e.readCoordinate());const c=a.length;for(let t=0,r=0!==s?2:4;t<r;t++)a.push(e.readComponents());let l,h,u,d;switch(s){case 0:n[12]=o+3;n[13]=o+4;n[14]=o+5;n[15]=o+6;n[8]=o+2;n[9]=o+13;n[10]=o+14;n[11]=o+7;n[4]=o+1;n[5]=o+12;n[6]=o+15;n[7]=o+8;n[0]=o;n[1]=o+11;n[2]=o+10;n[3]=o+9;i[2]=c+1;i[3]=c+2;i[0]=c;i[1]=c+3;break;case 1:l=n[12];h=n[13];u=n[14];d=n[15];n[12]=d;n[13]=o+0;n[14]=o+1;n[15]=o+2;n[8]=u;n[9]=o+9;n[10]=o+10;n[11]=o+3;n[4]=h;n[5]=o+8;n[6]=o+11;n[7]=o+4;n[0]=l;n[1]=o+7;n[2]=o+6;n[3]=o+5;l=i[2];h=i[3];i[2]=h;i[3]=c;i[0]=l;i[1]=c+1;break;case 2:l=n[15];h=n[11];n[12]=n[3];n[13]=o+0;n[14]=o+1;n[15]=o+2;n[8]=n[7];n[9]=o+9;n[10]=o+10;n[11]=o+3;n[4]=h;n[5]=o+8;n[6]=o+11;n[7]=o+4;n[0]=l;n[1]=o+7;n[2]=o+6;n[3]=o+5;l=i[3];i[2]=i[1];i[3]=c;i[0]=l;i[1]=c+1;break;case 3:n[12]=n[0];n[13]=o+0;n[14]=o+1;n[15]=o+2;n[8]=n[1];n[9]=o+9;n[10]=o+10;n[11]=o+3;n[4]=n[2];n[5]=o+8;n[6]=o+11;n[7]=o+4;n[0]=n[3];n[1]=o+7;n[2]=o+6;n[3]=o+5;i[2]=i[0];i[3]=c;i[0]=i[1];i[1]=c+1}this.figures.push({type:"patch",coords:new Int32Array(n),colors:new Int32Array(i)})}}_buildFigureFromPatch(e){const t=this.figures[e];(0,r.assert)("patch"===t.type,"Unexpected patch mesh figure");const a=this.coords,n=this.colors,i=t.coords,s=t.colors,o=Math.min(a[i[0]][0],a[i[3]][0],a[i[12]][0],a[i[15]][0]),c=Math.min(a[i[0]][1],a[i[3]][1],a[i[12]][1],a[i[15]][1]),l=Math.max(a[i[0]][0],a[i[3]][0],a[i[12]][0],a[i[15]][0]),h=Math.max(a[i[0]][1],a[i[3]][1],a[i[12]][1],a[i[15]][1]);let u=Math.ceil((l-o)*MeshShading.TRIANGLE_DENSITY/(this.bounds[2]-this.bounds[0]));u=Math.max(MeshShading.MIN_SPLIT_PATCH_CHUNKS_AMOUNT,Math.min(MeshShading.MAX_SPLIT_PATCH_CHUNKS_AMOUNT,u));let d=Math.ceil((h-c)*MeshShading.TRIANGLE_DENSITY/(this.bounds[3]-this.bounds[1]));d=Math.max(MeshShading.MIN_SPLIT_PATCH_CHUNKS_AMOUNT,Math.min(MeshShading.MAX_SPLIT_PATCH_CHUNKS_AMOUNT,d));const g=u+1,p=new Int32Array((d+1)*g),m=new Int32Array((d+1)*g);let b=0;const y=new Uint8Array(3),w=new Uint8Array(3),S=n[s[0]],x=n[s[1]],C=n[s[2]],k=n[s[3]],v=f(d),F=f(u);for(let e=0;e<=d;e++){y[0]=(S[0]*(d-e)+C[0]*e)/d|0;y[1]=(S[1]*(d-e)+C[1]*e)/d|0;y[2]=(S[2]*(d-e)+C[2]*e)/d|0;w[0]=(x[0]*(d-e)+k[0]*e)/d|0;w[1]=(x[1]*(d-e)+k[1]*e)/d|0;w[2]=(x[2]*(d-e)+k[2]*e)/d|0;for(let t=0;t<=u;t++,b++){if(!(0!==e&&e!==d||0!==t&&t!==u))continue;let r=0,s=0,o=0;for(let n=0;n<=3;n++)for(let c=0;c<=3;c++,o++){const l=v[e][n]*F[t][c];r+=a[i[o]][0]*l;s+=a[i[o]][1]*l}p[b]=a.length;a.push([r,s]);m[b]=n.length;const c=new Uint8Array(3);c[0]=(y[0]*(u-t)+w[0]*t)/u|0;c[1]=(y[1]*(u-t)+w[1]*t)/u|0;c[2]=(y[2]*(u-t)+w[2]*t)/u|0;n.push(c)}}p[0]=i[0];m[0]=s[0];p[u]=i[3];m[u]=s[1];p[g*d]=i[12];m[g*d]=s[2];p[g*d+u]=i[15];m[g*d+u]=s[3];this.figures[e]={type:"lattice",coords:p,colors:m,verticesPerRow:g}}_updateBounds(){let e=this.coords[0][0],t=this.coords[0][1],a=e,r=t;for(let n=1,i=this.coords.length;n<i;n++){const i=this.coords[n][0],s=this.coords[n][1];e=e>i?i:e;t=t>s?s:t;a=a<i?i:a;r=r<s?s:r}this.bounds=[e,t,a,r]}_packData(){let e,t,a,r;const n=this.coords,i=new Float32Array(2*n.length);for(e=0,a=0,t=n.length;e<t;e++){const t=n[e];i[a++]=t[0];i[a++]=t[1]}this.coords=i;const s=this.colors,o=new Uint8Array(3*s.length);for(e=0,a=0,t=s.length;e<t;e++){const t=s[e];o[a++]=t[0];o[a++]=t[1];o[a++]=t[2]}this.colors=o;const c=this.figures;for(e=0,t=c.length;e<t;e++){const t=c[e],n=t.coords,i=t.colors;for(a=0,r=n.length;a<r;a++){n[a]*=2;i[a]*=3}}}getIR(){return["Mesh",this.shadingType,this.coords,this.colors,this.figures,this.bounds,this.bbox,this.background]}}class DummyShading extends BaseShading{getIR(){return["Dummy"]}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.getXfaFontDict=function getXfaFontDict(e){const t=function getXfaFontWidths(e){const t=getXfaFontName(e);if(!t)return null;const{baseWidths:a,baseMapping:r,factors:n}=t;let i;i=n?a.map(((e,t)=>e*n[t])):a;let s,o=-2;const c=[];for(const[e,t]of r.map(((e,t)=>[e,t])).sort((([e],[t])=>e-t)))if(-1!==e)if(e===o+1){s.push(i[t]);o+=1}else{o=e;s=[i[t]];c.push(e,s)}return c}(e),a=new n.Dict(null);a.set("BaseFont",n.Name.get(e));a.set("Type",n.Name.get("Font"));a.set("Subtype",n.Name.get("CIDFontType2"));a.set("Encoding",n.Name.get("Identity-H"));a.set("CIDToGIDMap",n.Name.get("Identity"));a.set("W",t);a.set("FirstChar",t[0]);a.set("LastChar",t.at(-2)+t.at(-1).length-1);const r=new n.Dict(null);a.set("FontDescriptor",r);const i=new n.Dict(null);i.set("Ordering","Identity");i.set("Registry","Adobe");i.set("Supplement",0);a.set("CIDSystemInfo",i);return a};t.getXfaFontName=getXfaFontName;var r=a(50),n=a(4),i=a(51),s=a(52),o=a(53),c=a(54),l=a(3),h=a(36);const u=(0,l.getLookupTableFactory)((function(e){e["MyriadPro-Regular"]=e["PdfJS-Fallback-Regular"]={name:"LiberationSans-Regular",factors:o.MyriadProRegularFactors,baseWidths:s.LiberationSansRegularWidths,baseMapping:s.LiberationSansRegularMapping,metrics:o.MyriadProRegularMetrics};e["MyriadPro-Bold"]=e["PdfJS-Fallback-Bold"]={name:"LiberationSans-Bold",factors:o.MyriadProBoldFactors,baseWidths:s.LiberationSansBoldWidths,baseMapping:s.LiberationSansBoldMapping,metrics:o.MyriadProBoldMetrics};e["MyriadPro-It"]=e["MyriadPro-Italic"]=e["PdfJS-Fallback-Italic"]={name:"LiberationSans-Italic",factors:o.MyriadProItalicFactors,baseWidths:s.LiberationSansItalicWidths,baseMapping:s.LiberationSansItalicMapping,metrics:o.MyriadProItalicMetrics};e["MyriadPro-BoldIt"]=e["MyriadPro-BoldItalic"]=e["PdfJS-Fallback-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:o.MyriadProBoldItalicFactors,baseWidths:s.LiberationSansBoldItalicWidths,baseMapping:s.LiberationSansBoldItalicMapping,metrics:o.MyriadProBoldItalicMetrics};e.ArialMT=e.Arial=e["Arial-Regular"]={name:"LiberationSans-Regular",baseWidths:s.LiberationSansRegularWidths,baseMapping:s.LiberationSansRegularMapping};e["Arial-BoldMT"]=e["Arial-Bold"]={name:"LiberationSans-Bold",baseWidths:s.LiberationSansBoldWidths,baseMapping:s.LiberationSansBoldMapping};e["Arial-ItalicMT"]=e["Arial-Italic"]={name:"LiberationSans-Italic",baseWidths:s.LiberationSansItalicWidths,baseMapping:s.LiberationSansItalicMapping};e["Arial-BoldItalicMT"]=e["Arial-BoldItalic"]={name:"LiberationSans-BoldItalic",baseWidths:s.LiberationSansBoldItalicWidths,baseMapping:s.LiberationSansBoldItalicMapping};e["Calibri-Regular"]={name:"LiberationSans-Regular",factors:r.CalibriRegularFactors,baseWidths:s.LiberationSansRegularWidths,baseMapping:s.LiberationSansRegularMapping,metrics:r.CalibriRegularMetrics};e["Calibri-Bold"]={name:"LiberationSans-Bold",factors:r.CalibriBoldFactors,baseWidths:s.LiberationSansBoldWidths,baseMapping:s.LiberationSansBoldMapping,metrics:r.CalibriBoldMetrics};e["Calibri-Italic"]={name:"LiberationSans-Italic",factors:r.CalibriItalicFactors,baseWidths:s.LiberationSansItalicWidths,baseMapping:s.LiberationSansItalicMapping,metrics:r.CalibriItalicMetrics};e["Calibri-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:r.CalibriBoldItalicFactors,baseWidths:s.LiberationSansBoldItalicWidths,baseMapping:s.LiberationSansBoldItalicMapping,metrics:r.CalibriBoldItalicMetrics};e["Segoeui-Regular"]={name:"LiberationSans-Regular",factors:c.SegoeuiRegularFactors,baseWidths:s.LiberationSansRegularWidths,baseMapping:s.LiberationSansRegularMapping,metrics:c.SegoeuiRegularMetrics};e["Segoeui-Bold"]={name:"LiberationSans-Bold",factors:c.SegoeuiBoldFactors,baseWidths:s.LiberationSansBoldWidths,baseMapping:s.LiberationSansBoldMapping,metrics:c.SegoeuiBoldMetrics};e["Segoeui-Italic"]={name:"LiberationSans-Italic",factors:c.SegoeuiItalicFactors,baseWidths:s.LiberationSansItalicWidths,baseMapping:s.LiberationSansItalicMapping,metrics:c.SegoeuiItalicMetrics};e["Segoeui-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:c.SegoeuiBoldItalicFactors,baseWidths:s.LiberationSansBoldItalicWidths,baseMapping:s.LiberationSansBoldItalicMapping,metrics:c.SegoeuiBoldItalicMetrics};e["Helvetica-Regular"]=e.Helvetica={name:"LiberationSans-Regular",factors:i.HelveticaRegularFactors,baseWidths:s.LiberationSansRegularWidths,baseMapping:s.LiberationSansRegularMapping,metrics:i.HelveticaRegularMetrics};e["Helvetica-Bold"]={name:"LiberationSans-Bold",factors:i.HelveticaBoldFactors,baseWidths:s.LiberationSansBoldWidths,baseMapping:s.LiberationSansBoldMapping,metrics:i.HelveticaBoldMetrics};e["Helvetica-Italic"]={name:"LiberationSans-Italic",factors:i.HelveticaItalicFactors,baseWidths:s.LiberationSansItalicWidths,baseMapping:s.LiberationSansItalicMapping,metrics:i.HelveticaItalicMetrics};e["Helvetica-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:i.HelveticaBoldItalicFactors,baseWidths:s.LiberationSansBoldItalicWidths,baseMapping:s.LiberationSansBoldItalicMapping,metrics:i.HelveticaBoldItalicMetrics}}));function getXfaFontName(e){const t=(0,h.normalizeFontName)(e);return u()[t]}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.CalibriRegularMetrics=t.CalibriRegularFactors=t.CalibriItalicMetrics=t.CalibriItalicFactors=t.CalibriBoldMetrics=t.CalibriBoldItalicMetrics=t.CalibriBoldItalicFactors=t.CalibriBoldFactors=void 0;t.CalibriBoldFactors=[1.3877,1,1,1,.97801,.92482,.89552,.91133,.81988,.97566,.98152,.93548,.93548,1.2798,.85284,.92794,1,.96134,1.54657,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.82845,.82845,.85284,.85284,.85284,.75859,.92138,.83908,.7762,.73293,.87289,.73133,.7514,.81921,.87356,.95958,.59526,.75727,.69225,1.04924,.9121,.86943,.79795,.88198,.77958,.70864,.81055,.90399,.88653,.96017,.82577,.77892,.78257,.97507,1.54657,.97507,.85284,.89552,.90176,.88762,.8785,.75241,.8785,.90518,.95015,.77618,.8785,.88401,.91916,.86304,.88401,.91488,.8785,.8801,.8785,.8785,.91343,.7173,1.04106,.8785,.85075,.95794,.82616,.85162,.79492,.88331,1.69808,.88331,.85284,.97801,.89552,.91133,.89552,.91133,1.7801,.89552,1.24487,1.13254,1.12401,.96839,.85284,.68787,.70645,.85592,.90747,1.01466,1.0088,.90323,1,1.07463,1,.91056,.75806,1.19118,.96839,.78864,.82845,.84133,.75859,.83908,.83908,.83908,.83908,.83908,.83908,.77539,.73293,.73133,.73133,.73133,.73133,.95958,.95958,.95958,.95958,.88506,.9121,.86943,.86943,.86943,.86943,.86943,.85284,.87508,.90399,.90399,.90399,.90399,.77892,.79795,.90807,.88762,.88762,.88762,.88762,.88762,.88762,.8715,.75241,.90518,.90518,.90518,.90518,.88401,.88401,.88401,.88401,.8785,.8785,.8801,.8801,.8801,.8801,.8801,.90747,.89049,.8785,.8785,.8785,.8785,.85162,.8785,.85162,.83908,.88762,.83908,.88762,.83908,.88762,.73293,.75241,.73293,.75241,.73293,.75241,.73293,.75241,.87289,.83016,.88506,.93125,.73133,.90518,.73133,.90518,.73133,.90518,.73133,.90518,.73133,.90518,.81921,.77618,.81921,.77618,.81921,.77618,1,1,.87356,.8785,.91075,.89608,.95958,.88401,.95958,.88401,.95958,.88401,.95958,.88401,.95958,.88401,.76229,.90167,.59526,.91916,1,1,.86304,.69225,.88401,1,1,.70424,.79468,.91926,.88175,.70823,.94903,.9121,.8785,1,1,.9121,.8785,.87802,.88656,.8785,.86943,.8801,.86943,.8801,.86943,.8801,.87402,.89291,.77958,.91343,1,1,.77958,.91343,.70864,.7173,.70864,.7173,.70864,.7173,.70864,.7173,1,1,.81055,.75841,.81055,1.06452,.90399,.8785,.90399,.8785,.90399,.8785,.90399,.8785,.90399,.8785,.90399,.8785,.96017,.95794,.77892,.85162,.77892,.78257,.79492,.78257,.79492,.78257,.79492,.9297,.56892,.83908,.88762,.77539,.8715,.87508,.89049,1,1,.81055,1.04106,1.20528,1.20528,1,1.15543,.70674,.98387,.94721,1.33431,1.45894,.95161,1.06303,.83908,.80352,.57184,.6965,.56289,.82001,.56029,.81235,1.02988,.83908,.7762,.68156,.80367,.73133,.78257,.87356,.86943,.95958,.75727,.89019,1.04924,.9121,.7648,.86943,.87356,.79795,.78275,.81055,.77892,.9762,.82577,.99819,.84896,.95958,.77892,.96108,1.01407,.89049,1.02988,.94211,.96108,.8936,.84021,.87842,.96399,.79109,.89049,1.00813,1.02988,.86077,.87445,.92099,.84723,.86513,.8801,.75638,.85714,.78216,.79586,.87965,.94211,.97747,.78287,.97926,.84971,1.02988,.94211,.8801,.94211,.84971,.73133,1,1,1,1,1,1,1,1,1,1,1,1,.90264,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.90518,1,1,1,1,1,1,1,1,1,1,1,1,.90548,1,1,1,1,1,1,.96017,.95794,.96017,.95794,.96017,.95794,.77892,.85162,1,1,.89552,.90527,1,.90363,.92794,.92794,.92794,.92794,.87012,.87012,.87012,.89552,.89552,1.42259,.71143,1.06152,1,1,1.03372,1.03372,.97171,1.4956,2.2807,.93835,.83406,.91133,.84107,.91133,1,1,1,.72021,1,1.23108,.83489,.88525,.88525,.81499,.90527,1.81055,.90527,1.81055,1.31006,1.53711,.94434,1.08696,1,.95018,.77192,.85284,.90747,1.17534,.69825,.9716,1.37077,.90747,.90747,.85356,.90747,.90747,1.44947,.85284,.8941,.8941,.70572,.8,.70572,.70572,.70572,.70572,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.99862,.99862,1,1,1,1,1,1.08004,.91027,1,1,1,.99862,1,1,1,1,1,1,1,1,1,1,1,1,.90727,.90727,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];t.CalibriBoldMetrics={lineHeight:1.2207,lineGap:.2207};t.CalibriBoldItalicFactors=[1.3877,1,1,1,.97801,.92482,.89552,.91133,.81988,.97566,.98152,.93548,.93548,1.2798,.85284,.92794,1,.96134,1.56239,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.82845,.82845,.85284,.85284,.85284,.75859,.92138,.83908,.7762,.71805,.87289,.73133,.7514,.81921,.87356,.95958,.59526,.75727,.69225,1.04924,.90872,.85938,.79795,.87068,.77958,.69766,.81055,.90399,.88653,.96068,.82577,.77892,.78257,.97507,1.529,.97507,.85284,.89552,.90176,.94908,.86411,.74012,.86411,.88323,.95015,.86411,.86331,.88401,.91916,.86304,.88401,.9039,.86331,.86331,.86411,.86411,.90464,.70852,1.04106,.86331,.84372,.95794,.82616,.84548,.79492,.88331,1.69808,.88331,.85284,.97801,.89552,.91133,.89552,.91133,1.7801,.89552,1.24487,1.13254,1.19129,.96839,.85284,.68787,.70645,.85592,.90747,1.01466,1.0088,.90323,1,1.07463,1,.91056,.75806,1.19118,.96839,.78864,.82845,.84133,.75859,.83908,.83908,.83908,.83908,.83908,.83908,.77539,.71805,.73133,.73133,.73133,.73133,.95958,.95958,.95958,.95958,.88506,.90872,.85938,.85938,.85938,.85938,.85938,.85284,.87068,.90399,.90399,.90399,.90399,.77892,.79795,.90807,.94908,.94908,.94908,.94908,.94908,.94908,.85887,.74012,.88323,.88323,.88323,.88323,.88401,.88401,.88401,.88401,.8785,.86331,.86331,.86331,.86331,.86331,.86331,.90747,.89049,.86331,.86331,.86331,.86331,.84548,.86411,.84548,.83908,.94908,.83908,.94908,.83908,.94908,.71805,.74012,.71805,.74012,.71805,.74012,.71805,.74012,.87289,.79538,.88506,.92726,.73133,.88323,.73133,.88323,.73133,.88323,.73133,.88323,.73133,.88323,.81921,.86411,.81921,.86411,.81921,.86411,1,1,.87356,.86331,.91075,.8777,.95958,.88401,.95958,.88401,.95958,.88401,.95958,.88401,.95958,.88401,.76467,.90167,.59526,.91916,1,1,.86304,.69225,.88401,1,1,.70424,.77312,.91926,.88175,.70823,.94903,.90872,.86331,1,1,.90872,.86331,.86906,.88116,.86331,.85938,.86331,.85938,.86331,.85938,.86331,.87402,.86549,.77958,.90464,1,1,.77958,.90464,.69766,.70852,.69766,.70852,.69766,.70852,.69766,.70852,1,1,.81055,.75841,.81055,1.06452,.90399,.86331,.90399,.86331,.90399,.86331,.90399,.86331,.90399,.86331,.90399,.86331,.96068,.95794,.77892,.84548,.77892,.78257,.79492,.78257,.79492,.78257,.79492,.9297,.56892,.83908,.94908,.77539,.85887,.87068,.89049,1,1,.81055,1.04106,1.20528,1.20528,1,1.15543,.70088,.98387,.94721,1.33431,1.45894,.95161,1.48387,.83908,.80352,.57118,.6965,.56347,.79179,.55853,.80346,1.02988,.83908,.7762,.67174,.86036,.73133,.78257,.87356,.86441,.95958,.75727,.89019,1.04924,.90872,.74889,.85938,.87891,.79795,.7957,.81055,.77892,.97447,.82577,.97466,.87179,.95958,.77892,.94252,.95612,.8753,1.02988,.92733,.94252,.87411,.84021,.8728,.95612,.74081,.8753,1.02189,1.02988,.84814,.87445,.91822,.84723,.85668,.86331,.81344,.87581,.76422,.82046,.96057,.92733,.99375,.78022,.95452,.86015,1.02988,.92733,.86331,.92733,.86015,.73133,1,1,1,1,1,1,1,1,1,1,1,1,.90631,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.88323,1,1,1,1,1,1,1,1,1,1,1,1,.85174,1,1,1,1,1,1,.96068,.95794,.96068,.95794,.96068,.95794,.77892,.84548,1,1,.89552,.90527,1,.90363,.92794,.92794,.92794,.89807,.87012,.87012,.87012,.89552,.89552,1.42259,.71094,1.06152,1,1,1.03372,1.03372,.97171,1.4956,2.2807,.92972,.83406,.91133,.83326,.91133,1,1,1,.72021,1,1.23108,.83489,.88525,.88525,.81499,.90616,1.81055,.90527,1.81055,1.3107,1.53711,.94434,1.08696,1,.95018,.77192,.85284,.90747,1.17534,.69825,.9716,1.37077,.90747,.90747,.85356,.90747,.90747,1.44947,.85284,.8941,.8941,.70572,.8,.70572,.70572,.70572,.70572,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.99862,.99862,1,1,1,1,1,1.08004,.91027,1,1,1,.99862,1,1,1,1,1,1,1,1,1,1,1,1,.90727,.90727,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];t.CalibriBoldItalicMetrics={lineHeight:1.2207,lineGap:.2207};t.CalibriItalicFactors=[1.3877,1,1,1,1.17223,1.1293,.89552,.91133,.80395,1.02269,1.15601,.91056,.91056,1.2798,.85284,.89807,1,.90861,1.39543,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.96309,.96309,.85284,.85284,.85284,.83319,.88071,.8675,.81552,.72346,.85193,.73206,.7522,.81105,.86275,.90685,.6377,.77892,.75593,1.02638,.89249,.84118,.77452,.85374,.75186,.67789,.79776,.88844,.85066,.94309,.77818,.7306,.76659,1.10369,1.38313,1.10369,1.06139,.89552,.8739,.9245,.9245,.83203,.9245,.85865,1.09842,.9245,.9245,1.03297,1.07692,.90918,1.03297,.94959,.9245,.92274,.9245,.9245,1.02933,.77832,1.20562,.9245,.8916,.98986,.86621,.89453,.79004,.94152,1.77256,.94152,.85284,.97801,.89552,.91133,.89552,.91133,1.91729,.89552,1.17889,1.13254,1.16359,.92098,.85284,.68787,.71353,.84737,.90747,1.0088,1.0044,.87683,1,1.09091,1,.92229,.739,1.15642,.92098,.76288,.80504,.80972,.75859,.8675,.8675,.8675,.8675,.8675,.8675,.76318,.72346,.73206,.73206,.73206,.73206,.90685,.90685,.90685,.90685,.86477,.89249,.84118,.84118,.84118,.84118,.84118,.85284,.84557,.88844,.88844,.88844,.88844,.7306,.77452,.86331,.9245,.9245,.9245,.9245,.9245,.9245,.84843,.83203,.85865,.85865,.85865,.85865,.82601,.82601,.82601,.82601,.94469,.9245,.92274,.92274,.92274,.92274,.92274,.90747,.86651,.9245,.9245,.9245,.9245,.89453,.9245,.89453,.8675,.9245,.8675,.9245,.8675,.9245,.72346,.83203,.72346,.83203,.72346,.83203,.72346,.83203,.85193,.8875,.86477,.99034,.73206,.85865,.73206,.85865,.73206,.85865,.73206,.85865,.73206,.85865,.81105,.9245,.81105,.9245,.81105,.9245,1,1,.86275,.9245,.90872,.93591,.90685,.82601,.90685,.82601,.90685,.82601,.90685,1.03297,.90685,.82601,.77896,1.05611,.6377,1.07692,1,1,.90918,.75593,1.03297,1,1,.76032,.9375,.98156,.93407,.77261,1.11429,.89249,.9245,1,1,.89249,.9245,.92534,.86698,.9245,.84118,.92274,.84118,.92274,.84118,.92274,.8667,.86291,.75186,1.02933,1,1,.75186,1.02933,.67789,.77832,.67789,.77832,.67789,.77832,.67789,.77832,1,1,.79776,.97655,.79776,1.23023,.88844,.9245,.88844,.9245,.88844,.9245,.88844,.9245,.88844,.9245,.88844,.9245,.94309,.98986,.7306,.89453,.7306,.76659,.79004,.76659,.79004,.76659,.79004,1.09231,.54873,.8675,.9245,.76318,.84843,.84557,.86651,1,1,.79776,1.20562,1.18622,1.18622,1,1.1437,.67009,.96334,.93695,1.35191,1.40909,.95161,1.48387,.8675,.90861,.6192,.7363,.64824,.82411,.56321,.85696,1.23516,.8675,.81552,.7286,.84134,.73206,.76659,.86275,.84369,.90685,.77892,.85871,1.02638,.89249,.75828,.84118,.85984,.77452,.76466,.79776,.7306,.90782,.77818,.903,.87291,.90685,.7306,.99058,1.03667,.94635,1.23516,.9849,.99058,.92393,.8916,.942,1.03667,.75026,.94635,1.0297,1.23516,.90918,.94048,.98217,.89746,.84153,.92274,.82507,.88832,.84438,.88178,1.03525,.9849,1.00225,.78086,.97248,.89404,1.23516,.9849,.92274,.9849,.89404,.73206,1,1,1,1,1,1,1,1,1,1,1,1,.89693,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.85865,1,1,1,1,1,1,1,1,1,1,1,1,.90933,1,1,1,1,1,1,.94309,.98986,.94309,.98986,.94309,.98986,.7306,.89453,1,1,.89552,.90527,1,.90186,1.12308,1.12308,1.12308,1.12308,1.2566,1.2566,1.2566,.89552,.89552,1.42259,.68994,1.03809,1,1,1.0176,1.0176,1.11523,1.4956,2.01462,.97858,.82616,.91133,.83437,.91133,1,1,1,.70508,1,1.23108,.79801,.84426,.84426,.774,.90572,1.81055,.90749,1.81055,1.28809,1.55469,.94434,1.07806,1,.97094,.7589,.85284,.90747,1.19658,.69825,.97622,1.33512,.90747,.90747,.85284,.90747,.90747,1.44947,.85284,.8941,.8941,.70572,.8,.70572,.70572,.70572,.70572,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.99862,.99862,1,1,1,1,1,1.0336,.91027,1,1,1,.99862,1,1,1,1,1,1,1,1,1,1,1,1,1.05859,1.05859,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];t.CalibriItalicMetrics={lineHeight:1.2207,lineGap:.2207};t.CalibriRegularFactors=[1.3877,1,1,1,1.17223,1.1293,.89552,.91133,.80395,1.02269,1.15601,.91056,.91056,1.2798,.85284,.89807,1,.90861,1.39016,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.96309,.96309,.85284,.85284,.85284,.83319,.88071,.8675,.81552,.73834,.85193,.73206,.7522,.81105,.86275,.90685,.6377,.77892,.75593,1.02638,.89385,.85122,.77452,.86503,.75186,.68887,.79776,.88844,.85066,.94258,.77818,.7306,.76659,1.10369,1.39016,1.10369,1.06139,.89552,.8739,.86128,.94469,.8457,.94469,.89464,1.09842,.84636,.94469,1.03297,1.07692,.90918,1.03297,.95897,.94469,.9482,.94469,.94469,1.04692,.78223,1.20562,.94469,.90332,.98986,.86621,.90527,.79004,.94152,1.77256,.94152,.85284,.97801,.89552,.91133,.89552,.91133,1.91729,.89552,1.17889,1.13254,1.08707,.92098,.85284,.68787,.71353,.84737,.90747,1.0088,1.0044,.87683,1,1.09091,1,.92229,.739,1.15642,.92098,.76288,.80504,.80972,.75859,.8675,.8675,.8675,.8675,.8675,.8675,.76318,.73834,.73206,.73206,.73206,.73206,.90685,.90685,.90685,.90685,.86477,.89385,.85122,.85122,.85122,.85122,.85122,.85284,.85311,.88844,.88844,.88844,.88844,.7306,.77452,.86331,.86128,.86128,.86128,.86128,.86128,.86128,.8693,.8457,.89464,.89464,.89464,.89464,.82601,.82601,.82601,.82601,.94469,.94469,.9482,.9482,.9482,.9482,.9482,.90747,.86651,.94469,.94469,.94469,.94469,.90527,.94469,.90527,.8675,.86128,.8675,.86128,.8675,.86128,.73834,.8457,.73834,.8457,.73834,.8457,.73834,.8457,.85193,.92454,.86477,.9921,.73206,.89464,.73206,.89464,.73206,.89464,.73206,.89464,.73206,.89464,.81105,.84636,.81105,.84636,.81105,.84636,1,1,.86275,.94469,.90872,.95786,.90685,.82601,.90685,.82601,.90685,.82601,.90685,1.03297,.90685,.82601,.77741,1.05611,.6377,1.07692,1,1,.90918,.75593,1.03297,1,1,.76032,.90452,.98156,1.11842,.77261,1.11429,.89385,.94469,1,1,.89385,.94469,.95877,.86901,.94469,.85122,.9482,.85122,.9482,.85122,.9482,.8667,.90016,.75186,1.04692,1,1,.75186,1.04692,.68887,.78223,.68887,.78223,.68887,.78223,.68887,.78223,1,1,.79776,.92188,.79776,1.23023,.88844,.94469,.88844,.94469,.88844,.94469,.88844,.94469,.88844,.94469,.88844,.94469,.94258,.98986,.7306,.90527,.7306,.76659,.79004,.76659,.79004,.76659,.79004,1.09231,.54873,.8675,.86128,.76318,.8693,.85311,.86651,1,1,.79776,1.20562,1.18622,1.18622,1,1.1437,.67742,.96334,.93695,1.35191,1.40909,.95161,1.48387,.86686,.90861,.62267,.74359,.65649,.85498,.56963,.88254,1.23516,.8675,.81552,.75443,.84503,.73206,.76659,.86275,.85122,.90685,.77892,.85746,1.02638,.89385,.75657,.85122,.86275,.77452,.74171,.79776,.7306,.95165,.77818,.89772,.88831,.90685,.7306,.98142,1.02191,.96576,1.23516,.99018,.98142,.9236,.89258,.94035,1.02191,.78848,.96576,.9561,1.23516,.90918,.92578,.95424,.89746,.83969,.9482,.80113,.89442,.85208,.86155,.98022,.99018,1.00452,.81209,.99247,.89181,1.23516,.99018,.9482,.99018,.89181,.73206,1,1,1,1,1,1,1,1,1,1,1,1,.88844,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.89464,1,1,1,1,1,1,1,1,1,1,1,1,.96766,1,1,1,1,1,1,.94258,.98986,.94258,.98986,.94258,.98986,.7306,.90527,1,1,.89552,.90527,1,.90186,1.12308,1.12308,1.12308,1.12308,1.2566,1.2566,1.2566,.89552,.89552,1.42259,.69043,1.03809,1,1,1.0176,1.0176,1.11523,1.4956,2.01462,.99331,.82616,.91133,.84286,.91133,1,1,1,.70508,1,1.23108,.79801,.84426,.84426,.774,.90527,1.81055,.90527,1.81055,1.28809,1.55469,.94434,1.07806,1,.97094,.7589,.85284,.90747,1.19658,.69825,.97622,1.33512,.90747,.90747,.85356,.90747,.90747,1.44947,.85284,.8941,.8941,.70572,.8,.70572,.70572,.70572,.70572,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.99862,.99862,1,1,1,1,1,1.0336,.91027,1,1,1,.99862,1,1,1,1,1,1,1,1,1,1,1,1,1.05859,1.05859,1,1,1,1.07185,.99413,.96334,1.08065,1,1,1,1,1,1,1,1,1,1,1];t.CalibriRegularMetrics={lineHeight:1.2207,lineGap:.2207}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.HelveticaRegularMetrics=t.HelveticaRegularFactors=t.HelveticaItalicMetrics=t.HelveticaItalicFactors=t.HelveticaBoldMetrics=t.HelveticaBoldItalicMetrics=t.HelveticaBoldItalicFactors=t.HelveticaBoldFactors=void 0;t.HelveticaBoldFactors=[.76116,1,1,1.0006,.99998,.99974,.99973,.99973,.99982,.99977,1.00087,.99998,.99998,.99959,1.00003,1.0006,.99998,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99998,1,1.00003,1.00003,1.00003,1.00026,.9999,.99977,.99977,.99977,.99977,1.00001,1.00026,1.00022,.99977,1.0006,.99973,.99977,1.00026,.99999,.99977,1.00022,1.00001,1.00022,.99977,1.00001,1.00026,.99977,1.00001,1.00016,1.00001,1.00001,1.00026,.99998,1.0006,.99998,1.00003,.99973,.99998,.99973,1.00026,.99973,1.00026,.99973,.99998,1.00026,1.00026,1.0006,1.0006,.99973,1.0006,.99982,1.00026,1.00026,1.00026,1.00026,.99959,.99973,.99998,1.00026,.99973,1.00022,.99973,.99973,1,.99959,1.00077,.99959,1.00003,.99998,.99973,.99973,.99973,.99973,1.00077,.99973,.99998,1.00025,.99968,.99973,1.00003,1.00025,.60299,1.00024,1.06409,1,1,.99998,1,.99973,1.0006,.99998,1,.99936,.99973,1.00002,1.00002,1.00002,1.00026,.99977,.99977,.99977,.99977,.99977,.99977,1,.99977,1.00001,1.00001,1.00001,1.00001,1.0006,1.0006,1.0006,1.0006,.99977,.99977,1.00022,1.00022,1.00022,1.00022,1.00022,1.00003,1.00022,.99977,.99977,.99977,.99977,1.00001,1.00001,1.00026,.99973,.99973,.99973,.99973,.99973,.99973,.99982,.99973,.99973,.99973,.99973,.99973,1.0006,1.0006,1.0006,1.0006,1.00026,1.00026,1.00026,1.00026,1.00026,1.00026,1.00026,1.06409,1.00026,1.00026,1.00026,1.00026,1.00026,.99973,1.00026,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,1.03374,.99977,1.00026,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,.99977,1.00026,.99977,1.00026,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.00042,.99973,.99973,1.0006,.99977,.99973,.99973,1.00026,1.0006,1.00026,1.0006,1.00026,1.03828,1.00026,.99999,1.00026,1.0006,.99977,1.00026,.99977,1.00026,.99977,1.00026,.9993,.9998,1.00026,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,1,1.00016,.99977,.99959,.99977,.99959,.99977,.99959,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00026,.99998,1.00026,.8121,1.00026,.99998,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,1.00016,1.00022,1.00001,.99973,1.00001,1.00026,1,1.00026,1,1.00026,1,1.0006,.99973,.99977,.99973,1,.99982,1.00022,1.00026,1.00001,.99973,1.00026,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,1.00034,.99977,1,.99997,1.00026,1.00078,1.00036,.99973,1.00013,1.0006,.99977,.99977,.99988,.85148,1.00001,1.00026,.99977,1.00022,1.0006,.99977,1.00001,.99999,.99977,1.00069,1.00022,.99977,1.00001,.99984,1.00026,1.00001,1.00024,1.00001,.9999,1,1.0006,1.00001,1.00041,.99962,1.00026,1.0006,.99995,1.00041,.99942,.99973,.99927,1.00082,.99902,1.00026,1.00087,1.0006,1.00069,.99973,.99867,.99973,.9993,1.00026,1.00049,1.00056,1,.99988,.99935,.99995,.99954,1.00055,.99945,1.00032,1.0006,.99995,1.00026,.99995,1.00032,1.00001,1.00008,.99971,1.00019,.9994,1.00001,1.0006,1.00044,.99973,1.00023,1.00047,1,.99942,.99561,.99989,1.00035,.99977,1.00035,.99977,1.00019,.99944,1.00001,1.00021,.99926,1.00035,1.00035,.99942,1.00048,.99999,.99977,1.00022,1.00035,1.00001,.99977,1.00026,.99989,1.00057,1.00001,.99936,1.00052,1.00012,.99996,1.00043,1,1.00035,.9994,.99976,1.00035,.99973,1.00052,1.00041,1.00119,1.00037,.99973,1.00002,.99986,1.00041,1.00041,.99902,.9996,1.00034,.99999,1.00026,.99999,1.00026,.99973,1.00052,.99973,1,.99973,1.00041,1.00075,.9994,1.0003,.99999,1,1.00041,.99955,1,.99915,.99973,.99973,1.00026,1.00119,.99955,.99973,1.0006,.99911,1.0006,1.00026,.99972,1.00026,.99902,1.00041,.99973,.99999,1,1,1.00038,1.0005,1.00016,1.00022,1.00016,1.00022,1.00016,1.00022,1.00001,.99973,1,1,.99973,1,1,.99955,1.0006,1.0006,1.0006,1.0006,1,1,1,.99973,.99973,.99972,1,1,1.00106,.99999,.99998,.99998,.99999,.99998,1.66475,1,.99973,.99973,1.00023,.99973,.99971,1.00047,1.00023,1,.99991,.99984,1.00002,1.00002,1.00002,1.00002,1,1,1,1,1,1,1,.99972,1,1.20985,1.39713,1.00003,1.00031,1.00015,1,.99561,1.00027,1.00031,1.00031,.99915,1.00031,1.00031,.99999,1.00003,.99999,.99999,1.41144,1.6,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.40579,1.40579,1.36625,.99999,1,.99861,.99861,1,1.00026,1.00026,1.00026,1.00026,.99972,.99999,.99999,.99999,.99999,1.40483,1,.99977,1.00054,1,1,.99953,.99962,1.00042,.9995,1,1,1,1,1,1,1,1,.99998,.99998,.99998,.99998,1,1,1,1,1,1,1,1,1,1,1];t.HelveticaBoldMetrics={lineHeight:1.2,lineGap:.2};t.HelveticaBoldItalicFactors=[.76116,1,1,1.0006,.99998,.99974,.99973,.99973,.99982,.99977,1.00087,.99998,.99998,.99959,1.00003,1.0006,.99998,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99998,1,1.00003,1.00003,1.00003,1.00026,.9999,.99977,.99977,.99977,.99977,1.00001,1.00026,1.00022,.99977,1.0006,.99973,.99977,1.00026,.99999,.99977,1.00022,1.00001,1.00022,.99977,1.00001,1.00026,.99977,1.00001,1.00016,1.00001,1.00001,1.00026,.99998,1.0006,.99998,1.00003,.99973,.99998,.99973,1.00026,.99973,1.00026,.99973,.99998,1.00026,1.00026,1.0006,1.0006,.99973,1.0006,.99982,1.00026,1.00026,1.00026,1.00026,.99959,.99973,.99998,1.00026,.99973,1.00022,.99973,.99973,1,.99959,1.00077,.99959,1.00003,.99998,.99973,.99973,.99973,.99973,1.00077,.99973,.99998,1.00025,.99968,.99973,1.00003,1.00025,.60299,1.00024,1.06409,1,1,.99998,1,.99973,1.0006,.99998,1,.99936,.99973,1.00002,1.00002,1.00002,1.00026,.99977,.99977,.99977,.99977,.99977,.99977,1,.99977,1.00001,1.00001,1.00001,1.00001,1.0006,1.0006,1.0006,1.0006,.99977,.99977,1.00022,1.00022,1.00022,1.00022,1.00022,1.00003,1.00022,.99977,.99977,.99977,.99977,1.00001,1.00001,1.00026,.99973,.99973,.99973,.99973,.99973,.99973,.99982,.99973,.99973,.99973,.99973,.99973,1.0006,1.0006,1.0006,1.0006,1.00026,1.00026,1.00026,1.00026,1.00026,1.00026,1.00026,1.06409,1.00026,1.00026,1.00026,1.00026,1.00026,.99973,1.00026,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,1.0044,.99977,1.00026,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,.99977,1.00026,.99977,1.00026,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,.99971,.99973,.99973,1.0006,.99977,.99973,.99973,1.00026,1.0006,1.00026,1.0006,1.00026,1.01011,1.00026,.99999,1.00026,1.0006,.99977,1.00026,.99977,1.00026,.99977,1.00026,.9993,.9998,1.00026,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,1,1.00016,.99977,.99959,.99977,.99959,.99977,.99959,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00026,.99998,1.00026,.8121,1.00026,.99998,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,1.00016,1.00022,1.00001,.99973,1.00001,1.00026,1,1.00026,1,1.00026,1,1.0006,.99973,.99977,.99973,1,.99982,1.00022,1.00026,1.00001,.99973,1.00026,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99977,1,1,1.00026,.99969,.99972,.99981,.9998,1.0006,.99977,.99977,1.00022,.91155,1.00001,1.00026,.99977,1.00022,1.0006,.99977,1.00001,.99999,.99977,.99966,1.00022,1.00032,1.00001,.99944,1.00026,1.00001,.99968,1.00001,1.00047,1,1.0006,1.00001,.99981,1.00101,1.00026,1.0006,.99948,.99981,1.00064,.99973,.99942,1.00101,1.00061,1.00026,1.00069,1.0006,1.00014,.99973,1.01322,.99973,1.00065,1.00026,1.00012,.99923,1,1.00064,1.00076,.99948,1.00055,1.00063,1.00007,.99943,1.0006,.99948,1.00026,.99948,.99943,1.00001,1.00001,1.00029,1.00038,1.00035,1.00001,1.0006,1.0006,.99973,.99978,1.00001,1.00057,.99989,.99967,.99964,.99967,.99977,.99999,.99977,1.00038,.99977,1.00001,.99973,1.00066,.99967,.99967,1.00041,.99998,.99999,.99977,1.00022,.99967,1.00001,.99977,1.00026,.99964,1.00031,1.00001,.99999,.99999,1,1.00023,1,1,.99999,1.00035,1.00001,.99999,.99973,.99977,.99999,1.00058,.99973,.99973,.99955,.9995,1.00026,1.00026,1.00032,.99989,1.00034,.99999,1.00026,1.00026,1.00026,.99973,.45998,.99973,1.00026,.99973,1.00001,.99999,.99982,.99994,.99996,1,1.00042,1.00044,1.00029,1.00023,.99973,.99973,1.00026,.99949,1.00002,.99973,1.0006,1.0006,1.0006,.99975,1.00026,1.00026,1.00032,.98685,.99973,1.00026,1,1,.99966,1.00044,1.00016,1.00022,1.00016,1.00022,1.00016,1.00022,1.00001,.99973,1,1,.99973,1,1,.99955,1.0006,1.0006,1.0006,1.0006,1,1,1,.99973,.99973,.99972,1,1,1.00106,.99999,.99998,.99998,.99999,.99998,1.66475,1,.99973,.99973,1,.99973,.99971,.99978,1,1,.99991,.99984,1.00002,1.00002,1.00002,1.00002,1.00098,1,1,1,1.00049,1,1,.99972,1,1.20985,1.39713,1.00003,1.00031,1.00015,1,.99561,1.00027,1.00031,1.00031,.99915,1.00031,1.00031,.99999,1.00003,.99999,.99999,1.41144,1.6,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.40579,1.40579,1.36625,.99999,1,.99861,.99861,1,1.00026,1.00026,1.00026,1.00026,.99972,.99999,.99999,.99999,.99999,1.40483,1,.99977,1.00054,1,1,.99953,.99962,1.00042,.9995,1,1,1,1,1,1,1,1,.99998,.99998,.99998,.99998,1,1,1,1,1,1,1,1,1,1,1];t.HelveticaBoldItalicMetrics={lineHeight:1.35,lineGap:.2};t.HelveticaItalicFactors=[.76116,1,1,1.0006,1.0006,1.00006,.99973,.99973,.99982,1.00001,1.00043,.99998,.99998,.99959,1.00003,1.0006,.99998,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,1.0006,1,1.00003,1.00003,1.00003,.99973,.99987,1.00001,1.00001,.99977,.99977,1.00001,1.00026,1.00022,.99977,1.0006,1,1.00001,.99973,.99999,.99977,1.00022,1.00001,1.00022,.99977,1.00001,1.00026,.99977,1.00001,1.00016,1.00001,1.00001,1.00026,1.0006,1.0006,1.0006,.99949,.99973,.99998,.99973,.99973,1,.99973,.99973,1.0006,.99973,.99973,.99924,.99924,1,.99924,.99999,.99973,.99973,.99973,.99973,.99998,1,1.0006,.99973,1,.99977,1,1,1,1.00005,1.0009,1.00005,1.00003,.99998,.99973,.99973,.99973,.99973,1.0009,.99973,.99998,1.00025,.99968,.99973,1.00003,1.00025,.60299,1.00024,1.06409,1,1,.99998,1,.9998,1.0006,.99998,1,.99936,.99973,1.00002,1.00002,1.00002,1.00026,1.00001,1.00001,1.00001,1.00001,1.00001,1.00001,1,.99977,1.00001,1.00001,1.00001,1.00001,1.0006,1.0006,1.0006,1.0006,.99977,.99977,1.00022,1.00022,1.00022,1.00022,1.00022,1.00003,1.00022,.99977,.99977,.99977,.99977,1.00001,1.00001,1.00026,.99973,.99973,.99973,.99973,.99973,.99973,.99982,1,.99973,.99973,.99973,.99973,1.0006,1.0006,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,1.06409,1.00026,.99973,.99973,.99973,.99973,1,.99973,1,1.00001,.99973,1.00001,.99973,1.00001,.99973,.99977,1,.99977,1,.99977,1,.99977,1,.99977,1.0288,.99977,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,.99977,.99973,.99977,.99973,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,.99924,1.0006,1.0006,.99946,1.00034,1,.99924,1.00001,1,1,.99973,.99924,.99973,.99924,.99973,1.06311,.99973,1.00024,.99973,.99924,.99977,.99973,.99977,.99973,.99977,.99973,1.00041,.9998,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,1,1.00016,.99977,.99998,.99977,.99998,.99977,.99998,1.00001,1,1.00001,1,1.00001,1,1.00001,1,1.00026,1.0006,1.00026,.89547,1.00026,1.0006,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,1.00016,.99977,1.00001,1,1.00001,1.00026,1,1.00026,1,1.00026,1,.99924,.99973,1.00001,.99973,1,.99982,1.00022,1.00026,1.00001,1,1.00026,1.0006,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,1.00001,1,1.00054,.99977,1.00084,1.00007,.99973,1.00013,.99924,1.00001,1.00001,.99945,.91221,1.00001,1.00026,.99977,1.00022,1.0006,1.00001,1.00001,.99999,.99977,.99933,1.00022,1.00054,1.00001,1.00065,1.00026,1.00001,1.0001,1.00001,1.00052,1,1.0006,1.00001,.99945,.99897,.99968,.99924,1.00036,.99945,.99949,1,1.0006,.99897,.99918,.99968,.99911,.99924,1,.99962,1.01487,1,1.0005,.99973,1.00012,1.00043,1,.99995,.99994,1.00036,.99947,1.00019,1.00063,1.00025,.99924,1.00036,.99973,1.00036,1.00025,1.00001,1.00001,1.00027,1.0001,1.00068,1.00001,1.0006,1.0006,1,1.00008,.99957,.99972,.9994,.99954,.99975,1.00051,1.00001,1.00019,1.00001,1.0001,.99986,1.00001,1.00001,1.00038,.99954,.99954,.9994,1.00066,.99999,.99977,1.00022,1.00054,1.00001,.99977,1.00026,.99975,1.0001,1.00001,.99993,.9995,.99955,1.00016,.99978,.99974,1.00019,1.00022,.99955,1.00053,.99973,1.00089,1.00005,.99967,1.00048,.99973,1.00002,1.00034,.99973,.99973,.99964,1.00006,1.00066,.99947,.99973,.98894,.99973,1,.44898,1,.99946,1,1.00039,1.00082,.99991,.99991,.99985,1.00022,1.00023,1.00061,1.00006,.99966,.99973,.99973,.99973,1.00019,1.0008,1,.99924,.99924,.99924,.99983,1.00044,.99973,.99964,.98332,1,.99973,1,1,.99962,.99895,1.00016,.99977,1.00016,.99977,1.00016,.99977,1.00001,1,1,1,.99973,1,1,.99955,.99924,.99924,.99924,.99924,.99998,.99998,.99998,.99973,.99973,.99972,1,1,1.00267,.99999,.99998,.99998,1,.99998,1.66475,1,.99973,.99973,1.00023,.99973,1.00423,.99925,.99999,1,.99991,.99984,1.00002,1.00002,1.00002,1.00002,1.00049,1,1.00245,1,1,1,1,.96329,1,1.20985,1.39713,1.00003,.8254,1.00015,1,1.00035,1.00027,1.00031,1.00031,1.00003,1.00031,1.00031,.99999,1.00003,.99999,.99999,1.41144,1.6,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.40579,1.40579,1.36625,.99999,1,.99861,.99861,1,1.00026,1.00026,1.00026,1.00026,.95317,.99999,.99999,.99999,.99999,1.40483,1,.99977,1.00054,1,1,.99953,.99962,1.00042,.9995,1,1,1,1,1,1,1,1,.99998,.99998,.99998,.99998,1,1,1,1,1,1,1,1,1,1,1];t.HelveticaItalicMetrics={lineHeight:1.35,lineGap:.2};t.HelveticaRegularFactors=[.76116,1,1,1.0006,1.0006,1.00006,.99973,.99973,.99982,1.00001,1.00043,.99998,.99998,.99959,1.00003,1.0006,.99998,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,1.0006,1,1.00003,1.00003,1.00003,.99973,.99987,1.00001,1.00001,.99977,.99977,1.00001,1.00026,1.00022,.99977,1.0006,1,1.00001,.99973,.99999,.99977,1.00022,1.00001,1.00022,.99977,1.00001,1.00026,.99977,1.00001,1.00016,1.00001,1.00001,1.00026,1.0006,1.0006,1.0006,.99949,.99973,.99998,.99973,.99973,1,.99973,.99973,1.0006,.99973,.99973,.99924,.99924,1,.99924,.99999,.99973,.99973,.99973,.99973,.99998,1,1.0006,.99973,1,.99977,1,1,1,1.00005,1.0009,1.00005,1.00003,.99998,.99973,.99973,.99973,.99973,1.0009,.99973,.99998,1.00025,.99968,.99973,1.00003,1.00025,.60299,1.00024,1.06409,1,1,.99998,1,.9998,1.0006,.99998,1,.99936,.99973,1.00002,1.00002,1.00002,1.00026,1.00001,1.00001,1.00001,1.00001,1.00001,1.00001,1,.99977,1.00001,1.00001,1.00001,1.00001,1.0006,1.0006,1.0006,1.0006,.99977,.99977,1.00022,1.00022,1.00022,1.00022,1.00022,1.00003,1.00022,.99977,.99977,.99977,.99977,1.00001,1.00001,1.00026,.99973,.99973,.99973,.99973,.99973,.99973,.99982,1,.99973,.99973,.99973,.99973,1.0006,1.0006,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,1.06409,1.00026,.99973,.99973,.99973,.99973,1,.99973,1,1.00001,.99973,1.00001,.99973,1.00001,.99973,.99977,1,.99977,1,.99977,1,.99977,1,.99977,1.04596,.99977,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,.99977,.99973,.99977,.99973,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,.99924,1.0006,1.0006,1.00019,1.00034,1,.99924,1.00001,1,1,.99973,.99924,.99973,.99924,.99973,1.02572,.99973,1.00005,.99973,.99924,.99977,.99973,.99977,.99973,.99977,.99973,.99999,.9998,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,1,1.00016,.99977,.99998,.99977,.99998,.99977,.99998,1.00001,1,1.00001,1,1.00001,1,1.00001,1,1.00026,1.0006,1.00026,.84533,1.00026,1.0006,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,1.00016,.99977,1.00001,1,1.00001,1.00026,1,1.00026,1,1.00026,1,.99924,.99973,1.00001,.99973,1,.99982,1.00022,1.00026,1.00001,1,1.00026,1.0006,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99928,1,.99977,1.00013,1.00055,.99947,.99945,.99941,.99924,1.00001,1.00001,1.0004,.91621,1.00001,1.00026,.99977,1.00022,1.0006,1.00001,1.00005,.99999,.99977,1.00015,1.00022,.99977,1.00001,.99973,1.00026,1.00001,1.00019,1.00001,.99946,1,1.0006,1.00001,.99978,1.00045,.99973,.99924,1.00023,.99978,.99966,1,1.00065,1.00045,1.00019,.99973,.99973,.99924,1,1,.96499,1,1.00055,.99973,1.00008,1.00027,1,.9997,.99995,1.00023,.99933,1.00019,1.00015,1.00031,.99924,1.00023,.99973,1.00023,1.00031,1.00001,.99928,1.00029,1.00092,1.00035,1.00001,1.0006,1.0006,1,.99988,.99975,1,1.00082,.99561,.9996,1.00035,1.00001,.99962,1.00001,1.00092,.99964,1.00001,.99963,.99999,1.00035,1.00035,1.00082,.99962,.99999,.99977,1.00022,1.00035,1.00001,.99977,1.00026,.9996,.99967,1.00001,1.00034,1.00074,1.00054,1.00053,1.00063,.99971,.99962,1.00035,.99975,.99977,.99973,1.00043,.99953,1.0007,.99915,.99973,1.00008,.99892,1.00073,1.00073,1.00114,.99915,1.00073,.99955,.99973,1.00092,.99973,1,.99998,1,1.0003,1,1.00043,1.00001,.99969,1.0003,1,1.00035,1.00001,.9995,1,1.00092,.99973,.99973,.99973,1.0007,.9995,1,.99924,1.0006,.99924,.99972,1.00062,.99973,1.00114,1.00073,1,.99955,1,1,1.00047,.99968,1.00016,.99977,1.00016,.99977,1.00016,.99977,1.00001,1,1,1,.99973,1,1,.99955,.99924,.99924,.99924,.99924,.99998,.99998,.99998,.99973,.99973,.99972,1,1,1.00267,.99999,.99998,.99998,1,.99998,1.66475,1,.99973,.99973,1.00023,.99973,.99971,.99925,1.00023,1,.99991,.99984,1.00002,1.00002,1.00002,1.00002,1,1,1,1,1,1,1,.96329,1,1.20985,1.39713,1.00003,.8254,1.00015,1,1.00035,1.00027,1.00031,1.00031,.99915,1.00031,1.00031,.99999,1.00003,.99999,.99999,1.41144,1.6,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.40579,1.40579,1.36625,.99999,1,.99861,.99861,1,1.00026,1.00026,1.00026,1.00026,.95317,.99999,.99999,.99999,.99999,1.40483,1,.99977,1.00054,1,1,.99953,.99962,1.00042,.9995,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];t.HelveticaRegularMetrics={lineHeight:1.2,lineGap:.2}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.LiberationSansRegularWidths=t.LiberationSansRegularMapping=t.LiberationSansItalicWidths=t.LiberationSansItalicMapping=t.LiberationSansBoldWidths=t.LiberationSansBoldMapping=t.LiberationSansBoldItalicWidths=t.LiberationSansBoldItalicMapping=void 0;t.LiberationSansBoldWidths=[365,0,333,278,333,474,556,556,889,722,238,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,333,333,584,584,584,611,975,722,722,722,722,667,611,778,722,278,556,722,611,833,722,778,667,778,722,667,611,722,667,944,667,667,611,333,278,333,584,556,333,556,611,556,611,556,333,611,611,278,278,556,278,889,611,611,611,611,389,556,333,611,556,778,556,556,500,389,280,389,584,333,556,556,556,556,280,556,333,737,370,556,584,737,552,400,549,333,333,333,576,556,278,333,333,365,556,834,834,834,611,722,722,722,722,722,722,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,556,556,556,556,556,278,278,278,278,611,611,611,611,611,611,611,549,611,611,611,611,611,556,611,556,722,556,722,556,722,556,722,556,722,556,722,556,722,556,722,719,722,611,667,556,667,556,667,556,667,556,667,556,778,611,778,611,778,611,778,611,722,611,722,611,278,278,278,278,278,278,278,278,278,278,785,556,556,278,722,556,556,611,278,611,278,611,385,611,479,611,278,722,611,722,611,722,611,708,723,611,778,611,778,611,778,611,1e3,944,722,389,722,389,722,389,667,556,667,556,667,556,667,556,611,333,611,479,611,333,722,611,722,611,722,611,722,611,722,611,722,611,944,778,667,556,667,611,500,611,500,611,500,278,556,722,556,1e3,889,778,611,667,556,611,333,333,333,333,333,333,333,333,333,333,333,465,722,333,853,906,474,825,927,838,278,722,722,601,719,667,611,722,778,278,722,667,833,722,644,778,722,667,600,611,667,821,667,809,802,278,667,615,451,611,278,582,615,610,556,606,475,460,611,541,278,558,556,612,556,445,611,766,619,520,684,446,582,715,576,753,845,278,582,611,582,845,667,669,885,567,711,667,278,276,556,1094,1062,875,610,722,622,719,722,719,722,567,712,667,904,626,719,719,610,702,833,722,778,719,667,722,611,622,854,667,730,703,1005,1019,870,979,719,711,1031,719,556,618,615,417,635,556,709,497,615,615,500,635,740,604,611,604,611,556,490,556,875,556,615,581,833,844,729,854,615,552,854,583,556,556,611,417,552,556,278,281,278,969,906,611,500,615,556,604,778,611,487,447,944,778,944,778,944,778,667,556,333,333,556,1e3,1e3,552,278,278,278,278,500,500,500,556,556,350,1e3,1e3,240,479,333,333,604,333,167,396,556,556,1094,556,885,489,1115,1e3,768,600,834,834,834,834,1e3,500,1e3,500,1e3,500,500,494,612,823,713,584,549,713,979,722,274,549,549,583,549,549,604,584,604,604,708,625,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,729,604,604,354,354,1e3,990,990,990,990,494,604,604,604,604,354,1021,1052,917,750,750,531,656,594,510,500,750,750,611,611,333,333,333,333,333,333,333,333,222,222,333,333,333,333,333,333,333,333];t.LiberationSansBoldMapping=[-1,-1,-1,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,402,506,507,508,509,510,511,536,537,538,539,710,711,713,728,729,730,731,732,733,900,901,902,903,904,905,906,908,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1138,1139,1168,1169,7808,7809,7810,7811,7812,7813,7922,7923,8208,8209,8211,8212,8213,8215,8216,8217,8218,8219,8220,8221,8222,8224,8225,8226,8230,8240,8242,8243,8249,8250,8252,8254,8260,8319,8355,8356,8359,8364,8453,8467,8470,8482,8486,8494,8539,8540,8541,8542,8592,8593,8594,8595,8596,8597,8616,8706,8710,8719,8721,8722,8730,8734,8735,8745,8747,8776,8800,8801,8804,8805,8962,8976,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9600,9604,9608,9612,9616,9617,9618,9619,9632,9633,9642,9643,9644,9650,9658,9660,9668,9674,9675,9679,9688,9689,9702,9786,9787,9788,9792,9794,9824,9827,9829,9830,9834,9835,9836,61441,61442,61445,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];t.LiberationSansBoldItalicWidths=[365,0,333,278,333,474,556,556,889,722,238,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,333,333,584,584,584,611,975,722,722,722,722,667,611,778,722,278,556,722,611,833,722,778,667,778,722,667,611,722,667,944,667,667,611,333,278,333,584,556,333,556,611,556,611,556,333,611,611,278,278,556,278,889,611,611,611,611,389,556,333,611,556,778,556,556,500,389,280,389,584,333,556,556,556,556,280,556,333,737,370,556,584,737,552,400,549,333,333,333,576,556,278,333,333,365,556,834,834,834,611,722,722,722,722,722,722,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,556,556,556,556,556,278,278,278,278,611,611,611,611,611,611,611,549,611,611,611,611,611,556,611,556,722,556,722,556,722,556,722,556,722,556,722,556,722,556,722,740,722,611,667,556,667,556,667,556,667,556,667,556,778,611,778,611,778,611,778,611,722,611,722,611,278,278,278,278,278,278,278,278,278,278,782,556,556,278,722,556,556,611,278,611,278,611,396,611,479,611,278,722,611,722,611,722,611,708,723,611,778,611,778,611,778,611,1e3,944,722,389,722,389,722,389,667,556,667,556,667,556,667,556,611,333,611,479,611,333,722,611,722,611,722,611,722,611,722,611,722,611,944,778,667,556,667,611,500,611,500,611,500,278,556,722,556,1e3,889,778,611,667,556,611,333,333,333,333,333,333,333,333,333,333,333,333,722,333,854,906,473,844,930,847,278,722,722,610,671,667,611,722,778,278,722,667,833,722,657,778,718,667,590,611,667,822,667,829,781,278,667,620,479,611,278,591,620,621,556,610,479,492,611,558,278,566,556,603,556,450,611,712,605,532,664,409,591,704,578,773,834,278,591,611,591,834,667,667,886,614,719,667,278,278,556,1094,1042,854,622,719,677,719,722,708,722,614,722,667,927,643,719,719,615,687,833,722,778,719,667,722,611,677,781,667,729,708,979,989,854,1e3,708,719,1042,729,556,619,604,534,618,556,736,510,611,611,507,622,740,604,611,611,611,556,889,556,885,556,646,583,889,935,707,854,594,552,865,589,556,556,611,469,563,556,278,278,278,969,906,611,507,619,556,611,778,611,575,467,944,778,944,778,944,778,667,556,333,333,556,1e3,1e3,552,278,278,278,278,500,500,500,556,556,350,1e3,1e3,240,479,333,333,604,333,167,396,556,556,1104,556,885,516,1146,1e3,768,600,834,834,834,834,999,500,1e3,500,1e3,500,500,494,612,823,713,584,549,713,979,722,274,549,549,583,549,549,604,584,604,604,708,625,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,729,604,604,354,354,1e3,990,990,990,990,494,604,604,604,604,354,1021,1052,917,750,750,531,656,594,510,500,750,750,611,611,333,333,333,333,333,333,333,333,222,222,333,333,333,333,333,333,333,333];t.LiberationSansBoldItalicMapping=[-1,-1,-1,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,402,506,507,508,509,510,511,536,537,538,539,710,711,713,728,729,730,731,732,733,900,901,902,903,904,905,906,908,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1138,1139,1168,1169,7808,7809,7810,7811,7812,7813,7922,7923,8208,8209,8211,8212,8213,8215,8216,8217,8218,8219,8220,8221,8222,8224,8225,8226,8230,8240,8242,8243,8249,8250,8252,8254,8260,8319,8355,8356,8359,8364,8453,8467,8470,8482,8486,8494,8539,8540,8541,8542,8592,8593,8594,8595,8596,8597,8616,8706,8710,8719,8721,8722,8730,8734,8735,8745,8747,8776,8800,8801,8804,8805,8962,8976,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9600,9604,9608,9612,9616,9617,9618,9619,9632,9633,9642,9643,9644,9650,9658,9660,9668,9674,9675,9679,9688,9689,9702,9786,9787,9788,9792,9794,9824,9827,9829,9830,9834,9835,9836,61441,61442,61445,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];t.LiberationSansItalicWidths=[365,0,333,278,278,355,556,556,889,667,191,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,278,278,584,584,584,556,1015,667,667,722,722,667,611,778,722,278,500,667,556,833,722,778,667,778,722,667,611,722,667,944,667,667,611,278,278,278,469,556,333,556,556,500,556,556,278,556,556,222,222,500,222,833,556,556,556,556,333,500,278,556,500,722,500,500,500,334,260,334,584,333,556,556,556,556,260,556,333,737,370,556,584,737,552,400,549,333,333,333,576,537,278,333,333,365,556,834,834,834,611,667,667,667,667,667,667,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,500,556,556,556,556,278,278,278,278,556,556,556,556,556,556,556,549,611,556,556,556,556,500,556,500,667,556,667,556,667,556,722,500,722,500,722,500,722,500,722,625,722,556,667,556,667,556,667,556,667,556,667,556,778,556,778,556,778,556,778,556,722,556,722,556,278,278,278,278,278,278,278,222,278,278,733,444,500,222,667,500,500,556,222,556,222,556,281,556,400,556,222,722,556,722,556,722,556,615,723,556,778,556,778,556,778,556,1e3,944,722,333,722,333,722,333,667,500,667,500,667,500,667,500,611,278,611,354,611,278,722,556,722,556,722,556,722,556,722,556,722,556,944,722,667,500,667,611,500,611,500,611,500,222,556,667,556,1e3,889,778,611,667,500,611,278,333,333,333,333,333,333,333,333,333,333,333,667,278,789,846,389,794,865,775,222,667,667,570,671,667,611,722,778,278,667,667,833,722,648,778,725,667,600,611,667,837,667,831,761,278,667,570,439,555,222,550,570,571,500,556,439,463,555,542,222,500,492,548,500,447,556,670,573,486,603,374,550,652,546,728,779,222,550,556,550,779,667,667,843,544,708,667,278,278,500,1066,982,844,589,715,639,724,667,651,667,544,704,667,917,614,715,715,589,686,833,722,778,725,667,722,611,639,795,667,727,673,920,923,805,886,651,694,1022,682,556,562,522,493,553,556,688,465,556,556,472,564,686,550,556,556,556,500,833,500,835,500,572,518,830,851,621,736,526,492,752,534,556,556,556,378,496,500,222,222,222,910,828,556,472,565,500,556,778,556,492,339,944,722,944,722,944,722,667,500,333,333,556,1e3,1e3,552,222,222,222,222,333,333,333,556,556,350,1e3,1e3,188,354,333,333,500,333,167,365,556,556,1094,556,885,323,1083,1e3,768,600,834,834,834,834,1e3,500,998,500,1e3,500,500,494,612,823,713,584,549,713,979,719,274,549,549,584,549,549,604,584,604,604,708,625,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,729,604,604,354,354,1e3,990,990,990,990,494,604,604,604,604,354,1021,1052,917,750,750,531,656,594,510,500,750,750,500,500,333,333,333,333,333,333,333,333,222,222,294,294,324,324,316,328,398,285];t.LiberationSansItalicMapping=[-1,-1,-1,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,402,506,507,508,509,510,511,536,537,538,539,710,711,713,728,729,730,731,732,733,900,901,902,903,904,905,906,908,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1138,1139,1168,1169,7808,7809,7810,7811,7812,7813,7922,7923,8208,8209,8211,8212,8213,8215,8216,8217,8218,8219,8220,8221,8222,8224,8225,8226,8230,8240,8242,8243,8249,8250,8252,8254,8260,8319,8355,8356,8359,8364,8453,8467,8470,8482,8486,8494,8539,8540,8541,8542,8592,8593,8594,8595,8596,8597,8616,8706,8710,8719,8721,8722,8730,8734,8735,8745,8747,8776,8800,8801,8804,8805,8962,8976,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9600,9604,9608,9612,9616,9617,9618,9619,9632,9633,9642,9643,9644,9650,9658,9660,9668,9674,9675,9679,9688,9689,9702,9786,9787,9788,9792,9794,9824,9827,9829,9830,9834,9835,9836,61441,61442,61445,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];t.LiberationSansRegularWidths=[365,0,333,278,278,355,556,556,889,667,191,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,278,278,584,584,584,556,1015,667,667,722,722,667,611,778,722,278,500,667,556,833,722,778,667,778,722,667,611,722,667,944,667,667,611,278,278,278,469,556,333,556,556,500,556,556,278,556,556,222,222,500,222,833,556,556,556,556,333,500,278,556,500,722,500,500,500,334,260,334,584,333,556,556,556,556,260,556,333,737,370,556,584,737,552,400,549,333,333,333,576,537,278,333,333,365,556,834,834,834,611,667,667,667,667,667,667,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,500,556,556,556,556,278,278,278,278,556,556,556,556,556,556,556,549,611,556,556,556,556,500,556,500,667,556,667,556,667,556,722,500,722,500,722,500,722,500,722,615,722,556,667,556,667,556,667,556,667,556,667,556,778,556,778,556,778,556,778,556,722,556,722,556,278,278,278,278,278,278,278,222,278,278,735,444,500,222,667,500,500,556,222,556,222,556,292,556,334,556,222,722,556,722,556,722,556,604,723,556,778,556,778,556,778,556,1e3,944,722,333,722,333,722,333,667,500,667,500,667,500,667,500,611,278,611,375,611,278,722,556,722,556,722,556,722,556,722,556,722,556,944,722,667,500,667,611,500,611,500,611,500,222,556,667,556,1e3,889,778,611,667,500,611,278,333,333,333,333,333,333,333,333,333,333,333,667,278,784,838,384,774,855,752,222,667,667,551,668,667,611,722,778,278,667,668,833,722,650,778,722,667,618,611,667,798,667,835,748,278,667,578,446,556,222,547,578,575,500,557,446,441,556,556,222,500,500,576,500,448,556,690,569,482,617,395,547,648,525,713,781,222,547,556,547,781,667,667,865,542,719,667,278,278,500,1057,1010,854,583,722,635,719,667,656,667,542,677,667,923,604,719,719,583,656,833,722,778,719,667,722,611,635,760,667,740,667,917,938,792,885,656,719,1010,722,556,573,531,365,583,556,669,458,559,559,438,583,688,552,556,542,556,500,458,500,823,500,573,521,802,823,625,719,521,510,750,542,556,556,556,365,510,500,222,278,222,906,812,556,438,559,500,552,778,556,489,411,944,722,944,722,944,722,667,500,333,333,556,1e3,1e3,552,222,222,222,222,333,333,333,556,556,350,1e3,1e3,188,354,333,333,500,333,167,365,556,556,1094,556,885,323,1073,1e3,768,600,834,834,834,834,1e3,500,1e3,500,1e3,500,500,494,612,823,713,584,549,713,979,719,274,549,549,583,549,549,604,584,604,604,708,625,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,729,604,604,354,354,1e3,990,990,990,990,494,604,604,604,604,354,1021,1052,917,750,750,531,656,594,510,500,750,750,500,500,333,333,333,333,333,333,333,333,222,222,294,294,324,324,316,328,398,285];t.LiberationSansRegularMapping=[-1,-1,-1,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,402,506,507,508,509,510,511,536,537,538,539,710,711,713,728,729,730,731,732,733,900,901,902,903,904,905,906,908,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1138,1139,1168,1169,7808,7809,7810,7811,7812,7813,7922,7923,8208,8209,8211,8212,8213,8215,8216,8217,8218,8219,8220,8221,8222,8224,8225,8226,8230,8240,8242,8243,8249,8250,8252,8254,8260,8319,8355,8356,8359,8364,8453,8467,8470,8482,8486,8494,8539,8540,8541,8542,8592,8593,8594,8595,8596,8597,8616,8706,8710,8719,8721,8722,8730,8734,8735,8745,8747,8776,8800,8801,8804,8805,8962,8976,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9600,9604,9608,9612,9616,9617,9618,9619,9632,9633,9642,9643,9644,9650,9658,9660,9668,9674,9675,9679,9688,9689,9702,9786,9787,9788,9792,9794,9824,9827,9829,9830,9834,9835,9836,61441,61442,61445,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.MyriadProRegularMetrics=t.MyriadProRegularFactors=t.MyriadProItalicMetrics=t.MyriadProItalicFactors=t.MyriadProBoldMetrics=t.MyriadProBoldItalicMetrics=t.MyriadProBoldItalicFactors=t.MyriadProBoldFactors=void 0;t.MyriadProBoldFactors=[1.36898,1,1,.72706,.80479,.83734,.98894,.99793,.9897,.93884,.86209,.94292,.94292,1.16661,1.02058,.93582,.96694,.93582,1.19137,.99793,.99793,.99793,.99793,.99793,.99793,.99793,.99793,.99793,.99793,.78076,.78076,1.02058,1.02058,1.02058,.72851,.78966,.90838,.83637,.82391,.96376,.80061,.86275,.8768,.95407,1.0258,.73901,.85022,.83655,1.0156,.95546,.92179,.87107,.92179,.82114,.8096,.89713,.94438,.95353,.94083,.91905,.90406,.9446,.94292,1.18777,.94292,1.02058,.89903,.90088,.94938,.97898,.81093,.97571,.94938,1.024,.9577,.95933,.98621,1.0474,.97455,.98981,.9672,.95933,.9446,.97898,.97407,.97646,.78036,1.10208,.95442,.95298,.97579,.9332,.94039,.938,.80687,1.01149,.80687,1.02058,.80479,.99793,.99793,.99793,.99793,1.01149,1.00872,.90088,.91882,1.0213,.8361,1.02058,.62295,.54324,.89022,1.08595,1,1,.90088,1,.97455,.93582,.90088,1,1.05686,.8361,.99642,.99642,.99642,.72851,.90838,.90838,.90838,.90838,.90838,.90838,.868,.82391,.80061,.80061,.80061,.80061,1.0258,1.0258,1.0258,1.0258,.97484,.95546,.92179,.92179,.92179,.92179,.92179,1.02058,.92179,.94438,.94438,.94438,.94438,.90406,.86958,.98225,.94938,.94938,.94938,.94938,.94938,.94938,.9031,.81093,.94938,.94938,.94938,.94938,.98621,.98621,.98621,.98621,.93969,.95933,.9446,.9446,.9446,.9446,.9446,1.08595,.9446,.95442,.95442,.95442,.95442,.94039,.97898,.94039,.90838,.94938,.90838,.94938,.90838,.94938,.82391,.81093,.82391,.81093,.82391,.81093,.82391,.81093,.96376,.84313,.97484,.97571,.80061,.94938,.80061,.94938,.80061,.94938,.80061,.94938,.80061,.94938,.8768,.9577,.8768,.9577,.8768,.9577,1,1,.95407,.95933,.97069,.95933,1.0258,.98621,1.0258,.98621,1.0258,.98621,1.0258,.98621,1.0258,.98621,.887,1.01591,.73901,1.0474,1,1,.97455,.83655,.98981,1,1,.83655,.73977,.83655,.73903,.84638,1.033,.95546,.95933,1,1,.95546,.95933,.8271,.95417,.95933,.92179,.9446,.92179,.9446,.92179,.9446,.936,.91964,.82114,.97646,1,1,.82114,.97646,.8096,.78036,.8096,.78036,1,1,.8096,.78036,1,1,.89713,.77452,.89713,1.10208,.94438,.95442,.94438,.95442,.94438,.95442,.94438,.95442,.94438,.95442,.94438,.95442,.94083,.97579,.90406,.94039,.90406,.9446,.938,.9446,.938,.9446,.938,1,.99793,.90838,.94938,.868,.9031,.92179,.9446,1,1,.89713,1.10208,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90989,.9358,.91945,.83181,.75261,.87992,.82976,.96034,.83689,.97268,1.0078,.90838,.83637,.8019,.90157,.80061,.9446,.95407,.92436,1.0258,.85022,.97153,1.0156,.95546,.89192,.92179,.92361,.87107,.96318,.89713,.93704,.95638,.91905,.91709,.92796,1.0258,.93704,.94836,1.0373,.95933,1.0078,.95871,.94836,.96174,.92601,.9498,.98607,.95776,.95933,1.05453,1.0078,.98275,.9314,.95617,.91701,1.05993,.9446,.78367,.9553,1,.86832,1.0128,.95871,.99394,.87548,.96361,.86774,1.0078,.95871,.9446,.95871,.86774,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.94083,.97579,.94083,.97579,.94083,.97579,.90406,.94039,.96694,1,.89903,1,1,1,.93582,.93582,.93582,1,.908,.908,.918,.94219,.94219,.96544,1,1.285,1,1,.81079,.81079,1,1,.74854,1,1,1,1,.99793,1,1,1,.65,1,1.36145,1,1,1,1,1,1,1,1,1,1,1,1.17173,1,.80535,.76169,1.02058,1.0732,1.05486,1,1,1.30692,1.08595,1.08595,1,1.08595,1.08595,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.16161,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];t.MyriadProBoldMetrics={lineHeight:1.2,lineGap:.2};t.MyriadProBoldItalicFactors=[1.36898,1,1,.66227,.80779,.81625,.97276,.97276,.97733,.92222,.83266,.94292,.94292,1.16148,1.02058,.93582,.96694,.93582,1.17337,.97276,.97276,.97276,.97276,.97276,.97276,.97276,.97276,.97276,.97276,.78076,.78076,1.02058,1.02058,1.02058,.71541,.76813,.85576,.80591,.80729,.94299,.77512,.83655,.86523,.92222,.98621,.71743,.81698,.79726,.98558,.92222,.90637,.83809,.90637,.80729,.76463,.86275,.90699,.91605,.9154,.85308,.85458,.90531,.94292,1.21296,.94292,1.02058,.89903,1.18616,.99613,.91677,.78216,.91677,.90083,.98796,.9135,.92168,.95381,.98981,.95298,.95381,.93459,.92168,.91513,.92004,.91677,.95077,.748,1.04502,.91677,.92061,.94236,.89544,.89364,.9,.80687,.8578,.80687,1.02058,.80779,.97276,.97276,.97276,.97276,.8578,.99973,1.18616,.91339,1.08074,.82891,1.02058,.55509,.71526,.89022,1.08595,1,1,1.18616,1,.96736,.93582,1.18616,1,1.04864,.82711,.99043,.99043,.99043,.71541,.85576,.85576,.85576,.85576,.85576,.85576,.845,.80729,.77512,.77512,.77512,.77512,.98621,.98621,.98621,.98621,.95961,.92222,.90637,.90637,.90637,.90637,.90637,1.02058,.90251,.90699,.90699,.90699,.90699,.85458,.83659,.94951,.99613,.99613,.99613,.99613,.99613,.99613,.85811,.78216,.90083,.90083,.90083,.90083,.95381,.95381,.95381,.95381,.9135,.92168,.91513,.91513,.91513,.91513,.91513,1.08595,.91677,.91677,.91677,.91677,.91677,.89364,.92332,.89364,.85576,.99613,.85576,.99613,.85576,.99613,.80729,.78216,.80729,.78216,.80729,.78216,.80729,.78216,.94299,.76783,.95961,.91677,.77512,.90083,.77512,.90083,.77512,.90083,.77512,.90083,.77512,.90083,.86523,.9135,.86523,.9135,.86523,.9135,1,1,.92222,.92168,.92222,.92168,.98621,.95381,.98621,.95381,.98621,.95381,.98621,.95381,.98621,.95381,.86036,.97096,.71743,.98981,1,1,.95298,.79726,.95381,1,1,.79726,.6894,.79726,.74321,.81691,1.0006,.92222,.92168,1,1,.92222,.92168,.79464,.92098,.92168,.90637,.91513,.90637,.91513,.90637,.91513,.909,.87514,.80729,.95077,1,1,.80729,.95077,.76463,.748,.76463,.748,1,1,.76463,.748,1,1,.86275,.72651,.86275,1.04502,.90699,.91677,.90699,.91677,.90699,.91677,.90699,.91677,.90699,.91677,.90699,.91677,.9154,.94236,.85458,.89364,.85458,.90531,.9,.90531,.9,.90531,.9,1,.97276,.85576,.99613,.845,.85811,.90251,.91677,1,1,.86275,1.04502,1.18616,1.18616,1.18616,1.18616,1.18616,1.18616,1.18616,1.18616,1.18616,1.00899,1.30628,.85576,.80178,.66862,.7927,.69323,.88127,.72459,.89711,.95381,.85576,.80591,.7805,.94729,.77512,.90531,.92222,.90637,.98621,.81698,.92655,.98558,.92222,.85359,.90637,.90976,.83809,.94523,.86275,.83509,.93157,.85308,.83392,.92346,.98621,.83509,.92886,.91324,.92168,.95381,.90646,.92886,.90557,.86847,.90276,.91324,.86842,.92168,.99531,.95381,.9224,.85408,.92699,.86847,1.0051,.91513,.80487,.93481,1,.88159,1.05214,.90646,.97355,.81539,.89398,.85923,.95381,.90646,.91513,.90646,.85923,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.9154,.94236,.9154,.94236,.9154,.94236,.85458,.89364,.96694,1,.89903,1,1,1,.91782,.91782,.91782,1,.896,.896,.896,.9332,.9332,.95973,1,1.26,1,1,.80479,.80178,1,1,.85633,1,1,1,1,.97276,1,1,1,.698,1,1.36145,1,1,1,1,1,1,1,1,1,1,1,1.14542,1,.79199,.78694,1.02058,1.03493,1.05486,1,1,1.23026,1.08595,1.08595,1,1.08595,1.08595,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.20006,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];t.MyriadProBoldItalicMetrics={lineHeight:1.2,lineGap:.2};t.MyriadProItalicFactors=[1.36898,1,1,.65507,.84943,.85639,.88465,.88465,.86936,.88307,.86948,.85283,.85283,1.06383,1.02058,.75945,.9219,.75945,1.17337,.88465,.88465,.88465,.88465,.88465,.88465,.88465,.88465,.88465,.88465,.75945,.75945,1.02058,1.02058,1.02058,.69046,.70926,.85158,.77812,.76852,.89591,.70466,.76125,.80094,.86822,.83864,.728,.77212,.79475,.93637,.87514,.8588,.76013,.8588,.72421,.69866,.77598,.85991,.80811,.87832,.78112,.77512,.8562,1.0222,1.18417,1.0222,1.27014,.89903,1.15012,.93859,.94399,.846,.94399,.81453,1.0186,.94219,.96017,1.03075,1.02175,.912,1.03075,.96998,.96017,.93859,.94399,.94399,.95493,.746,1.12658,.94578,.91,.979,.882,.882,.83,.85034,.83537,.85034,1.02058,.70869,.88465,.88465,.88465,.88465,.83537,.90083,1.15012,.9161,.94565,.73541,1.02058,.53609,.69353,.79519,1.08595,1,1,1.15012,1,.91974,.75945,1.15012,1,.9446,.73361,.9005,.9005,.9005,.62864,.85158,.85158,.85158,.85158,.85158,.85158,.773,.76852,.70466,.70466,.70466,.70466,.83864,.83864,.83864,.83864,.90561,.87514,.8588,.8588,.8588,.8588,.8588,1.02058,.85751,.85991,.85991,.85991,.85991,.77512,.76013,.88075,.93859,.93859,.93859,.93859,.93859,.93859,.8075,.846,.81453,.81453,.81453,.81453,.82424,.82424,.82424,.82424,.9278,.96017,.93859,.93859,.93859,.93859,.93859,1.08595,.8562,.94578,.94578,.94578,.94578,.882,.94578,.882,.85158,.93859,.85158,.93859,.85158,.93859,.76852,.846,.76852,.846,.76852,.846,.76852,.846,.89591,.8544,.90561,.94399,.70466,.81453,.70466,.81453,.70466,.81453,.70466,.81453,.70466,.81453,.80094,.94219,.80094,.94219,.80094,.94219,1,1,.86822,.96017,.86822,.96017,.83864,.82424,.83864,.82424,.83864,.82424,.83864,1.03075,.83864,.82424,.81402,1.02738,.728,1.02175,1,1,.912,.79475,1.03075,1,1,.79475,.83911,.79475,.66266,.80553,1.06676,.87514,.96017,1,1,.87514,.96017,.86865,.87396,.96017,.8588,.93859,.8588,.93859,.8588,.93859,.867,.84759,.72421,.95493,1,1,.72421,.95493,.69866,.746,.69866,.746,1,1,.69866,.746,1,1,.77598,.88417,.77598,1.12658,.85991,.94578,.85991,.94578,.85991,.94578,.85991,.94578,.85991,.94578,.85991,.94578,.87832,.979,.77512,.882,.77512,.8562,.83,.8562,.83,.8562,.83,1,.88465,.85158,.93859,.773,.8075,.85751,.8562,1,1,.77598,1.12658,1.15012,1.15012,1.15012,1.15012,1.15012,1.15313,1.15012,1.15012,1.15012,1.08106,1.03901,.85158,.77025,.62264,.7646,.65351,.86026,.69461,.89947,1.03075,.85158,.77812,.76449,.88836,.70466,.8562,.86822,.8588,.83864,.77212,.85308,.93637,.87514,.82352,.8588,.85701,.76013,.89058,.77598,.8156,.82565,.78112,.77899,.89386,.83864,.8156,.9486,.92388,.96186,1.03075,.91123,.9486,.93298,.878,.93942,.92388,.84596,.96186,.95119,1.03075,.922,.88787,.95829,.88,.93559,.93859,.78815,.93758,1,.89217,1.03737,.91123,.93969,.77487,.85769,.86799,1.03075,.91123,.93859,.91123,.86799,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.87832,.979,.87832,.979,.87832,.979,.77512,.882,.9219,1,.89903,1,1,1,.87321,.87321,.87321,1,1.027,1.027,1.027,.86847,.86847,.79121,1,1.124,1,1,.73572,.73572,1,1,.85034,1,1,1,1,.88465,1,1,1,.669,1,1.36145,1,1,1,1,1,1,1,1,1,1,1,1.04828,1,.74948,.75187,1.02058,.98391,1.02119,1,1,1.06233,1.08595,1.08595,1,1.08595,1.08595,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.05233,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];t.MyriadProItalicMetrics={lineHeight:1.2,lineGap:.2};t.MyriadProRegularFactors=[1.36898,1,1,.76305,.82784,.94935,.89364,.92241,.89073,.90706,.98472,.85283,.85283,1.0664,1.02058,.74505,.9219,.74505,1.23456,.92241,.92241,.92241,.92241,.92241,.92241,.92241,.92241,.92241,.92241,.74505,.74505,1.02058,1.02058,1.02058,.73002,.72601,.91755,.8126,.80314,.92222,.73764,.79726,.83051,.90284,.86023,.74,.8126,.84869,.96518,.91115,.8858,.79761,.8858,.74498,.73914,.81363,.89591,.83659,.89633,.85608,.8111,.90531,1.0222,1.22736,1.0222,1.27014,.89903,.90088,.86667,1.0231,.896,1.01411,.90083,1.05099,1.00512,.99793,1.05326,1.09377,.938,1.06226,1.00119,.99793,.98714,1.0231,1.01231,.98196,.792,1.19137,.99074,.962,1.01915,.926,.942,.856,.85034,.92006,.85034,1.02058,.69067,.92241,.92241,.92241,.92241,.92006,.9332,.90088,.91882,.93484,.75339,1.02058,.56866,.54324,.79519,1.08595,1,1,.90088,1,.95325,.74505,.90088,1,.97198,.75339,.91009,.91009,.91009,.66466,.91755,.91755,.91755,.91755,.91755,.91755,.788,.80314,.73764,.73764,.73764,.73764,.86023,.86023,.86023,.86023,.92915,.91115,.8858,.8858,.8858,.8858,.8858,1.02058,.8858,.89591,.89591,.89591,.89591,.8111,.79611,.89713,.86667,.86667,.86667,.86667,.86667,.86667,.86936,.896,.90083,.90083,.90083,.90083,.84224,.84224,.84224,.84224,.97276,.99793,.98714,.98714,.98714,.98714,.98714,1.08595,.89876,.99074,.99074,.99074,.99074,.942,1.0231,.942,.91755,.86667,.91755,.86667,.91755,.86667,.80314,.896,.80314,.896,.80314,.896,.80314,.896,.92222,.93372,.92915,1.01411,.73764,.90083,.73764,.90083,.73764,.90083,.73764,.90083,.73764,.90083,.83051,1.00512,.83051,1.00512,.83051,1.00512,1,1,.90284,.99793,.90976,.99793,.86023,.84224,.86023,.84224,.86023,.84224,.86023,1.05326,.86023,.84224,.82873,1.07469,.74,1.09377,1,1,.938,.84869,1.06226,1,1,.84869,.83704,.84869,.81441,.85588,1.08927,.91115,.99793,1,1,.91115,.99793,.91887,.90991,.99793,.8858,.98714,.8858,.98714,.8858,.98714,.894,.91434,.74498,.98196,1,1,.74498,.98196,.73914,.792,.73914,.792,1,1,.73914,.792,1,1,.81363,.904,.81363,1.19137,.89591,.99074,.89591,.99074,.89591,.99074,.89591,.99074,.89591,.99074,.89591,.99074,.89633,1.01915,.8111,.942,.8111,.90531,.856,.90531,.856,.90531,.856,1,.92241,.91755,.86667,.788,.86936,.8858,.89876,1,1,.81363,1.19137,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90388,1.03901,.92138,.78105,.7154,.86169,.80513,.94007,.82528,.98612,1.06226,.91755,.8126,.81884,.92819,.73764,.90531,.90284,.8858,.86023,.8126,.91172,.96518,.91115,.83089,.8858,.87791,.79761,.89297,.81363,.88157,.89992,.85608,.81992,.94307,.86023,.88157,.95308,.98699,.99793,1.06226,.95817,.95308,.97358,.928,.98088,.98699,.92761,.99793,.96017,1.06226,.986,.944,.95978,.938,.96705,.98714,.80442,.98972,1,.89762,1.04552,.95817,.99007,.87064,.91879,.88888,1.06226,.95817,.98714,.95817,.88888,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.89633,1.01915,.89633,1.01915,.89633,1.01915,.8111,.942,.9219,1,.89903,1,1,1,.93173,.93173,.93173,1,1.06304,1.06304,1.06904,.89903,.89903,.80549,1,1.156,1,1,.76575,.76575,1,1,.72458,1,1,1,1,.92241,1,1,1,.619,1,1.36145,1,1,1,1,1,1,1,1,1,1,1,1.07257,1,.74705,.71119,1.02058,1.024,1.02119,1,1,1.1536,1.08595,1.08595,1,1.08595,1.08595,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.05638,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];t.MyriadProRegularMetrics={lineHeight:1.2,lineGap:.2}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.SegoeuiRegularMetrics=t.SegoeuiRegularFactors=t.SegoeuiItalicMetrics=t.SegoeuiItalicFactors=t.SegoeuiBoldMetrics=t.SegoeuiBoldItalicMetrics=t.SegoeuiBoldItalicFactors=t.SegoeuiBoldFactors=void 0;t.SegoeuiBoldFactors=[1.76738,1,1,.99297,.9824,1.04016,1.06497,1.03424,.97529,1.17647,1.23203,1.1085,1.1085,1.16939,1.2107,.9754,1.21408,.9754,1.59578,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,.81378,.81378,1.2107,1.2107,1.2107,.71703,.97847,.97363,.88776,.8641,1.02096,.79795,.85132,.914,1.06085,1.1406,.8007,.89858,.83693,1.14889,1.09398,.97489,.92094,.97489,.90399,.84041,.95923,1.00135,1,1.06467,.98243,.90996,.99361,1.1085,1.56942,1.1085,1.2107,.74627,.94282,.96752,1.01519,.86304,1.01359,.97278,1.15103,1.01359,.98561,1.02285,1.02285,1.00527,1.02285,1.0302,.99041,1.0008,1.01519,1.01359,1.02258,.79104,1.16862,.99041,.97454,1.02511,.99298,.96752,.95801,.94856,1.16579,.94856,1.2107,.9824,1.03424,1.03424,1,1.03424,1.16579,.8727,1.3871,1.18622,1.10818,1.04478,1.2107,1.18622,.75155,.94994,1.28826,1.21408,1.21408,.91056,1,.91572,.9754,.64663,1.18328,1.24866,1.04478,1.14169,1.15749,1.17389,.71703,.97363,.97363,.97363,.97363,.97363,.97363,.93506,.8641,.79795,.79795,.79795,.79795,1.1406,1.1406,1.1406,1.1406,1.02096,1.09398,.97426,.97426,.97426,.97426,.97426,1.2107,.97489,1.00135,1.00135,1.00135,1.00135,.90996,.92094,1.02798,.96752,.96752,.96752,.96752,.96752,.96752,.93136,.86304,.97278,.97278,.97278,.97278,1.02285,1.02285,1.02285,1.02285,.97122,.99041,1,1,1,1,1,1.28826,1.0008,.99041,.99041,.99041,.99041,.96752,1.01519,.96752,.97363,.96752,.97363,.96752,.97363,.96752,.8641,.86304,.8641,.86304,.8641,.86304,.8641,.86304,1.02096,1.03057,1.02096,1.03517,.79795,.97278,.79795,.97278,.79795,.97278,.79795,.97278,.79795,.97278,.914,1.01359,.914,1.01359,.914,1.01359,1,1,1.06085,.98561,1.06085,1.00879,1.1406,1.02285,1.1406,1.02285,1.1406,1.02285,1.1406,1.02285,1.1406,1.02285,.97138,1.08692,.8007,1.02285,1,1,1.00527,.83693,1.02285,1,1,.83693,.9455,.83693,.90418,.83693,1.13005,1.09398,.99041,1,1,1.09398,.99041,.96692,1.09251,.99041,.97489,1.0008,.97489,1.0008,.97489,1.0008,.93994,.97931,.90399,1.02258,1,1,.90399,1.02258,.84041,.79104,.84041,.79104,.84041,.79104,.84041,.79104,1,1,.95923,1.07034,.95923,1.16862,1.00135,.99041,1.00135,.99041,1.00135,.99041,1.00135,.99041,1.00135,.99041,1.00135,.99041,1.06467,1.02511,.90996,.96752,.90996,.99361,.95801,.99361,.95801,.99361,.95801,1.07733,1.03424,.97363,.96752,.93506,.93136,.97489,1.0008,1,1,.95923,1.16862,1.15103,1.15103,1.01173,1.03959,.75953,.81378,.79912,1.15103,1.21994,.95161,.87815,1.01149,.81525,.7676,.98167,1.01134,1.02546,.84097,1.03089,1.18102,.97363,.88776,.85134,.97826,.79795,.99361,1.06085,.97489,1.1406,.89858,1.0388,1.14889,1.09398,.86039,.97489,1.0595,.92094,.94793,.95923,.90996,.99346,.98243,1.02112,.95493,1.1406,.90996,1.03574,1.02597,1.0008,1.18102,1.06628,1.03574,1.0192,1.01932,1.00886,.97531,1.0106,1.0008,1.13189,1.18102,1.02277,.98683,1.0016,.99561,1.07237,1.0008,.90434,.99921,.93803,.8965,1.23085,1.06628,1.04983,.96268,1.0499,.98439,1.18102,1.06628,1.0008,1.06628,.98439,.79795,1,1,1,1,1,1,1,1,1,1,1,1,1.09466,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.97278,1,1,1,1,1,1,1,1,1,1,1,1,1.02065,1,1,1,1,1,1,1.06467,1.02511,1.06467,1.02511,1.06467,1.02511,.90996,.96752,1,1.21408,.89903,1,1,.75155,1.04394,1.04394,1.04394,1.04394,.98633,.98633,.98633,.73047,.73047,1.20642,.91211,1.25635,1.222,1.02956,1.03372,1.03372,.96039,1.24633,1,1.12454,.93503,1.03424,1.19687,1.03424,1,1,1,.771,1,1,1.15749,1.15749,1.15749,1.10948,.86279,.94434,.86279,.94434,.86182,1,1,1.16897,1,.96085,.90137,1.2107,1.18416,1.13973,.69825,.9716,2.10339,1.29004,1.29004,1.21172,1.29004,1.29004,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.42603,1,.99862,.99862,1,.87025,.87025,.87025,.87025,1.18874,1.42603,1,1.42603,1.42603,.99862,1,1,1,1,1,1.2886,1.04315,1.15296,1.34163,1,1,1,1.09193,1.09193,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];t.SegoeuiBoldMetrics={lineHeight:1.33008,lineGap:0};t.SegoeuiBoldItalicFactors=[1.76738,1,1,.98946,1.03959,1.04016,1.02809,1.036,.97639,1.10953,1.23203,1.11144,1.11144,1.16939,1.21237,.9754,1.21261,.9754,1.59754,1.036,1.036,1.036,1.036,1.036,1.036,1.036,1.036,1.036,1.036,.81378,.81378,1.21237,1.21237,1.21237,.73541,.97847,.97363,.89723,.87897,1.0426,.79429,.85292,.91149,1.05815,1.1406,.79631,.90128,.83853,1.04396,1.10615,.97552,.94436,.97552,.88641,.80527,.96083,1.00135,1,1.06777,.9817,.91142,.99361,1.11144,1.57293,1.11144,1.21237,.74627,1.31818,1.06585,.97042,.83055,.97042,.93503,1.1261,.97042,.97922,1.14236,.94552,1.01054,1.14236,1.02471,.97922,.94165,.97042,.97042,1.0276,.78929,1.1261,.97922,.95874,1.02197,.98507,.96752,.97168,.95107,1.16579,.95107,1.21237,1.03959,1.036,1.036,1,1.036,1.16579,.87357,1.31818,1.18754,1.26781,1.05356,1.21237,1.18622,.79487,.94994,1.29004,1.24047,1.24047,1.31818,1,.91484,.9754,1.31818,1.1349,1.24866,1.05356,1.13934,1.15574,1.17389,.73541,.97363,.97363,.97363,.97363,.97363,.97363,.94385,.87897,.79429,.79429,.79429,.79429,1.1406,1.1406,1.1406,1.1406,1.0426,1.10615,.97552,.97552,.97552,.97552,.97552,1.21237,.97552,1.00135,1.00135,1.00135,1.00135,.91142,.94436,.98721,1.06585,1.06585,1.06585,1.06585,1.06585,1.06585,.96705,.83055,.93503,.93503,.93503,.93503,1.14236,1.14236,1.14236,1.14236,.93125,.97922,.94165,.94165,.94165,.94165,.94165,1.29004,.94165,.97922,.97922,.97922,.97922,.96752,.97042,.96752,.97363,1.06585,.97363,1.06585,.97363,1.06585,.87897,.83055,.87897,.83055,.87897,.83055,.87897,.83055,1.0426,1.0033,1.0426,.97042,.79429,.93503,.79429,.93503,.79429,.93503,.79429,.93503,.79429,.93503,.91149,.97042,.91149,.97042,.91149,.97042,1,1,1.05815,.97922,1.05815,.97922,1.1406,1.14236,1.1406,1.14236,1.1406,1.14236,1.1406,1.14236,1.1406,1.14236,.97441,1.04302,.79631,1.01582,1,1,1.01054,.83853,1.14236,1,1,.83853,1.09125,.83853,.90418,.83853,1.19508,1.10615,.97922,1,1,1.10615,.97922,1.01034,1.10466,.97922,.97552,.94165,.97552,.94165,.97552,.94165,.91602,.91981,.88641,1.0276,1,1,.88641,1.0276,.80527,.78929,.80527,.78929,.80527,.78929,.80527,.78929,1,1,.96083,1.05403,.95923,1.16862,1.00135,.97922,1.00135,.97922,1.00135,.97922,1.00135,.97922,1.00135,.97922,1.00135,.97922,1.06777,1.02197,.91142,.96752,.91142,.99361,.97168,.99361,.97168,.99361,.97168,1.23199,1.036,.97363,1.06585,.94385,.96705,.97552,.94165,1,1,.96083,1.1261,1.31818,1.31818,1.31818,1.31818,1.31818,1.31818,1.31818,1.31818,1.31818,.95161,1.27126,1.00811,.83284,.77702,.99137,.95253,1.0347,.86142,1.07205,1.14236,.97363,.89723,.86869,1.09818,.79429,.99361,1.05815,.97552,1.1406,.90128,1.06662,1.04396,1.10615,.84918,.97552,1.04694,.94436,.98015,.96083,.91142,1.00356,.9817,1.01945,.98999,1.1406,.91142,1.04961,.9898,1.00639,1.14236,1.07514,1.04961,.99607,1.02897,1.008,.9898,.95134,1.00639,1.11121,1.14236,1.00518,.97981,1.02186,1,1.08578,.94165,.99314,.98387,.93028,.93377,1.35125,1.07514,1.10687,.93491,1.04232,1.00351,1.14236,1.07514,.94165,1.07514,1.00351,.79429,1,1,1,1,1,1,1,1,1,1,1,1,1.09097,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.93503,1,1,1,1,1,1,1,1,1,1,1,1,.96609,1,1,1,1,1,1,1.06777,1.02197,1.06777,1.02197,1.06777,1.02197,.91142,.96752,1,1.21261,.89903,1,1,.75155,1.04745,1.04745,1.04745,1.04394,.98633,.98633,.98633,.72959,.72959,1.20502,.91406,1.26514,1.222,1.02956,1.03372,1.03372,.96039,1.24633,1,1.09125,.93327,1.03336,1.16541,1.036,1,1,1,.771,1,1,1.15574,1.15574,1.15574,1.15574,.86364,.94434,.86279,.94434,.86224,1,1,1.16798,1,.96085,.90068,1.21237,1.18416,1.13904,.69825,.9716,2.10339,1.29004,1.29004,1.21339,1.29004,1.29004,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.42603,1,.99862,.99862,1,.87025,.87025,.87025,.87025,1.18775,1.42603,1,1.42603,1.42603,.99862,1,1,1,1,1,1.2886,1.04315,1.15296,1.34163,1,1,1,1.13269,1.13269,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];t.SegoeuiBoldItalicMetrics={lineHeight:1.33008,lineGap:0};t.SegoeuiItalicFactors=[1.76738,1,1,.98946,1.14763,1.05365,1.06234,.96927,.92586,1.15373,1.18414,.91349,.91349,1.07403,1.17308,.78383,1.20088,.78383,1.42531,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.78383,.78383,1.17308,1.17308,1.17308,.77349,.94565,.94729,.85944,.88506,.9858,.74817,.80016,.88449,.98039,.95782,.69238,.89898,.83231,.98183,1.03989,.96924,.86237,.96924,.80595,.74524,.86091,.95402,.94143,.98448,.8858,.83089,.93285,1.0949,1.39016,1.0949,1.45994,.74627,1.04839,.97454,.97454,.87207,.97454,.87533,1.06151,.97454,1.00176,1.16484,1.08132,.98047,1.16484,1.02989,1.01054,.96225,.97454,.97454,1.06598,.79004,1.16344,1.00351,.94629,.9973,.91016,.96777,.9043,.91082,.92481,.91082,1.17308,.95748,.96927,.96927,1,.96927,.92481,.80597,1.04839,1.23393,1.1781,.9245,1.17308,1.20808,.63218,.94261,1.24822,1.09971,1.09971,1.04839,1,.85273,.78032,1.04839,1.09971,1.22326,.9245,1.09836,1.13525,1.15222,.70424,.94729,.94729,.94729,.94729,.94729,.94729,.85498,.88506,.74817,.74817,.74817,.74817,.95782,.95782,.95782,.95782,.9858,1.03989,.96924,.96924,.96924,.96924,.96924,1.17308,.96924,.95402,.95402,.95402,.95402,.83089,.86237,.88409,.97454,.97454,.97454,.97454,.97454,.97454,.92916,.87207,.87533,.87533,.87533,.87533,.93146,.93146,.93146,.93146,.93854,1.01054,.96225,.96225,.96225,.96225,.96225,1.24822,.8761,1.00351,1.00351,1.00351,1.00351,.96777,.97454,.96777,.94729,.97454,.94729,.97454,.94729,.97454,.88506,.87207,.88506,.87207,.88506,.87207,.88506,.87207,.9858,.95391,.9858,.97454,.74817,.87533,.74817,.87533,.74817,.87533,.74817,.87533,.74817,.87533,.88449,.97454,.88449,.97454,.88449,.97454,1,1,.98039,1.00176,.98039,1.00176,.95782,.93146,.95782,.93146,.95782,.93146,.95782,1.16484,.95782,.93146,.84421,1.12761,.69238,1.08132,1,1,.98047,.83231,1.16484,1,1,.84723,1.04861,.84723,.78755,.83231,1.23736,1.03989,1.01054,1,1,1.03989,1.01054,.9857,1.03849,1.01054,.96924,.96225,.96924,.96225,.96924,.96225,.92383,.90171,.80595,1.06598,1,1,.80595,1.06598,.74524,.79004,.74524,.79004,.74524,.79004,.74524,.79004,1,1,.86091,1.02759,.85771,1.16344,.95402,1.00351,.95402,1.00351,.95402,1.00351,.95402,1.00351,.95402,1.00351,.95402,1.00351,.98448,.9973,.83089,.96777,.83089,.93285,.9043,.93285,.9043,.93285,.9043,1.31868,.96927,.94729,.97454,.85498,.92916,.96924,.8761,1,1,.86091,1.16344,1.04839,1.04839,1.04839,1.04839,1.04839,1.04839,1.04839,1.04839,1.04839,.81965,.81965,.94729,.78032,.71022,.90883,.84171,.99877,.77596,1.05734,1.2,.94729,.85944,.82791,.9607,.74817,.93285,.98039,.96924,.95782,.89898,.98316,.98183,1.03989,.78614,.96924,.97642,.86237,.86075,.86091,.83089,.90082,.8858,.97296,1.01284,.95782,.83089,1.0976,1.04,1.03342,1.2,1.0675,1.0976,.98205,1.03809,1.05097,1.04,.95364,1.03342,1.05401,1.2,1.02148,1.0119,1.04724,1.0127,1.02732,.96225,.8965,.97783,.93574,.94818,1.30679,1.0675,1.11826,.99821,1.0557,1.0326,1.2,1.0675,.96225,1.0675,1.0326,.74817,1,1,1,1,1,1,1,1,1,1,1,1,1.03754,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.87533,1,1,1,1,1,1,1,1,1,1,1,1,.98705,1,1,1,1,1,1,.98448,.9973,.98448,.9973,.98448,.9973,.83089,.96777,1,1.20088,.89903,1,1,.75155,.94945,.94945,.94945,.94945,1.12317,1.12317,1.12317,.67603,.67603,1.15621,.73584,1.21191,1.22135,1.06483,.94868,.94868,.95996,1.24633,1,1.07497,.87709,.96927,1.01473,.96927,1,1,1,.77295,1,1,1.09836,1.09836,1.09836,1.01522,.86321,.94434,.8649,.94434,.86182,1,1,1.083,1,.91578,.86438,1.17308,1.18416,1.14589,.69825,.97622,1.96791,1.24822,1.24822,1.17308,1.24822,1.24822,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.42603,1,.99862,.99862,1,.87025,.87025,.87025,.87025,1.17984,1.42603,1,1.42603,1.42603,.99862,1,1,1,1,1,1.2886,1.04315,1.15296,1.34163,1,1,1,1.10742,1.10742,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];t.SegoeuiItalicMetrics={lineHeight:1.33008,lineGap:0};t.SegoeuiRegularFactors=[1.76738,1,1,.98594,1.02285,1.10454,1.06234,.96927,.92037,1.19985,1.2046,.90616,.90616,1.07152,1.1714,.78032,1.20088,.78032,1.40246,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.78032,.78032,1.1714,1.1714,1.1714,.80597,.94084,.96706,.85944,.85734,.97093,.75842,.79936,.88198,.9831,.95782,.71387,.86969,.84636,1.07796,1.03584,.96924,.83968,.96924,.82826,.79649,.85771,.95132,.93119,.98965,.88433,.8287,.93365,1.08612,1.3638,1.08612,1.45786,.74627,.80499,.91484,1.05707,.92383,1.05882,.9403,1.12654,1.05882,1.01756,1.09011,1.09011,.99414,1.09011,1.034,1.01756,1.05356,1.05707,1.05882,1.04399,.84863,1.21968,1.01756,.95801,1.00068,.91797,.96777,.9043,.90351,.92105,.90351,1.1714,.85337,.96927,.96927,.99912,.96927,.92105,.80597,1.2434,1.20808,1.05937,.90957,1.1714,1.20808,.75155,.94261,1.24644,1.09971,1.09971,.84751,1,.85273,.78032,.61584,1.05425,1.17914,.90957,1.08665,1.11593,1.14169,.73381,.96706,.96706,.96706,.96706,.96706,.96706,.86035,.85734,.75842,.75842,.75842,.75842,.95782,.95782,.95782,.95782,.97093,1.03584,.96924,.96924,.96924,.96924,.96924,1.1714,.96924,.95132,.95132,.95132,.95132,.8287,.83968,.89049,.91484,.91484,.91484,.91484,.91484,.91484,.93575,.92383,.9403,.9403,.9403,.9403,.8717,.8717,.8717,.8717,1.00527,1.01756,1.05356,1.05356,1.05356,1.05356,1.05356,1.24644,.95923,1.01756,1.01756,1.01756,1.01756,.96777,1.05707,.96777,.96706,.91484,.96706,.91484,.96706,.91484,.85734,.92383,.85734,.92383,.85734,.92383,.85734,.92383,.97093,1.0969,.97093,1.05882,.75842,.9403,.75842,.9403,.75842,.9403,.75842,.9403,.75842,.9403,.88198,1.05882,.88198,1.05882,.88198,1.05882,1,1,.9831,1.01756,.9831,1.01756,.95782,.8717,.95782,.8717,.95782,.8717,.95782,1.09011,.95782,.8717,.84784,1.11551,.71387,1.09011,1,1,.99414,.84636,1.09011,1,1,.84636,1.0536,.84636,.94298,.84636,1.23297,1.03584,1.01756,1,1,1.03584,1.01756,1.00323,1.03444,1.01756,.96924,1.05356,.96924,1.05356,.96924,1.05356,.93066,.98293,.82826,1.04399,1,1,.82826,1.04399,.79649,.84863,.79649,.84863,.79649,.84863,.79649,.84863,1,1,.85771,1.17318,.85771,1.21968,.95132,1.01756,.95132,1.01756,.95132,1.01756,.95132,1.01756,.95132,1.01756,.95132,1.01756,.98965,1.00068,.8287,.96777,.8287,.93365,.9043,.93365,.9043,.93365,.9043,1.08571,.96927,.96706,.91484,.86035,.93575,.96924,.95923,1,1,.85771,1.21968,1.11437,1.11437,.93109,.91202,.60411,.84164,.55572,1.01173,.97361,.81818,.81818,.96635,.78032,.72727,.92366,.98601,1.03405,.77968,1.09799,1.2,.96706,.85944,.85638,.96491,.75842,.93365,.9831,.96924,.95782,.86969,.94152,1.07796,1.03584,.78437,.96924,.98715,.83968,.83491,.85771,.8287,.94492,.88433,.9287,1.0098,.95782,.8287,1.0625,.98248,1.03424,1.2,1.01071,1.0625,.95246,1.03809,1.04912,.98248,1.00221,1.03424,1.05443,1.2,1.04785,.99609,1.00169,1.05176,.99346,1.05356,.9087,1.03004,.95542,.93117,1.23362,1.01071,1.07831,1.02512,1.05205,1.03502,1.2,1.01071,1.05356,1.01071,1.03502,.75842,1,1,1,1,1,1,1,1,1,1,1,1,1.03719,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.9403,1,1,1,1,1,1,1,1,1,1,1,1,1.04021,1,1,1,1,1,1,.98965,1.00068,.98965,1.00068,.98965,1.00068,.8287,.96777,1,1.20088,.89903,1,1,.75155,1.03077,1.03077,1.03077,1.03077,1.13196,1.13196,1.13196,.67428,.67428,1.16039,.73291,1.20996,1.22135,1.06483,.94868,.94868,.95996,1.24633,1,1.07497,.87796,.96927,1.01518,.96927,1,1,1,.77295,1,1,1.10539,1.10539,1.11358,1.06967,.86279,.94434,.86279,.94434,.86182,1,1,1.083,1,.91578,.86507,1.1714,1.18416,1.14589,.69825,.97622,1.9697,1.24822,1.24822,1.17238,1.24822,1.24822,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.42603,1,.99862,.99862,1,.87025,.87025,.87025,.87025,1.18083,1.42603,1,1.42603,1.42603,.99862,1,1,1,1,1,1.2886,1.04315,1.15296,1.34163,1,1,1,1.10938,1.10938,1,1,1,1.05425,1.09971,1.09971,1.09971,1,1,1,1,1,1,1,1,1,1,1];t.SegoeuiRegularMetrics={lineHeight:1.33008,lineGap:0}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.PostScriptEvaluator=t.PostScriptCompiler=t.PDFFunctionFactory=void 0;t.isPDFFunction=function isPDFFunction(e){let t;if("object"!=typeof e)return!1;if(e instanceof r.Dict)t=e;else{if(!(e instanceof s.BaseStream))return!1;t=e.dict}return t.has("FunctionType")};var r=a(4),n=a(2),i=a(56),s=a(5),o=a(57);t.PDFFunctionFactory=class PDFFunctionFactory{constructor({xref:e,isEvalSupported:t=!0}){this.xref=e;this.isEvalSupported=!1!==t}create(e){const t=this.getCached(e);if(t)return t;const a=PDFFunction.parse({xref:this.xref,isEvalSupported:this.isEvalSupported,fn:e instanceof r.Ref?this.xref.fetch(e):e});this._cache(e,a);return a}createFromArray(e){const t=this.getCached(e);if(t)return t;const a=PDFFunction.parseArray({xref:this.xref,isEvalSupported:this.isEvalSupported,fnObj:e instanceof r.Ref?this.xref.fetch(e):e});this._cache(e,a);return a}getCached(e){let t;e instanceof r.Ref?t=e:e instanceof r.Dict?t=e.objId:e instanceof s.BaseStream&&(t=e.dict&&e.dict.objId);if(t){const e=this._localFunctionCache.getByRef(t);if(e)return e}return null}_cache(e,t){if(!t)throw new Error('PDFFunctionFactory._cache - expected "parsedFunction" argument.');let a;e instanceof r.Ref?a=e:e instanceof r.Dict?a=e.objId:e instanceof s.BaseStream&&(a=e.dict&&e.dict.objId);a&&this._localFunctionCache.set(null,a,t)}get _localFunctionCache(){return(0,n.shadow)(this,"_localFunctionCache",new o.LocalFunctionCache)}};function toNumberArray(e){if(!Array.isArray(e))return null;const t=e.length;for(let a=0;a<t;a++)if("number"!=typeof e[a]){const a=new Array(t);for(let r=0;r<t;r++)a[r]=+e[r];return a}return e}class PDFFunction{static getSampleArray(e,t,a,r){let n,i,s=1;for(n=0,i=e.length;n<i;n++)s*=e[n];s*=t;const o=new Array(s);let c=0,l=0;const h=1/(2**a-1),u=r.getBytes((s*a+7)/8);let d=0;for(n=0;n<s;n++){for(;c<a;){l<<=8;l|=u[d++];c+=8}c-=a;o[n]=(l>>c)*h;l&=(1<<c)-1}return o}static parse({xref:e,isEvalSupported:t,fn:a}){const r=a.dict||a;switch(r.get("FunctionType")){case 0:return this.constructSampled({xref:e,isEvalSupported:t,fn:a,dict:r});case 1:break;case 2:return this.constructInterpolated({xref:e,isEvalSupported:t,dict:r});case 3:return this.constructStiched({xref:e,isEvalSupported:t,dict:r});case 4:return this.constructPostScript({xref:e,isEvalSupported:t,fn:a,dict:r})}throw new n.FormatError("Unknown type of function")}static parseArray({xref:e,isEvalSupported:t,fnObj:a}){if(!Array.isArray(a))return this.parse({xref:e,isEvalSupported:t,fn:a});const r=[];for(const n of a)r.push(this.parse({xref:e,isEvalSupported:t,fn:e.fetchIfRef(n)}));return function(e,t,a,n){for(let i=0,s=r.length;i<s;i++)r[i](e,t,a,n+i)}}static constructSampled({xref:e,isEvalSupported:t,fn:a,dict:r}){function toMultiArray(e){const t=e.length,a=[];let r=0;for(let n=0;n<t;n+=2)a[r++]=[e[n],e[n+1]];return a}function interpolate(e,t,a,r,n){return r+(n-r)/(a-t)*(e-t)}let i=toNumberArray(r.getArray("Domain")),s=toNumberArray(r.getArray("Range"));if(!i||!s)throw new n.FormatError("No domain or range");const o=i.length/2,c=s.length/2;i=toMultiArray(i);s=toMultiArray(s);const l=toNumberArray(r.getArray("Size")),h=r.get("BitsPerSample"),u=r.get("Order")||1;1!==u&&(0,n.info)("No support for cubic spline interpolation: "+u);let d=toNumberArray(r.getArray("Encode"));if(d)d=toMultiArray(d);else{d=[];for(let e=0;e<o;++e)d.push([0,l[e]-1])}let f=toNumberArray(r.getArray("Decode"));f=f?toMultiArray(f):s;const g=this.getSampleArray(l,c,h,a);return function constructSampledFn(e,t,a,r){const n=1<<o,h=new Float64Array(n),u=new Uint32Array(n);let p,m;for(m=0;m<n;m++)h[m]=1;let b=c,y=1;for(p=0;p<o;++p){const a=i[p][0],r=i[p][1];let s=interpolate(Math.min(Math.max(e[t+p],a),r),a,r,d[p][0],d[p][1]);const o=l[p];s=Math.min(Math.max(s,0),o-1);const c=s<o-1?Math.floor(s):s-1,f=c+1-s,g=s-c,w=c*b,S=w+b;for(m=0;m<n;m++)if(m&y){h[m]*=g;u[m]+=S}else{h[m]*=f;u[m]+=w}b*=o;y<<=1}for(m=0;m<c;++m){let e=0;for(p=0;p<n;p++)e+=g[u[p]+m]*h[p];e=interpolate(e,0,1,f[m][0],f[m][1]);a[r+m]=Math.min(Math.max(e,s[m][0]),s[m][1])}}}static constructInterpolated({xref:e,isEvalSupported:t,dict:a}){const r=toNumberArray(a.getArray("C0"))||[0],n=toNumberArray(a.getArray("C1"))||[1],i=a.get("N"),s=[];for(let e=0,t=r.length;e<t;++e)s.push(n[e]-r[e]);const o=s.length;return function constructInterpolatedFn(e,t,a,n){const c=1===i?e[t]:e[t]**i;for(let e=0;e<o;++e)a[n+e]=r[e]+c*s[e]}}static constructStiched({xref:e,isEvalSupported:t,dict:a}){const r=toNumberArray(a.getArray("Domain"));if(!r)throw new n.FormatError("No domain");if(1!==r.length/2)throw new n.FormatError("Bad domain for stiched function");const i=[];for(const r of a.get("Functions"))i.push(this.parse({xref:e,isEvalSupported:t,fn:e.fetchIfRef(r)}));const s=toNumberArray(a.getArray("Bounds")),o=toNumberArray(a.getArray("Encode")),c=new Float32Array(1);return function constructStichedFn(e,t,a,n){const l=function constructStichedFromIRClip(e,t,a){e>a?e=a:e<t&&(e=t);return e}(e[t],r[0],r[1]),h=s.length;let u;for(u=0;u<h&&!(l<s[u]);++u);let d=r[0];u>0&&(d=s[u-1]);let f=r[1];u<s.length&&(f=s[u]);const g=o[2*u],p=o[2*u+1];c[0]=d===f?g:g+(l-d)*(p-g)/(f-d);i[u](c,0,a,n)}}static constructPostScript({xref:e,isEvalSupported:t,fn:a,dict:r}){const s=toNumberArray(r.getArray("Domain")),o=toNumberArray(r.getArray("Range"));if(!s)throw new n.FormatError("No domain.");if(!o)throw new n.FormatError("No range.");const c=new i.PostScriptLexer(a),l=new i.PostScriptParser(c).parse();if(t&&n.FeatureTest.isEvalSupported){const e=(new PostScriptCompiler).compile(l,s,o);if(e)return new Function("src","srcOffset","dest","destOffset",e)}(0,n.info)("Unable to compile PS function");const h=o.length>>1,u=s.length>>1,d=new PostScriptEvaluator(l),f=Object.create(null);let g=8192;const p=new Float32Array(u);return function constructPostScriptFn(e,t,a,r){let n,i,s="";const c=p;for(n=0;n<u;n++){i=e[t+n];c[n]=i;s+=i+"_"}const l=f[s];if(void 0!==l){a.set(l,r);return}const m=new Float32Array(h),b=d.execute(c),y=b.length-h;for(n=0;n<h;n++){i=b[y+n];let e=o[2*n];if(i<e)i=e;else{e=o[2*n+1];i>e&&(i=e)}m[n]=i}if(g>0){g--;f[s]=m}a.set(m,r)}}}class PostScriptStack{static get MAX_STACK_SIZE(){return(0,n.shadow)(this,"MAX_STACK_SIZE",100)}constructor(e){this.stack=e?Array.from(e):[]}push(e){if(this.stack.length>=PostScriptStack.MAX_STACK_SIZE)throw new Error("PostScript function stack overflow.");this.stack.push(e)}pop(){if(this.stack.length<=0)throw new Error("PostScript function stack underflow.");return this.stack.pop()}copy(e){if(this.stack.length+e>=PostScriptStack.MAX_STACK_SIZE)throw new Error("PostScript function stack overflow.");const t=this.stack;for(let a=t.length-e,r=e-1;r>=0;r--,a++)t.push(t[a])}index(e){this.push(this.stack[this.stack.length-e-1])}roll(e,t){const a=this.stack,r=a.length-e,n=a.length-1,i=r+(t-Math.floor(t/e)*e);for(let e=r,t=n;e<t;e++,t--){const r=a[e];a[e]=a[t];a[t]=r}for(let e=r,t=i-1;e<t;e++,t--){const r=a[e];a[e]=a[t];a[t]=r}for(let e=i,t=n;e<t;e++,t--){const r=a[e];a[e]=a[t];a[t]=r}}}class PostScriptEvaluator{constructor(e){this.operators=e}execute(e){const t=new PostScriptStack(e);let a=0;const r=this.operators,i=r.length;let s,o,c;for(;a<i;){s=r[a++];if("number"!=typeof s)switch(s){case"jz":c=t.pop();o=t.pop();o||(a=c);break;case"j":o=t.pop();a=o;break;case"abs":o=t.pop();t.push(Math.abs(o));break;case"add":c=t.pop();o=t.pop();t.push(o+c);break;case"and":c=t.pop();o=t.pop();"boolean"==typeof o&&"boolean"==typeof c?t.push(o&&c):t.push(o&c);break;case"atan":o=t.pop();t.push(Math.atan(o));break;case"bitshift":c=t.pop();o=t.pop();o>0?t.push(o<<c):t.push(o>>c);break;case"ceiling":o=t.pop();t.push(Math.ceil(o));break;case"copy":o=t.pop();t.copy(o);break;case"cos":o=t.pop();t.push(Math.cos(o));break;case"cvi":o=0|t.pop();t.push(o);break;case"cvr":break;case"div":c=t.pop();o=t.pop();t.push(o/c);break;case"dup":t.copy(1);break;case"eq":c=t.pop();o=t.pop();t.push(o===c);break;case"exch":t.roll(2,1);break;case"exp":c=t.pop();o=t.pop();t.push(o**c);break;case"false":t.push(!1);break;case"floor":o=t.pop();t.push(Math.floor(o));break;case"ge":c=t.pop();o=t.pop();t.push(o>=c);break;case"gt":c=t.pop();o=t.pop();t.push(o>c);break;case"idiv":c=t.pop();o=t.pop();t.push(o/c|0);break;case"index":o=t.pop();t.index(o);break;case"le":c=t.pop();o=t.pop();t.push(o<=c);break;case"ln":o=t.pop();t.push(Math.log(o));break;case"log":o=t.pop();t.push(Math.log(o)/Math.LN10);break;case"lt":c=t.pop();o=t.pop();t.push(o<c);break;case"mod":c=t.pop();o=t.pop();t.push(o%c);break;case"mul":c=t.pop();o=t.pop();t.push(o*c);break;case"ne":c=t.pop();o=t.pop();t.push(o!==c);break;case"neg":o=t.pop();t.push(-o);break;case"not":o=t.pop();"boolean"==typeof o?t.push(!o):t.push(~o);break;case"or":c=t.pop();o=t.pop();"boolean"==typeof o&&"boolean"==typeof c?t.push(o||c):t.push(o|c);break;case"pop":t.pop();break;case"roll":c=t.pop();o=t.pop();t.roll(o,c);break;case"round":o=t.pop();t.push(Math.round(o));break;case"sin":o=t.pop();t.push(Math.sin(o));break;case"sqrt":o=t.pop();t.push(Math.sqrt(o));break;case"sub":c=t.pop();o=t.pop();t.push(o-c);break;case"true":t.push(!0);break;case"truncate":o=t.pop();o=o<0?Math.ceil(o):Math.floor(o);t.push(o);break;case"xor":c=t.pop();o=t.pop();"boolean"==typeof o&&"boolean"==typeof c?t.push(o!==c):t.push(o^c);break;default:throw new n.FormatError(`Unknown operator ${s}`)}else t.push(s)}return t.stack}}t.PostScriptEvaluator=PostScriptEvaluator;class AstNode{constructor(e){this.type=e}visit(e){(0,n.unreachable)("abstract method")}}class AstArgument extends AstNode{constructor(e,t,a){super("args");this.index=e;this.min=t;this.max=a}visit(e){e.visitArgument(this)}}class AstLiteral extends AstNode{constructor(e){super("literal");this.number=e;this.min=e;this.max=e}visit(e){e.visitLiteral(this)}}class AstBinaryOperation extends AstNode{constructor(e,t,a,r,n){super("binary");this.op=e;this.arg1=t;this.arg2=a;this.min=r;this.max=n}visit(e){e.visitBinaryOperation(this)}}class AstMin extends AstNode{constructor(e,t){super("max");this.arg=e;this.min=e.min;this.max=t}visit(e){e.visitMin(this)}}class AstVariable extends AstNode{constructor(e,t,a){super("var");this.index=e;this.min=t;this.max=a}visit(e){e.visitVariable(this)}}class AstVariableDefinition extends AstNode{constructor(e,t){super("definition");this.variable=e;this.arg=t}visit(e){e.visitVariableDefinition(this)}}class ExpressionBuilderVisitor{constructor(){this.parts=[]}visitArgument(e){this.parts.push("Math.max(",e.min,", Math.min(",e.max,", src[srcOffset + ",e.index,"]))")}visitVariable(e){this.parts.push("v",e.index)}visitLiteral(e){this.parts.push(e.number)}visitBinaryOperation(e){this.parts.push("(");e.arg1.visit(this);this.parts.push(" ",e.op," ");e.arg2.visit(this);this.parts.push(")")}visitVariableDefinition(e){this.parts.push("var ");e.variable.visit(this);this.parts.push(" = ");e.arg.visit(this);this.parts.push(";")}visitMin(e){this.parts.push("Math.min(");e.arg.visit(this);this.parts.push(", ",e.max,")")}toString(){return this.parts.join("")}}function buildAddOperation(e,t){return"literal"===t.type&&0===t.number?e:"literal"===e.type&&0===e.number?t:"literal"===t.type&&"literal"===e.type?new AstLiteral(e.number+t.number):new AstBinaryOperation("+",e,t,e.min+t.min,e.max+t.max)}function buildMulOperation(e,t){if("literal"===t.type){if(0===t.number)return new AstLiteral(0);if(1===t.number)return e;if("literal"===e.type)return new AstLiteral(e.number*t.number)}if("literal"===e.type){if(0===e.number)return new AstLiteral(0);if(1===e.number)return t}const a=Math.min(e.min*t.min,e.min*t.max,e.max*t.min,e.max*t.max),r=Math.max(e.min*t.min,e.min*t.max,e.max*t.min,e.max*t.max);return new AstBinaryOperation("*",e,t,a,r)}function buildSubOperation(e,t){if("literal"===t.type){if(0===t.number)return e;if("literal"===e.type)return new AstLiteral(e.number-t.number)}return"binary"===t.type&&"-"===t.op&&"literal"===e.type&&1===e.number&&"literal"===t.arg1.type&&1===t.arg1.number?t.arg2:new AstBinaryOperation("-",e,t,e.min-t.max,e.max-t.min)}function buildMinOperation(e,t){return e.min>=t?new AstLiteral(t):e.max<=t?e:new AstMin(e,t)}class PostScriptCompiler{compile(e,t,a){const r=[],n=[],i=t.length>>1,s=a.length>>1;let o,c,l,h,u,d,f,g,p=0;for(let e=0;e<i;e++)r.push(new AstArgument(e,t[2*e],t[2*e+1]));for(let t=0,a=e.length;t<a;t++){g=e[t];if("number"!=typeof g)switch(g){case"add":if(r.length<2)return null;h=r.pop();l=r.pop();r.push(buildAddOperation(l,h));break;case"cvr":if(r.length<1)return null;break;case"mul":if(r.length<2)return null;h=r.pop();l=r.pop();r.push(buildMulOperation(l,h));break;case"sub":if(r.length<2)return null;h=r.pop();l=r.pop();r.push(buildSubOperation(l,h));break;case"exch":if(r.length<2)return null;u=r.pop();d=r.pop();r.push(u,d);break;case"pop":if(r.length<1)return null;r.pop();break;case"index":if(r.length<1)return null;l=r.pop();if("literal"!==l.type)return null;o=l.number;if(o<0||!Number.isInteger(o)||r.length<o)return null;u=r[r.length-o-1];if("literal"===u.type||"var"===u.type){r.push(u);break}f=new AstVariable(p++,u.min,u.max);r[r.length-o-1]=f;r.push(f);n.push(new AstVariableDefinition(f,u));break;case"dup":if(r.length<1)return null;if("number"==typeof e[t+1]&&"gt"===e[t+2]&&e[t+3]===t+7&&"jz"===e[t+4]&&"pop"===e[t+5]&&e[t+6]===e[t+1]){l=r.pop();r.push(buildMinOperation(l,e[t+1]));t+=6;break}u=r.at(-1);if("literal"===u.type||"var"===u.type){r.push(u);break}f=new AstVariable(p++,u.min,u.max);r[r.length-1]=f;r.push(f);n.push(new AstVariableDefinition(f,u));break;case"roll":if(r.length<2)return null;h=r.pop();l=r.pop();if("literal"!==h.type||"literal"!==l.type)return null;c=h.number;o=l.number;if(o<=0||!Number.isInteger(o)||!Number.isInteger(c)||r.length<o)return null;c=(c%o+o)%o;if(0===c)break;r.push(...r.splice(r.length-o,o-c));break;default:return null}else r.push(new AstLiteral(g))}if(r.length!==s)return null;const m=[];for(const e of n){const t=new ExpressionBuilderVisitor;e.visit(t);m.push(t.toString())}for(let e=0,t=r.length;e<t;e++){const t=r[e],n=new ExpressionBuilderVisitor;t.visit(n);const i=a[2*e],s=a[2*e+1],o=[n.toString()];if(i>t.min){o.unshift("Math.max(",i,", ");o.push(")")}if(s<t.max){o.unshift("Math.min(",s,", ");o.push(")")}o.unshift("dest[destOffset + ",e,"] = ");o.push(";");m.push(o.join(""))}return m.join("\n")}}t.PostScriptCompiler=PostScriptCompiler},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.PostScriptParser=t.PostScriptLexer=void 0;var r=a(2),n=a(4),i=a(3);t.PostScriptParser=class PostScriptParser{constructor(e){this.lexer=e;this.operators=[];this.token=null;this.prev=null}nextToken(){this.prev=this.token;this.token=this.lexer.getToken()}accept(e){if(this.token.type===e){this.nextToken();return!0}return!1}expect(e){if(this.accept(e))return!0;throw new r.FormatError(`Unexpected symbol: found ${this.token.type} expected ${e}.`)}parse(){this.nextToken();this.expect(s.LBRACE);this.parseBlock();this.expect(s.RBRACE);return this.operators}parseBlock(){for(;;)if(this.accept(s.NUMBER))this.operators.push(this.prev.value);else if(this.accept(s.OPERATOR))this.operators.push(this.prev.value);else{if(!this.accept(s.LBRACE))return;this.parseCondition()}}parseCondition(){const e=this.operators.length;this.operators.push(null,null);this.parseBlock();this.expect(s.RBRACE);if(this.accept(s.IF)){this.operators[e]=this.operators.length;this.operators[e+1]="jz"}else{if(!this.accept(s.LBRACE))throw new r.FormatError("PS Function: error parsing conditional.");{const t=this.operators.length;this.operators.push(null,null);const a=this.operators.length;this.parseBlock();this.expect(s.RBRACE);this.expect(s.IFELSE);this.operators[t]=this.operators.length;this.operators[t+1]="j";this.operators[e]=a;this.operators[e+1]="jz"}}}};const s={LBRACE:0,RBRACE:1,NUMBER:2,OPERATOR:3,IF:4,IFELSE:5};class PostScriptToken{static get opCache(){return(0,r.shadow)(this,"opCache",Object.create(null))}constructor(e,t){this.type=e;this.value=t}static getOperator(e){const t=PostScriptToken.opCache[e];return t||(PostScriptToken.opCache[e]=new PostScriptToken(s.OPERATOR,e))}static get LBRACE(){return(0,r.shadow)(this,"LBRACE",new PostScriptToken(s.LBRACE,"{"))}static get RBRACE(){return(0,r.shadow)(this,"RBRACE",new PostScriptToken(s.RBRACE,"}"))}static get IF(){return(0,r.shadow)(this,"IF",new PostScriptToken(s.IF,"IF"))}static get IFELSE(){return(0,r.shadow)(this,"IFELSE",new PostScriptToken(s.IFELSE,"IFELSE"))}}t.PostScriptLexer=class PostScriptLexer{constructor(e){this.stream=e;this.nextChar();this.strBuf=[]}nextChar(){return this.currentChar=this.stream.getByte()}getToken(){let e=!1,t=this.currentChar;for(;;){if(t<0)return n.EOF;if(e)10!==t&&13!==t||(e=!1);else if(37===t)e=!0;else if(!(0,i.isWhiteSpace)(t))break;t=this.nextChar()}switch(0|t){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 43:case 45:case 46:return new PostScriptToken(s.NUMBER,this.getNumber());case 123:this.nextChar();return PostScriptToken.LBRACE;case 125:this.nextChar();return PostScriptToken.RBRACE}const a=this.strBuf;a.length=0;a[0]=String.fromCharCode(t);for(;(t=this.nextChar())>=0&&(t>=65&&t<=90||t>=97&&t<=122);)a.push(String.fromCharCode(t));const r=a.join("");switch(r.toLowerCase()){case"if":return PostScriptToken.IF;case"ifelse":return PostScriptToken.IFELSE;default:return PostScriptToken.getOperator(r)}}getNumber(){let e=this.currentChar;const t=this.strBuf;t.length=0;t[0]=String.fromCharCode(e);for(;(e=this.nextChar())>=0&&(e>=48&&e<=57||45===e||46===e);)t.push(String.fromCharCode(e));const a=parseFloat(t.join(""));if(isNaN(a))throw new r.FormatError(`Invalid floating point number: ${a}`);return a}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.LocalTilingPatternCache=t.LocalImageCache=t.LocalGStateCache=t.LocalFunctionCache=t.LocalColorSpaceCache=t.GlobalImageCache=void 0;var r=a(2),n=a(4);class BaseLocalCache{constructor(e){this.constructor===BaseLocalCache&&(0,r.unreachable)("Cannot initialize BaseLocalCache.");this._onlyRefs=!0===(e&&e.onlyRefs);if(!this._onlyRefs){this._nameRefMap=new Map;this._imageMap=new Map}this._imageCache=new n.RefSetCache}getByName(e){this._onlyRefs&&(0,r.unreachable)("Should not call `getByName` method.");const t=this._nameRefMap.get(e);return t?this.getByRef(t):this._imageMap.get(e)||null}getByRef(e){return this._imageCache.get(e)||null}set(e,t,a){(0,r.unreachable)("Abstract method `set` called.")}}t.LocalImageCache=class LocalImageCache extends BaseLocalCache{set(e,t=null,a){if("string"!=typeof e)throw new Error('LocalImageCache.set - expected "name" argument.');if(t){if(this._imageCache.has(t))return;this._nameRefMap.set(e,t);this._imageCache.put(t,a)}else this._imageMap.has(e)||this._imageMap.set(e,a)}};t.LocalColorSpaceCache=class LocalColorSpaceCache extends BaseLocalCache{set(e=null,t=null,a){if("string"!=typeof e&&!t)throw new Error('LocalColorSpaceCache.set - expected "name" and/or "ref" argument.');if(t){if(this._imageCache.has(t))return;null!==e&&this._nameRefMap.set(e,t);this._imageCache.put(t,a)}else this._imageMap.has(e)||this._imageMap.set(e,a)}};t.LocalFunctionCache=class LocalFunctionCache extends BaseLocalCache{constructor(e){super({onlyRefs:!0})}set(e=null,t,a){if(!t)throw new Error('LocalFunctionCache.set - expected "ref" argument.');this._imageCache.has(t)||this._imageCache.put(t,a)}};t.LocalGStateCache=class LocalGStateCache extends BaseLocalCache{set(e,t=null,a){if("string"!=typeof e)throw new Error('LocalGStateCache.set - expected "name" argument.');if(t){if(this._imageCache.has(t))return;this._nameRefMap.set(e,t);this._imageCache.put(t,a)}else this._imageMap.has(e)||this._imageMap.set(e,a)}};t.LocalTilingPatternCache=class LocalTilingPatternCache extends BaseLocalCache{constructor(e){super({onlyRefs:!0})}set(e=null,t,a){if(!t)throw new Error('LocalTilingPatternCache.set - expected "ref" argument.');this._imageCache.has(t)||this._imageCache.put(t,a)}};class GlobalImageCache{static get NUM_PAGES_THRESHOLD(){return(0,r.shadow)(this,"NUM_PAGES_THRESHOLD",2)}static get MIN_IMAGES_TO_CACHE(){return(0,r.shadow)(this,"MIN_IMAGES_TO_CACHE",10)}static get MAX_BYTE_SIZE(){return(0,r.shadow)(this,"MAX_BYTE_SIZE",4e7)}constructor(){this._refCache=new n.RefSetCache;this._imageCache=new n.RefSetCache}get _byteSize(){let e=0;for(const t of this._imageCache)e+=t.byteSize;return e}get _cacheLimitReached(){return!(this._imageCache.size<GlobalImageCache.MIN_IMAGES_TO_CACHE)&&!(this._byteSize<GlobalImageCache.MAX_BYTE_SIZE)}shouldCache(e,t){const a=this._refCache.get(e);return!((a?a.size+(a.has(t)?0:1):1)<GlobalImageCache.NUM_PAGES_THRESHOLD)&&!(!this._imageCache.has(e)&&this._cacheLimitReached)}addPageIndex(e,t){let a=this._refCache.get(e);if(!a){a=new Set;this._refCache.put(e,a)}a.add(t)}addByteSize(e,t){const a=this._imageCache.get(e);a&&(a.byteSize||(a.byteSize=t))}getData(e,t){const a=this._refCache.get(e);if(!a)return null;if(a.size<GlobalImageCache.NUM_PAGES_THRESHOLD)return null;const r=this._imageCache.get(e);if(!r)return null;a.add(t);return r}setData(e,t){if(!this._refCache.has(e))throw new Error('GlobalImageCache.setData - expected "addPageIndex" to have been called.');this._imageCache.has(e)||(this._cacheLimitReached?(0,r.warn)("GlobalImageCache.setData - cache limit reached."):this._imageCache.put(e,t))}clear(e=!1){e||this._refCache.clear();this._imageCache.clear()}}t.GlobalImageCache=GlobalImageCache},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.bidi=function bidi(e,t=-1,a=!1){let c=!0;const l=e.length;if(0===l||a)return createBidiText(e,c,a);s.length=l;o.length=l;let h,u,d=0;for(h=0;h<l;++h){s[h]=e.charAt(h);const t=e.charCodeAt(h);let a="L";if(t<=255)a=n[t];else if(1424<=t&&t<=1524)a="R";else if(1536<=t&&t<=1791){a=i[255&t];a||(0,r.warn)("Bidi: invalid Unicode character "+t.toString(16))}else 1792<=t&&t<=2220&&(a="AL");"R"!==a&&"AL"!==a&&"AN"!==a||d++;o[h]=a}if(0===d){c=!0;return createBidiText(e,c)}if(-1===t)if(d/l<.3&&l>4){c=!0;t=0}else{c=!1;t=1}const f=[];for(h=0;h<l;++h)f[h]=t;const g=isOdd(t)?"R":"L",p=g,m=p;let b,y=p;for(h=0;h<l;++h)"NSM"===o[h]?o[h]=y:y=o[h];y=p;for(h=0;h<l;++h){b=o[h];"EN"===b?o[h]="AL"===y?"AN":"EN":"R"!==b&&"L"!==b&&"AL"!==b||(y=b)}for(h=0;h<l;++h){b=o[h];"AL"===b&&(o[h]="R")}for(h=1;h<l-1;++h){"ES"===o[h]&&"EN"===o[h-1]&&"EN"===o[h+1]&&(o[h]="EN");"CS"!==o[h]||"EN"!==o[h-1]&&"AN"!==o[h-1]||o[h+1]!==o[h-1]||(o[h]=o[h-1])}for(h=0;h<l;++h)if("EN"===o[h]){for(let e=h-1;e>=0&&"ET"===o[e];--e)o[e]="EN";for(let e=h+1;e<l&&"ET"===o[e];++e)o[e]="EN"}for(h=0;h<l;++h){b=o[h];"WS"!==b&&"ES"!==b&&"ET"!==b&&"CS"!==b||(o[h]="ON")}y=p;for(h=0;h<l;++h){b=o[h];"EN"===b?o[h]="L"===y?"L":"EN":"R"!==b&&"L"!==b||(y=b)}for(h=0;h<l;++h)if("ON"===o[h]){const e=findUnequal(o,h+1,"ON");let t=p;h>0&&(t=o[h-1]);let a=m;e+1<l&&(a=o[e+1]);"L"!==t&&(t="R");"L"!==a&&(a="R");t===a&&setValues(o,h,e,t);h=e-1}for(h=0;h<l;++h)"ON"===o[h]&&(o[h]=g);for(h=0;h<l;++h){b=o[h];isEven(f[h])?"R"===b?f[h]+=1:"AN"!==b&&"EN"!==b||(f[h]+=2):"L"!==b&&"AN"!==b&&"EN"!==b||(f[h]+=1)}let w,S=-1,x=99;for(h=0,u=f.length;h<u;++h){w=f[h];S<w&&(S=w);x>w&&isOdd(w)&&(x=w)}for(w=S;w>=x;--w){let e=-1;for(h=0,u=f.length;h<u;++h)if(f[h]<w){if(e>=0){reverseValues(s,e,h);e=-1}}else e<0&&(e=h);e>=0&&reverseValues(s,e,f.length)}for(h=0,u=s.length;h<u;++h){const e=s[h];"<"!==e&&">"!==e||(s[h]="")}return createBidiText(s.join(""),c)};var r=a(2);const n=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],i=["AN","AN","AN","AN","AN","AN","ON","ON","AL","ET","ET","AL","CS","AL","ON","ON","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","ON","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","ON","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL"];function isOdd(e){return 0!=(1&e)}function isEven(e){return 0==(1&e)}function findUnequal(e,t,a){let r,n;for(r=t,n=e.length;r<n;++r)if(e[r]!==a)return r;return r}function setValues(e,t,a,r){for(let n=t;n<a;++n)e[n]=r}function reverseValues(e,t,a){for(let r=t,n=a-1;r<n;++r,--n){const t=e[r];e[r]=e[n];e[n]=t}}function createBidiText(e,t,a=!1){let r="ltr";a?r="ttb":t||(r="rtl");return{str:e,dir:r}}const s=[],o=[]},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.MurmurHash3_64=void 0;var r=a(2);const n=3285377520,i=4294901760,s=65535;t.MurmurHash3_64=class MurmurHash3_64{constructor(e){this.h1=e?4294967295&e:n;this.h2=e?4294967295&e:n}update(e){let t,a;if("string"==typeof e){t=new Uint8Array(2*e.length);a=0;for(let r=0,n=e.length;r<n;r++){const n=e.charCodeAt(r);if(n<=255)t[a++]=n;else{t[a++]=n>>>8;t[a++]=255&n}}}else{if(!(0,r.isArrayBuffer)(e))throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");t=e.slice();a=t.byteLength}const n=a>>2,o=a-4*n,c=new Uint32Array(t.buffer,0,n);let l=0,h=0,u=this.h1,d=this.h2;const f=3432918353,g=461845907,p=11601,m=13715;for(let e=0;e<n;e++)if(1&e){l=c[e];l=l*f&i|l*p&s;l=l<<15|l>>>17;l=l*g&i|l*m&s;u^=l;u=u<<13|u>>>19;u=5*u+3864292196}else{h=c[e];h=h*f&i|h*p&s;h=h<<15|h>>>17;h=h*g&i|h*m&s;d^=h;d=d<<13|d>>>19;d=5*d+3864292196}l=0;switch(o){case 3:l^=t[4*n+2]<<16;case 2:l^=t[4*n+1]<<8;case 1:l^=t[4*n];l=l*f&i|l*p&s;l=l<<15|l>>>17;l=l*g&i|l*m&s;1&n?u^=l:d^=l}this.h1=u;this.h2=d}hexdigest(){let e=this.h1,t=this.h2;e^=t>>>1;e=3981806797*e&i|36045*e&s;t=4283543511*t&i|(2950163797*(t<<16|e>>>16)&i)>>>16;e^=t>>>1;e=444984403*e&i|60499*e&s;t=3301882366*t&i|(3120437893*(t<<16|e>>>16)&i)>>>16;e^=t>>>1;return(e>>>0).toString(16).padStart(8,"0")+(t>>>0).toString(16).padStart(8,"0")}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.OperatorList=void 0;var r=a(2);function addState(e,t,a,r,n){let i=e;for(let e=0,a=t.length-1;e<a;e++){const a=t[e];i=i[a]||(i[a]=[])}i[t.at(-1)]={checkFn:a,iterateFn:r,processFn:n}}const n=[];addState(n,[r.OPS.save,r.OPS.transform,r.OPS.paintInlineImageXObject,r.OPS.restore],null,(function iterateInlineImageGroup(e,t){const a=e.fnArray,n=(t-(e.iCurr-3))%4;switch(n){case 0:return a[t]===r.OPS.save;case 1:return a[t]===r.OPS.transform;case 2:return a[t]===r.OPS.paintInlineImageXObject;case 3:return a[t]===r.OPS.restore}throw new Error(`iterateInlineImageGroup - invalid pos: ${n}`)}),(function foundInlineImageGroup(e,t){const a=e.fnArray,n=e.argsArray,i=e.iCurr,s=i-3,o=i-2,c=i-1,l=Math.min(Math.floor((t-s)/4),200);if(l<10)return t-(t-s)%4;let h=0;const u=[];let d=0,f=1,g=1;for(let e=0;e<l;e++){const t=n[o+(e<<2)],a=n[c+(e<<2)][0];if(f+a.width>1e3){h=Math.max(h,f);g+=d+2;f=0;d=0}u.push({transform:t,x:f,y:g,w:a.width,h:a.height});f+=a.width+2;d=Math.max(d,a.height)}const p=Math.max(h,f)+1,m=g+d+1,b=new Uint8Array(p*m*4),y=p<<2;for(let e=0;e<l;e++){const t=n[c+(e<<2)][0].data,a=u[e].w<<2;let r=0,i=u[e].x+u[e].y*p<<2;b.set(t.subarray(0,a),i-y);for(let n=0,s=u[e].h;n<s;n++){b.set(t.subarray(r,r+a),i);r+=a;i+=y}b.set(t.subarray(r-a,r),i);for(;i>=0;){t[i-4]=t[i];t[i-3]=t[i+1];t[i-2]=t[i+2];t[i-1]=t[i+3];t[i+a]=t[i+a-4];t[i+a+1]=t[i+a-3];t[i+a+2]=t[i+a-2];t[i+a+3]=t[i+a-1];i-=y}}a.splice(s,4*l,r.OPS.paintInlineImageXObjectGroup);n.splice(s,4*l,[{width:p,height:m,kind:r.ImageKind.RGBA_32BPP,data:b},u]);return s+1}));addState(n,[r.OPS.save,r.OPS.transform,r.OPS.paintImageMaskXObject,r.OPS.restore],null,(function iterateImageMaskGroup(e,t){const a=e.fnArray,n=(t-(e.iCurr-3))%4;switch(n){case 0:return a[t]===r.OPS.save;case 1:return a[t]===r.OPS.transform;case 2:return a[t]===r.OPS.paintImageMaskXObject;case 3:return a[t]===r.OPS.restore}throw new Error(`iterateImageMaskGroup - invalid pos: ${n}`)}),(function foundImageMaskGroup(e,t){const a=e.fnArray,n=e.argsArray,i=e.iCurr,s=i-3,o=i-2,c=i-1;let l=Math.floor((t-s)/4);if(l<10)return t-(t-s)%4;let h,u,d=!1;const f=n[c][0],g=n[o][0],p=n[o][1],m=n[o][2],b=n[o][3];if(p===m){d=!0;h=o+4;let e=c+4;for(let t=1;t<l;t++,h+=4,e+=4){u=n[h];if(n[e][0]!==f||u[0]!==g||u[1]!==p||u[2]!==m||u[3]!==b){t<10?d=!1:l=t;break}}}if(d){l=Math.min(l,1e3);const e=new Float32Array(2*l);h=o;for(let t=0;t<l;t++,h+=4){u=n[h];e[t<<1]=u[4];e[1+(t<<1)]=u[5]}a.splice(s,4*l,r.OPS.paintImageMaskXObjectRepeat);n.splice(s,4*l,[f,g,p,m,b,e])}else{l=Math.min(l,100);const e=[];for(let t=0;t<l;t++){u=n[o+(t<<2)];const a=n[c+(t<<2)][0];e.push({data:a.data,width:a.width,height:a.height,interpolate:a.interpolate,count:a.count,transform:u})}a.splice(s,4*l,r.OPS.paintImageMaskXObjectGroup);n.splice(s,4*l,[e])}return s+1}));addState(n,[r.OPS.save,r.OPS.transform,r.OPS.paintImageXObject,r.OPS.restore],(function(e){const t=e.argsArray,a=e.iCurr-2;return 0===t[a][1]&&0===t[a][2]}),(function iterateImageGroup(e,t){const a=e.fnArray,n=e.argsArray,i=(t-(e.iCurr-3))%4;switch(i){case 0:return a[t]===r.OPS.save;case 1:if(a[t]!==r.OPS.transform)return!1;const i=e.iCurr-2,s=n[i][0],o=n[i][3];return n[t][0]===s&&0===n[t][1]&&0===n[t][2]&&n[t][3]===o;case 2:if(a[t]!==r.OPS.paintImageXObject)return!1;const c=n[e.iCurr-1][0];return n[t][0]===c;case 3:return a[t]===r.OPS.restore}throw new Error(`iterateImageGroup - invalid pos: ${i}`)}),(function(e,t){const a=e.fnArray,n=e.argsArray,i=e.iCurr,s=i-3,o=i-2,c=n[i-1][0],l=n[o][0],h=n[o][3],u=Math.min(Math.floor((t-s)/4),1e3);if(u<3)return t-(t-s)%4;const d=new Float32Array(2*u);let f=o;for(let e=0;e<u;e++,f+=4){const t=n[f];d[e<<1]=t[4];d[1+(e<<1)]=t[5]}const g=[c,l,h,d];a.splice(s,4*u,r.OPS.paintImageXObjectRepeat);n.splice(s,4*u,g);return s+1}));addState(n,[r.OPS.beginText,r.OPS.setFont,r.OPS.setTextMatrix,r.OPS.showText,r.OPS.endText],null,(function iterateShowTextGroup(e,t){const a=e.fnArray,n=e.argsArray,i=(t-(e.iCurr-4))%5;switch(i){case 0:return a[t]===r.OPS.beginText;case 1:return a[t]===r.OPS.setFont;case 2:return a[t]===r.OPS.setTextMatrix;case 3:if(a[t]!==r.OPS.showText)return!1;const i=e.iCurr-3,s=n[i][0],o=n[i][1];return n[t][0]===s&&n[t][1]===o;case 4:return a[t]===r.OPS.endText}throw new Error(`iterateShowTextGroup - invalid pos: ${i}`)}),(function(e,t){const a=e.fnArray,r=e.argsArray,n=e.iCurr,i=n-4,s=n-3,o=n-2,c=n-1,l=n,h=r[s][0],u=r[s][1];let d=Math.min(Math.floor((t-i)/5),1e3);if(d<3)return t-(t-i)%5;let f=i;if(i>=4&&a[i-4]===a[s]&&a[i-3]===a[o]&&a[i-2]===a[c]&&a[i-1]===a[l]&&r[i-4][0]===h&&r[i-4][1]===u){d++;f-=5}let g=f+4;for(let e=1;e<d;e++){a.splice(g,3);r.splice(g,3);g+=2}return g+1}));class NullOptimizer{constructor(e){this.queue=e}_optimize(){}push(e,t){this.queue.fnArray.push(e);this.queue.argsArray.push(t);this._optimize()}flush(){}reset(){}}class QueueOptimizer extends NullOptimizer{constructor(e){super(e);this.state=null;this.context={iCurr:0,fnArray:e.fnArray,argsArray:e.argsArray};this.match=null;this.lastProcessed=0}_optimize(){const e=this.queue.fnArray;let t=this.lastProcessed,a=e.length,r=this.state,i=this.match;if(!r&&!i&&t+1===a&&!n[e[t]]){this.lastProcessed=a;return}const s=this.context;for(;t<a;){if(i){if((0,i.iterateFn)(s,t)){t++;continue}t=(0,i.processFn)(s,t+1);a=e.length;i=null;r=null;if(t>=a)break}r=(r||n)[e[t]];if(r&&!Array.isArray(r)){s.iCurr=t;t++;if(!r.checkFn||(0,r.checkFn)(s)){i=r;r=null}else r=null}else t++}this.state=r;this.match=i;this.lastProcessed=t}flush(){for(;this.match;){const e=this.queue.fnArray.length;this.lastProcessed=(0,this.match.processFn)(this.context,e);this.match=null;this.state=null;this._optimize()}}reset(){this.state=null;this.match=null;this.lastProcessed=0}}class OperatorList{static get CHUNK_SIZE(){return(0,r.shadow)(this,"CHUNK_SIZE",1e3)}static get CHUNK_SIZE_ABOUT(){return(0,r.shadow)(this,"CHUNK_SIZE_ABOUT",this.CHUNK_SIZE-5)}constructor(e=0,t){this._streamSink=t;this.fnArray=[];this.argsArray=[];!t||e&r.RenderingIntentFlag.OPLIST?this.optimizer=new NullOptimizer(this):this.optimizer=new QueueOptimizer(this);this.dependencies=new Set;this._totalLength=0;this.weight=0;this._resolved=t?null:Promise.resolve()}get length(){return this.argsArray.length}get ready(){return this._resolved||this._streamSink.ready}get totalLength(){return this._totalLength+this.length}addOp(e,t){this.optimizer.push(e,t);this.weight++;this._streamSink&&(this.weight>=OperatorList.CHUNK_SIZE||this.weight>=OperatorList.CHUNK_SIZE_ABOUT&&(e===r.OPS.restore||e===r.OPS.endText))&&this.flush()}addImageOps(e,t,a){void 0!==a&&this.addOp(r.OPS.beginMarkedContentProps,["OC",a]);this.addOp(e,t);void 0!==a&&this.addOp(r.OPS.endMarkedContent,[])}addDependency(e){if(!this.dependencies.has(e)){this.dependencies.add(e);this.addOp(r.OPS.dependency,[e])}}addDependencies(e){for(const t of e)this.addDependency(t)}addOpList(e){if(e instanceof OperatorList){for(const t of e.dependencies)this.dependencies.add(t);for(let t=0,a=e.length;t<a;t++)this.addOp(e.fnArray[t],e.argsArray[t])}else(0,r.warn)('addOpList - ignoring invalid "opList" parameter.')}getIR(){return{fnArray:this.fnArray,argsArray:this.argsArray,length:this.length}}get _transfers(){const e=[],{fnArray:t,argsArray:a,length:n}=this;for(let i=0;i<n;i++)switch(t[i]){case r.OPS.paintInlineImageXObject:case r.OPS.paintInlineImageXObjectGroup:case r.OPS.paintImageMaskXObject:const t=a[i][0];!t.cached&&t.data&&t.data.buffer instanceof ArrayBuffer&&e.push(t.data.buffer)}return e}flush(e=!1,t=null){this.optimizer.flush();const a=this.length;this._totalLength+=a;this._streamSink.enqueue({fnArray:this.fnArray,argsArray:this.argsArray,lastChunk:e,separateAnnots:t,length:a},1,this._transfers);this.dependencies.clear();this.fnArray.length=0;this.argsArray.length=0;this.weight=0;this.optimizer.reset()}}t.OperatorList=OperatorList},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.PDFImage=void 0;var r=a(2),n=a(62),i=a(5),s=a(12),o=a(17),c=a(25),l=a(28),h=a(4);function decodeAndClamp(e,t,a,r){(e=t+e*a)<0?e=0:e>r&&(e=r);return e}function resizeImageMask(e,t,a,r,n,i){const s=n*i;let o;o=t<=8?new Uint8Array(s):t<=16?new Uint16Array(s):new Uint32Array(s);const c=a/n,l=r/i;let h,u,d,f,g=0;const p=new Uint16Array(n),m=a;for(h=0;h<n;h++)p[h]=Math.floor(h*c);for(h=0;h<i;h++){d=Math.floor(h*l)*m;for(u=0;u<n;u++){f=d+p[u];o[g++]=e[f]}}return o}class PDFImage{constructor({xref:e,res:t,image:a,isInline:n=!1,smask:o=null,mask:c=null,isMask:u=!1,pdfFunctionFactory:d,localColorSpaceCache:f}){this.image=a;const g=a.dict,p=g.get("F","Filter");let m;if(p instanceof h.Name)m=p.name;else if(Array.isArray(p)){const t=e.fetchIfRef(p[0]);t instanceof h.Name&&(m=t.name)}switch(m){case"JPXDecode":const e=new l.JpxImage;e.parseImageProperties(a.stream);a.stream.reset();a.width=e.width;a.height=e.height;a.bitsPerComponent=e.bitsPerComponent;a.numComps=e.componentsCount;break;case"JBIG2Decode":a.bitsPerComponent=1;a.numComps=1}let b=g.get("W","Width"),y=g.get("H","Height");if(Number.isInteger(a.width)&&a.width>0&&Number.isInteger(a.height)&&a.height>0&&(a.width!==b||a.height!==y)){(0,r.warn)("PDFImage - using the Width/Height of the image data, rather than the image dictionary.");b=a.width;y=a.height}if(b<1||y<1)throw new r.FormatError(`Invalid image width: ${b} or height: ${y}`);this.width=b;this.height=y;this.interpolate=g.get("I","Interpolate");this.imageMask=g.get("IM","ImageMask")||!1;this.matte=g.get("Matte")||!1;let w=a.bitsPerComponent;if(!w){w=g.get("BPC","BitsPerComponent");if(!w){if(!this.imageMask)throw new r.FormatError(`Bits per component missing in image: ${this.imageMask}`);w=1}}this.bpc=w;if(!this.imageMask){let i=g.getRaw("CS")||g.getRaw("ColorSpace");if(!i){(0,r.info)("JPX images (which do not require color spaces)");switch(a.numComps){case 1:i=h.Name.get("DeviceGray");break;case 3:i=h.Name.get("DeviceRGB");break;case 4:i=h.Name.get("DeviceCMYK");break;default:throw new Error(`JPX images with ${a.numComps} color components not supported.`)}}this.colorSpace=s.ColorSpace.parse({cs:i,xref:e,resources:n?t:null,pdfFunctionFactory:d,localColorSpaceCache:f});this.numComps=this.colorSpace.numComps}this.decode=g.getArray("D","Decode");this.needsDecode=!1;if(this.decode&&(this.colorSpace&&!this.colorSpace.isDefaultDecode(this.decode,w)||u&&!s.ColorSpace.isDefaultDecode(this.decode,1))){this.needsDecode=!0;const e=(1<<w)-1;this.decodeCoefficients=[];this.decodeAddends=[];const t=this.colorSpace&&"Indexed"===this.colorSpace.name;for(let a=0,r=0;a<this.decode.length;a+=2,++r){const n=this.decode[a],i=this.decode[a+1];this.decodeCoefficients[r]=t?(i-n)/e:i-n;this.decodeAddends[r]=t?n:e*n}}if(o)this.smask=new PDFImage({xref:e,res:t,image:o,isInline:n,pdfFunctionFactory:d,localColorSpaceCache:f});else if(c)if(c instanceof i.BaseStream){c.dict.get("IM","ImageMask")?this.mask=new PDFImage({xref:e,res:t,image:c,isInline:n,isMask:!0,pdfFunctionFactory:d,localColorSpaceCache:f}):(0,r.warn)("Ignoring /Mask in image without /ImageMask.")}else this.mask=c}static async buildImage({xref:e,res:t,image:a,isInline:n=!1,pdfFunctionFactory:s,localColorSpaceCache:o}){const c=a;let l=null,h=null;const u=a.dict.get("SMask"),d=a.dict.get("Mask");u?u instanceof i.BaseStream?l=u:(0,r.warn)("Unsupported /SMask format."):d&&(d instanceof i.BaseStream||Array.isArray(d)?h=d:(0,r.warn)("Unsupported /Mask format."));return new PDFImage({xref:e,res:t,image:c,isInline:n,smask:l,mask:h,pdfFunctionFactory:s,localColorSpaceCache:o})}static createRawMask({imgArray:e,width:t,height:a,imageIsFromDecodeStream:r,inverseDecode:n,interpolate:i}){const s=(t+7>>3)*a,o=e.byteLength;let c,l;if(!r||n&&!(s===o))if(n){c=new Uint8Array(s);c.set(e);c.fill(255,o)}else c=new Uint8Array(e);else c=e;if(n)for(l=0;l<o;l++)c[l]^=255;return{data:c,width:t,height:a,interpolate:i}}static createMask({imgArray:e,width:t,height:a,imageIsFromDecodeStream:i,inverseDecode:s,interpolate:o,isOffscreenCanvasSupported:c=!0}){const l=1===t&&1===a&&s===(0===e.length||!!(128&e[0]));if(l)return{isSingleOpaquePixel:l};if(c&&r.FeatureTest.isOffscreenCanvasSupported){const r=new OffscreenCanvas(t,a),i=r.getContext("2d"),c=i.createImageData(t,a);(0,n.applyMaskImageData)({src:e,dest:c.data,width:t,height:a,inverseDecode:s});i.putImageData(c,0,0);return{data:null,width:t,height:a,interpolate:o,bitmap:r.transferToImageBitmap()}}return this.createRawMask({imgArray:e,width:t,height:a,inverseDecode:s,imageIsFromDecodeStream:i,interpolate:o})}get drawWidth(){return Math.max(this.width,this.smask&&this.smask.width||0,this.mask&&this.mask.width||0)}get drawHeight(){return Math.max(this.height,this.smask&&this.smask.height||0,this.mask&&this.mask.height||0)}decodeBuffer(e){const t=this.bpc,a=this.numComps,r=this.decodeAddends,n=this.decodeCoefficients,i=(1<<t)-1;let s,o;if(1===t){for(s=0,o=e.length;s<o;s++)e[s]=+!e[s];return}let c=0;for(s=0,o=this.width*this.height;s<o;s++)for(let t=0;t<a;t++){e[c]=decodeAndClamp(e[c],r[t],n[t],i);c++}}getComponents(e){const t=this.bpc;if(8===t)return e;const a=this.width,r=this.height,n=this.numComps,i=a*r*n;let s,o=0;s=t<=8?new Uint8Array(i):t<=16?new Uint16Array(i):new Uint32Array(i);const c=a*n,l=(1<<t)-1;let h,u,d=0;if(1===t){let t,a,n;for(let i=0;i<r;i++){a=d+(-8&c);n=d+c;for(;d<a;){u=e[o++];s[d]=u>>7&1;s[d+1]=u>>6&1;s[d+2]=u>>5&1;s[d+3]=u>>4&1;s[d+4]=u>>3&1;s[d+5]=u>>2&1;s[d+6]=u>>1&1;s[d+7]=1&u;d+=8}if(d<n){u=e[o++];t=128;for(;d<n;){s[d++]=+!!(u&t);t>>=1}}}}else{let a=0;u=0;for(d=0,h=i;d<h;++d){if(d%c==0){u=0;a=0}for(;a<t;){u=u<<8|e[o++];a+=8}const r=a-t;let n=u>>r;n<0?n=0:n>l&&(n=l);s[d]=n;u&=(1<<r)-1;a=r}}return s}fillOpacity(e,t,a,n,i){const s=this.smask,o=this.mask;let c,l,h,u,d,f;if(s){l=s.width;h=s.height;c=new Uint8ClampedArray(l*h);s.fillGrayBuffer(c);l===t&&h===a||(c=resizeImageMask(c,s.bpc,l,h,t,a))}else if(o)if(o instanceof PDFImage){l=o.width;h=o.height;c=new Uint8ClampedArray(l*h);o.numComps=1;o.fillGrayBuffer(c);for(u=0,d=l*h;u<d;++u)c[u]=255-c[u];l===t&&h===a||(c=resizeImageMask(c,o.bpc,l,h,t,a))}else{if(!Array.isArray(o))throw new r.FormatError("Unknown mask format.");{c=new Uint8ClampedArray(t*a);const e=this.numComps;for(u=0,d=t*a;u<d;++u){let t=0;const a=u*e;for(f=0;f<e;++f){const e=i[a+f],r=2*f;if(e<o[r]||e>o[r+1]){t=255;break}}c[u]=t}}}if(c)for(u=0,f=3,d=t*n;u<d;++u,f+=4)e[f]=c[u];else for(u=0,f=3,d=t*n;u<d;++u,f+=4)e[f]=255}undoPreblend(e,t,a){const r=this.smask&&this.smask.matte;if(!r)return;const n=this.colorSpace.getRgb(r,0),i=n[0],s=n[1],o=n[2],c=t*a*4;for(let t=0;t<c;t+=4){const a=e[t+3];if(0===a){e[t]=255;e[t+1]=255;e[t+2]=255;continue}const r=255/a;e[t]=(e[t]-i)*r+i;e[t+1]=(e[t+1]-s)*r+s;e[t+2]=(e[t+2]-o)*r+o}}createImageData(e=!1){const t=this.drawWidth,a=this.drawHeight,n={width:t,height:a,interpolate:this.interpolate,kind:0,data:null},i=this.numComps,s=this.width,o=this.height,l=this.bpc,h=s*i*l+7>>3;if(!e){let e;"DeviceGray"===this.colorSpace.name&&1===l?e=r.ImageKind.GRAYSCALE_1BPP:"DeviceRGB"!==this.colorSpace.name||8!==l||this.needsDecode||(e=r.ImageKind.RGB_24BPP);if(e&&!this.smask&&!this.mask&&t===s&&a===o){n.kind=e;n.data=this.getImageBytes(o*h,{});if(this.needsDecode){(0,r.assert)(e===r.ImageKind.GRAYSCALE_1BPP,"PDFImage.createImageData: The image must be grayscale.");const t=n.data;for(let e=0,a=t.length;e<a;e++)t[e]^=255}return n}if(this.image instanceof c.JpegStream&&!this.smask&&!this.mask){let e=o*h;switch(this.colorSpace.name){case"DeviceGray":e*=3;case"DeviceRGB":case"DeviceCMYK":n.kind=r.ImageKind.RGB_24BPP;n.data=this.getImageBytes(e,{drawWidth:t,drawHeight:a,forceRGB:!0});return n}}}const u=this.getImageBytes(o*h,{internal:!0}),d=0|u.length/h*a/o,f=this.getComponents(u);let g,p;if(e||this.smask||this.mask){n.kind=r.ImageKind.RGBA_32BPP;n.data=new Uint8ClampedArray(t*a*4);g=1;p=!0;this.fillOpacity(n.data,t,a,d,f)}else{n.kind=r.ImageKind.RGB_24BPP;n.data=new Uint8ClampedArray(t*a*3);g=0;p=!1}this.needsDecode&&this.decodeBuffer(f);this.colorSpace.fillRgb(n.data,s,o,t,a,d,l,f,g);p&&this.undoPreblend(n.data,t,d);return n}fillGrayBuffer(e){const t=this.numComps;if(1!==t)throw new r.FormatError(`Reading gray scale from a color image: ${t}`);const a=this.width,n=this.height,i=this.bpc,s=a*t*i+7>>3,o=this.getImageBytes(n*s,{internal:!0}),c=this.getComponents(o);let l,h;if(1===i){h=a*n;if(this.needsDecode)for(l=0;l<h;++l)e[l]=c[l]-1&255;else for(l=0;l<h;++l)e[l]=255&-c[l];return}this.needsDecode&&this.decodeBuffer(c);h=a*n;const u=255/((1<<i)-1);for(l=0;l<h;++l)e[l]=u*c[l]}getImageBytes(e,{drawWidth:t,drawHeight:a,forceRGB:n=!1,internal:i=!1}){this.image.reset();this.image.drawWidth=t||this.width;this.image.drawHeight=a||this.height;this.image.forceRGB=!!n;const s=this.image.getBytes(e);if(i||this.image instanceof o.DecodeStream)return s;(0,r.assert)(s instanceof Uint8Array,'PDFImage.getImageBytes: Unsupported "imageBytes" type.');return new Uint8Array(s)}}t.PDFImage=PDFImage},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.applyMaskImageData=function applyMaskImageData({src:e,srcPos:t=0,dest:a,destPos:n=0,width:i,height:s,inverseDecode:o=!1}){const c=r.FeatureTest.isLittleEndian?4278190080:255,[l,h]=o?[0,c]:[c,0],u=i>>3,d=7&i,f=e.length;a=new Uint32Array(a.buffer);for(let r=0;r<s;r++){for(const r=t+u;t<r;t++){const r=t<f?e[t]:255;a[n++]=128&r?h:l;a[n++]=64&r?h:l;a[n++]=32&r?h:l;a[n++]=16&r?h:l;a[n++]=8&r?h:l;a[n++]=4&r?h:l;a[n++]=2&r?h:l;a[n++]=1&r?h:l}if(0===d)continue;const r=t<f?e[t++]:255;for(let e=0;e<d;e++)a[n++]=r&1<<7-e?h:l}return{srcPos:t,destPos:n}};var r=a(2)},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.incrementalUpdate=function incrementalUpdate({originalData:e,xrefInfo:t,newRefs:a,xref:o=null,hasXfa:l=!1,xfaDatasetsRef:h=null,hasXfaDatasetsEntry:u=!1,needAppearances:d,acroFormRef:f=null,acroForm:g=null,xfaData:p=null}){!function updateAcroform({xref:e,acroForm:t,acroFormRef:a,hasXfa:i,hasXfaDatasetsEntry:s,xfaDatasetsRef:o,needAppearances:c,newRefs:l}){!i||s||o||(0,r.warn)("XFA - Cannot save it");if(!(c||i&&o))return;const h=new n.Dict(e);for(const e of t.getKeys())h.set(e,t.getRaw(e));if(i&&!s){const e=t.get("XFA").slice();e.splice(2,0,"datasets");e.splice(3,0,o);h.set("XFA",e)}c&&h.set("NeedAppearances",!0);const u=e.encrypt;let d=null;u&&(d=u.createCipherTransform(a.num,a.gen));const f=[];writeObject(a,h,f,d);l.push({ref:a,data:f.join("")})}({xref:o,acroForm:g,acroFormRef:f,hasXfa:l,hasXfaDatasetsEntry:u,xfaDatasetsRef:h,needAppearances:d,newRefs:a});l&&function updateXFA({xfaData:e,xfaDatasetsRef:t,newRefs:a,xref:n}){if(null===e){e=function writeXFADataForAcroform(e,t){const a=new s.SimpleXMLParser({hasAttributes:!0}).parseFromString(e);for(const{xfa:e}of t){if(!e)continue;const{path:t,value:n}=e;if(!t)continue;const o=(0,i.parseXFAPath)(t);let c=a.documentElement.searchNode(o,0);!c&&o.length>1&&(c=a.documentElement.searchNode([o.at(-1)],0));c?Array.isArray(n)?c.childNodes=n.map((e=>new s.SimpleDOMNode("value",e))):c.childNodes=[new s.SimpleDOMNode("#text",n)]:(0,r.warn)(`Node not found for path: ${t}`)}const n=[];a.documentElement.dump(n);return n.join("")}(n.fetchIfRef(t).getString(),a)}const o=n.encrypt;if(o){e=o.createCipherTransform(t.num,t.gen).encryptString(e)}const c=`${t.num} ${t.gen} obj\n<< /Type /EmbeddedFile /Length ${e.length}>>\nstream\n`+e+"\nendstream\nendobj\n";a.push({ref:t,data:c})}({xfaData:p,xfaDatasetsRef:h,newRefs:a,xref:o});const m=new n.Dict(null),b=t.newRef;let y,w;const S=e.at(-1);if(10===S||13===S){y=[];w=e.length}else{y=["\n"];w=e.length+1}m.set("Size",b.num+1);m.set("Prev",t.startXRef);m.set("Type",n.Name.get("XRef"));null!==t.rootRef&&m.set("Root",t.rootRef);null!==t.infoRef&&m.set("Info",t.infoRef);null!==t.encryptRef&&m.set("Encrypt",t.encryptRef);a.push({ref:b,data:""});a=a.sort(((e,t)=>e.ref.num-t.ref.num));const x=[[0,1,65535]],C=[0,1];let k=0;for(const{ref:e,data:t}of a){k=Math.max(k,w);x.push([1,w,Math.min(e.gen,65535)]);w+=t.length;C.push(e.num,1);y.push(t)}m.set("Index",C);if(Array.isArray(t.fileIds)&&t.fileIds.length>0){const e=function computeMD5(e,t){const a=Math.floor(Date.now()/1e3),n=t.filename||"",i=[a.toString(),n,e.toString()];let s=i.reduce(((e,t)=>e+t.length),0);for(const e of Object.values(t.info)){i.push(e);s+=e.length}const o=new Uint8Array(s);let l=0;for(const e of i){writeString(e,l,o);l+=e.length}return(0,r.bytesToString)((0,c.calculateMD5)(o))}(w,t);m.set("ID",[t.fileIds[0],e])}const v=[1,Math.ceil(Math.log2(k)/8),2],F=(v[0]+v[1]+v[2])*x.length;m.set("W",v);m.set("Length",F);y.push(`${b.num} ${b.gen} obj\n`);writeDict(m,y,null);y.push(" stream\n");const O=y.reduce(((e,t)=>e+t.length),0),T=`\nendstream\nendobj\nstartxref\n${w}\n%%EOF\n`,M=new Uint8Array(e.length+O+F+T.length);M.set(e);let E=e.length;for(const e of y){writeString(e,E,M);E+=e.length}for(const[e,t,a]of x){E=writeInt(e,v[0],E,M);E=writeInt(t,v[1],E,M);E=writeInt(a,v[2],E,M)}writeString(T,E,M);return M};t.writeDict=writeDict;t.writeObject=writeObject;var r=a(2),n=a(4),i=a(3),s=a(64),o=a(5),c=a(65);function writeObject(e,t,a,r){a.push(`${e.num} ${e.gen} obj\n`);t instanceof n.Dict?writeDict(t,a,r):t instanceof o.BaseStream&&writeStream(t,a,r);a.push("\nendobj\n")}function writeDict(e,t,a){t.push("<<");for(const r of e.getKeys()){t.push(` /${(0,i.escapePDFName)(r)} `);writeValue(e.getRaw(r),t,a)}t.push(">>")}function writeStream(e,t,a){let r=e.getString();null!==a&&(r=a.encryptString(r));e.dict.set("Length",r.length);writeDict(e.dict,t,a);t.push(" stream\n",r,"\nendstream")}function writeValue(e,t,a){if(e instanceof n.Name)t.push(`/${(0,i.escapePDFName)(e.name)}`);else if(e instanceof n.Ref)t.push(`${e.num} ${e.gen} R`);else if(Array.isArray(e))!function writeArray(e,t,a){t.push("[");let r=!0;for(const n of e){r?r=!1:t.push(" ");writeValue(n,t,a)}t.push("]")}(e,t,a);else if("string"==typeof e){null!==a&&(e=a.encryptString(e));t.push(`(${(0,i.escapeString)(e)})`)}else"number"==typeof e?t.push((0,i.numberToString)(e)):"boolean"==typeof e?t.push(e.toString()):e instanceof n.Dict?writeDict(e,t,a):e instanceof o.BaseStream?writeStream(e,t,a):null===e?t.push("null"):(0,r.warn)(`Unhandled value in writer: ${typeof e}, please file a bug.`)}function writeInt(e,t,a,r){for(let n=t+a-1;n>a-1;n--){r[n]=255&e;e>>=8}return a+t}function writeString(e,t,a){for(let r=0,n=e.length;r<n;r++)a[t+r]=255&e.charCodeAt(r)}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.XMLParserErrorCode=t.XMLParserBase=t.SimpleXMLParser=t.SimpleDOMNode=void 0;var r=a(3);const n={NoError:0,EndOfDocument:-1,UnterminatedCdat:-2,UnterminatedXmlDeclaration:-3,UnterminatedDoctypeDeclaration:-4,UnterminatedComment:-5,MalformedElement:-6,OutOfMemory:-7,UnterminatedAttributeValue:-8,UnterminatedElement:-9,ElementNeverBegun:-10};t.XMLParserErrorCode=n;function isWhitespace(e,t){const a=e[t];return" "===a||"\n"===a||"\r"===a||"\t"===a}class XMLParserBase{_resolveEntities(e){return e.replace(/&([^;]+);/g,((e,t)=>{if("#x"===t.substring(0,2))return String.fromCodePoint(parseInt(t.substring(2),16));if("#"===t.substring(0,1))return String.fromCodePoint(parseInt(t.substring(1),10));switch(t){case"lt":return"<";case"gt":return">";case"amp":return"&";case"quot":return'"';case"apos":return"'"}return this.onResolveEntity(t)}))}_parseContent(e,t){const a=[];let r=t;function skipWs(){for(;r<e.length&&isWhitespace(e,r);)++r}for(;r<e.length&&!isWhitespace(e,r)&&">"!==e[r]&&"/"!==e[r];)++r;const n=e.substring(t,r);skipWs();for(;r<e.length&&">"!==e[r]&&"/"!==e[r]&&"?"!==e[r];){skipWs();let t="",n="";for(;r<e.length&&!isWhitespace(e,r)&&"="!==e[r];){t+=e[r];++r}skipWs();if("="!==e[r])return null;++r;skipWs();const i=e[r];if('"'!==i&&"'"!==i)return null;const s=e.indexOf(i,++r);if(s<0)return null;n=e.substring(r,s);a.push({name:t,value:this._resolveEntities(n)});r=s+1;skipWs()}return{name:n,attributes:a,parsed:r-t}}_parseProcessingInstruction(e,t){let a=t;for(;a<e.length&&!isWhitespace(e,a)&&">"!==e[a]&&"?"!==e[a]&&"/"!==e[a];)++a;const r=e.substring(t,a);!function skipWs(){for(;a<e.length&&isWhitespace(e,a);)++a}();const n=a;for(;a<e.length&&("?"!==e[a]||">"!==e[a+1]);)++a;return{name:r,value:e.substring(n,a),parsed:a-t}}parseXml(e){let t=0;for(;t<e.length;){let a=t;if("<"===e[t]){++a;let t;switch(e[a]){case"/":++a;t=e.indexOf(">",a);if(t<0){this.onError(n.UnterminatedElement);return}this.onEndElement(e.substring(a,t));a=t+1;break;case"?":++a;const r=this._parseProcessingInstruction(e,a);if("?>"!==e.substring(a+r.parsed,a+r.parsed+2)){this.onError(n.UnterminatedXmlDeclaration);return}this.onPi(r.name,r.value);a+=r.parsed+2;break;case"!":if("--"===e.substring(a+1,a+3)){t=e.indexOf("--\x3e",a+3);if(t<0){this.onError(n.UnterminatedComment);return}this.onComment(e.substring(a+3,t));a=t+3}else if("[CDATA["===e.substring(a+1,a+8)){t=e.indexOf("]]>",a+8);if(t<0){this.onError(n.UnterminatedCdat);return}this.onCdata(e.substring(a+8,t));a=t+3}else{if("DOCTYPE"!==e.substring(a+1,a+8)){this.onError(n.MalformedElement);return}{const r=e.indexOf("[",a+8);let i=!1;t=e.indexOf(">",a+8);if(t<0){this.onError(n.UnterminatedDoctypeDeclaration);return}if(r>0&&t>r){t=e.indexOf("]>",a+8);if(t<0){this.onError(n.UnterminatedDoctypeDeclaration);return}i=!0}const s=e.substring(a+8,t+(i?1:0));this.onDoctype(s);a=t+(i?2:1)}}break;default:const i=this._parseContent(e,a);if(null===i){this.onError(n.MalformedElement);return}let s=!1;if("/>"===e.substring(a+i.parsed,a+i.parsed+2))s=!0;else if(">"!==e.substring(a+i.parsed,a+i.parsed+1)){this.onError(n.UnterminatedElement);return}this.onBeginElement(i.name,i.attributes,s);a+=i.parsed+(s?2:1)}}else{for(;a<e.length&&"<"!==e[a];)a++;const r=e.substring(t,a);this.onText(this._resolveEntities(r))}t=a}}onResolveEntity(e){return`&${e};`}onPi(e,t){}onComment(e){}onCdata(e){}onDoctype(e){}onText(e){}onBeginElement(e,t,a){}onEndElement(e){}onError(e){}}t.XMLParserBase=XMLParserBase;class SimpleDOMNode{constructor(e,t){this.nodeName=e;this.nodeValue=t;Object.defineProperty(this,"parentNode",{value:null,writable:!0})}get firstChild(){return this.childNodes&&this.childNodes[0]}get nextSibling(){const e=this.parentNode.childNodes;if(!e)return;const t=e.indexOf(this);return-1!==t?e[t+1]:void 0}get textContent(){return this.childNodes?this.childNodes.map((function(e){return e.textContent})).join(""):this.nodeValue||""}get children(){return this.childNodes||[]}hasChildNodes(){return this.childNodes&&this.childNodes.length>0}searchNode(e,t){if(t>=e.length)return this;const a=e[t],r=[];let n=this;for(;;){if(a.name===n.nodeName){if(0!==a.pos){if(0===r.length)return null;{const[i]=r.pop();let s=0;for(const r of i.childNodes)if(a.name===r.nodeName){if(s===a.pos)return r.searchNode(e,t+1);s++}return n.searchNode(e,t+1)}}{const a=n.searchNode(e,t+1);if(null!==a)return a}}if(n.childNodes&&0!==n.childNodes.length){r.push([n,0]);n=n.childNodes[0]}else{if(0===r.length)return null;for(;0!==r.length;){const[e,t]=r.pop(),a=t+1;if(a<e.childNodes.length){r.push([e,a]);n=e.childNodes[a];break}}if(0===r.length)return null}}}dump(e){if("#text"!==this.nodeName){e.push(`<${this.nodeName}`);if(this.attributes)for(const t of this.attributes)e.push(` ${t.name}="${(0,r.encodeToXmlString)(t.value)}"`);if(this.hasChildNodes()){e.push(">");for(const t of this.childNodes)t.dump(e);e.push(`</${this.nodeName}>`)}else this.nodeValue?e.push(`>${(0,r.encodeToXmlString)(this.nodeValue)}</${this.nodeName}>`):e.push("/>")}else e.push((0,r.encodeToXmlString)(this.nodeValue))}}t.SimpleDOMNode=SimpleDOMNode;t.SimpleXMLParser=class SimpleXMLParser extends XMLParserBase{constructor({hasAttributes:e=!1,lowerCaseName:t=!1}){super();this._currentFragment=null;this._stack=null;this._errorCode=n.NoError;this._hasAttributes=e;this._lowerCaseName=t}parseFromString(e){this._currentFragment=[];this._stack=[];this._errorCode=n.NoError;this.parseXml(e);if(this._errorCode!==n.NoError)return;const[t]=this._currentFragment;return t?{documentElement:t}:void 0}onText(e){if(function isWhitespaceString(e){for(let t=0,a=e.length;t<a;t++)if(!isWhitespace(e,t))return!1;return!0}(e))return;const t=new SimpleDOMNode("#text",e);this._currentFragment.push(t)}onCdata(e){const t=new SimpleDOMNode("#text",e);this._currentFragment.push(t)}onBeginElement(e,t,a){this._lowerCaseName&&(e=e.toLowerCase());const r=new SimpleDOMNode(e);r.childNodes=[];this._hasAttributes&&(r.attributes=t);this._currentFragment.push(r);if(!a){this._stack.push(this._currentFragment);this._currentFragment=r.childNodes}}onEndElement(e){this._currentFragment=this._stack.pop()||[];const t=this._currentFragment.at(-1);if(!t)return null;for(const e of t.childNodes)e.parentNode=t;return t}onError(e){this._errorCode=e}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.calculateSHA256=t.calculateMD5=t.PDF20=t.PDF17=t.CipherTransformFactory=t.ARCFourCipher=t.AES256Cipher=t.AES128Cipher=void 0;t.calculateSHA384=calculateSHA384;t.calculateSHA512=void 0;var r=a(2),n=a(4),i=a(66);class ARCFourCipher{constructor(e){this.a=0;this.b=0;const t=new Uint8Array(256),a=e.length;for(let e=0;e<256;++e)t[e]=e;for(let r=0,n=0;r<256;++r){const i=t[r];n=n+i+e[r%a]&255;t[r]=t[n];t[n]=i}this.s=t}encryptBlock(e){let t=this.a,a=this.b;const r=this.s,n=e.length,i=new Uint8Array(n);for(let s=0;s<n;++s){t=t+1&255;const n=r[t];a=a+n&255;const o=r[a];r[t]=o;r[a]=n;i[s]=e[s]^r[n+o&255]}this.a=t;this.b=a;return i}decryptBlock(e){return this.encryptBlock(e)}encrypt(e){return this.encryptBlock(e)}}t.ARCFourCipher=ARCFourCipher;const s=function calculateMD5Closure(){const e=new Uint8Array([7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21]),t=new Int32Array([-680876936,-389564586,606105819,-1044525330,-176418897,1200080426,-1473231341,-45705983,1770035416,-1958414417,-42063,-1990404162,1804603682,-40341101,-1502002290,1236535329,-165796510,-1069501632,643717713,-373897302,-701558691,38016083,-660478335,-405537848,568446438,-1019803690,-187363961,1163531501,-1444681467,-51403784,1735328473,-1926607734,-378558,-2022574463,1839030562,-35309556,-1530992060,1272893353,-155497632,-1094730640,681279174,-358537222,-722521979,76029189,-640364487,-421815835,530742520,-995338651,-198630844,1126891415,-1416354905,-57434055,1700485571,-1894986606,-1051523,-2054922799,1873313359,-30611744,-1560198380,1309151649,-145523070,-1120210379,718787259,-343485551]);return function hash(a,r,n){let i=1732584193,s=-271733879,o=-1732584194,c=271733878;const l=n+72&-64,h=new Uint8Array(l);let u,d;for(u=0;u<n;++u)h[u]=a[r++];h[u++]=128;const f=l-8;for(;u<f;)h[u++]=0;h[u++]=n<<3&255;h[u++]=n>>5&255;h[u++]=n>>13&255;h[u++]=n>>21&255;h[u++]=n>>>29&255;h[u++]=0;h[u++]=0;h[u++]=0;const g=new Int32Array(16);for(u=0;u<l;){for(d=0;d<16;++d,u+=4)g[d]=h[u]|h[u+1]<<8|h[u+2]<<16|h[u+3]<<24;let a,r,n=i,l=s,f=o,p=c;for(d=0;d<64;++d){if(d<16){a=l&f|~l&p;r=d}else if(d<32){a=p&l|~p&f;r=5*d+1&15}else if(d<48){a=l^f^p;r=3*d+5&15}else{a=f^(l|~p);r=7*d&15}const i=p,s=n+a+t[d]+g[r]|0,o=e[d];p=f;f=l;l=l+(s<<o|s>>>32-o)|0;n=i}i=i+n|0;s=s+l|0;o=o+f|0;c=c+p|0}return new Uint8Array([255&i,i>>8&255,i>>16&255,i>>>24&255,255&s,s>>8&255,s>>16&255,s>>>24&255,255&o,o>>8&255,o>>16&255,o>>>24&255,255&c,c>>8&255,c>>16&255,c>>>24&255])}}();t.calculateMD5=s;class Word64{constructor(e,t){this.high=0|e;this.low=0|t}and(e){this.high&=e.high;this.low&=e.low}xor(e){this.high^=e.high;this.low^=e.low}or(e){this.high|=e.high;this.low|=e.low}shiftRight(e){if(e>=32){this.low=this.high>>>e-32|0;this.high=0}else{this.low=this.low>>>e|this.high<<32-e;this.high=this.high>>>e|0}}shiftLeft(e){if(e>=32){this.high=this.low<<e-32;this.low=0}else{this.high=this.high<<e|this.low>>>32-e;this.low<<=e}}rotateRight(e){let t,a;if(32&e){a=this.low;t=this.high}else{t=this.low;a=this.high}e&=31;this.low=t>>>e|a<<32-e;this.high=a>>>e|t<<32-e}not(){this.high=~this.high;this.low=~this.low}add(e){const t=(this.low>>>0)+(e.low>>>0);let a=(this.high>>>0)+(e.high>>>0);t>4294967295&&(a+=1);this.low=0|t;this.high=0|a}copyTo(e,t){e[t]=this.high>>>24&255;e[t+1]=this.high>>16&255;e[t+2]=this.high>>8&255;e[t+3]=255&this.high;e[t+4]=this.low>>>24&255;e[t+5]=this.low>>16&255;e[t+6]=this.low>>8&255;e[t+7]=255&this.low}assign(e){this.high=e.high;this.low=e.low}}const o=function calculateSHA256Closure(){function rotr(e,t){return e>>>t|e<<32-t}function ch(e,t,a){return e&t^~e&a}function maj(e,t,a){return e&t^e&a^t&a}function sigma(e){return rotr(e,2)^rotr(e,13)^rotr(e,22)}function sigmaPrime(e){return rotr(e,6)^rotr(e,11)^rotr(e,25)}function littleSigma(e){return rotr(e,7)^rotr(e,18)^e>>>3}const e=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];return function hash(t,a,r){let n=1779033703,i=3144134277,s=1013904242,o=2773480762,c=1359893119,l=2600822924,h=528734635,u=1541459225;const d=64*Math.ceil((r+9)/64),f=new Uint8Array(d);let g,p;for(g=0;g<r;++g)f[g]=t[a++];f[g++]=128;const m=d-8;for(;g<m;)f[g++]=0;f[g++]=0;f[g++]=0;f[g++]=0;f[g++]=r>>>29&255;f[g++]=r>>21&255;f[g++]=r>>13&255;f[g++]=r>>5&255;f[g++]=r<<3&255;const b=new Uint32Array(64);for(g=0;g<d;){for(p=0;p<16;++p){b[p]=f[g]<<24|f[g+1]<<16|f[g+2]<<8|f[g+3];g+=4}for(p=16;p<64;++p)b[p]=(rotr(y=b[p-2],17)^rotr(y,19)^y>>>10)+b[p-7]+littleSigma(b[p-15])+b[p-16]|0;let t,a,r=n,d=i,m=s,w=o,S=c,x=l,C=h,k=u;for(p=0;p<64;++p){t=k+sigmaPrime(S)+ch(S,x,C)+e[p]+b[p];a=sigma(r)+maj(r,d,m);k=C;C=x;x=S;S=w+t|0;w=m;m=d;d=r;r=t+a|0}n=n+r|0;i=i+d|0;s=s+m|0;o=o+w|0;c=c+S|0;l=l+x|0;h=h+C|0;u=u+k|0}var y;return new Uint8Array([n>>24&255,n>>16&255,n>>8&255,255&n,i>>24&255,i>>16&255,i>>8&255,255&i,s>>24&255,s>>16&255,s>>8&255,255&s,o>>24&255,o>>16&255,o>>8&255,255&o,c>>24&255,c>>16&255,c>>8&255,255&c,l>>24&255,l>>16&255,l>>8&255,255&l,h>>24&255,h>>16&255,h>>8&255,255&h,u>>24&255,u>>16&255,u>>8&255,255&u])}}();t.calculateSHA256=o;const c=function calculateSHA512Closure(){function ch(e,t,a,r,n){e.assign(t);e.and(a);n.assign(t);n.not();n.and(r);e.xor(n)}function maj(e,t,a,r,n){e.assign(t);e.and(a);n.assign(t);n.and(r);e.xor(n);n.assign(a);n.and(r);e.xor(n)}function sigma(e,t,a){e.assign(t);e.rotateRight(28);a.assign(t);a.rotateRight(34);e.xor(a);a.assign(t);a.rotateRight(39);e.xor(a)}function sigmaPrime(e,t,a){e.assign(t);e.rotateRight(14);a.assign(t);a.rotateRight(18);e.xor(a);a.assign(t);a.rotateRight(41);e.xor(a)}function littleSigma(e,t,a){e.assign(t);e.rotateRight(1);a.assign(t);a.rotateRight(8);e.xor(a);a.assign(t);a.shiftRight(7);e.xor(a)}function littleSigmaPrime(e,t,a){e.assign(t);e.rotateRight(19);a.assign(t);a.rotateRight(61);e.xor(a);a.assign(t);a.shiftRight(6);e.xor(a)}const e=[new Word64(1116352408,3609767458),new Word64(1899447441,602891725),new Word64(3049323471,3964484399),new Word64(3921009573,2173295548),new Word64(961987163,4081628472),new Word64(1508970993,3053834265),new Word64(2453635748,2937671579),new Word64(2870763221,3664609560),new Word64(3624381080,2734883394),new Word64(310598401,1164996542),new Word64(607225278,1323610764),new Word64(1426881987,3590304994),new Word64(1925078388,4068182383),new Word64(2162078206,991336113),new Word64(2614888103,633803317),new Word64(3248222580,3479774868),new Word64(3835390401,2666613458),new Word64(4022224774,944711139),new Word64(264347078,2341262773),new Word64(604807628,2007800933),new Word64(770255983,1495990901),new Word64(1249150122,1856431235),new Word64(1555081692,3175218132),new Word64(1996064986,2198950837),new Word64(2554220882,3999719339),new Word64(2821834349,766784016),new Word64(2952996808,2566594879),new Word64(3210313671,3203337956),new Word64(3336571891,1034457026),new Word64(3584528711,2466948901),new Word64(113926993,3758326383),new Word64(338241895,168717936),new Word64(666307205,1188179964),new Word64(773529912,1546045734),new Word64(1294757372,1522805485),new Word64(1396182291,2643833823),new Word64(1695183700,2343527390),new Word64(1986661051,1014477480),new Word64(2177026350,1206759142),new Word64(2456956037,344077627),new Word64(2730485921,1290863460),new Word64(2820302411,3158454273),new Word64(3259730800,3505952657),new Word64(3345764771,106217008),new Word64(3516065817,3606008344),new Word64(3600352804,1432725776),new Word64(4094571909,1467031594),new Word64(275423344,851169720),new Word64(430227734,3100823752),new Word64(506948616,1363258195),new Word64(659060556,3750685593),new Word64(883997877,3785050280),new Word64(958139571,3318307427),new Word64(1322822218,3812723403),new Word64(1537002063,2003034995),new Word64(1747873779,3602036899),new Word64(1955562222,1575990012),new Word64(2024104815,1125592928),new Word64(2227730452,2716904306),new Word64(2361852424,442776044),new Word64(2428436474,593698344),new Word64(2756734187,3733110249),new Word64(3204031479,2999351573),new Word64(3329325298,3815920427),new Word64(3391569614,3928383900),new Word64(3515267271,566280711),new Word64(3940187606,3454069534),new Word64(4118630271,4000239992),new Word64(116418474,1914138554),new Word64(174292421,2731055270),new Word64(289380356,3203993006),new Word64(460393269,320620315),new Word64(685471733,587496836),new Word64(852142971,1086792851),new Word64(1017036298,365543100),new Word64(1126000580,2618297676),new Word64(1288033470,3409855158),new Word64(1501505948,4234509866),new Word64(1607167915,987167468),new Word64(1816402316,1246189591)];return function hash(t,a,r,n=!1){let i,s,o,c,l,h,u,d;if(n){i=new Word64(3418070365,3238371032);s=new Word64(1654270250,914150663);o=new Word64(2438529370,812702999);c=new Word64(355462360,4144912697);l=new Word64(1731405415,4290775857);h=new Word64(2394180231,1750603025);u=new Word64(3675008525,1694076839);d=new Word64(1203062813,3204075428)}else{i=new Word64(1779033703,4089235720);s=new Word64(3144134277,2227873595);o=new Word64(1013904242,4271175723);c=new Word64(2773480762,1595750129);l=new Word64(1359893119,2917565137);h=new Word64(2600822924,725511199);u=new Word64(528734635,4215389547);d=new Word64(1541459225,327033209)}const f=128*Math.ceil((r+17)/128),g=new Uint8Array(f);let p,m;for(p=0;p<r;++p)g[p]=t[a++];g[p++]=128;const b=f-16;for(;p<b;)g[p++]=0;g[p++]=0;g[p++]=0;g[p++]=0;g[p++]=0;g[p++]=0;g[p++]=0;g[p++]=0;g[p++]=0;g[p++]=0;g[p++]=0;g[p++]=0;g[p++]=r>>>29&255;g[p++]=r>>21&255;g[p++]=r>>13&255;g[p++]=r>>5&255;g[p++]=r<<3&255;const y=new Array(80);for(p=0;p<80;p++)y[p]=new Word64(0,0);let w=new Word64(0,0),S=new Word64(0,0),x=new Word64(0,0),C=new Word64(0,0),k=new Word64(0,0),v=new Word64(0,0),F=new Word64(0,0),O=new Word64(0,0);const T=new Word64(0,0),M=new Word64(0,0),E=new Word64(0,0),D=new Word64(0,0);let N,R;for(p=0;p<f;){for(m=0;m<16;++m){y[m].high=g[p]<<24|g[p+1]<<16|g[p+2]<<8|g[p+3];y[m].low=g[p+4]<<24|g[p+5]<<16|g[p+6]<<8|g[p+7];p+=8}for(m=16;m<80;++m){N=y[m];littleSigmaPrime(N,y[m-2],D);N.add(y[m-7]);littleSigma(E,y[m-15],D);N.add(E);N.add(y[m-16])}w.assign(i);S.assign(s);x.assign(o);C.assign(c);k.assign(l);v.assign(h);F.assign(u);O.assign(d);for(m=0;m<80;++m){T.assign(O);sigmaPrime(E,k,D);T.add(E);ch(E,k,v,F,D);T.add(E);T.add(e[m]);T.add(y[m]);sigma(M,w,D);maj(E,w,S,x,D);M.add(E);N=O;O=F;F=v;v=k;C.add(T);k=C;C=x;x=S;S=w;N.assign(T);N.add(M);w=N}i.add(w);s.add(S);o.add(x);c.add(C);l.add(k);h.add(v);u.add(F);d.add(O)}if(n){R=new Uint8Array(48);i.copyTo(R,0);s.copyTo(R,8);o.copyTo(R,16);c.copyTo(R,24);l.copyTo(R,32);h.copyTo(R,40)}else{R=new Uint8Array(64);i.copyTo(R,0);s.copyTo(R,8);o.copyTo(R,16);c.copyTo(R,24);l.copyTo(R,32);h.copyTo(R,40);u.copyTo(R,48);d.copyTo(R,56)}return R}}();t.calculateSHA512=c;function calculateSHA384(e,t,a){return c(e,t,a,!0)}class NullCipher{decryptBlock(e){return e}encrypt(e){return e}}class AESBaseCipher{constructor(){this.constructor===AESBaseCipher&&(0,r.unreachable)("Cannot initialize AESBaseCipher.");this._s=new Uint8Array([99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22]);this._inv_s=new Uint8Array([82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125]);this._mix=new Uint32Array([0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795]);this._mixCol=new Uint8Array(256);for(let e=0;e<256;e++)this._mixCol[e]=e<128?e<<1:e<<1^27;this.buffer=new Uint8Array(16);this.bufferPosition=0}_expandKey(e){(0,r.unreachable)("Cannot call `_expandKey` on the base class")}_decrypt(e,t){let a,r,n;const i=new Uint8Array(16);i.set(e);for(let e=0,a=this._keySize;e<16;++e,++a)i[e]^=t[a];for(let e=this._cyclesOfRepetition-1;e>=1;--e){a=i[13];i[13]=i[9];i[9]=i[5];i[5]=i[1];i[1]=a;a=i[14];r=i[10];i[14]=i[6];i[10]=i[2];i[6]=a;i[2]=r;a=i[15];r=i[11];n=i[7];i[15]=i[3];i[11]=a;i[7]=r;i[3]=n;for(let e=0;e<16;++e)i[e]=this._inv_s[i[e]];for(let a=0,r=16*e;a<16;++a,++r)i[a]^=t[r];for(let e=0;e<16;e+=4){const t=this._mix[i[e]],r=this._mix[i[e+1]],n=this._mix[i[e+2]],s=this._mix[i[e+3]];a=t^r>>>8^r<<24^n>>>16^n<<16^s>>>24^s<<8;i[e]=a>>>24&255;i[e+1]=a>>16&255;i[e+2]=a>>8&255;i[e+3]=255&a}}a=i[13];i[13]=i[9];i[9]=i[5];i[5]=i[1];i[1]=a;a=i[14];r=i[10];i[14]=i[6];i[10]=i[2];i[6]=a;i[2]=r;a=i[15];r=i[11];n=i[7];i[15]=i[3];i[11]=a;i[7]=r;i[3]=n;for(let e=0;e<16;++e){i[e]=this._inv_s[i[e]];i[e]^=t[e]}return i}_encrypt(e,t){const a=this._s;let r,n,i;const s=new Uint8Array(16);s.set(e);for(let e=0;e<16;++e)s[e]^=t[e];for(let e=1;e<this._cyclesOfRepetition;e++){for(let e=0;e<16;++e)s[e]=a[s[e]];i=s[1];s[1]=s[5];s[5]=s[9];s[9]=s[13];s[13]=i;i=s[2];n=s[6];s[2]=s[10];s[6]=s[14];s[10]=i;s[14]=n;i=s[3];n=s[7];r=s[11];s[3]=s[15];s[7]=i;s[11]=n;s[15]=r;for(let e=0;e<16;e+=4){const t=s[e+0],a=s[e+1],n=s[e+2],i=s[e+3];r=t^a^n^i;s[e+0]^=r^this._mixCol[t^a];s[e+1]^=r^this._mixCol[a^n];s[e+2]^=r^this._mixCol[n^i];s[e+3]^=r^this._mixCol[i^t]}for(let a=0,r=16*e;a<16;++a,++r)s[a]^=t[r]}for(let e=0;e<16;++e)s[e]=a[s[e]];i=s[1];s[1]=s[5];s[5]=s[9];s[9]=s[13];s[13]=i;i=s[2];n=s[6];s[2]=s[10];s[6]=s[14];s[10]=i;s[14]=n;i=s[3];n=s[7];r=s[11];s[3]=s[15];s[7]=i;s[11]=n;s[15]=r;for(let e=0,a=this._keySize;e<16;++e,++a)s[e]^=t[a];return s}_decryptBlock2(e,t){const a=e.length;let r=this.buffer,n=this.bufferPosition;const i=[];let s=this.iv;for(let t=0;t<a;++t){r[n]=e[t];++n;if(n<16)continue;const a=this._decrypt(r,this._key);for(let e=0;e<16;++e)a[e]^=s[e];s=r;i.push(a);r=new Uint8Array(16);n=0}this.buffer=r;this.bufferLength=n;this.iv=s;if(0===i.length)return new Uint8Array(0);let o=16*i.length;if(t){const e=i.at(-1);let t=e[15];if(t<=16){for(let a=15,r=16-t;a>=r;--a)if(e[a]!==t){t=0;break}o-=t;i[i.length-1]=e.subarray(0,16-t)}}const c=new Uint8Array(o);for(let e=0,t=0,a=i.length;e<a;++e,t+=16)c.set(i[e],t);return c}decryptBlock(e,t,a=null){const r=e.length,n=this.buffer;let i=this.bufferPosition;if(a)this.iv=a;else{for(let t=0;i<16&&t<r;++t,++i)n[i]=e[t];if(i<16){this.bufferLength=i;return new Uint8Array(0)}this.iv=n;e=e.subarray(16)}this.buffer=new Uint8Array(16);this.bufferLength=0;this.decryptBlock=this._decryptBlock2;return this.decryptBlock(e,t)}encrypt(e,t){const a=e.length;let r=this.buffer,n=this.bufferPosition;const i=[];t||(t=new Uint8Array(16));for(let s=0;s<a;++s){r[n]=e[s];++n;if(n<16)continue;for(let e=0;e<16;++e)r[e]^=t[e];const a=this._encrypt(r,this._key);t=a;i.push(a);r=new Uint8Array(16);n=0}this.buffer=r;this.bufferLength=n;this.iv=t;if(0===i.length)return new Uint8Array(0);const s=16*i.length,o=new Uint8Array(s);for(let e=0,t=0,a=i.length;e<a;++e,t+=16)o.set(i[e],t);return o}}class AES128Cipher extends AESBaseCipher{constructor(e){super();this._cyclesOfRepetition=10;this._keySize=160;this._rcon=new Uint8Array([141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141]);this._key=this._expandKey(e)}_expandKey(e){const t=this._s,a=this._rcon,r=new Uint8Array(176);r.set(e);for(let e=16,n=1;e<176;++n){let i=r[e-3],s=r[e-2],o=r[e-1],c=r[e-4];i=t[i];s=t[s];o=t[o];c=t[c];i^=a[n];for(let t=0;t<4;++t){r[e]=i^=r[e-16];e++;r[e]=s^=r[e-16];e++;r[e]=o^=r[e-16];e++;r[e]=c^=r[e-16];e++}}return r}}t.AES128Cipher=AES128Cipher;class AES256Cipher extends AESBaseCipher{constructor(e){super();this._cyclesOfRepetition=14;this._keySize=224;this._key=this._expandKey(e)}_expandKey(e){const t=this._s,a=new Uint8Array(240);a.set(e);let r,n,i,s,o=1;for(let e=32,c=1;e<240;++c){if(e%32==16){r=t[r];n=t[n];i=t[i];s=t[s]}else if(e%32==0){r=a[e-3];n=a[e-2];i=a[e-1];s=a[e-4];r=t[r];n=t[n];i=t[i];s=t[s];r^=o;(o<<=1)>=256&&(o=255&(27^o))}for(let t=0;t<4;++t){a[e]=r^=a[e-32];e++;a[e]=n^=a[e-32];e++;a[e]=i^=a[e-32];e++;a[e]=s^=a[e-32];e++}}return a}}t.AES256Cipher=AES256Cipher;class PDF17{checkOwnerPassword(e,t,a,n){const i=new Uint8Array(e.length+56);i.set(e,0);i.set(t,e.length);i.set(a,e.length+t.length);const s=o(i,0,i.length);return(0,r.isArrayEqual)(s,n)}checkUserPassword(e,t,a){const n=new Uint8Array(e.length+8);n.set(e,0);n.set(t,e.length);const i=o(n,0,n.length);return(0,r.isArrayEqual)(i,a)}getOwnerKey(e,t,a,r){const n=new Uint8Array(e.length+56);n.set(e,0);n.set(t,e.length);n.set(a,e.length+t.length);const i=o(n,0,n.length);return new AES256Cipher(i).decryptBlock(r,!1,new Uint8Array(16))}getUserKey(e,t,a){const r=new Uint8Array(e.length+8);r.set(e,0);r.set(t,e.length);const n=o(r,0,r.length);return new AES256Cipher(n).decryptBlock(a,!1,new Uint8Array(16))}}t.PDF17=PDF17;const l=function PDF20Closure(){function calculatePDF20Hash(e,t,a){let r=o(t,0,t.length).subarray(0,32),n=[0],i=0;for(;i<64||n.at(-1)>i-32;){const t=e.length+r.length+a.length,s=new Uint8Array(t);let l=0;s.set(e,l);l+=e.length;s.set(r,l);l+=r.length;s.set(a,l);const h=new Uint8Array(64*t);for(let e=0,a=0;e<64;e++,a+=t)h.set(s,a);n=new AES128Cipher(r.subarray(0,16)).encrypt(h,r.subarray(16,32));const u=n.slice(0,16).reduce(((e,t)=>e+t),0)%3;0===u?r=o(n,0,n.length):1===u?r=calculateSHA384(n,0,n.length):2===u&&(r=c(n,0,n.length));i++}return r.subarray(0,32)}return class PDF20{hash(e,t,a){return calculatePDF20Hash(e,t,a)}checkOwnerPassword(e,t,a,n){const i=new Uint8Array(e.length+56);i.set(e,0);i.set(t,e.length);i.set(a,e.length+t.length);const s=calculatePDF20Hash(e,i,a);return(0,r.isArrayEqual)(s,n)}checkUserPassword(e,t,a){const n=new Uint8Array(e.length+8);n.set(e,0);n.set(t,e.length);const i=calculatePDF20Hash(e,n,[]);return(0,r.isArrayEqual)(i,a)}getOwnerKey(e,t,a,r){const n=new Uint8Array(e.length+56);n.set(e,0);n.set(t,e.length);n.set(a,e.length+t.length);const i=calculatePDF20Hash(e,n,a);return new AES256Cipher(i).decryptBlock(r,!1,new Uint8Array(16))}getUserKey(e,t,a){const r=new Uint8Array(e.length+8);r.set(e,0);r.set(t,e.length);const n=calculatePDF20Hash(e,r,[]);return new AES256Cipher(n).decryptBlock(a,!1,new Uint8Array(16))}}}();t.PDF20=l;class CipherTransform{constructor(e,t){this.StringCipherConstructor=e;this.StreamCipherConstructor=t}createStream(e,t){const a=new this.StreamCipherConstructor;return new i.DecryptStream(e,t,(function cipherTransformDecryptStream(e,t){return a.decryptBlock(e,t)}))}decryptString(e){const t=new this.StringCipherConstructor;let a=(0,r.stringToBytes)(e);a=t.decryptBlock(a,!0);return(0,r.bytesToString)(a)}encryptString(e){const t=new this.StringCipherConstructor;if(t instanceof AESBaseCipher){const a=16-e.length%16;e+=String.fromCharCode(a).repeat(a);const n=new Uint8Array(16);if("undefined"!=typeof crypto)crypto.getRandomValues(n);else for(let e=0;e<16;e++)n[e]=Math.floor(256*Math.random());let i=(0,r.stringToBytes)(e);i=t.encrypt(i,n);const s=new Uint8Array(16+i.length);s.set(n);s.set(i,16);return(0,r.bytesToString)(s)}let a=(0,r.stringToBytes)(e);a=t.encrypt(a);return(0,r.bytesToString)(a)}}const h=function CipherTransformFactoryClosure(){const e=new Uint8Array([40,191,78,94,78,117,138,65,100,0,78,86,255,250,1,8,46,46,0,182,208,104,62,128,47,12,169,254,100,83,105,122]);function prepareKeyData(t,a,r,n,i,o,c,l){const h=40+r.length+t.length,u=new Uint8Array(h);let d,f,g=0;if(a){f=Math.min(32,a.length);for(;g<f;++g)u[g]=a[g]}d=0;for(;g<32;)u[g++]=e[d++];for(d=0,f=r.length;d<f;++d)u[g++]=r[d];u[g++]=255&i;u[g++]=i>>8&255;u[g++]=i>>16&255;u[g++]=i>>>24&255;for(d=0,f=t.length;d<f;++d)u[g++]=t[d];if(o>=4&&!l){u[g++]=255;u[g++]=255;u[g++]=255;u[g++]=255}let p=s(u,0,g);const m=c>>3;if(o>=3)for(d=0;d<50;++d)p=s(p,0,m);const b=p.subarray(0,m);let y,w;if(o>=3){for(g=0;g<32;++g)u[g]=e[g];for(d=0,f=t.length;d<f;++d)u[g++]=t[d];y=new ARCFourCipher(b);w=y.encryptBlock(s(u,0,g));f=b.length;const a=new Uint8Array(f);for(d=1;d<=19;++d){for(let e=0;e<f;++e)a[e]=b[e]^d;y=new ARCFourCipher(a);w=y.encryptBlock(w)}for(d=0,f=w.length;d<f;++d)if(n[d]!==w[d])return null}else{y=new ARCFourCipher(b);w=y.encryptBlock(e);for(d=0,f=w.length;d<f;++d)if(n[d]!==w[d])return null}return b}const t=n.Name.get("Identity");function buildObjectKey(e,t,a,r=!1){const n=new Uint8Array(a.length+9),i=a.length;let o;for(o=0;o<i;++o)n[o]=a[o];n[o++]=255&e;n[o++]=e>>8&255;n[o++]=e>>16&255;n[o++]=255&t;n[o++]=t>>8&255;if(r){n[o++]=115;n[o++]=65;n[o++]=108;n[o++]=84}return s(n,0,o).subarray(0,Math.min(a.length+5,16))}function buildCipherConstructor(e,t,a,i,s){if(!(t instanceof n.Name))throw new r.FormatError("Invalid crypt filter name.");const o=e.get(t.name);let c;null!=o&&(c=o.get("CFM"));if(!c||"None"===c.name)return function cipherTransformFactoryBuildCipherConstructorNone(){return new NullCipher};if("V2"===c.name)return function cipherTransformFactoryBuildCipherConstructorV2(){return new ARCFourCipher(buildObjectKey(a,i,s,!1))};if("AESV2"===c.name)return function cipherTransformFactoryBuildCipherConstructorAESV2(){return new AES128Cipher(buildObjectKey(a,i,s,!0))};if("AESV3"===c.name)return function cipherTransformFactoryBuildCipherConstructorAESV3(){return new AES256Cipher(s)};throw new r.FormatError("Unknown crypto method")}return class CipherTransformFactory{constructor(a,i,o){const c=a.get("Filter");if(!(0,n.isName)(c,"Standard"))throw new r.FormatError("unknown encryption method");this.filterName=c.name;this.dict=a;const h=a.get("V");if(!Number.isInteger(h)||1!==h&&2!==h&&4!==h&&5!==h)throw new r.FormatError("unsupported encryption algorithm");this.algorithm=h;let u=a.get("Length");if(!u)if(h<=3)u=40;else{const e=a.get("CF"),t=a.get("StmF");if(e instanceof n.Dict&&t instanceof n.Name){e.suppressEncryption=!0;const a=e.get(t.name);u=a&&a.get("Length")||128;u<40&&(u<<=3)}}if(!Number.isInteger(u)||u<40||u%8!=0)throw new r.FormatError("invalid key length");const d=(0,r.stringToBytes)(a.get("O")).subarray(0,32),f=(0,r.stringToBytes)(a.get("U")).subarray(0,32),g=a.get("P"),p=a.get("R"),m=(4===h||5===h)&&!1!==a.get("EncryptMetadata");this.encryptMetadata=m;const b=(0,r.stringToBytes)(i);let y,w;if(o){if(6===p)try{o=(0,r.utf8StringToString)(o)}catch(e){(0,r.warn)("CipherTransformFactory: Unable to convert UTF8 encoded password.")}y=(0,r.stringToBytes)(o)}if(5!==h)w=prepareKeyData(b,y,d,f,g,p,u,m);else{const e=(0,r.stringToBytes)(a.get("O")).subarray(32,40),t=(0,r.stringToBytes)(a.get("O")).subarray(40,48),n=(0,r.stringToBytes)(a.get("U")).subarray(0,48),i=(0,r.stringToBytes)(a.get("U")).subarray(32,40),s=(0,r.stringToBytes)(a.get("U")).subarray(40,48),o=(0,r.stringToBytes)(a.get("OE")),c=(0,r.stringToBytes)(a.get("UE"));(0,r.stringToBytes)(a.get("Perms"));w=function createEncryptionKey20(e,t,a,r,n,i,s,o,c,h,u,d){if(t){const e=Math.min(127,t.length);t=t.subarray(0,e)}else t=[];let f;f=6===e?new l:new PDF17;return f.checkUserPassword(t,o,s)?f.getUserKey(t,c,u):t.length&&f.checkOwnerPassword(t,r,i,a)?f.getOwnerKey(t,n,i,h):null}(p,y,d,e,t,n,f,i,s,o,c)}if(!w&&!o)throw new r.PasswordException("No password given",r.PasswordResponses.NEED_PASSWORD);if(!w&&o){const t=function decodeUserPassword(t,a,r,n){const i=new Uint8Array(32);let o=0;const c=Math.min(32,t.length);for(;o<c;++o)i[o]=t[o];let l=0;for(;o<32;)i[o++]=e[l++];let h=s(i,0,o);const u=n>>3;if(r>=3)for(l=0;l<50;++l)h=s(h,0,h.length);let d,f;if(r>=3){f=a;const e=new Uint8Array(u);for(l=19;l>=0;l--){for(let t=0;t<u;++t)e[t]=h[t]^l;d=new ARCFourCipher(e);f=d.encryptBlock(f)}}else{d=new ARCFourCipher(h.subarray(0,u));f=d.encryptBlock(a)}return f}(y,d,p,u);w=prepareKeyData(b,t,d,f,g,p,u,m)}if(!w)throw new r.PasswordException("Incorrect Password",r.PasswordResponses.INCORRECT_PASSWORD);this.encryptionKey=w;if(h>=4){const e=a.get("CF");e instanceof n.Dict&&(e.suppressEncryption=!0);this.cf=e;this.stmf=a.get("StmF")||t;this.strf=a.get("StrF")||t;this.eff=a.get("EFF")||this.stmf}}createCipherTransform(e,t){if(4===this.algorithm||5===this.algorithm)return new CipherTransform(buildCipherConstructor(this.cf,this.strf,e,t,this.encryptionKey),buildCipherConstructor(this.cf,this.stmf,e,t,this.encryptionKey));const a=buildObjectKey(e,t,this.encryptionKey,!1),r=function buildCipherCipherConstructor(){return new ARCFourCipher(a)};return new CipherTransform(r,r)}}}();t.CipherTransformFactory=h},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.DecryptStream=void 0;var r=a(17);class DecryptStream extends r.DecodeStream{constructor(e,t,a){super(t);this.str=e;this.dict=e.dict;this.decrypt=a;this.nextChunk=null;this.initialized=!1}readBlock(){let e;if(this.initialized)e=this.nextChunk;else{e=this.str.getBytes(512);this.initialized=!0}if(!e||0===e.length){this.eof=!0;return}this.nextChunk=this.str.getBytes(512);const t=this.nextChunk&&this.nextChunk.length>0;e=(0,this.decrypt)(e,!t);const a=this.bufferLength,r=a+e.length;this.ensureBuffer(r).set(e,a);this.bufferLength=r}}t.DecryptStream=DecryptStream},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.Catalog=void 0;var r=a(3),n=a(2),i=a(4),s=a(68),o=a(5),c=a(69),l=a(12),h=a(70),u=a(57),d=a(71),f=a(72);function fetchDestination(e){e instanceof i.Dict&&(e=e.get("D"));return Array.isArray(e)?e:null}class Catalog{constructor(e,t){this.pdfManager=e;this.xref=t;this._catDict=t.getCatalogObj();if(!(this._catDict instanceof i.Dict))throw new n.FormatError("Catalog object is not a dictionary.");this.toplevelPagesDict;this._actualNumPages=null;this.fontCache=new i.RefSetCache;this.builtInCMapCache=new Map;this.standardFontDataCache=new Map;this.globalImageCache=new u.GlobalImageCache;this.pageKidsCountCache=new i.RefSetCache;this.pageIndexCache=new i.RefSetCache;this.nonBlendModesSet=new i.RefSet}get version(){const e=this._catDict.get("Version");if(e instanceof i.Name){if(r.PDF_VERSION_REGEXP.test(e.name))return(0,n.shadow)(this,"version",e.name);(0,n.warn)(`Invalid PDF catalog version: ${e.name}`)}return(0,n.shadow)(this,"version",null)}get lang(){const e=this._catDict.get("Lang");return(0,n.shadow)(this,"lang","string"==typeof e?(0,n.stringToPDFString)(e):null)}get needsRendering(){const e=this._catDict.get("NeedsRendering");return(0,n.shadow)(this,"needsRendering","boolean"==typeof e&&e)}get collection(){let e=null;try{const t=this._catDict.get("Collection");t instanceof i.Dict&&t.size>0&&(e=t)}catch(e){if(e instanceof r.MissingDataException)throw e;(0,n.info)("Cannot fetch Collection entry; assuming no collection is present.")}return(0,n.shadow)(this,"collection",e)}get acroForm(){let e=null;try{const t=this._catDict.get("AcroForm");t instanceof i.Dict&&t.size>0&&(e=t)}catch(e){if(e instanceof r.MissingDataException)throw e;(0,n.info)("Cannot fetch AcroForm entry; assuming no forms are present.")}return(0,n.shadow)(this,"acroForm",e)}get acroFormRef(){const e=this._catDict.getRaw("AcroForm");return(0,n.shadow)(this,"acroFormRef",e instanceof i.Ref?e:null)}get metadata(){const e=this._catDict.getRaw("Metadata");if(!(e instanceof i.Ref))return(0,n.shadow)(this,"metadata",null);let t=null;try{const a=!(this.xref.encrypt&&this.xref.encrypt.encryptMetadata),r=this.xref.fetch(e,a);if(r instanceof o.BaseStream&&r.dict instanceof i.Dict){const e=r.dict.get("Type"),a=r.dict.get("Subtype");if((0,i.isName)(e,"Metadata")&&(0,i.isName)(a,"XML")){const e=(0,n.stringToUTF8String)(r.getString());e&&(t=new d.MetadataParser(e).serializable)}}}catch(e){if(e instanceof r.MissingDataException)throw e;(0,n.info)(`Skipping invalid Metadata: "${e}".`)}return(0,n.shadow)(this,"metadata",t)}get markInfo(){let e=null;try{e=this._readMarkInfo()}catch(e){if(e instanceof r.MissingDataException)throw e;(0,n.warn)("Unable to read mark info.")}return(0,n.shadow)(this,"markInfo",e)}_readMarkInfo(){const e=this._catDict.get("MarkInfo");if(!(e instanceof i.Dict))return null;const t={Marked:!1,UserProperties:!1,Suspects:!1};for(const a in t){const r=e.get(a);"boolean"==typeof r&&(t[a]=r)}return t}get structTreeRoot(){let e=null;try{e=this._readStructTreeRoot()}catch(e){if(e instanceof r.MissingDataException)throw e;(0,n.warn)("Unable read to structTreeRoot info.")}return(0,n.shadow)(this,"structTreeRoot",e)}_readStructTreeRoot(){const e=this._catDict.get("StructTreeRoot");if(!(e instanceof i.Dict))return null;const t=new f.StructTreeRoot(e);t.init();return t}get toplevelPagesDict(){const e=this._catDict.get("Pages");if(!(e instanceof i.Dict))throw new n.FormatError("Invalid top-level pages dictionary.");return(0,n.shadow)(this,"toplevelPagesDict",e)}get documentOutline(){let e=null;try{e=this._readDocumentOutline()}catch(e){if(e instanceof r.MissingDataException)throw e;(0,n.warn)("Unable to read document outline.")}return(0,n.shadow)(this,"documentOutline",e)}_readDocumentOutline(){let e=this._catDict.get("Outlines");if(!(e instanceof i.Dict))return null;e=e.getRaw("First");if(!(e instanceof i.Ref))return null;const t={items:[]},a=[{obj:e,parent:t}],r=new i.RefSet;r.put(e);const s=this.xref,o=new Uint8ClampedArray(3);for(;a.length>0;){const t=a.shift(),c=s.fetchIfRef(t.obj);if(null===c)continue;if(!c.has("Title"))throw new n.FormatError("Invalid outline item encountered.");const h={url:null,dest:null,action:null};Catalog.parseDestDictionary({destDict:c,resultObj:h,docBaseUrl:this.pdfManager.docBaseUrl,docAttachments:this.attachments});const u=c.get("Title"),d=c.get("F")||0,f=c.getArray("C"),g=c.get("Count");let p=o;!Array.isArray(f)||3!==f.length||0===f[0]&&0===f[1]&&0===f[2]||(p=l.ColorSpace.singletons.rgb.getRgb(f,0));const m={action:h.action,attachment:h.attachment,dest:h.dest,url:h.url,unsafeUrl:h.unsafeUrl,newWindow:h.newWindow,setOCGState:h.setOCGState,title:(0,n.stringToPDFString)(u),color:p,count:Number.isInteger(g)?g:void 0,bold:!!(2&d),italic:!!(1&d),items:[]};t.parent.items.push(m);e=c.getRaw("First");if(e instanceof i.Ref&&!r.has(e)){a.push({obj:e,parent:m});r.put(e)}e=c.getRaw("Next");if(e instanceof i.Ref&&!r.has(e)){a.push({obj:e,parent:t.parent});r.put(e)}}return t.items.length>0?t.items:null}get permissions(){let e=null;try{e=this._readPermissions()}catch(e){if(e instanceof r.MissingDataException)throw e;(0,n.warn)("Unable to read permissions.")}return(0,n.shadow)(this,"permissions",e)}_readPermissions(){const e=this.xref.trailer.get("Encrypt");if(!(e instanceof i.Dict))return null;let t=e.get("P");if("number"!=typeof t)return null;t+=2**32;const a=[];for(const e in n.PermissionFlag){const r=n.PermissionFlag[e];t&r&&a.push(r)}return a}get optionalContentConfig(){let e=null;try{const t=this._catDict.get("OCProperties");if(!t)return(0,n.shadow)(this,"optionalContentConfig",null);const a=t.get("D");if(!a)return(0,n.shadow)(this,"optionalContentConfig",null);const r=t.get("OCGs");if(!Array.isArray(r))return(0,n.shadow)(this,"optionalContentConfig",null);const s=[],o=[];for(const e of r){if(!(e instanceof i.Ref))continue;o.push(e);const t=this.xref.fetchIfRef(e);s.push({id:e.toString(),name:"string"==typeof t.get("Name")?(0,n.stringToPDFString)(t.get("Name")):null,intent:"string"==typeof t.get("Intent")?(0,n.stringToPDFString)(t.get("Intent")):null})}e=this._readOptionalContentConfig(a,o);e.groups=s}catch(e){if(e instanceof r.MissingDataException)throw e;(0,n.warn)(`Unable to read optional content config: ${e}`)}return(0,n.shadow)(this,"optionalContentConfig",e)}_readOptionalContentConfig(e,t){function parseOnOff(e){const a=[];if(Array.isArray(e))for(const r of e)r instanceof i.Ref&&t.includes(r)&&a.push(r.toString());return a}function parseOrder(e,a=0){if(!Array.isArray(e))return null;const n=[];for(const s of e){if(s instanceof i.Ref&&t.includes(s)){r.put(s);n.push(s.toString());continue}const e=parseNestedOrder(s,a);e&&n.push(e)}if(a>0)return n;const s=[];for(const e of t)r.has(e)||s.push(e.toString());s.length&&n.push({name:null,order:s});return n}function parseNestedOrder(e,t){if(++t>s){(0,n.warn)("parseNestedOrder - reached MAX_NESTED_LEVELS.");return null}const r=a.fetchIfRef(e);if(!Array.isArray(r))return null;const i=a.fetchIfRef(r[0]);if("string"!=typeof i)return null;const o=parseOrder(r.slice(1),t);return o&&o.length?{name:(0,n.stringToPDFString)(i),order:o}:null}const a=this.xref,r=new i.RefSet,s=10;return{name:"string"==typeof e.get("Name")?(0,n.stringToPDFString)(e.get("Name")):null,creator:"string"==typeof e.get("Creator")?(0,n.stringToPDFString)(e.get("Creator")):null,baseState:e.get("BaseState")instanceof i.Name?e.get("BaseState").name:null,on:parseOnOff(e.get("ON")),off:parseOnOff(e.get("OFF")),order:parseOrder(e.get("Order")),groups:null}}setActualNumPages(e=null){this._actualNumPages=e}get hasActualNumPages(){return null!==this._actualNumPages}get _pagesCount(){const e=this.toplevelPagesDict.get("Count");if(!Number.isInteger(e))throw new n.FormatError("Page count in top-level pages dictionary is not an integer.");return(0,n.shadow)(this,"_pagesCount",e)}get numPages(){return this.hasActualNumPages?this._actualNumPages:this._pagesCount}get destinations(){const e=this._readDests(),t=Object.create(null);if(e instanceof s.NameTree)for(const[a,r]of e.getAll()){const e=fetchDestination(r);e&&(t[(0,n.stringToPDFString)(a)]=e)}else e instanceof i.Dict&&e.forEach((function(e,a){const r=fetchDestination(a);r&&(t[e]=r)}));return(0,n.shadow)(this,"destinations",t)}getDestination(e){const t=this._readDests();if(t instanceof s.NameTree){const a=fetchDestination(t.get(e));if(a)return a;const r=this.destinations[e];if(r){(0,n.warn)(`Found "${e}" at an incorrect position in the NameTree.`);return r}}else if(t instanceof i.Dict){const a=fetchDestination(t.get(e));if(a)return a}return null}_readDests(){const e=this._catDict.get("Names");return e&&e.has("Dests")?new s.NameTree(e.getRaw("Dests"),this.xref):this._catDict.has("Dests")?this._catDict.get("Dests"):void 0}get pageLabels(){let e=null;try{e=this._readPageLabels()}catch(e){if(e instanceof r.MissingDataException)throw e;(0,n.warn)("Unable to read page labels.")}return(0,n.shadow)(this,"pageLabels",e)}_readPageLabels(){const e=this._catDict.getRaw("PageLabels");if(!e)return null;const t=new Array(this.numPages);let a=null,o="";const c=new s.NumberTree(e,this.xref).getAll();let l="",h=1;for(let e=0,s=this.numPages;e<s;e++){const s=c.get(e);if(void 0!==s){if(!(s instanceof i.Dict))throw new n.FormatError("PageLabel is not a dictionary.");if(s.has("Type")&&!(0,i.isName)(s.get("Type"),"PageLabel"))throw new n.FormatError("Invalid type in PageLabel dictionary.");if(s.has("S")){const e=s.get("S");if(!(e instanceof i.Name))throw new n.FormatError("Invalid style in PageLabel dictionary.");a=e.name}else a=null;if(s.has("P")){const e=s.get("P");if("string"!=typeof e)throw new n.FormatError("Invalid prefix in PageLabel dictionary.");o=(0,n.stringToPDFString)(e)}else o="";if(s.has("St")){const e=s.get("St");if(!(Number.isInteger(e)&&e>=1))throw new n.FormatError("Invalid start in PageLabel dictionary.");h=e}else h=1}switch(a){case"D":l=h;break;case"R":case"r":l=(0,r.toRomanNumerals)(h,"r"===a);break;case"A":case"a":const e=26,t="a"===a?97:65,i=h-1;l=String.fromCharCode(t+i%e).repeat(Math.floor(i/e)+1);break;default:if(a)throw new n.FormatError(`Invalid style "${a}" in PageLabel dictionary.`);l=""}t[e]=o+l;h++}return t}get pageLayout(){const e=this._catDict.get("PageLayout");let t="";if(e instanceof i.Name)switch(e.name){case"SinglePage":case"OneColumn":case"TwoColumnLeft":case"TwoColumnRight":case"TwoPageLeft":case"TwoPageRight":t=e.name}return(0,n.shadow)(this,"pageLayout",t)}get pageMode(){const e=this._catDict.get("PageMode");let t="UseNone";if(e instanceof i.Name)switch(e.name){case"UseNone":case"UseOutlines":case"UseThumbs":case"FullScreen":case"UseOC":case"UseAttachments":t=e.name}return(0,n.shadow)(this,"pageMode",t)}get viewerPreferences(){const e=this._catDict.get("ViewerPreferences");if(!(e instanceof i.Dict))return(0,n.shadow)(this,"viewerPreferences",null);let t=null;for(const a of e.getKeys()){const r=e.get(a);let s;switch(a){case"HideToolbar":case"HideMenubar":case"HideWindowUI":case"FitWindow":case"CenterWindow":case"DisplayDocTitle":case"PickTrayByPDFSize":"boolean"==typeof r&&(s=r);break;case"NonFullScreenPageMode":if(r instanceof i.Name)switch(r.name){case"UseNone":case"UseOutlines":case"UseThumbs":case"UseOC":s=r.name;break;default:s="UseNone"}break;case"Direction":if(r instanceof i.Name)switch(r.name){case"L2R":case"R2L":s=r.name;break;default:s="L2R"}break;case"ViewArea":case"ViewClip":case"PrintArea":case"PrintClip":if(r instanceof i.Name)switch(r.name){case"MediaBox":case"CropBox":case"BleedBox":case"TrimBox":case"ArtBox":s=r.name;break;default:s="CropBox"}break;case"PrintScaling":if(r instanceof i.Name)switch(r.name){case"None":case"AppDefault":s=r.name;break;default:s="AppDefault"}break;case"Duplex":if(r instanceof i.Name)switch(r.name){case"Simplex":case"DuplexFlipShortEdge":case"DuplexFlipLongEdge":s=r.name;break;default:s="None"}break;case"PrintPageRange":if(Array.isArray(r)&&r.length%2==0){r.every(((e,t,a)=>Number.isInteger(e)&&e>0&&(0===t||e>=a[t-1])&&e<=this.numPages))&&(s=r)}break;case"NumCopies":Number.isInteger(r)&&r>0&&(s=r);break;default:(0,n.warn)(`Ignoring non-standard key in ViewerPreferences: ${a}.`);continue}if(void 0!==s){t||(t=Object.create(null));t[a]=s}else(0,n.warn)(`Bad value, for key "${a}", in ViewerPreferences: ${r}.`)}return(0,n.shadow)(this,"viewerPreferences",t)}get openAction(){const e=this._catDict.get("OpenAction"),t=Object.create(null);if(e instanceof i.Dict){const a=new i.Dict(this.xref);a.set("A",e);const r={url:null,dest:null,action:null};Catalog.parseDestDictionary({destDict:a,resultObj:r});Array.isArray(r.dest)?t.dest=r.dest:r.action&&(t.action=r.action)}else Array.isArray(e)&&(t.dest=e);return(0,n.shadow)(this,"openAction",(0,n.objectSize)(t)>0?t:null)}get attachments(){const e=this._catDict.get("Names");let t=null;if(e instanceof i.Dict&&e.has("EmbeddedFiles")){const a=new s.NameTree(e.getRaw("EmbeddedFiles"),this.xref);for(const[e,r]of a.getAll()){const a=new h.FileSpec(r,this.xref);t||(t=Object.create(null));t[(0,n.stringToPDFString)(e)]=a.serializable}}return(0,n.shadow)(this,"attachments",t)}get xfaImages(){const e=this._catDict.get("Names");let t=null;if(e instanceof i.Dict&&e.has("XFAImages")){const a=new s.NameTree(e.getRaw("XFAImages"),this.xref);for(const[e,r]of a.getAll()){t||(t=new i.Dict(this.xref));t.set((0,n.stringToPDFString)(e),r)}}return(0,n.shadow)(this,"xfaImages",t)}_collectJavaScript(){const e=this._catDict.get("Names");let t=null;function appendIfJavaScriptDict(e,a){if(!(a instanceof i.Dict))return;if(!(0,i.isName)(a.get("S"),"JavaScript"))return;let r=a.get("JS");if(r instanceof o.BaseStream)r=r.getString();else if("string"!=typeof r)return;null===t&&(t=new Map);r=(0,n.stringToPDFString)(r).replace(/\u0000/g,"");t.set(e,r)}if(e instanceof i.Dict&&e.has("JavaScript")){const t=new s.NameTree(e.getRaw("JavaScript"),this.xref);for(const[e,a]of t.getAll())appendIfJavaScriptDict((0,n.stringToPDFString)(e),a)}const a=this._catDict.get("OpenAction");a&&appendIfJavaScriptDict("OpenAction",a);return t}get javaScript(){const e=this._collectJavaScript();return(0,n.shadow)(this,"javaScript",e?[...e.values()]:null)}get jsActions(){const e=this._collectJavaScript();let t=(0,r.collectActions)(this.xref,this._catDict,n.DocumentActionEventType);if(e){t||(t=Object.create(null));for(const[a,r]of e)a in t?t[a].push(r):t[a]=[r]}return(0,n.shadow)(this,"jsActions",t)}async fontFallback(e,t){const a=await Promise.all(this.fontCache);for(const r of a)if(r.loadedName===e){r.fallback(t);return}}async cleanup(e=!1){(0,c.clearGlobalCaches)();this.globalImageCache.clear(e);this.pageKidsCountCache.clear();this.pageIndexCache.clear();this.nonBlendModesSet.clear();const t=await Promise.all(this.fontCache);for(const{dict:e}of t)delete e.cacheKey;this.fontCache.clear();this.builtInCMapCache.clear();this.standardFontDataCache.clear()}async getPageDict(e){const t=[this.toplevelPagesDict],a=new i.RefSet,r=this._catDict.getRaw("Pages");r instanceof i.Ref&&a.put(r);const s=this.xref,o=this.pageKidsCountCache,c=this.pageIndexCache;let l=0;for(;t.length;){const r=t.pop();if(r instanceof i.Ref){const h=o.get(r);if(h>=0&&l+h<=e){l+=h;continue}if(a.has(r))throw new n.FormatError("Pages tree contains circular reference.");a.put(r);const u=await s.fetchAsync(r);if(u instanceof i.Dict){let t=u.getRaw("Type");t instanceof i.Ref&&(t=await s.fetchAsync(t));if((0,i.isName)(t,"Page")||!u.has("Kids")){o.has(r)||o.put(r,1);c.has(r)||c.put(r,l);if(l===e)return[u,r];l++;continue}}t.push(u);continue}if(!(r instanceof i.Dict))throw new n.FormatError("Page dictionary kid reference points to wrong type of object.");const{objId:h}=r;let u=r.getRaw("Count");u instanceof i.Ref&&(u=await s.fetchAsync(u));if(Number.isInteger(u)&&u>=0){h&&!o.has(h)&&o.put(h,u);if(l+u<=e){l+=u;continue}}let d=r.getRaw("Kids");d instanceof i.Ref&&(d=await s.fetchAsync(d));if(!Array.isArray(d)){let t=r.getRaw("Type");t instanceof i.Ref&&(t=await s.fetchAsync(t));if((0,i.isName)(t,"Page")||!r.has("Kids")){if(l===e)return[r,null];l++;continue}throw new n.FormatError("Page dictionary kids object is not an array.")}for(let e=d.length-1;e>=0;e--)t.push(d[e])}throw new Error(`Page index ${e} not found.`)}async getAllPageDicts(e=!1){const{ignoreErrors:t}=this.pdfManager.evaluatorOptions,a=[{currentNode:this.toplevelPagesDict,posInKids:0}],s=new i.RefSet,o=this._catDict.getRaw("Pages");o instanceof i.Ref&&s.put(o);const c=new Map,l=this.xref,h=this.pageIndexCache;let u=0;function addPageDict(e,t){t&&!h.has(t)&&h.put(t,u);c.set(u++,[e,t])}function addPageError(a){if(a instanceof r.XRefEntryException&&!e)throw a;if(e&&t&&0===u){(0,n.warn)(`getAllPageDicts - Skipping invalid first page: "${a}".`);a=i.Dict.empty}c.set(u++,[a,null])}for(;a.length>0;){const e=a.at(-1),{currentNode:t,posInKids:r}=e;let o=t.getRaw("Kids");if(o instanceof i.Ref)try{o=await l.fetchAsync(o)}catch(e){addPageError(e);break}if(!Array.isArray(o)){addPageError(new n.FormatError("Page dictionary kids object is not an array."));break}if(r>=o.length){a.pop();continue}const c=o[r];let h;if(c instanceof i.Ref){if(s.has(c)){addPageError(new n.FormatError("Pages tree contains circular reference."));break}s.put(c);try{h=await l.fetchAsync(c)}catch(e){addPageError(e);break}}else h=c;if(!(h instanceof i.Dict)){addPageError(new n.FormatError("Page dictionary kid reference points to wrong type of object."));break}let u=h.getRaw("Type");if(u instanceof i.Ref)try{u=await l.fetchAsync(u)}catch(e){addPageError(e);break}(0,i.isName)(u,"Page")||!h.has("Kids")?addPageDict(h,c instanceof i.Ref?c:null):a.push({currentNode:h,posInKids:0});e.posInKids++}return c}getPageIndex(e){const t=this.pageIndexCache.get(e);if(void 0!==t)return Promise.resolve(t);const a=this.xref;let r=0;const next=t=>function pagesBeforeRef(t){let r,s=0;return a.fetchAsync(t).then((function(a){if((0,i.isRefsEqual)(t,e)&&!(0,i.isDict)(a,"Page")&&!(a instanceof i.Dict&&!a.has("Type")&&a.has("Contents")))throw new n.FormatError("The reference does not point to a /Page dictionary.");if(!a)return null;if(!(a instanceof i.Dict))throw new n.FormatError("Node must be a dictionary.");r=a.getRaw("Parent");return a.getAsync("Parent")})).then((function(e){if(!e)return null;if(!(e instanceof i.Dict))throw new n.FormatError("Parent must be a dictionary.");return e.getAsync("Kids")})).then((function(e){if(!e)return null;const o=[];let c=!1;for(const r of e){if(!(r instanceof i.Ref))throw new n.FormatError("Kid must be a reference.");if((0,i.isRefsEqual)(r,t)){c=!0;break}o.push(a.fetchAsync(r).then((function(e){if(!(e instanceof i.Dict))throw new n.FormatError("Kid node must be a dictionary.");e.has("Count")?s+=e.get("Count"):s++})))}if(!c)throw new n.FormatError("Kid reference not found in parent's kids.");return Promise.all(o).then((function(){return[s,r]}))}))}(t).then((t=>{if(!t){this.pageIndexCache.put(e,r);return r}const[a,n]=t;r+=a;return next(n)}));return next(e)}get baseUrl(){const e=this._catDict.get("URI");if(e instanceof i.Dict){const t=e.get("Base");if("string"==typeof t){const e=(0,n.createValidAbsoluteUrl)(t,null,{tryConvertEncoding:!0});if(e)return(0,n.shadow)(this,"baseUrl",e.href)}}return(0,n.shadow)(this,"baseUrl",null)}static parseDestDictionary(e){const t=e.destDict;if(!(t instanceof i.Dict)){(0,n.warn)("parseDestDictionary: `destDict` must be a dictionary.");return}const a=e.resultObj;if("object"!=typeof a){(0,n.warn)("parseDestDictionary: `resultObj` must be an object.");return}const s=e.docBaseUrl||null,c=e.docAttachments||null;let l,h,u=t.get("A");if(!(u instanceof i.Dict))if(t.has("Dest"))u=t.get("Dest");else{u=t.get("AA");u instanceof i.Dict&&(u.has("D")?u=u.get("D"):u.has("U")&&(u=u.get("U")))}if(u instanceof i.Dict){const e=u.get("S");if(!(e instanceof i.Name)){(0,n.warn)("parseDestDictionary: Invalid type in Action dictionary.");return}const t=e.name;switch(t){case"ResetForm":const e=u.get("Flags"),s=0==(1&("number"==typeof e?e:0)),d=[],f=[];for(const e of u.get("Fields")||[])e instanceof i.Ref?f.push(e.toString()):"string"==typeof e&&d.push((0,n.stringToPDFString)(e));a.resetForm={fields:d,refs:f,include:s};break;case"URI":l=u.get("URI");l instanceof i.Name&&(l="/"+l.name);break;case"GoTo":h=u.get("D");break;case"Launch":case"GoToR":const g=u.get("F");g instanceof i.Dict?l=g.get("F")||null:"string"==typeof g&&(l=g);let p=u.get("D");if(p){p instanceof i.Name&&(p=p.name);if("string"==typeof l){const e=l.split("#")[0];"string"==typeof p?l=e+"#"+p:Array.isArray(p)&&(l=e+"#"+JSON.stringify(p))}}const m=u.get("NewWindow");"boolean"==typeof m&&(a.newWindow=m);break;case"GoToE":const b=u.get("T");let y;if(c&&b instanceof i.Dict){const e=b.get("R"),t=b.get("N");(0,i.isName)(e,"C")&&"string"==typeof t&&(y=c[(0,n.stringToPDFString)(t)])}y?a.attachment=y:(0,n.warn)('parseDestDictionary - unimplemented "GoToE" action.');break;case"Named":const w=u.get("N");w instanceof i.Name&&(a.action=w.name);break;case"SetOCGState":const S=u.get("State"),x=u.get("PreserveRB");if(!Array.isArray(S)||0===S.length)break;const C=[];for(const e of S)if(e instanceof i.Name)switch(e.name){case"ON":case"OFF":case"Toggle":C.push(e.name)}else e instanceof i.Ref&&C.push(e.toString());if(C.length!==S.length)break;a.setOCGState={state:C,preserveRB:"boolean"!=typeof x||x};break;case"JavaScript":const k=u.get("JS");let v;k instanceof o.BaseStream?v=k.getString():"string"==typeof k&&(v=k);const F=v&&(0,r.recoverJsURL)((0,n.stringToPDFString)(v));if(F){l=F.url;a.newWindow=F.newWindow;break}default:if("JavaScript"===t||"SubmitForm"===t)break;(0,n.warn)(`parseDestDictionary - unsupported action: "${t}".`)}}else t.has("Dest")&&(h=t.get("Dest"));if("string"==typeof l){const e=(0,n.createValidAbsoluteUrl)(l,s,{addDefaultProtocol:!0,tryConvertEncoding:!0});e&&(a.url=e.href);a.unsafeUrl=l}if(h){h instanceof i.Name&&(h=h.name);"string"==typeof h?a.dest=(0,n.stringToPDFString)(h):Array.isArray(h)&&(a.dest=h)}}}t.Catalog=Catalog},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.NumberTree=t.NameTree=void 0;var r=a(4),n=a(2);class NameOrNumberTree{constructor(e,t,a){this.constructor===NameOrNumberTree&&(0,n.unreachable)("Cannot initialize NameOrNumberTree.");this.root=e;this.xref=t;this._type=a}getAll(){const e=new Map;if(!this.root)return e;const t=this.xref,a=new r.RefSet;a.put(this.root);const i=[this.root];for(;i.length>0;){const s=t.fetchIfRef(i.shift());if(!(s instanceof r.Dict))continue;if(s.has("Kids")){const e=s.get("Kids");if(!Array.isArray(e))continue;for(const t of e){if(a.has(t))throw new n.FormatError(`Duplicate entry in "${this._type}" tree.`);i.push(t);a.put(t)}continue}const o=s.get(this._type);if(Array.isArray(o))for(let a=0,r=o.length;a<r;a+=2)e.set(t.fetchIfRef(o[a]),t.fetchIfRef(o[a+1]))}return e}get(e){if(!this.root)return null;const t=this.xref;let a=t.fetchIfRef(this.root),r=0;for(;a.has("Kids");){if(++r>10){(0,n.warn)(`Search depth limit reached for "${this._type}" tree.`);return null}const i=a.get("Kids");if(!Array.isArray(i))return null;let s=0,o=i.length-1;for(;s<=o;){const r=s+o>>1,n=t.fetchIfRef(i[r]),c=n.get("Limits");if(e<t.fetchIfRef(c[0]))o=r-1;else{if(!(e>t.fetchIfRef(c[1]))){a=n;break}s=r+1}}if(s>o)return null}const i=a.get(this._type);if(Array.isArray(i)){let a=0,r=i.length-2;for(;a<=r;){const n=a+r>>1,s=n+(1&n),o=t.fetchIfRef(i[s]);if(e<o)r=s-2;else{if(!(e>o))return t.fetchIfRef(i[s+1]);a=s+2}}}return null}}t.NameTree=class NameTree extends NameOrNumberTree{constructor(e,t){super(e,t,"Names")}};t.NumberTree=class NumberTree extends NameOrNumberTree{constructor(e,t){super(e,t,"Nums")}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.clearGlobalCaches=function clearGlobalCaches(){(0,r.clearPrimitiveCaches)();(0,n.clearUnicodeCaches)()};var r=a(4),n=a(38)},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.FileSpec=void 0;var r=a(2),n=a(5),i=a(4);function pickPlatformItem(e){return e.has("UF")?e.get("UF"):e.has("F")?e.get("F"):e.has("Unix")?e.get("Unix"):e.has("Mac")?e.get("Mac"):e.has("DOS")?e.get("DOS"):null}t.FileSpec=class FileSpec{constructor(e,t){if(e instanceof i.Dict){this.xref=t;this.root=e;e.has("FS")&&(this.fs=e.get("FS"));this.description=e.has("Desc")?(0,r.stringToPDFString)(e.get("Desc")):"";e.has("RF")&&(0,r.warn)("Related file specifications are not supported");this.contentAvailable=!0;if(!e.has("EF")){this.contentAvailable=!1;(0,r.warn)("Non-embedded file specifications are not supported")}}}get filename(){if(!this._filename&&this.root){const e=pickPlatformItem(this.root)||"unnamed";this._filename=(0,r.stringToPDFString)(e).replace(/\\\\/g,"\\").replace(/\\\//g,"/").replace(/\\/g,"/")}return this._filename}get content(){if(!this.contentAvailable)return null;!this.contentRef&&this.root&&(this.contentRef=pickPlatformItem(this.root.get("EF")));let e=null;if(this.contentRef){const t=this.xref.fetchIfRef(this.contentRef);t instanceof n.BaseStream?e=t.getBytes():(0,r.warn)("Embedded file specification points to non-existing/invalid content")}else(0,r.warn)("Embedded file specification does not have a content");return e}get serializable(){return{filename:this.filename,content:this.content}}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.MetadataParser=void 0;var r=a(64);t.MetadataParser=class MetadataParser{constructor(e){e=this._repair(e);const t=new r.SimpleXMLParser({lowerCaseName:!0}).parseFromString(e);this._metadataMap=new Map;this._data=e;t&&this._parse(t)}_repair(e){return e.replace(/^[^<]+/,"").replace(/>\\376\\377([^<]+)/g,(function(e,t){const a=t.replace(/\\([0-3])([0-7])([0-7])/g,(function(e,t,a,r){return String.fromCharCode(64*t+8*a+1*r)})).replace(/&(amp|apos|gt|lt|quot);/g,(function(e,t){switch(t){case"amp":return"&";case"apos":return"'";case"gt":return">";case"lt":return"<";case"quot":return'"'}throw new Error(`_repair: ${t} isn't defined.`)})),r=[">"];for(let e=0,t=a.length;e<t;e+=2){const t=256*a.charCodeAt(e)+a.charCodeAt(e+1);t>=32&&t<127&&60!==t&&62!==t&&38!==t?r.push(String.fromCharCode(t)):r.push("&#x"+(65536+t).toString(16).substring(1)+";")}return r.join("")}))}_getSequence(e){const t=e.nodeName;return"rdf:bag"!==t&&"rdf:seq"!==t&&"rdf:alt"!==t?null:e.childNodes.filter((e=>"rdf:li"===e.nodeName))}_parseArray(e){if(!e.hasChildNodes())return;const[t]=e.childNodes,a=this._getSequence(t)||[];this._metadataMap.set(e.nodeName,a.map((e=>e.textContent.trim())))}_parse(e){let t=e.documentElement;if("rdf:rdf"!==t.nodeName){t=t.firstChild;for(;t&&"rdf:rdf"!==t.nodeName;)t=t.nextSibling}if(t&&"rdf:rdf"===t.nodeName&&t.hasChildNodes())for(const e of t.childNodes)if("rdf:description"===e.nodeName)for(const t of e.childNodes){const e=t.nodeName;switch(e){case"#text":continue;case"dc:creator":case"dc:subject":this._parseArray(t);continue}this._metadataMap.set(e,t.textContent.trim())}}get serializable(){return{parsedData:this._metadataMap,rawData:this._data}}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.StructTreeRoot=t.StructTreePage=void 0;var r=a(4),n=a(2),i=a(68);const s=40,o={PAGE_CONTENT:"PAGE_CONTENT",STREAM_CONTENT:"STREAM_CONTENT",OBJECT:"OBJECT",ELEMENT:"ELEMENT"};t.StructTreeRoot=class StructTreeRoot{constructor(e){this.dict=e;this.roleMap=new Map}init(){this.readRoleMap()}readRoleMap(){const e=this.dict.get("RoleMap");e instanceof r.Dict&&e.forEach(((e,t)=>{t instanceof r.Name&&this.roleMap.set(e,t.name)}))}};class StructElementNode{constructor(e,t){this.tree=e;this.dict=t;this.kids=[];this.parseKids()}get role(){const e=this.dict.get("S"),t=e instanceof r.Name?e.name:"",{root:a}=this.tree;return a.roleMap.has(t)?a.roleMap.get(t):t}parseKids(){let e=null;const t=this.dict.getRaw("Pg");t instanceof r.Ref&&(e=t.toString());const a=this.dict.get("K");if(Array.isArray(a))for(const t of a){const a=this.parseKid(e,t);a&&this.kids.push(a)}else{const t=this.parseKid(e,a);t&&this.kids.push(t)}}parseKid(e,t){if(Number.isInteger(t))return this.tree.pageDict.objId!==e?null:new StructElement({type:o.PAGE_CONTENT,mcid:t,pageObjId:e});let a=null;t instanceof r.Ref?a=this.dict.xref.fetch(t):t instanceof r.Dict&&(a=t);if(!a)return null;const n=a.getRaw("Pg");n instanceof r.Ref&&(e=n.toString());const i=a.get("Type")instanceof r.Name?a.get("Type").name:null;return"MCR"===i?this.tree.pageDict.objId!==e?null:new StructElement({type:o.STREAM_CONTENT,refObjId:a.getRaw("Stm")instanceof r.Ref?a.getRaw("Stm").toString():null,pageObjId:e,mcid:a.get("MCID")}):"OBJR"===i?this.tree.pageDict.objId!==e?null:new StructElement({type:o.OBJECT,refObjId:a.getRaw("Obj")instanceof r.Ref?a.getRaw("Obj").toString():null,pageObjId:e}):new StructElement({type:o.ELEMENT,dict:a})}}class StructElement{constructor({type:e,dict:t=null,mcid:a=null,pageObjId:r=null,refObjId:n=null}){this.type=e;this.dict=t;this.mcid=a;this.pageObjId=r;this.refObjId=n;this.parentNode=null}}t.StructTreePage=class StructTreePage{constructor(e,t){this.root=e;this.rootDict=e?e.dict:null;this.pageDict=t;this.nodes=[]}parse(){if(!this.root||!this.rootDict)return;const e=this.rootDict.get("ParentTree");if(!e)return;const t=this.pageDict.get("StructParents");if(!Number.isInteger(t))return;const a=new i.NumberTree(e,this.rootDict.xref).get(t);if(!Array.isArray(a))return;const n=new Map;for(const e of a)e instanceof r.Ref&&this.addNode(this.rootDict.xref.fetch(e),n)}addNode(e,t,a=0){if(a>s){(0,n.warn)("StructTree MAX_DEPTH reached.");return null}if(t.has(e))return t.get(e);const i=new StructElementNode(this,e);t.set(e,i);const c=e.get("P");if(!c||(0,r.isName)(c.get("Type"),"StructTreeRoot")){this.addTopLevelNode(e,i)||t.delete(e);return i}const l=this.addNode(c,t,a+1);if(!l)return i;let h=!1;for(const t of l.kids)if(t.type===o.ELEMENT&&t.dict===e){t.parentNode=i;h=!0}h||t.delete(e);return i}addTopLevelNode(e,t){const a=this.rootDict.get("K");if(!a)return!1;if(a instanceof r.Dict){if(a.objId!==e.objId)return!1;this.nodes[0]=t;return!0}if(!Array.isArray(a))return!0;let n=!1;for(let r=0;r<a.length;r++){const i=a[r];if(i&&i.toString()===e.objId){this.nodes[r]=t;n=!0}}return n}get serializable(){function nodeToSerializable(e,t,a=0){if(a>s){(0,n.warn)("StructTree too deep to be fully serialized.");return}const r=Object.create(null);r.role=e.role;r.children=[];t.children.push(r);const i=e.dict.get("Alt");"string"==typeof i&&(r.alt=(0,n.stringToPDFString)(i));const c=e.dict.get("Lang");"string"==typeof c&&(r.lang=(0,n.stringToPDFString)(c));for(const t of e.kids){const e=t.type===o.ELEMENT?t.parentNode:null;e?nodeToSerializable(e,r,a+1):t.type===o.PAGE_CONTENT||t.type===o.STREAM_CONTENT?r.children.push({type:"content",id:`page${t.pageObjId}_mcid${t.mcid}`}):t.type===o.OBJECT&&r.children.push({type:"object",id:t.refObjId})}}const e=Object.create(null);e.children=[];e.role="Root";for(const t of this.nodes)t&&nodeToSerializable(t,e);return e}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.ObjectLoader=void 0;var r=a(4),n=a(5),i=a(3),s=a(2);function addChildren(e,t){if(e instanceof r.Dict)e=e.getRawValues();else if(e instanceof n.BaseStream)e=e.dict.getRawValues();else if(!Array.isArray(e))return;for(const i of e)((a=i)instanceof r.Ref||a instanceof r.Dict||a instanceof n.BaseStream||Array.isArray(a))&&t.push(i);var a}t.ObjectLoader=class ObjectLoader{constructor(e,t,a){this.dict=e;this.keys=t;this.xref=a;this.refSet=null}async load(){if(this.xref.stream.isDataLoaded)return;const{keys:e,dict:t}=this;this.refSet=new r.RefSet;const a=[];for(const r of e){const e=t.getRaw(r);void 0!==e&&a.push(e)}return this._walk(a)}async _walk(e){const t=[],a=[];for(;e.length;){let o=e.pop();if(o instanceof r.Ref){if(this.refSet.has(o))continue;try{this.refSet.put(o);o=this.xref.fetch(o)}catch(e){if(!(e instanceof i.MissingDataException)){(0,s.warn)(`ObjectLoader._walk - requesting all data: "${e}".`);this.refSet=null;const{manager:t}=this.xref.stream;return t.requestAllChunks()}t.push(o);a.push({begin:e.begin,end:e.end})}}if(o instanceof n.BaseStream){const e=o.getBaseStreams();if(e){let r=!1;for(const t of e)if(!t.isDataLoaded){r=!0;a.push({begin:t.start,end:t.end})}r&&t.push(o)}}addChildren(o,e)}if(a.length){await this.xref.stream.manager.requestRanges(a);for(const e of t)e instanceof r.Ref&&this.refSet.remove(e);return this._walk(t)}this.refSet=null}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.XFAFactory=void 0;var r=a(75),n=a(79),i=a(85),s=a(83),o=a(76),c=a(2),l=a(86),h=a(96);class XFAFactory{constructor(e){try{this.root=(new l.XFAParser).parse(XFAFactory._createDocument(e));const t=new n.Binder(this.root);this.form=t.bind();this.dataHandler=new i.DataHandler(this.root,t.getData());this.form[r.$globalData].template=this.form}catch(e){(0,c.warn)(`XFA - an error occurred during parsing and binding: ${e}`)}}isValid(){return this.root&&this.form}_createPagesHelper(){const e=this.form[r.$toPages]();return new Promise(((t,a)=>{const nextIteration=()=>{try{const a=e.next();a.done?t(a.value):setTimeout(nextIteration,0)}catch(e){a(e)}};setTimeout(nextIteration,0)}))}async _createPages(){try{this.pages=await this._createPagesHelper();this.dims=this.pages.children.map((e=>{const{width:t,height:a}=e.attributes.style;return[0,0,parseInt(t),parseInt(a)]}))}catch(e){(0,c.warn)(`XFA - an error occurred during layout: ${e}`)}}getBoundingBox(e){return this.dims[e]}async getNumPages(){this.pages||await this._createPages();return this.dims.length}setImages(e){this.form[r.$globalData].images=e}setFonts(e){this.form[r.$globalData].fontFinder=new s.FontFinder(e);const t=[];for(let e of this.form[r.$globalData].usedTypefaces){e=(0,o.stripQuotes)(e);this.form[r.$globalData].fontFinder.find(e)||t.push(e)}return t.length>0?t:null}appendFonts(e,t){this.form[r.$globalData].fontFinder.add(e,t)}async getPages(){this.pages||await this._createPages();const e=this.pages;this.pages=null;return e}serializeData(e){return this.dataHandler.serialize(e)}static _createDocument(e){return e["/xdp:xdp"]?Object.values(e).join(""):e["xdp:xdp"]}static getRichTextAsHtml(e){if(!e||"string"!=typeof e)return null;try{let t=new l.XFAParser(h.XhtmlNamespace,!0).parse(e);if(!["body","xhtml"].includes(t[r.$nodeName])){const e=h.XhtmlNamespace.body({});e[r.$appendChild](t);t=e}const a=t[r.$toHTML]();if(!a.success)return null;const{html:n}=a,{attributes:i}=n;if(i){i.class&&(i.class=i.class.filter((e=>!e.startsWith("xfa"))));i.dir="auto"}return{html:n,str:t[r.$text]()}}catch(e){(0,c.warn)(`XFA - an error occurred during parsing of rich text: ${e}`)}return null}}t.XFAFactory=XFAFactory},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.XmlObject=t.XFAObjectArray=t.XFAObject=t.XFAAttribute=t.StringObject=t.OptionObject=t.Option10=t.Option01=t.IntegerObject=t.ContentObject=t.$uid=t.$toStyle=t.$toString=t.$toPages=t.$toHTML=t.$text=t.$tabIndex=t.$setValue=t.$setSetAttributes=t.$setId=t.$searchNode=t.$root=t.$resolvePrototypes=t.$removeChild=t.$pushPara=t.$pushGlyphs=t.$popPara=t.$onText=t.$onChildCheck=t.$onChild=t.$nsAttributes=t.$nodeName=t.$namespaceId=t.$isUsable=t.$isTransparent=t.$isThereMoreWidth=t.$isSplittable=t.$isNsAgnostic=t.$isDescendent=t.$isDataValue=t.$isCDATAXml=t.$isBindable=t.$insertAt=t.$indexOf=t.$ids=t.$hasSettableValue=t.$globalData=t.$getTemplateRoot=t.$getSubformParent=t.$getRealChildrenByNameIt=t.$getParent=t.$getNextPage=t.$getExtra=t.$getDataValue=t.$getContainedChildren=t.$getChildrenByNameIt=t.$getChildrenByName=t.$getChildrenByClass=t.$getChildren=t.$getAvailableSpace=t.$getAttributes=t.$getAttributeIt=t.$flushHTML=t.$finalize=t.$extra=t.$dump=t.$data=t.$content=t.$consumed=t.$clone=t.$cleanup=t.$cleanPage=t.$clean=t.$childrenToHTML=t.$appendChild=t.$addHTML=t.$acceptWhitespace=void 0;var r=a(76),n=a(2),i=a(3),s=a(77),o=a(78);const c=Symbol();t.$acceptWhitespace=c;const l=Symbol();t.$addHTML=l;const h=Symbol();t.$appendChild=h;const u=Symbol();t.$childrenToHTML=u;const d=Symbol();t.$clean=d;const f=Symbol();t.$cleanPage=f;const g=Symbol();t.$cleanup=g;const p=Symbol();t.$clone=p;const m=Symbol();t.$consumed=m;const b=Symbol("content");t.$content=b;const y=Symbol("data");t.$data=y;const w=Symbol();t.$dump=w;const S=Symbol("extra");t.$extra=S;const x=Symbol();t.$finalize=x;const C=Symbol();t.$flushHTML=C;const k=Symbol();t.$getAttributeIt=k;const v=Symbol();t.$getAttributes=v;const F=Symbol();t.$getAvailableSpace=F;const O=Symbol();t.$getChildrenByClass=O;const T=Symbol();t.$getChildrenByName=T;const M=Symbol();t.$getChildrenByNameIt=M;const E=Symbol();t.$getDataValue=E;const D=Symbol();t.$getExtra=D;const N=Symbol();t.$getRealChildrenByNameIt=N;const R=Symbol();t.$getChildren=R;const L=Symbol();t.$getContainedChildren=L;const j=Symbol();t.$getNextPage=j;const $=Symbol();t.$getSubformParent=$;const _=Symbol();t.$getParent=_;const U=Symbol();t.$getTemplateRoot=U;const X=Symbol();t.$globalData=X;const H=Symbol();t.$hasSettableValue=H;const q=Symbol();t.$ids=q;const z=Symbol();t.$indexOf=z;const W=Symbol();t.$insertAt=W;const G=Symbol();t.$isCDATAXml=G;const V=Symbol();t.$isBindable=V;const K=Symbol();t.$isDataValue=K;const J=Symbol();t.$isDescendent=J;const Y=Symbol();t.$isNsAgnostic=Y;const Z=Symbol();t.$isSplittable=Z;const Q=Symbol();t.$isThereMoreWidth=Q;const ee=Symbol();t.$isTransparent=ee;const te=Symbol();t.$isUsable=te;const ae=Symbol(),re=Symbol("namespaceId");t.$namespaceId=re;const ne=Symbol("nodeName");t.$nodeName=ne;const ie=Symbol();t.$nsAttributes=ie;const se=Symbol();t.$onChild=se;const oe=Symbol();t.$onChildCheck=oe;const ce=Symbol();t.$onText=ce;const le=Symbol();t.$pushGlyphs=le;const he=Symbol();t.$popPara=he;const ue=Symbol();t.$pushPara=ue;const de=Symbol();t.$removeChild=de;const fe=Symbol("root");t.$root=fe;const ge=Symbol();t.$resolvePrototypes=ge;const pe=Symbol();t.$searchNode=pe;const me=Symbol();t.$setId=me;const be=Symbol();t.$setSetAttributes=be;const ye=Symbol();t.$setValue=ye;const we=Symbol();t.$tabIndex=we;const Se=Symbol();t.$text=Se;const xe=Symbol();t.$toPages=xe;const Ae=Symbol();t.$toHTML=Ae;const Ce=Symbol();t.$toString=Ce;const ke=Symbol();t.$toStyle=ke;const ve=Symbol("uid");t.$uid=ve;const Fe=Symbol(),Oe=Symbol(),Te=Symbol(),Ie=Symbol("_children"),Me=Symbol(),Pe=Symbol(),Ee=Symbol(),De=Symbol(),Ne=Symbol(),Be=Symbol(),Re=Symbol(),Le=Symbol(),je=Symbol(),$e=Symbol("parent"),_e=Symbol(),Ue=Symbol(),Xe=Symbol();let He=0;const qe=s.NamespaceIds.datasets.id;class XFAObject{constructor(e,t,a=!1){this[re]=e;this[ne]=t;this[Re]=a;this[$e]=null;this[Ie]=[];this[ve]=`${t}${He++}`;this[X]=null}[se](e){if(!this[Re]||!this[oe](e))return!1;const t=e[ne],a=this[t];if(!(a instanceof XFAObjectArray)){null!==a&&this[de](a);this[t]=e;this[h](e);return!0}if(a.push(e)){this[h](e);return!0}let r="";this.id?r=` (id: ${this.id})`:this.name&&(r=` (name: ${this.name} ${this.h.value})`);(0,n.warn)(`XFA - node "${this[ne]}"${r} has already enough "${t}"!`);return!1}[oe](e){return this.hasOwnProperty(e[ne])&&e[re]===this[re]}[Y](){return!1}[c](){return!1}[G](){return!1}[V](){return!1}[he](){this.para&&this[U]()[S].paraStack.pop()}[ue](){this[U]()[S].paraStack.push(this.para)}[me](e){this.id&&this[re]===s.NamespaceIds.template.id&&e.set(this.id,this)}[U](){return this[X].template}[Z](){return!1}[Q](){return!1}[h](e){e[$e]=this;this[Ie].push(e);!e[X]&&this[X]&&(e[X]=this[X])}[de](e){const t=this[Ie].indexOf(e);this[Ie].splice(t,1)}[H](){return this.hasOwnProperty("value")}[ye](e){}[ce](e){}[x](){}[d](e){delete this[Re];if(this[g]){e.clean(this[g]);delete this[g]}}[z](e){return this[Ie].indexOf(e)}[W](e,t){t[$e]=this;this[Ie].splice(e,0,t);!t[X]&&this[X]&&(t[X]=this[X])}[ee](){return!this.name}[ae](){return""}[Se](){return 0===this[Ie].length?this[b]:this[Ie].map((e=>e[Se]())).join("")}get[Te](){const e=Object.getPrototypeOf(this);if(!e._attributes){const t=e._attributes=new Set;for(const e of Object.getOwnPropertyNames(this)){if(null===this[e]||this[e]instanceof XFAObject||this[e]instanceof XFAObjectArray)break;t.add(e)}}return(0,n.shadow)(this,Te,e._attributes)}[J](e){let t=this;for(;t;){if(t===e)return!0;t=t[_]()}return!1}[_](){return this[$e]}[$](){return this[_]()}[R](e=null){return e?this[e]:this[Ie]}[w](){const e=Object.create(null);this[b]&&(e.$content=this[b]);for(const t of Object.getOwnPropertyNames(this)){const a=this[t];null!==a&&(a instanceof XFAObject?e[t]=a[w]():a instanceof XFAObjectArray?a.isEmpty()||(e[t]=a.dump()):e[t]=a)}return e}[ke](){return null}[Ae](){return r.HTMLResult.EMPTY}*[L](){for(const e of this[R]())yield e}*[De](e,t){for(const a of this[L]())if(!e||t===e.has(a[ne])){const e=this[F](),t=a[Ae](e);t.success||(this[S].failingNode=a);yield t}}[C](){return null}[l](e,t){this[S].children.push(e)}[F](){}[u]({filter:e=null,include:t=!0}){if(this[S].generator){const e=this[F](),t=this[S].failingNode[Ae](e);if(!t.success)return t;t.html&&this[l](t.html,t.bbox);delete this[S].failingNode}else this[S].generator=this[De](e,t);for(;;){const e=this[S].generator.next();if(e.done)break;const t=e.value;if(!t.success)return t;t.html&&this[l](t.html,t.bbox)}this[S].generator=null;return r.HTMLResult.EMPTY}[be](e){this[Ue]=new Set(Object.keys(e))}[Be](e){const t=this[Te],a=this[Ue];return[...e].filter((e=>t.has(e)&&!a.has(e)))}[ge](e,t=new Set){for(const a of this[Ie])a[_e](e,t)}[_e](e,t){const a=this[Ne](e,t);a?this[Fe](a,e,t):this[ge](e,t)}[Ne](e,t){const{use:a,usehref:r}=this;if(!a&&!r)return null;let i=null,s=null,c=null,l=a;if(r){l=r;r.startsWith("#som(")&&r.endsWith(")")?s=r.slice("#som(".length,r.length-1):r.startsWith(".#som(")&&r.endsWith(")")?s=r.slice(".#som(".length,r.length-1):r.startsWith("#")?c=r.slice(1):r.startsWith(".#")&&(c=r.slice(2))}else a.startsWith("#")?c=a.slice(1):s=a;this.use=this.usehref="";if(c)i=e.get(c);else{i=(0,o.searchNode)(e.get(fe),this,s,!0,!1);i&&(i=i[0])}if(!i){(0,n.warn)(`XFA - Invalid prototype reference: ${l}.`);return null}if(i[ne]!==this[ne]){(0,n.warn)(`XFA - Incompatible prototype: ${i[ne]} !== ${this[ne]}.`);return null}if(t.has(i)){(0,n.warn)("XFA - Cycle detected in prototypes use.");return null}t.add(i);const h=i[Ne](e,t);h&&i[Fe](h,e,t);i[ge](e,t);t.delete(i);return i}[Fe](e,t,a){if(a.has(e)){(0,n.warn)("XFA - Cycle detected in prototypes use.");return}!this[b]&&e[b]&&(this[b]=e[b]);new Set(a).add(e);for(const t of this[Be](e[Ue])){this[t]=e[t];this[Ue]&&this[Ue].add(t)}for(const r of Object.getOwnPropertyNames(this)){if(this[Te].has(r))continue;const n=this[r],i=e[r];if(n instanceof XFAObjectArray){for(const e of n[Ie])e[_e](t,a);for(let r=n[Ie].length,s=i[Ie].length;r<s;r++){const i=e[Ie][r][p]();if(!n.push(i))break;i[$e]=this;this[Ie].push(i);i[_e](t,a)}}else if(null===n){if(null!==i){const e=i[p]();e[$e]=this;this[r]=e;this[Ie].push(e);e[_e](t,a)}}else{n[ge](t,a);i&&n[Fe](i,t,a)}}}static[Me](e){return Array.isArray(e)?e.map((e=>XFAObject[Me](e))):"object"==typeof e&&null!==e?Object.assign({},e):e}[p](){const e=Object.create(Object.getPrototypeOf(this));for(const t of Object.getOwnPropertySymbols(this))try{e[t]=this[t]}catch(a){(0,n.shadow)(e,t,this[t])}e[ve]=`${e[ne]}${He++}`;e[Ie]=[];for(const t of Object.getOwnPropertyNames(this)){if(this[Te].has(t)){e[t]=XFAObject[Me](this[t]);continue}const a=this[t];e[t]=a instanceof XFAObjectArray?new XFAObjectArray(a[Le]):null}for(const t of this[Ie]){const a=t[ne],r=t[p]();e[Ie].push(r);r[$e]=e;null===e[a]?e[a]=r:e[a][Ie].push(r)}return e}[R](e=null){return e?this[Ie].filter((t=>t[ne]===e)):this[Ie]}[O](e){return this[e]}[T](e,t,a=!0){return Array.from(this[M](e,t,a))}*[M](e,t,a=!0){if("parent"!==e){for(const a of this[Ie]){a[ne]===e&&(yield a);a.name===e&&(yield a);(t||a[ee]())&&(yield*a[M](e,t,!1))}a&&this[Te].has(e)&&(yield new XFAAttribute(this,e,this[e]))}else yield this[$e]}}t.XFAObject=XFAObject;class XFAObjectArray{constructor(e=1/0){this[Le]=e;this[Ie]=[]}push(e){if(this[Ie].length<=this[Le]){this[Ie].push(e);return!0}(0,n.warn)(`XFA - node "${e[ne]}" accepts no more than ${this[Le]} children`);return!1}isEmpty(){return 0===this[Ie].length}dump(){return 1===this[Ie].length?this[Ie][0][w]():this[Ie].map((e=>e[w]()))}[p](){const e=new XFAObjectArray(this[Le]);e[Ie]=this[Ie].map((e=>e[p]()));return e}get children(){return this[Ie]}clear(){this[Ie].length=0}}t.XFAObjectArray=XFAObjectArray;class XFAAttribute{constructor(e,t,a){this[$e]=e;this[ne]=t;this[b]=a;this[m]=!1;this[ve]="attribute"+He++}[_](){return this[$e]}[K](){return!0}[E](){return this[b].trim()}[ye](e){e=e.value||"";this[b]=e.toString()}[Se](){return this[b]}[J](e){return this[$e]===e||this[$e][J](e)}}t.XFAAttribute=XFAAttribute;class XmlObject extends XFAObject{constructor(e,t,a={}){super(e,t);this[b]="";this[Pe]=null;if("#text"!==t){const e=new Map;this[Oe]=e;for(const[t,r]of Object.entries(a))e.set(t,new XFAAttribute(this,t,r));if(a.hasOwnProperty(ie)){const e=a[ie].xfa.dataNode;void 0!==e&&("dataGroup"===e?this[Pe]=!1:"dataValue"===e&&(this[Pe]=!0))}}this[m]=!1}[Ce](e){const t=this[ne];if("#text"===t){e.push((0,i.encodeToXmlString)(this[b]));return}const a=(0,n.utf8StringToString)(t),r=this[re]===qe?"xfa:":"";e.push(`<${r}${a}`);for(const[t,a]of this[Oe].entries()){const r=(0,n.utf8StringToString)(t);e.push(` ${r}="${(0,i.encodeToXmlString)(a[b])}"`)}null!==this[Pe]&&(this[Pe]?e.push(' xfa:dataNode="dataValue"'):e.push(' xfa:dataNode="dataGroup"'));if(this[b]||0!==this[Ie].length){e.push(">");if(this[b])"string"==typeof this[b]?e.push((0,i.encodeToXmlString)(this[b])):this[b][Ce](e);else for(const t of this[Ie])t[Ce](e);e.push(`</${r}${a}>`)}else e.push("/>")}[se](e){if(this[b]){const e=new XmlObject(this[re],"#text");this[h](e);e[b]=this[b];this[b]=""}this[h](e);return!0}[ce](e){this[b]+=e}[x](){if(this[b]&&this[Ie].length>0){const e=new XmlObject(this[re],"#text");this[h](e);e[b]=this[b];delete this[b]}}[Ae](){return"#text"===this[ne]?r.HTMLResult.success({name:"#text",value:this[b]}):r.HTMLResult.EMPTY}[R](e=null){return e?this[Ie].filter((t=>t[ne]===e)):this[Ie]}[v](){return this[Oe]}[O](e){const t=this[Oe].get(e);return void 0!==t?t:this[R](e)}*[M](e,t){const a=this[Oe].get(e);a&&(yield a);for(const a of this[Ie]){a[ne]===e&&(yield a);t&&(yield*a[M](e,t))}}*[k](e,t){const a=this[Oe].get(e);!a||t&&a[m]||(yield a);for(const a of this[Ie])yield*a[k](e,t)}*[N](e,t,a){for(const r of this[Ie]){r[ne]!==e||a&&r[m]||(yield r);t&&(yield*r[N](e,t,a))}}[K](){return null===this[Pe]?0===this[Ie].length||this[Ie][0][re]===s.NamespaceIds.xhtml.id:this[Pe]}[E](){return null===this[Pe]?0===this[Ie].length?this[b].trim():this[Ie][0][re]===s.NamespaceIds.xhtml.id?this[Ie][0][Se]().trim():null:this[b].trim()}[ye](e){e=e.value||"";this[b]=e.toString()}[w](e=!1){const t=Object.create(null);e&&(t.$ns=this[re]);this[b]&&(t.$content=this[b]);t.$name=this[ne];t.children=[];for(const a of this[Ie])t.children.push(a[w](e));t.attributes=Object.create(null);for(const[e,a]of this[Oe])t.attributes[e]=a[b];return t}}t.XmlObject=XmlObject;class ContentObject extends XFAObject{constructor(e,t){super(e,t);this[b]=""}[ce](e){this[b]+=e}[x](){}}t.ContentObject=ContentObject;t.OptionObject=class OptionObject extends ContentObject{constructor(e,t,a){super(e,t);this[je]=a}[x](){this[b]=(0,r.getKeyword)({data:this[b],defaultValue:this[je][0],validate:e=>this[je].includes(e)})}[d](e){super[d](e);delete this[je]}};t.StringObject=class StringObject extends ContentObject{[x](){this[b]=this[b].trim()}};class IntegerObject extends ContentObject{constructor(e,t,a,r){super(e,t);this[Ee]=a;this[Xe]=r}[x](){this[b]=(0,r.getInteger)({data:this[b],defaultValue:this[Ee],validate:this[Xe]})}[d](e){super[d](e);delete this[Ee];delete this[Xe]}}t.IntegerObject=IntegerObject;t.Option01=class Option01 extends IntegerObject{constructor(e,t){super(e,t,0,(e=>1===e))}};t.Option10=class Option10 extends IntegerObject{constructor(e,t){super(e,t,1,(e=>0===e))}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.HTMLResult=void 0;t.getBBox=function getBBox(e){const t=-1;if(!e)return{x:t,y:t,width:t,height:t};const a=e.trim().split(/\s*,\s*/).map((e=>getMeasurement(e,"-1")));if(a.length<4||a[2]<0||a[3]<0)return{x:t,y:t,width:t,height:t};const[r,n,i,s]=a;return{x:r,y:n,width:i,height:s}};t.getColor=function getColor(e,t=[0,0,0]){let[a,r,n]=t;if(!e)return{r:a,g:r,b:n};const i=e.trim().split(/\s*,\s*/).map((e=>Math.min(Math.max(0,parseInt(e.trim(),10)),255))).map((e=>isNaN(e)?0:e));if(i.length<3)return{r:a,g:r,b:n};[a,r,n]=i;return{r:a,g:r,b:n}};t.getFloat=function getFloat({data:e,defaultValue:t,validate:a}){if(!e)return t;e=e.trim();const r=parseFloat(e);if(!isNaN(r)&&a(r))return r;return t};t.getInteger=function getInteger({data:e,defaultValue:t,validate:a}){if(!e)return t;e=e.trim();const r=parseInt(e,10);if(!isNaN(r)&&a(r))return r;return t};t.getKeyword=getKeyword;t.getMeasurement=getMeasurement;t.getRatio=function getRatio(e){if(!e)return{num:1,den:1};const t=e.trim().split(/\s*:\s*/).map((e=>parseFloat(e))).filter((e=>!isNaN(e)));1===t.length&&t.push(1);if(0===t.length)return{num:1,den:1};const[a,r]=t;return{num:a,den:r}};t.getRelevant=function getRelevant(e){if(!e)return[];return e.trim().split(/\s+/).map((e=>({excluded:"-"===e[0],viewname:e.substring(1)})))};t.getStringOption=function getStringOption(e,t){return getKeyword({data:e,defaultValue:t[0],validate:e=>t.includes(e)})};t.stripQuotes=function stripQuotes(e){if(e.startsWith("'")||e.startsWith('"'))return e.slice(1,e.length-1);return e};var r=a(2);const n={pt:e=>e,cm:e=>e/2.54*72,mm:e=>e/25.4*72,in:e=>72*e,px:e=>e},i=/([+-]?\d+\.?\d*)(.*)/;function getKeyword({data:e,defaultValue:t,validate:a}){return e&&a(e=e.trim())?e:t}function getMeasurement(e,t="0"){t=t||"0";if(!e)return getMeasurement(t);const a=e.trim().match(i);if(!a)return getMeasurement(t);const[,r,s]=a,o=parseFloat(r);if(isNaN(o))return getMeasurement(t);if(0===o)return 0;const c=n[s];return c?c(o):o}class HTMLResult{static get FAILURE(){return(0,r.shadow)(this,"FAILURE",new HTMLResult(!1,null,null,null))}static get EMPTY(){return(0,r.shadow)(this,"EMPTY",new HTMLResult(!0,null,null,null))}constructor(e,t,a,r){this.success=e;this.html=t;this.bbox=a;this.breakNode=r}isBreak(){return!!this.breakNode}static breakNode(e){return new HTMLResult(!1,null,null,e)}static success(e,t=null){return new HTMLResult(!0,e,t,null)}}t.HTMLResult=HTMLResult},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.NamespaceIds=t.$buildXFAObject=void 0;const a=Symbol();t.$buildXFAObject=a;t.NamespaceIds={config:{id:0,check:e=>e.startsWith("http://www.xfa.org/schema/xci/")},connectionSet:{id:1,check:e=>e.startsWith("http://www.xfa.org/schema/xfa-connection-set/")},datasets:{id:2,check:e=>e.startsWith("http://www.xfa.org/schema/xfa-data/")},form:{id:3,check:e=>e.startsWith("http://www.xfa.org/schema/xfa-form/")},localeSet:{id:4,check:e=>e.startsWith("http://www.xfa.org/schema/xfa-locale-set/")},pdf:{id:5,check:e=>"http://ns.adobe.com/xdp/pdf/"===e},signature:{id:6,check:e=>"http://www.w3.org/2000/09/xmldsig#"===e},sourceSet:{id:7,check:e=>e.startsWith("http://www.xfa.org/schema/xfa-source-set/")},stylesheet:{id:8,check:e=>"http://www.w3.org/1999/XSL/Transform"===e},template:{id:9,check:e=>e.startsWith("http://www.xfa.org/schema/xfa-template/")},xdc:{id:10,check:e=>e.startsWith("http://www.xfa.org/schema/xdc/")},xdp:{id:11,check:e=>"http://ns.adobe.com/xdp/"===e},xfdf:{id:12,check:e=>"http://ns.adobe.com/xfdf/"===e},xhtml:{id:13,check:e=>"http://www.w3.org/1999/xhtml"===e},xmpmeta:{id:14,check:e=>"http://ns.adobe.com/xmpmeta/"===e}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.createDataNode=function createDataNode(e,t,a){const n=parseExpression(a);if(!n)return null;if(n.some((e=>e.operator===c.dotDot)))return null;const s=l.get(n[0].name);let o=0;if(s){e=s(e,t);o=1}else e=t||e;for(let t=n.length;o<t;o++){const{name:t,operator:a,index:s}=n[o];if(!isFinite(s)){n[o].index=0;return createNodes(e,n.slice(o))}let l;switch(a){case c.dot:l=e[r.$getChildrenByName](t,!1);break;case c.dotDot:l=e[r.$getChildrenByName](t,!0);break;case c.dotHash:l=e[r.$getChildrenByClass](t);l=l instanceof r.XFAObjectArray?l.children:[l]}if(0===l.length)return createNodes(e,n.slice(o));if(!(s<l.length)){n[o].index=s-l.length;return createNodes(e,n.slice(o))}{const t=l[s];if(!(t instanceof r.XFAObject)){(0,i.warn)("XFA - Cannot create a node.");return null}e=t}}return null};t.searchNode=function searchNode(e,t,a,n=!0,i=!0){const s=parseExpression(a,n);if(!s)return null;const o=l.get(s[0].name);let u,d=0;if(o){u=!0;e=[o(e,t)];d=1}else{u=null===t;e=[t||e]}for(let a=s.length;d<a;d++){const{name:a,cacheName:n,operator:o,index:l}=s[d],f=[];for(const t of e){if(!(t instanceof r.XFAObject))continue;let e,s;if(i){s=h.get(t);if(!s){s=new Map;h.set(t,s)}e=s.get(n)}if(!e){switch(o){case c.dot:e=t[r.$getChildrenByName](a,!1);break;case c.dotDot:e=t[r.$getChildrenByName](a,!0);break;case c.dotHash:e=t[r.$getChildrenByClass](a);e=e instanceof r.XFAObjectArray?e.children:[e]}i&&s.set(n,e)}e.length>0&&f.push(e)}if(0!==f.length||u||0!==d)e=isFinite(l)?f.filter((e=>l<e.length)).map((e=>e[l])):f.flat();else{const a=t[r.$getParent]();if(!(t=a))return null;d=-1;e=[t]}}if(0===e.length)return null;return e};var r=a(75),n=a(77),i=a(2);const s=/^[^.[]+/,o=/^[^\]]+/,c={dot:0,dotDot:1,dotHash:2,dotBracket:3,dotParen:4},l=new Map([["$data",(e,t)=>e.datasets?e.datasets.data:e],["$record",(e,t)=>(e.datasets?e.datasets.data:e)[r.$getChildren]()[0]],["$template",(e,t)=>e.template],["$connectionSet",(e,t)=>e.connectionSet],["$form",(e,t)=>e.form],["$layout",(e,t)=>e.layout],["$host",(e,t)=>e.host],["$dataWindow",(e,t)=>e.dataWindow],["$event",(e,t)=>e.event],["!",(e,t)=>e.datasets],["$xfa",(e,t)=>e],["xfa",(e,t)=>e],["$",(e,t)=>t]]),h=new WeakMap,u=n.NamespaceIds.datasets.id;function parseExpression(e,t,a=!0){let r=e.match(s);if(!r)return null;let[n]=r;const l=[{name:n,cacheName:"."+n,index:0,js:null,formCalc:null,operator:c.dot}];let h=n.length;for(;h<e.length;){const d=h;if("["===e.charAt(h++)){r=e.slice(h).match(o);if(!r){(0,i.warn)("XFA - Invalid index in SOM expression");return null}l.at(-1).index="*"===(u=(u=r[0]).trim())?1/0:parseInt(u,10)||0;h+=r[0].length+1;continue}let f;switch(e.charAt(h)){case".":if(!t)return null;h++;f=c.dotDot;break;case"#":h++;f=c.dotHash;break;case"[":if(a){(0,i.warn)("XFA - SOM expression contains a FormCalc subexpression which is not supported for now.");return null}f=c.dotBracket;break;case"(":if(a){(0,i.warn)("XFA - SOM expression contains a JavaScript subexpression which is not supported for now.");return null}f=c.dotParen;break;default:f=c.dot}r=e.slice(h).match(s);if(!r)break;[n]=r;h+=n.length;l.push({name:n,cacheName:e.slice(d,h),operator:f,index:0,js:null,formCalc:null})}var u;return l}function createNodes(e,t){let a=null;for(const{name:n,index:i}of t){for(let t=0,s=isFinite(i)?i:0;t<=s;t++){const t=e[r.$namespaceId]===u?-1:e[r.$namespaceId];a=new r.XmlObject(t,n);e[r.$appendChild](a)}e=a}return a}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.Binder=void 0;var r=a(75),n=a(80),i=a(78),s=a(77),o=a(2);const c=s.NamespaceIds.datasets.id;function createText(e){const t=new n.Text({});t[r.$content]=e;return t}t.Binder=class Binder{constructor(e){this.root=e;this.datasets=e.datasets;e.datasets&&e.datasets.data?this.data=e.datasets.data:this.data=new r.XmlObject(s.NamespaceIds.datasets.id,"data");this.emptyMerge=0===this.data[r.$getChildren]().length;this.root.form=this.form=e.template[r.$clone]()}_isConsumeData(){return!this.emptyMerge&&this._mergeMode}_isMatchTemplate(){return!this._isConsumeData()}bind(){this._bindElement(this.form,this.data);return this.form}getData(){return this.data}_bindValue(e,t,a){e[r.$data]=t;if(e[r.$hasSettableValue]())if(t[r.$isDataValue]()){const a=t[r.$getDataValue]();e[r.$setValue](createText(a))}else if(e instanceof n.Field&&e.ui&&e.ui.choiceList&&"multiSelect"===e.ui.choiceList.open){const a=t[r.$getChildren]().map((e=>e[r.$content].trim())).join("\n");e[r.$setValue](createText(a))}else this._isConsumeData()&&(0,o.warn)("XFA - Nodes haven't the same type.");else!t[r.$isDataValue]()||this._isMatchTemplate()?this._bindElement(e,t):(0,o.warn)("XFA - Nodes haven't the same type.")}_findDataByNameToConsume(e,t,a,n){if(!e)return null;let i,o;for(let n=0;n<3;n++){i=a[r.$getRealChildrenByNameIt](e,!1,!0);for(;;){o=i.next().value;if(!o)break;if(t===o[r.$isDataValue]())return o}if(a[r.$namespaceId]===s.NamespaceIds.datasets.id&&"data"===a[r.$nodeName])break;a=a[r.$getParent]()}if(!n)return null;i=this.data[r.$getRealChildrenByNameIt](e,!0,!1);o=i.next().value;if(o)return o;i=this.data[r.$getAttributeIt](e,!0);o=i.next().value;return o&&o[r.$isDataValue]()?o:null}_setProperties(e,t){if(e.hasOwnProperty("setProperty"))for(const{ref:a,target:s,connection:c}of e.setProperty.children){if(c)continue;if(!a)continue;const l=(0,i.searchNode)(this.root,t,a,!1,!1);if(!l){(0,o.warn)(`XFA - Invalid reference: ${a}.`);continue}const[h]=l;if(!h[r.$isDescendent](this.data)){(0,o.warn)("XFA - Invalid node: must be a data node.");continue}const u=(0,i.searchNode)(this.root,e,s,!1,!1);if(!u){(0,o.warn)(`XFA - Invalid target: ${s}.`);continue}const[d]=u;if(!d[r.$isDescendent](e)){(0,o.warn)("XFA - Invalid target: must be a property or subproperty.");continue}const f=d[r.$getParent]();if(d instanceof n.SetProperty||f instanceof n.SetProperty){(0,o.warn)("XFA - Invalid target: cannot be a setProperty or one of its properties.");continue}if(d instanceof n.BindItems||f instanceof n.BindItems){(0,o.warn)("XFA - Invalid target: cannot be a bindItems or one of its properties.");continue}const g=h[r.$text](),p=d[r.$nodeName];if(d instanceof r.XFAAttribute){const e=Object.create(null);e[p]=g;const t=Reflect.construct(Object.getPrototypeOf(f).constructor,[e]);f[p]=t[p]}else if(d.hasOwnProperty(r.$content)){d[r.$data]=h;d[r.$content]=g;d[r.$finalize]()}else(0,o.warn)("XFA - Invalid node to use in setProperty")}}_bindItems(e,t){if(!e.hasOwnProperty("items")||!e.hasOwnProperty("bindItems")||e.bindItems.isEmpty())return;for(const t of e.items.children)e[r.$removeChild](t);e.items.clear();const a=new n.Items({}),s=new n.Items({});e[r.$appendChild](a);e.items.push(a);e[r.$appendChild](s);e.items.push(s);for(const{ref:n,labelRef:c,valueRef:l,connection:h}of e.bindItems.children){if(h)continue;if(!n)continue;const e=(0,i.searchNode)(this.root,t,n,!1,!1);if(e)for(const t of e){if(!t[r.$isDescendent](this.datasets)){(0,o.warn)(`XFA - Invalid ref (${n}): must be a datasets child.`);continue}const e=(0,i.searchNode)(this.root,t,c,!0,!1);if(!e){(0,o.warn)(`XFA - Invalid label: ${c}.`);continue}const[h]=e;if(!h[r.$isDescendent](this.datasets)){(0,o.warn)("XFA - Invalid label: must be a datasets child.");continue}const u=(0,i.searchNode)(this.root,t,l,!0,!1);if(!u){(0,o.warn)(`XFA - Invalid value: ${l}.`);continue}const[d]=u;if(!d[r.$isDescendent](this.datasets)){(0,o.warn)("XFA - Invalid value: must be a datasets child.");continue}const f=createText(h[r.$text]()),g=createText(d[r.$text]());a[r.$appendChild](f);a.text.push(f);s[r.$appendChild](g);s.text.push(g)}else(0,o.warn)(`XFA - Invalid reference: ${n}.`)}}_bindOccurrences(e,t,a){let n;if(t.length>1){n=e[r.$clone]();n[r.$removeChild](n.occur);n.occur=null}this._bindValue(e,t[0],a);this._setProperties(e,t[0]);this._bindItems(e,t[0]);if(1===t.length)return;const i=e[r.$getParent](),s=e[r.$nodeName],o=i[r.$indexOf](e);for(let e=1,c=t.length;e<c;e++){const c=t[e],l=n[r.$clone]();i[s].push(l);i[r.$insertAt](o+e,l);this._bindValue(l,c,a);this._setProperties(l,c);this._bindItems(l,c)}}_createOccurrences(e){if(!this.emptyMerge)return;const{occur:t}=e;if(!t||t.initial<=1)return;const a=e[r.$getParent](),n=e[r.$nodeName];if(!(a[n]instanceof r.XFAObjectArray))return;let i;i=e.name?a[n].children.filter((t=>t.name===e.name)).length:a[n].children.length;const s=a[r.$indexOf](e)+1,o=t.initial-i;if(o){const t=e[r.$clone]();t[r.$removeChild](t.occur);t.occur=null;a[n].push(t);a[r.$insertAt](s,t);for(let e=1;e<o;e++){const i=t[r.$clone]();a[n].push(i);a[r.$insertAt](s+e,i)}}}_getOccurInfo(e){const{name:t,occur:a}=e;if(!a||!t)return[1,1];const r=-1===a.max?1/0:a.max;return[a.min,r]}_setAndBind(e,t){this._setProperties(e,t);this._bindItems(e,t);this._bindElement(e,t)}_bindElement(e,t){const a=[];this._createOccurrences(e);for(const n of e[r.$getChildren]()){if(n[r.$data])continue;if(void 0===this._mergeMode&&"subform"===n[r.$nodeName]){this._mergeMode="consumeData"===n.mergeMode;const e=t[r.$getChildren]();if(e.length>0)this._bindOccurrences(n,[e[0]],null);else if(this.emptyMerge){const e=t[r.$namespaceId]===c?-1:t[r.$namespaceId],a=n[r.$data]=new r.XmlObject(e,n.name||"root");t[r.$appendChild](a);this._bindElement(n,a)}continue}if(!n[r.$isBindable]())continue;let e=!1,s=null,l=null,h=null;if(n.bind){switch(n.bind.match){case"none":this._setAndBind(n,t);continue;case"global":e=!0;break;case"dataRef":if(!n.bind.ref){(0,o.warn)(`XFA - ref is empty in node ${n[r.$nodeName]}.`);this._setAndBind(n,t);continue}l=n.bind.ref}n.bind.picture&&(s=n.bind.picture[r.$content])}const[u,d]=this._getOccurInfo(n);if(l){h=(0,i.searchNode)(this.root,t,l,!0,!1);if(null===h){h=(0,i.createDataNode)(this.data,t,l);if(!h)continue;this._isConsumeData()&&(h[r.$consumed]=!0);this._setAndBind(n,h);continue}this._isConsumeData()&&(h=h.filter((e=>!e[r.$consumed])));h.length>d?h=h.slice(0,d):0===h.length&&(h=null);h&&this._isConsumeData()&&h.forEach((e=>{e[r.$consumed]=!0}))}else{if(!n.name){this._setAndBind(n,t);continue}if(this._isConsumeData()){const a=[];for(;a.length<d;){const i=this._findDataByNameToConsume(n.name,n[r.$hasSettableValue](),t,e);if(!i)break;i[r.$consumed]=!0;a.push(i)}h=a.length>0?a:null}else{h=t[r.$getRealChildrenByNameIt](n.name,!1,this.emptyMerge).next().value;if(!h){if(0===u){a.push(n);continue}const e=t[r.$namespaceId]===c?-1:t[r.$namespaceId];h=n[r.$data]=new r.XmlObject(e,n.name);this.emptyMerge&&(h[r.$consumed]=!0);t[r.$appendChild](h);this._setAndBind(n,h);continue}this.emptyMerge&&(h[r.$consumed]=!0);h=[h]}}h?this._bindOccurrences(n,h,s):u>0?this._setAndBind(n,t):a.push(n)}a.forEach((e=>e[r.$getParent]()[r.$removeChild](e)))}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.Value=t.Text=t.TemplateNamespace=t.Template=t.SetProperty=t.Items=t.Field=t.BindItems=void 0;var r=a(75),n=a(77),i=a(81),s=a(82),o=a(76),c=a(2),l=a(83),h=a(3),u=a(78);const d=n.NamespaceIds.template.id,f="http://www.w3.org/2000/svg",g=/^H(\d+)$/,p=new Set(["image/gif","image/jpeg","image/jpg","image/pjpeg","image/png","image/apng","image/x-png","image/bmp","image/x-ms-bmp","image/tiff","image/tif","application/octet-stream"]),m=[[[66,77],"image/bmp"],[[255,216,255],"image/jpeg"],[[73,73,42,0],"image/tiff"],[[77,77,0,42],"image/tiff"],[[71,73,70,56,57,97],"image/gif"],[[137,80,78,71,13,10,26,10],"image/png"]];function getBorderDims(e){if(!e||!e.border)return{w:0,h:0};const t=e.border[r.$getExtra]();return t?{w:t.widths[0]+t.widths[2]+t.insets[0]+t.insets[2],h:t.widths[1]+t.widths[3]+t.insets[1]+t.insets[3]}:{w:0,h:0}}function hasMargin(e){return e.margin&&(e.margin.topInset||e.margin.rightInset||e.margin.bottomInset||e.margin.leftInset)}function _setValue(e,t){if(!e.value){const t=new Value({});e[r.$appendChild](t);e.value=t}e.value[r.$setValue](t)}function*getContainedChildren(e){for(const t of e[r.$getChildren]())t instanceof SubformSet?yield*t[r.$getContainedChildren]():yield t}function isRequired(e){return e.validate&&"error"===e.validate.nullTest}function setTabIndex(e){for(;e;){if(!e.traversal){e[r.$tabIndex]=e[r.$getParent]()[r.$tabIndex];return}if(e[r.$tabIndex])return;let t=null;for(const a of e.traversal[r.$getChildren]())if("next"===a.operation){t=a;break}if(!t||!t.ref){e[r.$tabIndex]=e[r.$getParent]()[r.$tabIndex];return}const a=e[r.$getTemplateRoot]();e[r.$tabIndex]=++a[r.$tabIndex];const n=a[r.$searchNode](t.ref,e);if(!n)return;e=n[0]}}function applyAssist(e,t){const a=e.assist;if(a){const e=a[r.$toHTML]();e&&(t.title=e);const n=a.role.match(g);if(n){const e="heading",a=n[1];t.role=e;t["aria-level"]=a}}if("table"===e.layout)t.role="table";else if("row"===e.layout)t.role="row";else{const a=e[r.$getParent]();"row"===a.layout&&(a.assist&&"TH"===a.assist.role?t.role="columnheader":t.role="cell")}}function ariaLabel(e){if(!e.assist)return null;const t=e.assist;return t.speak&&""!==t.speak[r.$content]?t.speak[r.$content]:t.toolTip?t.toolTip[r.$content]:null}function valueToHtml(e){return o.HTMLResult.success({name:"div",attributes:{class:["xfaRich"],style:Object.create(null)},children:[{name:"span",attributes:{style:Object.create(null)},value:e}]})}function setFirstUnsplittable(e){const t=e[r.$getTemplateRoot]();if(null===t[r.$extra].firstUnsplittable){t[r.$extra].firstUnsplittable=e;t[r.$extra].noLayoutFailure=!0}}function unsetFirstUnsplittable(e){const t=e[r.$getTemplateRoot]();t[r.$extra].firstUnsplittable===e&&(t[r.$extra].noLayoutFailure=!1)}function handleBreak(e){if(e[r.$extra])return!1;e[r.$extra]=Object.create(null);if("auto"===e.targetType)return!1;const t=e[r.$getTemplateRoot]();let a=null;if(e.target){a=t[r.$searchNode](e.target,e[r.$getParent]());if(!a)return!1;a=a[0]}const{currentPageArea:n,currentContentArea:i}=t[r.$extra];if("pageArea"===e.targetType){a instanceof PageArea||(a=null);if(e.startNew){e[r.$extra].target=a||n;return!0}if(a&&a!==n){e[r.$extra].target=a;return!0}return!1}a instanceof ContentArea||(a=null);const s=a&&a[r.$getParent]();let o,c=s;if(e.startNew)if(a){const e=s.contentArea.children,t=e.indexOf(i),r=e.indexOf(a);-1!==t&&t<r&&(c=null);o=r-1}else o=n.contentArea.children.indexOf(i);else{if(!a||a===i)return!1;o=s.contentArea.children.indexOf(a)-1;c=s===n?null:s}e[r.$extra].target=c;e[r.$extra].index=o;return!0}function handleOverflow(e,t,a){const n=e[r.$getTemplateRoot](),i=n[r.$extra].noLayoutFailure,s=t[r.$getSubformParent];t[r.$getSubformParent]=()=>e;n[r.$extra].noLayoutFailure=!0;const o=t[r.$toHTML](a);e[r.$addHTML](o.html,o.bbox);n[r.$extra].noLayoutFailure=i;t[r.$getSubformParent]=s}class AppearanceFilter extends r.StringObject{constructor(e){super(d,"appearanceFilter");this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||""}}class Arc extends r.XFAObject{constructor(e){super(d,"arc",!0);this.circular=(0,o.getInteger)({data:e.circular,defaultValue:0,validate:e=>1===e});this.hand=(0,o.getStringOption)(e.hand,["even","left","right"]);this.id=e.id||"";this.startAngle=(0,o.getFloat)({data:e.startAngle,defaultValue:0,validate:e=>!0});this.sweepAngle=(0,o.getFloat)({data:e.sweepAngle,defaultValue:360,validate:e=>!0});this.use=e.use||"";this.usehref=e.usehref||"";this.edge=null;this.fill=null}[r.$toHTML](){const e=this.edge||new Edge({}),t=e[r.$toStyle](),a=Object.create(null);this.fill&&"visible"===this.fill.presence?Object.assign(a,this.fill[r.$toStyle]()):a.fill="transparent";a.strokeWidth=(0,s.measureToString)("visible"===e.presence?e.thickness:0);a.stroke=t.color;let n;const i={xmlns:f,style:{width:"100%",height:"100%",overflow:"visible"}};if(360===this.sweepAngle)n={name:"ellipse",attributes:{xmlns:f,cx:"50%",cy:"50%",rx:"50%",ry:"50%",style:a}};else{const e=this.startAngle*Math.PI/180,t=this.sweepAngle*Math.PI/180,r=this.sweepAngle>180?1:0,[s,o,c,l]=[50*(1+Math.cos(e)),50*(1-Math.sin(e)),50*(1+Math.cos(e+t)),50*(1-Math.sin(e+t))];n={name:"path",attributes:{xmlns:f,d:`M ${s} ${o} A 50 50 0 ${r} 0 ${c} ${l}`,vectorEffect:"non-scaling-stroke",style:a}};Object.assign(i,{viewBox:"0 0 100 100",preserveAspectRatio:"none"})}const c={name:"svg",children:[n],attributes:i};if(hasMargin(this[r.$getParent]()[r.$getParent]()))return o.HTMLResult.success({name:"div",attributes:{style:{display:"inline",width:"100%",height:"100%"}},children:[c]});c.attributes.style.position="absolute";return o.HTMLResult.success(c)}}class Area extends r.XFAObject{constructor(e){super(d,"area",!0);this.colSpan=(0,o.getInteger)({data:e.colSpan,defaultValue:1,validate:e=>e>=1||-1===e});this.id=e.id||"";this.name=e.name||"";this.relevant=(0,o.getRelevant)(e.relevant);this.use=e.use||"";this.usehref=e.usehref||"";this.x=(0,o.getMeasurement)(e.x,"0pt");this.y=(0,o.getMeasurement)(e.y,"0pt");this.desc=null;this.extras=null;this.area=new r.XFAObjectArray;this.draw=new r.XFAObjectArray;this.exObject=new r.XFAObjectArray;this.exclGroup=new r.XFAObjectArray;this.field=new r.XFAObjectArray;this.subform=new r.XFAObjectArray;this.subformSet=new r.XFAObjectArray}*[r.$getContainedChildren](){yield*getContainedChildren(this)}[r.$isTransparent](){return!0}[r.$isBindable](){return!0}[r.$addHTML](e,t){const[a,n,i,s]=t;this[r.$extra].width=Math.max(this[r.$extra].width,a+i);this[r.$extra].height=Math.max(this[r.$extra].height,n+s);this[r.$extra].children.push(e)}[r.$getAvailableSpace](){return this[r.$extra].availableSpace}[r.$toHTML](e){const t=(0,s.toStyle)(this,"position"),a={style:t,id:this[r.$uid],class:["xfaArea"]};(0,s.isPrintOnly)(this)&&a.class.push("xfaPrintOnly");this.name&&(a.xfaName=this.name);const n=[];this[r.$extra]={children:n,width:0,height:0,availableSpace:e};const i=this[r.$childrenToHTML]({filter:new Set(["area","draw","field","exclGroup","subform","subformSet"]),include:!0});if(!i.success){if(i.isBreak())return i;delete this[r.$extra];return o.HTMLResult.FAILURE}t.width=(0,s.measureToString)(this[r.$extra].width);t.height=(0,s.measureToString)(this[r.$extra].height);const c={name:"div",attributes:a,children:n},l=[this.x,this.y,this[r.$extra].width,this[r.$extra].height];delete this[r.$extra];return o.HTMLResult.success(c,l)}}class Assist extends r.XFAObject{constructor(e){super(d,"assist",!0);this.id=e.id||"";this.role=e.role||"";this.use=e.use||"";this.usehref=e.usehref||"";this.speak=null;this.toolTip=null}[r.$toHTML](){return this.toolTip&&this.toolTip[r.$content]?this.toolTip[r.$content]:null}}class Barcode extends r.XFAObject{constructor(e){super(d,"barcode",!0);this.charEncoding=(0,o.getKeyword)({data:e.charEncoding?e.charEncoding.toLowerCase():"",defaultValue:"",validate:e=>["utf-8","big-five","fontspecific","gbk","gb-18030","gb-2312","ksc-5601","none","shift-jis","ucs-2","utf-16"].includes(e)||e.match(/iso-8859-\d{2}/)});this.checksum=(0,o.getStringOption)(e.checksum,["none","1mod10","1mod10_1mod11","2mod10","auto"]);this.dataColumnCount=(0,o.getInteger)({data:e.dataColumnCount,defaultValue:-1,validate:e=>e>=0});this.dataLength=(0,o.getInteger)({data:e.dataLength,defaultValue:-1,validate:e=>e>=0});this.dataPrep=(0,o.getStringOption)(e.dataPrep,["none","flateCompress"]);this.dataRowCount=(0,o.getInteger)({data:e.dataRowCount,defaultValue:-1,validate:e=>e>=0});this.endChar=e.endChar||"";this.errorCorrectionLevel=(0,o.getInteger)({data:e.errorCorrectionLevel,defaultValue:-1,validate:e=>e>=0&&e<=8});this.id=e.id||"";this.moduleHeight=(0,o.getMeasurement)(e.moduleHeight,"5mm");this.moduleWidth=(0,o.getMeasurement)(e.moduleWidth,"0.25mm");this.printCheckDigit=(0,o.getInteger)({data:e.printCheckDigit,defaultValue:0,validate:e=>1===e});this.rowColumnRatio=(0,o.getRatio)(e.rowColumnRatio);this.startChar=e.startChar||"";this.textLocation=(0,o.getStringOption)(e.textLocation,["below","above","aboveEmbedded","belowEmbedded","none"]);this.truncate=(0,o.getInteger)({data:e.truncate,defaultValue:0,validate:e=>1===e});this.type=(0,o.getStringOption)(e.type?e.type.toLowerCase():"",["aztec","codabar","code2of5industrial","code2of5interleaved","code2of5matrix","code2of5standard","code3of9","code3of9extended","code11","code49","code93","code128","code128a","code128b","code128c","code128sscc","datamatrix","ean8","ean8add2","ean8add5","ean13","ean13add2","ean13add5","ean13pwcd","fim","logmars","maxicode","msi","pdf417","pdf417macro","plessey","postauscust2","postauscust3","postausreplypaid","postausstandard","postukrm4scc","postusdpbc","postusimb","postusstandard","postus5zip","qrcode","rfid","rss14","rss14expanded","rss14limited","rss14stacked","rss14stackedomni","rss14truncated","telepen","ucc128","ucc128random","ucc128sscc","upca","upcaadd2","upcaadd5","upcapwcd","upce","upceadd2","upceadd5","upcean2","upcean5","upsmaxicode"]);this.upsMode=(0,o.getStringOption)(e.upsMode,["usCarrier","internationalCarrier","secureSymbol","standardSymbol"]);this.use=e.use||"";this.usehref=e.usehref||"";this.wideNarrowRatio=(0,o.getRatio)(e.wideNarrowRatio);this.encrypt=null;this.extras=null}}class Bind extends r.XFAObject{constructor(e){super(d,"bind",!0);this.match=(0,o.getStringOption)(e.match,["once","dataRef","global","none"]);this.ref=e.ref||"";this.picture=null}}class BindItems extends r.XFAObject{constructor(e){super(d,"bindItems");this.connection=e.connection||"";this.labelRef=e.labelRef||"";this.ref=e.ref||"";this.valueRef=e.valueRef||""}}t.BindItems=BindItems;class Bookend extends r.XFAObject{constructor(e){super(d,"bookend");this.id=e.id||"";this.leader=e.leader||"";this.trailer=e.trailer||"";this.use=e.use||"";this.usehref=e.usehref||""}}class BooleanElement extends r.Option01{constructor(e){super(d,"boolean");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}[r.$toHTML](e){return valueToHtml(1===this[r.$content]?"1":"0")}}class Border extends r.XFAObject{constructor(e){super(d,"border",!0);this.break=(0,o.getStringOption)(e.break,["close","open"]);this.hand=(0,o.getStringOption)(e.hand,["even","left","right"]);this.id=e.id||"";this.presence=(0,o.getStringOption)(e.presence,["visible","hidden","inactive","invisible"]);this.relevant=(0,o.getRelevant)(e.relevant);this.use=e.use||"";this.usehref=e.usehref||"";this.corner=new r.XFAObjectArray(4);this.edge=new r.XFAObjectArray(4);this.extras=null;this.fill=null;this.margin=null}[r.$getExtra](){if(!this[r.$extra]){const e=this.edge.children.slice();if(e.length<4){const t=e.at(-1)||new Edge({});for(let a=e.length;a<4;a++)e.push(t)}const t=e.map((e=>e.thickness)),a=[0,0,0,0];if(this.margin){a[0]=this.margin.topInset;a[1]=this.margin.rightInset;a[2]=this.margin.bottomInset;a[3]=this.margin.leftInset}this[r.$extra]={widths:t,insets:a,edges:e}}return this[r.$extra]}[r.$toStyle](){const{edges:e}=this[r.$getExtra](),t=e.map((e=>{const t=e[r.$toStyle]();t.color=t.color||"#000000";return t})),a=Object.create(null);this.margin&&Object.assign(a,this.margin[r.$toStyle]());this.fill&&"visible"===this.fill.presence&&Object.assign(a,this.fill[r.$toStyle]());if(this.corner.children.some((e=>0!==e.radius))){const e=this.corner.children.map((e=>e[r.$toStyle]()));if(2===e.length||3===e.length){const t=e.at(-1);for(let a=e.length;a<4;a++)e.push(t)}a.borderRadius=e.map((e=>e.radius)).join(" ")}switch(this.presence){case"invisible":case"hidden":a.borderStyle="";break;case"inactive":a.borderStyle="none";break;default:a.borderStyle=t.map((e=>e.style)).join(" ")}a.borderWidth=t.map((e=>e.width)).join(" ");a.borderColor=t.map((e=>e.color)).join(" ");return a}}class Break extends r.XFAObject{constructor(e){super(d,"break",!0);this.after=(0,o.getStringOption)(e.after,["auto","contentArea","pageArea","pageEven","pageOdd"]);this.afterTarget=e.afterTarget||"";this.before=(0,o.getStringOption)(e.before,["auto","contentArea","pageArea","pageEven","pageOdd"]);this.beforeTarget=e.beforeTarget||"";this.bookendLeader=e.bookendLeader||"";this.bookendTrailer=e.bookendTrailer||"";this.id=e.id||"";this.overflowLeader=e.overflowLeader||"";this.overflowTarget=e.overflowTarget||"";this.overflowTrailer=e.overflowTrailer||"";this.startNew=(0,o.getInteger)({data:e.startNew,defaultValue:0,validate:e=>1===e});this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null}}class BreakAfter extends r.XFAObject{constructor(e){super(d,"breakAfter",!0);this.id=e.id||"";this.leader=e.leader||"";this.startNew=(0,o.getInteger)({data:e.startNew,defaultValue:0,validate:e=>1===e});this.target=e.target||"";this.targetType=(0,o.getStringOption)(e.targetType,["auto","contentArea","pageArea"]);this.trailer=e.trailer||"";this.use=e.use||"";this.usehref=e.usehref||"";this.script=null}}class BreakBefore extends r.XFAObject{constructor(e){super(d,"breakBefore",!0);this.id=e.id||"";this.leader=e.leader||"";this.startNew=(0,o.getInteger)({data:e.startNew,defaultValue:0,validate:e=>1===e});this.target=e.target||"";this.targetType=(0,o.getStringOption)(e.targetType,["auto","contentArea","pageArea"]);this.trailer=e.trailer||"";this.use=e.use||"";this.usehref=e.usehref||"";this.script=null}[r.$toHTML](e){this[r.$extra]={};return o.HTMLResult.FAILURE}}class Button extends r.XFAObject{constructor(e){super(d,"button",!0);this.highlight=(0,o.getStringOption)(e.highlight,["inverted","none","outline","push"]);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null}[r.$toHTML](e){const t=this[r.$getParent]()[r.$getParent](),a={name:"button",attributes:{id:this[r.$uid],class:["xfaButton"],style:{}},children:[]};for(const e of t.event.children){if("click"!==e.activity||!e.script)continue;const t=(0,h.recoverJsURL)(e.script[r.$content]);if(!t)continue;const n=(0,s.fixURL)(t.url);n&&a.children.push({name:"a",attributes:{id:"link"+this[r.$uid],href:n,newWindow:t.newWindow,class:["xfaLink"],style:{}},children:[]})}return o.HTMLResult.success(a)}}class Calculate extends r.XFAObject{constructor(e){super(d,"calculate",!0);this.id=e.id||"";this.override=(0,o.getStringOption)(e.override,["disabled","error","ignore","warning"]);this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.message=null;this.script=null}}class Caption extends r.XFAObject{constructor(e){super(d,"caption",!0);this.id=e.id||"";this.placement=(0,o.getStringOption)(e.placement,["left","bottom","inline","right","top"]);this.presence=(0,o.getStringOption)(e.presence,["visible","hidden","inactive","invisible"]);this.reserve=Math.ceil((0,o.getMeasurement)(e.reserve));this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.font=null;this.margin=null;this.para=null;this.value=null}[r.$setValue](e){_setValue(this,e)}[r.$getExtra](e){if(!this[r.$extra]){let{width:t,height:a}=e;switch(this.placement){case"left":case"right":case"inline":t=this.reserve<=0?t:this.reserve;break;case"top":case"bottom":a=this.reserve<=0?a:this.reserve}this[r.$extra]=(0,s.layoutNode)(this,{width:t,height:a})}return this[r.$extra]}[r.$toHTML](e){if(!this.value)return o.HTMLResult.EMPTY;this[r.$pushPara]();const t=this.value[r.$toHTML](e).html;if(!t){this[r.$popPara]();return o.HTMLResult.EMPTY}const a=this.reserve;if(this.reserve<=0){const{w:t,h:a}=this[r.$getExtra](e);switch(this.placement){case"left":case"right":case"inline":this.reserve=t;break;case"top":case"bottom":this.reserve=a}}const n=[];"string"==typeof t?n.push({name:"#text",value:t}):n.push(t);const i=(0,s.toStyle)(this,"font","margin","visibility");switch(this.placement){case"left":case"right":this.reserve>0&&(i.width=(0,s.measureToString)(this.reserve));break;case"top":case"bottom":this.reserve>0&&(i.height=(0,s.measureToString)(this.reserve))}(0,s.setPara)(this,null,t);this[r.$popPara]();this.reserve=a;return o.HTMLResult.success({name:"div",attributes:{style:i,class:["xfaCaption"]},children:n})}}class Certificate extends r.StringObject{constructor(e){super(d,"certificate");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Certificates extends r.XFAObject{constructor(e){super(d,"certificates",!0);this.credentialServerPolicy=(0,o.getStringOption)(e.credentialServerPolicy,["optional","required"]);this.id=e.id||"";this.url=e.url||"";this.urlPolicy=e.urlPolicy||"";this.use=e.use||"";this.usehref=e.usehref||"";this.encryption=null;this.issuers=null;this.keyUsage=null;this.oids=null;this.signing=null;this.subjectDNs=null}}class CheckButton extends r.XFAObject{constructor(e){super(d,"checkButton",!0);this.id=e.id||"";this.mark=(0,o.getStringOption)(e.mark,["default","check","circle","cross","diamond","square","star"]);this.shape=(0,o.getStringOption)(e.shape,["square","round"]);this.size=(0,o.getMeasurement)(e.size,"10pt");this.use=e.use||"";this.usehref=e.usehref||"";this.border=null;this.extras=null;this.margin=null}[r.$toHTML](e){const t=(0,s.toStyle)("margin"),a=(0,s.measureToString)(this.size);t.width=t.height=a;let n,i,c;const l=this[r.$getParent]()[r.$getParent](),h=l.items.children.length&&l.items.children[0][r.$toHTML]().html||[],u={on:(void 0!==h[0]?h[0]:"on").toString(),off:(void 0!==h[1]?h[1]:"off").toString()},d=(l.value&&l.value[r.$text]()||"off")===u.on||void 0,f=l[r.$getSubformParent](),g=l[r.$uid];let p;if(f instanceof ExclGroup){c=f[r.$uid];n="radio";i="xfaRadio";p=f[r.$data]&&f[r.$data][r.$uid]||f[r.$uid]}else{n="checkbox";i="xfaCheckbox";p=l[r.$data]&&l[r.$data][r.$uid]||l[r.$uid]}const m={name:"input",attributes:{class:[i],style:t,fieldId:g,dataId:p,type:n,checked:d,xfaOn:u.on,xfaOff:u.off,"aria-label":ariaLabel(l),"aria-required":!1}};c&&(m.attributes.name=c);if(isRequired(l)){m.attributes["aria-required"]=!0;m.attributes.required=!0}return o.HTMLResult.success({name:"label",attributes:{class:["xfaLabel"]},children:[m]})}}class ChoiceList extends r.XFAObject{constructor(e){super(d,"choiceList",!0);this.commitOn=(0,o.getStringOption)(e.commitOn,["select","exit"]);this.id=e.id||"";this.open=(0,o.getStringOption)(e.open,["userControl","always","multiSelect","onEntry"]);this.textEntry=(0,o.getInteger)({data:e.textEntry,defaultValue:0,validate:e=>1===e});this.use=e.use||"";this.usehref=e.usehref||"";this.border=null;this.extras=null;this.margin=null}[r.$toHTML](e){const t=(0,s.toStyle)(this,"border","margin"),a=this[r.$getParent]()[r.$getParent](),n={fontSize:`calc(${a.font&&a.font.size||10}px * var(--scale-factor))`},i=[];if(a.items.children.length>0){const e=a.items;let t=0,s=0;if(2===e.children.length){t=e.children[0].save;s=1-t}const o=e.children[t][r.$toHTML]().html,c=e.children[s][r.$toHTML]().html;let l=!1;const h=a.value&&a.value[r.$text]()||"";for(let e=0,t=o.length;e<t;e++){const t={name:"option",attributes:{value:c[e]||o[e],style:n},value:o[e]};c[e]===h&&(t.attributes.selected=l=!0);i.push(t)}l||i.splice(0,0,{name:"option",attributes:{hidden:!0,selected:!0},value:" "})}const c={class:["xfaSelect"],fieldId:a[r.$uid],dataId:a[r.$data]&&a[r.$data][r.$uid]||a[r.$uid],style:t,"aria-label":ariaLabel(a),"aria-required":!1};if(isRequired(a)){c["aria-required"]=!0;c.required=!0}"multiSelect"===this.open&&(c.multiple=!0);return o.HTMLResult.success({name:"label",attributes:{class:["xfaLabel"]},children:[{name:"select",children:i,attributes:c}]})}}class Color extends r.XFAObject{constructor(e){super(d,"color",!0);this.cSpace=(0,o.getStringOption)(e.cSpace,["SRGB"]);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.value=e.value?(0,o.getColor)(e.value):"";this.extras=null}[r.$hasSettableValue](){return!1}[r.$toStyle](){return this.value?c.Util.makeHexColor(this.value.r,this.value.g,this.value.b):null}}class Comb extends r.XFAObject{constructor(e){super(d,"comb");this.id=e.id||"";this.numberOfCells=(0,o.getInteger)({data:e.numberOfCells,defaultValue:0,validate:e=>e>=0});this.use=e.use||"";this.usehref=e.usehref||""}}class Connect extends r.XFAObject{constructor(e){super(d,"connect",!0);this.connection=e.connection||"";this.id=e.id||"";this.ref=e.ref||"";this.usage=(0,o.getStringOption)(e.usage,["exportAndImport","exportOnly","importOnly"]);this.use=e.use||"";this.usehref=e.usehref||"";this.picture=null}}class ContentArea extends r.XFAObject{constructor(e){super(d,"contentArea",!0);this.h=(0,o.getMeasurement)(e.h);this.id=e.id||"";this.name=e.name||"";this.relevant=(0,o.getRelevant)(e.relevant);this.use=e.use||"";this.usehref=e.usehref||"";this.w=(0,o.getMeasurement)(e.w);this.x=(0,o.getMeasurement)(e.x,"0pt");this.y=(0,o.getMeasurement)(e.y,"0pt");this.desc=null;this.extras=null}[r.$toHTML](e){const t={left:(0,s.measureToString)(this.x),top:(0,s.measureToString)(this.y),width:(0,s.measureToString)(this.w),height:(0,s.measureToString)(this.h)},a=["xfaContentarea"];(0,s.isPrintOnly)(this)&&a.push("xfaPrintOnly");return o.HTMLResult.success({name:"div",children:[],attributes:{style:t,class:a,id:this[r.$uid]}})}}class Corner extends r.XFAObject{constructor(e){super(d,"corner",!0);this.id=e.id||"";this.inverted=(0,o.getInteger)({data:e.inverted,defaultValue:0,validate:e=>1===e});this.join=(0,o.getStringOption)(e.join,["square","round"]);this.presence=(0,o.getStringOption)(e.presence,["visible","hidden","inactive","invisible"]);this.radius=(0,o.getMeasurement)(e.radius);this.stroke=(0,o.getStringOption)(e.stroke,["solid","dashDot","dashDotDot","dashed","dotted","embossed","etched","lowered","raised"]);this.thickness=(0,o.getMeasurement)(e.thickness,"0.5pt");this.use=e.use||"";this.usehref=e.usehref||"";this.color=null;this.extras=null}[r.$toStyle](){const e=(0,s.toStyle)(this,"visibility");e.radius=(0,s.measureToString)("square"===this.join?0:this.radius);return e}}class DateElement extends r.ContentObject{constructor(e){super(d,"date");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}[r.$finalize](){const e=this[r.$content].trim();this[r.$content]=e?new Date(e):null}[r.$toHTML](e){return valueToHtml(this[r.$content]?this[r.$content].toString():"")}}class DateTime extends r.ContentObject{constructor(e){super(d,"dateTime");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}[r.$finalize](){const e=this[r.$content].trim();this[r.$content]=e?new Date(e):null}[r.$toHTML](e){return valueToHtml(this[r.$content]?this[r.$content].toString():"")}}class DateTimeEdit extends r.XFAObject{constructor(e){super(d,"dateTimeEdit",!0);this.hScrollPolicy=(0,o.getStringOption)(e.hScrollPolicy,["auto","off","on"]);this.id=e.id||"";this.picker=(0,o.getStringOption)(e.picker,["host","none"]);this.use=e.use||"";this.usehref=e.usehref||"";this.border=null;this.comb=null;this.extras=null;this.margin=null}[r.$toHTML](e){const t=(0,s.toStyle)(this,"border","font","margin"),a=this[r.$getParent]()[r.$getParent](),n={name:"input",attributes:{type:"text",fieldId:a[r.$uid],dataId:a[r.$data]&&a[r.$data][r.$uid]||a[r.$uid],class:["xfaTextfield"],style:t,"aria-label":ariaLabel(a),"aria-required":!1}};if(isRequired(a)){n.attributes["aria-required"]=!0;n.attributes.required=!0}return o.HTMLResult.success({name:"label",attributes:{class:["xfaLabel"]},children:[n]})}}class Decimal extends r.ContentObject{constructor(e){super(d,"decimal");this.fracDigits=(0,o.getInteger)({data:e.fracDigits,defaultValue:2,validate:e=>!0});this.id=e.id||"";this.leadDigits=(0,o.getInteger)({data:e.leadDigits,defaultValue:-1,validate:e=>!0});this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}[r.$finalize](){const e=parseFloat(this[r.$content].trim());this[r.$content]=isNaN(e)?null:e}[r.$toHTML](e){return valueToHtml(null!==this[r.$content]?this[r.$content].toString():"")}}class DefaultUi extends r.XFAObject{constructor(e){super(d,"defaultUi",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null}}class Desc extends r.XFAObject{constructor(e){super(d,"desc",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.boolean=new r.XFAObjectArray;this.date=new r.XFAObjectArray;this.dateTime=new r.XFAObjectArray;this.decimal=new r.XFAObjectArray;this.exData=new r.XFAObjectArray;this.float=new r.XFAObjectArray;this.image=new r.XFAObjectArray;this.integer=new r.XFAObjectArray;this.text=new r.XFAObjectArray;this.time=new r.XFAObjectArray}}class DigestMethod extends r.OptionObject{constructor(e){super(d,"digestMethod",["","SHA1","SHA256","SHA512","RIPEMD160"]);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||""}}class DigestMethods extends r.XFAObject{constructor(e){super(d,"digestMethods",!0);this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.digestMethod=new r.XFAObjectArray}}class Draw extends r.XFAObject{constructor(e){super(d,"draw",!0);this.anchorType=(0,o.getStringOption)(e.anchorType,["topLeft","bottomCenter","bottomLeft","bottomRight","middleCenter","middleLeft","middleRight","topCenter","topRight"]);this.colSpan=(0,o.getInteger)({data:e.colSpan,defaultValue:1,validate:e=>e>=1||-1===e});this.h=e.h?(0,o.getMeasurement)(e.h):"";this.hAlign=(0,o.getStringOption)(e.hAlign,["left","center","justify","justifyAll","radix","right"]);this.id=e.id||"";this.locale=e.locale||"";this.maxH=(0,o.getMeasurement)(e.maxH,"0pt");this.maxW=(0,o.getMeasurement)(e.maxW,"0pt");this.minH=(0,o.getMeasurement)(e.minH,"0pt");this.minW=(0,o.getMeasurement)(e.minW,"0pt");this.name=e.name||"";this.presence=(0,o.getStringOption)(e.presence,["visible","hidden","inactive","invisible"]);this.relevant=(0,o.getRelevant)(e.relevant);this.rotate=(0,o.getInteger)({data:e.rotate,defaultValue:0,validate:e=>e%90==0});this.use=e.use||"";this.usehref=e.usehref||"";this.w=e.w?(0,o.getMeasurement)(e.w):"";this.x=(0,o.getMeasurement)(e.x,"0pt");this.y=(0,o.getMeasurement)(e.y,"0pt");this.assist=null;this.border=null;this.caption=null;this.desc=null;this.extras=null;this.font=null;this.keep=null;this.margin=null;this.para=null;this.traversal=null;this.ui=null;this.value=null;this.setProperty=new r.XFAObjectArray}[r.$setValue](e){_setValue(this,e)}[r.$toHTML](e){setTabIndex(this);if("hidden"===this.presence||"inactive"===this.presence)return o.HTMLResult.EMPTY;(0,s.fixDimensions)(this);this[r.$pushPara]();const t=this.w,a=this.h,{w:n,h:c,isBroken:l}=(0,s.layoutNode)(this,e);if(n&&""===this.w){if(l&&this[r.$getSubformParent]()[r.$isThereMoreWidth]()){this[r.$popPara]();return o.HTMLResult.FAILURE}this.w=n}c&&""===this.h&&(this.h=c);setFirstUnsplittable(this);if(!(0,i.checkDimensions)(this,e)){this.w=t;this.h=a;this[r.$popPara]();return o.HTMLResult.FAILURE}unsetFirstUnsplittable(this);const h=(0,s.toStyle)(this,"font","hAlign","dimensions","position","presence","rotate","anchorType","border","margin");(0,s.setMinMaxDimensions)(this,h);if(h.margin){h.padding=h.margin;delete h.margin}const u=["xfaDraw"];this.font&&u.push("xfaFont");(0,s.isPrintOnly)(this)&&u.push("xfaPrintOnly");const d={style:h,id:this[r.$uid],class:u};this.name&&(d.xfaName=this.name);const f={name:"div",attributes:d,children:[]};applyAssist(this,d);const g=(0,s.computeBbox)(this,f,e),p=this.value?this.value[r.$toHTML](e).html:null;if(null===p){this.w=t;this.h=a;this[r.$popPara]();return o.HTMLResult.success((0,s.createWrapper)(this,f),g)}f.children.push(p);(0,s.setPara)(this,h,p);this.w=t;this.h=a;this[r.$popPara]();return o.HTMLResult.success((0,s.createWrapper)(this,f),g)}}class Edge extends r.XFAObject{constructor(e){super(d,"edge",!0);this.cap=(0,o.getStringOption)(e.cap,["square","butt","round"]);this.id=e.id||"";this.presence=(0,o.getStringOption)(e.presence,["visible","hidden","inactive","invisible"]);this.stroke=(0,o.getStringOption)(e.stroke,["solid","dashDot","dashDotDot","dashed","dotted","embossed","etched","lowered","raised"]);this.thickness=(0,o.getMeasurement)(e.thickness,"0.5pt");this.use=e.use||"";this.usehref=e.usehref||"";this.color=null;this.extras=null}[r.$toStyle](){const e=(0,s.toStyle)(this,"visibility");Object.assign(e,{linecap:this.cap,width:(0,s.measureToString)(this.thickness),color:this.color?this.color[r.$toStyle]():"#000000",style:""});if("visible"!==this.presence)e.style="none";else switch(this.stroke){case"solid":e.style="solid";break;case"dashDot":case"dashDotDot":case"dashed":e.style="dashed";break;case"dotted":e.style="dotted";break;case"embossed":e.style="ridge";break;case"etched":e.style="groove";break;case"lowered":e.style="inset";break;case"raised":e.style="outset"}return e}}class Encoding extends r.OptionObject{constructor(e){super(d,"encoding",["adbe.x509.rsa_sha1","adbe.pkcs7.detached","adbe.pkcs7.sha1"]);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Encodings extends r.XFAObject{constructor(e){super(d,"encodings",!0);this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.encoding=new r.XFAObjectArray}}class Encrypt extends r.XFAObject{constructor(e){super(d,"encrypt",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.certificate=null}}class EncryptData extends r.XFAObject{constructor(e){super(d,"encryptData",!0);this.id=e.id||"";this.operation=(0,o.getStringOption)(e.operation,["encrypt","decrypt"]);this.target=e.target||"";this.use=e.use||"";this.usehref=e.usehref||"";this.filter=null;this.manifest=null}}class Encryption extends r.XFAObject{constructor(e){super(d,"encryption",!0);this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.certificate=new r.XFAObjectArray}}class EncryptionMethod extends r.OptionObject{constructor(e){super(d,"encryptionMethod",["","AES256-CBC","TRIPLEDES-CBC","AES128-CBC","AES192-CBC"]);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||""}}class EncryptionMethods extends r.XFAObject{constructor(e){super(d,"encryptionMethods",!0);this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.encryptionMethod=new r.XFAObjectArray}}class Event extends r.XFAObject{constructor(e){super(d,"event",!0);this.activity=(0,o.getStringOption)(e.activity,["click","change","docClose","docReady","enter","exit","full","indexChange","initialize","mouseDown","mouseEnter","mouseExit","mouseUp","postExecute","postOpen","postPrint","postSave","postSign","postSubmit","preExecute","preOpen","prePrint","preSave","preSign","preSubmit","ready","validationState"]);this.id=e.id||"";this.listen=(0,o.getStringOption)(e.listen,["refOnly","refAndDescendents"]);this.name=e.name||"";this.ref=e.ref||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.encryptData=null;this.execute=null;this.script=null;this.signData=null;this.submit=null}}class ExData extends r.ContentObject{constructor(e){super(d,"exData");this.contentType=e.contentType||"";this.href=e.href||"";this.id=e.id||"";this.maxLength=(0,o.getInteger)({data:e.maxLength,defaultValue:-1,validate:e=>e>=-1});this.name=e.name||"";this.rid=e.rid||"";this.transferEncoding=(0,o.getStringOption)(e.transferEncoding,["none","base64","package"]);this.use=e.use||"";this.usehref=e.usehref||""}[r.$isCDATAXml](){return"text/html"===this.contentType}[r.$onChild](e){if("text/html"===this.contentType&&e[r.$namespaceId]===n.NamespaceIds.xhtml.id){this[r.$content]=e;return!0}if("text/xml"===this.contentType){this[r.$content]=e;return!0}return!1}[r.$toHTML](e){return"text/html"===this.contentType&&this[r.$content]?this[r.$content][r.$toHTML](e):o.HTMLResult.EMPTY}}class ExObject extends r.XFAObject{constructor(e){super(d,"exObject",!0);this.archive=e.archive||"";this.classId=e.classId||"";this.codeBase=e.codeBase||"";this.codeType=e.codeType||"";this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.boolean=new r.XFAObjectArray;this.date=new r.XFAObjectArray;this.dateTime=new r.XFAObjectArray;this.decimal=new r.XFAObjectArray;this.exData=new r.XFAObjectArray;this.exObject=new r.XFAObjectArray;this.float=new r.XFAObjectArray;this.image=new r.XFAObjectArray;this.integer=new r.XFAObjectArray;this.text=new r.XFAObjectArray;this.time=new r.XFAObjectArray}}class ExclGroup extends r.XFAObject{constructor(e){super(d,"exclGroup",!0);this.access=(0,o.getStringOption)(e.access,["open","nonInteractive","protected","readOnly"]);this.accessKey=e.accessKey||"";this.anchorType=(0,o.getStringOption)(e.anchorType,["topLeft","bottomCenter","bottomLeft","bottomRight","middleCenter","middleLeft","middleRight","topCenter","topRight"]);this.colSpan=(0,o.getInteger)({data:e.colSpan,defaultValue:1,validate:e=>e>=1||-1===e});this.h=e.h?(0,o.getMeasurement)(e.h):"";this.hAlign=(0,o.getStringOption)(e.hAlign,["left","center","justify","justifyAll","radix","right"]);this.id=e.id||"";this.layout=(0,o.getStringOption)(e.layout,["position","lr-tb","rl-row","rl-tb","row","table","tb"]);this.maxH=(0,o.getMeasurement)(e.maxH,"0pt");this.maxW=(0,o.getMeasurement)(e.maxW,"0pt");this.minH=(0,o.getMeasurement)(e.minH,"0pt");this.minW=(0,o.getMeasurement)(e.minW,"0pt");this.name=e.name||"";this.presence=(0,o.getStringOption)(e.presence,["visible","hidden","inactive","invisible"]);this.relevant=(0,o.getRelevant)(e.relevant);this.use=e.use||"";this.usehref=e.usehref||"";this.w=e.w?(0,o.getMeasurement)(e.w):"";this.x=(0,o.getMeasurement)(e.x,"0pt");this.y=(0,o.getMeasurement)(e.y,"0pt");this.assist=null;this.bind=null;this.border=null;this.calculate=null;this.caption=null;this.desc=null;this.extras=null;this.margin=null;this.para=null;this.traversal=null;this.validate=null;this.connect=new r.XFAObjectArray;this.event=new r.XFAObjectArray;this.field=new r.XFAObjectArray;this.setProperty=new r.XFAObjectArray}[r.$isBindable](){return!0}[r.$hasSettableValue](){return!0}[r.$setValue](e){for(const t of this.field.children){if(!t.value){const e=new Value({});t[r.$appendChild](e);t.value=e}t.value[r.$setValue](e)}}[r.$isThereMoreWidth](){return this.layout.endsWith("-tb")&&0===this[r.$extra].attempt&&this[r.$extra].numberInLine>0||this[r.$getParent]()[r.$isThereMoreWidth]()}[r.$isSplittable](){const e=this[r.$getSubformParent]();if(!e[r.$isSplittable]())return!1;if(void 0!==this[r.$extra]._isSplittable)return this[r.$extra]._isSplittable;if("position"===this.layout||this.layout.includes("row")){this[r.$extra]._isSplittable=!1;return!1}if(e.layout&&e.layout.endsWith("-tb")&&0!==e[r.$extra].numberInLine)return!1;this[r.$extra]._isSplittable=!0;return!0}[r.$flushHTML](){return(0,i.flushHTML)(this)}[r.$addHTML](e,t){(0,i.addHTML)(this,e,t)}[r.$getAvailableSpace](){return(0,i.getAvailableSpace)(this)}[r.$toHTML](e){setTabIndex(this);if("hidden"===this.presence||"inactive"===this.presence||0===this.h||0===this.w)return o.HTMLResult.EMPTY;(0,s.fixDimensions)(this);const t=[],a={id:this[r.$uid],class:[]};(0,s.setAccess)(this,a.class);this[r.$extra]||(this[r.$extra]=Object.create(null));Object.assign(this[r.$extra],{children:t,attributes:a,attempt:0,line:null,numberInLine:0,availableSpace:{width:Math.min(this.w||1/0,e.width),height:Math.min(this.h||1/0,e.height)},width:0,height:0,prevHeight:0,currentWidth:0});const n=this[r.$isSplittable]();n||setFirstUnsplittable(this);if(!(0,i.checkDimensions)(this,e))return o.HTMLResult.FAILURE;const c=new Set(["field"]);if(this.layout.includes("row")){const e=this[r.$getSubformParent]().columnWidths;if(Array.isArray(e)&&e.length>0){this[r.$extra].columnWidths=e;this[r.$extra].currentColumn=0}}const l=(0,s.toStyle)(this,"anchorType","dimensions","position","presence","border","margin","hAlign"),h=["xfaExclgroup"],u=(0,s.layoutClass)(this);u&&h.push(u);(0,s.isPrintOnly)(this)&&h.push("xfaPrintOnly");a.style=l;a.class=h;this.name&&(a.xfaName=this.name);this[r.$pushPara]();const d="lr-tb"===this.layout||"rl-tb"===this.layout,f=d?2:1;for(;this[r.$extra].attempt<f;this[r.$extra].attempt++){d&&1===this[r.$extra].attempt&&(this[r.$extra].numberInLine=0);const e=this[r.$childrenToHTML]({filter:c,include:!0});if(e.success)break;if(e.isBreak()){this[r.$popPara]();return e}if(d&&0===this[r.$extra].attempt&&0===this[r.$extra].numberInLine&&!this[r.$getTemplateRoot]()[r.$extra].noLayoutFailure){this[r.$extra].attempt=f;break}}this[r.$popPara]();n||unsetFirstUnsplittable(this);if(this[r.$extra].attempt===f){n||delete this[r.$extra];return o.HTMLResult.FAILURE}let g=0,p=0;if(this.margin){g=this.margin.leftInset+this.margin.rightInset;p=this.margin.topInset+this.margin.bottomInset}const m=Math.max(this[r.$extra].width+g,this.w||0),b=Math.max(this[r.$extra].height+p,this.h||0),y=[this.x,this.y,m,b];""===this.w&&(l.width=(0,s.measureToString)(m));""===this.h&&(l.height=(0,s.measureToString)(b));const w={name:"div",attributes:a,children:t};applyAssist(this,a);delete this[r.$extra];return o.HTMLResult.success((0,s.createWrapper)(this,w),y)}}class Execute extends r.XFAObject{constructor(e){super(d,"execute");this.connection=e.connection||"";this.executeType=(0,o.getStringOption)(e.executeType,["import","remerge"]);this.id=e.id||"";this.runAt=(0,o.getStringOption)(e.runAt,["client","both","server"]);this.use=e.use||"";this.usehref=e.usehref||""}}class Extras extends r.XFAObject{constructor(e){super(d,"extras",!0);this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||"";this.boolean=new r.XFAObjectArray;this.date=new r.XFAObjectArray;this.dateTime=new r.XFAObjectArray;this.decimal=new r.XFAObjectArray;this.exData=new r.XFAObjectArray;this.extras=new r.XFAObjectArray;this.float=new r.XFAObjectArray;this.image=new r.XFAObjectArray;this.integer=new r.XFAObjectArray;this.text=new r.XFAObjectArray;this.time=new r.XFAObjectArray}}class Field extends r.XFAObject{constructor(e){super(d,"field",!0);this.access=(0,o.getStringOption)(e.access,["open","nonInteractive","protected","readOnly"]);this.accessKey=e.accessKey||"";this.anchorType=(0,o.getStringOption)(e.anchorType,["topLeft","bottomCenter","bottomLeft","bottomRight","middleCenter","middleLeft","middleRight","topCenter","topRight"]);this.colSpan=(0,o.getInteger)({data:e.colSpan,defaultValue:1,validate:e=>e>=1||-1===e});this.h=e.h?(0,o.getMeasurement)(e.h):"";this.hAlign=(0,o.getStringOption)(e.hAlign,["left","center","justify","justifyAll","radix","right"]);this.id=e.id||"";this.locale=e.locale||"";this.maxH=(0,o.getMeasurement)(e.maxH,"0pt");this.maxW=(0,o.getMeasurement)(e.maxW,"0pt");this.minH=(0,o.getMeasurement)(e.minH,"0pt");this.minW=(0,o.getMeasurement)(e.minW,"0pt");this.name=e.name||"";this.presence=(0,o.getStringOption)(e.presence,["visible","hidden","inactive","invisible"]);this.relevant=(0,o.getRelevant)(e.relevant);this.rotate=(0,o.getInteger)({data:e.rotate,defaultValue:0,validate:e=>e%90==0});this.use=e.use||"";this.usehref=e.usehref||"";this.w=e.w?(0,o.getMeasurement)(e.w):"";this.x=(0,o.getMeasurement)(e.x,"0pt");this.y=(0,o.getMeasurement)(e.y,"0pt");this.assist=null;this.bind=null;this.border=null;this.calculate=null;this.caption=null;this.desc=null;this.extras=null;this.font=null;this.format=null;this.items=new r.XFAObjectArray(2);this.keep=null;this.margin=null;this.para=null;this.traversal=null;this.ui=null;this.validate=null;this.value=null;this.bindItems=new r.XFAObjectArray;this.connect=new r.XFAObjectArray;this.event=new r.XFAObjectArray;this.setProperty=new r.XFAObjectArray}[r.$isBindable](){return!0}[r.$setValue](e){_setValue(this,e)}[r.$toHTML](e){setTabIndex(this);if(!this.ui){this.ui=new Ui({});this.ui[r.$globalData]=this[r.$globalData];this[r.$appendChild](this.ui);let e;switch(this.items.children.length){case 0:e=new TextEdit({});this.ui.textEdit=e;break;case 1:e=new CheckButton({});this.ui.checkButton=e;break;case 2:e=new ChoiceList({});this.ui.choiceList=e}this.ui[r.$appendChild](e)}if(!this.ui||"hidden"===this.presence||"inactive"===this.presence||0===this.h||0===this.w)return o.HTMLResult.EMPTY;this.caption&&delete this.caption[r.$extra];this[r.$pushPara]();const t=this.caption?this.caption[r.$toHTML](e).html:null,a=this.w,n=this.h;let c=0,h=0;if(this.margin){c=this.margin.leftInset+this.margin.rightInset;h=this.margin.topInset+this.margin.bottomInset}let u=null;if(""===this.w||""===this.h){let t=null,a=null,n=0,i=0;if(this.ui.checkButton)n=i=this.ui.checkButton.size;else{const{w:t,h:a}=(0,s.layoutNode)(this,e);if(null!==t){n=t;i=a}else i=(0,l.getMetrics)(this.font,!0).lineNoGap}u=getBorderDims(this.ui[r.$getExtra]());n+=u.w;i+=u.h;if(this.caption){const{w:s,h:c,isBroken:l}=this.caption[r.$getExtra](e);if(l&&this[r.$getSubformParent]()[r.$isThereMoreWidth]()){this[r.$popPara]();return o.HTMLResult.FAILURE}t=s;a=c;switch(this.caption.placement){case"left":case"right":case"inline":t+=n;break;case"top":case"bottom":a+=i}}else{t=n;a=i}if(t&&""===this.w){t+=c;this.w=Math.min(this.maxW<=0?1/0:this.maxW,this.minW+1<t?t:this.minW)}if(a&&""===this.h){a+=h;this.h=Math.min(this.maxH<=0?1/0:this.maxH,this.minH+1<a?a:this.minH)}}this[r.$popPara]();(0,s.fixDimensions)(this);setFirstUnsplittable(this);if(!(0,i.checkDimensions)(this,e)){this.w=a;this.h=n;this[r.$popPara]();return o.HTMLResult.FAILURE}unsetFirstUnsplittable(this);const d=(0,s.toStyle)(this,"font","dimensions","position","rotate","anchorType","presence","margin","hAlign");(0,s.setMinMaxDimensions)(this,d);const f=["xfaField"];this.font&&f.push("xfaFont");(0,s.isPrintOnly)(this)&&f.push("xfaPrintOnly");const g={style:d,id:this[r.$uid],class:f};if(d.margin){d.padding=d.margin;delete d.margin}(0,s.setAccess)(this,f);this.name&&(g.xfaName=this.name);const p=[],m={name:"div",attributes:g,children:p};applyAssist(this,g);const b=this.border?this.border[r.$toStyle]():null,y=(0,s.computeBbox)(this,m,e),w=this.ui[r.$toHTML]().html;if(!w){Object.assign(d,b);return o.HTMLResult.success((0,s.createWrapper)(this,m),y)}this[r.$tabIndex]&&(w.children&&w.children[0]?w.children[0].attributes.tabindex=this[r.$tabIndex]:w.attributes.tabindex=this[r.$tabIndex]);w.attributes.style||(w.attributes.style=Object.create(null));let S=null;if(this.ui.button){1===w.children.length&&([S]=w.children.splice(0,1));Object.assign(w.attributes.style,b)}else Object.assign(d,b);p.push(w);if(this.value)if(this.ui.imageEdit)w.children.push(this.value[r.$toHTML]().html);else if(!this.ui.button){let e="";if(this.value.exData)e=this.value.exData[r.$text]();else if(this.value.text)e=this.value.text[r.$getExtra]();else{const t=this.value[r.$toHTML]().html;null!==t&&(e=t.children[0].value)}this.ui.textEdit&&this.value.text&&this.value.text.maxChars&&(w.children[0].attributes.maxLength=this.value.text.maxChars);if(e){if(this.ui.numericEdit){e=parseFloat(e);e=isNaN(e)?"":e.toString()}"textarea"===w.children[0].name?w.children[0].attributes.textContent=e:w.children[0].attributes.value=e}}if(!this.ui.imageEdit&&w.children&&w.children[0]&&this.h){u=u||getBorderDims(this.ui[r.$getExtra]());let t=0;if(this.caption&&["top","bottom"].includes(this.caption.placement)){t=this.caption.reserve;t<=0&&(t=this.caption[r.$getExtra](e).h);const a=this.h-t-h-u.h;w.children[0].attributes.style.height=(0,s.measureToString)(a)}else w.children[0].attributes.style.height="100%"}S&&w.children.push(S);if(!t){w.attributes.class&&w.attributes.class.push("xfaLeft");this.w=a;this.h=n;return o.HTMLResult.success((0,s.createWrapper)(this,m),y)}if(this.ui.button){d.padding&&delete d.padding;"div"===t.name&&(t.name="span");w.children.push(t);return o.HTMLResult.success(m,y)}this.ui.checkButton&&(t.attributes.class[0]="xfaCaptionForCheckButton");w.attributes.class||(w.attributes.class=[]);w.children.splice(0,0,t);switch(this.caption.placement){case"left":case"inline":w.attributes.class.push("xfaLeft");break;case"right":w.attributes.class.push("xfaRight");break;case"top":w.attributes.class.push("xfaTop");break;case"bottom":w.attributes.class.push("xfaBottom")}this.w=a;this.h=n;return o.HTMLResult.success((0,s.createWrapper)(this,m),y)}}t.Field=Field;class Fill extends r.XFAObject{constructor(e){super(d,"fill",!0);this.id=e.id||"";this.presence=(0,o.getStringOption)(e.presence,["visible","hidden","inactive","invisible"]);this.use=e.use||"";this.usehref=e.usehref||"";this.color=null;this.extras=null;this.linear=null;this.pattern=null;this.radial=null;this.solid=null;this.stipple=null}[r.$toStyle](){const e=this[r.$getParent](),t=e[r.$getParent]()[r.$getParent](),a=Object.create(null);let n="color",i=n;if(e instanceof Border){n="background-color";i="background";t instanceof Ui&&(a.backgroundColor="white")}if(e instanceof Rectangle||e instanceof Arc){n=i="fill";a.fill="white"}for(const e of Object.getOwnPropertyNames(this)){if("extras"===e||"color"===e)continue;const t=this[e];if(!(t instanceof r.XFAObject))continue;const s=t[r.$toStyle](this.color);s&&(a[s.startsWith("#")?n:i]=s);return a}if(this.color&&this.color.value){const e=this.color[r.$toStyle]();a[e.startsWith("#")?n:i]=e}return a}}class Filter extends r.XFAObject{constructor(e){super(d,"filter",!0);this.addRevocationInfo=(0,o.getStringOption)(e.addRevocationInfo,["","required","optional","none"]);this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||"";this.version=(0,o.getInteger)({data:this.version,defaultValue:5,validate:e=>e>=1&&e<=5});this.appearanceFilter=null;this.certificates=null;this.digestMethods=null;this.encodings=null;this.encryptionMethods=null;this.handler=null;this.lockDocument=null;this.mdp=null;this.reasons=null;this.timeStamp=null}}class Float extends r.ContentObject{constructor(e){super(d,"float");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}[r.$finalize](){const e=parseFloat(this[r.$content].trim());this[r.$content]=isNaN(e)?null:e}[r.$toHTML](e){return valueToHtml(null!==this[r.$content]?this[r.$content].toString():"")}}class Font extends r.XFAObject{constructor(e){super(d,"font",!0);this.baselineShift=(0,o.getMeasurement)(e.baselineShift);this.fontHorizontalScale=(0,o.getFloat)({data:e.fontHorizontalScale,defaultValue:100,validate:e=>e>=0});this.fontVerticalScale=(0,o.getFloat)({data:e.fontVerticalScale,defaultValue:100,validate:e=>e>=0});this.id=e.id||"";this.kerningMode=(0,o.getStringOption)(e.kerningMode,["none","pair"]);this.letterSpacing=(0,o.getMeasurement)(e.letterSpacing,"0");this.lineThrough=(0,o.getInteger)({data:e.lineThrough,defaultValue:0,validate:e=>1===e||2===e});this.lineThroughPeriod=(0,o.getStringOption)(e.lineThroughPeriod,["all","word"]);this.overline=(0,o.getInteger)({data:e.overline,defaultValue:0,validate:e=>1===e||2===e});this.overlinePeriod=(0,o.getStringOption)(e.overlinePeriod,["all","word"]);this.posture=(0,o.getStringOption)(e.posture,["normal","italic"]);this.size=(0,o.getMeasurement)(e.size,"10pt");this.typeface=e.typeface||"Courier";this.underline=(0,o.getInteger)({data:e.underline,defaultValue:0,validate:e=>1===e||2===e});this.underlinePeriod=(0,o.getStringOption)(e.underlinePeriod,["all","word"]);this.use=e.use||"";this.usehref=e.usehref||"";this.weight=(0,o.getStringOption)(e.weight,["normal","bold"]);this.extras=null;this.fill=null}[r.$clean](e){super[r.$clean](e);this[r.$globalData].usedTypefaces.add(this.typeface)}[r.$toStyle](){const e=(0,s.toStyle)(this,"fill"),t=e.color;if(t)if("#000000"===t)delete e.color;else if(!t.startsWith("#")){e.background=t;e.backgroundClip="text";e.color="transparent"}this.baselineShift&&(e.verticalAlign=(0,s.measureToString)(this.baselineShift));e.fontKerning="none"===this.kerningMode?"none":"normal";e.letterSpacing=(0,s.measureToString)(this.letterSpacing);if(0!==this.lineThrough){e.textDecoration="line-through";2===this.lineThrough&&(e.textDecorationStyle="double")}if(0!==this.overline){e.textDecoration="overline";2===this.overline&&(e.textDecorationStyle="double")}e.fontStyle=this.posture;e.fontSize=(0,s.measureToString)(.99*this.size);(0,s.setFontFamily)(this,this,this[r.$globalData].fontFinder,e);if(0!==this.underline){e.textDecoration="underline";2===this.underline&&(e.textDecorationStyle="double")}e.fontWeight=this.weight;return e}}class Format extends r.XFAObject{constructor(e){super(d,"format",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.picture=null}}class Handler extends r.StringObject{constructor(e){super(d,"handler");this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||""}}class Hyphenation extends r.XFAObject{constructor(e){super(d,"hyphenation");this.excludeAllCaps=(0,o.getInteger)({data:e.excludeAllCaps,defaultValue:0,validate:e=>1===e});this.excludeInitialCap=(0,o.getInteger)({data:e.excludeInitialCap,defaultValue:0,validate:e=>1===e});this.hyphenate=(0,o.getInteger)({data:e.hyphenate,defaultValue:0,validate:e=>1===e});this.id=e.id||"";this.pushCharacterCount=(0,o.getInteger)({data:e.pushCharacterCount,defaultValue:3,validate:e=>e>=0});this.remainCharacterCount=(0,o.getInteger)({data:e.remainCharacterCount,defaultValue:3,validate:e=>e>=0});this.use=e.use||"";this.usehref=e.usehref||"";this.wordCharacterCount=(0,o.getInteger)({data:e.wordCharacterCount,defaultValue:7,validate:e=>e>=0})}}class Image extends r.StringObject{constructor(e){super(d,"image");this.aspect=(0,o.getStringOption)(e.aspect,["fit","actual","height","none","width"]);this.contentType=e.contentType||"";this.href=e.href||"";this.id=e.id||"";this.name=e.name||"";this.transferEncoding=(0,o.getStringOption)(e.transferEncoding,["base64","none","package"]);this.use=e.use||"";this.usehref=e.usehref||""}[r.$toHTML](){if(this.contentType&&!p.has(this.contentType.toLowerCase()))return o.HTMLResult.EMPTY;let e=this[r.$globalData].images&&this[r.$globalData].images.get(this.href);if(!e&&(this.href||!this[r.$content]))return o.HTMLResult.EMPTY;e||"base64"!==this.transferEncoding||(e=(0,c.stringToBytes)(atob(this[r.$content])));if(!e)return o.HTMLResult.EMPTY;if(!this.contentType){for(const[t,a]of m)if(e.length>t.length&&t.every(((t,a)=>t===e[a]))){this.contentType=a;break}if(!this.contentType)return o.HTMLResult.EMPTY}const t=new Blob([e],{type:this.contentType});let a;switch(this.aspect){case"fit":case"actual":break;case"height":a={height:"100%",objectFit:"fill"};break;case"none":a={width:"100%",height:"100%",objectFit:"fill"};break;case"width":a={width:"100%",objectFit:"fill"}}const n=this[r.$getParent]();return o.HTMLResult.success({name:"img",attributes:{class:["xfaImage"],style:a,src:URL.createObjectURL(t),alt:n?ariaLabel(n[r.$getParent]()):null}})}}class ImageEdit extends r.XFAObject{constructor(e){super(d,"imageEdit",!0);this.data=(0,o.getStringOption)(e.data,["link","embed"]);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.border=null;this.extras=null;this.margin=null}[r.$toHTML](e){return"embed"===this.data?o.HTMLResult.success({name:"div",children:[],attributes:{}}):o.HTMLResult.EMPTY}}class Integer extends r.ContentObject{constructor(e){super(d,"integer");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}[r.$finalize](){const e=parseInt(this[r.$content].trim(),10);this[r.$content]=isNaN(e)?null:e}[r.$toHTML](e){return valueToHtml(null!==this[r.$content]?this[r.$content].toString():"")}}class Issuers extends r.XFAObject{constructor(e){super(d,"issuers",!0);this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.certificate=new r.XFAObjectArray}}class Items extends r.XFAObject{constructor(e){super(d,"items",!0);this.id=e.id||"";this.name=e.name||"";this.presence=(0,o.getStringOption)(e.presence,["visible","hidden","inactive","invisible"]);this.ref=e.ref||"";this.save=(0,o.getInteger)({data:e.save,defaultValue:0,validate:e=>1===e});this.use=e.use||"";this.usehref=e.usehref||"";this.boolean=new r.XFAObjectArray;this.date=new r.XFAObjectArray;this.dateTime=new r.XFAObjectArray;this.decimal=new r.XFAObjectArray;this.exData=new r.XFAObjectArray;this.float=new r.XFAObjectArray;this.image=new r.XFAObjectArray;this.integer=new r.XFAObjectArray;this.text=new r.XFAObjectArray;this.time=new r.XFAObjectArray}[r.$toHTML](){const e=[];for(const t of this[r.$getChildren]())e.push(t[r.$text]());return o.HTMLResult.success(e)}}t.Items=Items;class Keep extends r.XFAObject{constructor(e){super(d,"keep",!0);this.id=e.id||"";const t=["none","contentArea","pageArea"];this.intact=(0,o.getStringOption)(e.intact,t);this.next=(0,o.getStringOption)(e.next,t);this.previous=(0,o.getStringOption)(e.previous,t);this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null}}class KeyUsage extends r.XFAObject{constructor(e){super(d,"keyUsage");const t=["","yes","no"];this.crlSign=(0,o.getStringOption)(e.crlSign,t);this.dataEncipherment=(0,o.getStringOption)(e.dataEncipherment,t);this.decipherOnly=(0,o.getStringOption)(e.decipherOnly,t);this.digitalSignature=(0,o.getStringOption)(e.digitalSignature,t);this.encipherOnly=(0,o.getStringOption)(e.encipherOnly,t);this.id=e.id||"";this.keyAgreement=(0,o.getStringOption)(e.keyAgreement,t);this.keyCertSign=(0,o.getStringOption)(e.keyCertSign,t);this.keyEncipherment=(0,o.getStringOption)(e.keyEncipherment,t);this.nonRepudiation=(0,o.getStringOption)(e.nonRepudiation,t);this.type=(0,o.getStringOption)(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||""}}class Line extends r.XFAObject{constructor(e){super(d,"line",!0);this.hand=(0,o.getStringOption)(e.hand,["even","left","right"]);this.id=e.id||"";this.slope=(0,o.getStringOption)(e.slope,["\\","/"]);this.use=e.use||"";this.usehref=e.usehref||"";this.edge=null}[r.$toHTML](){const e=this[r.$getParent]()[r.$getParent](),t=this.edge||new Edge({}),a=t[r.$toStyle](),n=Object.create(null),i="visible"===t.presence?t.thickness:0;n.strokeWidth=(0,s.measureToString)(i);n.stroke=a.color;let c,l,h,u,d="100%",g="100%";if(e.w<=i){[c,l,h,u]=["50%",0,"50%","100%"];d=n.strokeWidth}else if(e.h<=i){[c,l,h,u]=[0,"50%","100%","50%"];g=n.strokeWidth}else"\\"===this.slope?[c,l,h,u]=[0,0,"100%","100%"]:[c,l,h,u]=[0,"100%","100%",0];const p={name:"svg",children:[{name:"line",attributes:{xmlns:f,x1:c,y1:l,x2:h,y2:u,style:n}}],attributes:{xmlns:f,width:d,height:g,style:{overflow:"visible"}}};if(hasMargin(e))return o.HTMLResult.success({name:"div",attributes:{style:{display:"inline",width:"100%",height:"100%"}},children:[p]});p.attributes.style.position="absolute";return o.HTMLResult.success(p)}}class Linear extends r.XFAObject{constructor(e){super(d,"linear",!0);this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["toRight","toBottom","toLeft","toTop"]);this.use=e.use||"";this.usehref=e.usehref||"";this.color=null;this.extras=null}[r.$toStyle](e){e=e?e[r.$toStyle]():"#FFFFFF";return`linear-gradient(${this.type.replace(/([RBLT])/," $1").toLowerCase()}, ${e}, ${this.color?this.color[r.$toStyle]():"#000000"})`}}class LockDocument extends r.ContentObject{constructor(e){super(d,"lockDocument");this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||""}[r.$finalize](){this[r.$content]=(0,o.getStringOption)(this[r.$content],["auto","0","1"])}}class Manifest extends r.XFAObject{constructor(e){super(d,"manifest",!0);this.action=(0,o.getStringOption)(e.action,["include","all","exclude"]);this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.ref=new r.XFAObjectArray}}class Margin extends r.XFAObject{constructor(e){super(d,"margin",!0);this.bottomInset=(0,o.getMeasurement)(e.bottomInset,"0");this.id=e.id||"";this.leftInset=(0,o.getMeasurement)(e.leftInset,"0");this.rightInset=(0,o.getMeasurement)(e.rightInset,"0");this.topInset=(0,o.getMeasurement)(e.topInset,"0");this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null}[r.$toStyle](){return{margin:(0,s.measureToString)(this.topInset)+" "+(0,s.measureToString)(this.rightInset)+" "+(0,s.measureToString)(this.bottomInset)+" "+(0,s.measureToString)(this.leftInset)}}}class Mdp extends r.XFAObject{constructor(e){super(d,"mdp");this.id=e.id||"";this.permissions=(0,o.getInteger)({data:e.permissions,defaultValue:2,validate:e=>1===e||3===e});this.signatureType=(0,o.getStringOption)(e.signatureType,["filler","author"]);this.use=e.use||"";this.usehref=e.usehref||""}}class Medium extends r.XFAObject{constructor(e){super(d,"medium");this.id=e.id||"";this.imagingBBox=(0,o.getBBox)(e.imagingBBox);this.long=(0,o.getMeasurement)(e.long);this.orientation=(0,o.getStringOption)(e.orientation,["portrait","landscape"]);this.short=(0,o.getMeasurement)(e.short);this.stock=e.stock||"";this.trayIn=(0,o.getStringOption)(e.trayIn,["auto","delegate","pageFront"]);this.trayOut=(0,o.getStringOption)(e.trayOut,["auto","delegate"]);this.use=e.use||"";this.usehref=e.usehref||""}}class Message extends r.XFAObject{constructor(e){super(d,"message",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.text=new r.XFAObjectArray}}class NumericEdit extends r.XFAObject{constructor(e){super(d,"numericEdit",!0);this.hScrollPolicy=(0,o.getStringOption)(e.hScrollPolicy,["auto","off","on"]);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.border=null;this.comb=null;this.extras=null;this.margin=null}[r.$toHTML](e){const t=(0,s.toStyle)(this,"border","font","margin"),a=this[r.$getParent]()[r.$getParent](),n={name:"input",attributes:{type:"text",fieldId:a[r.$uid],dataId:a[r.$data]&&a[r.$data][r.$uid]||a[r.$uid],class:["xfaTextfield"],style:t,"aria-label":ariaLabel(a),"aria-required":!1}};if(isRequired(a)){n.attributes["aria-required"]=!0;n.attributes.required=!0}return o.HTMLResult.success({name:"label",attributes:{class:["xfaLabel"]},children:[n]})}}class Occur extends r.XFAObject{constructor(e){super(d,"occur",!0);this.id=e.id||"";this.initial=""!==e.initial?(0,o.getInteger)({data:e.initial,defaultValue:"",validate:e=>!0}):"";this.max=""!==e.max?(0,o.getInteger)({data:e.max,defaultValue:1,validate:e=>!0}):"";this.min=""!==e.min?(0,o.getInteger)({data:e.min,defaultValue:1,validate:e=>!0}):"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null}[r.$clean](){const e=this[r.$getParent](),t=this.min;""===this.min&&(this.min=e instanceof PageArea||e instanceof PageSet?0:1);""===this.max&&(this.max=""===t?e instanceof PageArea||e instanceof PageSet?-1:1:this.min);-1!==this.max&&this.max<this.min&&(this.max=this.min);""===this.initial&&(this.initial=e instanceof Template?1:this.min)}}class Oid extends r.StringObject{constructor(e){super(d,"oid");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Oids extends r.XFAObject{constructor(e){super(d,"oids",!0);this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.oid=new r.XFAObjectArray}}class Overflow extends r.XFAObject{constructor(e){super(d,"overflow");this.id=e.id||"";this.leader=e.leader||"";this.target=e.target||"";this.trailer=e.trailer||"";this.use=e.use||"";this.usehref=e.usehref||""}[r.$getExtra](){if(!this[r.$extra]){const e=this[r.$getParent](),t=this[r.$getTemplateRoot](),a=t[r.$searchNode](this.target,e),n=t[r.$searchNode](this.leader,e),i=t[r.$searchNode](this.trailer,e);this[r.$extra]={target:a&&a[0]||null,leader:n&&n[0]||null,trailer:i&&i[0]||null,addLeader:!1,addTrailer:!1}}return this[r.$extra]}}class PageArea extends r.XFAObject{constructor(e){super(d,"pageArea",!0);this.blankOrNotBlank=(0,o.getStringOption)(e.blankOrNotBlank,["any","blank","notBlank"]);this.id=e.id||"";this.initialNumber=(0,o.getInteger)({data:e.initialNumber,defaultValue:1,validate:e=>!0});this.name=e.name||"";this.numbered=(0,o.getInteger)({data:e.numbered,defaultValue:1,validate:e=>!0});this.oddOrEven=(0,o.getStringOption)(e.oddOrEven,["any","even","odd"]);this.pagePosition=(0,o.getStringOption)(e.pagePosition,["any","first","last","only","rest"]);this.relevant=(0,o.getRelevant)(e.relevant);this.use=e.use||"";this.usehref=e.usehref||"";this.desc=null;this.extras=null;this.medium=null;this.occur=null;this.area=new r.XFAObjectArray;this.contentArea=new r.XFAObjectArray;this.draw=new r.XFAObjectArray;this.exclGroup=new r.XFAObjectArray;this.field=new r.XFAObjectArray;this.subform=new r.XFAObjectArray}[r.$isUsable](){if(!this[r.$extra]){this[r.$extra]={numberOfUse:0};return!0}return!this.occur||-1===this.occur.max||this[r.$extra].numberOfUse<this.occur.max}[r.$cleanPage](){delete this[r.$extra]}[r.$getNextPage](){this[r.$extra]||(this[r.$extra]={numberOfUse:0});const e=this[r.$getParent]();if("orderedOccurrence"===e.relation&&this[r.$isUsable]()){this[r.$extra].numberOfUse+=1;return this}return e[r.$getNextPage]()}[r.$getAvailableSpace](){return this[r.$extra].space||{width:0,height:0}}[r.$toHTML](){this[r.$extra]||(this[r.$extra]={numberOfUse:1});const e=[];this[r.$extra].children=e;const t=Object.create(null);if(this.medium&&this.medium.short&&this.medium.long){t.width=(0,s.measureToString)(this.medium.short);t.height=(0,s.measureToString)(this.medium.long);this[r.$extra].space={width:this.medium.short,height:this.medium.long};if("landscape"===this.medium.orientation){const e=t.width;t.width=t.height;t.height=e;this[r.$extra].space={width:this.medium.long,height:this.medium.short}}}else(0,c.warn)("XFA - No medium specified in pageArea: please file a bug.");this[r.$childrenToHTML]({filter:new Set(["area","draw","field","subform"]),include:!0});this[r.$childrenToHTML]({filter:new Set(["contentArea"]),include:!0});return o.HTMLResult.success({name:"div",children:e,attributes:{class:["xfaPage"],id:this[r.$uid],style:t,xfaName:this.name}})}}class PageSet extends r.XFAObject{constructor(e){super(d,"pageSet",!0);this.duplexImposition=(0,o.getStringOption)(e.duplexImposition,["longEdge","shortEdge"]);this.id=e.id||"";this.name=e.name||"";this.relation=(0,o.getStringOption)(e.relation,["orderedOccurrence","duplexPaginated","simplexPaginated"]);this.relevant=(0,o.getRelevant)(e.relevant);this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.occur=null;this.pageArea=new r.XFAObjectArray;this.pageSet=new r.XFAObjectArray}[r.$cleanPage](){for(const e of this.pageArea.children)e[r.$cleanPage]();for(const e of this.pageSet.children)e[r.$cleanPage]()}[r.$isUsable](){return!this.occur||-1===this.occur.max||this[r.$extra].numberOfUse<this.occur.max}[r.$getNextPage](){this[r.$extra]||(this[r.$extra]={numberOfUse:1,pageIndex:-1,pageSetIndex:-1});if("orderedOccurrence"===this.relation){if(this[r.$extra].pageIndex+1<this.pageArea.children.length){this[r.$extra].pageIndex+=1;return this.pageArea.children[this[r.$extra].pageIndex][r.$getNextPage]()}if(this[r.$extra].pageSetIndex+1<this.pageSet.children.length){this[r.$extra].pageSetIndex+=1;return this.pageSet.children[this[r.$extra].pageSetIndex][r.$getNextPage]()}if(this[r.$isUsable]()){this[r.$extra].numberOfUse+=1;this[r.$extra].pageIndex=-1;this[r.$extra].pageSetIndex=-1;return this[r.$getNextPage]()}const e=this[r.$getParent]();if(e instanceof PageSet)return e[r.$getNextPage]();this[r.$cleanPage]();return this[r.$getNextPage]()}const e=this[r.$getTemplateRoot]()[r.$extra].pageNumber,t=e%2==0?"even":"odd",a=0===e?"first":"rest";let n=this.pageArea.children.find((e=>e.oddOrEven===t&&e.pagePosition===a));if(n)return n;n=this.pageArea.children.find((e=>"any"===e.oddOrEven&&e.pagePosition===a));if(n)return n;n=this.pageArea.children.find((e=>"any"===e.oddOrEven&&"any"===e.pagePosition));return n||this.pageArea.children[0]}}class Para extends r.XFAObject{constructor(e){super(d,"para",!0);this.hAlign=(0,o.getStringOption)(e.hAlign,["left","center","justify","justifyAll","radix","right"]);this.id=e.id||"";this.lineHeight=e.lineHeight?(0,o.getMeasurement)(e.lineHeight,"0pt"):"";this.marginLeft=e.marginLeft?(0,o.getMeasurement)(e.marginLeft,"0pt"):"";this.marginRight=e.marginRight?(0,o.getMeasurement)(e.marginRight,"0pt"):"";this.orphans=(0,o.getInteger)({data:e.orphans,defaultValue:0,validate:e=>e>=0});this.preserve=e.preserve||"";this.radixOffset=e.radixOffset?(0,o.getMeasurement)(e.radixOffset,"0pt"):"";this.spaceAbove=e.spaceAbove?(0,o.getMeasurement)(e.spaceAbove,"0pt"):"";this.spaceBelow=e.spaceBelow?(0,o.getMeasurement)(e.spaceBelow,"0pt"):"";this.tabDefault=e.tabDefault?(0,o.getMeasurement)(this.tabDefault):"";this.tabStops=(e.tabStops||"").trim().split(/\s+/).map(((e,t)=>t%2==1?(0,o.getMeasurement)(e):e));this.textIndent=e.textIndent?(0,o.getMeasurement)(e.textIndent,"0pt"):"";this.use=e.use||"";this.usehref=e.usehref||"";this.vAlign=(0,o.getStringOption)(e.vAlign,["top","bottom","middle"]);this.widows=(0,o.getInteger)({data:e.widows,defaultValue:0,validate:e=>e>=0});this.hyphenation=null}[r.$toStyle](){const e=(0,s.toStyle)(this,"hAlign");""!==this.marginLeft&&(e.paddingLeft=(0,s.measureToString)(this.marginLeft));""!==this.marginRight&&(e.paddingight=(0,s.measureToString)(this.marginRight));""!==this.spaceAbove&&(e.paddingTop=(0,s.measureToString)(this.spaceAbove));""!==this.spaceBelow&&(e.paddingBottom=(0,s.measureToString)(this.spaceBelow));if(""!==this.textIndent){e.textIndent=(0,s.measureToString)(this.textIndent);(0,s.fixTextIndent)(e)}this.lineHeight>0&&(e.lineHeight=(0,s.measureToString)(this.lineHeight));""!==this.tabDefault&&(e.tabSize=(0,s.measureToString)(this.tabDefault));this.tabStops.length;this.hyphenatation&&Object.assign(e,this.hyphenatation[r.$toStyle]());return e}}class PasswordEdit extends r.XFAObject{constructor(e){super(d,"passwordEdit",!0);this.hScrollPolicy=(0,o.getStringOption)(e.hScrollPolicy,["auto","off","on"]);this.id=e.id||"";this.passwordChar=e.passwordChar||"*";this.use=e.use||"";this.usehref=e.usehref||"";this.border=null;this.extras=null;this.margin=null}}class Pattern extends r.XFAObject{constructor(e){super(d,"pattern",!0);this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["crossHatch","crossDiagonal","diagonalLeft","diagonalRight","horizontal","vertical"]);this.use=e.use||"";this.usehref=e.usehref||"";this.color=null;this.extras=null}[r.$toStyle](e){e=e?e[r.$toStyle]():"#FFFFFF";const t=this.color?this.color[r.$toStyle]():"#000000",a="repeating-linear-gradient",n=`${e},${e} 5px,${t} 5px,${t} 10px`;switch(this.type){case"crossHatch":return`${a}(to top,${n}) ${a}(to right,${n})`;case"crossDiagonal":return`${a}(45deg,${n}) ${a}(-45deg,${n})`;case"diagonalLeft":return`${a}(45deg,${n})`;case"diagonalRight":return`${a}(-45deg,${n})`;case"horizontal":return`${a}(to top,${n})`;case"vertical":return`${a}(to right,${n})`}return""}}class Picture extends r.StringObject{constructor(e){super(d,"picture");this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Proto extends r.XFAObject{constructor(e){super(d,"proto",!0);this.appearanceFilter=new r.XFAObjectArray;this.arc=new r.XFAObjectArray;this.area=new r.XFAObjectArray;this.assist=new r.XFAObjectArray;this.barcode=new r.XFAObjectArray;this.bindItems=new r.XFAObjectArray;this.bookend=new r.XFAObjectArray;this.boolean=new r.XFAObjectArray;this.border=new r.XFAObjectArray;this.break=new r.XFAObjectArray;this.breakAfter=new r.XFAObjectArray;this.breakBefore=new r.XFAObjectArray;this.button=new r.XFAObjectArray;this.calculate=new r.XFAObjectArray;this.caption=new r.XFAObjectArray;this.certificate=new r.XFAObjectArray;this.certificates=new r.XFAObjectArray;this.checkButton=new r.XFAObjectArray;this.choiceList=new r.XFAObjectArray;this.color=new r.XFAObjectArray;this.comb=new r.XFAObjectArray;this.connect=new r.XFAObjectArray;this.contentArea=new r.XFAObjectArray;this.corner=new r.XFAObjectArray;this.date=new r.XFAObjectArray;this.dateTime=new r.XFAObjectArray;this.dateTimeEdit=new r.XFAObjectArray;this.decimal=new r.XFAObjectArray;this.defaultUi=new r.XFAObjectArray;this.desc=new r.XFAObjectArray;this.digestMethod=new r.XFAObjectArray;this.digestMethods=new r.XFAObjectArray;this.draw=new r.XFAObjectArray;this.edge=new r.XFAObjectArray;this.encoding=new r.XFAObjectArray;this.encodings=new r.XFAObjectArray;this.encrypt=new r.XFAObjectArray;this.encryptData=new r.XFAObjectArray;this.encryption=new r.XFAObjectArray;this.encryptionMethod=new r.XFAObjectArray;this.encryptionMethods=new r.XFAObjectArray;this.event=new r.XFAObjectArray;this.exData=new r.XFAObjectArray;this.exObject=new r.XFAObjectArray;this.exclGroup=new r.XFAObjectArray;this.execute=new r.XFAObjectArray;this.extras=new r.XFAObjectArray;this.field=new r.XFAObjectArray;this.fill=new r.XFAObjectArray;this.filter=new r.XFAObjectArray;this.float=new r.XFAObjectArray;this.font=new r.XFAObjectArray;this.format=new r.XFAObjectArray;this.handler=new r.XFAObjectArray;this.hyphenation=new r.XFAObjectArray;this.image=new r.XFAObjectArray;this.imageEdit=new r.XFAObjectArray;this.integer=new r.XFAObjectArray;this.issuers=new r.XFAObjectArray;this.items=new r.XFAObjectArray;this.keep=new r.XFAObjectArray;this.keyUsage=new r.XFAObjectArray;this.line=new r.XFAObjectArray;this.linear=new r.XFAObjectArray;this.lockDocument=new r.XFAObjectArray;this.manifest=new r.XFAObjectArray;this.margin=new r.XFAObjectArray;this.mdp=new r.XFAObjectArray;this.medium=new r.XFAObjectArray;this.message=new r.XFAObjectArray;this.numericEdit=new r.XFAObjectArray;this.occur=new r.XFAObjectArray;this.oid=new r.XFAObjectArray;this.oids=new r.XFAObjectArray;this.overflow=new r.XFAObjectArray;this.pageArea=new r.XFAObjectArray;this.pageSet=new r.XFAObjectArray;this.para=new r.XFAObjectArray;this.passwordEdit=new r.XFAObjectArray;this.pattern=new r.XFAObjectArray;this.picture=new r.XFAObjectArray;this.radial=new r.XFAObjectArray;this.reason=new r.XFAObjectArray;this.reasons=new r.XFAObjectArray;this.rectangle=new r.XFAObjectArray;this.ref=new r.XFAObjectArray;this.script=new r.XFAObjectArray;this.setProperty=new r.XFAObjectArray;this.signData=new r.XFAObjectArray;this.signature=new r.XFAObjectArray;this.signing=new r.XFAObjectArray;this.solid=new r.XFAObjectArray;this.speak=new r.XFAObjectArray;this.stipple=new r.XFAObjectArray;this.subform=new r.XFAObjectArray;this.subformSet=new r.XFAObjectArray;this.subjectDN=new r.XFAObjectArray;this.subjectDNs=new r.XFAObjectArray;this.submit=new r.XFAObjectArray;this.text=new r.XFAObjectArray;this.textEdit=new r.XFAObjectArray;this.time=new r.XFAObjectArray;this.timeStamp=new r.XFAObjectArray;this.toolTip=new r.XFAObjectArray;this.traversal=new r.XFAObjectArray;this.traverse=new r.XFAObjectArray;this.ui=new r.XFAObjectArray;this.validate=new r.XFAObjectArray;this.value=new r.XFAObjectArray;this.variables=new r.XFAObjectArray}}class Radial extends r.XFAObject{constructor(e){super(d,"radial",!0);this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["toEdge","toCenter"]);this.use=e.use||"";this.usehref=e.usehref||"";this.color=null;this.extras=null}[r.$toStyle](e){e=e?e[r.$toStyle]():"#FFFFFF";const t=this.color?this.color[r.$toStyle]():"#000000";return`radial-gradient(circle at center, ${"toEdge"===this.type?`${e},${t}`:`${t},${e}`})`}}class Reason extends r.StringObject{constructor(e){super(d,"reason");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Reasons extends r.XFAObject{constructor(e){super(d,"reasons",!0);this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.reason=new r.XFAObjectArray}}class Rectangle extends r.XFAObject{constructor(e){super(d,"rectangle",!0);this.hand=(0,o.getStringOption)(e.hand,["even","left","right"]);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.corner=new r.XFAObjectArray(4);this.edge=new r.XFAObjectArray(4);this.fill=null}[r.$toHTML](){const e=this.edge.children.length?this.edge.children[0]:new Edge({}),t=e[r.$toStyle](),a=Object.create(null);this.fill&&"visible"===this.fill.presence?Object.assign(a,this.fill[r.$toStyle]()):a.fill="transparent";a.strokeWidth=(0,s.measureToString)("visible"===e.presence?e.thickness:0);a.stroke=t.color;const n=(this.corner.children.length?this.corner.children[0]:new Corner({}))[r.$toStyle](),i={name:"svg",children:[{name:"rect",attributes:{xmlns:f,width:"100%",height:"100%",x:0,y:0,rx:n.radius,ry:n.radius,style:a}}],attributes:{xmlns:f,style:{overflow:"visible"},width:"100%",height:"100%"}};if(hasMargin(this[r.$getParent]()[r.$getParent]()))return o.HTMLResult.success({name:"div",attributes:{style:{display:"inline",width:"100%",height:"100%"}},children:[i]});i.attributes.style.position="absolute";return o.HTMLResult.success(i)}}class RefElement extends r.StringObject{constructor(e){super(d,"ref");this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Script extends r.StringObject{constructor(e){super(d,"script");this.binding=e.binding||"";this.contentType=e.contentType||"";this.id=e.id||"";this.name=e.name||"";this.runAt=(0,o.getStringOption)(e.runAt,["client","both","server"]);this.use=e.use||"";this.usehref=e.usehref||""}}class SetProperty extends r.XFAObject{constructor(e){super(d,"setProperty");this.connection=e.connection||"";this.ref=e.ref||"";this.target=e.target||""}}t.SetProperty=SetProperty;class SignData extends r.XFAObject{constructor(e){super(d,"signData",!0);this.id=e.id||"";this.operation=(0,o.getStringOption)(e.operation,["sign","clear","verify"]);this.ref=e.ref||"";this.target=e.target||"";this.use=e.use||"";this.usehref=e.usehref||"";this.filter=null;this.manifest=null}}class Signature extends r.XFAObject{constructor(e){super(d,"signature",!0);this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["PDF1.3","PDF1.6"]);this.use=e.use||"";this.usehref=e.usehref||"";this.border=null;this.extras=null;this.filter=null;this.manifest=null;this.margin=null}}class Signing extends r.XFAObject{constructor(e){super(d,"signing",!0);this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.certificate=new r.XFAObjectArray}}class Solid extends r.XFAObject{constructor(e){super(d,"solid",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null}[r.$toStyle](e){return e?e[r.$toStyle]():"#FFFFFF"}}class Speak extends r.StringObject{constructor(e){super(d,"speak");this.disable=(0,o.getInteger)({data:e.disable,defaultValue:0,validate:e=>1===e});this.id=e.id||"";this.priority=(0,o.getStringOption)(e.priority,["custom","caption","name","toolTip"]);this.rid=e.rid||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Stipple extends r.XFAObject{constructor(e){super(d,"stipple",!0);this.id=e.id||"";this.rate=(0,o.getInteger)({data:e.rate,defaultValue:50,validate:e=>e>=0&&e<=100});this.use=e.use||"";this.usehref=e.usehref||"";this.color=null;this.extras=null}[r.$toStyle](e){const t=this.rate/100;return c.Util.makeHexColor(Math.round(e.value.r*(1-t)+this.value.r*t),Math.round(e.value.g*(1-t)+this.value.g*t),Math.round(e.value.b*(1-t)+this.value.b*t))}}class Subform extends r.XFAObject{constructor(e){super(d,"subform",!0);this.access=(0,o.getStringOption)(e.access,["open","nonInteractive","protected","readOnly"]);this.allowMacro=(0,o.getInteger)({data:e.allowMacro,defaultValue:0,validate:e=>1===e});this.anchorType=(0,o.getStringOption)(e.anchorType,["topLeft","bottomCenter","bottomLeft","bottomRight","middleCenter","middleLeft","middleRight","topCenter","topRight"]);this.colSpan=(0,o.getInteger)({data:e.colSpan,defaultValue:1,validate:e=>e>=1||-1===e});this.columnWidths=(e.columnWidths||"").trim().split(/\s+/).map((e=>"-1"===e?-1:(0,o.getMeasurement)(e)));this.h=e.h?(0,o.getMeasurement)(e.h):"";this.hAlign=(0,o.getStringOption)(e.hAlign,["left","center","justify","justifyAll","radix","right"]);this.id=e.id||"";this.layout=(0,o.getStringOption)(e.layout,["position","lr-tb","rl-row","rl-tb","row","table","tb"]);this.locale=e.locale||"";this.maxH=(0,o.getMeasurement)(e.maxH,"0pt");this.maxW=(0,o.getMeasurement)(e.maxW,"0pt");this.mergeMode=(0,o.getStringOption)(e.mergeMode,["consumeData","matchTemplate"]);this.minH=(0,o.getMeasurement)(e.minH,"0pt");this.minW=(0,o.getMeasurement)(e.minW,"0pt");this.name=e.name||"";this.presence=(0,o.getStringOption)(e.presence,["visible","hidden","inactive","invisible"]);this.relevant=(0,o.getRelevant)(e.relevant);this.restoreState=(0,o.getStringOption)(e.restoreState,["manual","auto"]);this.scope=(0,o.getStringOption)(e.scope,["name","none"]);this.use=e.use||"";this.usehref=e.usehref||"";this.w=e.w?(0,o.getMeasurement)(e.w):"";this.x=(0,o.getMeasurement)(e.x,"0pt");this.y=(0,o.getMeasurement)(e.y,"0pt");this.assist=null;this.bind=null;this.bookend=null;this.border=null;this.break=null;this.calculate=null;this.desc=null;this.extras=null;this.keep=null;this.margin=null;this.occur=null;this.overflow=null;this.pageSet=null;this.para=null;this.traversal=null;this.validate=null;this.variables=null;this.area=new r.XFAObjectArray;this.breakAfter=new r.XFAObjectArray;this.breakBefore=new r.XFAObjectArray;this.connect=new r.XFAObjectArray;this.draw=new r.XFAObjectArray;this.event=new r.XFAObjectArray;this.exObject=new r.XFAObjectArray;this.exclGroup=new r.XFAObjectArray;this.field=new r.XFAObjectArray;this.proto=new r.XFAObjectArray;this.setProperty=new r.XFAObjectArray;this.subform=new r.XFAObjectArray;this.subformSet=new r.XFAObjectArray}[r.$getSubformParent](){const e=this[r.$getParent]();return e instanceof SubformSet?e[r.$getSubformParent]():e}[r.$isBindable](){return!0}[r.$isThereMoreWidth](){return this.layout.endsWith("-tb")&&0===this[r.$extra].attempt&&this[r.$extra].numberInLine>0||this[r.$getParent]()[r.$isThereMoreWidth]()}*[r.$getContainedChildren](){yield*getContainedChildren(this)}[r.$flushHTML](){return(0,i.flushHTML)(this)}[r.$addHTML](e,t){(0,i.addHTML)(this,e,t)}[r.$getAvailableSpace](){return(0,i.getAvailableSpace)(this)}[r.$isSplittable](){const e=this[r.$getSubformParent]();if(!e[r.$isSplittable]())return!1;if(void 0!==this[r.$extra]._isSplittable)return this[r.$extra]._isSplittable;if("position"===this.layout||this.layout.includes("row")){this[r.$extra]._isSplittable=!1;return!1}if(this.keep&&"none"!==this.keep.intact){this[r.$extra]._isSplittable=!1;return!1}if(e.layout&&e.layout.endsWith("-tb")&&0!==e[r.$extra].numberInLine)return!1;this[r.$extra]._isSplittable=!0;return!0}[r.$toHTML](e){setTabIndex(this);if(this.break){if("auto"!==this.break.after||""!==this.break.afterTarget){const e=new BreakAfter({targetType:this.break.after,target:this.break.afterTarget,startNew:this.break.startNew.toString()});e[r.$globalData]=this[r.$globalData];this[r.$appendChild](e);this.breakAfter.push(e)}if("auto"!==this.break.before||""!==this.break.beforeTarget){const e=new BreakBefore({targetType:this.break.before,target:this.break.beforeTarget,startNew:this.break.startNew.toString()});e[r.$globalData]=this[r.$globalData];this[r.$appendChild](e);this.breakBefore.push(e)}if(""!==this.break.overflowTarget){const e=new Overflow({target:this.break.overflowTarget,leader:this.break.overflowLeader,trailer:this.break.overflowTrailer});e[r.$globalData]=this[r.$globalData];this[r.$appendChild](e);this.overflow.push(e)}this[r.$removeChild](this.break);this.break=null}if("hidden"===this.presence||"inactive"===this.presence)return o.HTMLResult.EMPTY;(this.breakBefore.children.length>1||this.breakAfter.children.length>1)&&(0,c.warn)("XFA - Several breakBefore or breakAfter in subforms: please file a bug.");if(this.breakBefore.children.length>=1){const e=this.breakBefore.children[0];if(handleBreak(e))return o.HTMLResult.breakNode(e)}if(this[r.$extra]&&this[r.$extra].afterBreakAfter)return o.HTMLResult.EMPTY;(0,s.fixDimensions)(this);const t=[],a={id:this[r.$uid],class:[]};(0,s.setAccess)(this,a.class);this[r.$extra]||(this[r.$extra]=Object.create(null));Object.assign(this[r.$extra],{children:t,line:null,attributes:a,attempt:0,numberInLine:0,availableSpace:{width:Math.min(this.w||1/0,e.width),height:Math.min(this.h||1/0,e.height)},width:0,height:0,prevHeight:0,currentWidth:0});const n=this[r.$getTemplateRoot](),l=n[r.$extra].noLayoutFailure,h=this[r.$isSplittable]();h||setFirstUnsplittable(this);if(!(0,i.checkDimensions)(this,e))return o.HTMLResult.FAILURE;const u=new Set(["area","draw","exclGroup","field","subform","subformSet"]);if(this.layout.includes("row")){const e=this[r.$getSubformParent]().columnWidths;if(Array.isArray(e)&&e.length>0){this[r.$extra].columnWidths=e;this[r.$extra].currentColumn=0}}const d=(0,s.toStyle)(this,"anchorType","dimensions","position","presence","border","margin","hAlign"),f=["xfaSubform"],g=(0,s.layoutClass)(this);g&&f.push(g);a.style=d;a.class=f;this.name&&(a.xfaName=this.name);if(this.overflow){const t=this.overflow[r.$getExtra]();if(t.addLeader){t.addLeader=!1;handleOverflow(this,t.leader,e)}}this[r.$pushPara]();const p="lr-tb"===this.layout||"rl-tb"===this.layout,m=p?2:1;for(;this[r.$extra].attempt<m;this[r.$extra].attempt++){p&&1===this[r.$extra].attempt&&(this[r.$extra].numberInLine=0);const e=this[r.$childrenToHTML]({filter:u,include:!0});if(e.success)break;if(e.isBreak()){this[r.$popPara]();return e}if(p&&0===this[r.$extra].attempt&&0===this[r.$extra].numberInLine&&!n[r.$extra].noLayoutFailure){this[r.$extra].attempt=m;break}}this[r.$popPara]();h||unsetFirstUnsplittable(this);n[r.$extra].noLayoutFailure=l;if(this[r.$extra].attempt===m){this.overflow&&(this[r.$getTemplateRoot]()[r.$extra].overflowNode=this.overflow);h||delete this[r.$extra];return o.HTMLResult.FAILURE}if(this.overflow){const t=this.overflow[r.$getExtra]();if(t.addTrailer){t.addTrailer=!1;handleOverflow(this,t.trailer,e)}}let b=0,y=0;if(this.margin){b=this.margin.leftInset+this.margin.rightInset;y=this.margin.topInset+this.margin.bottomInset}const w=Math.max(this[r.$extra].width+b,this.w||0),S=Math.max(this[r.$extra].height+y,this.h||0),x=[this.x,this.y,w,S];""===this.w&&(d.width=(0,s.measureToString)(w));""===this.h&&(d.height=(0,s.measureToString)(S));if(("0px"===d.width||"0px"===d.height)&&0===t.length)return o.HTMLResult.EMPTY;const C={name:"div",attributes:a,children:t};applyAssist(this,a);const k=o.HTMLResult.success((0,s.createWrapper)(this,C),x);if(this.breakAfter.children.length>=1){const e=this.breakAfter.children[0];if(handleBreak(e)){this[r.$extra].afterBreakAfter=k;return o.HTMLResult.breakNode(e)}}delete this[r.$extra];return k}}class SubformSet extends r.XFAObject{constructor(e){super(d,"subformSet",!0);this.id=e.id||"";this.name=e.name||"";this.relation=(0,o.getStringOption)(e.relation,["ordered","choice","unordered"]);this.relevant=(0,o.getRelevant)(e.relevant);this.use=e.use||"";this.usehref=e.usehref||"";this.bookend=null;this.break=null;this.desc=null;this.extras=null;this.occur=null;this.overflow=null;this.breakAfter=new r.XFAObjectArray;this.breakBefore=new r.XFAObjectArray;this.subform=new r.XFAObjectArray;this.subformSet=new r.XFAObjectArray}*[r.$getContainedChildren](){yield*getContainedChildren(this)}[r.$getSubformParent](){let e=this[r.$getParent]();for(;!(e instanceof Subform);)e=e[r.$getParent]();return e}[r.$isBindable](){return!0}}class SubjectDN extends r.ContentObject{constructor(e){super(d,"subjectDN");this.delimiter=e.delimiter||",";this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}[r.$finalize](){this[r.$content]=new Map(this[r.$content].split(this.delimiter).map((e=>{(e=e.split("=",2))[0]=e[0].trim();return e})))}}class SubjectDNs extends r.XFAObject{constructor(e){super(d,"subjectDNs",!0);this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.subjectDN=new r.XFAObjectArray}}class Submit extends r.XFAObject{constructor(e){super(d,"submit",!0);this.embedPDF=(0,o.getInteger)({data:e.embedPDF,defaultValue:0,validate:e=>1===e});this.format=(0,o.getStringOption)(e.format,["xdp","formdata","pdf","urlencoded","xfd","xml"]);this.id=e.id||"";this.target=e.target||"";this.textEncoding=(0,o.getKeyword)({data:e.textEncoding?e.textEncoding.toLowerCase():"",defaultValue:"",validate:e=>["utf-8","big-five","fontspecific","gbk","gb-18030","gb-2312","ksc-5601","none","shift-jis","ucs-2","utf-16"].includes(e)||e.match(/iso-8859-\d{2}/)});this.use=e.use||"";this.usehref=e.usehref||"";this.xdpContent=e.xdpContent||"";this.encrypt=null;this.encryptData=new r.XFAObjectArray;this.signData=new r.XFAObjectArray}}class Template extends r.XFAObject{constructor(e){super(d,"template",!0);this.baseProfile=(0,o.getStringOption)(e.baseProfile,["full","interactiveForms"]);this.extras=null;this.subform=new r.XFAObjectArray}[r.$finalize](){0===this.subform.children.length&&(0,c.warn)("XFA - No subforms in template node.");this.subform.children.length>=2&&(0,c.warn)("XFA - Several subforms in template node: please file a bug.");this[r.$tabIndex]=5e3}[r.$isSplittable](){return!0}[r.$searchNode](e,t){return e.startsWith("#")?[this[r.$ids].get(e.slice(1))]:(0,u.searchNode)(this,t,e,!0,!0)}*[r.$toPages](){if(!this.subform.children.length)return o.HTMLResult.success({name:"div",children:[]});this[r.$extra]={overflowNode:null,firstUnsplittable:null,currentContentArea:null,currentPageArea:null,noLayoutFailure:!1,pageNumber:1,pagePosition:"first",oddOrEven:"odd",blankOrNotBlank:"nonBlank",paraStack:[]};const e=this.subform.children[0];e.pageSet[r.$cleanPage]();const t=e.pageSet.pageArea.children,a={name:"div",children:[]};let n=null,i=null,s=null;if(e.breakBefore.children.length>=1){i=e.breakBefore.children[0];s=i.target}else if(e.subform.children.length>=1&&e.subform.children[0].breakBefore.children.length>=1){i=e.subform.children[0].breakBefore.children[0];s=i.target}else if(e.break&&e.break.beforeTarget){i=e.break;s=i.beforeTarget}else if(e.subform.children.length>=1&&e.subform.children[0].break&&e.subform.children[0].break.beforeTarget){i=e.subform.children[0].break;s=i.beforeTarget}if(i){const e=this[r.$searchNode](s,i[r.$getParent]());if(e instanceof PageArea){n=e;i[r.$extra]={}}}n||(n=t[0]);n[r.$extra]={numberOfUse:1};const l=n[r.$getParent]();l[r.$extra]={numberOfUse:1,pageIndex:l.pageArea.children.indexOf(n),pageSetIndex:0};let h,u=null,d=null,f=!0,g=0,p=0;for(;;){if(f)g=0;else{a.children.pop();if(3==++g){(0,c.warn)("XFA - Something goes wrong: please file a bug.");return a}}h=null;this[r.$extra].currentPageArea=n;const t=n[r.$toHTML]().html;a.children.push(t);if(u){this[r.$extra].noLayoutFailure=!0;t.children.push(u[r.$toHTML](n[r.$extra].space).html);u=null}if(d){this[r.$extra].noLayoutFailure=!0;t.children.push(d[r.$toHTML](n[r.$extra].space).html);d=null}const i=n.contentArea.children,s=t.children.filter((e=>e.attributes.class.includes("xfaContentarea")));f=!1;this[r.$extra].firstUnsplittable=null;this[r.$extra].noLayoutFailure=!1;const flush=t=>{const a=e[r.$flushHTML]();if(a){f=f||a.children&&0!==a.children.length;s[t].children.push(a)}};for(let t=p,n=i.length;t<n;t++){const n=this[r.$extra].currentContentArea=i[t],o={width:n.w,height:n.h};p=0;if(u){s[t].children.push(u[r.$toHTML](o).html);u=null}if(d){s[t].children.push(d[r.$toHTML](o).html);d=null}const c=e[r.$toHTML](o);if(c.success){if(c.html){f=f||c.html.children&&0!==c.html.children.length;s[t].children.push(c.html)}else!f&&a.children.length>1&&a.children.pop();return a}if(c.isBreak()){const e=c.breakNode;flush(t);if("auto"===e.targetType)continue;if(e.leader){u=this[r.$searchNode](e.leader,e[r.$getParent]());u=u?u[0]:null}if(e.trailer){d=this[r.$searchNode](e.trailer,e[r.$getParent]());d=d?d[0]:null}if("pageArea"===e.targetType){h=e[r.$extra].target;t=1/0}else if(e[r.$extra].target){h=e[r.$extra].target;p=e[r.$extra].index+1;t=1/0}else t=e[r.$extra].index}else if(this[r.$extra].overflowNode){const e=this[r.$extra].overflowNode;this[r.$extra].overflowNode=null;const a=e[r.$getExtra](),n=a.target;a.addLeader=null!==a.leader;a.addTrailer=null!==a.trailer;flush(t);const s=t;t=1/0;if(n instanceof PageArea)h=n;else if(n instanceof ContentArea){const e=i.indexOf(n);if(-1!==e)e>s?t=e-1:p=e;else{h=n[r.$getParent]();p=h.contentArea.children.indexOf(n)}}}else flush(t)}this[r.$extra].pageNumber+=1;h&&(h[r.$isUsable]()?h[r.$extra].numberOfUse+=1:h=null);n=h||n[r.$getNextPage]();yield null}}}t.Template=Template;class Text extends r.ContentObject{constructor(e){super(d,"text");this.id=e.id||"";this.maxChars=(0,o.getInteger)({data:e.maxChars,defaultValue:0,validate:e=>e>=0});this.name=e.name||"";this.rid=e.rid||"";this.use=e.use||"";this.usehref=e.usehref||""}[r.$acceptWhitespace](){return!0}[r.$onChild](e){if(e[r.$namespaceId]===n.NamespaceIds.xhtml.id){this[r.$content]=e;return!0}(0,c.warn)(`XFA - Invalid content in Text: ${e[r.$nodeName]}.`);return!1}[r.$onText](e){this[r.$content]instanceof r.XFAObject||super[r.$onText](e)}[r.$finalize](){"string"==typeof this[r.$content]&&(this[r.$content]=this[r.$content].replace(/\r\n/g,"\n"))}[r.$getExtra](){return"string"==typeof this[r.$content]?this[r.$content].split(/[\u2029\u2028\n]/).reduce(((e,t)=>{t&&e.push(t);return e}),[]).join("\n"):this[r.$content][r.$text]()}[r.$toHTML](e){if("string"==typeof this[r.$content]){const e=valueToHtml(this[r.$content]).html;if(this[r.$content].includes("\u2029")){e.name="div";e.children=[];this[r.$content].split("\u2029").map((e=>e.split(/[\u2028\n]/).reduce(((e,t)=>{e.push({name:"span",value:t},{name:"br"});return e}),[]))).forEach((t=>{e.children.push({name:"p",children:t})}))}else if(/[\u2028\n]/.test(this[r.$content])){e.name="div";e.children=[];this[r.$content].split(/[\u2028\n]/).forEach((t=>{e.children.push({name:"span",value:t},{name:"br"})}))}return o.HTMLResult.success(e)}return this[r.$content][r.$toHTML](e)}}t.Text=Text;class TextEdit extends r.XFAObject{constructor(e){super(d,"textEdit",!0);this.allowRichText=(0,o.getInteger)({data:e.allowRichText,defaultValue:0,validate:e=>1===e});this.hScrollPolicy=(0,o.getStringOption)(e.hScrollPolicy,["auto","off","on"]);this.id=e.id||"";this.multiLine=(0,o.getInteger)({data:e.multiLine,defaultValue:"",validate:e=>0===e||1===e});this.use=e.use||"";this.usehref=e.usehref||"";this.vScrollPolicy=(0,o.getStringOption)(e.vScrollPolicy,["auto","off","on"]);this.border=null;this.comb=null;this.extras=null;this.margin=null}[r.$toHTML](e){const t=(0,s.toStyle)(this,"border","font","margin");let a;const n=this[r.$getParent]()[r.$getParent]();""===this.multiLine&&(this.multiLine=n instanceof Draw?1:0);a=1===this.multiLine?{name:"textarea",attributes:{dataId:n[r.$data]&&n[r.$data][r.$uid]||n[r.$uid],fieldId:n[r.$uid],class:["xfaTextfield"],style:t,"aria-label":ariaLabel(n),"aria-required":!1}}:{name:"input",attributes:{type:"text",dataId:n[r.$data]&&n[r.$data][r.$uid]||n[r.$uid],fieldId:n[r.$uid],class:["xfaTextfield"],style:t,"aria-label":ariaLabel(n),"aria-required":!1}};if(isRequired(n)){a.attributes["aria-required"]=!0;a.attributes.required=!0}return o.HTMLResult.success({name:"label",attributes:{class:["xfaLabel"]},children:[a]})}}class Time extends r.StringObject{constructor(e){super(d,"time");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}[r.$finalize](){const e=this[r.$content].trim();this[r.$content]=e?new Date(e):null}[r.$toHTML](e){return valueToHtml(this[r.$content]?this[r.$content].toString():"")}}class TimeStamp extends r.XFAObject{constructor(e){super(d,"timeStamp");this.id=e.id||"";this.server=e.server||"";this.type=(0,o.getStringOption)(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||""}}class ToolTip extends r.StringObject{constructor(e){super(d,"toolTip");this.id=e.id||"";this.rid=e.rid||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Traversal extends r.XFAObject{constructor(e){super(d,"traversal",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.traverse=new r.XFAObjectArray}}class Traverse extends r.XFAObject{constructor(e){super(d,"traverse",!0);this.id=e.id||"";this.operation=(0,o.getStringOption)(e.operation,["next","back","down","first","left","right","up"]);this.ref=e.ref||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.script=null}get name(){return this.operation}[r.$isTransparent](){return!1}}class Ui extends r.XFAObject{constructor(e){super(d,"ui",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.picture=null;this.barcode=null;this.button=null;this.checkButton=null;this.choiceList=null;this.dateTimeEdit=null;this.defaultUi=null;this.imageEdit=null;this.numericEdit=null;this.passwordEdit=null;this.signature=null;this.textEdit=null}[r.$getExtra](){if(void 0===this[r.$extra]){for(const e of Object.getOwnPropertyNames(this)){if("extras"===e||"picture"===e)continue;const t=this[e];if(t instanceof r.XFAObject){this[r.$extra]=t;return t}}this[r.$extra]=null}return this[r.$extra]}[r.$toHTML](e){const t=this[r.$getExtra]();return t?t[r.$toHTML](e):o.HTMLResult.EMPTY}}class Validate extends r.XFAObject{constructor(e){super(d,"validate",!0);this.formatTest=(0,o.getStringOption)(e.formatTest,["warning","disabled","error"]);this.id=e.id||"";this.nullTest=(0,o.getStringOption)(e.nullTest,["disabled","error","warning"]);this.scriptTest=(0,o.getStringOption)(e.scriptTest,["error","disabled","warning"]);this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.message=null;this.picture=null;this.script=null}}class Value extends r.XFAObject{constructor(e){super(d,"value",!0);this.id=e.id||"";this.override=(0,o.getInteger)({data:e.override,defaultValue:0,validate:e=>1===e});this.relevant=(0,o.getRelevant)(e.relevant);this.use=e.use||"";this.usehref=e.usehref||"";this.arc=null;this.boolean=null;this.date=null;this.dateTime=null;this.decimal=null;this.exData=null;this.float=null;this.image=null;this.integer=null;this.line=null;this.rectangle=null;this.text=null;this.time=null}[r.$setValue](e){const t=this[r.$getParent]();if(t instanceof Field&&t.ui&&t.ui.imageEdit){if(!this.image){this.image=new Image({});this[r.$appendChild](this.image)}this.image[r.$content]=e[r.$content];return}const a=e[r.$nodeName];if(null===this[a]){for(const e of Object.getOwnPropertyNames(this)){const t=this[e];if(t instanceof r.XFAObject){this[e]=null;this[r.$removeChild](t)}}this[e[r.$nodeName]]=e;this[r.$appendChild](e)}else this[a][r.$content]=e[r.$content]}[r.$text](){if(this.exData)return"string"==typeof this.exData[r.$content]?this.exData[r.$content].trim():this.exData[r.$content][r.$text]().trim();for(const e of Object.getOwnPropertyNames(this)){if("image"===e)continue;const t=this[e];if(t instanceof r.XFAObject)return(t[r.$content]||"").toString().trim()}return null}[r.$toHTML](e){for(const t of Object.getOwnPropertyNames(this)){const a=this[t];if(a instanceof r.XFAObject)return a[r.$toHTML](e)}return o.HTMLResult.EMPTY}}t.Value=Value;class Variables extends r.XFAObject{constructor(e){super(d,"variables",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.boolean=new r.XFAObjectArray;this.date=new r.XFAObjectArray;this.dateTime=new r.XFAObjectArray;this.decimal=new r.XFAObjectArray;this.exData=new r.XFAObjectArray;this.float=new r.XFAObjectArray;this.image=new r.XFAObjectArray;this.integer=new r.XFAObjectArray;this.manifest=new r.XFAObjectArray;this.script=new r.XFAObjectArray;this.text=new r.XFAObjectArray;this.time=new r.XFAObjectArray}[r.$isTransparent](){return!0}}class TemplateNamespace{static[n.$buildXFAObject](e,t){if(TemplateNamespace.hasOwnProperty(e)){const a=TemplateNamespace[e](t);a[r.$setSetAttributes](t);return a}}static appearanceFilter(e){return new AppearanceFilter(e)}static arc(e){return new Arc(e)}static area(e){return new Area(e)}static assist(e){return new Assist(e)}static barcode(e){return new Barcode(e)}static bind(e){return new Bind(e)}static bindItems(e){return new BindItems(e)}static bookend(e){return new Bookend(e)}static boolean(e){return new BooleanElement(e)}static border(e){return new Border(e)}static break(e){return new Break(e)}static breakAfter(e){return new BreakAfter(e)}static breakBefore(e){return new BreakBefore(e)}static button(e){return new Button(e)}static calculate(e){return new Calculate(e)}static caption(e){return new Caption(e)}static certificate(e){return new Certificate(e)}static certificates(e){return new Certificates(e)}static checkButton(e){return new CheckButton(e)}static choiceList(e){return new ChoiceList(e)}static color(e){return new Color(e)}static comb(e){return new Comb(e)}static connect(e){return new Connect(e)}static contentArea(e){return new ContentArea(e)}static corner(e){return new Corner(e)}static date(e){return new DateElement(e)}static dateTime(e){return new DateTime(e)}static dateTimeEdit(e){return new DateTimeEdit(e)}static decimal(e){return new Decimal(e)}static defaultUi(e){return new DefaultUi(e)}static desc(e){return new Desc(e)}static digestMethod(e){return new DigestMethod(e)}static digestMethods(e){return new DigestMethods(e)}static draw(e){return new Draw(e)}static edge(e){return new Edge(e)}static encoding(e){return new Encoding(e)}static encodings(e){return new Encodings(e)}static encrypt(e){return new Encrypt(e)}static encryptData(e){return new EncryptData(e)}static encryption(e){return new Encryption(e)}static encryptionMethod(e){return new EncryptionMethod(e)}static encryptionMethods(e){return new EncryptionMethods(e)}static event(e){return new Event(e)}static exData(e){return new ExData(e)}static exObject(e){return new ExObject(e)}static exclGroup(e){return new ExclGroup(e)}static execute(e){return new Execute(e)}static extras(e){return new Extras(e)}static field(e){return new Field(e)}static fill(e){return new Fill(e)}static filter(e){return new Filter(e)}static float(e){return new Float(e)}static font(e){return new Font(e)}static format(e){return new Format(e)}static handler(e){return new Handler(e)}static hyphenation(e){return new Hyphenation(e)}static image(e){return new Image(e)}static imageEdit(e){return new ImageEdit(e)}static integer(e){return new Integer(e)}static issuers(e){return new Issuers(e)}static items(e){return new Items(e)}static keep(e){return new Keep(e)}static keyUsage(e){return new KeyUsage(e)}static line(e){return new Line(e)}static linear(e){return new Linear(e)}static lockDocument(e){return new LockDocument(e)}static manifest(e){return new Manifest(e)}static margin(e){return new Margin(e)}static mdp(e){return new Mdp(e)}static medium(e){return new Medium(e)}static message(e){return new Message(e)}static numericEdit(e){return new NumericEdit(e)}static occur(e){return new Occur(e)}static oid(e){return new Oid(e)}static oids(e){return new Oids(e)}static overflow(e){return new Overflow(e)}static pageArea(e){return new PageArea(e)}static pageSet(e){return new PageSet(e)}static para(e){return new Para(e)}static passwordEdit(e){return new PasswordEdit(e)}static pattern(e){return new Pattern(e)}static picture(e){return new Picture(e)}static proto(e){return new Proto(e)}static radial(e){return new Radial(e)}static reason(e){return new Reason(e)}static reasons(e){return new Reasons(e)}static rectangle(e){return new Rectangle(e)}static ref(e){return new RefElement(e)}static script(e){return new Script(e)}static setProperty(e){return new SetProperty(e)}static signData(e){return new SignData(e)}static signature(e){return new Signature(e)}static signing(e){return new Signing(e)}static solid(e){return new Solid(e)}static speak(e){return new Speak(e)}static stipple(e){return new Stipple(e)}static subform(e){return new Subform(e)}static subformSet(e){return new SubformSet(e)}static subjectDN(e){return new SubjectDN(e)}static subjectDNs(e){return new SubjectDNs(e)}static submit(e){return new Submit(e)}static template(e){return new Template(e)}static text(e){return new Text(e)}static textEdit(e){return new TextEdit(e)}static time(e){return new Time(e)}static timeStamp(e){return new TimeStamp(e)}static toolTip(e){return new ToolTip(e)}static traversal(e){return new Traversal(e)}static traverse(e){return new Traverse(e)}static ui(e){return new Ui(e)}static validate(e){return new Validate(e)}static value(e){return new Value(e)}static variables(e){return new Variables(e)}}t.TemplateNamespace=TemplateNamespace},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.addHTML=function addHTML(e,t,a){const i=e[r.$extra],s=i.availableSpace,[o,c,l,h]=a;switch(e.layout){case"position":i.width=Math.max(i.width,o+l);i.height=Math.max(i.height,c+h);i.children.push(t);break;case"lr-tb":case"rl-tb":if(!i.line||1===i.attempt){i.line=createLine(e,[]);i.children.push(i.line);i.numberInLine=0}i.numberInLine+=1;i.line.children.push(t);if(0===i.attempt){i.currentWidth+=l;i.height=Math.max(i.height,i.prevHeight+h)}else{i.currentWidth=l;i.prevHeight=i.height;i.height+=h;i.attempt=0}i.width=Math.max(i.width,i.currentWidth);break;case"rl-row":case"row":{i.children.push(t);i.width+=l;i.height=Math.max(i.height,h);const e=(0,n.measureToString)(i.height);for(const t of i.children)t.attributes.style.height=e;break}case"table":case"tb":i.width=Math.min(s.width,Math.max(i.width,l));i.height+=h;i.children.push(t)}};t.checkDimensions=function checkDimensions(e,t){if(null===e[r.$getTemplateRoot]()[r.$extra].firstUnsplittable)return!0;if(0===e.w||0===e.h)return!0;const a=e[r.$getSubformParent](),n=a[r.$extra]&&a[r.$extra].attempt||0,[,i,s,o]=function getTransformedBBox(e){let t,a,r=""===e.w?NaN:e.w,n=""===e.h?NaN:e.h,[i,s]=[0,0];switch(e.anchorType||""){case"bottomCenter":[i,s]=[r/2,n];break;case"bottomLeft":[i,s]=[0,n];break;case"bottomRight":[i,s]=[r,n];break;case"middleCenter":[i,s]=[r/2,n/2];break;case"middleLeft":[i,s]=[0,n/2];break;case"middleRight":[i,s]=[r,n/2];break;case"topCenter":[i,s]=[r/2,0];break;case"topRight":[i,s]=[r,0]}switch(e.rotate||0){case 0:[t,a]=[-i,-s];break;case 90:[t,a]=[-s,i];[r,n]=[n,-r];break;case 180:[t,a]=[i,s];[r,n]=[-r,-n];break;case 270:[t,a]=[s,-i];[r,n]=[-n,r]}return[e.x+t+Math.min(0,r),e.y+a+Math.min(0,n),Math.abs(r),Math.abs(n)]}(e);switch(a.layout){case"lr-tb":case"rl-tb":return 0===n?e[r.$getTemplateRoot]()[r.$extra].noLayoutFailure?""!==e.w?Math.round(s-t.width)<=2:t.width>2:!(""!==e.h&&Math.round(o-t.height)>2)&&(""!==e.w?Math.round(s-t.width)<=2||0===a[r.$extra].numberInLine&&t.height>2:t.width>2):!!e[r.$getTemplateRoot]()[r.$extra].noLayoutFailure||!(""!==e.h&&Math.round(o-t.height)>2)&&((""===e.w||Math.round(s-t.width)<=2||!a[r.$isThereMoreWidth]())&&t.height>2);case"table":case"tb":return!!e[r.$getTemplateRoot]()[r.$extra].noLayoutFailure||(""===e.h||e[r.$isSplittable]()?(""===e.w||Math.round(s-t.width)<=2||!a[r.$isThereMoreWidth]())&&t.height>2:Math.round(o-t.height)<=2);case"position":if(e[r.$getTemplateRoot]()[r.$extra].noLayoutFailure)return!0;if(""===e.h||Math.round(o+i-t.height)<=2)return!0;return o+i>e[r.$getTemplateRoot]()[r.$extra].currentContentArea.h;case"rl-row":case"row":return!!e[r.$getTemplateRoot]()[r.$extra].noLayoutFailure||(""===e.h||Math.round(o-t.height)<=2);default:return!0}};t.flushHTML=function flushHTML(e){if(!e[r.$extra])return null;const t={name:"div",attributes:e[r.$extra].attributes,children:e[r.$extra].children};if(e[r.$extra].failingNode){const a=e[r.$extra].failingNode[r.$flushHTML]();a&&(e.layout.endsWith("-tb")?t.children.push(createLine(e,[a])):t.children.push(a))}if(0===t.children.length)return null;return t};t.getAvailableSpace=function getAvailableSpace(e){const t=e[r.$extra].availableSpace,a=e.margin?e.margin.topInset+e.margin.bottomInset:0,n=e.margin?e.margin.leftInset+e.margin.rightInset:0;switch(e.layout){case"lr-tb":case"rl-tb":return 0===e[r.$extra].attempt?{width:t.width-n-e[r.$extra].currentWidth,height:t.height-a-e[r.$extra].prevHeight}:{width:t.width-n,height:t.height-a-e[r.$extra].height};case"rl-row":case"row":return{width:e[r.$extra].columnWidths.slice(e[r.$extra].currentColumn).reduce(((e,t)=>e+t)),height:t.height-n};case"table":case"tb":return{width:t.width-n,height:t.height-a-e[r.$extra].height};default:return t}};var r=a(75),n=a(82);function createLine(e,t){return{name:"div",attributes:{class:["lr-tb"===e.layout?"xfaLr":"xfaRl"]},children:t}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.computeBbox=function computeBbox(e,t,a){let n;if(""!==e.w&&""!==e.h)n=[e.x,e.y,e.w,e.h];else{if(!a)return null;let i=e.w;if(""===i){if(0===e.maxW){const t=e[r.$getSubformParent]();i="position"===t.layout&&""!==t.w?0:e.minW}else i=Math.min(e.maxW,a.width);t.attributes.style.width=measureToString(i)}let s=e.h;if(""===s){if(0===e.maxH){const t=e[r.$getSubformParent]();s="position"===t.layout&&""!==t.h?0:e.minH}else s=Math.min(e.maxH,a.height);t.attributes.style.height=measureToString(s)}n=[e.x,e.y,i,s]}return n};t.createWrapper=function createWrapper(e,t){const{attributes:a}=t,{style:n}=a,i={name:"div",attributes:{class:["xfaWrapper"],style:Object.create(null)},children:[]};a.class.push("xfaWrapped");if(e.border){const{widths:a,insets:s}=e.border[r.$extra];let o,c,l=s[0],h=s[3];const u=s[0]+s[2],d=s[1]+s[3];switch(e.border.hand){case"even":l-=a[0]/2;h-=a[3]/2;o=`calc(100% + ${(a[1]+a[3])/2-d}px)`;c=`calc(100% + ${(a[0]+a[2])/2-u}px)`;break;case"left":l-=a[0];h-=a[3];o=`calc(100% + ${a[1]+a[3]-d}px)`;c=`calc(100% + ${a[0]+a[2]-u}px)`;break;case"right":o=d?`calc(100% - ${d}px)`:"100%";c=u?`calc(100% - ${u}px)`:"100%"}const f=["xfaBorder"];isPrintOnly(e.border)&&f.push("xfaPrintOnly");const g={name:"div",attributes:{class:f,style:{top:`${l}px`,left:`${h}px`,width:o,height:c}},children:[]};for(const e of["border","borderWidth","borderColor","borderRadius","borderStyle"])if(void 0!==n[e]){g.attributes.style[e]=n[e];delete n[e]}i.children.push(g,t)}else i.children.push(t);for(const e of["background","backgroundClip","top","left","width","height","minWidth","minHeight","maxWidth","maxHeight","transform","transformOrigin","visibility"])if(void 0!==n[e]){i.attributes.style[e]=n[e];delete n[e]}"absolute"===n.position?i.attributes.style.position="absolute":i.attributes.style.position="relative";delete n.position;if(n.alignSelf){i.attributes.style.alignSelf=n.alignSelf;delete n.alignSelf}return i};t.fixDimensions=function fixDimensions(e){const t=e[r.$getSubformParent]();if(t.layout&&t.layout.includes("row")){const a=t[r.$extra],n=e.colSpan;let i;i=-1===n?a.columnWidths.slice(a.currentColumn).reduce(((e,t)=>e+t),0):a.columnWidths.slice(a.currentColumn,a.currentColumn+n).reduce(((e,t)=>e+t),0);isNaN(i)||(e.w=i)}t.layout&&"position"!==t.layout&&(e.x=e.y=0);"table"===e.layout&&""===e.w&&Array.isArray(e.columnWidths)&&(e.w=e.columnWidths.reduce(((e,t)=>e+t),0))};t.fixTextIndent=function fixTextIndent(e){const t=(0,i.getMeasurement)(e.textIndent,"0px");if(t>=0)return;const a="padding"+("left"==("right"===e.textAlign?"right":"left")?"Left":"Right"),r=(0,i.getMeasurement)(e[a],"0px");e[a]=r-t+"px"};t.fixURL=function fixURL(e){const t=(0,n.createValidAbsoluteUrl)(e,null,{addDefaultProtocol:!0,tryConvertEncoding:!0});return t?t.href:null};t.isPrintOnly=isPrintOnly;t.layoutClass=function layoutClass(e){switch(e.layout){case"position":default:return"xfaPosition";case"lr-tb":return"xfaLrTb";case"rl-row":return"xfaRlRow";case"rl-tb":return"xfaRlTb";case"row":return"xfaRow";case"table":return"xfaTable";case"tb":return"xfaTb"}};t.layoutNode=function layoutNode(e,t){let a=null,n=null,i=!1;if((!e.w||!e.h)&&e.value){let s=0,o=0;if(e.margin){s=e.margin.leftInset+e.margin.rightInset;o=e.margin.topInset+e.margin.bottomInset}let c=null,l=null;if(e.para){l=Object.create(null);c=""===e.para.lineHeight?null:e.para.lineHeight;l.top=""===e.para.spaceAbove?0:e.para.spaceAbove;l.bottom=""===e.para.spaceBelow?0:e.para.spaceBelow;l.left=""===e.para.marginLeft?0:e.para.marginLeft;l.right=""===e.para.marginRight?0:e.para.marginRight}let h=e.font;if(!h){const t=e[r.$getTemplateRoot]();let a=e[r.$getParent]();for(;a&&a!==t;){if(a.font){h=a.font;break}a=a[r.$getParent]()}}const u=(e.w||t.width)-s,d=e[r.$globalData].fontFinder;if(e.value.exData&&e.value.exData[r.$content]&&"text/html"===e.value.exData.contentType){const t=layoutText(e.value.exData[r.$content],h,l,c,d,u);n=t.width;a=t.height;i=t.isBroken}else{const t=e.value[r.$text]();if(t){const e=layoutText(t,h,l,c,d,u);n=e.width;a=e.height;i=e.isBroken}}null===n||e.w||(n+=s);null===a||e.h||(a+=o)}return{w:n,h:a,isBroken:i}};t.measureToString=measureToString;t.setAccess=function setAccess(e,t){switch(e.access){case"nonInteractive":t.push("xfaNonInteractive");break;case"readOnly":t.push("xfaReadOnly");break;case"protected":t.push("xfaDisabled")}};t.setFontFamily=function setFontFamily(e,t,a,r){if(!a){delete r.fontFamily;return}const n=(0,i.stripQuotes)(e.typeface);r.fontFamily=`"${n}"`;const o=a.find(n);if(o){const{fontFamily:a}=o.regular.cssFontInfo;a!==n&&(r.fontFamily=`"${a}"`);const i=getCurrentPara(t);if(i&&""!==i.lineHeight)return;if(r.lineHeight)return;const c=(0,s.selectFont)(e,o);c&&(r.lineHeight=Math.max(1.2,c.lineHeight))}};t.setMinMaxDimensions=function setMinMaxDimensions(e,t){if("position"===e[r.$getSubformParent]().layout){e.minW>0&&(t.minWidth=measureToString(e.minW));e.maxW>0&&(t.maxWidth=measureToString(e.maxW));e.minH>0&&(t.minHeight=measureToString(e.minH));e.maxH>0&&(t.maxHeight=measureToString(e.maxH))}};t.setPara=function setPara(e,t,a){if(a.attributes.class&&a.attributes.class.includes("xfaRich")){if(t){""===e.h&&(t.height="auto");""===e.w&&(t.width="auto")}const n=getCurrentPara(e);if(n){const e=a.attributes.style;e.display="flex";e.flexDirection="column";switch(n.vAlign){case"top":e.justifyContent="start";break;case"bottom":e.justifyContent="end";break;case"middle":e.justifyContent="center"}const t=n[r.$toStyle]();for(const[a,r]of Object.entries(t))a in e||(e[a]=r)}}};t.toStyle=function toStyle(e,...t){const a=Object.create(null);for(const i of t){const t=e[i];if(null!==t)if(c.hasOwnProperty(i))c[i](e,a);else if(t instanceof r.XFAObject){const e=t[r.$toStyle]();e?Object.assign(a,e):(0,n.warn)(`(DEBUG) - XFA - style for ${i} not implemented yet`)}}return a};var r=a(75),n=a(2),i=a(76),s=a(83),o=a(84);function measureToString(e){return"string"==typeof e?"0px":Number.isInteger(e)?`${e}px`:`${e.toFixed(2)}px`}const c={anchorType(e,t){const a=e[r.$getSubformParent]();if(a&&(!a.layout||"position"===a.layout)){"transform"in t||(t.transform="");switch(e.anchorType){case"bottomCenter":t.transform+="translate(-50%, -100%)";break;case"bottomLeft":t.transform+="translate(0,-100%)";break;case"bottomRight":t.transform+="translate(-100%,-100%)";break;case"middleCenter":t.transform+="translate(-50%,-50%)";break;case"middleLeft":t.transform+="translate(0,-50%)";break;case"middleRight":t.transform+="translate(-100%,-50%)";break;case"topCenter":t.transform+="translate(-50%,0)";break;case"topRight":t.transform+="translate(-100%,0)"}}},dimensions(e,t){const a=e[r.$getSubformParent]();let n=e.w;const i=e.h;if(a.layout&&a.layout.includes("row")){const t=a[r.$extra],i=e.colSpan;let s;if(-1===i){s=t.columnWidths.slice(t.currentColumn).reduce(((e,t)=>e+t),0);t.currentColumn=0}else{s=t.columnWidths.slice(t.currentColumn,t.currentColumn+i).reduce(((e,t)=>e+t),0);t.currentColumn=(t.currentColumn+e.colSpan)%t.columnWidths.length}isNaN(s)||(n=e.w=s)}t.width=""!==n?measureToString(n):"auto";t.height=""!==i?measureToString(i):"auto"},position(e,t){const a=e[r.$getSubformParent]();if(!a||!a.layout||"position"===a.layout){t.position="absolute";t.left=measureToString(e.x);t.top=measureToString(e.y)}},rotate(e,t){if(e.rotate){"transform"in t||(t.transform="");t.transform+=`rotate(-${e.rotate}deg)`;t.transformOrigin="top left"}},presence(e,t){switch(e.presence){case"invisible":t.visibility="hidden";break;case"hidden":case"inactive":t.display="none"}},hAlign(e,t){if("para"===e[r.$nodeName])switch(e.hAlign){case"justifyAll":t.textAlign="justify-all";break;case"radix":t.textAlign="left";break;default:t.textAlign=e.hAlign}else switch(e.hAlign){case"left":t.alignSelf="start";break;case"center":t.alignSelf="center";break;case"right":t.alignSelf="end"}},margin(e,t){e.margin&&(t.margin=e.margin[r.$toStyle]().margin)}};function layoutText(e,t,a,n,i,s){const c=new o.TextMeasure(t,a,n,i);"string"==typeof e?c.addString(e):e[r.$pushGlyphs](c);return c.compute(s)}function isPrintOnly(e){return e.relevant.length>0&&!e.relevant[0].excluded&&"print"===e.relevant[0].viewname}function getCurrentPara(e){const t=e[r.$getTemplateRoot]()[r.$extra].paraStack;return t.length?t.at(-1):null}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.FontFinder=void 0;t.getMetrics=function getMetrics(e,t=!1){let a=null;if(e){const t=(0,n.stripQuotes)(e.typeface),i=e[r.$globalData].fontFinder.find(t);a=selectFont(e,i)}if(!a)return{lineHeight:12,lineGap:2,lineNoGap:10};const i=e.size||10,s=a.lineHeight?Math.max(t?0:1.2,a.lineHeight):1.2,o=void 0===a.lineGap?.2:a.lineGap;return{lineHeight:s*i,lineGap:o*i,lineNoGap:Math.max(1,s-o)*i}};t.selectFont=selectFont;var r=a(75),n=a(76),i=a(2);t.FontFinder=class FontFinder{constructor(e){this.fonts=new Map;this.cache=new Map;this.warned=new Set;this.defaultFont=null;this.add(e)}add(e,t=null){for(const t of e)this.addPdfFont(t);for(const e of this.fonts.values())e.regular||(e.regular=e.italic||e.bold||e.bolditalic);if(!t||0===t.size)return;const a=this.fonts.get("PdfJS-Fallback-PdfJS-XFA");for(const e of t)this.fonts.set(e,a)}addPdfFont(e){const t=e.cssFontInfo,a=t.fontFamily;let r=this.fonts.get(a);if(!r){r=Object.create(null);this.fonts.set(a,r);this.defaultFont||(this.defaultFont=r)}let n="";const i=parseFloat(t.fontWeight);0!==parseFloat(t.italicAngle)?n=i>=700?"bolditalic":"italic":i>=700&&(n="bold");if(!n){(e.name.includes("Bold")||e.psName&&e.psName.includes("Bold"))&&(n="bold");(e.name.includes("Italic")||e.name.endsWith("It")||e.psName&&(e.psName.includes("Italic")||e.psName.endsWith("It")))&&(n+="italic")}n||(n="regular");r[n]=e}getDefault(){return this.defaultFont}find(e,t=!0){let a=this.fonts.get(e)||this.cache.get(e);if(a)return a;const r=/,|-|_| |bolditalic|bold|italic|regular|it/gi;let n=e.replace(r,"");a=this.fonts.get(n);if(a){this.cache.set(e,a);return a}n=n.toLowerCase();const s=[];for(const[e,t]of this.fonts.entries())e.replace(r,"").toLowerCase().startsWith(n)&&s.push(t);if(0===s.length)for(const[,e]of this.fonts.entries())e.regular.name&&e.regular.name.replace(r,"").toLowerCase().startsWith(n)&&s.push(e);if(0===s.length){n=n.replace(/psmt|mt/gi,"");for(const[e,t]of this.fonts.entries())e.replace(r,"").toLowerCase().startsWith(n)&&s.push(t)}if(0===s.length)for(const e of this.fonts.values())e.regular.name&&e.regular.name.replace(r,"").toLowerCase().startsWith(n)&&s.push(e);if(s.length>=1){1!==s.length&&t&&(0,i.warn)(`XFA - Too many choices to guess the correct font: ${e}`);this.cache.set(e,s[0]);return s[0]}if(t&&!this.warned.has(e)){this.warned.add(e);(0,i.warn)(`XFA - Cannot find the font: ${e}`)}return null}};function selectFont(e,t){return"italic"===e.posture?"bold"===e.weight?t.bolditalic:t.italic:"bold"===e.weight?t.bold:t.regular}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.TextMeasure=void 0;var r=a(83);class FontInfo{constructor(e,t,a,n){this.lineHeight=a;this.paraMargin=t||{top:0,bottom:0,left:0,right:0};if(!e){[this.pdfFont,this.xfaFont]=this.defaultFont(n);return}this.xfaFont={typeface:e.typeface,posture:e.posture,weight:e.weight,size:e.size,letterSpacing:e.letterSpacing};const i=n.find(e.typeface);if(i){this.pdfFont=(0,r.selectFont)(e,i);this.pdfFont||([this.pdfFont,this.xfaFont]=this.defaultFont(n))}else[this.pdfFont,this.xfaFont]=this.defaultFont(n)}defaultFont(e){const t=e.find("Helvetica",!1)||e.find("Myriad Pro",!1)||e.find("Arial",!1)||e.getDefault();if(t&&t.regular){const e=t.regular;return[e,{typeface:e.cssFontInfo.fontFamily,posture:"normal",weight:"normal",size:10,letterSpacing:0}]}return[null,{typeface:"Courier",posture:"normal",weight:"normal",size:10,letterSpacing:0}]}}class FontSelector{constructor(e,t,a,r){this.fontFinder=r;this.stack=[new FontInfo(e,t,a,r)]}pushData(e,t,a){const r=this.stack.at(-1);for(const t of["typeface","posture","weight","size","letterSpacing"])e[t]||(e[t]=r.xfaFont[t]);for(const e of["top","bottom","left","right"])isNaN(t[e])&&(t[e]=r.paraMargin[e]);const n=new FontInfo(e,t,a||r.lineHeight,this.fontFinder);n.pdfFont||(n.pdfFont=r.pdfFont);this.stack.push(n)}popFont(){this.stack.pop()}topFont(){return this.stack.at(-1)}}t.TextMeasure=class TextMeasure{constructor(e,t,a,r){this.glyphs=[];this.fontSelector=new FontSelector(e,t,a,r);this.extraHeight=0}pushData(e,t,a){this.fontSelector.pushData(e,t,a)}popFont(e){return this.fontSelector.popFont()}addPara(){const e=this.fontSelector.topFont();this.extraHeight+=e.paraMargin.top+e.paraMargin.bottom}addString(e){if(!e)return;const t=this.fontSelector.topFont(),a=t.xfaFont.size;if(t.pdfFont){const r=t.xfaFont.letterSpacing,n=t.pdfFont,i=n.lineHeight||1.2,s=t.lineHeight||Math.max(1.2,i)*a,o=i-(void 0===n.lineGap?.2:n.lineGap),c=Math.max(1,o)*a,l=a/1e3,h=n.defaultWidth||n.charsToGlyphs(" ")[0].width;for(const t of e.split(/[\u2029\n]/)){const e=n.encodeString(t).join(""),a=n.charsToGlyphs(e);for(const e of a){const t=e.width||h;this.glyphs.push([t*l+r,s,c,e.unicode,!1])}this.glyphs.push([0,0,0,"\n",!0])}this.glyphs.pop()}else{for(const t of e.split(/[\u2029\n]/)){for(const e of t.split(""))this.glyphs.push([a,1.2*a,a,e,!1]);this.glyphs.push([0,0,0,"\n",!0])}this.glyphs.pop()}}compute(e){let t=-1,a=0,r=0,n=0,i=0,s=0,o=!1,c=!0;for(let l=0,h=this.glyphs.length;l<h;l++){const[h,u,d,f,g]=this.glyphs[l],p=" "===f,m=c?d:u;if(g){r=Math.max(r,i);i=0;n+=s;s=m;t=-1;a=0;c=!1}else if(p)if(i+h>e){r=Math.max(r,i);i=0;n+=s;s=m;t=-1;a=0;o=!0;c=!1}else{s=Math.max(m,s);a=i;i+=h;t=l}else if(i+h>e){n+=s;s=m;if(-1!==t){l=t;r=Math.max(r,a);i=0;t=-1;a=0}else{r=Math.max(r,i);i=h}o=!0;c=!1}else{i+=h;s=Math.max(m,s)}}r=Math.max(r,i);n+=s+this.extraHeight;return{width:1.02*r,height:n,isBroken:o}}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.DataHandler=void 0;var r=a(75);t.DataHandler=class DataHandler{constructor(e,t){this.data=t;this.dataset=e.datasets||null}serialize(e){const t=[[-1,this.data[r.$getChildren]()]];for(;t.length>0;){const a=t.at(-1),[n,i]=a;if(n+1===i.length){t.pop();continue}const s=i[++a[0]],o=e.get(s[r.$uid]);if(o)s[r.$setValue](o);else{const t=s[r.$getAttributes]();for(const a of t.values()){const t=e.get(a[r.$uid]);if(t){a[r.$setValue](t);break}}}const c=s[r.$getChildren]();c.length>0&&t.push([-1,c])}const a=['<xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">'];if(this.dataset)for(const e of this.dataset[r.$getChildren]())"data"!==e[r.$nodeName]&&e[r.$toString](a);this.data[r.$toString](a);a.push("</xfa:datasets>");return a.join("")}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.XFAParser=void 0;var r=a(75),n=a(64),i=a(87),s=a(2);class XFAParser extends n.XMLParserBase{constructor(e=null,t=!1){super();this._builder=new i.Builder(e);this._stack=[];this._globalData={usedTypefaces:new Set};this._ids=new Map;this._current=this._builder.buildRoot(this._ids);this._errorCode=n.XMLParserErrorCode.NoError;this._whiteRegex=/^\s+$/;this._nbsps=/\xa0+/g;this._richText=t}parse(e){this.parseXml(e);if(this._errorCode===n.XMLParserErrorCode.NoError){this._current[r.$finalize]();return this._current.element}}onText(e){e=e.replace(this._nbsps,(e=>e.slice(1)+" "));this._richText||this._current[r.$acceptWhitespace]()?this._current[r.$onText](e,this._richText):this._whiteRegex.test(e)||this._current[r.$onText](e.trim())}onCdata(e){this._current[r.$onText](e)}_mkAttributes(e,t){let a=null,n=null;const i=Object.create({});for(const{name:o,value:c}of e)if("xmlns"===o)a?(0,s.warn)(`XFA - multiple namespace definition in <${t}>`):a=c;else if(o.startsWith("xmlns:")){const e=o.substring("xmlns:".length);n||(n=[]);n.push({prefix:e,value:c})}else{const e=o.indexOf(":");if(-1===e)i[o]=c;else{let t=i[r.$nsAttributes];t||(t=i[r.$nsAttributes]=Object.create(null));const[a,n]=[o.slice(0,e),o.slice(e+1)];let s=t[a];s||(s=t[a]=Object.create(null));s[n]=c}}return[a,n,i]}_getNameAndPrefix(e,t){const a=e.indexOf(":");return-1===a?[e,null]:[e.substring(a+1),t?"":e.substring(0,a)]}onBeginElement(e,t,a){const[n,i,s]=this._mkAttributes(t,e),[o,c]=this._getNameAndPrefix(e,this._builder.isNsAgnostic()),l=this._builder.build({nsPrefix:c,name:o,attributes:s,namespace:n,prefixes:i});l[r.$globalData]=this._globalData;if(a){l[r.$finalize]();this._current[r.$onChild](l)&&l[r.$setId](this._ids);l[r.$clean](this._builder)}else{this._stack.push(this._current);this._current=l}}onEndElement(e){const t=this._current;if(t[r.$isCDATAXml]()&&"string"==typeof t[r.$content]){const e=new XFAParser;e._globalData=this._globalData;const a=e.parse(t[r.$content]);t[r.$content]=null;t[r.$onChild](a)}t[r.$finalize]();this._current=this._stack.pop();this._current[r.$onChild](t)&&t[r.$setId](this._ids);t[r.$clean](this._builder)}onError(e){this._errorCode=e}}t.XFAParser=XFAParser},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.Builder=void 0;var r=a(77),n=a(75),i=a(88),s=a(80),o=a(97),c=a(2);class Root extends n.XFAObject{constructor(e){super(-1,"root",Object.create(null));this.element=null;this[n.$ids]=e}[n.$onChild](e){this.element=e;return!0}[n.$finalize](){super[n.$finalize]();if(this.element.template instanceof s.Template){this[n.$ids].set(n.$root,this.element);this.element.template[n.$resolvePrototypes](this[n.$ids]);this.element.template[n.$ids]=this[n.$ids]}}}class Empty extends n.XFAObject{constructor(){super(-1,"",Object.create(null))}[n.$onChild](e){return!1}}t.Builder=class Builder{constructor(e=null){this._namespaceStack=[];this._nsAgnosticLevel=0;this._namespacePrefixes=new Map;this._namespaces=new Map;this._nextNsId=Math.max(...Object.values(r.NamespaceIds).map((({id:e})=>e)));this._currentNamespace=e||new o.UnknownNamespace(++this._nextNsId)}buildRoot(e){return new Root(e)}build({nsPrefix:e,name:t,attributes:a,namespace:s,prefixes:o}){const c=null!==s;if(c){this._namespaceStack.push(this._currentNamespace);this._currentNamespace=this._searchNamespace(s)}o&&this._addNamespacePrefix(o);if(a.hasOwnProperty(n.$nsAttributes)){const e=i.NamespaceSetUp.datasets,t=a[n.$nsAttributes];let r=null;for(const[a,n]of Object.entries(t)){if(this._getNamespaceToUse(a)===e){r={xfa:n};break}}r?a[n.$nsAttributes]=r:delete a[n.$nsAttributes]}const l=this._getNamespaceToUse(e),h=l&&l[r.$buildXFAObject](t,a)||new Empty;h[n.$isNsAgnostic]()&&this._nsAgnosticLevel++;(c||o||h[n.$isNsAgnostic]())&&(h[n.$cleanup]={hasNamespace:c,prefixes:o,nsAgnostic:h[n.$isNsAgnostic]()});return h}isNsAgnostic(){return this._nsAgnosticLevel>0}_searchNamespace(e){let t=this._namespaces.get(e);if(t)return t;for(const[a,{check:n}]of Object.entries(r.NamespaceIds))if(n(e)){t=i.NamespaceSetUp[a];if(t){this._namespaces.set(e,t);return t}break}t=new o.UnknownNamespace(++this._nextNsId);this._namespaces.set(e,t);return t}_addNamespacePrefix(e){for(const{prefix:t,value:a}of e){const e=this._searchNamespace(a);let r=this._namespacePrefixes.get(t);if(!r){r=[];this._namespacePrefixes.set(t,r)}r.push(e)}}_getNamespaceToUse(e){if(!e)return this._currentNamespace;const t=this._namespacePrefixes.get(e);if(t&&t.length>0)return t.at(-1);(0,c.warn)(`Unknown namespace prefix: ${e}.`);return null}clean(e){const{hasNamespace:t,prefixes:a,nsAgnostic:r}=e;t&&(this._currentNamespace=this._namespaceStack.pop());a&&a.forEach((({prefix:e})=>{this._namespacePrefixes.get(e).pop()}));r&&this._nsAgnosticLevel--}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.NamespaceSetUp=void 0;var r=a(89),n=a(90),i=a(91),s=a(92),o=a(93),c=a(94),l=a(80),h=a(95),u=a(96);const d={config:r.ConfigNamespace,connection:n.ConnectionSetNamespace,datasets:i.DatasetsNamespace,localeSet:s.LocaleSetNamespace,signature:o.SignatureNamespace,stylesheet:c.StylesheetNamespace,template:l.TemplateNamespace,xdp:h.XdpNamespace,xhtml:u.XhtmlNamespace};t.NamespaceSetUp=d},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.ConfigNamespace=void 0;var r=a(77),n=a(75),i=a(76),s=a(2);const o=r.NamespaceIds.config.id;class Acrobat extends n.XFAObject{constructor(e){super(o,"acrobat",!0);this.acrobat7=null;this.autoSave=null;this.common=null;this.validate=null;this.validateApprovalSignatures=null;this.submitUrl=new n.XFAObjectArray}}class Acrobat7 extends n.XFAObject{constructor(e){super(o,"acrobat7",!0);this.dynamicRender=null}}class ADBE_JSConsole extends n.OptionObject{constructor(e){super(o,"ADBE_JSConsole",["delegate","Enable","Disable"])}}class ADBE_JSDebugger extends n.OptionObject{constructor(e){super(o,"ADBE_JSDebugger",["delegate","Enable","Disable"])}}class AddSilentPrint extends n.Option01{constructor(e){super(o,"addSilentPrint")}}class AddViewerPreferences extends n.Option01{constructor(e){super(o,"addViewerPreferences")}}class AdjustData extends n.Option10{constructor(e){super(o,"adjustData")}}class AdobeExtensionLevel extends n.IntegerObject{constructor(e){super(o,"adobeExtensionLevel",0,(e=>e>=1&&e<=8))}}class Agent extends n.XFAObject{constructor(e){super(o,"agent",!0);this.name=e.name?e.name.trim():"";this.common=new n.XFAObjectArray}}class AlwaysEmbed extends n.ContentObject{constructor(e){super(o,"alwaysEmbed")}}class Amd extends n.StringObject{constructor(e){super(o,"amd")}}class Area extends n.XFAObject{constructor(e){super(o,"area");this.level=(0,i.getInteger)({data:e.level,defaultValue:0,validate:e=>e>=1&&e<=3});this.name=(0,i.getStringOption)(e.name,["","barcode","coreinit","deviceDriver","font","general","layout","merge","script","signature","sourceSet","templateCache"])}}class Attributes extends n.OptionObject{constructor(e){super(o,"attributes",["preserve","delegate","ignore"])}}class AutoSave extends n.OptionObject{constructor(e){super(o,"autoSave",["disabled","enabled"])}}class Base extends n.StringObject{constructor(e){super(o,"base")}}class BatchOutput extends n.XFAObject{constructor(e){super(o,"batchOutput");this.format=(0,i.getStringOption)(e.format,["none","concat","zip","zipCompress"])}}class BehaviorOverride extends n.ContentObject{constructor(e){super(o,"behaviorOverride")}[n.$finalize](){this[n.$content]=new Map(this[n.$content].trim().split(/\s+/).filter((e=>e.includes(":"))).map((e=>e.split(":",2))))}}class Cache extends n.XFAObject{constructor(e){super(o,"cache",!0);this.templateCache=null}}class Change extends n.Option01{constructor(e){super(o,"change")}}class Common extends n.XFAObject{constructor(e){super(o,"common",!0);this.data=null;this.locale=null;this.localeSet=null;this.messaging=null;this.suppressBanner=null;this.template=null;this.validationMessaging=null;this.versionControl=null;this.log=new n.XFAObjectArray}}class Compress extends n.XFAObject{constructor(e){super(o,"compress");this.scope=(0,i.getStringOption)(e.scope,["imageOnly","document"])}}class CompressLogicalStructure extends n.Option01{constructor(e){super(o,"compressLogicalStructure")}}class CompressObjectStream extends n.Option10{constructor(e){super(o,"compressObjectStream")}}class Compression extends n.XFAObject{constructor(e){super(o,"compression",!0);this.compressLogicalStructure=null;this.compressObjectStream=null;this.level=null;this.type=null}}class Config extends n.XFAObject{constructor(e){super(o,"config",!0);this.acrobat=null;this.present=null;this.trace=null;this.agent=new n.XFAObjectArray}}class Conformance extends n.OptionObject{constructor(e){super(o,"conformance",["A","B"])}}class ContentCopy extends n.Option01{constructor(e){super(o,"contentCopy")}}class Copies extends n.IntegerObject{constructor(e){super(o,"copies",1,(e=>e>=1))}}class Creator extends n.StringObject{constructor(e){super(o,"creator")}}class CurrentPage extends n.IntegerObject{constructor(e){super(o,"currentPage",0,(e=>e>=0))}}class Data extends n.XFAObject{constructor(e){super(o,"data",!0);this.adjustData=null;this.attributes=null;this.incrementalLoad=null;this.outputXSL=null;this.range=null;this.record=null;this.startNode=null;this.uri=null;this.window=null;this.xsl=null;this.excludeNS=new n.XFAObjectArray;this.transform=new n.XFAObjectArray}}class Debug extends n.XFAObject{constructor(e){super(o,"debug",!0);this.uri=null}}class DefaultTypeface extends n.ContentObject{constructor(e){super(o,"defaultTypeface");this.writingScript=(0,i.getStringOption)(e.writingScript,["*","Arabic","Cyrillic","EastEuropeanRoman","Greek","Hebrew","Japanese","Korean","Roman","SimplifiedChinese","Thai","TraditionalChinese","Vietnamese"])}}class Destination extends n.OptionObject{constructor(e){super(o,"destination",["pdf","pcl","ps","webClient","zpl"])}}class DocumentAssembly extends n.Option01{constructor(e){super(o,"documentAssembly")}}class Driver extends n.XFAObject{constructor(e){super(o,"driver",!0);this.name=e.name?e.name.trim():"";this.fontInfo=null;this.xdc=null}}class DuplexOption extends n.OptionObject{constructor(e){super(o,"duplexOption",["simplex","duplexFlipLongEdge","duplexFlipShortEdge"])}}class DynamicRender extends n.OptionObject{constructor(e){super(o,"dynamicRender",["forbidden","required"])}}class Embed extends n.Option01{constructor(e){super(o,"embed")}}class Encrypt extends n.Option01{constructor(e){super(o,"encrypt")}}class Encryption extends n.XFAObject{constructor(e){super(o,"encryption",!0);this.encrypt=null;this.encryptionLevel=null;this.permissions=null}}class EncryptionLevel extends n.OptionObject{constructor(e){super(o,"encryptionLevel",["40bit","128bit"])}}class Enforce extends n.StringObject{constructor(e){super(o,"enforce")}}class Equate extends n.XFAObject{constructor(e){super(o,"equate");this.force=(0,i.getInteger)({data:e.force,defaultValue:1,validate:e=>0===e});this.from=e.from||"";this.to=e.to||""}}class EquateRange extends n.XFAObject{constructor(e){super(o,"equateRange");this.from=e.from||"";this.to=e.to||"";this._unicodeRange=e.unicodeRange||""}get unicodeRange(){const e=[],t=/U\+([0-9a-fA-F]+)/,a=this._unicodeRange;for(let r of a.split(",").map((e=>e.trim())).filter((e=>!!e))){r=r.split("-",2).map((e=>{const a=e.match(t);return a?parseInt(a[1],16):0}));1===r.length&&r.push(r[0]);e.push(r)}return(0,s.shadow)(this,"unicodeRange",e)}}class Exclude extends n.ContentObject{constructor(e){super(o,"exclude")}[n.$finalize](){this[n.$content]=this[n.$content].trim().split(/\s+/).filter((e=>e&&["calculate","close","enter","exit","initialize","ready","validate"].includes(e)))}}class ExcludeNS extends n.StringObject{constructor(e){super(o,"excludeNS")}}class FlipLabel extends n.OptionObject{constructor(e){super(o,"flipLabel",["usePrinterSetting","on","off"])}}class FontInfo extends n.XFAObject{constructor(e){super(o,"fontInfo",!0);this.embed=null;this.map=null;this.subsetBelow=null;this.alwaysEmbed=new n.XFAObjectArray;this.defaultTypeface=new n.XFAObjectArray;this.neverEmbed=new n.XFAObjectArray}}class FormFieldFilling extends n.Option01{constructor(e){super(o,"formFieldFilling")}}class GroupParent extends n.StringObject{constructor(e){super(o,"groupParent")}}class IfEmpty extends n.OptionObject{constructor(e){super(o,"ifEmpty",["dataValue","dataGroup","ignore","remove"])}}class IncludeXDPContent extends n.StringObject{constructor(e){super(o,"includeXDPContent")}}class IncrementalLoad extends n.OptionObject{constructor(e){super(o,"incrementalLoad",["none","forwardOnly"])}}class IncrementalMerge extends n.Option01{constructor(e){super(o,"incrementalMerge")}}class Interactive extends n.Option01{constructor(e){super(o,"interactive")}}class Jog extends n.OptionObject{constructor(e){super(o,"jog",["usePrinterSetting","none","pageSet"])}}class LabelPrinter extends n.XFAObject{constructor(e){super(o,"labelPrinter",!0);this.name=(0,i.getStringOption)(e.name,["zpl","dpl","ipl","tcpl"]);this.batchOutput=null;this.flipLabel=null;this.fontInfo=null;this.xdc=null}}class Layout extends n.OptionObject{constructor(e){super(o,"layout",["paginate","panel"])}}class Level extends n.IntegerObject{constructor(e){super(o,"level",0,(e=>e>0))}}class Linearized extends n.Option01{constructor(e){super(o,"linearized")}}class Locale extends n.StringObject{constructor(e){super(o,"locale")}}class LocaleSet extends n.StringObject{constructor(e){super(o,"localeSet")}}class Log extends n.XFAObject{constructor(e){super(o,"log",!0);this.mode=null;this.threshold=null;this.to=null;this.uri=null}}class MapElement extends n.XFAObject{constructor(e){super(o,"map",!0);this.equate=new n.XFAObjectArray;this.equateRange=new n.XFAObjectArray}}class MediumInfo extends n.XFAObject{constructor(e){super(o,"mediumInfo",!0);this.map=null}}class Message extends n.XFAObject{constructor(e){super(o,"message",!0);this.msgId=null;this.severity=null}}class Messaging extends n.XFAObject{constructor(e){super(o,"messaging",!0);this.message=new n.XFAObjectArray}}class Mode extends n.OptionObject{constructor(e){super(o,"mode",["append","overwrite"])}}class ModifyAnnots extends n.Option01{constructor(e){super(o,"modifyAnnots")}}class MsgId extends n.IntegerObject{constructor(e){super(o,"msgId",1,(e=>e>=1))}}class NameAttr extends n.StringObject{constructor(e){super(o,"nameAttr")}}class NeverEmbed extends n.ContentObject{constructor(e){super(o,"neverEmbed")}}class NumberOfCopies extends n.IntegerObject{constructor(e){super(o,"numberOfCopies",null,(e=>e>=2&&e<=5))}}class OpenAction extends n.XFAObject{constructor(e){super(o,"openAction",!0);this.destination=null}}class Output extends n.XFAObject{constructor(e){super(o,"output",!0);this.to=null;this.type=null;this.uri=null}}class OutputBin extends n.StringObject{constructor(e){super(o,"outputBin")}}class OutputXSL extends n.XFAObject{constructor(e){super(o,"outputXSL",!0);this.uri=null}}class Overprint extends n.OptionObject{constructor(e){super(o,"overprint",["none","both","draw","field"])}}class Packets extends n.StringObject{constructor(e){super(o,"packets")}[n.$finalize](){"*"!==this[n.$content]&&(this[n.$content]=this[n.$content].trim().split(/\s+/).filter((e=>["config","datasets","template","xfdf","xslt"].includes(e))))}}class PageOffset extends n.XFAObject{constructor(e){super(o,"pageOffset");this.x=(0,i.getInteger)({data:e.x,defaultValue:"useXDCSetting",validate:e=>!0});this.y=(0,i.getInteger)({data:e.y,defaultValue:"useXDCSetting",validate:e=>!0})}}class PageRange extends n.StringObject{constructor(e){super(o,"pageRange")}[n.$finalize](){const e=this[n.$content].trim().split(/\s+/).map((e=>parseInt(e,10))),t=[];for(let a=0,r=e.length;a<r;a+=2)t.push(e.slice(a,a+2));this[n.$content]=t}}class Pagination extends n.OptionObject{constructor(e){super(o,"pagination",["simplex","duplexShortEdge","duplexLongEdge"])}}class PaginationOverride extends n.OptionObject{constructor(e){super(o,"paginationOverride",["none","forceDuplex","forceDuplexLongEdge","forceDuplexShortEdge","forceSimplex"])}}class Part extends n.IntegerObject{constructor(e){super(o,"part",1,(e=>!1))}}class Pcl extends n.XFAObject{constructor(e){super(o,"pcl",!0);this.name=e.name||"";this.batchOutput=null;this.fontInfo=null;this.jog=null;this.mediumInfo=null;this.outputBin=null;this.pageOffset=null;this.staple=null;this.xdc=null}}class Pdf extends n.XFAObject{constructor(e){super(o,"pdf",!0);this.name=e.name||"";this.adobeExtensionLevel=null;this.batchOutput=null;this.compression=null;this.creator=null;this.encryption=null;this.fontInfo=null;this.interactive=null;this.linearized=null;this.openAction=null;this.pdfa=null;this.producer=null;this.renderPolicy=null;this.scriptModel=null;this.silentPrint=null;this.submitFormat=null;this.tagged=null;this.version=null;this.viewerPreferences=null;this.xdc=null}}class Pdfa extends n.XFAObject{constructor(e){super(o,"pdfa",!0);this.amd=null;this.conformance=null;this.includeXDPContent=null;this.part=null}}class Permissions extends n.XFAObject{constructor(e){super(o,"permissions",!0);this.accessibleContent=null;this.change=null;this.contentCopy=null;this.documentAssembly=null;this.formFieldFilling=null;this.modifyAnnots=null;this.plaintextMetadata=null;this.print=null;this.printHighQuality=null}}class PickTrayByPDFSize extends n.Option01{constructor(e){super(o,"pickTrayByPDFSize")}}class Picture extends n.StringObject{constructor(e){super(o,"picture")}}class PlaintextMetadata extends n.Option01{constructor(e){super(o,"plaintextMetadata")}}class Presence extends n.OptionObject{constructor(e){super(o,"presence",["preserve","dissolve","dissolveStructure","ignore","remove"])}}class Present extends n.XFAObject{constructor(e){super(o,"present",!0);this.behaviorOverride=null;this.cache=null;this.common=null;this.copies=null;this.destination=null;this.incrementalMerge=null;this.layout=null;this.output=null;this.overprint=null;this.pagination=null;this.paginationOverride=null;this.script=null;this.validate=null;this.xdp=null;this.driver=new n.XFAObjectArray;this.labelPrinter=new n.XFAObjectArray;this.pcl=new n.XFAObjectArray;this.pdf=new n.XFAObjectArray;this.ps=new n.XFAObjectArray;this.submitUrl=new n.XFAObjectArray;this.webClient=new n.XFAObjectArray;this.zpl=new n.XFAObjectArray}}class Print extends n.Option01{constructor(e){super(o,"print")}}class PrintHighQuality extends n.Option01{constructor(e){super(o,"printHighQuality")}}class PrintScaling extends n.OptionObject{constructor(e){super(o,"printScaling",["appdefault","noScaling"])}}class PrinterName extends n.StringObject{constructor(e){super(o,"printerName")}}class Producer extends n.StringObject{constructor(e){super(o,"producer")}}class Ps extends n.XFAObject{constructor(e){super(o,"ps",!0);this.name=e.name||"";this.batchOutput=null;this.fontInfo=null;this.jog=null;this.mediumInfo=null;this.outputBin=null;this.staple=null;this.xdc=null}}class Range extends n.ContentObject{constructor(e){super(o,"range")}[n.$finalize](){this[n.$content]=this[n.$content].trim().split(/\s*,\s*/,2).map((e=>e.split("-").map((e=>parseInt(e.trim(),10))))).filter((e=>e.every((e=>!isNaN(e))))).map((e=>{1===e.length&&e.push(e[0]);return e}))}}class Record extends n.ContentObject{constructor(e){super(o,"record")}[n.$finalize](){this[n.$content]=this[n.$content].trim();const e=parseInt(this[n.$content],10);!isNaN(e)&&e>=0&&(this[n.$content]=e)}}class Relevant extends n.ContentObject{constructor(e){super(o,"relevant")}[n.$finalize](){this[n.$content]=this[n.$content].trim().split(/\s+/)}}class Rename extends n.ContentObject{constructor(e){super(o,"rename")}[n.$finalize](){this[n.$content]=this[n.$content].trim();(this[n.$content].toLowerCase().startsWith("xml")||new RegExp("[\\p{L}_][\\p{L}\\d._\\p{M}-]*","u").test(this[n.$content]))&&(0,s.warn)("XFA - Rename: invalid XFA name")}}class RenderPolicy extends n.OptionObject{constructor(e){super(o,"renderPolicy",["server","client"])}}class RunScripts extends n.OptionObject{constructor(e){super(o,"runScripts",["both","client","none","server"])}}class Script extends n.XFAObject{constructor(e){super(o,"script",!0);this.currentPage=null;this.exclude=null;this.runScripts=null}}class ScriptModel extends n.OptionObject{constructor(e){super(o,"scriptModel",["XFA","none"])}}class Severity extends n.OptionObject{constructor(e){super(o,"severity",["ignore","error","information","trace","warning"])}}class SilentPrint extends n.XFAObject{constructor(e){super(o,"silentPrint",!0);this.addSilentPrint=null;this.printerName=null}}class Staple extends n.XFAObject{constructor(e){super(o,"staple");this.mode=(0,i.getStringOption)(e.mode,["usePrinterSetting","on","off"])}}class StartNode extends n.StringObject{constructor(e){super(o,"startNode")}}class StartPage extends n.IntegerObject{constructor(e){super(o,"startPage",0,(e=>!0))}}class SubmitFormat extends n.OptionObject{constructor(e){super(o,"submitFormat",["html","delegate","fdf","xml","pdf"])}}class SubmitUrl extends n.StringObject{constructor(e){super(o,"submitUrl")}}class SubsetBelow extends n.IntegerObject{constructor(e){super(o,"subsetBelow",100,(e=>e>=0&&e<=100))}}class SuppressBanner extends n.Option01{constructor(e){super(o,"suppressBanner")}}class Tagged extends n.Option01{constructor(e){super(o,"tagged")}}class Template extends n.XFAObject{constructor(e){super(o,"template",!0);this.base=null;this.relevant=null;this.startPage=null;this.uri=null;this.xsl=null}}class Threshold extends n.OptionObject{constructor(e){super(o,"threshold",["trace","error","information","warning"])}}class To extends n.OptionObject{constructor(e){super(o,"to",["null","memory","stderr","stdout","system","uri"])}}class TemplateCache extends n.XFAObject{constructor(e){super(o,"templateCache");this.maxEntries=(0,i.getInteger)({data:e.maxEntries,defaultValue:5,validate:e=>e>=0})}}class Trace extends n.XFAObject{constructor(e){super(o,"trace",!0);this.area=new n.XFAObjectArray}}class Transform extends n.XFAObject{constructor(e){super(o,"transform",!0);this.groupParent=null;this.ifEmpty=null;this.nameAttr=null;this.picture=null;this.presence=null;this.rename=null;this.whitespace=null}}class Type extends n.OptionObject{constructor(e){super(o,"type",["none","ascii85","asciiHex","ccittfax","flate","lzw","runLength","native","xdp","mergedXDP"])}}class Uri extends n.StringObject{constructor(e){super(o,"uri")}}class Validate extends n.OptionObject{constructor(e){super(o,"validate",["preSubmit","prePrint","preExecute","preSave"])}}class ValidateApprovalSignatures extends n.ContentObject{constructor(e){super(o,"validateApprovalSignatures")}[n.$finalize](){this[n.$content]=this[n.$content].trim().split(/\s+/).filter((e=>["docReady","postSign"].includes(e)))}}class ValidationMessaging extends n.OptionObject{constructor(e){super(o,"validationMessaging",["allMessagesIndividually","allMessagesTogether","firstMessageOnly","noMessages"])}}class Version extends n.OptionObject{constructor(e){super(o,"version",["1.7","1.6","1.5","1.4","1.3","1.2"])}}class VersionControl extends n.XFAObject{constructor(e){super(o,"VersionControl");this.outputBelow=(0,i.getStringOption)(e.outputBelow,["warn","error","update"]);this.sourceAbove=(0,i.getStringOption)(e.sourceAbove,["warn","error"]);this.sourceBelow=(0,i.getStringOption)(e.sourceBelow,["update","maintain"])}}class ViewerPreferences extends n.XFAObject{constructor(e){super(o,"viewerPreferences",!0);this.ADBE_JSConsole=null;this.ADBE_JSDebugger=null;this.addViewerPreferences=null;this.duplexOption=null;this.enforce=null;this.numberOfCopies=null;this.pageRange=null;this.pickTrayByPDFSize=null;this.printScaling=null}}class WebClient extends n.XFAObject{constructor(e){super(o,"webClient",!0);this.name=e.name?e.name.trim():"";this.fontInfo=null;this.xdc=null}}class Whitespace extends n.OptionObject{constructor(e){super(o,"whitespace",["preserve","ltrim","normalize","rtrim","trim"])}}class Window extends n.ContentObject{constructor(e){super(o,"window")}[n.$finalize](){const e=this[n.$content].trim().split(/\s*,\s*/,2).map((e=>parseInt(e,10)));if(e.some((e=>isNaN(e))))this[n.$content]=[0,0];else{1===e.length&&e.push(e[0]);this[n.$content]=e}}}class Xdc extends n.XFAObject{constructor(e){super(o,"xdc",!0);this.uri=new n.XFAObjectArray;this.xsl=new n.XFAObjectArray}}class Xdp extends n.XFAObject{constructor(e){super(o,"xdp",!0);this.packets=null}}class Xsl extends n.XFAObject{constructor(e){super(o,"xsl",!0);this.debug=null;this.uri=null}}class Zpl extends n.XFAObject{constructor(e){super(o,"zpl",!0);this.name=e.name?e.name.trim():"";this.batchOutput=null;this.flipLabel=null;this.fontInfo=null;this.xdc=null}}class ConfigNamespace{static[r.$buildXFAObject](e,t){if(ConfigNamespace.hasOwnProperty(e))return ConfigNamespace[e](t)}static acrobat(e){return new Acrobat(e)}static acrobat7(e){return new Acrobat7(e)}static ADBE_JSConsole(e){return new ADBE_JSConsole(e)}static ADBE_JSDebugger(e){return new ADBE_JSDebugger(e)}static addSilentPrint(e){return new AddSilentPrint(e)}static addViewerPreferences(e){return new AddViewerPreferences(e)}static adjustData(e){return new AdjustData(e)}static adobeExtensionLevel(e){return new AdobeExtensionLevel(e)}static agent(e){return new Agent(e)}static alwaysEmbed(e){return new AlwaysEmbed(e)}static amd(e){return new Amd(e)}static area(e){return new Area(e)}static attributes(e){return new Attributes(e)}static autoSave(e){return new AutoSave(e)}static base(e){return new Base(e)}static batchOutput(e){return new BatchOutput(e)}static behaviorOverride(e){return new BehaviorOverride(e)}static cache(e){return new Cache(e)}static change(e){return new Change(e)}static common(e){return new Common(e)}static compress(e){return new Compress(e)}static compressLogicalStructure(e){return new CompressLogicalStructure(e)}static compressObjectStream(e){return new CompressObjectStream(e)}static compression(e){return new Compression(e)}static config(e){return new Config(e)}static conformance(e){return new Conformance(e)}static contentCopy(e){return new ContentCopy(e)}static copies(e){return new Copies(e)}static creator(e){return new Creator(e)}static currentPage(e){return new CurrentPage(e)}static data(e){return new Data(e)}static debug(e){return new Debug(e)}static defaultTypeface(e){return new DefaultTypeface(e)}static destination(e){return new Destination(e)}static documentAssembly(e){return new DocumentAssembly(e)}static driver(e){return new Driver(e)}static duplexOption(e){return new DuplexOption(e)}static dynamicRender(e){return new DynamicRender(e)}static embed(e){return new Embed(e)}static encrypt(e){return new Encrypt(e)}static encryption(e){return new Encryption(e)}static encryptionLevel(e){return new EncryptionLevel(e)}static enforce(e){return new Enforce(e)}static equate(e){return new Equate(e)}static equateRange(e){return new EquateRange(e)}static exclude(e){return new Exclude(e)}static excludeNS(e){return new ExcludeNS(e)}static flipLabel(e){return new FlipLabel(e)}static fontInfo(e){return new FontInfo(e)}static formFieldFilling(e){return new FormFieldFilling(e)}static groupParent(e){return new GroupParent(e)}static ifEmpty(e){return new IfEmpty(e)}static includeXDPContent(e){return new IncludeXDPContent(e)}static incrementalLoad(e){return new IncrementalLoad(e)}static incrementalMerge(e){return new IncrementalMerge(e)}static interactive(e){return new Interactive(e)}static jog(e){return new Jog(e)}static labelPrinter(e){return new LabelPrinter(e)}static layout(e){return new Layout(e)}static level(e){return new Level(e)}static linearized(e){return new Linearized(e)}static locale(e){return new Locale(e)}static localeSet(e){return new LocaleSet(e)}static log(e){return new Log(e)}static map(e){return new MapElement(e)}static mediumInfo(e){return new MediumInfo(e)}static message(e){return new Message(e)}static messaging(e){return new Messaging(e)}static mode(e){return new Mode(e)}static modifyAnnots(e){return new ModifyAnnots(e)}static msgId(e){return new MsgId(e)}static nameAttr(e){return new NameAttr(e)}static neverEmbed(e){return new NeverEmbed(e)}static numberOfCopies(e){return new NumberOfCopies(e)}static openAction(e){return new OpenAction(e)}static output(e){return new Output(e)}static outputBin(e){return new OutputBin(e)}static outputXSL(e){return new OutputXSL(e)}static overprint(e){return new Overprint(e)}static packets(e){return new Packets(e)}static pageOffset(e){return new PageOffset(e)}static pageRange(e){return new PageRange(e)}static pagination(e){return new Pagination(e)}static paginationOverride(e){return new PaginationOverride(e)}static part(e){return new Part(e)}static pcl(e){return new Pcl(e)}static pdf(e){return new Pdf(e)}static pdfa(e){return new Pdfa(e)}static permissions(e){return new Permissions(e)}static pickTrayByPDFSize(e){return new PickTrayByPDFSize(e)}static picture(e){return new Picture(e)}static plaintextMetadata(e){return new PlaintextMetadata(e)}static presence(e){return new Presence(e)}static present(e){return new Present(e)}static print(e){return new Print(e)}static printHighQuality(e){return new PrintHighQuality(e)}static printScaling(e){return new PrintScaling(e)}static printerName(e){return new PrinterName(e)}static producer(e){return new Producer(e)}static ps(e){return new Ps(e)}static range(e){return new Range(e)}static record(e){return new Record(e)}static relevant(e){return new Relevant(e)}static rename(e){return new Rename(e)}static renderPolicy(e){return new RenderPolicy(e)}static runScripts(e){return new RunScripts(e)}static script(e){return new Script(e)}static scriptModel(e){return new ScriptModel(e)}static severity(e){return new Severity(e)}static silentPrint(e){return new SilentPrint(e)}static staple(e){return new Staple(e)}static startNode(e){return new StartNode(e)}static startPage(e){return new StartPage(e)}static submitFormat(e){return new SubmitFormat(e)}static submitUrl(e){return new SubmitUrl(e)}static subsetBelow(e){return new SubsetBelow(e)}static suppressBanner(e){return new SuppressBanner(e)}static tagged(e){return new Tagged(e)}static template(e){return new Template(e)}static templateCache(e){return new TemplateCache(e)}static threshold(e){return new Threshold(e)}static to(e){return new To(e)}static trace(e){return new Trace(e)}static transform(e){return new Transform(e)}static type(e){return new Type(e)}static uri(e){return new Uri(e)}static validate(e){return new Validate(e)}static validateApprovalSignatures(e){return new ValidateApprovalSignatures(e)}static validationMessaging(e){return new ValidationMessaging(e)}static version(e){return new Version(e)}static versionControl(e){return new VersionControl(e)}static viewerPreferences(e){return new ViewerPreferences(e)}static webClient(e){return new WebClient(e)}static whitespace(e){return new Whitespace(e)}static window(e){return new Window(e)}static xdc(e){return new Xdc(e)}static xdp(e){return new Xdp(e)}static xsl(e){return new Xsl(e)}static zpl(e){return new Zpl(e)}}t.ConfigNamespace=ConfigNamespace},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.ConnectionSetNamespace=void 0;var r=a(77),n=a(75);const i=r.NamespaceIds.connectionSet.id;class ConnectionSet extends n.XFAObject{constructor(e){super(i,"connectionSet",!0);this.wsdlConnection=new n.XFAObjectArray;this.xmlConnection=new n.XFAObjectArray;this.xsdConnection=new n.XFAObjectArray}}class EffectiveInputPolicy extends n.XFAObject{constructor(e){super(i,"effectiveInputPolicy");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class EffectiveOutputPolicy extends n.XFAObject{constructor(e){super(i,"effectiveOutputPolicy");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Operation extends n.StringObject{constructor(e){super(i,"operation");this.id=e.id||"";this.input=e.input||"";this.name=e.name||"";this.output=e.output||"";this.use=e.use||"";this.usehref=e.usehref||""}}class RootElement extends n.StringObject{constructor(e){super(i,"rootElement");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class SoapAction extends n.StringObject{constructor(e){super(i,"soapAction");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class SoapAddress extends n.StringObject{constructor(e){super(i,"soapAddress");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Uri extends n.StringObject{constructor(e){super(i,"uri");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class WsdlAddress extends n.StringObject{constructor(e){super(i,"wsdlAddress");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class WsdlConnection extends n.XFAObject{constructor(e){super(i,"wsdlConnection",!0);this.dataDescription=e.dataDescription||"";this.name=e.name||"";this.effectiveInputPolicy=null;this.effectiveOutputPolicy=null;this.operation=null;this.soapAction=null;this.soapAddress=null;this.wsdlAddress=null}}class XmlConnection extends n.XFAObject{constructor(e){super(i,"xmlConnection",!0);this.dataDescription=e.dataDescription||"";this.name=e.name||"";this.uri=null}}class XsdConnection extends n.XFAObject{constructor(e){super(i,"xsdConnection",!0);this.dataDescription=e.dataDescription||"";this.name=e.name||"";this.rootElement=null;this.uri=null}}class ConnectionSetNamespace{static[r.$buildXFAObject](e,t){if(ConnectionSetNamespace.hasOwnProperty(e))return ConnectionSetNamespace[e](t)}static connectionSet(e){return new ConnectionSet(e)}static effectiveInputPolicy(e){return new EffectiveInputPolicy(e)}static effectiveOutputPolicy(e){return new EffectiveOutputPolicy(e)}static operation(e){return new Operation(e)}static rootElement(e){return new RootElement(e)}static soapAction(e){return new SoapAction(e)}static soapAddress(e){return new SoapAddress(e)}static uri(e){return new Uri(e)}static wsdlAddress(e){return new WsdlAddress(e)}static wsdlConnection(e){return new WsdlConnection(e)}static xmlConnection(e){return new XmlConnection(e)}static xsdConnection(e){return new XsdConnection(e)}}t.ConnectionSetNamespace=ConnectionSetNamespace},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.DatasetsNamespace=void 0;var r=a(75),n=a(77);const i=n.NamespaceIds.datasets.id;class Data extends r.XmlObject{constructor(e){super(i,"data",e)}[r.$isNsAgnostic](){return!0}}class Datasets extends r.XFAObject{constructor(e){super(i,"datasets",!0);this.data=null;this.Signature=null}[r.$onChild](e){const t=e[r.$nodeName];("data"===t&&e[r.$namespaceId]===i||"Signature"===t&&e[r.$namespaceId]===n.NamespaceIds.signature.id)&&(this[t]=e);this[r.$appendChild](e)}}class DatasetsNamespace{static[n.$buildXFAObject](e,t){if(DatasetsNamespace.hasOwnProperty(e))return DatasetsNamespace[e](t)}static datasets(e){return new Datasets(e)}static data(e){return new Data(e)}}t.DatasetsNamespace=DatasetsNamespace},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.LocaleSetNamespace=void 0;var r=a(77),n=a(75),i=a(76);const s=r.NamespaceIds.localeSet.id;class CalendarSymbols extends n.XFAObject{constructor(e){super(s,"calendarSymbols",!0);this.name="gregorian";this.dayNames=new n.XFAObjectArray(2);this.eraNames=null;this.meridiemNames=null;this.monthNames=new n.XFAObjectArray(2)}}class CurrencySymbol extends n.StringObject{constructor(e){super(s,"currencySymbol");this.name=(0,i.getStringOption)(e.name,["symbol","isoname","decimal"])}}class CurrencySymbols extends n.XFAObject{constructor(e){super(s,"currencySymbols",!0);this.currencySymbol=new n.XFAObjectArray(3)}}class DatePattern extends n.StringObject{constructor(e){super(s,"datePattern");this.name=(0,i.getStringOption)(e.name,["full","long","med","short"])}}class DatePatterns extends n.XFAObject{constructor(e){super(s,"datePatterns",!0);this.datePattern=new n.XFAObjectArray(4)}}class DateTimeSymbols extends n.ContentObject{constructor(e){super(s,"dateTimeSymbols")}}class Day extends n.StringObject{constructor(e){super(s,"day")}}class DayNames extends n.XFAObject{constructor(e){super(s,"dayNames",!0);this.abbr=(0,i.getInteger)({data:e.abbr,defaultValue:0,validate:e=>1===e});this.day=new n.XFAObjectArray(7)}}class Era extends n.StringObject{constructor(e){super(s,"era")}}class EraNames extends n.XFAObject{constructor(e){super(s,"eraNames",!0);this.era=new n.XFAObjectArray(2)}}class Locale extends n.XFAObject{constructor(e){super(s,"locale",!0);this.desc=e.desc||"";this.name="isoname";this.calendarSymbols=null;this.currencySymbols=null;this.datePatterns=null;this.dateTimeSymbols=null;this.numberPatterns=null;this.numberSymbols=null;this.timePatterns=null;this.typeFaces=null}}class LocaleSet extends n.XFAObject{constructor(e){super(s,"localeSet",!0);this.locale=new n.XFAObjectArray}}class Meridiem extends n.StringObject{constructor(e){super(s,"meridiem")}}class MeridiemNames extends n.XFAObject{constructor(e){super(s,"meridiemNames",!0);this.meridiem=new n.XFAObjectArray(2)}}class Month extends n.StringObject{constructor(e){super(s,"month")}}class MonthNames extends n.XFAObject{constructor(e){super(s,"monthNames",!0);this.abbr=(0,i.getInteger)({data:e.abbr,defaultValue:0,validate:e=>1===e});this.month=new n.XFAObjectArray(12)}}class NumberPattern extends n.StringObject{constructor(e){super(s,"numberPattern");this.name=(0,i.getStringOption)(e.name,["full","long","med","short"])}}class NumberPatterns extends n.XFAObject{constructor(e){super(s,"numberPatterns",!0);this.numberPattern=new n.XFAObjectArray(4)}}class NumberSymbol extends n.StringObject{constructor(e){super(s,"numberSymbol");this.name=(0,i.getStringOption)(e.name,["decimal","grouping","percent","minus","zero"])}}class NumberSymbols extends n.XFAObject{constructor(e){super(s,"numberSymbols",!0);this.numberSymbol=new n.XFAObjectArray(5)}}class TimePattern extends n.StringObject{constructor(e){super(s,"timePattern");this.name=(0,i.getStringOption)(e.name,["full","long","med","short"])}}class TimePatterns extends n.XFAObject{constructor(e){super(s,"timePatterns",!0);this.timePattern=new n.XFAObjectArray(4)}}class TypeFace extends n.XFAObject{constructor(e){super(s,"typeFace",!0);this.name=""|e.name}}class TypeFaces extends n.XFAObject{constructor(e){super(s,"typeFaces",!0);this.typeFace=new n.XFAObjectArray}}class LocaleSetNamespace{static[r.$buildXFAObject](e,t){if(LocaleSetNamespace.hasOwnProperty(e))return LocaleSetNamespace[e](t)}static calendarSymbols(e){return new CalendarSymbols(e)}static currencySymbol(e){return new CurrencySymbol(e)}static currencySymbols(e){return new CurrencySymbols(e)}static datePattern(e){return new DatePattern(e)}static datePatterns(e){return new DatePatterns(e)}static dateTimeSymbols(e){return new DateTimeSymbols(e)}static day(e){return new Day(e)}static dayNames(e){return new DayNames(e)}static era(e){return new Era(e)}static eraNames(e){return new EraNames(e)}static locale(e){return new Locale(e)}static localeSet(e){return new LocaleSet(e)}static meridiem(e){return new Meridiem(e)}static meridiemNames(e){return new MeridiemNames(e)}static month(e){return new Month(e)}static monthNames(e){return new MonthNames(e)}static numberPattern(e){return new NumberPattern(e)}static numberPatterns(e){return new NumberPatterns(e)}static numberSymbol(e){return new NumberSymbol(e)}static numberSymbols(e){return new NumberSymbols(e)}static timePattern(e){return new TimePattern(e)}static timePatterns(e){return new TimePatterns(e)}static typeFace(e){return new TypeFace(e)}static typeFaces(e){return new TypeFaces(e)}}t.LocaleSetNamespace=LocaleSetNamespace},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.SignatureNamespace=void 0;var r=a(77),n=a(75);const i=r.NamespaceIds.signature.id;class Signature extends n.XFAObject{constructor(e){super(i,"signature",!0)}}class SignatureNamespace{static[r.$buildXFAObject](e,t){if(SignatureNamespace.hasOwnProperty(e))return SignatureNamespace[e](t)}static signature(e){return new Signature(e)}}t.SignatureNamespace=SignatureNamespace},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.StylesheetNamespace=void 0;var r=a(77),n=a(75);const i=r.NamespaceIds.stylesheet.id;class Stylesheet extends n.XFAObject{constructor(e){super(i,"stylesheet",!0)}}class StylesheetNamespace{static[r.$buildXFAObject](e,t){if(StylesheetNamespace.hasOwnProperty(e))return StylesheetNamespace[e](t)}static stylesheet(e){return new Stylesheet(e)}}t.StylesheetNamespace=StylesheetNamespace},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.XdpNamespace=void 0;var r=a(77),n=a(75);const i=r.NamespaceIds.xdp.id;class Xdp extends n.XFAObject{constructor(e){super(i,"xdp",!0);this.uuid=e.uuid||"";this.timeStamp=e.timeStamp||"";this.config=null;this.connectionSet=null;this.datasets=null;this.localeSet=null;this.stylesheet=new n.XFAObjectArray;this.template=null}[n.$onChildCheck](e){const t=r.NamespaceIds[e[n.$nodeName]];return t&&e[n.$namespaceId]===t.id}}class XdpNamespace{static[r.$buildXFAObject](e,t){if(XdpNamespace.hasOwnProperty(e))return XdpNamespace[e](t)}static xdp(e){return new Xdp(e)}}t.XdpNamespace=XdpNamespace},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.XhtmlNamespace=void 0;var r=a(75),n=a(77),i=a(82),s=a(76);const o=n.NamespaceIds.xhtml.id,c=Symbol(),l=new Set(["color","font","font-family","font-size","font-stretch","font-style","font-weight","margin","margin-bottom","margin-left","margin-right","margin-top","letter-spacing","line-height","orphans","page-break-after","page-break-before","page-break-inside","tab-interval","tab-stop","text-align","text-decoration","text-indent","vertical-align","widows","kerning-mode","xfa-font-horizontal-scale","xfa-font-vertical-scale","xfa-spacerun","xfa-tab-stops"]),h=new Map([["page-break-after","breakAfter"],["page-break-before","breakBefore"],["page-break-inside","breakInside"],["kerning-mode",e=>"none"===e?"none":"normal"],["xfa-font-horizontal-scale",e=>`scaleX(${Math.max(0,Math.min(parseInt(e)/100)).toFixed(2)})`],["xfa-font-vertical-scale",e=>`scaleY(${Math.max(0,Math.min(parseInt(e)/100)).toFixed(2)})`],["xfa-spacerun",""],["xfa-tab-stops",""],["font-size",(e,t)=>{e=t.fontSize=(0,s.getMeasurement)(e);return(0,i.measureToString)(.99*e)}],["letter-spacing",e=>(0,i.measureToString)((0,s.getMeasurement)(e))],["line-height",e=>(0,i.measureToString)((0,s.getMeasurement)(e))],["margin",e=>(0,i.measureToString)((0,s.getMeasurement)(e))],["margin-bottom",e=>(0,i.measureToString)((0,s.getMeasurement)(e))],["margin-left",e=>(0,i.measureToString)((0,s.getMeasurement)(e))],["margin-right",e=>(0,i.measureToString)((0,s.getMeasurement)(e))],["margin-top",e=>(0,i.measureToString)((0,s.getMeasurement)(e))],["text-indent",e=>(0,i.measureToString)((0,s.getMeasurement)(e))],["font-family",e=>e],["vertical-align",e=>(0,i.measureToString)((0,s.getMeasurement)(e))]]),u=/\s+/g,d=/[\r\n]+/g,f=/\r\n?/g;function mapStyle(e,t,a){const n=Object.create(null);if(!e)return n;const o=Object.create(null);for(const[t,a]of e.split(";").map((e=>e.split(":",2)))){const e=h.get(t);if(""===e)continue;let r=a;e&&(r="string"==typeof e?e:e(a,o));t.endsWith("scale")?n.transform?n.transform=`${n[t]} ${r}`:n.transform=r:n[t.replaceAll(/-([a-zA-Z])/g,((e,t)=>t.toUpperCase()))]=r}n.fontFamily&&(0,i.setFontFamily)({typeface:n.fontFamily,weight:n.fontWeight||"normal",posture:n.fontStyle||"normal",size:o.fontSize||0},t,t[r.$globalData].fontFinder,n);if(a&&n.verticalAlign&&"0px"!==n.verticalAlign&&n.fontSize){const e=.583,t=.333,a=(0,s.getMeasurement)(n.fontSize);n.fontSize=(0,i.measureToString)(a*e);n.verticalAlign=(0,i.measureToString)(Math.sign((0,s.getMeasurement)(n.verticalAlign))*a*t)}a&&n.fontSize&&(n.fontSize=`calc(${n.fontSize} * var(--scale-factor))`);(0,i.fixTextIndent)(n);return n}const g=new Set(["body","html"]);class XhtmlObject extends r.XmlObject{constructor(e,t){super(o,t);this[c]=!1;this.style=e.style||""}[r.$clean](e){super[r.$clean](e);this.style=function checkStyle(e){return e.style?e.style.trim().split(/\s*;\s*/).filter((e=>!!e)).map((e=>e.split(/\s*:\s*/,2))).filter((([t,a])=>{"font-family"===t&&e[r.$globalData].usedTypefaces.add(a);return l.has(t)})).map((e=>e.join(":"))).join(";"):""}(this)}[r.$acceptWhitespace](){return!g.has(this[r.$nodeName])}[r.$onText](e,t=!1){if(t)this[c]=!0;else{e=e.replace(d,"");this.style.includes("xfa-spacerun:yes")||(e=e.replace(u," "))}e&&(this[r.$content]+=e)}[r.$pushGlyphs](e,t=!0){const a=Object.create(null),n={top:NaN,bottom:NaN,left:NaN,right:NaN};let i=null;for(const[e,t]of this.style.split(";").map((e=>e.split(":",2))))switch(e){case"font-family":a.typeface=(0,s.stripQuotes)(t);break;case"font-size":a.size=(0,s.getMeasurement)(t);break;case"font-weight":a.weight=t;break;case"font-style":a.posture=t;break;case"letter-spacing":a.letterSpacing=(0,s.getMeasurement)(t);break;case"margin":const e=t.split(/ \t/).map((e=>(0,s.getMeasurement)(e)));switch(e.length){case 1:n.top=n.bottom=n.left=n.right=e[0];break;case 2:n.top=n.bottom=e[0];n.left=n.right=e[1];break;case 3:n.top=e[0];n.bottom=e[2];n.left=n.right=e[1];break;case 4:n.top=e[0];n.left=e[1];n.bottom=e[2];n.right=e[3]}break;case"margin-top":n.top=(0,s.getMeasurement)(t);break;case"margin-bottom":n.bottom=(0,s.getMeasurement)(t);break;case"margin-left":n.left=(0,s.getMeasurement)(t);break;case"margin-right":n.right=(0,s.getMeasurement)(t);break;case"line-height":i=(0,s.getMeasurement)(t)}e.pushData(a,n,i);if(this[r.$content])e.addString(this[r.$content]);else for(const t of this[r.$getChildren]())"#text"!==t[r.$nodeName]?t[r.$pushGlyphs](e):e.addString(t[r.$content]);t&&e.popFont()}[r.$toHTML](e){const t=[];this[r.$extra]={children:t};this[r.$childrenToHTML]({});if(0===t.length&&!this[r.$content])return s.HTMLResult.EMPTY;let a;a=this[c]?this[r.$content]?this[r.$content].replace(f,"\n"):void 0:this[r.$content]||void 0;return s.HTMLResult.success({name:this[r.$nodeName],attributes:{href:this.href,style:mapStyle(this.style,this,this[c])},children:t,value:a})}}class A extends XhtmlObject{constructor(e){super(e,"a");this.href=(0,i.fixURL)(e.href)||""}}class B extends XhtmlObject{constructor(e){super(e,"b")}[r.$pushGlyphs](e){e.pushFont({weight:"bold"});super[r.$pushGlyphs](e);e.popFont()}}class Body extends XhtmlObject{constructor(e){super(e,"body")}[r.$toHTML](e){const t=super[r.$toHTML](e),{html:a}=t;if(!a)return s.HTMLResult.EMPTY;a.name="div";a.attributes.class=["xfaRich"];return t}}class Br extends XhtmlObject{constructor(e){super(e,"br")}[r.$text](){return"\n"}[r.$pushGlyphs](e){e.addString("\n")}[r.$toHTML](e){return s.HTMLResult.success({name:"br"})}}class Html extends XhtmlObject{constructor(e){super(e,"html")}[r.$toHTML](e){const t=[];this[r.$extra]={children:t};this[r.$childrenToHTML]({});if(0===t.length)return s.HTMLResult.success({name:"div",attributes:{class:["xfaRich"],style:{}},value:this[r.$content]||""});if(1===t.length){const e=t[0];if(e.attributes&&e.attributes.class.includes("xfaRich"))return s.HTMLResult.success(e)}return s.HTMLResult.success({name:"div",attributes:{class:["xfaRich"],style:{}},children:t})}}class I extends XhtmlObject{constructor(e){super(e,"i")}[r.$pushGlyphs](e){e.pushFont({posture:"italic"});super[r.$pushGlyphs](e);e.popFont()}}class Li extends XhtmlObject{constructor(e){super(e,"li")}}class Ol extends XhtmlObject{constructor(e){super(e,"ol")}}class P extends XhtmlObject{constructor(e){super(e,"p")}[r.$pushGlyphs](e){super[r.$pushGlyphs](e,!1);e.addString("\n");e.addPara();e.popFont()}[r.$text](){return this[r.$getParent]()[r.$getChildren]().at(-1)===this?super[r.$text]():super[r.$text]()+"\n"}}class Span extends XhtmlObject{constructor(e){super(e,"span")}}class Sub extends XhtmlObject{constructor(e){super(e,"sub")}}class Sup extends XhtmlObject{constructor(e){super(e,"sup")}}class Ul extends XhtmlObject{constructor(e){super(e,"ul")}}class XhtmlNamespace{static[n.$buildXFAObject](e,t){if(XhtmlNamespace.hasOwnProperty(e))return XhtmlNamespace[e](t)}static a(e){return new A(e)}static b(e){return new B(e)}static body(e){return new Body(e)}static br(e){return new Br(e)}static html(e){return new Html(e)}static i(e){return new I(e)}static li(e){return new Li(e)}static ol(e){return new Ol(e)}static p(e){return new P(e)}static span(e){return new Span(e)}static sub(e){return new Sub(e)}static sup(e){return new Sup(e)}static ul(e){return new Ul(e)}}t.XhtmlNamespace=XhtmlNamespace},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.UnknownNamespace=void 0;var r=a(77),n=a(75);class UnknownNamespace{constructor(e){this.namespaceId=e}[r.$buildXFAObject](e,t){return new n.XmlObject(this.namespaceId,e,t)}}t.UnknownNamespace=UnknownNamespace},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.DatasetReader=void 0;var r=a(2),n=a(3),i=a(64);function decodeString(e){try{return(0,r.stringToUTF8String)(e)}catch(t){(0,r.warn)(`UTF-8 decoding failed: "${t}".`);return e}}class DatasetXMLParser extends i.SimpleXMLParser{constructor(e){super(e);this.node=null}onEndElement(e){const t=super.onEndElement(e);if(t&&"xfa:datasets"===e){this.node=t;throw new Error("Aborting DatasetXMLParser.")}}}t.DatasetReader=class DatasetReader{constructor(e){if(e.datasets)this.node=new i.SimpleXMLParser({hasAttributes:!0}).parseFromString(e.datasets).documentElement;else{const t=new DatasetXMLParser({hasAttributes:!0});try{t.parseFromString(e["xdp:xdp"])}catch(e){}this.node=t.node}}getValue(e){if(!this.node||!e)return"";const t=this.node.searchNode((0,n.parseXFAPath)(e),0);if(!t)return"";const a=t.firstChild;return a&&"value"===a.nodeName?t.children.map((e=>decodeString(e.textContent))):decodeString(t.textContent)}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.XRef=void 0;var r=a(2),n=a(4),i=a(15),s=a(3),o=a(5),c=a(65);t.XRef=class XRef{constructor(e,t){this.stream=e;this.pdfManager=t;this.entries=[];this.xrefstms=Object.create(null);this._cacheMap=new Map;this._pendingRefs=new n.RefSet;this._newPersistentRefNum=null;this._newTemporaryRefNum=null}getNewPersistentRef(e){null===this._newPersistentRefNum&&(this._newPersistentRefNum=this.entries.length||1);const t=this._newPersistentRefNum++;this._cacheMap.set(t,e);return n.Ref.get(t,0)}getNewTemporaryRef(){null===this._newTemporaryRefNum&&(this._newTemporaryRefNum=this.entries.length||1);return n.Ref.get(this._newTemporaryRefNum++,0)}resetNewTemporaryRef(){this._newTemporaryRefNum=null}setStartXRef(e){this.startXRefQueue=[e]}parse(e=!1){let t,a,i;if(e){(0,r.warn)("Indexing all PDF objects");t=this.indexObjects()}else t=this.readXRef();t.assignXref(this);this.trailer=t;try{a=t.get("Encrypt")}catch(e){if(e instanceof s.MissingDataException)throw e;(0,r.warn)(`XRef.parse - Invalid "Encrypt" reference: "${e}".`)}if(a instanceof n.Dict){const e=t.get("ID"),r=e&&e.length?e[0]:"";a.suppressEncryption=!0;this.encrypt=new c.CipherTransformFactory(a,r,this.pdfManager.password)}try{i=t.get("Root")}catch(e){if(e instanceof s.MissingDataException)throw e;(0,r.warn)(`XRef.parse - Invalid "Root" reference: "${e}".`)}if(i instanceof n.Dict)try{if(i.get("Pages")instanceof n.Dict){this.root=i;return}}catch(e){if(e instanceof s.MissingDataException)throw e;(0,r.warn)(`XRef.parse - Invalid "Pages" reference: "${e}".`)}if(!e)throw new s.XRefParseException;throw new r.InvalidPDFException("Invalid Root reference.")}processXRefTable(e){"tableState"in this||(this.tableState={entryNum:0,streamPos:e.lexer.stream.pos,parserBuf1:e.buf1,parserBuf2:e.buf2});const t=this.readXRefTable(e);if(!(0,n.isCmd)(t,"trailer"))throw new r.FormatError("Invalid XRef table: could not find trailer dictionary");let a=e.getObj();a instanceof n.Dict||!a.dict||(a=a.dict);if(!(a instanceof n.Dict))throw new r.FormatError("Invalid XRef table: could not parse trailer dictionary");delete this.tableState;return a}readXRefTable(e){const t=e.lexer.stream,a=this.tableState;t.pos=a.streamPos;e.buf1=a.parserBuf1;e.buf2=a.parserBuf2;let i;for(;;){if(!("firstEntryNum"in a)||!("entryCount"in a)){if((0,n.isCmd)(i=e.getObj(),"trailer"))break;a.firstEntryNum=i;a.entryCount=e.getObj()}let s=a.firstEntryNum;const o=a.entryCount;if(!Number.isInteger(s)||!Number.isInteger(o))throw new r.FormatError("Invalid XRef table: wrong types in subsection header");for(let i=a.entryNum;i<o;i++){a.streamPos=t.pos;a.entryNum=i;a.parserBuf1=e.buf1;a.parserBuf2=e.buf2;const c={};c.offset=e.getObj();c.gen=e.getObj();const l=e.getObj();if(l instanceof n.Cmd)switch(l.cmd){case"f":c.free=!0;break;case"n":c.uncompressed=!0}if(!Number.isInteger(c.offset)||!Number.isInteger(c.gen)||!c.free&&!c.uncompressed)throw new r.FormatError(`Invalid entry in XRef subsection: ${s}, ${o}`);0===i&&c.free&&1===s&&(s=0);this.entries[i+s]||(this.entries[i+s]=c)}a.entryNum=0;a.streamPos=t.pos;a.parserBuf1=e.buf1;a.parserBuf2=e.buf2;delete a.firstEntryNum;delete a.entryCount}if(this.entries[0]&&!this.entries[0].free)throw new r.FormatError("Invalid XRef table: unexpected first object");return i}processXRefStream(e){if(!("streamState"in this)){const t=e.dict,a=t.get("W");let r=t.get("Index");r||(r=[0,t.get("Size")]);this.streamState={entryRanges:r,byteWidths:a,entryNum:0,streamPos:e.pos}}this.readXRefStream(e);delete this.streamState;return e.dict}readXRefStream(e){const t=this.streamState;e.pos=t.streamPos;const[a,n,i]=t.byteWidths,s=t.entryRanges;for(;s.length>0;){const[o,c]=s;if(!Number.isInteger(o)||!Number.isInteger(c))throw new r.FormatError(`Invalid XRef range fields: ${o}, ${c}`);if(!Number.isInteger(a)||!Number.isInteger(n)||!Number.isInteger(i))throw new r.FormatError(`Invalid XRef entry fields length: ${o}, ${c}`);for(let s=t.entryNum;s<c;++s){t.entryNum=s;t.streamPos=e.pos;let c=0,l=0,h=0;for(let t=0;t<a;++t){const t=e.getByte();if(-1===t)throw new r.FormatError("Invalid XRef byteWidths 'type'.");c=c<<8|t}0===a&&(c=1);for(let t=0;t<n;++t){const t=e.getByte();if(-1===t)throw new r.FormatError("Invalid XRef byteWidths 'offset'.");l=l<<8|t}for(let t=0;t<i;++t){const t=e.getByte();if(-1===t)throw new r.FormatError("Invalid XRef byteWidths 'generation'.");h=h<<8|t}const u={};u.offset=l;u.gen=h;switch(c){case 0:u.free=!0;break;case 1:u.uncompressed=!0;break;case 2:break;default:throw new r.FormatError(`Invalid XRef entry type: ${c}`)}this.entries[o+s]||(this.entries[o+s]=u)}t.entryNum=0;t.streamPos=e.pos;s.splice(0,2)}}indexObjects(){const e=10,t=13,a=60;function readToken(r,n){let i="",s=r[n];for(;s!==e&&s!==t&&s!==a&&!(++n>=r.length);){i+=String.fromCharCode(s);s=r[n]}return i}function skipUntil(e,t,a){const r=a.length,n=e.length;let i=0;for(;t<n;){let n=0;for(;n<r&&e[t+n]===a[n];)++n;if(n>=r)break;t++;i++}return i}const o=/\b(endobj|\d+\s+\d+\s+obj|xref|trailer)\b/g,c=/\b(startxref|\d+\s+\d+\s+obj)\b/g,l=/^(\d+)\s+(\d+)\s+obj\b/,h=new Uint8Array([116,114,97,105,108,101,114]),u=new Uint8Array([115,116,97,114,116,120,114,101,102]),d=new Uint8Array([47,88,82,101,102]);this.entries.length=0;this._cacheMap.clear();const f=this.stream;f.pos=0;const g=f.getBytes(),p=(0,r.bytesToString)(g),m=g.length;let b=f.start;const y=[],w=[];for(;b<m;){let a=g[b];if(9===a||a===e||a===t||32===a){++b;continue}if(37===a){do{++b;if(b>=m)break;a=g[b]}while(a!==e&&a!==t);continue}const n=readToken(g,b);let S;if(n.startsWith("xref")&&(4===n.length||/\s/.test(n[4]))){b+=skipUntil(g,b,h);y.push(b);b+=skipUntil(g,b,u)}else if(S=l.exec(n)){const e=0|S[1],t=0|S[2],a=b+n.length;let c,l=!1;if(this.entries[e]){if(this.entries[e].gen===t)try{new i.Parser({lexer:new i.Lexer(f.makeSubStream(a))}).getObj();l=!0}catch(e){e instanceof s.ParserEOFException?(0,r.warn)(`indexObjects -- checking object (${n}): "${e}".`):l=!0}}else l=!0;l&&(this.entries[e]={offset:b-f.start,gen:t,uncompressed:!0});o.lastIndex=a;const h=o.exec(p);if(h){c=o.lastIndex+1-b;if("endobj"!==h[1]){(0,r.warn)(`indexObjects: Found "${h[1]}" inside of another "obj", caused by missing "endobj" -- trying to recover.`);c-=h[1].length+1}}else c=m-b;const u=g.subarray(b,b+c),y=skipUntil(u,0,d);if(y<c&&u[y+5]<64){w.push(b-f.start);this.xrefstms[b-f.start]=1}b+=c}else if(n.startsWith("trailer")&&(7===n.length||/\s/.test(n[7]))){y.push(b);const e=b+n.length;let t;c.lastIndex=e;const a=c.exec(p);if(a){t=c.lastIndex+1-b;if("startxref"!==a[1]){(0,r.warn)(`indexObjects: Found "${a[1]}" after "trailer", caused by missing "startxref" -- trying to recover.`);t-=a[1].length+1}}else t=m-b;b+=t}else b+=n.length+1}for(const e of w){this.startXRefQueue.push(e);this.readXRef(!0)}const S=[];let x,C,k=!1;for(const e of y){f.pos=e;const t=new i.Parser({lexer:new i.Lexer(f),xref:this,allowStreams:!0,recoveryMode:!0}),a=t.getObj();if(!(0,n.isCmd)(a,"trailer"))continue;const r=t.getObj();if(r instanceof n.Dict){S.push(r);r.has("Encrypt")&&(k=!0)}}for(const e of[...S,"genFallback",...S]){if("genFallback"===e){if(!C)break;this._generationFallback=!0;continue}let t=!1;try{const a=e.get("Root");if(!(a instanceof n.Dict))continue;const r=a.get("Pages");if(!(r instanceof n.Dict))continue;const i=r.get("Count");Number.isInteger(i)&&(t=!0)}catch(e){C=e;continue}if(t&&(!k||e.has("Encrypt"))&&e.has("ID"))return e;x=e}if(x)return x;if(this.topDict)return this.topDict;throw new r.InvalidPDFException("Invalid PDF structure.")}readXRef(e=!1){const t=this.stream,a=new Set;for(;this.startXRefQueue.length;){try{const e=this.startXRefQueue[0];if(a.has(e)){(0,r.warn)("readXRef - skipping XRef table since it was already parsed.");this.startXRefQueue.shift();continue}a.add(e);t.pos=e+t.start;const s=new i.Parser({lexer:new i.Lexer(t),xref:this,allowStreams:!0});let c,l=s.getObj();if((0,n.isCmd)(l,"xref")){c=this.processXRefTable(s);this.topDict||(this.topDict=c);l=c.get("XRefStm");if(Number.isInteger(l)){const e=l;if(!(e in this.xrefstms)){this.xrefstms[e]=1;this.startXRefQueue.push(e)}}}else{if(!Number.isInteger(l))throw new r.FormatError("Invalid XRef stream header");if(!(Number.isInteger(s.getObj())&&(0,n.isCmd)(s.getObj(),"obj")&&(l=s.getObj())instanceof o.BaseStream))throw new r.FormatError("Invalid XRef stream");c=this.processXRefStream(l);this.topDict||(this.topDict=c);if(!c)throw new r.FormatError("Failed to read XRef stream")}l=c.get("Prev");Number.isInteger(l)?this.startXRefQueue.push(l):l instanceof n.Ref&&this.startXRefQueue.push(l.num)}catch(e){if(e instanceof s.MissingDataException)throw e;(0,r.info)("(while reading XRef): "+e)}this.startXRefQueue.shift()}if(this.topDict)return this.topDict;if(!e)throw new s.XRefParseException}getEntry(e){const t=this.entries[e];return t&&!t.free&&t.offset?t:null}fetchIfRef(e,t=!1){return e instanceof n.Ref?this.fetch(e,t):e}fetch(e,t=!1){if(!(e instanceof n.Ref))throw new Error("ref object is not a reference");const a=e.num,i=this._cacheMap.get(a);if(void 0!==i){i instanceof n.Dict&&!i.objId&&(i.objId=e.toString());return i}let s=this.getEntry(a);if(null===s){this._cacheMap.set(a,s);return s}if(this._pendingRefs.has(e)){this._pendingRefs.remove(e);(0,r.warn)(`Ignoring circular reference: ${e}.`);return n.CIRCULAR_REF}this._pendingRefs.put(e);try{s=s.uncompressed?this.fetchUncompressed(e,s,t):this.fetchCompressed(e,s,t);this._pendingRefs.remove(e)}catch(t){this._pendingRefs.remove(e);throw t}s instanceof n.Dict?s.objId=e.toString():s instanceof o.BaseStream&&(s.dict.objId=e.toString());return s}fetchUncompressed(e,t,a=!1){const c=e.gen;let l=e.num;if(t.gen!==c){const i=`Inconsistent generation in XRef: ${e}`;if(this._generationFallback&&t.gen<c){(0,r.warn)(i);return this.fetchUncompressed(n.Ref.get(l,t.gen),t,a)}throw new s.XRefEntryException(i)}const h=this.stream.makeSubStream(t.offset+this.stream.start),u=new i.Parser({lexer:new i.Lexer(h),xref:this,allowStreams:!0}),d=u.getObj(),f=u.getObj(),g=u.getObj();if(d!==l||f!==c||!(g instanceof n.Cmd))throw new s.XRefEntryException(`Bad (uncompressed) XRef entry: ${e}`);if("obj"!==g.cmd){if(g.cmd.startsWith("obj")){l=parseInt(g.cmd.substring(3),10);if(!Number.isNaN(l))return l}throw new s.XRefEntryException(`Bad (uncompressed) XRef entry: ${e}`)}(t=this.encrypt&&!a?u.getObj(this.encrypt.createCipherTransform(l,c)):u.getObj())instanceof o.BaseStream||this._cacheMap.set(l,t);return t}fetchCompressed(e,t,a=!1){const c=t.offset,l=this.fetch(n.Ref.get(c,0));if(!(l instanceof o.BaseStream))throw new r.FormatError("bad ObjStm stream");const h=l.dict.get("First"),u=l.dict.get("N");if(!Number.isInteger(h)||!Number.isInteger(u))throw new r.FormatError("invalid first and n parameters for ObjStm stream");let d=new i.Parser({lexer:new i.Lexer(l),xref:this,allowStreams:!0});const f=new Array(u),g=new Array(u);for(let e=0;e<u;++e){const t=d.getObj();if(!Number.isInteger(t))throw new r.FormatError(`invalid object number in the ObjStm stream: ${t}`);const a=d.getObj();if(!Number.isInteger(a))throw new r.FormatError(`invalid object offset in the ObjStm stream: ${a}`);f[e]=t;g[e]=a}const p=(l.start||0)+h,m=new Array(u);for(let e=0;e<u;++e){const t=e<u-1?g[e+1]-g[e]:void 0;if(t<0)throw new r.FormatError("Invalid offset in the ObjStm stream.");d=new i.Parser({lexer:new i.Lexer(l.makeSubStream(p+g[e],t,l.dict)),xref:this,allowStreams:!0});const a=d.getObj();m[e]=a;if(a instanceof o.BaseStream)continue;const n=f[e],s=this.entries[n];s&&s.offset===c&&s.gen===e&&this._cacheMap.set(n,a)}if(void 0===(t=m[t.gen]))throw new s.XRefEntryException(`Bad (compressed) XRef entry: ${e}`);return t}async fetchIfRefAsync(e,t){return e instanceof n.Ref?this.fetchAsync(e,t):e}async fetchAsync(e,t){try{return this.fetch(e,t)}catch(a){if(!(a instanceof s.MissingDataException))throw a;await this.pdfManager.requestRange(a.begin,a.end);return this.fetchAsync(e,t)}}getCatalogObj(){return this.root}}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.isNodeJS=void 0;const a=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type);t.isNodeJS=a},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.MessageHandler=void 0;var r=a(2);const n=1,i=2,s=1,o=2,c=3,l=4,h=5,u=6,d=7,f=8;function wrapReason(e){e instanceof Error||"object"==typeof e&&null!==e||(0,r.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.');switch(e.name){case"AbortException":return new r.AbortException(e.message);case"MissingPDFException":return new r.MissingPDFException(e.message);case"PasswordException":return new r.PasswordException(e.message,e.code);case"UnexpectedResponseException":return new r.UnexpectedResponseException(e.message,e.status);case"UnknownErrorException":return new r.UnknownErrorException(e.message,e.details);default:return new r.UnknownErrorException(e.message,e.toString())}}t.MessageHandler=class MessageHandler{constructor(e,t,a){this.sourceName=e;this.targetName=t;this.comObj=a;this.callbackId=1;this.streamId=1;this.streamSinks=Object.create(null);this.streamControllers=Object.create(null);this.callbackCapabilities=Object.create(null);this.actionHandler=Object.create(null);this._onComObjOnMessage=e=>{const t=e.data;if(t.targetName!==this.sourceName)return;if(t.stream){this._processStreamMessage(t);return}if(t.callback){const e=t.callbackId,a=this.callbackCapabilities[e];if(!a)throw new Error(`Cannot resolve callback ${e}`);delete this.callbackCapabilities[e];if(t.callback===n)a.resolve(t.data);else{if(t.callback!==i)throw new Error("Unexpected callback case");a.reject(wrapReason(t.reason))}return}const r=this.actionHandler[t.action];if(!r)throw new Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){const e=this.sourceName,s=t.sourceName;new Promise((function(e){e(r(t.data))})).then((function(r){a.postMessage({sourceName:e,targetName:s,callback:n,callbackId:t.callbackId,data:r})}),(function(r){a.postMessage({sourceName:e,targetName:s,callback:i,callbackId:t.callbackId,reason:wrapReason(r)})}))}else t.streamId?this._createStreamSink(t):r(t.data)};a.addEventListener("message",this._onComObjOnMessage)}on(e,t){const a=this.actionHandler;if(a[e])throw new Error(`There is already an actionName called "${e}"`);a[e]=t}send(e,t,a){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},a)}sendWithPromise(e,t,a){const n=this.callbackId++,i=(0,r.createPromiseCapability)();this.callbackCapabilities[n]=i;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:n,data:t},a)}catch(e){i.reject(e)}return i.promise}sendWithStream(e,t,a,n){const i=this.streamId++,o=this.sourceName,c=this.targetName,l=this.comObj;return new ReadableStream({start:a=>{const s=(0,r.createPromiseCapability)();this.streamControllers[i]={controller:a,startCall:s,pullCall:null,cancelCall:null,isClosed:!1};l.postMessage({sourceName:o,targetName:c,action:e,streamId:i,data:t,desiredSize:a.desiredSize},n);return s.promise},pull:e=>{const t=(0,r.createPromiseCapability)();this.streamControllers[i].pullCall=t;l.postMessage({sourceName:o,targetName:c,stream:u,streamId:i,desiredSize:e.desiredSize});return t.promise},cancel:e=>{(0,r.assert)(e instanceof Error,"cancel must have a valid reason");const t=(0,r.createPromiseCapability)();this.streamControllers[i].cancelCall=t;this.streamControllers[i].isClosed=!0;l.postMessage({sourceName:o,targetName:c,stream:s,streamId:i,reason:wrapReason(e)});return t.promise}},a)}_createStreamSink(e){const t=e.streamId,a=this.sourceName,n=e.sourceName,i=this.comObj,s=this,o=this.actionHandler[e.action],u={enqueue(e,s=1,o){if(this.isCancelled)return;const c=this.desiredSize;this.desiredSize-=s;if(c>0&&this.desiredSize<=0){this.sinkCapability=(0,r.createPromiseCapability)();this.ready=this.sinkCapability.promise}i.postMessage({sourceName:a,targetName:n,stream:l,streamId:t,chunk:e},o)},close(){if(!this.isCancelled){this.isCancelled=!0;i.postMessage({sourceName:a,targetName:n,stream:c,streamId:t});delete s.streamSinks[t]}},error(e){(0,r.assert)(e instanceof Error,"error must have a valid reason");if(!this.isCancelled){this.isCancelled=!0;i.postMessage({sourceName:a,targetName:n,stream:h,streamId:t,reason:wrapReason(e)})}},sinkCapability:(0,r.createPromiseCapability)(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};u.sinkCapability.resolve();u.ready=u.sinkCapability.promise;this.streamSinks[t]=u;new Promise((function(t){t(o(e.data,u))})).then((function(){i.postMessage({sourceName:a,targetName:n,stream:f,streamId:t,success:!0})}),(function(e){i.postMessage({sourceName:a,targetName:n,stream:f,streamId:t,reason:wrapReason(e)})}))}_processStreamMessage(e){const t=e.streamId,a=this.sourceName,n=e.sourceName,i=this.comObj,g=this.streamControllers[t],p=this.streamSinks[t];switch(e.stream){case f:e.success?g.startCall.resolve():g.startCall.reject(wrapReason(e.reason));break;case d:e.success?g.pullCall.resolve():g.pullCall.reject(wrapReason(e.reason));break;case u:if(!p){i.postMessage({sourceName:a,targetName:n,stream:d,streamId:t,success:!0});break}p.desiredSize<=0&&e.desiredSize>0&&p.sinkCapability.resolve();p.desiredSize=e.desiredSize;new Promise((function(e){e(p.onPull&&p.onPull())})).then((function(){i.postMessage({sourceName:a,targetName:n,stream:d,streamId:t,success:!0})}),(function(e){i.postMessage({sourceName:a,targetName:n,stream:d,streamId:t,reason:wrapReason(e)})}));break;case l:(0,r.assert)(g,"enqueue should have stream controller");if(g.isClosed)break;g.controller.enqueue(e.chunk);break;case c:(0,r.assert)(g,"close should have stream controller");if(g.isClosed)break;g.isClosed=!0;g.controller.close();this._deleteStreamController(g,t);break;case h:(0,r.assert)(g,"error should have stream controller");g.controller.error(wrapReason(e.reason));this._deleteStreamController(g,t);break;case o:e.success?g.cancelCall.resolve():g.cancelCall.reject(wrapReason(e.reason));this._deleteStreamController(g,t);break;case s:if(!p)break;new Promise((function(t){t(p.onCancel&&p.onCancel(wrapReason(e.reason)))})).then((function(){i.postMessage({sourceName:a,targetName:n,stream:o,streamId:t,success:!0})}),(function(e){i.postMessage({sourceName:a,targetName:n,stream:o,streamId:t,reason:wrapReason(e)})}));p.sinkCapability.reject(wrapReason(e.reason));p.isCancelled=!0;delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}}async _deleteStreamController(e,t){await Promise.allSettled([e.startCall&&e.startCall.promise,e.pullCall&&e.pullCall.promise,e.cancelCall&&e.cancelCall.promise]);delete this.streamControllers[t]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0});t.PDFWorkerStream=void 0;var r=a(2);t.PDFWorkerStream=class PDFWorkerStream{constructor(e){this._msgHandler=e;this._contentLength=null;this._fullRequestReader=null;this._rangeRequestReaders=[]}getFullReader(){(0,r.assert)(!this._fullRequestReader,"PDFWorkerStream.getFullReader can only be called once.");this._fullRequestReader=new PDFWorkerStreamReader(this._msgHandler);return this._fullRequestReader}getRangeReader(e,t){const a=new PDFWorkerStreamRangeReader(e,t,this._msgHandler);this._rangeRequestReaders.push(a);return a}cancelAllRequests(e){this._fullRequestReader&&this._fullRequestReader.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}};class PDFWorkerStreamReader{constructor(e){this._msgHandler=e;this.onProgress=null;this._contentLength=null;this._isRangeSupported=!1;this._isStreamingSupported=!1;const t=this._msgHandler.sendWithStream("GetReader");this._reader=t.getReader();this._headersReady=this._msgHandler.sendWithPromise("ReaderHeadersReady").then((e=>{this._isStreamingSupported=e.isStreamingSupported;this._isRangeSupported=e.isRangeSupported;this._contentLength=e.contentLength}))}get headersReady(){return this._headersReady}get contentLength(){return this._contentLength}get isStreamingSupported(){return this._isStreamingSupported}get isRangeSupported(){return this._isRangeSupported}async read(){const{value:e,done:t}=await this._reader.read();return t?{value:void 0,done:!0}:{value:e.buffer,done:!1}}cancel(e){this._reader.cancel(e)}}class PDFWorkerStreamRangeReader{constructor(e,t,a){this._msgHandler=a;this.onProgress=null;const r=this._msgHandler.sendWithStream("GetRangeReader",{begin:e,end:t});this._reader=r.getReader()}get isStreamingSupported(){return!1}async read(){const{value:e,done:t}=await this._reader.read();return t?{value:void 0,done:!0}:{value:e.buffer,done:!1}}cancel(e){this._reader.cancel(e)}}}],t={};function __w_pdfjs_require__(a){var r=t[a];if(void 0!==r)return r.exports;var n=t[a]={exports:{}};e[a](n,n.exports,__w_pdfjs_require__);return n.exports}__w_pdfjs_require__.d=(e,t)=>{for(var a in t)__w_pdfjs_require__.o(t,a)&&!__w_pdfjs_require__.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})};__w_pdfjs_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);__w_pdfjs_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});Object.defineProperty(e,"__esModule",{value:!0})};var a={};(()=>{var e=a;Object.defineProperty(e,"__esModule",{value:!0});Object.defineProperty(e,"WorkerMessageHandler",{enumerable:!0,get:function(){return t.WorkerMessageHandler}});var t=__w_pdfjs_require__(1)})();return a})())); \ No newline at end of file
diff --git a/vhosts/blog/static/slide.js b/vhosts/blog/static/slide.js
new file mode 100644
index 00000000..77e49acc
--- /dev/null
+++ b/vhosts/blog/static/slide.js
@@ -0,0 +1,59 @@
+document.addEventListener("DOMContentLoaded", async () => {
+ const pdfjsLib = globalThis.pdfjsLib;
+ pdfjsLib.GlobalWorkerOptions.workerSrc = "https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.4.120/pdf.worker.min.js";
+
+ const canvas = document.getElementById("slide");
+ const ctx = canvas.getContext("2d");
+ const url = canvas.dataset.slideLink;
+
+ let pageNum = 1;
+ let pageNumPending = null;
+ let pageRendering = false;
+ let doc = null;
+
+ const renderPage = async (num) => {
+ pageRendering = true;
+ const page = await doc.getPage(num);
+
+ var viewport = page.getViewport({ scale: 1.0 });
+ canvas.height = viewport.height;
+ canvas.width = viewport.width;
+
+ // TODO: error handling
+ await page.render({
+ canvasContext: ctx,
+ viewport: viewport,
+ });
+
+ pageRendering = false;
+ if (pageNumPending !== null) {
+ renderPage(pageNumPending);
+ pageNumPending = null;
+ }
+ };
+
+ const queueRenderPage = (num) => {
+ if (pageRendering) {
+ pageNumPending = num;
+ } else {
+ renderPage(num);
+ }
+ };
+
+ const prev = document.getElementById("prev");
+ prev.addEventListener("click", () => {
+ if (pageNum <= 1) return;
+ pageNum--;
+ queueRenderPage(pageNum);
+ });
+ const next = document.getElementById("next");
+ next.addEventListener("click", () => {
+ if (pageNum >= doc.numPages) return;
+ pageNum++;
+ queueRenderPage(pageNum);
+ });
+
+ // TODO: error handling
+ doc = await pdfjsLib.getDocument(url).promise;
+ queueRenderPage(pageNum);
+});
diff --git a/vhosts/blog/static/style.css b/vhosts/blog/static/style.css
new file mode 100644
index 00000000..8d7120af
--- /dev/null
+++ b/vhosts/blog/static/style.css
@@ -0,0 +1,269 @@
+html {
+ box-sizing: border-box;
+}
+
+*, *:before, *:after {
+ box-sizing: inherit;
+}
+
+body {
+ font-family: 'Yu Gothic', 'Meiryo', 'Noto Sans JP', sans-serif;
+ color: #000;
+ background-color: #fff;
+ line-height: 1.8;
+ height: 100vh;
+ margin: 0;
+ padding: 0;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+}
+
+header.header {
+ background-color: #f5f5f5;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 1rem 15%;
+ box-shadow: 0px 1px 5px rgba(0,0,0,0.1);
+}
+
+main {
+ max-width: 800px;
+ margin: 2rem auto;
+ flex-grow: 1;
+}
+
+body > footer {
+ background-color: #f5f5f5;
+ padding: 1rem 20%;
+ text-align: center;
+ box-shadow: 0px -1px 5px rgba(0,0,0,0.1);
+}
+
+nav {
+ font-size: 1.5rem;
+ padding: 0;
+ margin: 0;
+ width: 100%;
+}
+
+nav ul {
+ list-style-type: none;
+ padding: 0;
+ margin: 0;
+ display: flex;
+ flex-direction: row;
+}
+
+nav ul li {
+ margin: 0 1.2rem;
+}
+
+nav ul li:first-child {
+ font-weight: bold;
+ margin-right: auto;
+}
+
+nav ul li a {
+ border: none;
+ color: #000;
+}
+
+h1, h2, h3, h4, h5, h6 {
+ font-weight: bold;
+}
+
+p {
+ font-size: 1rem;
+ line-height: 1.8;
+ margin-bottom: 1.2rem;
+}
+
+a {
+ text-decoration: none;
+ color: #000;
+ border-bottom: 1px solid #000;
+}
+
+a:hover {
+ color: #666;
+}
+
+pre {
+ background-color: #f5f5f5;
+ padding: 1rem;
+ overflow-x: auto;
+ font-family: 'Courier New', Courier, monospace;
+ font-size: 0.9rem;
+}
+
+blockquote {
+ background-color: #f5f5f5;
+ border-left: 5px solid #555;
+ padding: 1rem;
+ margin: 1rem 0;
+}
+
+.tag {
+ display: inline-block;
+ background-color: #f5f5f5;
+ padding: 3px 8px;
+ border-radius: 5px;
+ font-size: 0.9rem;
+ margin-right: 5px;
+ margin-bottom: 5px;
+}
+
+.tag a {
+ border: none;
+}
+
+code {
+ background-color: #f5f5f5;
+ padding: 2px 5px;
+ font-family: 'Courier New', Courier, monospace;
+ font-size: 0.9rem;
+ border-radius: 3px;
+}
+
+pre code {
+ padding: 0;
+}
+
+li.revision {
+ list-style: inside;
+}
+
+h1 {
+ font-size: 2.2rem;
+}
+
+.post-content h2,
+.post-content h3,
+.post-content h4,
+.post-content h5,
+.post-content h6 {
+ border-bottom: 1px solid #555;
+ margin-bottom: 1.2rem;
+}
+
+.post-content h2 a,
+.post-content h3 a,
+.post-content h4 a,
+.post-content h5 a,
+.post-content h6 a {
+ border: none;
+}
+
+.post-content h2:before {
+ content: "#";
+ padding-right: 0.3rem;
+ color: #555;
+ font-weight: bold;
+}
+
+.post-content h3:before {
+ content: "##";
+ padding-right: 0.3rem;
+ color: #555;
+ font-weight: bold;
+}
+
+.post-content h4:before {
+ content: "###";
+ padding-right: 0.3rem;
+ color: #555;
+ font-weight: bold;
+}
+
+.post-content h5:before {
+ content: "####";
+ padding-right: 0.3rem;
+ color: #555;
+ font-weight: bold;
+}
+
+.post-content h6:before {
+ content: "#####";
+ padding-right: 0.3rem;
+ color: #555;
+ font-weight: bold;
+}
+
+.post-entry {
+ min-width: calc(min(800px, 100vw - 2rem));
+ background-color: #f5f5f5;
+ border-radius: 10px;
+ padding: 1.5rem;
+ margin: 2rem 0;
+ box-shadow: 0px 1px 5px rgba(0,0,0,0.1);
+}
+
+.post-entry header {
+ border: none;
+}
+
+.post-entry header h2 {
+ margin: 0;
+}
+
+.post-entry section {
+ color: #666;
+}
+
+.post-entry footer {
+ background-color: #f5f5f5;
+ padding: 0;
+ text-align: left;
+ color: #666;
+}
+
+.admonition {
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ background-color: #f5f5f5;
+ border: 1px solid #d1d1d1;
+ border-radius: 5px;
+ padding: 1rem;
+ margin: 1rem 0;
+ box-shadow: 0px 1px 5px rgba(0,0,0,0.1);
+}
+
+.admonition-label {
+ font-weight: bold;
+ color: #333;
+ margin-right: 1rem;
+}
+
+.admonition-content {
+ font-size: 1rem;
+}
+
+.not-found {
+ font-size: 8rem;
+ font-weight: bold;
+}
+
+@media screen and (max-width: 768px) {
+ main {
+ padding: 0 1rem;
+ }
+}
+
+@media screen and (max-width: 1200px) {
+ header.header {
+ padding: 1rem 0;
+ }
+
+ nav ul li:not(:first-child) {
+ display: none;
+ }
+}
+
+.my-icon {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}