From c25836c78891c42735950cf79ea66b832e8428fd Mon Sep 17 00:00:00 2001 From: Thomas Weber Date: Wed, 23 Jun 2021 19:57:27 -0500 Subject: [PATCH] Out with the old --- .gitignore | 1 - CNAME | 1 - LICENSE | 674 -------------------------------- README.md | 9 - conditionals.js | 117 ------ credits.html | 82 ---- default-icon.png | Bin 9115 -> 0 bytes downloader.js | 336 ---------------- http-server.js | 143 ------- index.html | 589 ---------------------------- lib/details-element-polyfill.js | 203 ---------- lib/icns.js | 6 - lib/jszip.min.js | 15 - packager.js | 489 ----------------------- parseoptions.js | 174 --------- 15 files changed, 2839 deletions(-) delete mode 100644 .gitignore delete mode 100644 CNAME delete mode 100644 LICENSE delete mode 100644 README.md delete mode 100644 conditionals.js delete mode 100644 credits.html delete mode 100644 default-icon.png delete mode 100644 downloader.js delete mode 100644 http-server.js delete mode 100644 index.html delete mode 100644 lib/details-element-polyfill.js delete mode 100644 lib/icns.js delete mode 100644 lib/jszip.min.js delete mode 100644 packager.js delete mode 100644 parseoptions.js diff --git a/.gitignore b/.gitignore deleted file mode 100644 index c4c4ffc..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.zip diff --git a/CNAME b/CNAME deleted file mode 100644 index 5094725..0000000 --- a/CNAME +++ /dev/null @@ -1 +0,0 @@ -packager.turbowarp.org \ No newline at end of file diff --git a/LICENSE b/LICENSE deleted file mode 100644 index e72bfdd..0000000 --- a/LICENSE +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index 96d3376..0000000 --- a/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# TurboWarp Packager - -https://packager.turbowarp.org/ - -A packager for Scratch projects. - -This website is plain HTML and JavaScript, no build steps required. Spin up a local HTTP server and just type and reload. If you don't have one of those on hand, run `node http-server` and open http://localhost:8080/. - -It uses a modified version of the TurboWarp GUI, https://github.com/TurboWarp/scratch-gui/tree/packager diff --git a/conditionals.js b/conditionals.js deleted file mode 100644 index 17ecff4..0000000 --- a/conditionals.js +++ /dev/null @@ -1,117 +0,0 @@ -/* -Copyright (c) 2020 Thomas Weber - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -window.Conditionals = (function() { - /** @type {Conditional[]} */ - const conditionals = []; - - const prefersReducedMotion = window.matchMedia('(prefers-reduced-motion)'); - - class Conditional { - constructor() { - this._lastVisible = null; - } - - isVisible() { - return false; - } - - onchange(visible) { - - } - - update() { - const visible = this.isVisible(); - if (visible === this._lastVisible) { - return; - } - this._lastVisible = visible; - this.onchange(visible); - } - } - - class Regular extends Conditional { - constructor(el) { - super(); - this.el = el; - } - - onchange(visible) { - this.el.hidden = !visible; - } - } - - class Animated extends Conditional { - constructor(el) { - super(); - this.el = el; - this.el.style.overflow = 'hidden'; - this.el.style.transition = '.2s'; - this.height = getComputedStyle(el).height; - } - - onchange(visible) { - // Because the element isn't actually hidden or removed from the DOM, we have to do some extra work to make sure that - // inputs and such won't upset accessibility tools or tab index - if (visible) { - this.el.style.height = this.height; - this.el.removeAttribute('aria-hidden'); - for (const input of this.el.querySelectorAll('input')) { - input.disabled = input._disabled; - input.tabIndex = input._tabIndex; - } - } else { - this.el.style.height = '0'; - this.el.setAttribute('aria-hidden', 'true'); - for (const input of this.el.querySelectorAll('input')) { - input._disabled = input.disabled; - input._tabIndex = input.tabIndex; - input.tabIndex = -1; - input.disabled = true; - } - } - } - } - - const setupConditionals = () => { - for (const el of document.querySelectorAll('[if]')) { - const isVisible = new Function('return ' + el.getAttribute('if') + ';'); - - let conditional; - if (el.classList.contains('fold') && !prefersReducedMotion.matches) { - conditional = new Animated(el); - } else { - conditional = new Regular(el); - } - conditional.isVisible = isVisible; - conditionals.push(conditional); - } - - updateConditionals(); - }; - - const updateConditionals = () => { - for (const i of conditionals) { - i.update(); - } - }; - - return { - setup: setupConditionals, - update: updateConditionals, - }; -})(); diff --git a/credits.html b/credits.html deleted file mode 100644 index 73ca4c0..0000000 --- a/credits.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - Library Credits - - - -

icns

-

Homepage

-
- License -
MIT License
-
-Copyright (c) 2018 fiahfy
-
-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.
-
- -

JSZip

-

Homepage

-
- License -
Copyright (c) 2009-2016 Stuart Knightley, David Duponchel, Franz Buchinger, António Afonso
-
-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.
-
- -

details-element-polyfill

-

Homepage

-
- License -
The MIT License (MIT)
-
-Copyright (c) 2019 Javan Makhmali
-
-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/default-icon.png b/default-icon.png deleted file mode 100644 index 82b9fc221c418e1eb5733391cf779694f27140eb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9115 zcmd^lRZtzk?)MSg-Mthk?k>flMT)z-I}|$yN^uG;Qe2B$ad-C?iXY${thf~Sk2`ap zzq#-KJnZcJvYTWwo0%k=Xbm+*Yzztv004lktR$xi0DxY$AOPCS3iwSJ%LD+tvQ(CP ztL?vhl>ISFUFW%H8mn)DtUpeIf@g@P?lpsvwK8J@21g7@Q9wa~qRmNdvSN3G_-7L3 zaArnEG1;cWbYzQ&Q7pdx39{97+PKzSuV$|k*h$v?V~FI5UXAHg=ijWrsr2h>*b&St zj7Y(pN#7TU)|vBz-PzH%O~64 zXJtj1oNSWO=W*#7J@Zy_Y()b2PnSkGJ-`5+)vOBfNH0Ijtw3dTd;SG;AKPzrwX+b$ zAhNUSgUaVgZk3;siM@x21+#G0wgkP+Nl9%>sURe2TBxv_Q|2AtO7qS-=r1Ks`RYa?7hn}0*W*$E3_?~qrNv|SXi~pQ-zGhn5K4$>VfiHL-@9W>yjsKMg zDMN)qc-C|2+o7h6P$Ye!L59Bdx_7(sASI}>F8K15vVSi9)>)VoJfF zJ6NAva~FVE?v z)fUBC@(6<*uFeZajm40aj)8dq>Marl46ixnUI+#=CK2#Um_}e^>kS{I9K57lFbdjY z;1*G(b|in($ZaZpb4^Ak(ZhpRPT$C$ledeUxB|{X&EMA?-!MZ`!cD}HVT1|;XTZit z`56Dj0E&SrsfHxV!Vln=6Yk{UD#{$OjMkWR&8W~*TSz{aaEPl$R{ zLbw0kOp53B*j$y~iLc%}h$s&aE9<7Ff^OMNk&5E*z`)`|RN+qvX-i9)zVwN>iHRBd zBH1@`@`L=B?eqgUfq=Kbt15$b5}JIEgd7(b>&LrkNKTRf@Af`cHjQM zMex8QwK0~r%kSSqt=6tfO~IL0{fPal<0B2T798df(e$8n9^G0;XWCxId!ZbaDI4}u z&qgsZVb^w9yXx&#d(a}dQi{ZwolK2gN9FnCHE+U1A7`8LNlr-&_$rwwr-142L03fM z!CjHVjH@7pW5-*X_7Y!SWu50$sR74)nou3P1dVTz+R7-DLn^4-d($T&e^NPWA$wGB zrJ)~(WZxffa%KSxPQuekTK{=(Hkd7yKNw_FJ!LH~@~-BA8Rh`WIrwEFStC1`cA(0p zHxk1KYDkOrlHJSDA2Mj%W#aV(5r_$W_2u$=yNnAXl&B)Ak8^c2=yY!tzm`9veR~*B z2XHMD<$VPM*J{W3H`u6wD$xzS5hOB2$JZqxo`GN~Mfb9WDmf>Q+p!XN^ z5K6LjpDdl?y#(xLgE-2LrH~Shj=^}6J=bO-#5)YM*I0WGh3+$(!FHI#9EO_CL*1!G ztF~`?o~oUY>KHhggru!l-n#l*v7MRGS=C5Y)bqe}=L)r-bIuc}j2y@*oz%%zgtO2VuYL(- zBQb#(FYu2nubNFPYUnbLNwwH=MQR+Hmk6bGF2U2wDx+jp&QXhdx_+HIi6JkoiM{g+j8-Znnr$F0)J=${yTo|9{ah6;M7GEHwZ_4cFGM!mWk?;A z3v>Qi7{2DUFzlSXc>~_daPjlACo$p+uRUjFWuC9ReOLc{bobcGVY0JW*1rE?o~QHC zkDtw`$yqMC;i93TMOO5_`3q!x3K0{r_S{5jcKtEuH};5e=g4D8rMTx?k!HU=r=5h* z$y{*5cA;MIJ%3#79=2*KBJ$Q5Wu^3vU8gPeVQNZi!LFQ7&EQ{yVC280g67cd!*!G| zUcQv2Q4sJLnU%!F7ju52n{)-z8&&)h$?^dAq|^0h3Nwb}2|?E3U(cSD3h(Db#=i?A zyjKqZnN7>rQYs&nj%7>B%#UtKDSy ztU=Vz9J+k|jFhdfc+VI79!cphrwJ`z+{XgeID_#Y6dKURVx6v!OmP{BwggAkV%3_I zScL%^Q2(zoEHQ{A>B+gl4j$3k{h({X`f)OUx3k6X5j;+n5u_An&$YqaCa(TEPo1+? z4DSncp1-ZM!?OEHvHR3XE|B%R<5o^%dx;lXPFy%~8_s3%_;2s|bS=n(+|TF<2Rg16 zN-%>25RFC?Uaj$gppHRP)oo2B;0@-_(QAsLlk3>dgfqKPjU+DBSBk2ry@dsC&`GED zfS^%c*#uQKr}W9f(_qBacq(g$ECNXhVc0f&Fht&PSCk&_NgXbt-W(;li;wp(pFKn# zxII(C!+_uF>Xs`Oc}>y=n)ux7KHF^3IL}WiMRf>JFsR-Z#7^tj=+JpM(BI>_J8z+N z^i<+bH_K-OEC4>{7fvi?HPqQU&y=V{#nR^Tz1#j2V2%7Dx;pP|@=7&AI$F`xq*B zvMQRiy`xU`%ujdtK&<9m?Ej($RpCn;k8CBv#$n@NfckK9kf2c?a_cucrCmlz50SNCi3jR4MhAlalosGv z;KL7T@Pf)?qy>ZRqNuQ{_s+sKfG2=_Y8eMuVTS1G_gUi@q-!Mjyy*dZ^7J^vwT?7Y zsg@^S15hi*bFI6KQmEGP_?R9Da*lk<0}Ka%U~H+y6gLVLrEY@=QLWG$^l}?qcfDkD zwfTXf3fVAF52v&vF5CqOI{=!$YF`8%qUPg-mGwB>$fTOT`Ht7oeg>*Wcc;J+^!36ieyvGBL;MNHD3c$ zS*y|DpU54qT^56+52-(uoc(6)8GOB2r<7izJ9|@ON$QQVC^9WX0+&JbTf6F zn9g-T6Oi0}e-{~%38?{tv6vDYOz!2UQPuvMu{7X@!8^t|*GP!jf=GDkF>+C@;%dL* zqQchK8<|5-D^CglpG|+YK9m+J;1;{ghrm&fb;j9Rd@)#(s&P#4Cr2o5u1YrjYaNkm z^YRX!V|hPvSkzoeRM|GPGIO0QUp}j$+w3A66Xrz)K-s_BQuy{H1wftyGY014tA^Z; zj@f`PNZ$40KG7gXU&}LRE=KL0 zrixhXB1Sqem;iGy0lZmER0e}y16E$8eFeCGi~!?!u^Jyi!g_JppZY9sW$Hh7(Vb7Y zCIQIvb1+9=L>a1W)iaxPw*A2xt%zA0wMIvzCu>U7%Pj9Rr3i;jm9 zQEjF|sInz^988YX4tU-L$~oayVIEr%o4Fgv3lH4>$Q1C3I)xi#Q_O?&scJdR6QrwF zK6%-UX`&y2kV|PDiOn?FS$gn8iSCg%7QrMsH=HYVsOBW&@M7q5l z-LSF%tr<2!y)*z@M)%c+ZGBQU2(|xfLo%RYKV1B)Gs-~hKp2QU*}Xd4saRj?nUsi* zBE0f`0^8SCloV+#mP7%Xdiv&cg5kgzwz6za{ zETsqv=jvcgfCAVmT^AKFasPx7LTEfsi+gUx+vcS-j* zB{Jxz+}GPzO6TlDoy^7~q1?hA&0L0kacFqUHu!;86=6#X{d%jJx)}qV7v@yw$fpAw zL0A$%70=l6>P*Yj{xrWqOoMt{tZvSnKUBYI@&wU}+_>Y#?ZQvbjC%7%ML(6arP2Q3 zIaS-bp$!}LuJOFl@mc4-EyK#SE=lI;zwWQ;v^&VE%R$=x`NX92Dw? zJjo=ZKePLM{|cYqH+T7lJ)b$^uOy_k+4w2Yod;WQa=Y~|b4l~qeec`k5Pl&7K^SMX zUzw3*LzYe}O4eo~wU%%<%MiymCPXdAXTr1PcJs=fVX^uSbUH3tt8nM^tCH^~0HzO^ zbnaHiBtGvMN4W2C;j|2VjRwH}`S!xnoLF>QOmM1jrtBN?~$yb3!ObyiX3=-Egq* z-zz3cg)mho25Ba#fWH!*`X{^dWACAC%aJN>ePl~X@lx>=cF9%LKuHAe5n86t`OQ~7 zA5C%&O26Eu zo%Z;Ikb-%Ekl85w^5`$>>`znf3j6Fy#C6H`o!9xDmTY>GMvt(sK8mf>pLQy0mZ-R> z(089Dx{Lg$+lUJ^)pC~tAB%q?P6CjH%qi*z^-T62z z=wI_ZlJv79W@v0BpuBIHH;4LjZ`XHZjlKs9|M9-1e7REF$aFc2af4``0kdFMeK9m< z{+bUMldd@YBf_QWjFx!deYYeL_E~^fI=azI>690y4Jc~%ukI%{L(9`w+es`_wR&hf z*qqm0THR`j$3-8uiA%Y;1&aN~EZt%!A4WPWZGM2sK4k8&;ur9&-;Jci*rz!Vzy0e( zWd$5#Cww$7pB!pGB<8o@dv!%%T#|7%L+pz(AaPMY{^*tAmY`ln>s@AwX7t>oc%Gcr?(}n>5t!93MsX=H{yWyjYjP3dMD1^I6VP z=i%)G@h1~o!^*xwA*uSkQNyjsyR-O_eKzfLCxHA1qV3^wUnikOMxh&+YyDjBI+4hl z{R=GrcttnOu35&@NT#Q}14fgl#t z19IAs9JL@eAdyWfBB5wz082;w^8FKbIFd#(-*dVB<3i2F1jcwATq~CUt5ppjO&aOl zbgWR}CF>%4@ntHF!qSy-(HA|lM!PNxS2(JK;ns~Fvmyo6Ge_s{Jcwm1sIw%ja(lvw zdl}-YwxN%J$fy>v#1uT7kk`kCsyx~bq0il&h0!$bpoT?CUVb?q`&%VBrYmn4c+NoQ zTx{OejWaXac#$M#QK^oh;Eu&Tbr8E7#vWm;9p1ugsu=n+^74L=F29B-Nw;dbC`Yqd zrM_CiCpBovZ}&Y3W`%F&4I$DHnUzPo-^o+9SyGkuWt(aye>}+)<9+kM7Mln?e#*fD zv0DG))TEJMMK=V;X|{@TJ@UzSYa+#|sBjQXZ2 z@Kmh}C)IKu_{7A-+V$;~?3JwJ_m9Od@DacEF8)JNp4*P|9v;Pc4Ff;;NN2esQn^TH zD`gP%UK-FpFElYSQo3*Z*T4f91(iD;M`h6XKiyaS-#V&;HZ%{5v}b#J`S=2sl;f@_ z9ZE#zM+0W(&r9%II~yS+-7q2pMbn2w(Tg$fC5})c2M|ljbm(c*d|f7pd4?18x2Ibw zleztMB7-W_#Mr-iE21ZcANa)sQTUA##5RM}(({>1rJZ6ho*y{FE`%o^$`4dIqZ}J? zL90|E%%dXZ)ROUhM<<^F5NL64fcZ+t@&orh5&EOpp~McLi|sxzg{ii+Az3z@WO1{+#qNc#gQ2qON6X0pzkCMJ&gSRO2VTXh%bMOIo4+H!VHB+xF?9k=zJIlBG0P|euFdUxEkT5v=oWpi-l zvht5V^PtJqM?F~V_RtW*yXom}pPoTYdDiaxbo1(At4uBO{tm;=n2}|Mtn|%bVP6>m zlb}GUa-@NS;Fp|x9k(Q12g$QMcQq5tZ>phzk`4vm{U(y%e~hnwn*)fHt_b2xwV$1V-vlT5K{?`$sg=~L$nbuwo5sZVtH#zY+>8gv)v)S)_gszWi1ORM8`vXmjZ zbh$rB2vjM`L%B5|Nc&z9|VD5 zanD&g^GQVl;sX$*o2qEInaeMo*`Sba^^56gGPcWfo7M}Y#g#G9gWofTG;pD5V3%{F z9>49%EK}g$_1fj35A~5T*&KAaLhBaP4*TQPjj9%>q(DisEM_V{#cuZgV5^7+my@37 zy+qgMO2Qn1HwX96zGW^LpL5Z;U4CRQikb2(^O=7;l6Bk7w&Ci1=Z3C8)mZxLNYnp8 z7K&?HPYN;p@^m%a<>h{=+Ua#92eD3d|MOjfn>ox(9K)1H6B1Zf=U_p4;k$L%_0H{_ z(CpwZp-$0z{o0Aj3#7-@Zt?(9afNR3zP;tA2BM_dWRA!SN)+AF)L;S>=a4Wvau+^R#)`aSoD8U) zQe>0%I}d6dHl&O#ZjC>^c}awBY_C)Hr|Jx-al$N# zw@OT3(SnCAdA~vT814Y{gb%+`LsnYC4HHyjgyG}1X;p1Bm&>-2u8z*p=a9VAx`I=l z7AxjIbN$C$i?=6G%uYiail$s;% z?^yn4rf5J-mv~&E9TL2@9kpVdvsb_@wQ3I(6c_ZKOHn%xLL`GB^SF-=q5NE!iQwF? z!r5)ePjh2(OUmOMHZ~kkJX4C;6B}TQmTP#wvpKHDysqJK8qLkOVV4eefZr!71UKbP zJ$7>niD`AMvr+UThzqkP7*4vwPU=e@es~Fh0S2i43!8X}b$W+M83lr1Ag;wSR2I#a z^-L^a3nvtbMN=5)>XC|htyiCpDSndN5Xa?Bx%;|y@kK5g%<9%SX#f9b-!9CdY z#f`2dpdM!>02;cv3XM3nK`!V4=S8i+wT)dXkqUs*Hynm?hWrodr)hoa0dR(zW<(xH zrLJ;p(g6dz`#JC7)Q6tn9b)%>$^{X%&*@rr_l$$IBYL}yN16KP-#xyfBZ5*xOOT_W zd;zq6Y1r2SqdZ~`2>ov>*3D74r*#0Bo6wrY%U6ct(T~p{{^V6U$({tHn-?erJ}XWD zczFnLcdX%>4GL%?HE?EAl@|j`oI~0KZ|rW;Lhv-QeQk*Q(1cqFM8pGwR!+WH18Ig4 zZ?Ga7a;wHhUGZq)>Yz%`RLtksJt}9(8qhCwEB&PYhS0WCP)Oq>smN_ZiJqQTFx3n2Hw;qfyxV*1vt;%?z213H?K4HM9%4OzhL4P-rIp}=ArNis6dKA_gcG9_yFMOft zkFGyNS<%t@Wf-}11v#SGQ0?sc!~JR;PjyM@s1MMn@;T!Smes{2_Q*N7`4Z|wT=oBs zNsE7bMVhGN4ZF}zeO_-iTs{~}Jg1`))%1OLgI0t2D>B#jWR&*3WsTFn(Mw1c+!q#z z+l(kue~+69OAplN=E0){^X&u!7tbFex*}>m&zkOLNws(Eq$BJ@`nl_qMvK*8*_JEc zt(!m9oOS@z9d=L-+}vN^e25z*%(>4+G2Stbj<)jKIDwcTb z=j}3F474hwN&;L9se7ah___ze7RlSz?>O4E>eU{@1NHMZZfT%Cw53bQr{3{A`{Nyd zYEX1OKC1g*9WjeA%~d-OQ`~ZzD38_mX>|}GBvi=L$o3tXNiLJ6_;g)OsDiA zbkaA9ZMYWGHT)lI&GhV6wjKk}HFpfDyJt3}JHh4?v}(XOAAGX}G1}EzC~1?I=LPRO zmr1rAx0_D@=KZF}u*R|loBWX82G$re?aQnRF8`o?7 zFJw^piA2*&i*#Hv_Wew9Yq?#DpcbH>r5qr zmgLS6-li_u9KaaMTxHcWk!r(vO8Fh6?#|7*+3WPsjfVH|fdRGVXVTnmSU_^18T%+D z^7OhRJ4;NHAd}M0O~a95k{20fwSV9{F}@qu)vn-S<;w_5pXCN8=74y8Xv7CYAaS?h%ij@t-gIx#k*P5B>A>CtdW*vb* zG|zi. -*/ - -/* -Requires JSZip (3.x.x): https://stuk.github.io/jszip/ - -Usage: - -const project = await SBDownloader.download("123456789"); -const type = project.type; // "sb", "sb2", or "sb3" -const blob = await project.asBlob(); -const arrayBuffer = await project.asArrayBuffer(); -*/ - -window.SBDownloader = (function() { - const SB_MAGIC = 'ScratchV0'; - const ZIP_MAGIC = 'PK'; - - const PROJECT_HOST = 'https://projects.scratch.mit.edu/$id'; - const ASSET_HOST = 'https://assets.scratch.mit.edu/internalapi/asset/$path/get/'; - - class ZipProject { - constructor (zip, type) { - this._zip = zip; - this.type = type; - } - - asArrayBuffer() { - return this._zip.generateAsync({ - type: 'arraybuffer' - }); - } - - asBlob() { - return this._zip.generateAsync({ - type: 'blob' - }); - } - } - - class BinaryProject { - constructor (blob, type) { - this._blob = blob; - this.type = type; - } - - asArrayBuffer() { - return readAsArrayBuffer(this._blob); - } - - asBlob() { - return Promise.resolve(this._blob); - } - } - - const readAsText = (blob) => new Promise((resolve, reject) => { - const fileReader = new FileReader(); - fileReader.onloadend = () => resolve(fileReader.result); - fileReader.onerror = () => reject(new Error('Cannot read as text')); - fileReader.readAsText(blob); - }); - - const readAsArrayBuffer = (blob) => new Promise((resolve, reject) => { - const fileReader = new FileReader(); - fileReader.onloadend = () => resolve(fileReader.result); - fileReader.onerror = () => reject(new Error('Cannot read as blob')); - fileReader.readAsArrayBuffer(blob); - }); - - const checkMagic = (text, magic) => { - for (let i = 0; i < magic.length; i++) { - if (text[i] !== magic[i]) { - return false; - } - } - return true; - }; - - const fetchProject = (projectId, progressTarget) => { - return new Promise((resolve, reject) => { - const xhr = new XMLHttpRequest(); - xhr.responseType = 'blob'; - xhr.onload = () => { - if (xhr.status === 200) { - resolve(xhr.response); - } else { - reject(new Error(`Unexpected status code: ${xhr.status}`)); - } - }; - xhr.onerror = () => { - reject(new Error('XHR failed')); - }; - xhr.onprogress = (e) => { - if (e.lengthComputable) { - const progress = e.loaded / e.total; - progressTarget.dispatchEvent(new CustomEvent('data-progress', { - detail: progress - })); - } - }; - xhr.onloadend = () => { - progressTarget.dispatchEvent(new CustomEvent('data-progress', { - detail: 1 - })); - }; - xhr.open('GET', PROJECT_HOST.replace('$id', projectId)); - xhr.send(); - }); - }; - - const identifyProjectType = async (projectData) => { - // If the data is a full project file, parse the file. - if (projectData instanceof Blob || projectData instanceof ArrayBuffer) { - let zip; - try { - zip = await JSZip.loadAsync(projectData); - } catch (e) { - return null; - } - const projectDataFile = zip.file('project.json'); - if (!projectDataFile) { - return null; - } - const text = await projectDataFile.async('string'); - try { - // TODO: Use a looser JSON.parse implementation for certain weird projects? - const projectData = JSON.parse(text); - return await identifyProjectType(projectData); - } catch (e) { - return null; - } - } - - if ('targets' in projectData) { - return 'sb3'; - } else if ('objName' in projectData) { - return 'sb2'; - } - - return null; - }; - - const loadScratch2 = (projectData, progressTarget) => { - const zip = new JSZip(); - - const IMAGE_EXTENSIONS = ['svg', 'png']; - const SOUND_EXTENSIONS = ['wav', 'mp3']; - - // sb2 files have two ways of storing references to files. - // In the online editor they use md5 hashes which point to an API destination. - // In the offline editor they use separate accumulative file IDs for images and sounds. - // The files served from the Scratch API don't contain the file IDs we need to export a valid .sb2, so we must create those ourselves. - - let soundAccumulator = 0; - let imageAccumulator = 0; - - function md5Of(thing) { - return thing.md5 || thing.baseLayerMD5 || thing.penLayerMD5 || thing.toString(); - } - - function claimAccumulatedID(extension) { - if (IMAGE_EXTENSIONS.includes(extension)) { - return imageAccumulator++; - } else if (SOUND_EXTENSIONS.includes(extension)) { - return soundAccumulator++; - } else { - throw new Error('unknown extension: ' + extension); - } - } - - function addAsset(asset) { - const md5 = asset.md5; - const extension = asset.extension; - const accumulator = claimAccumulatedID(extension); - const path = accumulator + '.' + extension; - - // Update IDs in all references to match the accumulator - // Downloaded projects usually use -1 for all of these, but sometimes they exist and are just wrong since we're redoing them all. - for (const reference of asset.references) { - if ('baseLayerID' in reference) { - reference.baseLayerID = accumulator; - } - if ('soundID' in reference) { - reference.soundID = accumulator; - } - if ('penLayerID' in reference) { - reference.penLayerID = accumulator; - } - } - - progressTarget.dispatchEvent(new CustomEvent('asset-fetch', { - detail: md5 - })); - - return fetch(ASSET_HOST.replace('$path', md5)) - .then((request) => request.arrayBuffer()) - .then((buffer) => { - zip.file(path, buffer); - progressTarget.dispatchEvent(new CustomEvent('asset-fetched', { - detail: md5 - })); - }); - } - - // Processes a list of assets - // Finds and groups duplicate assets. - function processAssets(assets) { - // Records a list of all unique asset md5s and stores all references to an asset. - const hashToAssetMap = Object.create(null); - const allAssets = []; - - for (const data of assets) { - const md5ext = md5Of(data); - if (!(md5ext in hashToAssetMap)) { - const asset = { - md5: md5ext, - extension: md5ext.split('.').pop(), - references: [], - }; - hashToAssetMap[md5ext] = asset; - allAssets.push(asset); - } - hashToAssetMap[md5ext].references.push(data); - } - - return allAssets; - } - - const children = projectData.children.filter((c) => !c.listName && !c.target); - const targets = [].concat.apply([], [projectData, children]); - const costumes = [].concat.apply([], targets.map((c) => c.costumes || [])); - const sounds = [].concat.apply([], targets.map((c) => c.sounds || [])); - const assets = processAssets([].concat.apply([], [costumes, sounds, projectData])); - return Promise.all(assets.map((a) => addAsset(a))) - .then(() => { - // We must add the project JSON at the end because it is changed during the loading due to updating asset IDs - zip.file('project.json', JSON.stringify(projectData)); - return zip; - }); - }; - - const loadScratch3 = (projectData, progressTarget) => { - const zip = new JSZip(); - - function addFile(data) { - const path = data.md5ext || data.assetId + '.' + data.dataFormat; - progressTarget.dispatchEvent(new CustomEvent('asset-fetch', { - detail: path - })); - return fetch(ASSET_HOST.replace('$path', path)) - .then((request) => request.arrayBuffer()) - .then((buffer) => { - zip.file(path, buffer); - progressTarget.dispatchEvent(new CustomEvent('asset-fetched', { - detail: path - })); - }); - } - - // Removes assets with the same ID - function dedupeAssets(assets) { - const result = []; - const knownIds = new Set(); - - for (const i of assets) { - const id = i.assetId; - if (knownIds.has(id)) { - continue; - } - knownIds.add(id); - result.push(i); - } - - return result; - } - - zip.file('project.json', JSON.stringify(projectData)); - - const targets = projectData.targets; - const costumes = [].concat.apply([], targets.map((t) => t.costumes || [])); - const sounds = [].concat.apply([], targets.map((t) => t.sounds || [])); - const assets = dedupeAssets([].concat.apply([], [costumes, sounds])); - - return Promise.all(assets.map((a) => addFile(a))) - .then(() => zip); - }; - - const download = async (projectId, options = {}) => { - const progressTarget = options.progressTarget || new EventTarget(); - - const blob = await fetchProject(projectId, progressTarget); - const asText = await readAsText(blob); - - if (checkMagic(asText, SB_MAGIC)) { - return new BinaryProject(blob, 'sb'); - } - if (checkMagic(asText, ZIP_MAGIC)) { - return new BinaryProject(blob, await identifyProjectType(blob)); - } - - let projectData; - try { - projectData = JSON.parse(asText); - } catch (e) { - throw new Error(`Project JSON is invalid, but not a binary project either (${e})`); - } - - const projectType = await identifyProjectType(projectData); - if (projectType === 'sb3') { - return new ZipProject(await loadScratch3(projectData, progressTarget), 'sb3'); - } else if (projectType === 'sb2') { - return new ZipProject(await loadScratch2(projectData, progressTarget), 'sb2'); - } else { - throw new Error('Project JSON is valid, but of unknown type'); - } - }; - - return { - download, - identifyProjectType, - }; -}()); diff --git a/http-server.js b/http-server.js deleted file mode 100644 index 3b09aa9..0000000 --- a/http-server.js +++ /dev/null @@ -1,143 +0,0 @@ -'use strict'; - -const http = require('http'); -const promisify = require('util').promisify; -const fs = require('fs'); -const pathUtil = require('path'); - -const lstat = promisify(fs.lstat); -const readFile = promisify(fs.readFile); - -// checking for path traversal requires trailing slash -const webRoot = pathUtil.join(__dirname, '/'); - -function startServer() { - const port = process.env.PORT || 8080; - const contentTypes = { - '.html': 'text/html', - '.css': 'text/css', - '.js': 'text/javascript', - '.svg': 'image/svg+xml', - '.ico': 'image/vnd.microsoft.icon', - '.wav': 'audio/wav', - '.woff': 'font/woff', - '.woff2': 'font/woff2', - '.ttf': 'font/ttf', - '.md': 'text/plain', - }; - const defaultContentType = 'application/octet-stream'; - - class HttpError extends Error { - constructor(code, message) { - super(message); - this.code = code; - this.message = message; - } - } - - class Http404 extends HttpError { - constructor() { - super(404, '404 Not Found'); - } - } - - async function findFile(root, path) { - const indexes = ['index.html', 'README.md']; - const extensions = ['', '.html', '.md']; - - // prevent null bytes - if (path.indexOf('\0') !== -1) { - return null; - } - - // remove escape codes - path = unescape(path); - - // remove query string - if (path.indexOf('?') !== -1) { - path = path.substr(0, path.indexOf('?')); - } - - path = pathUtil.join(root, path); - - // check for path traversal - if (!path.startsWith(root)) { - return null; - } - - const originalPath = path; - - try { - if ((await lstat(path)).isDirectory()) { - let found = false; - for (const i of indexes) { - try { - path = pathUtil.join(originalPath, i); - if ((await lstat(path)).isFile()) { - found = true; - break; - } - } catch (e) { - // ignore - } - } - if (!found) return null; - } - } catch (e) { - let found = false; - for (const i of extensions) { - try { - path = originalPath + i; - if ((await lstat(path)).isFile()) { - found = true; - break; - } - } catch (e) { - // ignore - } - } - if (!found) return null; - } - - return path; - } - - async function handler(req, res) { - const path = await findFile(webRoot, req.url || '/'); - if (path === null) throw new Http404(); - - const data = await readFile(path); - const extension = pathUtil.extname(path); - res.setHeader('Content-Length', data.length); - res.setHeader('Content-Type', contentTypes[extension] || defaultContentType); - res.setHeader('Cache-Control', 'no-store'); - res.write(data); - }; - - const server = http.createServer(async (req, res) => { - try { - await handler(req, res); - } catch (e) { - if (e.code) { - res.statusCode = e.code; - res.write(e.message); - } else { - res.statusCode = 500; - res.write('internal server error'); - console.error(e.stack || e); - } - } - res.end(); - }); - server.listen(port); - - portConnectionInfo(port); -} - -function portConnectionInfo(port) { - console.log('Visit any of these links in your browser:'); - console.log(` http://localhost:${port}/`); - console.log(` http://127.0.0.1:${port}/`); -} - -startServer(); diff --git a/index.html b/index.html deleted file mode 100644 index a83b7bb..0000000 --- a/index.html +++ /dev/null @@ -1,589 +0,0 @@ - - - - - - - - TurboWarp Packager - - - - - -
-

TurboWarp Packager

-

Converts Scratch projects to standalone files. This is still in an early stage of development -- use with care.

-

If you just want to embed a TurboWarp project into your website, see Embedding instead.

-

This packager no longer supports forkphorus. If you'd like to package forkphorus, use the forkphorus packager instead.

-
- -
-

Help us test the new packager

-

We're rewriting the packager for improved file size, performance, customizability, and a redesigned loading screen. Give it a try and let us know what you think.

-

The new packager is still in beta. Expect to find bugs. Take the time to report them before we replace the current packager with it in the very near future.

-
- -
- Loading... -
- -
-

Select project

- -
- - -
- -
- -
- -
- -
- -
- -
-

Runtime

- -
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- Stage size - - × - -
-
- -
-
- -
-

Appearance

- -
- -
-
- -
-
- -
-

Cloud variables

- - - -

The option to connect to cloud variable server is only available when packaging projects from IDs, not from files.

-
- -
-

Environment

- -
- -
- -
-

Plain HTML Options

-

No options.

-
- -
-

Zip Options

-

No options.

-
- -
-

NW.js Options

- -
- -
-
- -
-
-
- -
-

Advanced

- -
- You probably don't want to change these. (Click to open) -
- -
-
- -
-
- -
-
-
- -
-

License

-

TurboWarp, this packager, and the output of this packager are licensed under the GNU General Public License v3.0. Talk to a lawyer for more information.

-
- -
- - - -
- -
- -
- -
-
-
-
-
-
Status updates will appear here.
-
-
- - - - - - - - - - - - - - - - diff --git a/lib/details-element-polyfill.js b/lib/details-element-polyfill.js deleted file mode 100644 index ee20b5a..0000000 --- a/lib/details-element-polyfill.js +++ /dev/null @@ -1,203 +0,0 @@ -/* -Details Element Polyfill 2.3.1 -Copyright © 2019 Javan Makhmali - */ -(function() { - "use strict"; - var element = document.createElement("details"); - element.innerHTML = "ab"; - element.setAttribute("style", "position: absolute; left: -9999px"); - var support = { - open: "open" in element && elementExpands(), - toggle: "ontoggle" in element - }; - function elementExpands() { - (document.body || document.documentElement).appendChild(element); - var closedHeight = element.offsetHeight; - element.open = true; - var openedHeight = element.offsetHeight; - element.parentNode.removeChild(element); - return closedHeight != openedHeight; - } - var styles = '\ndetails, summary {\n display: block;\n}\ndetails:not([open]) > *:not(summary) {\n display: none;\n}\nsummary::before {\n content: "►";\n padding-right: 0.3rem;\n font-size: 0.6rem;\n cursor: default;\n}\n[open] > summary::before {\n content: "▼";\n}\n'; - var _ref = [], forEach = _ref.forEach, slice = _ref.slice; - if (!support.open) { - polyfillStyles(); - polyfillProperties(); - polyfillToggle(); - polyfillAccessibility(); - } - if (support.open && !support.toggle) { - polyfillToggleEvent(); - } - function polyfillStyles() { - document.head.insertAdjacentHTML("afterbegin", ""); - } - function polyfillProperties() { - var prototype = document.createElement("details").constructor.prototype; - var setAttribute = prototype.setAttribute, removeAttribute = prototype.removeAttribute; - var open = Object.getOwnPropertyDescriptor(prototype, "open"); - Object.defineProperties(prototype, { - open: { - get: function get() { - if (this.tagName == "DETAILS") { - return this.hasAttribute("open"); - } else { - if (open && open.get) { - return open.get.call(this); - } - } - }, - set: function set(value) { - if (this.tagName == "DETAILS") { - return value ? this.setAttribute("open", "") : this.removeAttribute("open"); - } else { - if (open && open.set) { - return open.set.call(this, value); - } - } - } - }, - setAttribute: { - value: function value(name, _value) { - var _this = this; - var call = function call() { - return setAttribute.call(_this, name, _value); - }; - if (name == "open" && this.tagName == "DETAILS") { - var wasOpen = this.hasAttribute("open"); - var result = call(); - if (!wasOpen) { - var summary = this.querySelector("summary"); - if (summary) summary.setAttribute("aria-expanded", true); - triggerToggle(this); - } - return result; - } - return call(); - } - }, - removeAttribute: { - value: function value(name) { - var _this2 = this; - var call = function call() { - return removeAttribute.call(_this2, name); - }; - if (name == "open" && this.tagName == "DETAILS") { - var wasOpen = this.hasAttribute("open"); - var result = call(); - if (wasOpen) { - var summary = this.querySelector("summary"); - if (summary) summary.setAttribute("aria-expanded", false); - triggerToggle(this); - } - return result; - } - return call(); - } - } - }); - } - function polyfillToggle() { - onTogglingTrigger(function(element) { - element.hasAttribute("open") ? element.removeAttribute("open") : element.setAttribute("open", ""); - }); - } - function polyfillToggleEvent() { - if (window.MutationObserver) { - new MutationObserver(function(mutations) { - forEach.call(mutations, function(mutation) { - var target = mutation.target, attributeName = mutation.attributeName; - if (target.tagName == "DETAILS" && attributeName == "open") { - triggerToggle(target); - } - }); - }).observe(document.documentElement, { - attributes: true, - subtree: true - }); - } else { - onTogglingTrigger(function(element) { - var wasOpen = element.getAttribute("open"); - setTimeout(function() { - var isOpen = element.getAttribute("open"); - if (wasOpen != isOpen) { - triggerToggle(element); - } - }, 1); - }); - } - } - function polyfillAccessibility() { - setAccessibilityAttributes(document); - if (window.MutationObserver) { - new MutationObserver(function(mutations) { - forEach.call(mutations, function(mutation) { - forEach.call(mutation.addedNodes, setAccessibilityAttributes); - }); - }).observe(document.documentElement, { - subtree: true, - childList: true - }); - } else { - document.addEventListener("DOMNodeInserted", function(event) { - setAccessibilityAttributes(event.target); - }); - } - } - function setAccessibilityAttributes(root) { - findElementsWithTagName(root, "SUMMARY").forEach(function(summary) { - var details = findClosestElementWithTagName(summary, "DETAILS"); - summary.setAttribute("aria-expanded", details.hasAttribute("open")); - if (!summary.hasAttribute("tabindex")) summary.setAttribute("tabindex", "0"); - if (!summary.hasAttribute("role")) summary.setAttribute("role", "button"); - }); - } - function eventIsSignificant(event) { - return !(event.defaultPrevented || event.ctrlKey || event.metaKey || event.shiftKey || event.target.isContentEditable); - } - function onTogglingTrigger(callback) { - addEventListener("click", function(event) { - if (eventIsSignificant(event)) { - if (event.which <= 1) { - var element = findClosestElementWithTagName(event.target, "SUMMARY"); - if (element && element.parentNode && element.parentNode.tagName == "DETAILS") { - callback(element.parentNode); - } - } - } - }, false); - addEventListener("keydown", function(event) { - if (eventIsSignificant(event)) { - if (event.keyCode == 13 || event.keyCode == 32) { - var element = findClosestElementWithTagName(event.target, "SUMMARY"); - if (element && element.parentNode && element.parentNode.tagName == "DETAILS") { - callback(element.parentNode); - event.preventDefault(); - } - } - } - }, false); - } - function triggerToggle(element) { - var event = document.createEvent("Event"); - event.initEvent("toggle", false, false); - element.dispatchEvent(event); - } - function findElementsWithTagName(root, tagName) { - return (root.tagName == tagName ? [ root ] : []).concat(typeof root.getElementsByTagName == "function" ? slice.call(root.getElementsByTagName(tagName)) : []); - } - function findClosestElementWithTagName(element, tagName) { - if (typeof element.closest == "function") { - return element.closest(tagName); - } else { - while (element) { - if (element.tagName == tagName) { - return element; - } else { - element = element.parentNode; - } - } - } - } -})(); diff --git a/lib/icns.js b/lib/icns.js deleted file mode 100644 index 7820c8e..0000000 --- a/lib/icns.js +++ /dev/null @@ -1,6 +0,0 @@ -/*! -From https://github.com/GarboMuffin/icns -Based on https://github.com/fiahfy/icns -MIT License -*/ -!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Icns=t()}}((function(){var t=function(t){var e;return function(r){return e||t(e={exports:{},parent:r},e.exports),e.exports}},e=t((function(t,e){(function(t){(function(){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IcnsImage=e.BitmapBuilder=void 0;const n=r({});class i{constructor(t,e,r){this.png=t,this.osType=e,this.format=r}build(){switch(this.format){case"MASK":return this.mask;case"RGB":return this.rgb;case"ARGB":return this.argb;default:return}}get mask(){return this.getChannel(3)}get rgb(){const e="it32"===this.osType?4:0,r=t.alloc(e);return t.concat([r,Bi.encode(this.getChannel(0),{format:"icns"}),Bi.encode(this.getChannel(1),{format:"icns"}),Bi.encode(this.getChannel(2),{format:"icns"})])}get argb(){const e=t.alloc(4);return e.write("ARGB",0,4,"ascii"),t.concat([e,Bi.encode(this.getChannel(3),{format:"icns"}),Bi.encode(this.getChannel(0),{format:"icns"}),Bi.encode(this.getChannel(1),{format:"icns"}),Bi.encode(this.getChannel(2),{format:"icns"})])}getChannel(e){const r=[];for(let t=0;tt.osType===e);if(!r)throw new TypeError("No supported osType");const a=o.readPNG(t);if(!a)throw new TypeError("Image must be PNG format");const s=a.width;if(s!==a.height)throw new TypeError("Image must be squre");if(s!==r.size)throw new TypeError(`Image size must be ${r.size}x${r.size} for '${e}'`);const l="PNG"===r.format?t:new i(a,e,r.format).build();if(!l)throw new TypeError(`Invalid format '${r.format}'`);const f=8+l.length;return new o(e,f,l)}static fromArrayBuffer(e,r){return o.fromPNG(t.from(e),r)}get data(){const e=t.alloc(8);return e.write(this.osType,0,4,"ascii"),e.writeUInt32BE(this.bytes,4),t.concat([e,this.image])}static readPNG(t){try{return Pi.PNG.sync.read(t)}catch(e){return}}}e.IcnsImage=o}).call(this)}).call(this,u({}).Buffer)})),r=t((function(t,r){(function(t){(function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Icns=void 0;const n=e({});class i{constructor(t=new E.IcnsFileHeader,e=[]){this._fileHeader=t,this._images=e}static from(t){const e=E.IcnsFileHeader.from(t);let r=e.data.length;const o=[];for(;rt+e.bytes,0);this._fileHeader=new E.IcnsFileHeader("icns",e)}get data(){const e=[this._fileHeader.data,...this._images.map(t=>t.data)];return t.concat(e)}append(t){this.images=[...this.images,t]}insert(t,e){this.images=[...this.images.slice(0,e),t,...this.images.slice(e+1)]}remove(t){this.images=[...this.images.slice(0,t),...this.images.slice(t+1)]}}r.Icns=i,i.supportedIconTypes=[{osType:"is32",size:16,format:"RGB"},{osType:"il32",size:32,format:"RGB"},{osType:"ih32",size:48,format:"RGB"},{osType:"it32",size:128,format:"RGB"},{osType:"s8mk",size:16,format:"MASK"},{osType:"l8mk",size:32,format:"MASK"},{osType:"h8mk",size:48,format:"MASK"},{osType:"t8mk",size:128,format:"MASK"},{osType:"ic04",size:16,format:"ARGB"},{osType:"ic05",size:32,format:"ARGB"},{osType:"icp4",size:16,format:"PNG"},{osType:"icp5",size:32,format:"PNG"},{osType:"icp6",size:64,format:"PNG"},{osType:"ic07",size:128,format:"PNG"},{osType:"ic08",size:256,format:"PNG"},{osType:"ic09",size:512,format:"PNG"},{osType:"ic10",size:1024,format:"PNG"},{osType:"ic11",size:32,format:"PNG"},{osType:"ic12",size:64,format:"PNG"},{osType:"ic13",size:256,format:"PNG"},{osType:"ic14",size:512,format:"PNG"}]}).call(this)}).call(this,u({}).Buffer)})),n=t((function(t,e){(function(e,r){(function(){"use strict";var n;t.exports=A,A.ReadableState=S,be.EventEmitter;var a,f=function(t,e){return t.listeners(e).length},h=u({}).Buffer,c=r.Uint8Array||function(){};a=Ce&&Ce.debuglog?Ce.debuglog("stream"):function(){};var d,p,y,_=qe.getHighWaterMark,g=Ze.codes,b=g.ERR_INVALID_ARG_TYPE,m=g.ERR_STREAM_PUSH_AFTER_EOF,w=g.ERR_METHOD_NOT_IMPLEMENTED,v=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;te(A,xe);var E=ze.errorOrDestroy,k=["error","close","destroy","pause","resume"];function S(t,e,r){n=n||l({}),t=t||{},"boolean"!=typeof r&&(r=e instanceof n),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=_(this,t,"readableHighWaterMark",r),this.buffer=new Fe,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(d||(d=s({}).StringDecoder),this.decoder=new d(t.encoding),this.encoding=t.encoding)}function A(t){if(n=n||l({}),!(this instanceof A))return new A(t);var e=this instanceof n;this._readableState=new S(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),xe.call(this)}function T(t,e,r,n,i){a("readableAddChunk",e);var o,s=t._readableState;if(null===e)s.reading=!1,function(t,e){if(a("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?L(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,I(t)))}}(t,s);else if(i||(o=function(t,e){var r,n;return n=e,h.isBuffer(n)||n instanceof c||"string"==typeof e||void 0===e||t.objectMode||(r=new b("chunk",["string","Buffer","Uint8Array"],e)),r}(s,e)),o)E(t,o);else if(s.objectMode||e&&e.length>0)if("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===h.prototype||(e=function(t){return h.from(t)}(e)),n)s.endEmitted?E(t,new v):O(t,s,e,!0);else if(s.ended)E(t,new m);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(e=s.decoder.write(e),s.objectMode||0!==e.length?O(t,s,e,!1):P(t,s)):O(t,s,e,!1)}else n||(s.reading=!1,P(t,s));return!s.ended&&(s.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=1073741824?t=1073741824:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function L(t){var r=t._readableState;a("emitReadable",r.needReadable,r.emittedReadable),r.needReadable=!1,r.emittedReadable||(a("emitReadable",r.flowing),r.emittedReadable=!0,e.nextTick(I,t))}function I(t){var e=t._readableState;a("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,N(t)}function P(t,r){r.readingMore||(r.readingMore=!0,e.nextTick(x,t,r))}function x(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function B(t){a("readable nexttick read 0"),t.read(0)}function M(t,e){a("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),N(t),e.flowing&&!e.reading&&t.read(0)}function N(t){var e=t._readableState;for(a("flow",e.flowing);e.flowing&&null!==t.read(););}function D(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function j(t){var r=t._readableState;a("endReadable",r.endEmitted),r.endEmitted||(r.ended=!0,e.nextTick(U,r,t))}function U(t,e){if(a("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function F(t,e){for(var r=0,n=t.length;r=e.highWaterMark:e.length>0)||e.ended))return a("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?j(this):L(this),null;if(0===(t=R(t,e))&&e.ended)return 0===e.length&&j(this),null;var n,i=e.needReadable;return a("need readable",i),(0===e.length||e.length-t0?D(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&j(this)),null!==n&&this.emit("data",n),n},A.prototype._read=function(t){E(this,new w("_read()"))},A.prototype.pipe=function(t,r){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,a("pipe count=%d opts=%j",i.pipesCount,r);var o=r&&!1===r.end||t===e.stdout||t===e.stderr?y:s;function s(){a("onend"),t.end()}i.endEmitted?e.nextTick(o):n.once("end",o),t.on("unpipe",(function e(r,o){a("onunpipe"),r===n&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,a("cleanup"),t.removeListener("close",d),t.removeListener("finish",p),t.removeListener("drain",l),t.removeListener("error",c),t.removeListener("unpipe",e),n.removeListener("end",s),n.removeListener("end",y),n.removeListener("data",h),u=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||l())}));var l=function(t){return function(){var e=t._readableState;a("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&f(t,"data")&&(e.flowing=!0,N(t))}}(n);t.on("drain",l);var u=!1;function h(e){a("ondata");var r=t.write(e);a("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==F(i.pipes,t))&&!u&&(a("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function c(e){a("onerror",e),y(),t.removeListener("error",c),0===f(t,"error")&&E(t,e)}function d(){t.removeListener("finish",p),y()}function p(){a("onfinish"),t.removeListener("close",d),y()}function y(){a("unpipe"),n.unpipe(t)}return n.on("data",h),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener("error",r);t._events&&t._events.error?Array.isArray(t._events.error)?t._events.error.unshift(r):t._events.error=[r,t._events.error]:t.on("error",r)}(t,0,c),t.once("close",d),t.once("finish",p),t.emit("pipe",n),i.flowing||(a("pipe resume"),n.resume()),t},A.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,a("on readable",i.length,i.reading),i.length?L(this):i.reading||e.nextTick(B,this))),n},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(t,r){var n=xe.prototype.removeListener.call(this,t,r);return"readable"===t&&e.nextTick(C,this),n},A.prototype.removeAllListeners=function(t){var r=xe.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||e.nextTick(C,this),r},A.prototype.resume=function(){var t=this._readableState;return t.flowing||(a("resume"),t.flowing=!t.readableListening,function(t,r){r.resumeScheduled||(r.resumeScheduled=!0,e.nextTick(M,t,r))}(this,t)),t.paused=!1,this},A.prototype.pause=function(){return a("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(a("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(a("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){a("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"\ufffd";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"\ufffd";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"\ufffd"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function s(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function l(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function f(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function u(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function h(t){return t.toString(this.encoding)}function c(t){return t&&t.length?this.write(t):""}e.StringDecoder=i,i.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(i>0&&(t.lastNeed=i-1),i):--n=0?(i>0&&(t.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:t.lastNeed=i-3),i):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},i.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}})),l=t((function(t,e){(function(e){(function(){"use strict";var r=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=u;var i=n({}),o=f({});te(u,i);for(var a=r(o.prototype),s=0;s-1))throw new w(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(S.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(S.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),S.prototype._write=function(t,e,r){r(new p("_write()"))},S.prototype._writev=null,S.prototype.end=function(t,r,n){var i=this._writableState;return"function"==typeof t?(n=t,t=null,r=null):"function"==typeof r&&(n=r,r=null),null!=t&&this.write(t,r),i.corked&&(i.corked=1,this.uncork()),i.ending||function(t,r,n){r.ending=!0,I(t,r),n&&(r.finished?e.nextTick(n):t.once("finish",n)),r.ended=!0,t.writable=!1}(this,i,n),this},Object.defineProperty(S.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),S.prototype.destroy=ze.destroy,S.prototype._undestroy=ze.undestroy,S.prototype._destroy=function(t,e){e(t)}}).call(this)}).call(this,ne,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})})),u=t((function(t,e){(function(t){(function(){"use strict";e.Buffer=r,e.SlowBuffer=function(t){return+t!=t&&(t=0),r.alloc(+t)},e.INSPECT_MAX_BYTES=50;function t(t){if(t>2147483647)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=r.prototype,e}function r(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return o(t)}return n(t,e,r)}function n(e,n,i){if("string"==typeof e)return function(e,n){if("string"==typeof n&&""!==n||(n="utf8"),!r.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var i=0|l(e,n),o=t(i),a=o.write(e,n);return a!==i&&(o=o.slice(0,a)),o}(e,n);if(ArrayBuffer.isView(e))return a(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(N(e,ArrayBuffer)||e&&N(e.buffer,ArrayBuffer))return function(t,e,n){if(e<0||t.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|t}function l(t,e){if(r.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||N(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var n=t.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===n)return 0;for(var o=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return C(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return B(t).length;default:if(o)return i?-1:C(t).length;e=(""+e).toLowerCase(),o=!0}}function f(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function u(t,e,n,i,o){if(0===t.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),D(n=+n)&&(n=o?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(o)return-1;n=t.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof e&&(e=r.from(e,i)),r.isBuffer(e))return 0===e.length?-1:h(t,e,n,i,o);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):h(t,[e],n,i,o);throw new TypeError("val must be string, number or Buffer")}function h(t,e,r,n,i){var o,a=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,l/=2,r/=2}function f(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var u=-1;for(o=r;os&&(r=s-l),o=r;o>=0;o--){for(var h=!0,c=0;ci&&(n=i):n=i;var o=e.length;n>o/2&&(n=o/2);for(var a=0;a>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function m(t,e,r){return 0===e&&r===t.length?c.fromByteArray(t):c.fromByteArray(t.slice(e,r))}function w(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:f>223?3:f>191?2:1;if(i+h<=r)switch(h){case 1:f<128&&(u=f);break;case 2:128==(192&(o=t[i+1]))&&(l=(31&f)<<6|63&o)>127&&(u=l);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(l=(15&f)<<12|(63&o)<<6|63&a)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(l=(15&f)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(u=l)}null===u?(u=65533,h=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),i+=h}return function(t){var e=t.length;if(e<=E)return String.fromCharCode.apply(String,t);for(var r="",n=0;nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return A(this,e,r);case"utf8":case"utf-8":return w(this,e,r);case"ascii":return k(this,e,r);case"latin1":case"binary":return S(this,e,r);case"base64":return m(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},r.prototype.toLocaleString=r.prototype.toString,r.prototype.equals=function(t){if(!r.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===r.compare(this,t)},r.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),""},r.prototype.compare=function(t,e,n,i,o){if(N(t,Uint8Array)&&(t=r.from(t,t.offset,t.byteLength)),!r.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===i&&(i=0),void 0===o&&(o=this.length),e<0||n>t.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&e>=n)return 0;if(i>=o)return-1;if(e>=n)return 1;if(this===t)return 0;for(var a=(o>>>=0)-(i>>>=0),s=(n>>>=0)-(e>>>=0),l=Math.min(a,s),f=this.slice(i,o),u=t.slice(e,n),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return d(this,t,e,r);case"utf8":case"utf-8":return p(this,t,e,r);case"ascii":return y(this,t,e,r);case"latin1":case"binary":return _(this,t,e,r);case"base64":return g(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var E=4096;function k(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;ii)&&(r=i);for(var o="",a=e;ar)throw new RangeError("Trying to access beyond buffer length")}function R(t,e,n,i,o,a){if(!r.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||et.length)throw new RangeError("Index out of range")}function L(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function I(t,e,r,n,i){return e=+e,r>>>=0,i||L(t,0,r,4),v.write(t,e,r,n,23,4),r+4}function P(t,e,r,n,i){return e=+e,r>>>=0,i||L(t,0,r,8),v.write(t,e,r,n,52,8),r+8}r.prototype.slice=function(t,e){var n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e>>=0,e>>>=0,r||O(t,e,this.length);for(var n=this[t],i=1,o=0;++o>>=0,e>>>=0,r||O(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},r.prototype.readUInt8=function(t,e){return t>>>=0,e||O(t,1,this.length),this[t]},r.prototype.readUInt16LE=function(t,e){return t>>>=0,e||O(t,2,this.length),this[t]|this[t+1]<<8},r.prototype.readUInt16BE=function(t,e){return t>>>=0,e||O(t,2,this.length),this[t]<<8|this[t+1]},r.prototype.readUInt32LE=function(t,e){return t>>>=0,e||O(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},r.prototype.readUInt32BE=function(t,e){return t>>>=0,e||O(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},r.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||O(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},r.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||O(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},r.prototype.readInt8=function(t,e){return t>>>=0,e||O(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},r.prototype.readInt16LE=function(t,e){t>>>=0,e||O(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},r.prototype.readInt16BE=function(t,e){t>>>=0,e||O(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},r.prototype.readInt32LE=function(t,e){return t>>>=0,e||O(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},r.prototype.readInt32BE=function(t,e){return t>>>=0,e||O(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},r.prototype.readFloatLE=function(t,e){return t>>>=0,e||O(t,4,this.length),v.read(this,t,!0,23,4)},r.prototype.readFloatBE=function(t,e){return t>>>=0,e||O(t,4,this.length),v.read(this,t,!1,23,4)},r.prototype.readDoubleLE=function(t,e){return t>>>=0,e||O(t,8,this.length),v.read(this,t,!0,52,8)},r.prototype.readDoubleBE=function(t,e){return t>>>=0,e||O(t,8,this.length),v.read(this,t,!1,52,8)},r.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||R(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,n||R(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},r.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,1,255,0),this[e]=255&t,e+1},r.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},r.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},r.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},r.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},r.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);R(this,t,e,r,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o>0)-s&255;return e+r},r.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);R(this,t,e,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},r.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},r.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},r.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},r.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},r.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},r.prototype.writeFloatLE=function(t,e,r){return I(this,t,e,!0,r)},r.prototype.writeFloatBE=function(t,e,r){return I(this,t,e,!1,r)},r.prototype.writeDoubleLE=function(t,e,r){return P(this,t,e,!0,r)},r.prototype.writeDoubleBE=function(t,e,r){return P(this,t,e,!1,r)},r.prototype.copy=function(t,e,n,i){if(!r.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e=0;--a)t[a+e]=this[a+n];else Uint8Array.prototype.set.call(t,this.subarray(n,i),e);return o},r.prototype.fill=function(t,e,n,i){if("string"==typeof t){if("string"==typeof e?(i=e,e=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!r.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===t.length){var o=t.charCodeAt(0);("utf8"===i&&o<128||"latin1"===i)&&(t=o)}}else"number"==typeof t&&(t&=255);if(e<0||this.length>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(a=e;a55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function B(t){return c.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(x,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function M(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function N(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function D(t){return t!=t}}).call(this)}).call(this,u({}).Buffer)})),h={};Object.defineProperty(h,"__esModule",{value:!0});for(var c={toByteArray:function(t){var e,r,n=m(t),i=n[0],o=n[1],a=new y(function(t,e,r){return 3*(e+r)/4-r}(0,i,o)),s=0,l=o>0?i-4:i;for(r=0;r>16&255,a[s++]=e>>8&255,a[s++]=255&e;return 2===o&&(e=p[t.charCodeAt(r)]<<2|p[t.charCodeAt(r+1)]>>4,a[s++]=255&e),1===o&&(e=p[t.charCodeAt(r)]<<10|p[t.charCodeAt(r+1)]<<4|p[t.charCodeAt(r+2)]>>2,a[s++]=e>>8&255,a[s++]=255&e),a},fromByteArray:function(t){for(var e,r=t.length,n=r%3,i=[],o=0,a=r-n;oa?a:o+16383));return 1===n?(e=t[r-1],i.push(d[e>>2]+d[e<<4&63]+"==")):2===n&&(e=(t[r-2]<<8)+t[r-1],i.push(d[e>>10]+d[e>>4&63]+d[e<<2&63]+"=")),i.join("")}},d=[],p=[],y="undefined"!=typeof Uint8Array?Uint8Array:Array,_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",g=0,b=_.length;g0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function w(t,e,r){for(var n,i,o=[],a=e;a>18&63]+d[i>>12&63]+d[i>>6&63]+d[63&i]);return o.join("")}p["-".charCodeAt(0)]=62,p["_".charCodeAt(0)]=63;var v={read:function(t,e,r,n,i){var o,a,s=8*i-n-1,l=(1<>1,u=-7,h=r?i-1:0,c=r?-1:1,d=t[e+h];for(h+=c,o=d&(1<<-u)-1,d>>=-u,u+=s;u>0;o=256*o+t[e+h],h+=c,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=n;u>0;a=256*a+t[e+h],h+=c,u-=8);if(0===o)o=1-f;else{if(o===l)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=f}return(d?-1:1)*a*Math.pow(2,o-n)},write:function(t,e,r,n,i,o){var a,s,l,f=8*o-i-1,u=(1<>1,c=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+h>=1?c/l:c*Math.pow(2,1-h))*l>=2&&(a++,l/=2),a+h>=u?(s=0,a=u):a+h>=1?(s=(e*l-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<0;t[r+d]=255&a,d+=p,a/=256,f-=8);t[r+d-p]|=128*y}},E={};(function(t){(function(){"use strict";Object.defineProperty(E,"__esModule",{value:!0}),E.IcnsFileHeader=void 0;class e{constructor(t="icns",e=8){this.identifier=t,this.bytes=e}static from(t){const r=t.toString("ascii",0,4),n=t.readUInt32BE(4);return new e(r,n)}get data(){const e=t.alloc(8);return e.write(this.identifier,0,4,"ascii"),e.writeUInt32BE(this.bytes,4),e}}E.IcnsFileHeader=e}).call(this)}).call(this,u({}).Buffer);var k="undefined"!=typeof Symbol&&Symbol,S=function(){return"function"==typeof k&&"function"==typeof Symbol&&"symbol"==typeof k("foo")&&"symbol"==typeof Symbol("bar")&&function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}()},A=Array.prototype.slice,T=Object.prototype.toString,O=Function.prototype.bind||function(t){var e=this;if("function"!=typeof e||"[object Function]"!==T.call(e))throw new TypeError("Function.prototype.bind called on incompatible "+e);for(var r,n=A.call(arguments,1),i=Math.max(0,e.length-n.length),o=[],a=0;a1&&"boolean"!=typeof e)throw new P('"allowMissing" argument must be a boolean');var r=function(t){var e=Y(t,0,1),r=Y(t,-1);if("%"===e&&"%"!==r)throw new L("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new L("invalid intrinsic syntax, expected opening `%`");var n=[];return W(t,q,(function(t,e,r,i){n[n.length]=r?W(i,V,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",i=K("%"+n+"%",e),o=i.name,a=i.value,s=!1,l=i.alias;l&&(n=l[0],G(r,H([0,1],l)));for(var f=1,u=!0;f=r.length){var p=C(a,h);a=(u=!!p)&&"get"in p&&!("originalValue"in p.get)?p.get:a[h]}else u=R(a,h),a=a[h];u&&!s&&(z[o]=a)}}return a},X=$("%Function.prototype.apply%"),J=$("%Function.prototype.call%"),Q=$("%Reflect.apply%",!0)||O.call(J,X),tt=$("%Object.getOwnPropertyDescriptor%",!0),et=$("%Object.defineProperty%",!0),rt=$("%Math.max%");if(et)try{et({},"a",{value:1})}catch(Hi){et=null}B=function(t){var e=Q(O,J,arguments);return tt&&et&&tt(e,"length").configurable&&et(e,"length",{value:1+rt(0,t.length-(arguments.length-1))}),e};var nt=function(){return Q(O,X,arguments)};et?et(B,"apply",{value:nt}):B.apply=nt;var it,ot=B($("String.prototype.indexOf")),at=function(t,e){var r=$(t,!!e);return"function"==typeof r&&ot(t,".prototype.")>-1?B(r):r},st="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,lt=at("Object.prototype.toString"),ft=function(t){return!(st&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===lt(t)},ut=function(t){return!!ft(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==lt(t)&&"[object Function]"===lt(t.callee)},ht=function(){return ft(arguments)}();ft.isLegacyArguments=ut,it=ht?ft:ut;var ct=Object.prototype.toString,dt=Function.prototype.toString,pt=/^\s*(?:function)?\*/,yt="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,_t=Object.getPrototypeOf,gt=function(){if(!yt)return!1;try{return Function("return function*() {}")()}catch(Hi){}}(),bt=!(!_t||!gt)&&_t(gt),mt=Object.prototype.hasOwnProperty,wt=Object.prototype.toString,vt=function(t,e,r){if("[object Function]"!==wt.call(e))throw new TypeError("iterator must be a function");var n=t.length;if(n===+n)for(var i=0;i-1}return!!At&&function(t){var e=!1;return vt(a,(function(r,n){if(!e)try{e=r.call(t)===n}catch(Hi){}})),e}(t)}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var Ot={};(function(t){(function(){"use strict";var e=at("Object.prototype.toString"),r=S()&&"symbol"==typeof Symbol.toStringTag,n=kt(),i=at("String.prototype.slice"),o={},a=Object.getPrototypeOf;r&&At&&a&&vt(n,(function(e){if("function"==typeof t[e]){var r=new t[e];if(!(Symbol.toStringTag in r))throw new EvalError("this engine has support for Symbol.toStringTag, but "+e+" does not have the property! Please report this.");var n=a(r),i=At(n,Symbol.toStringTag);if(!i){var s=a(n);i=At(s,Symbol.toStringTag)}o[e]=i.get}})),Ot=function(t){return!!Tt(t)&&(r?function(t){var e=!1;return vt(o,(function(r,n){if(!e)try{var i=r.call(t);i===n&&(e=i)}catch(Hi){}})),e}(t):i(e(t),8,-1))}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var Rt={};function Lt(t){return t.call.bind(t)}var It="undefined"!=typeof BigInt,Pt="undefined"!=typeof Symbol,xt=Lt(Object.prototype.toString),Ct=Lt(Number.prototype.valueOf),Bt=Lt(String.prototype.valueOf),Mt=Lt(Boolean.prototype.valueOf);if(It)var Nt=Lt(BigInt.prototype.valueOf);if(Pt)var Dt=Lt(Symbol.prototype.valueOf);function jt(t,e){if("object"!=typeof t)return!1;try{return e(t),!0}catch(Hi){return!1}}function Ut(t){return"[object Map]"===xt(t)}function Ft(t){return"[object Set]"===xt(t)}function zt(t){return"[object WeakMap]"===xt(t)}function Zt(t){return"[object WeakSet]"===xt(t)}function Ht(t){return"[object ArrayBuffer]"===xt(t)}function Gt(t){return"undefined"!=typeof ArrayBuffer&&(Ht.working?Ht(t):t instanceof ArrayBuffer)}function Wt(t){return"[object DataView]"===xt(t)}function Yt(t){return"undefined"!=typeof DataView&&(Wt.working?Wt(t):t instanceof DataView)}function qt(t){return"[object SharedArrayBuffer]"===xt(t)}function Vt(t){return"undefined"!=typeof SharedArrayBuffer&&(qt.working?qt(t):t instanceof SharedArrayBuffer)}function Kt(t){return jt(t,Ct)}function $t(t){return jt(t,Bt)}function Xt(t){return jt(t,Mt)}function Jt(t){return It&&jt(t,Nt)}function Qt(t){return Pt&&jt(t,Dt)}Rt.isArgumentsObject=it,Rt.isGeneratorFunction=function(t){return"function"==typeof t&&(!!pt.test(dt.call(t))||(yt?_t&&_t(t)===bt:"[object GeneratorFunction]"===ct.call(t)))},Rt.isTypedArray=Tt,Rt.isPromise=function(t){return"undefined"!=typeof Promise&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},Rt.isArrayBufferView=function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):Tt(t)||Yt(t)},Rt.isUint8Array=function(t){return"Uint8Array"===Ot(t)},Rt.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===Ot(t)},Rt.isUint16Array=function(t){return"Uint16Array"===Ot(t)},Rt.isUint32Array=function(t){return"Uint32Array"===Ot(t)},Rt.isInt8Array=function(t){return"Int8Array"===Ot(t)},Rt.isInt16Array=function(t){return"Int16Array"===Ot(t)},Rt.isInt32Array=function(t){return"Int32Array"===Ot(t)},Rt.isFloat32Array=function(t){return"Float32Array"===Ot(t)},Rt.isFloat64Array=function(t){return"Float64Array"===Ot(t)},Rt.isBigInt64Array=function(t){return"BigInt64Array"===Ot(t)},Rt.isBigUint64Array=function(t){return"BigUint64Array"===Ot(t)},Ut.working="undefined"!=typeof Map&&Ut(new Map),Rt.isMap=function(t){return"undefined"!=typeof Map&&(Ut.working?Ut(t):t instanceof Map)},Ft.working="undefined"!=typeof Set&&Ft(new Set),Rt.isSet=function(t){return"undefined"!=typeof Set&&(Ft.working?Ft(t):t instanceof Set)},zt.working="undefined"!=typeof WeakMap&&zt(new WeakMap),Rt.isWeakMap=function(t){return"undefined"!=typeof WeakMap&&(zt.working?zt(t):t instanceof WeakMap)},Zt.working="undefined"!=typeof WeakSet&&Zt(new WeakSet),Rt.isWeakSet=function(t){return Zt(t)},Ht.working="undefined"!=typeof ArrayBuffer&&Ht(new ArrayBuffer),Rt.isArrayBuffer=Gt,Wt.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&Wt(new DataView(new ArrayBuffer(1),0,1)),Rt.isDataView=Yt,qt.working="undefined"!=typeof SharedArrayBuffer&&qt(new SharedArrayBuffer),Rt.isSharedArrayBuffer=Vt,Rt.isAsyncFunction=function(t){return"[object AsyncFunction]"===xt(t)},Rt.isMapIterator=function(t){return"[object Map Iterator]"===xt(t)},Rt.isSetIterator=function(t){return"[object Set Iterator]"===xt(t)},Rt.isGeneratorObject=function(t){return"[object Generator]"===xt(t)},Rt.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===xt(t)},Rt.isNumberObject=Kt,Rt.isStringObject=$t,Rt.isBooleanObject=Xt,Rt.isBigIntObject=Jt,Rt.isSymbolObject=Qt,Rt.isBoxedPrimitive=function(t){return Kt(t)||$t(t)||Xt(t)||Jt(t)||Qt(t)},Rt.isAnyArrayBuffer=function(t){return"undefined"!=typeof Uint8Array&&(Gt(t)||Vt(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(t){Object.defineProperty(Rt,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})}));var te={};te="function"==typeof Object.create?function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}};var ee,re,ne={},ie=ne={};function oe(){throw new Error("setTimeout has not been defined")}function ae(){throw new Error("clearTimeout has not been defined")}function se(t){if(ee===setTimeout)return setTimeout(t,0);if((ee===oe||!ee)&&setTimeout)return ee=setTimeout,setTimeout(t,0);try{return ee(t,0)}catch(Hi){try{return ee.call(null,t,0)}catch(Hi){return ee.call(this,t,0)}}}!function(){try{ee="function"==typeof setTimeout?setTimeout:oe}catch(Hi){ee=oe}try{re="function"==typeof clearTimeout?clearTimeout:ae}catch(Hi){re=ae}}();var le,fe=[],ue=!1,he=-1;function ce(){ue&&le&&(ue=!1,le.length?fe=le.concat(fe):he=-1,fe.length&&de())}function de(){if(!ue){var t=se(ce);ue=!0;for(var e=fe.length;e;){for(le=fe,fe=[];++he1)for(var r=1;r=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),u(e)?r.showHidden=e:e&&_e._extend(r,e),p(r.showHidden)&&(r.showHidden=!1),p(r.depth)&&(r.depth=2),p(r.colors)&&(r.colors=!1),p(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=i),a(r,t,r.depth)}function i(t,e){var r=n.styles[e];return r?"\x1b["+n.colors[r][0]+"m"+t+"\x1b["+n.colors[r][1]+"m":t}function o(t,e){return t}function a(t,e,r){if(t.customInspect&&e&&m(e.inspect)&&e.inspect!==_e.inspect&&(!e.constructor||e.constructor.prototype!==e)){var n=e.inspect(r,t);return d(n)||(n=a(t,n,r)),n}var i=function(t,e){if(p(e))return t.stylize("undefined","undefined");if(d(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return c(e)?t.stylize(""+e,"number"):u(e)?t.stylize(""+e,"boolean"):h(e)?t.stylize("null","null"):void 0}(t,e);if(i)return i;var o=Object.keys(e),_=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),b(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return s(e);if(0===o.length){if(m(e)){var w=e.name?": "+e.name:"";return t.stylize("[Function"+w+"]","special")}if(y(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(g(e))return t.stylize(Date.prototype.toString.call(e),"date");if(b(e))return s(e)}var E,k="",S=!1,A=["{","}"];return f(e)&&(S=!0,A=["[","]"]),m(e)&&(k=" [Function"+(e.name?": "+e.name:"")+"]"),y(e)&&(k=" "+RegExp.prototype.toString.call(e)),g(e)&&(k=" "+Date.prototype.toUTCString.call(e)),b(e)&&(k=" "+s(e)),0!==o.length||S&&0!=e.length?r<0?y(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),E=S?function(t,e,r,n,i){for(var o=[],a=0,s=e.length;a60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(E,k,A)):A[0]+k+A[1]}function s(t){return"["+Error.prototype.toString.call(t)+"]"}function l(t,e,r,n,i,o){var s,l,f;if((f=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?l=f.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):f.set&&(l=t.stylize("[Setter]","special")),v(n,i)||(s="["+i+"]"),l||(t.seen.indexOf(f.value)<0?(l=h(r)?a(t,f.value,null):a(t,f.value,r-1)).indexOf("\n")>-1&&(l=o?l.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+l.split("\n").map((function(t){return" "+t})).join("\n")):l=t.stylize("[Circular]","special")),p(s)){if(o&&i.match(/^\d+$/))return l;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+l}function f(t){return Array.isArray(t)}function u(t){return"boolean"==typeof t}function h(t){return null===t}function c(t){return"number"==typeof t}function d(t){return"string"==typeof t}function p(t){return void 0===t}function y(t){return _(t)&&"[object RegExp]"===w(t)}function _(t){return"object"==typeof t&&null!==t}function g(t){return _(t)&&"[object Date]"===w(t)}function b(t){return _(t)&&("[object Error]"===w(t)||t instanceof Error)}function m(t){return"function"==typeof t}function w(t){return Object.prototype.toString.call(t)}_e.inspect=n,n.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},n.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},_e.types=Rt,_e.types.isRegExp=y,_e.types.isDate=g,_e.types.isNativeError=b;function v(t,e){return Object.prototype.hasOwnProperty.call(t,e)}_e.inherits=te,_e._extend=function(t,e){if(!e||!_(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var E="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;_e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(E&&t[E]){var r;if("function"!=typeof(r=t[E]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(r,E,{value:r,enumerable:!1,writable:!1,configurable:!0}),r}function r(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),i=[],o=0;o0&&a.length>i&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=a.length,s=l,console&&console.warn&&console.warn(s)}return t}function Oe(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=function(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}.bind(n);return i.listener=r,n.wrapFn=i,i}function Re(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(o=e[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var s=i[t];if(void 0===s)return!1;if("function"==typeof s)we(s,this,e);else{var l=s.length,f=Ie(s,l);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},Ee.prototype.listeners=function(t){return Re(this,t,!0)},Ee.prototype.rawListeners=function(t){return Re(this,t,!1)},Ee.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):Le.call(t,e)},Ee.prototype.listenerCount=Le,Ee.prototype.eventNames=function(){return this._eventsCount>0?ge(this._events):[]};var xe=be.EventEmitter,Ce={};function Be(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Me(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ne(t,e){for(var r=0;r0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return De.alloc(0);for(var e,r,n,i=De.allocUnsafe(t>>>0),o=this.head,a=0;o;)e=o.data,r=i,n=a,De.prototype.copy.call(e,r,n),a+=o.data.length,o=o.next;return i}},{key:"consume",value:function(t,e){var r;return ti.length?i.length:t;if(o===i.length?n+=i:n+=i.slice(0,t),0==(t-=o)){o===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=De.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),0==(t-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,e}},{key:Ue,value:function(t,e){return je(this,function(t){for(var e=1;e2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}Ge("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),Ge("ERR_INVALID_ARG_TYPE",(function(t,e,r){var n,i,o,a;if("string"==typeof e&&("not ","not "===e.substr(0,"not ".length))?(n="must not be",e=e.replace(/^not /,"")):n="must be",o=t,(void 0===a||a>o.length)&&(a=o.length)," argument"===o.substring(a-" argument".length,a))i="The ".concat(t," ").concat(n," ").concat(We(e,"type"));else{var s=function(t,e,r){return"number"!=typeof r&&(r=0),!(r+".".length>t.length)&&-1!==t.indexOf(".",r)}(t)?"property":"argument";i='The "'.concat(t,'" ').concat(s," ").concat(n," ").concat(We(e,"type"))}return i+". Received type ".concat(typeof r)}),TypeError),Ge("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),Ge("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),Ge("ERR_STREAM_PREMATURE_CLOSE","Premature close"),Ge("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),Ge("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),Ge("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),Ge("ERR_STREAM_WRITE_AFTER_END","write after end"),Ge("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),Ge("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),Ge("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Ze.codes=He;var Ye=Ze.codes.ERR_INVALID_OPT_VALUE,qe={getHighWaterMark:function(t,e,r,n){var i=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,n,r);if(null!=i){if(!isFinite(i)||Math.floor(i)!==i||i<0)throw new Ye(n?r:"highWaterMark",i);return Math.floor(i)}return t.objectMode?16:16384}},Ve={};(function(t){(function(){function e(e){try{if(!t.localStorage)return!1}catch(n){return!1}var r=t.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}Ve=function(t,r){if(e("noDeprecation"))return t;var n=!1;return function(){if(!n){if(e("throwDeprecation"))throw new Error(r);e("traceDeprecation")?console.trace(r):console.warn(r),n=!0}return t.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var Ke={},$e=u({}),Xe=$e.Buffer;function Je(t,e){for(var r in t)e[r]=t[r]}function Qe(t,e,r){return Xe(t,e,r)}Xe.from&&Xe.alloc&&Xe.allocUnsafe&&Xe.allocUnsafeSlow?Ke=$e:(Je($e,Ke),Ke.Buffer=Qe),Qe.prototype=Object.create(Xe.prototype),Je(Xe,Qe),Qe.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return Xe(t,e,r)},Qe.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=Xe(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},Qe.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return Xe(t)},Qe.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return $e.SlowBuffer(t)};var tr=lr,er=Ze.codes,rr=er.ERR_METHOD_NOT_IMPLEMENTED,nr=er.ERR_MULTIPLE_CALLBACK,ir=er.ERR_TRANSFORM_ALREADY_TRANSFORMING,or=er.ERR_TRANSFORM_WITH_LENGTH_0,ar=l({});function sr(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new nr);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length0,(function(t){n||(n=t),t&&o.forEach(br),s||(o.forEach(br),i(n))}))}));return e.reduce(mr)},Er.Stream=Er,Er.prototype.pipe=function(t,e){var r=this;function n(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function i(){r.readable&&r.resume&&r.resume()}r.on("data",n),t.on("drain",i),t._isStdio||e&&!1===e.end||(r.on("end",a),r.on("close",s));var o=!1;function a(){o||(o=!0,t.end())}function s(){o||(o=!0,"function"==typeof t.destroy&&t.destroy())}function l(t){if(f(),0===vr.listenerCount(this,"error"))throw t}function f(){r.removeListener("data",n),t.removeListener("drain",i),r.removeListener("end",a),r.removeListener("close",s),r.removeListener("error",l),t.removeListener("error",l),r.removeListener("end",f),r.removeListener("close",f),t.removeListener("close",f)}return r.on("error",l),t.on("error",l),r.on("end",f),r.on("close",f),t.on("close",f),t.emit("pipe",r),t};var kr=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},Sr={},Ar="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function Tr(t,e){return Object.prototype.hasOwnProperty.call(t,e)}Sr.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var n in r)Tr(r,n)&&(t[n]=r[n])}}return t};var Or={arraySet:function(t,e,r,n,i){if(e.subarray&&t.subarray)t.set(e.subarray(r,r+n),i);else for(var o=0;o=0;)t[e]=0}var Pr=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],xr=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Cr=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Br=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Mr=new Array(576);Ir(Mr);var Nr=new Array(60);Ir(Nr);var Dr=new Array(512);Ir(Dr);var jr=new Array(256);Ir(jr);var Ur=new Array(29);Ir(Ur);var Fr,zr,Zr,Hr=new Array(30);function Gr(t,e,r,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}function Wr(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function Yr(t){return t<256?Dr[t]:Dr[256+(t>>>7)]}function qr(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function Vr(t,e,r){t.bi_valid>16-r?(t.bi_buf|=e<>16-t.bi_valid,t.bi_valid+=r-16):(t.bi_buf|=e<>>=1,r<<=1}while(--e>0);return r>>>1}function Xr(t,e,r){var n,i,o=new Array(16),a=0;for(n=1;n<=15;n++)o[n]=a=a+r[n-1]<<1;for(i=0;i<=e;i++){var s=t[2*i+1];0!==s&&(t[2*i]=$r(o[s]++,s))}}function Jr(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function Qr(t){t.bi_valid>8?qr(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function tn(t,e,r,n){var i=2*e,o=2*r;return t[i]>1;r>=1;r--)en(t,o,r);i=l;do{r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],en(t,o,1),n=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=n,o[2*i]=o[2*r]+o[2*n],t.depth[i]=(t.depth[r]>=t.depth[n]?t.depth[r]:t.depth[n])+1,o[2*r+1]=o[2*n+1]=i,t.heap[1]=i++,en(t,o,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var r,n,i,o,a,s,l=e.dyn_tree,f=e.max_code,u=e.stat_desc.static_tree,h=e.stat_desc.has_stree,c=e.stat_desc.extra_bits,d=e.stat_desc.extra_base,p=e.stat_desc.max_length,y=0;for(o=0;o<=15;o++)t.bl_count[o]=0;for(l[2*t.heap[t.heap_max]+1]=0,r=t.heap_max+1;r<573;r++)(o=l[2*l[2*(n=t.heap[r])+1]+1]+1)>p&&(o=p,y++),l[2*n+1]=o,n>f||(t.bl_count[o]++,a=0,n>=d&&(a=c[n-d]),s=l[2*n],t.opt_len+=s*(o+a),h&&(t.static_len+=s*(u[2*n+1]+a)));if(0!==y){do{for(o=p-1;0===t.bl_count[o];)o--;t.bl_count[o]--,t.bl_count[o+1]+=2,t.bl_count[p]--,y-=2}while(y>0);for(o=p;0!==o;o--)for(n=t.bl_count[o];0!==n;)(i=t.heap[--r])>f||(l[2*i+1]!==o&&(t.opt_len+=(o-l[2*i+1])*l[2*i],l[2*i+1]=o),n--)}}(t,e),Xr(o,f,t.bl_count)}function on(t,e,r){var n,i,o=-1,a=e[1],s=0,l=7,f=4;for(0===a&&(l=138,f=3),e[2*(r+1)+1]=65535,n=0;n<=r;n++)i=a,a=e[2*(n+1)+1],++s>=7;n<30;n++)for(Hr[n]=i<<7,t=0;t<1<0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,r=4093624447;for(e=0;e<=31;e++,r>>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),nn(t,t.l_desc),nn(t,t.d_desc),a=function(t){var e;for(on(t,t.dyn_ltree,t.l_desc.max_code),on(t,t.dyn_dtree,t.d_desc.max_code),nn(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*Br[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),i=t.opt_len+3+7>>>3,(o=t.static_len+3+7>>>3)<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==e?ln(t,e,r,n):4===t.strategy||o===i?(Vr(t,2+(n?1:0),3),rn(t,Mr,Nr)):(Vr(t,4+(n?1:0),3),function(t,e,r,n){var i;for(Vr(t,e-257,5),Vr(t,r-1,5),Vr(t,n-4,4),i=0;i>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&r,t.last_lit++,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(jr[r]+256+1)]++,t.dyn_dtree[2*Yr(e)]++),t.last_lit===t.lit_bufsize-1},Lr._tr_align=function(t){Vr(t,2,3),Kr(t,256,Mr),function(t){16===t.bi_valid?(qr(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)};var fn,un=function(t,e,r,n){for(var i=65535&t|0,o=t>>>16&65535|0,a=0;0!==r;){r-=a=r>2e3?2e3:r;do{o=o+(i=i+e[n++]|0)|0}while(--a);i%=65521,o%=65521}return i|o<<16|0},hn=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e}(),cn=function(t,e,r,n){var i=hn,o=n+r;t^=-1;for(var a=n;a>>8^i[255&(t^e[a])];return-1^t},dn={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},pn={};function yn(t,e){return t.msg=dn[e],e}function _n(t){return(t<<1)-(t>4?9:0)}function gn(t){for(var e=t.length;--e>=0;)t[e]=0}function bn(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),0!==r&&(Sr.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))}function mn(t,e){Lr._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,bn(t.strm)}function wn(t,e){t.pending_buf[t.pending++]=e}function vn(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function En(t,e){var r,n,i=t.max_chain_length,o=t.strstart,a=t.prev_length,s=t.nice_match,l=t.strstart>t.w_size-262?t.strstart-(t.w_size-262):0,f=t.window,u=t.w_mask,h=t.prev,c=t.strstart+258,d=f[o+a-1],p=f[o+a];t.prev_length>=t.good_match&&(i>>=2),s>t.lookahead&&(s=t.lookahead);do{if(f[(r=e)+a]===p&&f[r+a-1]===d&&f[r]===f[o]&&f[++r]===f[o+1]){o+=2,r++;do{}while(f[++o]===f[++r]&&f[++o]===f[++r]&&f[++o]===f[++r]&&f[++o]===f[++r]&&f[++o]===f[++r]&&f[++o]===f[++r]&&f[++o]===f[++r]&&f[++o]===f[++r]&&oa){if(t.match_start=e,a=n,n>=s)break;d=f[o+a-1],p=f[o+a]}}}while((e=h[e&u])>l&&0!=--i);return a<=t.lookahead?a:t.lookahead}function kn(t){var e,r,n,i,o,a,s,l,f,u,h=t.w_size;do{if(i=t.window_size-t.lookahead-t.strstart,t.strstart>=h+(h-262)){Sr.arraySet(t.window,t.window,h,h,0),t.match_start-=h,t.strstart-=h,t.block_start-=h,e=r=t.hash_size;do{n=t.head[--e],t.head[e]=n>=h?n-h:0}while(--r);e=r=h;do{n=t.prev[--e],t.prev[e]=n>=h?n-h:0}while(--r);i+=h}if(0===t.strm.avail_in)break;if(a=t.strm,s=t.window,l=t.strstart+t.lookahead,f=i,u=void 0,(u=a.avail_in)>f&&(u=f),r=0===u?0:(a.avail_in-=u,Sr.arraySet(s,a.input,a.next_in,u,l),1===a.state.wrap?a.adler=un(a.adler,s,u,l):2===a.state.wrap&&(a.adler=cn(a.adler,s,u,l)),a.next_in+=u,a.total_in+=u,u),t.lookahead+=r,t.lookahead+t.insert>=3)for(o=t.strstart-t.insert,t.ins_h=t.window[o],t.ins_h=(t.ins_h<=3&&(t.ins_h=(t.ins_h<=3)if(n=Lr._tr_tally(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=(t.ins_h<=3&&(t.ins_h=(t.ins_h<4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-3,n=Lr._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=i&&(t.ins_h=(t.ins_h<15&&(a=2,n-=16),i<1||i>9||8!==r||n<8||n>15||e<0||e>9||o<0||o>4)return yn(t,-2);8===n&&(n=9);var s=new On;return t.state=s,s.strm=t,s.wrap=a,s.gzhead=null,s.w_bits=n,s.w_size=1<t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(kn(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+r;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,mn(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-262&&(mn(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(mn(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(mn(t,!1),t.strm.avail_out),1)})),new Tn(4,4,8,4,Sn),new Tn(4,5,16,8,Sn),new Tn(4,6,32,32,Sn),new Tn(4,4,16,16,An),new Tn(8,16,32,32,An),new Tn(8,16,128,128,An),new Tn(8,32,128,256,An),new Tn(32,128,258,1024,An),new Tn(32,258,258,4096,An)],pn.deflateInit2=In,pn.deflateReset=Ln,pn.deflate=function(t,e){var r,n,i,o;if(!t||!t.state||e>5||e<0)return t?yn(t,-2):-2;if(n=t.state,!t.output||!t.input&&0!==t.avail_in||666===n.status&&4!==e)return yn(t,0===t.avail_out?-5:-2);if(n.strm=t,r=n.last_flush,n.last_flush=e,42===n.status)if(2===n.wrap)t.adler=0,wn(n,31),wn(n,139),wn(n,8),n.gzhead?(wn(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),wn(n,255&n.gzhead.time),wn(n,n.gzhead.time>>8&255),wn(n,n.gzhead.time>>16&255),wn(n,n.gzhead.time>>24&255),wn(n,9===n.level?2:n.strategy>=2||n.level<2?4:0),wn(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(wn(n,255&n.gzhead.extra.length),wn(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=cn(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(wn(n,0),wn(n,0),wn(n,0),wn(n,0),wn(n,0),wn(n,9===n.level?2:n.strategy>=2||n.level<2?4:0),wn(n,3),n.status=113);else{var a=8+(n.w_bits-8<<4)<<8;a|=(n.strategy>=2||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(a|=32),a+=31-a%31,n.status=113,vn(n,a),0!==n.strstart&&(vn(n,t.adler>>>16),vn(n,65535&t.adler)),t.adler=1}if(69===n.status)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>i&&(t.adler=cn(t.adler,n.pending_buf,n.pending-i,i)),bn(t),i=n.pending,n.pending!==n.pending_buf_size));)wn(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(t.adler=cn(t.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(t.adler=cn(t.adler,n.pending_buf,n.pending-i,i)),bn(t),i=n.pending,n.pending===n.pending_buf_size)){o=1;break}o=n.gzindexi&&(t.adler=cn(t.adler,n.pending_buf,n.pending-i,i)),0===o&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(t.adler=cn(t.adler,n.pending_buf,n.pending-i,i)),bn(t),i=n.pending,n.pending===n.pending_buf_size)){o=1;break}o=n.gzindexi&&(t.adler=cn(t.adler,n.pending_buf,n.pending-i,i)),0===o&&(n.status=103)}else n.status=103;if(103===n.status&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&bn(t),n.pending+2<=n.pending_buf_size&&(wn(n,255&t.adler),wn(n,t.adler>>8&255),t.adler=0,n.status=113)):n.status=113),0!==n.pending){if(bn(t),0===t.avail_out)return n.last_flush=-1,0}else if(0===t.avail_in&&_n(e)<=_n(r)&&4!==e)return yn(t,-5);if(666===n.status&&0!==t.avail_in)return yn(t,-5);if(0!==t.avail_in||0!==n.lookahead||0!==e&&666!==n.status){var s=2===n.strategy?function(t,e){for(var r;;){if(0===t.lookahead&&(kn(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,r=Lr._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(mn(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(mn(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(mn(t,!1),0===t.strm.avail_out)?1:2}(n,e):3===n.strategy?function(t,e){for(var r,n,i,o,a=t.window;;){if(t.lookahead<=258){if(kn(t),t.lookahead<=258&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=a[i=t.strstart-1])===a[++i]&&n===a[++i]&&n===a[++i]){o=t.strstart+258;do{}while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&it.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(r=Lr._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=Lr._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(mn(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(mn(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(mn(t,!1),0===t.strm.avail_out)?1:2}(n,e):fn[n.level].func(n,e);if(3!==s&&4!==s||(n.status=666),1===s||3===s)return 0===t.avail_out&&(n.last_flush=-1),0;if(2===s&&(1===e?Lr._tr_align(n):5!==e&&(Lr._tr_stored_block(n,0,0,!1),3===e&&(gn(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),bn(t),0===t.avail_out))return n.last_flush=-1,0}return 4!==e?0:n.wrap<=0?1:(2===n.wrap?(wn(n,255&t.adler),wn(n,t.adler>>8&255),wn(n,t.adler>>16&255),wn(n,t.adler>>24&255),wn(n,255&t.total_in),wn(n,t.total_in>>8&255),wn(n,t.total_in>>16&255),wn(n,t.total_in>>24&255)):(vn(n,t.adler>>>16),vn(n,65535&t.adler)),bn(t),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?0:1)},pn.deflateEnd=function(t){var e;return t&&t.state?42!==(e=t.state.status)&&69!==e&&73!==e&&91!==e&&103!==e&&113!==e&&666!==e?yn(t,-2):(t.state=null,113===e?yn(t,-3):0):-2},pn.deflateSetDictionary=function(t,e){var r,n,i,o,a,s,l,f,u=e.length;if(!t||!t.state)return-2;if(2===(o=(r=t.state).wrap)||1===o&&42!==r.status||r.lookahead)return-2;for(1===o&&(t.adler=un(t.adler,e,u,0)),r.wrap=0,u>=r.w_size&&(0===o&&(gn(r.head),r.strstart=0,r.block_start=0,r.insert=0),f=new Sr.Buf8(r.w_size),Sr.arraySet(f,e,u-r.w_size,r.w_size,0),e=f,u=r.w_size),a=t.avail_in,s=t.next_in,l=t.input,t.avail_in=u,t.next_in=0,t.input=e,kn(r);r.lookahead>=3;){n=r.strstart,i=r.lookahead-2;do{r.ins_h=(r.ins_h<>>=w=m>>>24,p-=w,0==(w=m>>>16&255))T[o++]=65535&m;else{if(!(16&w)){if(0==(64&w)){m=y[(65535&m)+(d&(1<>>=w,p-=w),p<15&&(d+=A[n++]<>>=w=m>>>24,p-=w,!(16&(w=m>>>16&255))){if(0==(64&w)){m=_[(65535&m)+(d&(1<l){t.msg="invalid distance too far back",r.mode=30;break t}if(d>>>=w,p-=w,E>(w=o-a)){if((w=E-w)>u&&r.sane){t.msg="invalid distance too far back",r.mode=30;break t}if(k=0,S=c,0===h){if(k+=f-w,w2;)T[o++]=S[k++],T[o++]=S[k++],T[o++]=S[k++],v-=3;v&&(T[o++]=S[k++],v>1&&(T[o++]=S[k++]))}else{k=o-E;do{T[o++]=T[k++],T[o++]=T[k++],T[o++]=T[k++],v-=3}while(v>2);v&&(T[o++]=T[k++],v>1&&(T[o++]=T[k++]))}break}}break}}while(n>3,d&=(1<<(p-=v<<3))-1,t.next_in=n,t.next_out=o,t.avail_in=n=1&&0===I[v];v--);if(E>v&&(E=v),0===v)return i[o++]=20971520,i[o++]=20971520,s.bits=1,0;for(w=1;w0&&(0===t||1!==v))return-1;for(P[1]=0,b=1;b<15;b++)P[b+1]=P[b]+I[b];for(m=0;m852||2===t&&T>592)return 1;for(;;){p=b-S,a[m]d?(y=x[C+a[m]],_=R[L+a[m]]):(y=96,_=0),l=1<>S)+(f-=l)]=p<<24|y<<16|_|0}while(0!==f);for(l=1<>=1;if(0!==l?(O&=l-1,O+=l):O=0,m++,0==--I[b]){if(b===v)break;b=e[r+a[m]]}if(b>E&&(O&h)!==u){for(0===S&&(S=E),c+=w,A=1<<(k=b-S);k+S852||2===t&&T>592)return 1;i[u=O&h]=E<<24|k<<16|c-o|0}}return 0!==O&&(i[c+O]=b-S<<24|64<<16|0),s.bits=E,0},Dn={};function jn(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function Un(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Sr.Buf16(320),this.work=new Sr.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Fn(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Sr.Buf32(852),e.distcode=e.distdyn=new Sr.Buf32(592),e.sane=1,e.back=-1,0):-2}function zn(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,Fn(t)):-2}function Zn(t,e){var r,n;return t&&t.state?(n=t.state,e<0?(r=0,e=-e):(r=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?-2:(null!==n.window&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,zn(t))):-2}function Hn(t,e){var r,n;return t?(n=new Un,t.state=n,n.window=null,0!==(r=Zn(t,e))&&(t.state=null),r):-2}var Gn,Wn,Yn=!0;function qn(t){if(Yn){var e;for(Gn=new Sr.Buf32(512),Wn=new Sr.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(Nn(1,t.lens,0,288,Gn,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;Nn(2,t.lens,0,32,Wn,0,t.work,{bits:5}),Yn=!1}t.lencode=Gn,t.lenbits=9,t.distcode=Wn,t.distbits=5}function Vn(t,e,r,n){var i,o=t.state;return null===o.window&&(o.wsize=1<=o.wsize?(Sr.arraySet(o.window,e,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((i=o.wsize-o.wnext)>n&&(i=n),Sr.arraySet(o.window,e,r-n,i,o.wnext),(n-=i)?(Sr.arraySet(o.window,e,r-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,r.check=cn(r.check,O,2,0),f=0,u=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&f)<<8)+(f>>8))%31){t.msg="incorrect header check",r.mode=30;break}if(8!=(15&f)){t.msg="unknown compression method",r.mode=30;break}if(u-=4,E=8+(15&(f>>>=4)),0===r.wbits)r.wbits=E;else if(E>r.wbits){t.msg="invalid window size",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(O[0]=255&f,O[1]=f>>>8&255,r.check=cn(r.check,O,2,0)),f=0,u=0,r.mode=3;case 3:for(;u<32;){if(0===s)break t;s--,f+=n[o++]<>>8&255,O[2]=f>>>16&255,O[3]=f>>>24&255,r.check=cn(r.check,O,4,0)),f=0,u=0,r.mode=4;case 4:for(;u<16;){if(0===s)break t;s--,f+=n[o++]<>8),512&r.flags&&(O[0]=255&f,O[1]=f>>>8&255,r.check=cn(r.check,O,2,0)),f=0,u=0,r.mode=5;case 5:if(1024&r.flags){for(;u<16;){if(0===s)break t;s--,f+=n[o++]<>>8&255,r.check=cn(r.check,O,2,0)),f=0,u=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((d=r.length)>s&&(d=s),d&&(r.head&&(E=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),Sr.arraySet(r.head.extra,n,o,d,E)),512&r.flags&&(r.check=cn(r.check,n,d,o)),s-=d,o+=d,r.length-=d),r.length))break t;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===s)break t;d=0;do{E=n[o+d++],r.head&&E&&r.length<65536&&(r.head.name+=String.fromCharCode(E))}while(E&&d>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=12;break;case 10:for(;u<32;){if(0===s)break t;s--,f+=n[o++]<>>=7&u,u-=7&u,r.mode=27;break}for(;u<3;){if(0===s)break t;s--,f+=n[o++]<>>=1)){case 0:r.mode=14;break;case 1:if(qn(r),r.mode=20,6===e){f>>>=2,u-=2;break t}break;case 2:r.mode=17;break;case 3:t.msg="invalid block type",r.mode=30}f>>>=2,u-=2;break;case 14:for(f>>>=7&u,u-=7&u;u<32;){if(0===s)break t;s--,f+=n[o++]<>>16^65535)){t.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&f,f=0,u=0,r.mode=15,6===e)break t;case 15:r.mode=16;case 16:if(d=r.length){if(d>s&&(d=s),d>l&&(d=l),0===d)break t;Sr.arraySet(i,n,o,d,a),s-=d,o+=d,l-=d,a+=d,r.length-=d;break}r.mode=12;break;case 17:for(;u<14;){if(0===s)break t;s--,f+=n[o++]<>>=5,u-=5,r.ndist=1+(31&f),f>>>=5,u-=5,r.ncode=4+(15&f),f>>>=4,u-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have>>=3,u-=3}for(;r.have<19;)r.lens[R[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},k=Nn(0,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,k){t.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,b=65535&T,!((_=T>>>24)<=u);){if(0===s)break t;s--,f+=n[o++]<>>=_,u-=_,r.lens[r.have++]=b;else{if(16===b){for(A=_+2;u>>=_,u-=_,0===r.have){t.msg="invalid bit length repeat",r.mode=30;break}E=r.lens[r.have-1],d=3+(3&f),f>>>=2,u-=2}else if(17===b){for(A=_+3;u>>=_)),f>>>=3,u-=3}else{for(A=_+7;u>>=_)),f>>>=7,u-=7}if(r.have+d>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=30;break}for(;d--;)r.lens[r.have++]=E}}if(30===r.mode)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,S={bits:r.lenbits},k=Nn(1,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,k){t.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},k=Nn(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,k){t.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===e)break t;case 20:r.mode=21;case 21:if(s>=6&&l>=258){t.next_out=a,t.avail_out=l,t.next_in=o,t.avail_in=s,r.hold=f,r.bits=u,Pn(t,c),a=t.next_out,i=t.output,l=t.avail_out,o=t.next_in,n=t.input,s=t.avail_in,f=r.hold,u=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;g=(T=r.lencode[f&(1<>>16&255,b=65535&T,!((_=T>>>24)<=u);){if(0===s)break t;s--,f+=n[o++]<>m)])>>>16&255,b=65535&T,!(m+(_=T>>>24)<=u);){if(0===s)break t;s--,f+=n[o++]<>>=m,u-=m,r.back+=m}if(f>>>=_,u-=_,r.back+=_,r.length=b,0===g){r.mode=26;break}if(32&g){r.back=-1,r.mode=12;break}if(64&g){t.msg="invalid literal/length code",r.mode=30;break}r.extra=15&g,r.mode=22;case 22:if(r.extra){for(A=r.extra;u>>=r.extra,u-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;g=(T=r.distcode[f&(1<>>16&255,b=65535&T,!((_=T>>>24)<=u);){if(0===s)break t;s--,f+=n[o++]<>m)])>>>16&255,b=65535&T,!(m+(_=T>>>24)<=u);){if(0===s)break t;s--,f+=n[o++]<>>=m,u-=m,r.back+=m}if(f>>>=_,u-=_,r.back+=_,64&g){t.msg="invalid distance code",r.mode=30;break}r.offset=b,r.extra=15&g,r.mode=24;case 24:if(r.extra){for(A=r.extra;u>>=r.extra,u-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===l)break t;if(d=c-l,r.offset>d){if((d=r.offset-d)>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=30;break}d>r.wnext?(d-=r.wnext,p=r.wsize-d):p=r.wnext-d,d>r.length&&(d=r.length),y=r.window}else y=i,p=a-r.offset,d=r.length;d>l&&(d=l),l-=d,r.length-=d;do{i[a++]=y[p++]}while(--d);0===r.length&&(r.mode=21);break;case 26:if(0===l)break t;i[a++]=r.length,l--,r.mode=21;break;case 27:if(r.wrap){for(;u<32;){if(0===s)break t;s--,f|=n[o++]<$n.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=t,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}$n.NONE=0,$n.DEFLATE=1,$n.INFLATE=2,$n.GZIP=3,$n.GUNZIP=4,$n.DEFLATERAW=5,$n.INFLATERAW=6,$n.UNZIP=7,n.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,this.mode===$n.DEFLATE||this.mode===$n.GZIP||this.mode===$n.DEFLATERAW?pn.deflateEnd(this.strm):this.mode!==$n.INFLATE&&this.mode!==$n.GUNZIP&&this.mode!==$n.INFLATERAW&&this.mode!==$n.UNZIP||Dn.inflateEnd(this.strm),this.mode=$n.NONE,this.dictionary=null)},n.prototype.write=function(t,e,r,n,i,o,a){return this._write(!0,t,e,r,n,i,o,a)},n.prototype.writeSync=function(t,e,r,n,i,o,a){return this._write(!1,t,e,r,n,i,o,a)},n.prototype._write=function(r,n,i,o,a,s,l,f){if(this.write_in_progress=!0,this.write_in_progress=!0,n!==$n.Z_NO_FLUSH&&n!==$n.Z_PARTIAL_FLUSH&&n!==$n.Z_SYNC_FLUSH&&n!==$n.Z_FULL_FLUSH&&n!==$n.Z_FINISH&&n!==$n.Z_BLOCK)throw new Error("Invalid flush value");if(null==i&&(i=e.alloc(0),a=0,o=0),this.strm.avail_in=a,this.strm.input=i,this.strm.next_in=o,this.strm.avail_out=f,this.strm.output=s,this.strm.next_out=l,this.flush=n,!r)return this._process(),this._checkError()?this._afterSync():void 0;var u=this;return t.nextTick((function(){u._process(),u._after()})),this},n.prototype._afterSync=function(){var t=this.strm.avail_out,e=this.strm.avail_in;return this.write_in_progress=!1,[e,t]},n.prototype._process=function(){var t=null;switch(this.mode){case $n.DEFLATE:case $n.GZIP:case $n.DEFLATERAW:this.err=pn.deflate(this.strm,this.flush);break;case $n.UNZIP:switch(this.strm.avail_in>0&&(t=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(null===t)break;if(31!==this.strm.input[t]){this.mode=$n.INFLATE;break}if(this.gzip_id_bytes_read=1,t++,1===this.strm.avail_in)break;case 1:if(null===t)break;139===this.strm.input[t]?(this.gzip_id_bytes_read=2,this.mode=$n.GUNZIP):this.mode=$n.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case $n.INFLATE:case $n.GUNZIP:case $n.INFLATERAW:for(this.err=Dn.inflate(this.strm,this.flush),this.err===$n.Z_NEED_DICT&&this.dictionary&&(this.err=Dn.inflateSetDictionary(this.strm,this.dictionary),this.err===$n.Z_OK?this.err=Dn.inflate(this.strm,this.flush):this.err===$n.Z_DATA_ERROR&&(this.err=$n.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===$n.GUNZIP&&this.err===$n.Z_STREAM_END&&0!==this.strm.next_in[0];)this.reset(),this.err=Dn.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},n.prototype._checkError=function(){switch(this.err){case $n.Z_OK:case $n.Z_BUF_ERROR:if(0!==this.strm.avail_out&&this.flush===$n.Z_FINISH)return this._error("unexpected end of file"),!1;break;case $n.Z_STREAM_END:break;case $n.Z_NEED_DICT:return null==this.dictionary?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},n.prototype._after=function(){if(this._checkError()){var t=this.strm.avail_out,e=this.strm.avail_in;this.write_in_progress=!1,this.callback(e,t),this.pending_close&&this.close()}},n.prototype._error=function(t){this.strm.msg&&(t=this.strm.msg),this.onerror(t,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},n.prototype.init=function(t,e,r,n,i){this._init(e,t,r,n,i),this._setDictionary()},n.prototype.params=function(){throw new Error("deflateParams Not supported")},n.prototype.reset=function(){this._reset(),this._setDictionary()},n.prototype._init=function(t,e,r,n,i){switch(this.level=t,this.windowBits=e,this.memLevel=r,this.strategy=n,this.flush=$n.Z_NO_FLUSH,this.err=$n.Z_OK,this.mode!==$n.GZIP&&this.mode!==$n.GUNZIP||(this.windowBits+=16),this.mode===$n.UNZIP&&(this.windowBits+=32),this.mode!==$n.DEFLATERAW&&this.mode!==$n.INFLATERAW||(this.windowBits=-1*this.windowBits),this.strm=new kr,this.mode){case $n.DEFLATE:case $n.GZIP:case $n.DEFLATERAW:this.err=pn.deflateInit2(this.strm,this.level,$n.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case $n.INFLATE:case $n.GUNZIP:case $n.INFLATERAW:case $n.UNZIP:this.err=Dn.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==$n.Z_OK&&this._error("Init error"),this.dictionary=i,this.write_in_progress=!1,this.init_done=!0},n.prototype._setDictionary=function(){if(null!=this.dictionary){switch(this.err=$n.Z_OK,this.mode){case $n.DEFLATE:case $n.DEFLATERAW:this.err=pn.deflateSetDictionary(this.strm,this.dictionary)}this.err!==$n.Z_OK&&this._error("Failed to set dictionary")}},n.prototype._reset=function(){switch(this.err=$n.Z_OK,this.mode){case $n.DEFLATE:case $n.DEFLATERAW:case $n.GZIP:this.err=pn.deflateReset(this.strm);break;case $n.INFLATE:case $n.INFLATERAW:case $n.GUNZIP:this.err=Dn.inflateReset(this.strm)}this.err!==$n.Z_OK&&this._error("Failed to reset stream")},$n.Zlib=n}).call(this)}).call(this,ne,u({}).Buffer);var Xn=Object.getOwnPropertySymbols,Jn=Object.prototype.hasOwnProperty,Qn=Object.prototype.propertyIsEnumerable,ti=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(yn){return!1}}()?Object.assign:function(t,e){for(var r,n,i=function(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),o=1;o=3&&(o.depth=arguments[2]),arguments.length>=4&&(o.colors=arguments[3]),s(i)?o.showHidden=i:i&&ri._extend(o,i),h(o.showHidden)&&(o.showHidden=!1),h(o.depth)&&(o.depth=2),h(o.colors)&&(o.colors=!1),h(o.customInspect)&&(o.customInspect=!0),o.colors&&(o.stylize=e),n(o,t,o.depth)}function e(e,r){var n=t.styles[r];return n?"\x1b["+t.colors[n][0]+"m"+e+"\x1b["+t.colors[n][1]+"m":e}function r(t,e){return t}function n(t,e,r){if(t.customInspect&&e&&_(e.inspect)&&e.inspect!==ri.inspect&&(!e.constructor||e.constructor.prototype!==e)){var d=e.inspect(r,t);return u(d)||(d=n(t,d,r)),d}var g=function(t,e){if(h(e))return t.stylize("undefined","undefined");if(u(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return f(e)?t.stylize(""+e,"number"):s(e)?t.stylize(""+e,"boolean"):l(e)?t.stylize("null","null"):void 0}(t,e);if(g)return g;var m=Object.keys(e),w=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(m);if(t.showHidden&&(m=Object.getOwnPropertyNames(e)),y(e)&&(m.indexOf("message")>=0||m.indexOf("description")>=0))return i(e);if(0===m.length){if(_(e)){var v=e.name?": "+e.name:"";return t.stylize("[Function"+v+"]","special")}if(c(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(p(e))return t.stylize(Date.prototype.toString.call(e),"date");if(y(e))return i(e)}var E,k="",S=!1,A=["{","}"];return a(e)&&(S=!0,A=["[","]"]),_(e)&&(k=" [Function"+(e.name?": "+e.name:"")+"]"),c(e)&&(k=" "+RegExp.prototype.toString.call(e)),p(e)&&(k=" "+Date.prototype.toUTCString.call(e)),y(e)&&(k=" "+i(e)),0!==m.length||S&&0!=e.length?r<0?c(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),E=S?function(t,e,r,n,i){for(var a=[],s=0,l=e.length;s60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(E,k,A)):A[0]+k+A[1]}function i(t){return"["+Error.prototype.toString.call(t)+"]"}function o(t,e,r,i,o,a){var s,f,u;if((u=Object.getOwnPropertyDescriptor(e,o)||{value:e[o]}).get?f=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(f=t.stylize("[Setter]","special")),b(i,o)||(s="["+o+"]"),f||(t.seen.indexOf(u.value)<0?(f=l(r)?n(t,u.value,null):n(t,u.value,r-1)).indexOf("\n")>-1&&(f=a?f.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+f.split("\n").map((function(t){return" "+t})).join("\n")):f=t.stylize("[Circular]","special")),h(s)){if(a&&o.match(/^\d+$/))return f;(s=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+f}function a(t){return Array.isArray(t)}function s(t){return"boolean"==typeof t}function l(t){return null===t}function f(t){return"number"==typeof t}function u(t){return"string"==typeof t}function h(t){return void 0===t}function c(t){return d(t)&&"[object RegExp]"===g(t)}function d(t){return"object"==typeof t&&null!==t}function p(t){return d(t)&&"[object Date]"===g(t)}function y(t){return d(t)&&("[object Error]"===g(t)||t instanceof Error)}function _(t){return"function"==typeof t}function g(t){return Object.prototype.toString.call(t)}ri.inspect=t,t.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},t.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},ri.isRegExp=c,ri.isDate=p,ri.isError=y,ri.isFunction=_,ri.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t};function b(t,e){return Object.prototype.hasOwnProperty.call(t,e)}ri.inherits=ei,ri._extend=function(t,e){if(!e||!d(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}}).call(this)}).call(this,ne,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var ni={};(function(t){(function(){"use strict";function e(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i=0;l--)if(f[l]!==u[l])return!1;for(l=f.length-1;l>=0;l--)if(!y(t[s=f[l]],e[s],r,n))return!1;return!0}(t,n,o,l))}return o?t===n:t==n}function _(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function g(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(Hi){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function b(t,e,r,n){var i;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(t){var e;try{t()}catch(Hi){e=Hi}return e}(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!i&&d(i,r,"Missing expected exception"+n);var o="string"==typeof n,a=!t&&i&&!r;if((!t&&ri.isError(i)&&o&&g(i,r)||a)&&d(i,r,"Got unwanted exception"+n),t&&i&&r&&!g(i,r)||!t&&i)throw i}l.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=h(c(this.actual),128)+" "+this.operator+" "+h(c(this.expected),128),this.generatedMessage=!0);var e=t.stackStartFunction||d;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,i=u(e),o=n.indexOf("\n"+i);if(o>=0){var a=n.indexOf("\n",o+1);n=n.substring(a+1)}this.stack=n}}},ri.inherits(l.AssertionError,Error),l.fail=d,l.ok=p,l.equal=function(t,e,r){t!=e&&d(t,e,r,"==",l.equal)},l.notEqual=function(t,e,r){t==e&&d(t,e,r,"!=",l.notEqual)},l.deepEqual=function(t,e,r){y(t,e,!1)||d(t,e,r,"deepEqual",l.deepEqual)},l.deepStrictEqual=function(t,e,r){y(t,e,!0)||d(t,e,r,"deepStrictEqual",l.deepStrictEqual)},l.notDeepEqual=function(t,e,r){y(t,e,!1)&&d(t,e,r,"notDeepEqual",l.notDeepEqual)},l.notDeepStrictEqual=function t(e,r,n){y(e,r,!0)&&d(e,r,n,"notDeepStrictEqual",t)},l.strictEqual=function(t,e,r){t!==e&&d(t,e,r,"===",l.strictEqual)},l.notStrictEqual=function(t,e,r){t===e&&d(t,e,r,"!==",l.notStrictEqual)},l.throws=function(t,e,r){b(!0,t,e,r)},l.doesNotThrow=function(t,e,r){b(!1,t,e,r)},l.ifError=function(t){if(t)throw t},l.strict=ti((function t(e,r){e||d(e,!0,r,"==",t)}),l,{equal:l.strictEqual,deepEqual:l.deepStrictEqual,notEqual:l.notStrictEqual,notDeepEqual:l.notDeepStrictEqual}),l.strict.strict=l.strict;var m=Object.keys||function(t){var e=[];for(var r in t)n.call(t,r)&&e.push(r);return e}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var ii={};(function(t){(function(){"use strict";var e=u({}).Buffer,r=wr.Transform,n=(ni.ok,u({}).kMaxLength),i="Cannot create final Buffer. It would be larger than 0x"+n.toString(16)+" bytes";$n.Z_MIN_WINDOWBITS=8,$n.Z_MAX_WINDOWBITS=15,$n.Z_DEFAULT_WINDOWBITS=15,$n.Z_MIN_CHUNK=64,$n.Z_MAX_CHUNK=1/0,$n.Z_DEFAULT_CHUNK=16384,$n.Z_MIN_MEMLEVEL=1,$n.Z_MAX_MEMLEVEL=9,$n.Z_DEFAULT_MEMLEVEL=8,$n.Z_MIN_LEVEL=-1,$n.Z_MAX_LEVEL=9,$n.Z_DEFAULT_LEVEL=$n.Z_DEFAULT_COMPRESSION;for(var o=Object.keys($n),a=0;aii.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+t.chunkSize);if(t.windowBits&&(t.windowBitsii.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+t.windowBits);if(t.level&&(t.levelii.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+t.level);if(t.memLevel&&(t.memLevelii.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+t.memLevel);if(t.strategy&&t.strategy!=ii.Z_FILTERED&&t.strategy!=ii.Z_HUFFMAN_ONLY&&t.strategy!=ii.Z_RLE&&t.strategy!=ii.Z_FIXED&&t.strategy!=ii.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+t.strategy);if(t.dictionary&&!e.isBuffer(t.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new $n.Zlib(n);var o=this;this._hadError=!1,this._handle.onerror=function(t,e){k(o),o._hadError=!0;var r=new Error(t);r.errno=e,r.code=ii.codes[e],o.emit("error",r)};var a=ii.Z_DEFAULT_COMPRESSION;"number"==typeof t.level&&(a=t.level);var s=ii.Z_DEFAULT_STRATEGY;"number"==typeof t.strategy&&(s=t.strategy),this._handle.init(t.windowBits||ii.Z_DEFAULT_WINDOWBITS,a,t.memLevel||ii.Z_DEFAULT_MEMLEVEL,s,t.dictionary),this._buffer=e.allocUnsafe(this._chunkSize),this._offset=0,this._level=a,this._strategy=s,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!i._handle},configurable:!0,enumerable:!0})}function k(e,r){r&&t.nextTick(r),e._handle&&(e._handle.close(),e._handle=null)}function S(t){t.emit("close")}Object.defineProperty(ii,"codes",{enumerable:!0,value:Object.freeze(l),writable:!1}),ii.Inflate=y,ii.createDeflate=function(t){return new p(t)},ii.createInflate=function(t){return new y(t)},ii.deflateSync=function(t,e){return d(new p(e),t)},ii.inflateSync=function(t,e){return d(new y(e),t)},_e.inherits(E,r),E.prototype.params=function(e,r,n){if(eii.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(r!=ii.Z_FILTERED&&r!=ii.Z_HUFFMAN_ONLY&&r!=ii.Z_RLE&&r!=ii.Z_FIXED&&r!=ii.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+r);if(this._level!==e||this._strategy!==r){var i=this;this.flush($n.Z_SYNC_FLUSH,(function(){i._handle.params(e,r),i._hadError||(i._level=e,i._strategy=r,n&&n())}))}else t.nextTick(n)},E.prototype.reset=function(){return this._handle.reset()},E.prototype._flush=function(t){this._transform(e.alloc(0),"",t)},E.prototype.flush=function(r,n){var i=this,o=this._writableState;("function"==typeof r||void 0===r&&!n)&&(n=r,r=$n.Z_FULL_FLUSH),o.ended?n&&t.nextTick(n):o.ending?n&&this.once("end",n):o.needDrain?n&&this.once("drain",(function(){return i.flush(r,n)})):(this._flushFlag=r,this.write(e.alloc(0),"",n))},E.prototype.close=function(e){k(this,e),t.nextTick(S,this)},E.prototype._transform=function(t,r,n){var i,o=this._writableState,a=(o.ending||o.ended)&&(!t||o.length===t.length);return null===t||e.isBuffer(t)?this._handle?(a?i=this._finishFlushFlag:(i=this._flushFlag,t.length>=o.length&&(this._flushFlag=this._opts.flush||$n.Z_NO_FLUSH)),void this._processChunk(t,i,n)):n(new Error("zlib binding closed")):n(new Error("invalid input"))},E.prototype._processChunk=function(t,r,o){var a=t&&t.length,s=this._chunkSize-this._offset,l=0,f=this,u="function"==typeof o;if(!u){var h,c=[],d=0;this.on("error",(function(t){h=t}));do{var p=this._handle.writeSync(r,t,l,a,this._buffer,this._offset,s)}while(!this._hadError&&g(p[0],p[1]));if(this._hadError)throw h;if(d>=n)throw k(this),new RangeError(i);var y=e.concat(c,d);return k(this),y}var _=this._handle.write(r,t,l,a,this._buffer,this._offset,s);function g(n,i){if(this&&(this.buffer=null,this.callback=null),!f._hadError){var h=s-i;if(h>0){var p=f._buffer.slice(f._offset,f._offset+h);f._offset+=h,u?f.push(p):(c.push(p),d+=p.length)}if((0===i||f._offset>=f._chunkSize)&&(s=f._chunkSize,f._offset=0,f._buffer=e.allocUnsafe(f._chunkSize)),0===i){if(l+=a-n,a=n,!u)return!0;var y=f._handle.write(r,t,l,a,f._buffer,f._offset,f._chunkSize);return y.callback=g,void(y.buffer=t)}if(!u)return!1;o()}}_.buffer=t,_.callback=g},_e.inherits(p,E),_e.inherits(y,E),_e.inherits(_,E),_e.inherits(g,E),_e.inherits(b,E),_e.inherits(m,E),_e.inherits(w,E)}).call(this)}).call(this,ne);var oi={};(function(t,e){(function(){"use strict";let r=oi=function(){wr.call(this),this._buffers=[],this._buffered=0,this._reads=[],this._paused=!1,this._encoding="utf8",this.writable=!0};_e.inherits(r,wr),r.prototype.read=function(e,r){this._reads.push({length:Math.abs(e),allowLess:e<0,func:r}),t.nextTick(function(){this._process(),this._paused&&this._reads&&this._reads.length>0&&(this._paused=!1,this.emit("drain"))}.bind(this))},r.prototype.write=function(t,r){if(!this.writable)return this.emit("error",new Error("Stream not writable")),!1;let n;return n=e.isBuffer(t)?t:e.from(t,r||this._encoding),this._buffers.push(n),this._buffered+=n.length,this._process(),this._reads&&0===this._reads.length&&(this._paused=!0),this.writable&&!this._paused},r.prototype.end=function(t,e){t&&this.write(t,e),this.writable=!1,this._buffers&&(0===this._buffers.length?this._end():(this._buffers.push(null),this._process()))},r.prototype.destroySoon=r.prototype.end,r.prototype._end=function(){this._reads.length>0&&this.emit("error",new Error("Unexpected end of input")),this.destroy()},r.prototype.destroy=function(){this._buffers&&(this.writable=!1,this._reads=null,this._buffers=null,this.emit("close"))},r.prototype._processReadAllowingLess=function(t){this._reads.shift();let e=this._buffers[0];e.length>t.length?(this._buffered-=t.length,this._buffers[0]=e.slice(t.length),t.func.call(this,e.slice(0,t.length))):(this._buffered-=e.length,this._buffers.shift(),t.func.call(this,e))},r.prototype._processRead=function(t){this._reads.shift();let r=0,n=0,i=e.alloc(t.length);for(;r0&&this._buffers.splice(0,n),this._buffered-=t.length,t.func.call(this,i)},r.prototype._process=function(){try{for(;this._buffered>0&&this._reads&&this._reads.length>0;){let t=this._reads[0];if(t.allowLess)this._processReadAllowingLess(t);else{if(!(this._buffered>=t.length))break;this._processRead(t)}}this._buffers&&!this.writable&&this._end()}catch(t){this.emit("error",t)}}}).call(this)}).call(this,ne,u({}).Buffer);var ai={};let si=[{x:[0],y:[0]},{x:[4],y:[0]},{x:[0,4],y:[4]},{x:[2,6],y:[0,4]},{x:[0,2,4,6],y:[2,6]},{x:[1,3,5,7],y:[0,2,4,6]},{x:[0,1,2,3,4,5,6,7],y:[1,3,5,7]}];ai.getImagePasses=function(t,e){let r=[],n=t%8,i=e%8,o=(t-n)/8,a=(e-i)/8;for(let s=0;s0&&l>0&&r.push({width:e,height:l,index:s})}return r},ai.getInterlaceIterator=function(t){return function(e,r,n){let i=e%si[n].x.length,o=(e-i)/si[n].x.length*8+si[n].x[i],a=r%si[n].y.length;return 4*o+((r-a)/si[n].y.length*8+si[n].y[a])*t*4}};var li=function(t,e,r){let n=t+e-r,i=Math.abs(n-t),o=Math.abs(n-e),a=Math.abs(n-r);return i<=o&&i<=a?t:o<=a?e:r},fi={};(function(t){(function(){"use strict";function e(t,e,r){let n=t*e;return 8!==r&&(n=Math.ceil(n/(8/r))),n}let r=fi=function(t,r){let n=t.width,i=t.height,o=t.interlace,a=t.bpp,s=t.depth;if(this.read=r.read,this.write=r.write,this.complete=r.complete,this._imageIndex=0,this._images=[],o){let t=ai.getImagePasses(n,i);for(let r=0;ri?e[o-n]:0;e[o]=r+a}},r.prototype._unFilterType2=function(t,e,r){let n=this._lastLine;for(let i=0;ii?e[a-n]:0,f=Math.floor((l+s)/2);e[a]=r+f}},r.prototype._unFilterType4=function(t,e,r){let n=this._xComparison,i=n-1,o=this._lastLine;for(let a=0;ai?e[a-n]:0,f=a>i&&o?o[a-n]:0,u=li(l,s,f);e[a]=r+u}},r.prototype._reverseFilterLine=function(e){let r,n=e[0],i=this._images[this._imageIndex],o=i.byteWidth;if(0===n)r=e.slice(1,o+1);else switch(r=t.alloc(o),n){case 1:this._unFilterType1(e,r,o);break;case 2:this._unFilterType2(e,r,o);break;case 3:this._unFilterType3(e,r,o);break;case 4:this._unFilterType4(e,r,o);break;default:throw new Error("Unrecognised filter type - "+n)}this.write(r),i.lineIndex++,i.lineIndex>=i.height?(this._lastLine=null,this._imageIndex++,i=this._images[this._imageIndex]):this._lastLine=r,i?this.read(i.byteWidth+1,this._reverseFilterLine.bind(this)):(this._lastLine=null,this.complete())}}).call(this)}).call(this,u({}).Buffer);var ui={};(function(t){(function(){"use strict";let e=ui=function(e){oi.call(this);let r=[],n=this;this._filter=new fi(e,{read:this.read.bind(this),write:function(t){r.push(t)},complete:function(){n.emit("complete",t.concat(r))}}),this._filter.start()};_e.inherits(e,oi)}).call(this)}).call(this,u({}).Buffer);var hi,ci={PNG_SIGNATURE:[137,80,78,71,13,10,26,10],TYPE_IHDR:1229472850,TYPE_IEND:1229278788,TYPE_IDAT:1229209940,TYPE_PLTE:1347179589,TYPE_tRNS:1951551059,TYPE_gAMA:1732332865,COLORTYPE_GRAYSCALE:0,COLORTYPE_PALETTE:1,COLORTYPE_COLOR:2,COLORTYPE_ALPHA:4,COLORTYPE_PALETTE_COLOR:3,COLORTYPE_COLOR_ALPHA:6,COLORTYPE_TO_BPP_MAP:{0:1,2:3,3:1,4:2,6:4},GAMMA_DIVISION:1e5};let di=[];!function(){for(let t=0;t<256;t++){let e=t;for(let t=0;t<8;t++)1&e?e=3988292384^e>>>1:e>>>=1;di[t]=e}}();let pi=hi=function(){this._crc=-1};pi.prototype.write=function(t){for(let e=0;e>>8;return!0},pi.prototype.crc32=function(){return-1^this._crc},pi.crc32=function(t){let e=-1;for(let r=0;r>>8;return-1^e};var yi={};(function(t){(function(){"use strict";let e=yi=function(t,e){this._options=t,t.checkCRC=!1!==t.checkCRC,this._hasIHDR=!1,this._hasIEND=!1,this._emittedHeadersFinished=!1,this._palette=[],this._colorType=0,this._chunks={},this._chunks[ci.TYPE_IHDR]=this._handleIHDR.bind(this),this._chunks[ci.TYPE_IEND]=this._handleIEND.bind(this),this._chunks[ci.TYPE_IDAT]=this._handleIDAT.bind(this),this._chunks[ci.TYPE_PLTE]=this._handlePLTE.bind(this),this._chunks[ci.TYPE_tRNS]=this._handleTRNS.bind(this),this._chunks[ci.TYPE_gAMA]=this._handleGAMA.bind(this),this.read=e.read,this.error=e.error,this.metadata=e.metadata,this.gamma=e.gamma,this.transColor=e.transColor,this.palette=e.palette,this.parsed=e.parsed,this.inflateData=e.inflateData,this.finished=e.finished,this.simpleTransparency=e.simpleTransparency,this.headersFinished=e.headersFinished||function(){}};e.prototype.start=function(){this.read(ci.PNG_SIGNATURE.length,this._parseSignature.bind(this))},e.prototype._parseSignature=function(t){let e=ci.PNG_SIGNATURE;for(let r=0;rthis._palette.length)return void this.error(new Error("More transparent colors than palette size"));for(let e=0;e0?this._handleIDAT(r):this._handleChunkEnd()},e.prototype._handleIEND=function(t){this.read(t,this._parseIEND.bind(this))},e.prototype._parseIEND=function(t){this._crc.write(t),this._hasIEND=!0,this._handleChunkEnd(),this.finished&&this.finished()}}).call(this)}).call(this,u({}).Buffer);var _i={};(function(t){(function(){"use strict";let e=[function(){},function(t,e,r,n){if(n===e.length)throw new Error("Ran out of data");let i=e[n];t[r]=i,t[r+1]=i,t[r+2]=i,t[r+3]=255},function(t,e,r,n){if(n+1>=e.length)throw new Error("Ran out of data");let i=e[n];t[r]=i,t[r+1]=i,t[r+2]=i,t[r+3]=e[n+1]},function(t,e,r,n){if(n+2>=e.length)throw new Error("Ran out of data");t[r]=e[n],t[r+1]=e[n+1],t[r+2]=e[n+2],t[r+3]=255},function(t,e,r,n){if(n+3>=e.length)throw new Error("Ran out of data");t[r]=e[n],t[r+1]=e[n+1],t[r+2]=e[n+2],t[r+3]=e[n+3]}],r=[function(){},function(t,e,r,n){let i=e[0];t[r]=i,t[r+1]=i,t[r+2]=i,t[r+3]=n},function(t,e,r){let n=e[0];t[r]=n,t[r+1]=n,t[r+2]=n,t[r+3]=e[1]},function(t,e,r,n){t[r]=e[0],t[r+1]=e[1],t[r+2]=e[2],t[r+3]=n},function(t,e,r){t[r]=e[0],t[r+1]=e[1],t[r+2]=e[2],t[r+3]=e[3]}];function n(t,r,n,i,o,a){let s=t.width,l=t.height,f=t.index;for(let u=0;u>4,r.push(h,u);break;case 2:l=3&c,f=c>>2&3,u=c>>4&3,h=c>>6&3,r.push(h,u,f,l);break;case 1:i=1&c,o=c>>1&1,a=c>>2&1,s=c>>3&1,l=c>>4&1,f=c>>5&1,u=c>>6&1,h=c>>7&1,r.push(h,u,f,l,s,a,o,i)}}return{get:function(t){for(;r.length>3))*this._bitmapInfo.height,e=Math.max(t,ii.Z_MIN_CHUNK);this._inflate=ii.createInflate({chunkSize:e});let r=t,n=this.emit.bind(this,"error");this._inflate.on("error",(function(t){r&&n(t)})),this._filter.on("complete",this._complete.bind(this));let i=this._filter.write.bind(this._filter);this._inflate.on("data",(function(t){r&&(t.length>r&&(t=t.slice(0,r)),r-=t.length,i(t))})),this._inflate.on("end",this._filter.end.bind(this._filter))}this._inflate.write(t)},mi.prototype._handleMetaData=function(t){this._metaData=t,this._bitmapInfo=Object.create(t),this._filter=new ui(this._bitmapInfo)},mi.prototype._handleTransColor=function(t){this._bitmapInfo.transColor=t},mi.prototype._handlePalette=function(t){this._bitmapInfo.palette=t},mi.prototype._simpleTransparency=function(){this._metaData.alpha=!0},mi.prototype._headersFinished=function(){this.emit("metadata",this._metaData)},mi.prototype._finished=function(){this.errord||(this._inflate?this._inflate.end():this.emit("error","No Inflate block"))},mi.prototype._complete=function(t){if(this.errord)return;let e;try{let r=_i.dataToBitMap(t,this._bitmapInfo);e=gi(r,this._bitmapInfo,this._options.skipRescale),r=null}catch(r){return void this._handleError(r)}this.emit("parsed",e)};var wi={};(function(t){(function(){"use strict";wi=function(e,r,n,i){let o=-1!==[ci.COLORTYPE_COLOR_ALPHA,ci.COLORTYPE_ALPHA].indexOf(i.colorType);if(i.colorType===i.inputColorType){let t=function(){let t=new ArrayBuffer(2);return new DataView(t).setInt16(0,256,!0),256!==new Int16Array(t)[0]}();if(8===i.bitDepth||16===i.bitDepth&&t)return e}let a=16!==i.bitDepth?e:new Uint16Array(e.buffer),s=255,l=ci.COLORTYPE_TO_BPP_MAP[i.inputColorType];4!==l||i.inputHasAlpha||(l=3);let f=ci.COLORTYPE_TO_BPP_MAP[i.colorType];16===i.bitDepth&&(s=65535,f*=2);let u=t.alloc(r*n*f),h=0,c=0,d=i.bgColor||{};function p(){let t,e,r,n=s;switch(i.inputColorType){case ci.COLORTYPE_COLOR_ALPHA:n=a[h+3],t=a[h],e=a[h+1],r=a[h+2];break;case ci.COLORTYPE_COLOR:t=a[h],e=a[h+1],r=a[h+2];break;case ci.COLORTYPE_ALPHA:n=a[h+1],e=t=a[h],r=t;break;case ci.COLORTYPE_GRAYSCALE:e=t=a[h],r=t;break;default:throw new Error("input color type:"+i.inputColorType+" is not supported at present")}return i.inputHasAlpha&&(o||(n/=s,t=Math.min(Math.max(Math.round((1-n)*d.red+n*t),0),s),e=Math.min(Math.max(Math.round((1-n)*d.green+n*e),0),s),r=Math.min(Math.max(Math.round((1-n)*d.blue+n*r),0),s))),{red:t,green:e,blue:r,alpha:n}}void 0===d.red&&(d.red=s),void 0===d.green&&(d.green=s),void 0===d.blue&&(d.blue=s);for(let t=0;t=o?t[e+a-o]:0,s=t[e+a]-r;n[i+a]=s}},2:function(t,e,r,n,i){for(let o=0;o0?t[e+o-r]:0,s=t[e+o]-a;n[i+o]=s}},3:function(t,e,r,n,i,o){for(let a=0;a=o?t[e+a-o]:0,l=e>0?t[e+a-r]:0,f=t[e+a]-(s+l>>1);n[i+a]=f}},4:function(t,e,r,n,i,o){for(let a=0;a=o?t[e+a-o]:0,l=e>0?t[e+a-r]:0,f=e>0&&a>=o?t[e+a-(r+o)]:0,u=t[e+a]-li(s,l,f);n[i+a]=u}}},r={0:function(t,e,r){let n=0,i=e+r;for(let o=e;o=n?t[e+o-n]:0,a=t[e+o]-r;i+=Math.abs(a)}return i},2:function(t,e,r){let n=0,i=e+r;for(let o=e;o0?t[o-r]:0,a=t[o]-i;n+=Math.abs(a)}return n},3:function(t,e,r,n){let i=0;for(let o=0;o=n?t[e+o-n]:0,s=e>0?t[e+o-r]:0,l=t[e+o]-(a+s>>1);i+=Math.abs(l)}return i},4:function(t,e,r,n){let i=0;for(let o=0;o=n?t[e+o-n]:0,s=e>0?t[e+o-r]:0,l=e>0&&o>=n?t[e+o-(r+n)]:0,f=t[e+o]-li(a,s,l);i+=Math.abs(f)}return i}};vi=function(n,i,o,a,s){let l;if("filterType"in a&&-1!==a.filterType){if("number"!=typeof a.filterType)throw new Error("unrecognised filter types");l=[a.filterType]}else l=[0,1,2,3,4];16===a.bitDepth&&(s*=2);let f=i*s,u=0,h=0,c=t.alloc((f+1)*o),d=l[0];for(let t=0;t1){let t=1/0;for(let e=0;e0){let t=l._buffer.slice(l._offset,l._offset+n);if(l._offset+=n,t.length>h&&(t=t.slice(0,h)),d.push(t),p+=t.length,0==(h-=t.length))return!1}return(0===r||l._offset>=l._chunkSize)&&(u=l._chunkSize,l._offset=0,l._buffer=e.allocUnsafe(l._chunkSize)),0===r&&(c+=f-t,f=t,!0)}this.on("error",(function(t){a=t}));do{s=(s=this._handle.writeSync(n,t,c,f,this._buffer,this._offset,u))||this._writeState}while(!this._hadError&&y(s[0],s[1]));if(this._hadError)throw a;if(p>=r)throw i(this),new RangeError("Cannot create final Buffer. It would be larger than 0x"+r.toString(16)+" bytes");let _=e.concat(d,p);return i(this),_},_e.inherits(n,ii.Inflate),(Si=Si=o).Inflate=n,Si.createInflate=function(t){return new n(t)},Si.inflateSync=o}).call(this)}).call(this,ne,u({}).Buffer);var Ai;let Ti=Ai=function(t){this._buffer=t,this._reads=[]};Ti.prototype.read=function(t,e){this._reads.push({length:Math.abs(t),allowLess:t<0,func:e})},Ti.prototype.process=function(){for(;this._reads.length>0&&this._buffer.length;){let t=this._reads[0];if(!this._buffer.length||!(this._buffer.length>=t.length||t.allowLess))break;{this._reads.shift();let e=this._buffer;this._buffer=e.slice(t.length),t.func.call(this,e.slice(0,t.length))}}if(this._reads.length>0)throw new Error("There are some read requests waitng on finished stream");if(this._buffer.length>0)throw new Error("unrecognised content at end of stream")};var Oi={};(function(t){(function(){"use strict";Oi.process=function(e,r){let n=[],i=new Ai(e);return new fi(r,{read:i.read.bind(i),write:function(t){n.push(t)},complete:function(){}}).start(),i.process(),t.concat(n)}}).call(this)}).call(this,u({}).Buffer);var Ri={};(function(t){(function(){"use strict";let e=!0;ii.deflateSync||(e=!1),Ri=function(r,n){if(!e)throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");let i,o,a,s=[],l=new Ai(r);if(new yi(n,{read:l.read.bind(l),error:function(t){i=t},metadata:function(t){o=t},gamma:function(t){a=t},palette:function(t){o.palette=t},transColor:function(t){o.transColor=t},inflateData:function(t){s.push(t)},simpleTransparency:function(){o.alpha=!0}}).start(),l.process(),i)throw i;let f,u=t.concat(s);if(s.length=0,o.interlace)f=ii.inflateSync(u);else{let t=(1+(o.width*o.bpp*o.depth+7>>3))*o.height;f=Si(u,{chunkSize:t,maxLength:t})}if(u=null,!f||!f.length)throw new Error("bad png - invalid inflate data response");let h=Oi.process(f,o);u=null;let c=_i.dataToBitMap(h,o);h=null;let d=gi(c,o,n.skipRescale);return o.data=d,o.gamma=a||0,o}}).call(this)}).call(this,u({}).Buffer);var Li={};(function(t){(function(){"use strict";let e=!0;ii.deflateSync||(e=!1),Li=function(r,n){if(!e)throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");let i=new Ei(n||{}),o=[];o.push(t.from(ci.PNG_SIGNATURE)),o.push(i.packIHDR(r.width,r.height)),r.gamma&&o.push(i.packGAMA(r.gamma));let a=i.filterData(r.data,r.width,r.height),s=ii.deflateSync(a,i.getDeflateOptions());if(a=null,!s||!s.length)throw new Error("bad png - invalid compressed data response");return o.push(i.packIDAT(s)),o.push(i.packIEND()),t.concat(o)}}).call(this)}).call(this,u({}).Buffer);var Ii={read:function(t,e){return Ri(t,e||{})},write:function(t,e){return Li(t,e)}},Pi={};(function(t,e){(function(){"use strict";let r=Pi.PNG=function(t){wr.call(this),t=t||{},this.width=0|t.width,this.height=0|t.height,this.data=this.width>0&&this.height>0?e.alloc(4*this.width*this.height):null,t.fill&&this.data&&this.data.fill(0),this.gamma=0,this.readable=this.writable=!0,this._parser=new bi(t),this._parser.on("error",this.emit.bind(this,"error")),this._parser.on("close",this._handleClose.bind(this)),this._parser.on("metadata",this._metadata.bind(this)),this._parser.on("gamma",this._gamma.bind(this)),this._parser.on("parsed",function(t){this.data=t,this.emit("parsed",t)}.bind(this)),this._packer=new ki(t),this._packer.on("data",this.emit.bind(this,"data")),this._packer.on("end",this.emit.bind(this,"end")),this._parser.on("close",this._handleClose.bind(this)),this._packer.on("error",this.emit.bind(this,"error"))};_e.inherits(r,wr),r.sync=Ii,r.prototype.pack=function(){return this.data&&this.data.length?(t.nextTick(function(){this._packer.pack(this.data,this.width,this.height,this.gamma)}.bind(this)),this):(this.emit("error","No data provided"),this)},r.prototype.parse=function(t,e){if(e){let t,r;t=function(t){this.removeListener("error",r),this.data=t,e(null,this)}.bind(this),r=function(r){this.removeListener("parsed",t),e(r,null)}.bind(this),this.once("parsed",t),this.once("error",r)}return this.end(t),this},r.prototype.write=function(t){return this._parser.write(t),!0},r.prototype.end=function(t){this._parser.end(t)},r.prototype._metadata=function(t){this.width=t.width,this.height=t.height,this.emit("metadata",t)},r.prototype._gamma=function(t){this.gamma=t},r.prototype._handleClose=function(){this._parser.writable||this._packer.readable||this.emit("close")},r.bitblt=function(t,e,r,n,i,o,a,s){if(n|=0,i|=0,o|=0,a|=0,s|=0,(r|=0)>t.width||n>t.height||r+i>t.width||n+o>t.height)throw new Error("bitblt reading outside image");if(a>e.width||s>e.height||a+i>e.width||s+o>e.height)throw new Error("bitblt writing outside image");for(let l=0;l{const r=[];let n=0;for(;n=e.length){const i=1,o=t.from([i-1]);r.push(o),r.push(e.slice(n,e.length));break}if(i===e[n+1]){let o=n+1,a=2;for(;++o{const r=[];let n=0;for(;n{const r=[];let n=0;for(;n=e.length){const i=e.length-n,o=t.from([i-1]);r.push(o),r.push(e.slice(n,e.length));break}if(i===e[n+1]&&i===e[n+2]){let o=n+2,a=3;for(;++o2)break}else a=e[i],s=1;o++}s>2&&(i-=2,o-=2);const l=t.from([o-1]);r.push(l),r.push(e.slice(n,i)),n=i}}return t.concat(r)},Ci.decode=e=>{const r=[];let n=0;for(;n=128){const r=i-125;o=t.alloc(r,e.slice(n+1,n+2)),n+=2}else{const t=i+1;o=e.slice(n+1,n+1+t),n+=1+t}r.push(o)}return t.concat(r)}}).call(this)}).call(this,u({}).Buffer);var Bi={},Mi=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),Ni=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Di=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&Mi(e,t,r);return Ni(e,t),e};Object.defineProperty(Bi,"__esModule",{value:!0}),Bi.encode=void 0;const ji=Di(xi),Ui=Di(Ci);Bi.encode=(t,e={})=>{const{format:r}=Object.assign({format:"default"},e);return"icns"===r?Ui.encode(t):ji.encode(t)};var Fi={},zi=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),Zi=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||zi(e,t,r)};return Object.defineProperty(Fi,"__esModule",{value:!0}),Zi(h,Fi),Zi(E,Fi),Zi(e({}),Fi),Zi(r({}),Fi),Fi})); \ No newline at end of file diff --git a/lib/jszip.min.js b/lib/jszip.min.js deleted file mode 100644 index b918873..0000000 --- a/lib/jszip.min.js +++ /dev/null @@ -1,15 +0,0 @@ -/*! - -JSZip v3.1.5 - A JavaScript class for generating and reading zip files - - -(c) 2009-2016 Stuart Knightley -Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/master/LICENSE.markdown. - -JSZip uses the library pako released under the MIT license : -https://github.com/nodeca/pako/blob/master/LICENSE -*/ -!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.JSZip=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g>2,h=(3&b)<<4|c>>4,i=n>1?(15&c)<<2|e>>6:64,j=n>2?63&e:64,k.push(f.charAt(g)+f.charAt(h)+f.charAt(i)+f.charAt(j));return k.join("")},c.decode=function(a){var b,c,d,g,h,i,j,k=0,l=0,m="data:";if(a.substr(0,m.length)===m)throw new Error("Invalid base64 input, it looks like a data url.");a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");var n=3*a.length/4;if(a.charAt(a.length-1)===f.charAt(64)&&n--,a.charAt(a.length-2)===f.charAt(64)&&n--,n%1!==0)throw new Error("Invalid base64 input, bad content length.");var o;for(o=e.uint8array?new Uint8Array(0|n):new Array(0|n);k>4,c=(15&h)<<4|i>>2,d=(3&i)<<6|j,o[l++]=b,64!==i&&(o[l++]=c),64!==j&&(o[l++]=d);return o}},{"./support":30,"./utils":32}],2:[function(a,b,c){"use strict";function d(a,b,c,d,e){this.compressedSize=a,this.uncompressedSize=b,this.crc32=c,this.compression=d,this.compressedContent=e}var e=a("./external"),f=a("./stream/DataWorker"),g=a("./stream/DataLengthProbe"),h=a("./stream/Crc32Probe"),g=a("./stream/DataLengthProbe");d.prototype={getContentWorker:function(){var a=new f(e.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new g("data_length")),b=this;return a.on("end",function(){if(this.streamInfo.data_length!==b.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),a},getCompressedWorker:function(){return new f(e.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},d.createWorkerFrom=function(a,b,c){return a.pipe(new h).pipe(new g("uncompressedSize")).pipe(b.compressWorker(c)).pipe(new g("compressedSize")).withStreamInfo("compression",b)},b.exports=d},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(a,b,c){"use strict";var d=a("./stream/GenericWorker");c.STORE={magic:"\0\0",compressWorker:function(a){return new d("STORE compression")},uncompressWorker:function(){return new d("STORE decompression")}},c.DEFLATE=a("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(a,b,c){"use strict";function d(){for(var a,b=[],c=0;c<256;c++){a=c;for(var d=0;d<8;d++)a=1&a?3988292384^a>>>1:a>>>1;b[c]=a}return b}function e(a,b,c,d){var e=h,f=d+c;a^=-1;for(var g=d;g>>8^e[255&(a^b[g])];return a^-1}function f(a,b,c,d){var e=h,f=d+c;a^=-1;for(var g=d;g>>8^e[255&(a^b.charCodeAt(g))];return a^-1}var g=a("./utils"),h=d();b.exports=function(a,b){if("undefined"==typeof a||!a.length)return 0;var c="string"!==g.getTypeOf(a);return c?e(0|b,a,a.length,0):f(0|b,a,a.length,0)}},{"./utils":32}],5:[function(a,b,c){"use strict";c.base64=!1,c.binary=!1,c.dir=!1,c.createFolders=!0,c.date=null,c.compression=null,c.compressionOptions=null,c.comment=null,c.unixPermissions=null,c.dosPermissions=null},{}],6:[function(a,b,c){"use strict";var d=null;d="undefined"!=typeof Promise?Promise:a("lie"),b.exports={Promise:d}},{lie:58}],7:[function(a,b,c){"use strict";function d(a,b){h.call(this,"FlateWorker/"+a),this._pako=null,this._pakoAction=a,this._pakoOptions=b,this.meta={}}var e="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,f=a("pako"),g=a("./utils"),h=a("./stream/GenericWorker"),i=e?"uint8array":"array";c.magic="\b\0",g.inherits(d,h),d.prototype.processChunk=function(a){this.meta=a.meta,null===this._pako&&this._createPako(),this._pako.push(g.transformTo(i,a.data),!1)},d.prototype.flush=function(){h.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},d.prototype.cleanUp=function(){h.prototype.cleanUp.call(this),this._pako=null},d.prototype._createPako=function(){this._pako=new f[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var a=this;this._pako.onData=function(b){a.push({data:b,meta:a.meta})}},c.compressWorker=function(a){return new d("Deflate",a)},c.uncompressWorker=function(){return new d("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:59}],8:[function(a,b,c){"use strict";function d(a,b,c,d){f.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=b,this.zipPlatform=c,this.encodeFileName=d,this.streamFiles=a,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}var e=a("../utils"),f=a("../stream/GenericWorker"),g=a("../utf8"),h=a("../crc32"),i=a("../signature"),j=function(a,b){var c,d="";for(c=0;c>>=8;return d},k=function(a,b){var c=a;return a||(c=b?16893:33204),(65535&c)<<16},l=function(a,b){return 63&(a||0)},m=function(a,b,c,d,f,m){var n,o,p=a.file,q=a.compression,r=m!==g.utf8encode,s=e.transformTo("string",m(p.name)),t=e.transformTo("string",g.utf8encode(p.name)),u=p.comment,v=e.transformTo("string",m(u)),w=e.transformTo("string",g.utf8encode(u)),x=t.length!==p.name.length,y=w.length!==u.length,z="",A="",B="",C=p.dir,D=p.date,E={crc32:0,compressedSize:0,uncompressedSize:0};b&&!c||(E.crc32=a.crc32,E.compressedSize=a.compressedSize,E.uncompressedSize=a.uncompressedSize);var F=0;b&&(F|=8),r||!x&&!y||(F|=2048);var G=0,H=0;C&&(G|=16),"UNIX"===f?(H=798,G|=k(p.unixPermissions,C)):(H=20,G|=l(p.dosPermissions,C)),n=D.getUTCHours(),n<<=6,n|=D.getUTCMinutes(),n<<=5,n|=D.getUTCSeconds()/2,o=D.getUTCFullYear()-1980,o<<=4,o|=D.getUTCMonth()+1,o<<=5,o|=D.getUTCDate(),x&&(A=j(1,1)+j(h(s),4)+t,z+="up"+j(A.length,2)+A),y&&(B=j(1,1)+j(h(v),4)+w,z+="uc"+j(B.length,2)+B);var I="";I+="\n\0",I+=j(F,2),I+=q.magic,I+=j(n,2),I+=j(o,2),I+=j(E.crc32,4),I+=j(E.compressedSize,4),I+=j(E.uncompressedSize,4),I+=j(s.length,2),I+=j(z.length,2);var J=i.LOCAL_FILE_HEADER+I+s+z,K=i.CENTRAL_FILE_HEADER+j(H,2)+I+j(v.length,2)+"\0\0\0\0"+j(G,4)+j(d,4)+s+z+v;return{fileRecord:J,dirRecord:K}},n=function(a,b,c,d,f){var g="",h=e.transformTo("string",f(d));return g=i.CENTRAL_DIRECTORY_END+"\0\0\0\0"+j(a,2)+j(a,2)+j(b,4)+j(c,4)+j(h.length,2)+h},o=function(a){var b="";return b=i.DATA_DESCRIPTOR+j(a.crc32,4)+j(a.compressedSize,4)+j(a.uncompressedSize,4)};e.inherits(d,f),d.prototype.push=function(a){var b=a.meta.percent||0,c=this.entriesCount,d=this._sources.length;this.accumulate?this.contentBuffer.push(a):(this.bytesWritten+=a.data.length,f.prototype.push.call(this,{data:a.data,meta:{currentFile:this.currentFile,percent:c?(b+100*(c-d-1))/c:100}}))},d.prototype.openedSource=function(a){this.currentSourceOffset=this.bytesWritten,this.currentFile=a.file.name;var b=this.streamFiles&&!a.file.dir;if(b){var c=m(a,b,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:c.fileRecord,meta:{percent:0}})}else this.accumulate=!0},d.prototype.closedSource=function(a){this.accumulate=!1;var b=this.streamFiles&&!a.file.dir,c=m(a,b,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(c.dirRecord),b)this.push({data:o(a),meta:{percent:100}});else for(this.push({data:c.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},d.prototype.flush=function(){for(var a=this.bytesWritten,b=0;b0?a.substring(0,b):""},q=function(a){return"/"!==a.slice(-1)&&(a+="/"),a},r=function(a,b){return b="undefined"!=typeof b?b:i.createFolders,a=q(a),this.files[a]||o.call(this,a,null,{dir:!0,createFolders:b}),this.files[a]},s={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(a){var b,c,d;for(b in this.files)this.files.hasOwnProperty(b)&&(d=this.files[b],c=b.slice(this.root.length,b.length),c&&b.slice(0,this.root.length)===this.root&&a(c,d))},filter:function(a){var b=[];return this.forEach(function(c,d){a(c,d)&&b.push(d)}),b},file:function(a,b,c){if(1===arguments.length){if(d(a)){var e=a;return this.filter(function(a,b){return!b.dir&&e.test(a)})}var f=this.files[this.root+a];return f&&!f.dir?f:null}return a=this.root+a,o.call(this,a,b,c),this},folder:function(a){if(!a)return this;if(d(a))return this.filter(function(b,c){return c.dir&&a.test(b)});var b=this.root+a,c=r.call(this,b),e=this.clone();return e.root=c.name,e},remove:function(a){a=this.root+a;var b=this.files[a];if(b||("/"!==a.slice(-1)&&(a+="/"),b=this.files[a]),b&&!b.dir)delete this.files[a];else for(var c=this.filter(function(b,c){return c.name.slice(0,a.length)===a}),d=0;d=0;--f)if(this.data[f]===b&&this.data[f+1]===c&&this.data[f+2]===d&&this.data[f+3]===e)return f-this.zero;return-1},d.prototype.readAndCheckSignature=function(a){var b=a.charCodeAt(0),c=a.charCodeAt(1),d=a.charCodeAt(2),e=a.charCodeAt(3),f=this.readData(4);return b===f[0]&&c===f[1]&&d===f[2]&&e===f[3]},d.prototype.readData=function(a){if(this.checkOffset(a),0===a)return[];var b=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,b},b.exports=d},{"../utils":32,"./DataReader":18}],18:[function(a,b,c){"use strict";function d(a){this.data=a,this.length=a.length,this.index=0,this.zero=0}var e=a("../utils");d.prototype={checkOffset:function(a){this.checkIndex(this.index+a)},checkIndex:function(a){if(this.length=this.index;b--)c=(c<<8)+this.byteAt(b);return this.index+=a,c},readString:function(a){return e.transformTo("string",this.readData(a))},readData:function(a){},lastIndexOfSignature:function(a){},readAndCheckSignature:function(a){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC((a>>25&127)+1980,(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},b.exports=d},{"../utils":32}],19:[function(a,b,c){"use strict";function d(a){e.call(this,a)}var e=a("./Uint8ArrayReader"),f=a("../utils");f.inherits(d,e),d.prototype.readData=function(a){this.checkOffset(a);var b=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,b},b.exports=d},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(a,b,c){"use strict";function d(a){e.call(this,a)}var e=a("./DataReader"),f=a("../utils");f.inherits(d,e),d.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},d.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},d.prototype.readAndCheckSignature=function(a){var b=this.readData(4);return a===b},d.prototype.readData=function(a){this.checkOffset(a);var b=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,b},b.exports=d},{"../utils":32,"./DataReader":18}],21:[function(a,b,c){"use strict";function d(a){e.call(this,a)}var e=a("./ArrayReader"),f=a("../utils");f.inherits(d,e),d.prototype.readData=function(a){if(this.checkOffset(a),0===a)return new Uint8Array(0);var b=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,b},b.exports=d},{"../utils":32,"./ArrayReader":17}],22:[function(a,b,c){"use strict";var d=a("../utils"),e=a("../support"),f=a("./ArrayReader"),g=a("./StringReader"),h=a("./NodeBufferReader"),i=a("./Uint8ArrayReader");b.exports=function(a){var b=d.getTypeOf(a);return d.checkSupport(b),"string"!==b||e.uint8array?"nodebuffer"===b?new h(a):e.uint8array?new i(d.transformTo("uint8array",a)):new f(d.transformTo("array",a)):new g(a)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(a,b,c){"use strict";c.LOCAL_FILE_HEADER="PK",c.CENTRAL_FILE_HEADER="PK",c.CENTRAL_DIRECTORY_END="PK",c.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",c.ZIP64_CENTRAL_DIRECTORY_END="PK",c.DATA_DESCRIPTOR="PK\b"},{}],24:[function(a,b,c){"use strict";function d(a){e.call(this,"ConvertWorker to "+a),this.destType=a}var e=a("./GenericWorker"),f=a("../utils");f.inherits(d,e),d.prototype.processChunk=function(a){this.push({data:f.transformTo(this.destType,a.data),meta:a.meta})},b.exports=d},{"../utils":32,"./GenericWorker":28}],25:[function(a,b,c){"use strict";function d(){e.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}var e=a("./GenericWorker"),f=a("../crc32"),g=a("../utils");g.inherits(d,e),d.prototype.processChunk=function(a){this.streamInfo.crc32=f(a.data,this.streamInfo.crc32||0),this.push(a)},b.exports=d},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(a,b,c){"use strict";function d(a){f.call(this,"DataLengthProbe for "+a),this.propName=a,this.withStreamInfo(a,0)}var e=a("../utils"),f=a("./GenericWorker");e.inherits(d,f),d.prototype.processChunk=function(a){if(a){var b=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=b+a.data.length}f.prototype.processChunk.call(this,a)},b.exports=d},{"../utils":32,"./GenericWorker":28}],27:[function(a,b,c){"use strict";function d(a){f.call(this,"DataWorker");var b=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,a.then(function(a){b.dataIsReady=!0,b.data=a,b.max=a&&a.length||0,b.type=e.getTypeOf(a),b.isPaused||b._tickAndRepeat()},function(a){b.error(a)})}var e=a("../utils"),f=a("./GenericWorker"),g=16384;e.inherits(d,f),d.prototype.cleanUp=function(){f.prototype.cleanUp.call(this),this.data=null},d.prototype.resume=function(){return!!f.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,e.delay(this._tickAndRepeat,[],this)),!0)},d.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(e.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},d.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var a=g,b=null,c=Math.min(this.max,this.index+a);if(this.index>=this.max)return this.end();switch(this.type){case"string":b=this.data.substring(this.index,c);break;case"uint8array":b=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":b=this.data.slice(this.index,c)}return this.index=c,this.push({data:b,meta:{percent:this.max?this.index/this.max*100:0}})},b.exports=d},{"../utils":32,"./GenericWorker":28}],28:[function(a,b,c){"use strict";function d(a){this.name=a||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}d.prototype={push:function(a){this.emit("data",a)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(a){this.emit("error",a)}return!0},error:function(a){return!this.isFinished&&(this.isPaused?this.generatedError=a:(this.isFinished=!0,this.emit("error",a),this.previous&&this.previous.error(a),this.cleanUp()),!0)},on:function(a,b){return this._listeners[a].push(b),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(a,b){if(this._listeners[a])for(var c=0;c "+a:a}},b.exports=d},{}],29:[function(a,b,c){"use strict";function d(a,b,c){switch(a){case"blob":return h.newBlob(h.transformTo("arraybuffer",b),c);case"base64":return k.encode(b);default:return h.transformTo(a,b)}}function e(a,b){var c,d=0,e=null,f=0;for(c=0;c=252?6:k>=248?5:k>=240?4:k>=224?3:k>=192?2:1;j[254]=j[254]=1;var l=function(a){var b,c,d,e,f,h=a.length,i=0;for(e=0;e>>6,b[f++]=128|63&c):c<65536?(b[f++]=224|c>>>12,b[f++]=128|c>>>6&63,b[f++]=128|63&c):(b[f++]=240|c>>>18,b[f++]=128|c>>>12&63,b[f++]=128|c>>>6&63,b[f++]=128|63&c);return b},m=function(a,b){var c;for(b=b||a.length,b>a.length&&(b=a.length),c=b-1;c>=0&&128===(192&a[c]);)c--;return c<0?b:0===c?b:c+j[a[c]]>b?c:b},n=function(a){var b,c,d,e,g=a.length,h=new Array(2*g);for(c=0,b=0;b4)h[c++]=65533,b+=e-1;else{for(d&=2===e?31:3===e?15:7;e>1&&b1?h[c++]=65533:d<65536?h[c++]=d:(d-=65536,h[c++]=55296|d>>10&1023,h[c++]=56320|1023&d)}return h.length!==c&&(h.subarray?h=h.subarray(0,c):h.length=c),f.applyFromCharCode(h)};c.utf8encode=function(a){return g.nodebuffer?h.newBufferFrom(a,"utf-8"):l(a)},c.utf8decode=function(a){return g.nodebuffer?f.transformTo("nodebuffer",a).toString("utf-8"):(a=f.transformTo(g.uint8array?"uint8array":"array",a),n(a))},f.inherits(d,i),d.prototype.processChunk=function(a){var b=f.transformTo(g.uint8array?"uint8array":"array",a.data);if(this.leftOver&&this.leftOver.length){if(g.uint8array){var d=b;b=new Uint8Array(d.length+this.leftOver.length),b.set(this.leftOver,0),b.set(d,this.leftOver.length)}else b=this.leftOver.concat(b);this.leftOver=null}var e=m(b),h=b;e!==b.length&&(g.uint8array?(h=b.subarray(0,e),this.leftOver=b.subarray(e,b.length)):(h=b.slice(0,e),this.leftOver=b.slice(e,b.length))),this.push({data:c.utf8decode(h),meta:a.meta})},d.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:c.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},c.Utf8DecodeWorker=d,f.inherits(e,i),e.prototype.processChunk=function(a){this.push({data:c.utf8encode(a.data),meta:a.meta})},c.Utf8EncodeWorker=e},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(a,b,c){"use strict";function d(a){var b=null;return b=i.uint8array?new Uint8Array(a.length):new Array(a.length),f(a,b)}function e(a){return a}function f(a,b){for(var c=0;c1;)try{return n.stringifyByChunk(a,d,b)}catch(f){b=Math.floor(b/2)}return n.stringifyByChar(a)}function h(a,b){for(var c=0;c1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var a,b;for(a=0;a0)this.isSignature(c,g.CENTRAL_FILE_HEADER)||(this.reader.zero=e);else if(e<0)throw new Error("Corrupted zip: missing "+Math.abs(e)+" bytes.")},prepareReader:function(a){this.reader=e(a)},load:function(a){this.prepareReader(a),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},b.exports=d},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utf8":31,"./utils":32,"./zipEntry":34}],34:[function(a,b,c){"use strict";function d(a,b){this.options=a,this.loadOptions=b}var e=a("./reader/readerFor"),f=a("./utils"),g=a("./compressedObject"),h=a("./crc32"),i=a("./utf8"),j=a("./compressions"),k=a("./support"),l=0,m=3,n=function(a){for(var b in j)if(j.hasOwnProperty(b)&&j[b].magic===a)return j[b];return null};d.prototype={isEncrypted:function(){return 1===(1&this.bitFlag)},useUTF8:function(){return 2048===(2048&this.bitFlag)},readLocalPart:function(a){var b,c;if(a.skip(22),this.fileNameLength=a.readInt(2),c=a.readInt(2),this.fileName=a.readData(this.fileNameLength),a.skip(c),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough informations from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(b=n(this.compressionMethod),null===b)throw new Error("Corrupted zip : compression "+f.pretty(this.compressionMethod)+" unknown (inner file : "+f.transformTo("string",this.fileName)+")");this.decompressed=new g(this.compressedSize,this.uncompressedSize,this.crc32,b,a.readData(this.compressedSize))},readCentralPart:function(a){this.versionMadeBy=a.readInt(2),a.skip(2),this.bitFlag=a.readInt(2),this.compressionMethod=a.readString(2),this.date=a.readDate(),this.crc32=a.readInt(4),this.compressedSize=a.readInt(4),this.uncompressedSize=a.readInt(4);var b=a.readInt(2);if(this.extraFieldsLength=a.readInt(2),this.fileCommentLength=a.readInt(2),this.diskNumberStart=a.readInt(2),this.internalFileAttributes=a.readInt(2),this.externalFileAttributes=a.readInt(4),this.localHeaderOffset=a.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");a.skip(b),this.readExtraFields(a),this.parseZIP64ExtraField(a),this.fileComment=a.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var a=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),a===l&&(this.dosPermissions=63&this.externalFileAttributes),a===m&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(a){if(this.extraFields[1]){var b=e(this.extraFields[1].value);this.uncompressedSize===f.MAX_VALUE_32BITS&&(this.uncompressedSize=b.readInt(8)),this.compressedSize===f.MAX_VALUE_32BITS&&(this.compressedSize=b.readInt(8)),this.localHeaderOffset===f.MAX_VALUE_32BITS&&(this.localHeaderOffset=b.readInt(8)),this.diskNumberStart===f.MAX_VALUE_32BITS&&(this.diskNumberStart=b.readInt(4))}},readExtraFields:function(a){var b,c,d,e=a.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});a.indexc;)b.push(arguments[c++]);return q[++p]=function(){h("function"==typeof a?a:Function(a),b)},d(p),p},n=function(a){delete q[a]},"process"==a("./_cof")(l)?d=function(a){l.nextTick(g(s,a,1))}:o?(e=new o,f=e.port2,e.port1.onmessage=t,d=g(f.postMessage,f,1)):k.addEventListener&&"function"==typeof postMessage&&!k.importScripts?(d=function(a){k.postMessage(a+"","*")},k.addEventListener("message",t,!1)):d=r in j("script")?function(a){i.appendChild(j("script"))[r]=function(){i.removeChild(this),s.call(a)}}:function(a){setTimeout(g(s,a,1),0)}),b.exports={set:m,clear:n}},{"./_cof":39,"./_ctx":41,"./_dom-create":43,"./_global":46,"./_html":48,"./_invoke":50}],55:[function(a,b,c){var d=a("./_is-object");b.exports=function(a,b){if(!d(a))return a;var c,e;if(b&&"function"==typeof(c=a.toString)&&!d(e=c.call(a)))return e;if("function"==typeof(c=a.valueOf)&&!d(e=c.call(a)))return e;if(!b&&"function"==typeof(c=a.toString)&&!d(e=c.call(a)))return e;throw TypeError("Can't convert object to primitive value")}},{"./_is-object":51}],56:[function(a,b,c){var d=a("./_export"),e=a("./_task");d(d.G+d.B,{setImmediate:e.set,clearImmediate:e.clear})},{"./_export":44,"./_task":54}],57:[function(a,b,c){(function(a){"use strict";function c(){k=!0;for(var a,b,c=l.length;c;){for(b=l,l=[],a=-1;++a0?b.windowBits=-b.windowBits:b.gzip&&b.windowBits>0&&b.windowBits<16&&(b.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var c=h.deflateInit2(this.strm,b.level,b.method,b.windowBits,b.memLevel,b.strategy);if(c!==p)throw new Error(k[c]);if(b.header&&h.deflateSetHeader(this.strm,b.header),b.dictionary){var e;if(e="string"==typeof b.dictionary?j.string2buf(b.dictionary):"[object ArrayBuffer]"===m.call(b.dictionary)?new Uint8Array(b.dictionary):b.dictionary,c=h.deflateSetDictionary(this.strm,e),c!==p)throw new Error(k[c]);this._dict_set=!0}}function e(a,b){var c=new d(b);if(c.push(a,!0),c.err)throw c.msg||k[c.err];return c.result}function f(a,b){return b=b||{},b.raw=!0,e(a,b)}function g(a,b){return b=b||{},b.gzip=!0,e(a,b)}var h=a("./zlib/deflate"),i=a("./utils/common"),j=a("./utils/strings"),k=a("./zlib/messages"),l=a("./zlib/zstream"),m=Object.prototype.toString,n=0,o=4,p=0,q=1,r=2,s=-1,t=0,u=8;d.prototype.push=function(a,b){var c,d,e=this.strm,f=this.options.chunkSize;if(this.ended)return!1;d=b===~~b?b:b===!0?o:n,"string"==typeof a?e.input=j.string2buf(a):"[object ArrayBuffer]"===m.call(a)?e.input=new Uint8Array(a):e.input=a,e.next_in=0,e.avail_in=e.input.length;do{if(0===e.avail_out&&(e.output=new i.Buf8(f),e.next_out=0,e.avail_out=f),c=h.deflate(e,d),c!==q&&c!==p)return this.onEnd(c),this.ended=!0,!1;0!==e.avail_out&&(0!==e.avail_in||d!==o&&d!==r)||("string"===this.options.to?this.onData(j.buf2binstring(i.shrinkBuf(e.output,e.next_out))):this.onData(i.shrinkBuf(e.output,e.next_out)))}while((e.avail_in>0||0===e.avail_out)&&c!==q);return d===o?(c=h.deflateEnd(this.strm),this.onEnd(c),this.ended=!0,c===p):d!==r||(this.onEnd(p),e.avail_out=0,!0)},d.prototype.onData=function(a){this.chunks.push(a)},d.prototype.onEnd=function(a){a===p&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=a,this.msg=this.strm.msg},c.Deflate=d,c.deflate=e,c.deflateRaw=f,c.gzip=g},{"./utils/common":62,"./utils/strings":63,"./zlib/deflate":67,"./zlib/messages":72,"./zlib/zstream":74}],61:[function(a,b,c){"use strict";function d(a){if(!(this instanceof d))return new d(a);this.options=h.assign({chunkSize:16384,windowBits:0,to:""},a||{});var b=this.options;b.raw&&b.windowBits>=0&&b.windowBits<16&&(b.windowBits=-b.windowBits,0===b.windowBits&&(b.windowBits=-15)),!(b.windowBits>=0&&b.windowBits<16)||a&&a.windowBits||(b.windowBits+=32),b.windowBits>15&&b.windowBits<48&&0===(15&b.windowBits)&&(b.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var c=g.inflateInit2(this.strm,b.windowBits);if(c!==j.Z_OK)throw new Error(k[c]);this.header=new m,g.inflateGetHeader(this.strm,this.header)}function e(a,b){var c=new d(b);if(c.push(a,!0),c.err)throw c.msg||k[c.err];return c.result}function f(a,b){return b=b||{},b.raw=!0,e(a,b)}var g=a("./zlib/inflate"),h=a("./utils/common"),i=a("./utils/strings"),j=a("./zlib/constants"),k=a("./zlib/messages"),l=a("./zlib/zstream"),m=a("./zlib/gzheader"),n=Object.prototype.toString;d.prototype.push=function(a,b){var c,d,e,f,k,l,m=this.strm,o=this.options.chunkSize,p=this.options.dictionary,q=!1;if(this.ended)return!1;d=b===~~b?b:b===!0?j.Z_FINISH:j.Z_NO_FLUSH,"string"==typeof a?m.input=i.binstring2buf(a):"[object ArrayBuffer]"===n.call(a)?m.input=new Uint8Array(a):m.input=a,m.next_in=0,m.avail_in=m.input.length;do{if(0===m.avail_out&&(m.output=new h.Buf8(o),m.next_out=0,m.avail_out=o),c=g.inflate(m,j.Z_NO_FLUSH),c===j.Z_NEED_DICT&&p&&(l="string"==typeof p?i.string2buf(p):"[object ArrayBuffer]"===n.call(p)?new Uint8Array(p):p,c=g.inflateSetDictionary(this.strm,l)),c===j.Z_BUF_ERROR&&q===!0&&(c=j.Z_OK,q=!1),c!==j.Z_STREAM_END&&c!==j.Z_OK)return this.onEnd(c),this.ended=!0,!1;m.next_out&&(0!==m.avail_out&&c!==j.Z_STREAM_END&&(0!==m.avail_in||d!==j.Z_FINISH&&d!==j.Z_SYNC_FLUSH)||("string"===this.options.to?(e=i.utf8border(m.output,m.next_out),f=m.next_out-e,k=i.buf2string(m.output,e),m.next_out=f,m.avail_out=o-f,f&&h.arraySet(m.output,m.output,e,f,0),this.onData(k)):this.onData(h.shrinkBuf(m.output,m.next_out)))),0===m.avail_in&&0===m.avail_out&&(q=!0)}while((m.avail_in>0||0===m.avail_out)&&c!==j.Z_STREAM_END);return c===j.Z_STREAM_END&&(d=j.Z_FINISH),d===j.Z_FINISH?(c=g.inflateEnd(this.strm),this.onEnd(c),this.ended=!0,c===j.Z_OK):d!==j.Z_SYNC_FLUSH||(this.onEnd(j.Z_OK),m.avail_out=0,!0)},d.prototype.onData=function(a){this.chunks.push(a)},d.prototype.onEnd=function(a){a===j.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=h.flattenChunks(this.chunks)),this.chunks=[],this.err=a,this.msg=this.strm.msg},c.Inflate=d,c.inflate=e,c.inflateRaw=f,c.ungzip=e},{"./utils/common":62,"./utils/strings":63,"./zlib/constants":65,"./zlib/gzheader":68,"./zlib/inflate":70,"./zlib/messages":72,"./zlib/zstream":74}],62:[function(a,b,c){"use strict";var d="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;c.assign=function(a){for(var b=Array.prototype.slice.call(arguments,1);b.length;){var c=b.shift();if(c){if("object"!=typeof c)throw new TypeError(c+"must be non-object");for(var d in c)c.hasOwnProperty(d)&&(a[d]=c[d])}}return a},c.shrinkBuf=function(a,b){return a.length===b?a:a.subarray?a.subarray(0,b):(a.length=b,a)};var e={arraySet:function(a,b,c,d,e){if(b.subarray&&a.subarray)return void a.set(b.subarray(c,c+d),e);for(var f=0;f=252?6:j>=248?5:j>=240?4:j>=224?3:j>=192?2:1;i[254]=i[254]=1,c.string2buf=function(a){var b,c,d,f,g,h=a.length,i=0;for(f=0;f>>6,b[g++]=128|63&c):c<65536?(b[g++]=224|c>>>12,b[g++]=128|c>>>6&63,b[g++]=128|63&c):(b[g++]=240|c>>>18,b[g++]=128|c>>>12&63,b[g++]=128|c>>>6&63,b[g++]=128|63&c);return b},c.buf2binstring=function(a){return d(a,a.length)},c.binstring2buf=function(a){for(var b=new e.Buf8(a.length),c=0,d=b.length;c4)j[e++]=65533,c+=g-1;else{for(f&=2===g?31:3===g?15:7;g>1&&c1?j[e++]=65533:f<65536?j[e++]=f:(f-=65536,j[e++]=55296|f>>10&1023,j[e++]=56320|1023&f)}return d(j,e)},c.utf8border=function(a,b){var c;for(b=b||a.length,b>a.length&&(b=a.length),c=b-1;c>=0&&128===(192&a[c]);)c--;return c<0?b:0===c?b:c+i[a[c]]>b?c:b}},{"./common":62}],64:[function(a,b,c){"use strict";function d(a,b,c,d){for(var e=65535&a|0,f=a>>>16&65535|0,g=0;0!==c;){g=c>2e3?2e3:c,c-=g;do e=e+b[d++]|0,f=f+e|0;while(--g);e%=65521,f%=65521}return e|f<<16|0; -}b.exports=d},{}],65:[function(a,b,c){"use strict";b.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],66:[function(a,b,c){"use strict";function d(){for(var a,b=[],c=0;c<256;c++){a=c;for(var d=0;d<8;d++)a=1&a?3988292384^a>>>1:a>>>1;b[c]=a}return b}function e(a,b,c,d){var e=f,g=d+c;a^=-1;for(var h=d;h>>8^e[255&(a^b[h])];return a^-1}var f=d();b.exports=e},{}],67:[function(a,b,c){"use strict";function d(a,b){return a.msg=I[b],b}function e(a){return(a<<1)-(a>4?9:0)}function f(a){for(var b=a.length;--b>=0;)a[b]=0}function g(a){var b=a.state,c=b.pending;c>a.avail_out&&(c=a.avail_out),0!==c&&(E.arraySet(a.output,b.pending_buf,b.pending_out,c,a.next_out),a.next_out+=c,b.pending_out+=c,a.total_out+=c,a.avail_out-=c,b.pending-=c,0===b.pending&&(b.pending_out=0))}function h(a,b){F._tr_flush_block(a,a.block_start>=0?a.block_start:-1,a.strstart-a.block_start,b),a.block_start=a.strstart,g(a.strm)}function i(a,b){a.pending_buf[a.pending++]=b}function j(a,b){a.pending_buf[a.pending++]=b>>>8&255,a.pending_buf[a.pending++]=255&b}function k(a,b,c,d){var e=a.avail_in;return e>d&&(e=d),0===e?0:(a.avail_in-=e,E.arraySet(b,a.input,a.next_in,e,c),1===a.state.wrap?a.adler=G(a.adler,b,e,c):2===a.state.wrap&&(a.adler=H(a.adler,b,e,c)),a.next_in+=e,a.total_in+=e,e)}function l(a,b){var c,d,e=a.max_chain_length,f=a.strstart,g=a.prev_length,h=a.nice_match,i=a.strstart>a.w_size-la?a.strstart-(a.w_size-la):0,j=a.window,k=a.w_mask,l=a.prev,m=a.strstart+ka,n=j[f+g-1],o=j[f+g];a.prev_length>=a.good_match&&(e>>=2),h>a.lookahead&&(h=a.lookahead);do if(c=b,j[c+g]===o&&j[c+g-1]===n&&j[c]===j[f]&&j[++c]===j[f+1]){f+=2,c++;do;while(j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&fg){if(a.match_start=b,g=d,d>=h)break;n=j[f+g-1],o=j[f+g]}}while((b=l[b&k])>i&&0!==--e);return g<=a.lookahead?g:a.lookahead}function m(a){var b,c,d,e,f,g=a.w_size;do{if(e=a.window_size-a.lookahead-a.strstart,a.strstart>=g+(g-la)){E.arraySet(a.window,a.window,g,g,0),a.match_start-=g,a.strstart-=g,a.block_start-=g,c=a.hash_size,b=c;do d=a.head[--b],a.head[b]=d>=g?d-g:0;while(--c);c=g,b=c;do d=a.prev[--b],a.prev[b]=d>=g?d-g:0;while(--c);e+=g}if(0===a.strm.avail_in)break;if(c=k(a.strm,a.window,a.strstart+a.lookahead,e),a.lookahead+=c,a.lookahead+a.insert>=ja)for(f=a.strstart-a.insert,a.ins_h=a.window[f],a.ins_h=(a.ins_h<a.pending_buf_size-5&&(c=a.pending_buf_size-5);;){if(a.lookahead<=1){if(m(a),0===a.lookahead&&b===J)return ua;if(0===a.lookahead)break}a.strstart+=a.lookahead,a.lookahead=0;var d=a.block_start+c;if((0===a.strstart||a.strstart>=d)&&(a.lookahead=a.strstart-d,a.strstart=d,h(a,!1),0===a.strm.avail_out))return ua;if(a.strstart-a.block_start>=a.w_size-la&&(h(a,!1),0===a.strm.avail_out))return ua}return a.insert=0,b===M?(h(a,!0),0===a.strm.avail_out?wa:xa):a.strstart>a.block_start&&(h(a,!1),0===a.strm.avail_out)?ua:ua}function o(a,b){for(var c,d;;){if(a.lookahead=ja&&(a.ins_h=(a.ins_h<=ja)if(d=F._tr_tally(a,a.strstart-a.match_start,a.match_length-ja),a.lookahead-=a.match_length,a.match_length<=a.max_lazy_match&&a.lookahead>=ja){a.match_length--;do a.strstart++,a.ins_h=(a.ins_h<=ja&&(a.ins_h=(a.ins_h<4096)&&(a.match_length=ja-1)),a.prev_length>=ja&&a.match_length<=a.prev_length){e=a.strstart+a.lookahead-ja,d=F._tr_tally(a,a.strstart-1-a.prev_match,a.prev_length-ja),a.lookahead-=a.prev_length-1,a.prev_length-=2;do++a.strstart<=e&&(a.ins_h=(a.ins_h<=ja&&a.strstart>0&&(e=a.strstart-1,d=g[e],d===g[++e]&&d===g[++e]&&d===g[++e])){f=a.strstart+ka;do;while(d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&ea.lookahead&&(a.match_length=a.lookahead)}if(a.match_length>=ja?(c=F._tr_tally(a,1,a.match_length-ja),a.lookahead-=a.match_length,a.strstart+=a.match_length,a.match_length=0):(c=F._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++),c&&(h(a,!1),0===a.strm.avail_out))return ua}return a.insert=0,b===M?(h(a,!0),0===a.strm.avail_out?wa:xa):a.last_lit&&(h(a,!1),0===a.strm.avail_out)?ua:va}function r(a,b){for(var c;;){if(0===a.lookahead&&(m(a),0===a.lookahead)){if(b===J)return ua;break}if(a.match_length=0,c=F._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++,c&&(h(a,!1),0===a.strm.avail_out))return ua}return a.insert=0,b===M?(h(a,!0),0===a.strm.avail_out?wa:xa):a.last_lit&&(h(a,!1),0===a.strm.avail_out)?ua:va}function s(a,b,c,d,e){this.good_length=a,this.max_lazy=b,this.nice_length=c,this.max_chain=d,this.func=e}function t(a){a.window_size=2*a.w_size,f(a.head),a.max_lazy_match=D[a.level].max_lazy,a.good_match=D[a.level].good_length,a.nice_match=D[a.level].nice_length,a.max_chain_length=D[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=ja-1,a.match_available=0,a.ins_h=0}function u(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=$,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new E.Buf16(2*ha),this.dyn_dtree=new E.Buf16(2*(2*fa+1)),this.bl_tree=new E.Buf16(2*(2*ga+1)),f(this.dyn_ltree),f(this.dyn_dtree),f(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new E.Buf16(ia+1),this.heap=new E.Buf16(2*ea+1),f(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new E.Buf16(2*ea+1),f(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function v(a){var b;return a&&a.state?(a.total_in=a.total_out=0,a.data_type=Z,b=a.state,b.pending=0,b.pending_out=0,b.wrap<0&&(b.wrap=-b.wrap),b.status=b.wrap?na:sa,a.adler=2===b.wrap?0:1,b.last_flush=J,F._tr_init(b),O):d(a,Q)}function w(a){var b=v(a);return b===O&&t(a.state),b}function x(a,b){return a&&a.state?2!==a.state.wrap?Q:(a.state.gzhead=b,O):Q}function y(a,b,c,e,f,g){if(!a)return Q;var h=1;if(b===T&&(b=6),e<0?(h=0,e=-e):e>15&&(h=2,e-=16),f<1||f>_||c!==$||e<8||e>15||b<0||b>9||g<0||g>X)return d(a,Q);8===e&&(e=9);var i=new u;return a.state=i,i.strm=a,i.wrap=h,i.gzhead=null,i.w_bits=e,i.w_size=1<N||b<0)return a?d(a,Q):Q;if(h=a.state,!a.output||!a.input&&0!==a.avail_in||h.status===ta&&b!==M)return d(a,0===a.avail_out?S:Q);if(h.strm=a,c=h.last_flush,h.last_flush=b,h.status===na)if(2===h.wrap)a.adler=0,i(h,31),i(h,139),i(h,8),h.gzhead?(i(h,(h.gzhead.text?1:0)+(h.gzhead.hcrc?2:0)+(h.gzhead.extra?4:0)+(h.gzhead.name?8:0)+(h.gzhead.comment?16:0)),i(h,255&h.gzhead.time),i(h,h.gzhead.time>>8&255),i(h,h.gzhead.time>>16&255),i(h,h.gzhead.time>>24&255),i(h,9===h.level?2:h.strategy>=V||h.level<2?4:0),i(h,255&h.gzhead.os),h.gzhead.extra&&h.gzhead.extra.length&&(i(h,255&h.gzhead.extra.length),i(h,h.gzhead.extra.length>>8&255)),h.gzhead.hcrc&&(a.adler=H(a.adler,h.pending_buf,h.pending,0)),h.gzindex=0,h.status=oa):(i(h,0),i(h,0),i(h,0),i(h,0),i(h,0),i(h,9===h.level?2:h.strategy>=V||h.level<2?4:0),i(h,ya),h.status=sa);else{var m=$+(h.w_bits-8<<4)<<8,n=-1;n=h.strategy>=V||h.level<2?0:h.level<6?1:6===h.level?2:3,m|=n<<6,0!==h.strstart&&(m|=ma),m+=31-m%31,h.status=sa,j(h,m),0!==h.strstart&&(j(h,a.adler>>>16),j(h,65535&a.adler)),a.adler=1}if(h.status===oa)if(h.gzhead.extra){for(k=h.pending;h.gzindex<(65535&h.gzhead.extra.length)&&(h.pending!==h.pending_buf_size||(h.gzhead.hcrc&&h.pending>k&&(a.adler=H(a.adler,h.pending_buf,h.pending-k,k)),g(a),k=h.pending,h.pending!==h.pending_buf_size));)i(h,255&h.gzhead.extra[h.gzindex]),h.gzindex++;h.gzhead.hcrc&&h.pending>k&&(a.adler=H(a.adler,h.pending_buf,h.pending-k,k)),h.gzindex===h.gzhead.extra.length&&(h.gzindex=0,h.status=pa)}else h.status=pa;if(h.status===pa)if(h.gzhead.name){k=h.pending;do{if(h.pending===h.pending_buf_size&&(h.gzhead.hcrc&&h.pending>k&&(a.adler=H(a.adler,h.pending_buf,h.pending-k,k)),g(a),k=h.pending,h.pending===h.pending_buf_size)){l=1;break}l=h.gzindexk&&(a.adler=H(a.adler,h.pending_buf,h.pending-k,k)),0===l&&(h.gzindex=0,h.status=qa)}else h.status=qa;if(h.status===qa)if(h.gzhead.comment){k=h.pending;do{if(h.pending===h.pending_buf_size&&(h.gzhead.hcrc&&h.pending>k&&(a.adler=H(a.adler,h.pending_buf,h.pending-k,k)),g(a),k=h.pending,h.pending===h.pending_buf_size)){l=1;break}l=h.gzindexk&&(a.adler=H(a.adler,h.pending_buf,h.pending-k,k)),0===l&&(h.status=ra)}else h.status=ra;if(h.status===ra&&(h.gzhead.hcrc?(h.pending+2>h.pending_buf_size&&g(a),h.pending+2<=h.pending_buf_size&&(i(h,255&a.adler),i(h,a.adler>>8&255),a.adler=0,h.status=sa)):h.status=sa),0!==h.pending){if(g(a),0===a.avail_out)return h.last_flush=-1,O}else if(0===a.avail_in&&e(b)<=e(c)&&b!==M)return d(a,S);if(h.status===ta&&0!==a.avail_in)return d(a,S);if(0!==a.avail_in||0!==h.lookahead||b!==J&&h.status!==ta){var o=h.strategy===V?r(h,b):h.strategy===W?q(h,b):D[h.level].func(h,b);if(o!==wa&&o!==xa||(h.status=ta),o===ua||o===wa)return 0===a.avail_out&&(h.last_flush=-1),O;if(o===va&&(b===K?F._tr_align(h):b!==N&&(F._tr_stored_block(h,0,0,!1),b===L&&(f(h.head),0===h.lookahead&&(h.strstart=0,h.block_start=0,h.insert=0))),g(a),0===a.avail_out))return h.last_flush=-1,O}return b!==M?O:h.wrap<=0?P:(2===h.wrap?(i(h,255&a.adler),i(h,a.adler>>8&255),i(h,a.adler>>16&255),i(h,a.adler>>24&255),i(h,255&a.total_in),i(h,a.total_in>>8&255),i(h,a.total_in>>16&255),i(h,a.total_in>>24&255)):(j(h,a.adler>>>16),j(h,65535&a.adler)),g(a),h.wrap>0&&(h.wrap=-h.wrap),0!==h.pending?O:P)}function B(a){var b;return a&&a.state?(b=a.state.status,b!==na&&b!==oa&&b!==pa&&b!==qa&&b!==ra&&b!==sa&&b!==ta?d(a,Q):(a.state=null,b===sa?d(a,R):O)):Q}function C(a,b){var c,d,e,g,h,i,j,k,l=b.length;if(!a||!a.state)return Q;if(c=a.state,g=c.wrap,2===g||1===g&&c.status!==na||c.lookahead)return Q;for(1===g&&(a.adler=G(a.adler,b,l,0)),c.wrap=0,l>=c.w_size&&(0===g&&(f(c.head),c.strstart=0,c.block_start=0,c.insert=0),k=new E.Buf8(c.w_size),E.arraySet(k,b,l-c.w_size,c.w_size,0),b=k,l=c.w_size),h=a.avail_in,i=a.next_in,j=a.input,a.avail_in=l,a.next_in=0,a.input=b,m(c);c.lookahead>=ja;){d=c.strstart,e=c.lookahead-(ja-1);do c.ins_h=(c.ins_h<>>24,p>>>=w,q-=w,w=v>>>16&255,0===w)C[h++]=65535&v;else{if(!(16&w)){if(0===(64&w)){v=r[(65535&v)+(p&(1<>>=w,q-=w),q<15&&(p+=B[f++]<>>24,p>>>=w,q-=w,w=v>>>16&255,!(16&w)){if(0===(64&w)){v=s[(65535&v)+(p&(1<k){a.msg="invalid distance too far back",c.mode=d;break a}if(p>>>=w,q-=w,w=h-i,y>w){if(w=y-w,w>m&&c.sane){a.msg="invalid distance too far back",c.mode=d;break a}if(z=0,A=o,0===n){if(z+=l-w,w2;)C[h++]=A[z++],C[h++]=A[z++],C[h++]=A[z++],x-=3;x&&(C[h++]=A[z++],x>1&&(C[h++]=A[z++]))}else{z=h-y;do C[h++]=C[z++],C[h++]=C[z++],C[h++]=C[z++],x-=3;while(x>2);x&&(C[h++]=C[z++],x>1&&(C[h++]=C[z++]))}break}}break}}while(f>3,f-=x,q-=x<<3,p&=(1<>>24&255)+(a>>>8&65280)+((65280&a)<<8)+((255&a)<<24)}function e(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new s.Buf16(320),this.work=new s.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function f(a){var b;return a&&a.state?(b=a.state,a.total_in=a.total_out=b.total=0,a.msg="",b.wrap&&(a.adler=1&b.wrap),b.mode=L,b.last=0,b.havedict=0,b.dmax=32768,b.head=null,b.hold=0,b.bits=0,b.lencode=b.lendyn=new s.Buf32(pa),b.distcode=b.distdyn=new s.Buf32(qa),b.sane=1,b.back=-1,D):G}function g(a){var b;return a&&a.state?(b=a.state,b.wsize=0,b.whave=0,b.wnext=0,f(a)):G}function h(a,b){var c,d;return a&&a.state?(d=a.state,b<0?(c=0,b=-b):(c=(b>>4)+1,b<48&&(b&=15)),b&&(b<8||b>15)?G:(null!==d.window&&d.wbits!==b&&(d.window=null),d.wrap=c,d.wbits=b,g(a))):G}function i(a,b){var c,d;return a?(d=new e,a.state=d,d.window=null,c=h(a,b),c!==D&&(a.state=null),c):G}function j(a){return i(a,sa)}function k(a){if(ta){var b;for(q=new s.Buf32(512),r=new s.Buf32(32),b=0;b<144;)a.lens[b++]=8;for(;b<256;)a.lens[b++]=9;for(;b<280;)a.lens[b++]=7;for(;b<288;)a.lens[b++]=8;for(w(y,a.lens,0,288,q,0,a.work,{bits:9}),b=0;b<32;)a.lens[b++]=5;w(z,a.lens,0,32,r,0,a.work,{bits:5}),ta=!1}a.lencode=q,a.lenbits=9,a.distcode=r,a.distbits=5}function l(a,b,c,d){var e,f=a.state;return null===f.window&&(f.wsize=1<=f.wsize?(s.arraySet(f.window,b,c-f.wsize,f.wsize,0),f.wnext=0,f.whave=f.wsize):(e=f.wsize-f.wnext,e>d&&(e=d),s.arraySet(f.window,b,c-d,e,f.wnext),d-=e,d?(s.arraySet(f.window,b,c-d,d,0),f.wnext=d,f.whave=f.wsize):(f.wnext+=e,f.wnext===f.wsize&&(f.wnext=0),f.whave>>8&255,c.check=u(c.check,Ba,2,0),m=0,n=0,c.mode=M;break}if(c.flags=0,c.head&&(c.head.done=!1),!(1&c.wrap)||(((255&m)<<8)+(m>>8))%31){a.msg="incorrect header check",c.mode=ma;break}if((15&m)!==K){a.msg="unknown compression method",c.mode=ma;break}if(m>>>=4,n-=4,wa=(15&m)+8,0===c.wbits)c.wbits=wa;else if(wa>c.wbits){a.msg="invalid window size",c.mode=ma;break}c.dmax=1<>8&1),512&c.flags&&(Ba[0]=255&m,Ba[1]=m>>>8&255,c.check=u(c.check,Ba,2,0)),m=0,n=0,c.mode=N;case N:for(;n<32;){if(0===i)break a;i--,m+=e[g++]<>>8&255,Ba[2]=m>>>16&255,Ba[3]=m>>>24&255,c.check=u(c.check,Ba,4,0)),m=0,n=0,c.mode=O;case O:for(;n<16;){if(0===i)break a;i--,m+=e[g++]<>8),512&c.flags&&(Ba[0]=255&m,Ba[1]=m>>>8&255,c.check=u(c.check,Ba,2,0)),m=0,n=0,c.mode=P;case P:if(1024&c.flags){for(;n<16;){if(0===i)break a;i--,m+=e[g++]<>>8&255,c.check=u(c.check,Ba,2,0)),m=0,n=0}else c.head&&(c.head.extra=null);c.mode=Q;case Q:if(1024&c.flags&&(q=c.length,q>i&&(q=i),q&&(c.head&&(wa=c.head.extra_len-c.length,c.head.extra||(c.head.extra=new Array(c.head.extra_len)),s.arraySet(c.head.extra,e,g,q,wa)),512&c.flags&&(c.check=u(c.check,e,q,g)),i-=q,g+=q,c.length-=q),c.length))break a;c.length=0,c.mode=R;case R:if(2048&c.flags){if(0===i)break a;q=0;do wa=e[g+q++],c.head&&wa&&c.length<65536&&(c.head.name+=String.fromCharCode(wa));while(wa&&q>9&1,c.head.done=!0),a.adler=c.check=0,c.mode=W;break;case U:for(;n<32;){if(0===i)break a;i--,m+=e[g++]<>>=7&n,n-=7&n,c.mode=ja;break}for(;n<3;){if(0===i)break a;i--,m+=e[g++]<>>=1,n-=1,3&m){case 0:c.mode=Y;break;case 1:if(k(c),c.mode=ca,b===C){m>>>=2,n-=2;break a}break;case 2:c.mode=_;break;case 3:a.msg="invalid block type",c.mode=ma}m>>>=2,n-=2;break;case Y:for(m>>>=7&n,n-=7&n;n<32;){if(0===i)break a;i--,m+=e[g++]<>>16^65535)){a.msg="invalid stored block lengths",c.mode=ma;break}if(c.length=65535&m,m=0,n=0,c.mode=Z,b===C)break a;case Z:c.mode=$;case $:if(q=c.length){if(q>i&&(q=i),q>j&&(q=j),0===q)break a;s.arraySet(f,e,g,q,h),i-=q,g+=q,j-=q,h+=q,c.length-=q;break}c.mode=W;break;case _:for(;n<14;){if(0===i)break a;i--,m+=e[g++]<>>=5,n-=5,c.ndist=(31&m)+1,m>>>=5,n-=5,c.ncode=(15&m)+4,m>>>=4,n-=4,c.nlen>286||c.ndist>30){a.msg="too many length or distance symbols",c.mode=ma;break}c.have=0,c.mode=aa;case aa:for(;c.have>>=3,n-=3}for(;c.have<19;)c.lens[Ca[c.have++]]=0;if(c.lencode=c.lendyn,c.lenbits=7,ya={bits:c.lenbits},xa=w(x,c.lens,0,19,c.lencode,0,c.work,ya),c.lenbits=ya.bits,xa){a.msg="invalid code lengths set",c.mode=ma;break}c.have=0,c.mode=ba;case ba:for(;c.have>>24,ra=Aa>>>16&255,sa=65535&Aa,!(qa<=n);){if(0===i)break a;i--,m+=e[g++]<>>=qa,n-=qa,c.lens[c.have++]=sa;else{if(16===sa){for(za=qa+2;n>>=qa,n-=qa,0===c.have){a.msg="invalid bit length repeat",c.mode=ma;break}wa=c.lens[c.have-1],q=3+(3&m),m>>>=2,n-=2}else if(17===sa){for(za=qa+3;n>>=qa,n-=qa,wa=0,q=3+(7&m),m>>>=3,n-=3}else{for(za=qa+7;n>>=qa,n-=qa,wa=0,q=11+(127&m),m>>>=7,n-=7}if(c.have+q>c.nlen+c.ndist){a.msg="invalid bit length repeat",c.mode=ma;break}for(;q--;)c.lens[c.have++]=wa}}if(c.mode===ma)break;if(0===c.lens[256]){a.msg="invalid code -- missing end-of-block",c.mode=ma;break}if(c.lenbits=9,ya={bits:c.lenbits},xa=w(y,c.lens,0,c.nlen,c.lencode,0,c.work,ya),c.lenbits=ya.bits,xa){a.msg="invalid literal/lengths set",c.mode=ma;break}if(c.distbits=6,c.distcode=c.distdyn,ya={bits:c.distbits},xa=w(z,c.lens,c.nlen,c.ndist,c.distcode,0,c.work,ya),c.distbits=ya.bits,xa){a.msg="invalid distances set",c.mode=ma;break}if(c.mode=ca,b===C)break a;case ca:c.mode=da;case da:if(i>=6&&j>=258){a.next_out=h,a.avail_out=j,a.next_in=g,a.avail_in=i,c.hold=m,c.bits=n,v(a,p),h=a.next_out,f=a.output,j=a.avail_out,g=a.next_in,e=a.input,i=a.avail_in,m=c.hold,n=c.bits,c.mode===W&&(c.back=-1);break}for(c.back=0;Aa=c.lencode[m&(1<>>24,ra=Aa>>>16&255,sa=65535&Aa,!(qa<=n);){if(0===i)break a;i--,m+=e[g++]<>ta)],qa=Aa>>>24,ra=Aa>>>16&255,sa=65535&Aa,!(ta+qa<=n);){if(0===i)break a;i--,m+=e[g++]<>>=ta,n-=ta,c.back+=ta}if(m>>>=qa,n-=qa,c.back+=qa,c.length=sa,0===ra){c.mode=ia;break}if(32&ra){c.back=-1,c.mode=W;break}if(64&ra){a.msg="invalid literal/length code",c.mode=ma;break}c.extra=15&ra,c.mode=ea;case ea:if(c.extra){for(za=c.extra;n>>=c.extra,n-=c.extra,c.back+=c.extra}c.was=c.length,c.mode=fa;case fa:for(;Aa=c.distcode[m&(1<>>24,ra=Aa>>>16&255,sa=65535&Aa,!(qa<=n);){if(0===i)break a;i--,m+=e[g++]<>ta)],qa=Aa>>>24,ra=Aa>>>16&255,sa=65535&Aa,!(ta+qa<=n);){if(0===i)break a;i--,m+=e[g++]<>>=ta,n-=ta,c.back+=ta}if(m>>>=qa,n-=qa,c.back+=qa,64&ra){a.msg="invalid distance code",c.mode=ma;break}c.offset=sa,c.extra=15&ra,c.mode=ga;case ga:if(c.extra){for(za=c.extra;n>>=c.extra,n-=c.extra,c.back+=c.extra}if(c.offset>c.dmax){a.msg="invalid distance too far back",c.mode=ma;break}c.mode=ha;case ha:if(0===j)break a;if(q=p-j,c.offset>q){if(q=c.offset-q,q>c.whave&&c.sane){a.msg="invalid distance too far back",c.mode=ma;break}q>c.wnext?(q-=c.wnext,r=c.wsize-q):r=c.wnext-q,q>c.length&&(q=c.length),pa=c.window}else pa=f,r=h-c.offset,q=c.length;q>j&&(q=j),j-=q,c.length-=q;do f[h++]=pa[r++];while(--q);0===c.length&&(c.mode=da);break;case ia:if(0===j)break a;f[h++]=c.length,j--,c.mode=da;break;case ja:if(c.wrap){for(;n<32;){if(0===i)break a;i--,m|=e[g++]<=1&&0===P[G];G--);if(H>G&&(H=G),0===G)return p[q++]=20971520,p[q++]=20971520,s.bits=1,0;for(F=1;F0&&(a===h||1!==G))return-1;for(Q[1]=0,D=1;Df||a===j&&L>g)return 1;for(;;){z=D-J,r[E]y?(A=R[S+r[E]],B=N[O+r[E]]):(A=96,B=0),t=1<>J)+u]=z<<24|A<<16|B|0;while(0!==u);for(t=1<>=1;if(0!==t?(M&=t-1,M+=t):M=0,E++,0===--P[D]){if(D===G)break;D=b[c+r[E]]}if(D>H&&(M&w)!==v){for(0===J&&(J=H),x+=F,I=D-J,K=1<f||a===j&&L>g)return 1;v=M&w,p[v]=H<<24|I<<16|x-q|0}}return 0!==M&&(p[x+M]=D-J<<24|64<<16|0),s.bits=H,0}},{"../utils/common":62}],72:[function(a,b,c){"use strict";b.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],73:[function(a,b,c){"use strict";function d(a){for(var b=a.length;--b>=0;)a[b]=0}function e(a,b,c,d,e){this.static_tree=a,this.extra_bits=b,this.extra_base=c,this.elems=d,this.max_length=e,this.has_stree=a&&a.length}function f(a,b){this.dyn_tree=a,this.max_code=0,this.stat_desc=b}function g(a){return a<256?ia[a]:ia[256+(a>>>7)]}function h(a,b){a.pending_buf[a.pending++]=255&b,a.pending_buf[a.pending++]=b>>>8&255}function i(a,b,c){a.bi_valid>X-c?(a.bi_buf|=b<>X-a.bi_valid,a.bi_valid+=c-X):(a.bi_buf|=b<>>=1,c<<=1;while(--b>0);return c>>>1}function l(a){16===a.bi_valid?(h(a,a.bi_buf),a.bi_buf=0,a.bi_valid=0):a.bi_valid>=8&&(a.pending_buf[a.pending++]=255&a.bi_buf,a.bi_buf>>=8,a.bi_valid-=8)}function m(a,b){var c,d,e,f,g,h,i=b.dyn_tree,j=b.max_code,k=b.stat_desc.static_tree,l=b.stat_desc.has_stree,m=b.stat_desc.extra_bits,n=b.stat_desc.extra_base,o=b.stat_desc.max_length,p=0;for(f=0;f<=W;f++)a.bl_count[f]=0;for(i[2*a.heap[a.heap_max]+1]=0, -c=a.heap_max+1;co&&(f=o,p++),i[2*d+1]=f,d>j||(a.bl_count[f]++,g=0,d>=n&&(g=m[d-n]),h=i[2*d],a.opt_len+=h*(f+g),l&&(a.static_len+=h*(k[2*d+1]+g)));if(0!==p){do{for(f=o-1;0===a.bl_count[f];)f--;a.bl_count[f]--,a.bl_count[f+1]+=2,a.bl_count[o]--,p-=2}while(p>0);for(f=o;0!==f;f--)for(d=a.bl_count[f];0!==d;)e=a.heap[--c],e>j||(i[2*e+1]!==f&&(a.opt_len+=(f-i[2*e+1])*i[2*e],i[2*e+1]=f),d--)}}function n(a,b,c){var d,e,f=new Array(W+1),g=0;for(d=1;d<=W;d++)f[d]=g=g+c[d-1]<<1;for(e=0;e<=b;e++){var h=a[2*e+1];0!==h&&(a[2*e]=k(f[h]++,h))}}function o(){var a,b,c,d,f,g=new Array(W+1);for(c=0,d=0;d>=7;d8?h(a,a.bi_buf):a.bi_valid>0&&(a.pending_buf[a.pending++]=a.bi_buf),a.bi_buf=0,a.bi_valid=0}function r(a,b,c,d){q(a),d&&(h(a,c),h(a,~c)),G.arraySet(a.pending_buf,a.window,b,c,a.pending),a.pending+=c}function s(a,b,c,d){var e=2*b,f=2*c;return a[e]>1;c>=1;c--)t(a,f,c);e=i;do c=a.heap[1],a.heap[1]=a.heap[a.heap_len--],t(a,f,1),d=a.heap[1],a.heap[--a.heap_max]=c,a.heap[--a.heap_max]=d,f[2*e]=f[2*c]+f[2*d],a.depth[e]=(a.depth[c]>=a.depth[d]?a.depth[c]:a.depth[d])+1,f[2*c+1]=f[2*d+1]=e,a.heap[1]=e++,t(a,f,1);while(a.heap_len>=2);a.heap[--a.heap_max]=a.heap[1],m(a,b),n(f,j,a.bl_count)}function w(a,b,c){var d,e,f=-1,g=b[1],h=0,i=7,j=4;for(0===g&&(i=138,j=3),b[2*(c+1)+1]=65535,d=0;d<=c;d++)e=g,g=b[2*(d+1)+1],++h=3&&0===a.bl_tree[2*ea[b]+1];b--);return a.opt_len+=3*(b+1)+5+5+4,b}function z(a,b,c,d){var e;for(i(a,b-257,5),i(a,c-1,5),i(a,d-4,4),e=0;e>>=1)if(1&c&&0!==a.dyn_ltree[2*b])return I;if(0!==a.dyn_ltree[18]||0!==a.dyn_ltree[20]||0!==a.dyn_ltree[26])return J;for(b=32;b0?(a.strm.data_type===K&&(a.strm.data_type=A(a)),v(a,a.l_desc),v(a,a.d_desc),g=y(a),e=a.opt_len+3+7>>>3,f=a.static_len+3+7>>>3,f<=e&&(e=f)):e=f=c+5,c+4<=e&&b!==-1?C(a,b,c,d):a.strategy===H||f===e?(i(a,(M<<1)+(d?1:0),3),u(a,ga,ha)):(i(a,(N<<1)+(d?1:0),3),z(a,a.l_desc.max_code+1,a.d_desc.max_code+1,g+1),u(a,a.dyn_ltree,a.dyn_dtree)),p(a),d&&q(a)}function F(a,b,c){return a.pending_buf[a.d_buf+2*a.last_lit]=b>>>8&255,a.pending_buf[a.d_buf+2*a.last_lit+1]=255&b,a.pending_buf[a.l_buf+a.last_lit]=255&c,a.last_lit++,0===b?a.dyn_ltree[2*c]++:(a.matches++,b--,a.dyn_ltree[2*(ja[c]+R+1)]++,a.dyn_dtree[2*g(b)]++),a.last_lit===a.lit_bufsize-1}var G=a("../utils/common"),H=4,I=0,J=1,K=2,L=0,M=1,N=2,O=3,P=258,Q=29,R=256,S=R+1+Q,T=30,U=19,V=2*S+1,W=15,X=16,Y=7,Z=256,$=16,_=17,aa=18,ba=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],ca=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],da=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],ea=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],fa=512,ga=new Array(2*(S+2));d(ga);var ha=new Array(2*T);d(ha);var ia=new Array(fa);d(ia);var ja=new Array(P-O+1);d(ja);var ka=new Array(Q);d(ka);var la=new Array(T);d(la);var ma,na,oa,pa=!1;c._tr_init=B,c._tr_stored_block=C,c._tr_flush_block=E,c._tr_tally=F,c._tr_align=D},{"../utils/common":62}],74:[function(a,b,c){"use strict";function d(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}b.exports=d},{}]},{},[10])(10)}); \ No newline at end of file diff --git a/packager.js b/packager.js deleted file mode 100644 index dd4fdf6..0000000 --- a/packager.js +++ /dev/null @@ -1,489 +0,0 @@ -/* -Copyright (c) 2020 Thomas Weber - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -window.Packager = (function() { - // @ts-ignore - const JSZip = window.JSZip; - // @ts-ignore - const Icns = window.Icns; - - const readAsDataURL = (blob) => new Promise((resolve, reject) => { - const fr = new FileReader(); - fr.onload = () => resolve(fr.result); - fr.onerror = () => reject(new Error('could not read as data url')); - fr.readAsDataURL(blob); - }); - - const readAsArrayBuffer = (blob) => new Promise((resolve, reject) => { - const fr = new FileReader(); - fr.onload = () => resolve(fr.result); - fr.onerror = () => reject(new Error('could not read as arraybuffer')); - fr.readAsArrayBuffer(blob); - }); - - const loadImage = (src) => new Promise((resolve, reject) => { - const image = new Image(); - image.onload = () => resolve(image); - image.onerror = () => reject(new Error(`Could not load image: ${src}`)); - image.src = src; - }); - - const canvasToBlob = (canvas) => new Promise((resolve, reject) => { - canvas.toBlob((blob) => { - if (blob) { - resolve(blob); - } else { - reject(new Error('Could not read as blob')); - } - }); // png is default type, quality is ignored - }); - - const isObject = (obj) => typeof obj === 'object' && obj !== null; - - const assetManifest = { - 'turbowarp': { - src: 'https://packagerdata.turbowarp.org/packager.e212db007a686ee5a5c1.js', - size: 3040000 // TODO get accurate number, it's complicated because of gzip - }, - 'nwjs-win64': { - src: 'https://packagerdata.turbowarp.org/nwjs-v0.49.0-win-x64.zip', - size: 97406745 - }, - 'nwjs-mac': { - src: 'https://packagerdata.turbowarp.org/nwjs-v0.49.0-osx-x64.zip', - size: 128684835 - } - }; - - const LOAD_ASSETS_FROM_LOCALHOST = false; - - const fetchManifestAsset = (assetName, progressCallback) => { - const manifestEntry = assetManifest[assetName]; - if (manifestEntry._data) { - return Promise.resolve(manifestEntry._data); - } - return new Promise((resolve, reject) => { - let {src, size} = manifestEntry; - if (LOAD_ASSETS_FROM_LOCALHOST) { - const srcURL = new URL(src); - src = srcURL.pathname; - } - const xhr = new XMLHttpRequest(); - xhr.responseType = 'blob'; - xhr.onload = () => { - if (xhr.status === 200) { - manifestEntry._data = xhr.response; - resolve(xhr.response); - } else { - reject(new Error(`Unexpected status code ${xhr.status} while downloading ${src}`)); - } - }; - xhr.onerror = () => reject(new Error('XHR failed')); - xhr.onprogress = (e) => { - progressCallback(e.loaded / size); - }; - xhr.onloadend = () => progressCallback(1); - xhr.open('GET', src); - xhr.send(); - }); - }; - - const fetch = (url) => window.fetch(url) - .then((response) => { - if (response.status !== 200) { - throw new Error(`Unexpected status code ${response.status} while fetching ${url}`); - } - return response; - }); - - /** - * @typedef {object} ProjectReference - * @property {string} data - * @property {string} type - */ - - class Project { - constructor(blob, type) { - this.blob = blob; - this.type = type; - } - - /** - * @returns {Promise} - */ - async asDataURL() { - return { - data: await readAsDataURL(this.blob), - type: this.type - }; - } - - /** - * @returns {Promise} - */ - async asFetchedFrom(path) { - // Environment is responsible for making sure the file will be available at the given path. - return { - data: path, - type: this.type - }; - } - } - - class Runtime { - setProgressTarget(progressTarget) { - /** @type {EventTarget} */ - this.progressTarget = progressTarget; - } - /** - * @param {ProjectReference} projectReference - */ - package(projectReference) { - throw new Error('Not implemented'); - } - } - - class Environment { - setRuntime(runtime) { - /** @type {Runtime} */ - this.runtime = runtime; - } - setProgressTarget(progressTarget) { - if (!this.runtime) { - throw new Error('setRuntime should be run before setProgressTarget'); - } - /** @type {EventTarget} */ - this.progressTarget = progressTarget; - this.runtime.setProgressTarget(progressTarget); - } - setProjectData(projectData) { - /** @type {Project} */ - this.projectData = projectData; - } - package() { - throw new Error('Not implemented'); - } - } - - class TurboWarp extends Runtime { - constructor(options) { - super(); - this.options = options; - } - async getJS () { - const res = await fetchManifestAsset('turbowarp', (progress) => { - this.progressTarget.dispatchEvent(new CustomEvent('turbowarp-progress', { - detail: progress - })); - }); - const src = await res.text(); - return src; - } - async package(projectReference) { - const stringify = (v) => { - if (typeof v === 'undefined') { - throw new Error('Undefined value'); - } - return JSON.stringify(v); - }; - const script = await this.getJS(); - return ` - - - - - - - - - - - - - - - - - - - -`; - } - } - - class HTML extends Environment { - async package() { - const packagerData = await this.runtime.package(await this.projectData.asDataURL()); - return { - data: packagerData, - filename: 'project.html', - }; - } - } - - class Zip extends Environment { - async package() { - const zip = new JSZip(); - const packagerData = await this.runtime.package(await this.projectData.asFetchedFrom('project.zip')); - zip.file('index.html', packagerData); - zip.file('project.zip', this.projectData.blob); - return { - data: await zip.generateAsync({ - type: 'blob', - compression: 'DEFLATE' - }), - filename: 'project.zip', - }; - } - } - - /** - * Convert a PNG to an Apple Icon Image (ICNS) file - * @param {Blob} pngData PNG image data. - */ - const pngToAppleICNS = async (pngData) => { - const FORMATS = [ - { type: 'ic04', size: 16 }, - { type: 'ic07', size: 128 }, - { type: 'ic08', size: 256 }, - { type: 'ic09', size: 512 }, - { type: 'ic10', size: 1024 }, - { type: 'ic11', size: 32 }, - { type: 'ic12', size: 64 }, - { type: 'ic13', size: 256 }, - { type: 'ic14', size: 512 }, - ]; - - // Read the Image. - const url = URL.createObjectURL(pngData); - const image = await loadImage(url); - if (image.width !== image.height) { - throw new Error('Image width and height do not match'); - } - const size = image.width; - - // Determine the formats to create - const eligibleFormats = FORMATS.filter((format) => { - // Always include the smallest size so that tiny images will get at least 1 image. - if (format.size === 16) { - return true; - } - return size >= format.size; - }); - - // Create a single canvas to be used for conversion - // Creating many canvases is prone to error in Safari - const canvas = document.createElement('canvas'); - const ctx = canvas.getContext('2d'); - if (!ctx) { - throw new Error('cannot get canvas rendering context'); - } - - const icns = new Icns.Icns(); - for (const format of eligibleFormats) { - // Use the canvas to scale the image. - const formatSize = format.size; - canvas.width = formatSize; - canvas.height = formatSize; - ctx.drawImage(image, 0, 0, formatSize, formatSize); - - const blob = await canvasToBlob(canvas); - const arrayBuffer = await readAsArrayBuffer(blob); - const icnsImage = await Icns.IcnsImage.fromArrayBuffer(arrayBuffer, format.type); - icns.append(icnsImage); - } - - return icns.data; - }; - - class NWjs extends Environment { - constructor({ platform, manifest, icon }) { - super(); - try { - this.manifest = JSON.parse(manifest); - } catch (e) { - throw new Error(`NW.js manifest is invalid JSON (${e}}`); - } - if (!isObject(this.manifest)) { - throw new Error('NW.js manifest not an object'); - } - if (typeof this.manifest.name !== 'string') { - throw new Error('NW.js manifest is missing or has incorrect type for field: name'); - } - if (/[\/\\]/g.test(this.manifest.name)) { - throw new Error('NW.js manifest name contains invalid characters'); - } - if (typeof this.manifest.main !== 'string') { - throw new Error('NW.js manifest is missing or has incorrect type for field: main'); - } - if (!isObject(this.manifest.window)) { - throw new Error('NW.js manifest is missing or has incorrect type for field: window'); - } - if (typeof this.manifest.window.icon !== 'string') { - throw new Error('NW.js manifest is missing or has incorrect type for field: window.icon'); - } - this.platform = platform; - this.icon = icon; - } - async package() { - const isWindows = this.platform === 'win64'; - const isMac = this.platform === 'mac'; - if (!(isWindows || isMac)) { - throw new Error('invalid platform'); - } - - const packagerData = await this.runtime.package(await this.projectData.asFetchedFrom('project.zip')); - - const nwjsData = await fetchManifestAsset(`nwjs-${this.platform}`, (progress) => { - this.progressTarget.dispatchEvent(new CustomEvent('nwjs-progress', { - detail: progress - })); - }); - const nwjsZip = await JSZip.loadAsync(nwjsData); - // NW.js Windows folder structure: - // * (root) - // +-- nwjs-v0.49.0-win-x64 - // +-- nw.exe (executable) - // +-- credits.html - // +-- (project data) - // - // NW.js macOS folder structure: - // * (root) - // +-- nwjs-v0.49.0-osx-64 - // +-- credits.html - // +-- nwjs.app - // +-- Contents - // +-- Resources - // +-- app.icns (icon) - // +-- app.nw - // +-- (project data) - // +-- MacOS - // +-- nwjs (executable) - // +-- ... - - // the first folder, something like "nwjs-v0.49.0-win-64" - const nwjsPrefix = Object.keys(nwjsZip.files)[0].split('/')[0]; - - // constructor checks to make this is reasonably safe - const appName = this.manifest.name; - - const zip = new JSZip(); - for (const path of Object.keys(nwjsZip.files)) { - const file = nwjsZip.files[path]; - - let newPath = path.replace(nwjsPrefix, appName); - - if (isMac) { - newPath = newPath.replace('nwjs.app', `${appName}.app`); - } else if (isWindows) { - newPath = newPath.replace('nw.exe', `${appName}.exe`); - } - - // This internal hackery improves performance. - // Without this, generating the zip would take a very long time. - zip.files[newPath] = file; - } - - let dataPrefix; - if (isMac) { - const icnsData = await pngToAppleICNS(this.icon); - zip.file(`${appName}/${appName}.app/Contents/Resources/app.icns`, icnsData); - dataPrefix = `${appName}/${appName}.app/Contents/Resources/app.nw/`; - } else { - dataPrefix = `${appName}/`; - } - - zip.file(dataPrefix + this.manifest.main, packagerData); - zip.file(dataPrefix + 'project.zip', this.projectData.blob); - zip.file(dataPrefix + this.manifest.window.icon, this.icon); - zip.file(dataPrefix + 'package.json', JSON.stringify(this.manifest)); - - return { - data: await zip.generateAsync({ - type: 'blob', - compression: 'DEFLATE', - // Use UNIX permissions so that executable bits are properly set, which matters for macOS - platform: 'UNIX', - }), - filename: `${appName}.zip`, - }; - } - } - - return { - assetManifest, - Project, - runtimes: { - TurboWarp - }, - environments: { - HTML, - Zip, - NWjs, - }, - }; -}()); diff --git a/parseoptions.js b/parseoptions.js deleted file mode 100644 index 0131657..0000000 --- a/parseoptions.js +++ /dev/null @@ -1,174 +0,0 @@ -/* -Copyright (c) 2020 Thomas Weber - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -window.O = (function() { - const options = Object.create(null); - - const setOption = (name, value) => { - // name supports "a.b.c" syntax - const parts = name.split('.'); - const last = parts.pop(); - let target = options; - for (const part of parts) { - if (typeof target[part] === 'undefined') { - target[part] = Object.create(null); - } - target = target[part]; - } - target[last] = value; - }; - - const onchange = (e) => { - const target = e.target; - const name = target.name; - const value = getValue(target); - setOption(name, value); - setLocalValue(name, value); - - if (options.onchange) { - options.onchange(); - } - }; - - const getValue = (el) => { - const tag = el.tagName.toLowerCase(); - - if (tag === 'select') { - return el.value; - } - - if (tag === 'textarea') { - return el.value; - } - - if (tag === 'input') { - switch (el.type) { - case 'number': - return +el.value; - case 'text': - case 'radio': - case 'color': - return el.value; - case 'checkbox': - return el.checked; - case 'file': - return el.files[0] || null; - default: - console.warn('Unknown type', el); - } - } - }; - - const setValue = (el, value) => { - const tag = el.tagName.toLowerCase(); - - if (tag === 'select') { - el.value = value; - } - - if (tag === 'textarea') { - el.value = value; - } - - if (tag === 'input') { - switch (el.type) { - case 'text': - case 'number': - case 'color': - el.value = value; - break; - case 'radio': - el.checked = el.value === value; - break; - case 'checkbox': - el.checked = value; - break; - default: - console.warn('Unknown type', el); - } - } - }; - - /** - * Returns all possible values for an HTML element - * @returns {string[]|null} list of possible values, or null if all values are possible - */ - const getPossibleValues = (el) => { - const tag = el.tagName.toLowerCase(); - - if (tag === 'select') { - return Array.from(el.options).map(i => i.value) - } - - if (tag === 'input' && el.type === 'radio') { - return Array.from(document.getElementsByName(el.name)).map(i => i.value); - } - - return null; - }; - - const setLocalValue = (name, value) => { - try { - localStorage.setItem(`opt:${name}`, JSON.stringify(value)); - } catch (e) { - // ignore - } - }; - - const getLocalValue = (name) => { - try { - const v = localStorage.getItem(`opt:${name}`); - if (v !== null) { - return JSON.parse(v); - } - } catch (e) { - // ignore - } - return null; - }; - - const inputs = document.querySelectorAll('input, select, textarea'); - for (const input of inputs) { - const name = input.name; - if (!name) continue; - - const defaultValue = getValue(input); - const localValue = getLocalValue(name); - const possibleValues = getPossibleValues(input); - - let value = defaultValue; - if (typeof value !== 'object' && localValue !== null && typeof localValue === typeof value) { - if (possibleValues === null || possibleValues.includes(localValue)) { - value = localValue; - setValue(input, value); - } - } - - input.addEventListener('change', onchange); - - const isRadio = input.tagName.toLowerCase() === 'input' && input.type === 'radio'; - if (isRadio) { - if (input.checked) { - setOption(name, value); - } - } else { - setOption(name, value); - } - }; - - return options; -}());